Paper commentary
Towards Deep Learning Models Resistant to Adversarial Attacks
Min-max training makes networks resist adversarial attacks
- Problem Standard training minimizes average loss, so small crafted input changes can flip predictions unchecked. Earlier defenses did not state which guarantee they gave, or whether an attack had found the worst input.
- Method The authors frame robustness as a min-max problem. The inner step is a PGD attack that repeats signed gradient steps and projects back into the allowed set, and the outer step trains on those adversarial inputs.
- Results On MNIST, the adversarially trained network kept 89.3% accuracy under 100-step PGD with 20 restarts. Natural accuracy was 98.8% for the same network under 40-step PGD.
Why small input changes fool trained networks
A classifier can be very effective on benign inputs and still be pushed into a wrong output by a crafted input. Adversarial examples can fool state-of-the-art networks with high confidence, even when the original example was classified correctly. The change that does this is imperceptible to a human, which the authors take as a sign that current models don't learn the underlying concepts in a robust way.
Many attack and defense methods exist, including defensive distillation and feature squeezing. But these methods don't tell us which guarantee they provide, and we can't be sure an attack has found the most adversarial input. So the authors ask how deep networks can be trained to stay correct on adversarial inputs, and they start from the guarantee a robust model should satisfy rather than from any single attack.
The saddle point view of robust training
The key idea is to write robust training as a single min-max problem, in which the attacker picks a perturbation inside an allowed set and the learner picks parameters that do well against that worst case. Formally, the authors minimize \( \rho(\theta) = \mathbb{E}_{(x,y)\sim D}\big[\max_{\delta\in S} L(\theta, x+\delta, y)\big] \) over the parameters \( \theta \).
The inner maximization is an attack on a fixed network, and the outer minimization is adversarial training.
For image classification, the allowed set \( S \) is an \( \ell_\infty \) ball around each input, and the paper focuses on \( \ell_\infty \)-bounded attacks. The reason to expect this to work is the guarantee it gives: if the adversarial loss is small, no allowed attack can fool the network. The same formulation also covers earlier work, since FGSM can be read as a one-step attempt at the inner problem and adversarial training as the outer problem.
How FGSM, PGD and FGSM training fit together
FGSM takes one step of size \( \varepsilon \) along the sign of the input gradient, giving \( x + \varepsilon\,\mathrm{sgn}(\nabla_x L(\theta, x, y)) \). PGD repeats a signed gradient step of size \( \alpha \) and projects back onto the allowed set after each step, so that \( x^{t+1} = \Pi_{x+S}(x^t + \alpha\,\mathrm{sgn}(\nabla_x L(\theta, x, y))) \).
PGD is therefore the multi-step version of the same sign-gradient idea, and the authors treat it as the main inner solver.
On the defense side, training with FGSM examples is a linearized one-step version of the inner problem. Earlier min-max training work also used one-step adversaries, and the authors instead work with multi-step methods. They see the multi-step training as a more exhaustive approximation of the inner maximization, which is why the rest of the paper centers on PGD.
Is the inner maximization really hard?
A highly non-concave loss suggests the inner problem should be intractable, which is why prior work linearized it. The authors instead restart PGD from many random points in the \( \ell_\infty \) balls around evaluation examples and watch where it ends up. In their runs the loss rises quickly and then plateaus, and the final values cluster tightly, especially on CIFAR10.
They checked the spread with 105 restarts per example, and the final losses formed a concentrated distribution with no extreme outliers. Adversarially trained networks reached final losses clearly smaller than those of standard networks. Distances between local maxima stayed close to those between random points in the ball, so the maxima are distinct yet similar in value.
The authors draw from this that the inner problem is tractable for first-order methods, based on experiments rather than a proof.
Why first-order attacks are the target
If PGD reliably finds high-loss points, then a stronger attack using only input gradients should not find much better ones. The authors conjecture exactly this, and they treat it as a hypothesis that their experiments support rather than a result they proved. Their argument is that ERM-style training is driven by first-order methods, so first-order attacks are a natural class to defend against.
Black-box transfer attacks are weaker still, because the adversary only sees the rough architecture and training data. The authors observed that more capacity and stronger training adversaries both improve resistance to transfer attacks. For their best models, resistance to transfer attacks is larger than resistance to the strongest first-order attacks.
Computing the gradient for robust training
The outer problem needs the gradient of \( \rho(\theta) \), and the authors use the gradient of the loss at an inner maximizer for it. In practice this means replacing each input by its adversarial perturbation and training normally on the perturbed input with SGD.
Danskin's theorem would justify this direction for continuously differentiable functions, since the gradient at a maximizer is then a descent direction. But ReLU and max-pooling units make the network not continuously differentiable, and the inner maximizers are only approximate. Even so, SGD on these gradients lowered the adversarial loss steadily during training, which the authors read as evidence that the saddle point problem is being solved.
How network capacity changes robustness
The authors argue that a robust decision boundary must enclose the attack balls around the data, which is more complicated than one that only separates benign points. For MNIST they doubled the filters and the fully connected layer, starting from 2 and 4 convolutional filters and a hidden layer of 64 units. For CIFAR10 they widened a ResNet by a factor of 10, into 5 residual units with 16, 160, 320, 640 filters, and that network reaches 95.2% on natural examples.
Capacity alone raises robustness to one-step perturbations for networks trained on natural examples, and the effect is larger for smaller ε. FGSM training fails for large ε because of label leaking, where the network overfits to the small set of FGSM examples. Small networks trained against PGD can collapse to predicting one fixed class, while the value of the saddle point problem drops as capacity grows.
Larger capacity and stronger adversaries also reduce transferability, as the gradient correlation between source and target networks becomes weaker.
MNIST results under white-box and transfer attacks
The MNIST network uses two convolutional layers with 32 and 64 filters, 2×2 max-pooling and a fully connected layer of 1024 units. It is trained and tested with ε = 0.3, using PGD with 40 iterations and a step size of 0.01 in the \( \ell_\infty \) norm. A network trained only on natural examples reaches 99.2%, but FGSM drops it to 6.4%, which shows why natural accuracy alone says little about robustness.
For the adversarially trained network, 40-step PGD with one restart keeps 93.2% accuracy, compared to 98.8% on natural examples. Stronger PGD settings lower accuracy further, to 89.3% for 100 steps with 20 restarts, but the drop stays modest. Against an independently trained copy of the network, 100-step PGD with 20 restarts still leaves 95.7%.
Black-box attacks from the transfer copies keep accuracy above 95%, which fits the expectation that transfer attacks are weaker. So the MNIST result holds across several white-box and transfer sources, although the strongest entries are all for ε = 0.3 only.
CIFAR10 results and the remaining gap
For CIFAR10, the networks were trained with PGD using 7 steps of size 2 and a total ε = 8.
Under 20-step PGD the adversarially trained network reaches 45.8%, compared to 87.3% on natural examples. Under 7-step PGD from the independent copy, accuracy is 64.2%, which is still well below the natural accuracy.
Other perturbation sizes and l2 attacks
The authors sweep the attack strength with 100 PGD steps and a step size of 2.5·ε/100, so the attack can reach the boundary of the ε-ball. For ε at or below the training value, the networks keep equal or higher accuracy.
For l2-bounded attacks on MNIST, PGD fails to find adversarial examples even at ε = 4.5. The authors suspect the learned threshold filters mask the loss gradient, so PGD overestimates l2 robustness. A Decision Boundary Attack with 2000 steps, which uses no model gradients, shows the model is significantly more brittle to l2 attacks.
Limitations
CIFAR10 robustness is still far from satisfactory, at 45.8% under 20-step PGD. The experiments cover only MNIST and CIFAR10, and the training focus is on \( \ell_\infty \)-bounded attacks. On MNIST the accuracy drop just above the training ε remains unexplained beyond the threshold operators learned.
Danskin's justification does not hold strictly for these networks, so the gradient-based training rests mainly on experiments. The first-order conjecture is also a hypothesis, supported by experiments but not proven. The authors argue that FGSM-only evaluation is unreliable, since a reported 70% accuracy at ε = 0.7 in prior work says little about robustness.
Paper info
- Authors
- Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, Adrian Vladu
- Venue
- arXiv · Preprint
- First published
- 2017-6-19
- Added
- 2026-11-11
- Updated
- 2019-9-4
- Version
- v4
- arXiv
- 1706.06083
- Category
- stat.ML · cs.LG · cs.NE
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, Adrian Vladu (2017). Towards Deep Learning Models Resistant to Adversarial Attacks. arXiv:1706.06083v4. https://arxiv.org/abs/1706.06083v4
BibTeX
@misc{madry2017towards,
title = {{Towards Deep Learning Models Resistant to Adversarial Attacks}},
author = {Aleksander Madry and Aleksandar Makelov and Ludwig Schmidt and Dimitris Tsipras and Adrian Vladu},
year = {2017},
eprint = {1706.06083},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1706.06083v4}
}