Abstract
Deep models, while being extremely versatile and accurate, are vulnerable to adversarial attacks: slight perturbations that are imperceptible to humans can completely flip the prediction of deep models. Many attack and defense mechanisms have been proposed, although a satisfying solution still largely remains elusive. In this work, we give strong evidence that during training, deep models maximize the minimum margin in order to achieve high accuracy, but at the same time decrease the average margin hence hurting robustness. Our empirical results highlight an intrinsic trade-off between accuracy and robustness for current deep model training. To further address this issue, we propose a new regularizer to explicitly promote average margin, and we verify through extensive experiments that it does lead to better robustness. Our regularized objective remains Fisher-consistent, hence asymptotically can still recover the Bayes optimal classifier.
Introduction: The Fragility Trap
Deep neural networks are famously "brittle." A tiny, imperceptible change to an image—an adversarial perturbation—can cause a state-of-the-art model to misclassify a stop sign as a speed limit sign. This vulnerability is rooted in the model's margin: the distance between a data point and the decision boundary. A larger margin implies greater robustness, as it requires a more significant "shove" to alter the model's prediction.
The core challenge identified in this research is a hidden trade-off: standard optimization algorithms (like SGD) are biased toward maximizing the minimum margin (the distance of the hardest, most ambiguous points). While this helps the model achieve zero training error and high accuracy, it inadvertently "squeezes" the rest of the data points toward the boundary, leaving the majority of the dataset vulnerable to even slight attacks.
The "Left Shift" Phenomenon
The most striking empirical insight is the visualization of margin histograms during training. As models become more accurate, the distribution of margins undergoes a distinct transformation.
As shown in the histograms, as training progresses, the distribution of margins shifts to the left. Even as the model gets more "accurate," the majority of data points are being moved closer to the "cliff edge" of the decision boundary. This provides strong evidence that maximizing accuracy via standard training is intrinsically at odds with robustness.
Methodology: Average Margin Regularizer (AMR)
To address this fragility, the authors propose the Average Margin Regularizer (AMR), a novel training framework that explicitly protects the average margin:
- Truncated Distance: The objective rewards a larger average margin using a truncated distance threshold ($\tau$) to prevent outliers from dominating the optimization.
- Feature Space Optimization: Because calculating exact margins in deep networks is computationally NP-hard, AMR maximizes the margin in the feature space (the layer just before the final output).
- Lipschitz Control: To ensure feature-space margins translate to input-space robustness, the authors add an orthogonal penalty ($\beta \|W W^\top - I\|_F^2$) to control the network's Lipschitz constant, preventing small input changes from being amplified into large feature changes.
- Fisher Consistency: Mathematically, the new objective is Fisher-consistent, ensuring that with sufficient data, the model still converges to the Bayes optimal classifier.
Key Results
The AMR method was evaluated on MNIST and CIFAR-10 across various architectures, including CNNs and MLPs. Key findings include:
- Robustness Gains: On CIFAR-10, the average margin was increased by a factor of 1.5x to 2x compared to standard training.
- Competitive Performance: AMR achieved robust accuracy comparable to Projected Gradient Descent (PGD) adversarial training—the gold standard for defense. For example, on MNIST (LeNet), AMR reached 93.12% robust accuracy at a perturbation level of $\epsilon=2.0$.
- Efficiency: Unlike traditional adversarial training, which is incredibly slow due to generating attacks at every step, AMR achieves robustness by simply changing the loss function, making it nearly as fast as standard training.
Conclusion and Future Work
While AMR provides a robust and efficient alternative to traditional defenses, it relies on Lipschitz approximations that may be less accurate in certain high-dimensional edge cases. Future work may explore other statistics of the margin distribution, such as controlling the variance of the margins, to ensure no specific clusters of data are left vulnerable.
Summary updated