Skip to content
All apps

Adversarial examples

About this app

A real MobileNet in the browser is fooled by an FGSM attack: an ε slider mixes gradient noise invisible to humans into the image until the label flips — alongside, the Adelson checkerboard shows the blind spots of humans. With webcam, drag & drop and procedural test images; a bridge to the robustness of camera-based quality inspection in the supply chain.

Optical illusions for machines

An adversarial example is an input image with a deliberately computed perturbation, practically invisible to humans, that changes a neural network’s decision. The fast gradient sign method (FGSM) computes the gradient of the model output with respect to the input pixels. The sign of that gradient tells each pixel which direction shifts the result most. The perturbation is ε·sign(gradient); even small ε can flip the class. For camera-based inspection this means robustness tests, controlled capture conditions and monitoring of confidence values are needed.

What the app shows

A real MobileNet with ImageNet labels runs in the browser. Image sources are procedural test images (box, traffic light, clock), the webcam or your own image via drag and drop; everything stays local. Original, perturbation (shown amplified twenty times) and perturbed image sit side by side, each with its classification. If the gradient is unavailable on a device, a demo mode shows a substitute noise pattern while the classification stays real. A comparison panel adds the Adelson checkerboard and a table of human and CNN blind spots.

Try it yourself

Raise ε slowly and note the value at which the label flips while the perturbed image looks unchanged to you. Try different images: some classes flip earlier than others. Then open the Adelson checkerboard and reveal the proof. The table sums it up: humans are robust to pixel noise but fooled by shadows; for CNNs it is often the other way round.

Frequently asked questions

What is an adversarial example?
An adversarial example is an input deliberately modified so that a machine learning model misclassifies it. For images the change is often so small that humans see no difference. It shows that neural networks rely on different features than human vision.
How does the fast gradient sign method (FGSM) work?
FGSM computes the gradient of the model output with respect to the input pixels and keeps only its sign. This pattern is multiplied by a small strength ε and added to the image. A single gradient step thus produces a perturbation that shifts the model’s decision markedly.
How can neural networks be protected against adversarial attacks?
A common approach is adversarial training, where perturbed examples are added to the training data. Robustness testing, input preprocessing and monitoring of confidence values help as well. There is no complete protection so far.
Are my images uploaded by the app?
No. Webcam frames and your own images stay in the browser, and the MobileNet runs there too. Only the model itself is downloaded.

Subject: Perception & Illusion

More from Perception & Illusion

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps