Definitionintro
Adversarial example
Also called adversarial perturbation.
An input in an allowed small set around a correctly classified input, such as an l_p ball, to which the model gives a wrong label. The set is part of the threat model.
An adversarial example is an input that is close to a correctly classified input , in a set of allowed changes fixed in advance, and that the model labels wrongly. The changes are often too small for a person to see, yet they move the input across the decision boundary of the model. Biggio et al. (2013) and Szegedy et al. (2014) found such inputs for trained classifiers with gradient steps, and Goodfellow, Shlens and Szegedy (2015) explained them by the near-linear behavior of the models in high dimension. An evasion attack is a method that finds them; adversarial training and certified methods are the defenses. "Close" has no meaning without a threat model, so the definition below names the set of allowed changes explicitly.
Definition
A classifier with classes has logits and predicts , with ties going to the smallest index. Inputs are in . For and a radius , the set of allowed inputs around is
Here counts the nonzero coordinates of ; it is not a norm, since .
Definition (untargeted). Let have the true label and let . An input is an adversarial example for at radius in if and . The vector is its perturbation.
Definition (targeted). For a target class , is a targeted adversarial example if and .
Definition (robustness). The point is robust at radius in if no adversarial example for exists in . The minimal adversarial distance is . If , then is robust at radius . The robust accuracy of at radius on a test set is the fraction of test points with for every .
Three remarks fix the reading of the definition:
- The threat model is part of the definition. The norm , the radius and the box define what counts. An input is an adversarial example only relative to a stated set. Biggio and Roli (2018) put this set in the capability of the attacker, next to the goal (untargeted or targeted) and the knowledge (white box, gray box, black box with scores, black box with decisions).
- The true label is assumed to stay in the set. The set is chosen small enough that a person would give the same label as . This is a modeling assumption, not a theorem. A change that turns a "3" into a real "8" is not an adversarial example, even though the model changes its label.
- The start must be correct. If already, the model is simply wrong at . Some papers, such as Szegedy et al., define the condition as instead of . The two agree when . Say which one a number uses.
Bounds. An attack that finds an adversarial example proves that is not robust, so attacks give an upper bound on robust accuracy. A verifier or a certificate, such as randomized smoothing or interval bound propagation, proves that no adversarial example exists, so it gives a lower bound. A failed attack proves nothing.
Proposition (linear models). Let with when and otherwise, , and ignore the box. Then and .
Proof. Changing the label needs to reach when the label is , or to pass it when the label is . So is needed, and by Hölder's inequality with . So . The vectors and , with the sign of chosen to move toward the boundary, attain equality in the two cases, and a slightly longer step crosses the boundary.
The case shows the linear explanation of Goodfellow, Shlens and Szegedy. The change of the logit is , which grows with the number of coordinates: if every is about , it is about . In high dimension, many changes that are each too small to see add up to a large change of the output.
Examples and non-examples
A linear model in the plane, three norms. Take , with rows , and , and with . Then . The label becomes once . Class is far away.
| norm | a perturbation that reaches it | |
|---|---|---|
| with just above | ||
| with just above | ||
| change one coordinate, for example to |
The point , found by one step of DeepFool, is an adversarial example in at every radius . At in , no adversarial example exists, because . The same pair is far apart in (two changed coordinates) and close in (). So the norm decides which inputs count.
A logistic model in six dimensions, with the box. Let , , and . The logit is . The fast gradient sign method at in gives with , so is an adversarial example. Coordinates 4 and 5 cannot move, because the box stops them at and . So the box matters: without it, ; with it, only the other four coordinates can move, and .
A non-example: a radius that is too small. In the same model at , the smallest logit in is . FGSM is exact for a linear model (see its page), so this is a proof: no adversarial example exists, and is robust at this radius.
A non-example: a change outside the set. The input changes one coordinate by and has logit , a wrong label. At in it is not an adversarial example, because it is not in . In with it is one.
A non-example: random noise. A change of the same size in a random direction rarely changes the label. On two logistic models in 8 dimensions trained on seeded Gaussian blobs (the measurement on the page adversarial transferability), random sign noise of size in changed the label of 5 of 198 test points, while the FGSM change of the same size changed 90. Adversarial examples are rare in volume but easy to find with the gradient.
A non-example: a point that is already wrong. If , then itself has the wrong label, and no search is needed. It counts against clean accuracy, not as an adversarial example.
An example in . The Jacobian saliency map attack changes few coordinates by a large amount. On the six-feature model of its page it reaches the target class with four changed features, so while .
Related definitions
- Evasion attack. The class of methods that find adversarial examples at test time. Each one fixes the goal, the knowledge and the set .
- Minimal perturbation. The attacks DeepFool and the Carlini-Wagner attack estimate from above. The attacks with a fixed radius, FGSM and the PGD attack, test membership of a set instead.
- Universal adversarial perturbation. One vector that changes the label of many inputs at once, in contrast to an chosen for each .
- Adversarial transferability. An adversarial example for one model is often one for another model trained on similar data.
- Certified radius. A lower bound on with a proof, from randomized smoothing (with a stated probability), interval bound propagation or linear bound propagation. The exact question is the neural network verification problem.
- Training-time attacks. Data poisoning and backdoor attacks change the training data, not the test input. A backdoor trigger is a test-time change too, but it works because the training was changed.
- Robust training. Adversarial training minimizes the loss at the worst point of , which lowers the number of adversarial examples for the training distribution.
References
- Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow and Rob Fergus, Intriguing properties of neural networks, ICLR 2014, Section 4 (the box-constrained minimal perturbation that changes the label, found with L-BFGS)
- Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndic, Pavel Laskov, Giorgio Giacinto and Fabio Roli, Evasion attacks against machine learning at test time, ECML PKDD 2013, LNCS 8190, pages 387 to 402, the adversary model (goal, knowledge, capability) and the gradient-based evasion of a classifier at test time
- Ian J. Goodfellow, Jonathon Shlens and Christian Szegedy, Explaining and harnessing adversarial examples, ICLR 2015, Section 3 (the linear explanation, with the perturbation eta of l_infinity norm at most epsilon)
- Battista Biggio and Fabio Roli, Wild patterns: Ten years after the rise of adversarial machine learning, Pattern Recognition 84, pages 317 to 331, 2018, the threat model in three parts and the history of evasion attacks since the work on spam filters
- Nicholas Carlini and David Wagner, Towards evaluating the robustness of neural networks, IEEE Symposium on Security and Privacy 2017, pages 39 to 57, the l_0, l_2 and l_infinity distance metrics and the targeted definition
- Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras and Adrian Vladu, Towards deep learning models resistant to adversarial attacks, ICLR 2018, Section 2 (the set of allowed perturbations and the robust objective)
Where this leads
- Transferability of adversarial examples
- Backward pass differentiable approximation
- Boundary attack
- Carlini-Wagner attack
- DeepFool
- Evasion attack
- Expectation over transformation
- Fast gradient sign method
- Greedy coordinate gradient attack
- Interval bound propagation
- Jacobian-based saliency map attack
- Linear bound propagation
- Model extraction attack
- Neural network verification
- Randomized smoothing
- Universal adversarial perturbation
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag ZJAKP2 Edit this page History Report an error Markdown