Conceptintro
Evasion attack
Also called test-time attack.
An attack that changes inputs at test time so that a trained classifier misclassifies them, in a white-box or black-box setting.
An evasion attack changes an input at test time so that a trained model gives it a wrong label, without any change to the model or its training data. The output of the attack is an adversarial example. Biggio et al. (2013) stated evasion as an optimization problem against an explicit adversary, and Biggio and Roli (2018) describe every attack by three parts: the goal, the knowledge and the capability. The class covers attacks with full access to the gradients, attacks that see only the scores or only the labels, and attacks that use a second model. On the defense side, an evasion attack is the tool that measures robustness: it gives an upper bound on robust accuracy, while certificates give the lower bound. An attack on the training data instead is data poisoning.
In plain words
A spam filter or an image classifier is trained once and then used on new inputs. An attacker who controls an input can change it a little, so that it still does its job for the attacker but the model now says "harmless" or names the wrong object. This is an evasion attack.
How the attacker searches depends on what the attacker can see. With a copy of the model, the attacker can ask which small change raises the error most. With only the answers of the model, the attacker must try many inputs and learn from the results. With nothing, the attacker can train a similar model and hope that its tricks work on the real one.
Defenders use these attacks to test their models. A model that resists strong attacks of every kind is more robust, but only a proof shows that no attack exists.
The idea
The threat model. Let the model have logits and label on inputs , with a loss . Following Biggio and Roli (2018), an evasion attack fixes:
- The goal. Untargeted (any wrong label) or targeted (a chosen label ). The violation is of integrity: the model still works on other inputs.
- The knowledge. White box (the parameters and the gradients), gray box (the training data or the architecture, but not ), black box with scores (the vector of probabilities for each query), or black box with decisions (only the label for each query).
- The capability. Changes at test time only, within a set , usually for a norm and a radius . In some domains the set is different: a malware file can get new parts but cannot lose the parts it needs to run.
Two forms of the problem. With a fixed budget, the attacker solves
and succeeds if the maximizer has a wrong label. FGSM and the PGD attack work in this form. With a minimal budget, the attacker solves
and DeepFool and the Carlini-Wagner attack work in this form. Biggio et al. (2013) minimize the score of the classifier under a distance limit and add a term that keeps near the dense regions of the data of the target class, so that the result looks like normal data.
How the knowledge sets the method.
| knowledge | what the attacker can compute | attacks |
|---|---|---|
| white box | and the Jacobian of | FGSM, PGD attack, Carlini-Wagner attack, DeepFool, JSMA |
| black box with scores | finite differences of the scores | ZOO attack |
| black box with decisions | labels of chosen inputs | boundary attack |
| gray box or none | a substitute model trained by the attacker | transfer, see adversarial transferability |
Less knowledge costs queries, not always success. On a smooth model, a score-based or decision-based attack can reach nearly the same distance as a white-box attack, but it needs hundreds or thousands of queries where the white-box attack needs a few gradients.
What an attack proves. If the attack finds with , then is not robust at radius . So the fraction of test points that resist a given attack is an upper bound on the robust accuracy. If the attack fails, nothing is proved. A defense can make gradient attacks fail without making the model robust, for example by gradients that vanish or are noisy ("gradient masking"). Athalye, Carlini and Wagner (2018) found this in 7 of the 9 defenses of ICLR 2018 that they studied, and broke them. Carlini et al. (2019) ask for adaptive evaluations: attacks designed for the defense, with the threat model stated, many restarts, and a check that unbounded attacks reach 100 percent success.
The defenses.
- Robust training. Adversarial training minimizes the loss at the worst point of found by PGD. It is the empirical defense that has held up best.
- Certified methods. Randomized smoothing, interval bound propagation and linear bound propagation prove for each input that no change in changes the label. Complete verification is the neural network verification problem.
- Detection and input changes. Many detectors and input transformations were broken by adaptive attacks, for example with BPDA or EOT. Defensive distillation is the classic case.
- Limits on the attacker. Fewer queries, labels without scores, or rate limits make black-box attacks slower. They do not stop transfer attacks.
Examples
One model, four kinds of knowledge. Take the linear model of the page adversarial example: , with rows , , , and with label . The minimal distance to another label is . The four attacks of this area, run with the code of their pages on this model:
| attack | knowledge | cost | distance found | ratio to |
|---|---|---|---|---|
| DeepFool, overshoot 0.02 | white box | 1 Jacobian, 2 logit calls | 0.14425 | 1.020 |
| Carlini-Wagner, 8 rounds of 100 Adam steps | white box | 800 gradients | 0.14143 | 1.00003 |
| ZOO, 400 steps, , | scores | 1200 queries | 0.14326 | 1.013 |
| boundary attack, 200 steps, start | decisions | 297 queries | 0.14146 | 1.0002 |
All four find an adversarial example close to the minimum. The white-box attacks need almost no queries. The black-box attacks need hundreds, and on a model in thousands of dimensions they need many more. These are measurements on one tiny model with fixed seeds, not a general ranking.
Capability: add only, or add and remove. A made-up detector scores binary features with weights and bias , and flags an input when the score is above . The input has score and is flagged. If the attacker may only add features (set a to ), the best order adds the most negative weights first: after feature 5 the score is , after feature 4 it is , and after feature 3 it is , which is not above . So three changes are needed. If the attacker may also remove features, removing feature 1 and adding feature 5 gives with two changes. The same model is more or less robust depending on the capability. Biggio et al. (2013) used an add-only capability for PDF malware, where removing content can break the file.
A transfer attack. Two logistic models trained on different seeded samples of the same Gaussian blobs in 8 dimensions agree on the signs of all 8 weights. FGSM at in against the first model changes the label of 79 of 198 test points on that model and of 90 on the second model, which the attacker never queried. The details are on the page adversarial transferability.
Where it is used
- Security evaluation of classifiers. Spam filters, malware detectors and intrusion detectors face attackers who adapt their inputs. Biggio and Roli (2018) trace this work back to spam filtering in 2004 and 2005. An evaluation states the threat model and reports the success rate of the strongest attacks for it.
- Robustness benchmarks. Published robust accuracy numbers are upper bounds from a fixed set of attacks, so they can only go down when a stronger attack appears.
- Robust training. The inner step of adversarial training is an evasion attack, usually PGD, run on each training batch.
- Tests of a defense. An adaptive attack that targets the specific defense is the standard check of a new defense (Carlini et al. 2019). Defensive distillation passed the attacks of its own paper and failed the Carlini-Wagner attack.
- The physical world. Changes that survive printing, cameras and viewpoints are found by averaging the attack over random transformations (expectation over transformation).
References
- 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), the gradient descent evasion with a mimicry term, and the experiments on handwritten digits and PDF malware
- 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, the taxonomy of attacks at training and test time, and the history
- Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow and Rob Fergus, Intriguing properties of neural networks, ICLR 2014, Section 4 (adversarial examples of deep networks and their transfer)
- Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z. Berkay Celik and Ananthram Swami, Practical black-box attacks against machine learning, AsiaCCS 2017, pages 506 to 519, the substitute model trained on labels from queries, and the transfer of its adversarial examples
- Wieland Brendel, Jonas Rauber and Matthias Bethge, Decision-based adversarial attacks, reliable attacks against black-box machine learning models, ICLR 2018, the taxonomy of gradient-based, score-based, transfer-based and decision-based attacks
- Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, Aleksander Madry and Alexey Kurakin, On evaluating adversarial robustness, arXiv 2019, the threat model of an evaluation, adaptive attacks, and the checklist of common flaws
- Anish Athalye, Nicholas Carlini and David Wagner, Obfuscated gradients give a false sense of security, circumventing defenses to adversarial examples, ICML 2018, the three kinds of obfuscated gradients and the attacks that break defenses based on them
Where this leads
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 3BJ34P Edit this page History Report an error Markdown