Adversarial examples: how tiny changes fool image classifiers
10 questions on adversarial images, the fast gradient sign method, why attacks transfer, physical attacks and why the problem is not just overfitting.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
An attacker builds an adversarial image against network A and then shows it to a differently designed network B, trained on similar data. What is likely?
- Network B will certainly classify it correctly
- Network B is often fooled too
- Network B will crash
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
Take a photograph that a network labels correctly as a bicycle with moderate confidence. Add a faint pattern of noise, so faint that you cannot tell the new picture from the old, and the same network now declares it a toaster with near certainty. This is not a rare glitch or a quirk of one model. It is an adversarial example, and it shows that image classifiers can be made to fail by changes that no human would notice. That has implications for every system in which a network's answer is trusted.
This quiz explains how such examples are made and what they teach. The recipe is surprisingly simple and uses a tool you already know: the gradient. In training, the gradient tells you how to change the weights to lower the error. In an attack, the weights stay fixed and the gradient is taken with respect to the pixels instead, which tells the attacker how to change the picture to raise the error. You will see the simplest version, in which every pixel is nudged by the same tiny amount in the direction the gradient indicates, and you will see why a small nudge is the whole point.
The quiz then asks what the phenomenon means. Is it just overfitting, a high-capacity model latching on to the exact image? The evidence says no: examples crafted for one network tend to fool others, and even simple linear models can be fooled. You will meet attacks that leave the screen altogether, using physical objects such as altered road signs, and look at what is known about defences. The honest answer is that simple attacks can be countered by modest changes to training, but stronger attacks are harder to defeat, and the problem remains open.
Some beliefs deserve scepticism. Many people assume a confident answer is a reliable one, which these examples refute. Others assume that the vulnerability belongs to one architecture or that it is purely a computer-screen matter. And some assume a fix has been found, when the research is still active. The subject is also a useful antidote to overconfidence. A model that scores very well on a test set has shown that it works on data drawn from the same source as its training data. It has not shown that it works against someone who is deliberately probing it for weaknesses, and these are different claims. Anyone who deploys a network in a setting where an adversary has a reason to interfere, from content filtering to access control, needs to treat robustness as a separate requirement, to be tested separately, instead of assuming that it follows from accuracy.
The quiz suits learners interested in the security and robustness of machine learning, and practitioners deploying vision systems. It needs no mathematics. There are 10 questions, each with an explanation, and it takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation follows every answer, so the quiz works as a short primer on the subject.
›Do I need to be a security expert?
No. The quiz explains the idea in plain terms. If you know that a network turns an image into class probabilities, and that training uses gradients, you have the background needed to follow the questions.
›What is an adversarial attack on an image classifier?
It is a deliberate, very small modification of an image, small enough to be imperceptible to a person, that makes the network assign the wrong label. The modified image looks the same to us, but to the network it may belong to a completely different class, sometimes with very high confidence.
›How does the fast gradient sign method work?
It changes every pixel of an image by one fixed small amount, and for each pixel the direction of the change, plus or minus, is given by the sign of the gradient of the error with respect to that pixel. The gradient comes from backpropagation, with the trained weights held fixed. The result is an image on which the network's error is larger.
›How is this related to ordinary training?
It is the mirror image. In training, the weights are adjusted to minimise the error for the given images. In an attack, the weights are held fixed and the image is adjusted to maximise the error. Both use the same tool, the gradient, and the same backpropagation computation delivers it.
›Is the problem caused by overfitting?
It might seem so, with a very flexible model adapted precisely to the specific image. But an example designed for one network often gives wrong answers when shown to other networks, and similar results can be obtained with much less flexible linear models. So the weakness is more general than overfitting in one model.
›Can adversarial examples exist outside the computer?
Yes. It is possible to create physical objects with carefully designed modifications that trained networks robustly mistake for something else when the objects are photographed in the ordinary way. This raises safety concerns for systems that rely on image recognition to decide what to do, such as the camera-based perception of a vehicle or a robot, where a wrong but confident label can lead to a wrong action.
›Are there defences?
Basic attacks can be dealt with by simple changes to the training process. More sophisticated attacks are harder to defeat. Understanding the full implications of the phenomenon, and finding reliable ways to reduce the risk, remains an open area of research, so no system should be assumed immune.