Adversarial Attack Lab
Add a few invisible pixels of noise to a photo and watch a real image classifier change its mind, live in your browser.
This tool is being built. It will run right here, in your browser.
How it works
Method
Pick a sample photo or load your own, and a real MobileNet classifier labels it in your browser. Then attack it: FGSM takes one gradient step, PGD takes many small steps and is stronger, and a targeted attack pushes the image toward a class you choose, such as a toaster. You can also paint noise by hand and watch the top five predictions drain away as you go. Three panels show the original, the amplified noise and the attacked image, which still looks the same to you. Then try simple defences, JPEG compression, blur and resizing, and see whether the label comes back.
Data
Six sample photos that are public domain or CC0, credited below, plus any photo you load. Your photo is read in your browser only; it is never uploaded or stored. The only thing fetched over the network is the model's own weights, once, when the tool opens.
Model
MobileNet v1, a real pretrained image classifier, run with TensorFlow.js. Because it is a Keras layers model, its gradients flow back to the input pixels, so the FGSM, PGD, targeted and paint attacks are all computed from the real gradients, not faked. A quarter size version loads on phones.
Build
The model runs on the GPU through WebGL where it can, and on the CPU otherwise. The attacks, the defences and the noise measurements are handwritten TypeScript. The image, the attacks and the predictions all stay in your browser, so nothing you load is sent anywhere.