Boosting Adversarial Robustness From The Perspective of Effective Margin Regularization

Ziquan Liu, Antoni B. Chan

Introduction

Deep neural networks (DNNs) have achieved remarkable success across various domains, yet they remain notoriously susceptible to adversarial attacks—small, imperceptible perturbations that can drastically alter a model's prediction. A primary reason for this vulnerability lies in the standard training objective: Cross-Entropy (XE) loss. This paper identifies a critical "scale-variant" flaw in XE loss that allows models to achieve low training error without developing geometric robustness. To address this, the authors propose Effective Margin Regularization (EMR), a method designed to maximize the geometric distance between data points and decision boundaries by penalizing local weight norms.

The Problem: The "Lazy" Optimization of Cross-Entropy

The authors argue that XE loss acts as a "lazy" optimizer. In a classification task, a model can minimize XE loss simply by increasing the magnitude (scale) of its weights. As the weights grow, the logits increase, and the softmax probability for the correct class approaches one, causing the loss to vanish. However, this numerical minimization does not necessarily correspond to an increase in the "effective margin"—the actual geometric distance to the decision boundary.

Consequently, training often stops prematurely. The model appears confident because the loss is near zero, but the data points remain dangerously close to the decision boundary, leaving them vulnerable to adversarial perturbations. Standard regularization techniques like Weight Decay (WD) attempt to constrain weight growth but fail to account for the local geometry of the data, making them insufficient for ensuring robustness.

Methodology: Effective Margin Regularization (EMR)

The core of the proposed approach is to directly regularize the model's geometry. EMR introduces a penalty term that targets the "effective margin."

1. Defining the Effective Margin

The margin is defined as the normalized logit difference between the ground-truth class and the most competitive incorrect class. By maximizing this margin, the model pushes the decision boundary further away from the training samples.

2. The EMR Penalty

Instead of a global weight penalty, EMR adds a term to the loss function that penalizes the squared $L_2$ norm of the logit gradients with respect to the input. This "surgical" regularization forces the model to maintain a stable output in the local neighborhood of each training point.

3. Scaling with Approx-EMR

Calculating the exact EMR requires iterating over all possible classes, which is computationally prohibitive for large-scale datasets. To mitigate this, the authors introduce Approx-EMR. This variant uses a weighted logit mean, controlled by a temperature parameter $t$, to approximate the margin efficiently, making the method feasible for modern, deep architectures.

4. Synergy with Adversarial Training

EMR is designed to be complementary to existing defenses like Adversarial Training (AT) or TRADES. The authors describe a "push-pull" dynamic: while AT generates adversarial examples to "pull" the model’s attention toward the decision boundary, EMR "pushes" that boundary away from the samples. Combining these techniques results in a more robust classifier than using either in isolation.

Experimental Evaluation

The researchers evaluated EMR on MNIST and CIFAR10 using various architectures, including Multi-Layer Perceptrons (MLP), simple CNNs, ResNet18, and WideResNet-34-10. Robustness was measured using AutoAttack, a rigorous ensemble of four different adversarial attacks.

Performance Highlights

  • MNIST: EMR significantly outperformed standard training, achieving 87.56% PGD20 accuracy compared to the baseline's 48.41%.
  • CIFAR10 (WideResNet-34-10): Integrating EMR with TRADES improved AutoAttack accuracy from 52.19% to 52.73%. When combined with the MAIL defense strategy, the performance reached 53.29%, setting a high standard for the architecture.

The results consistently showed that EMR improves robustness across different architectures and base defense strategies, confirming its utility as a "plug-and-play" regularization module.

Discussion and Limitations

While EMR provides a significant boost to robustness, it comes with trade-offs. The primary limitation is computational overhead. Because EMR requires an additional backpropagation step to calculate logit gradients, training time increases by approximately 25-30% per iteration. Additionally, the method introduces two new hyperparameters—the regularization coefficient $\lambda_{EMR}$ and the temperature $t$—which require careful tuning.

Another technical insight noted by the authors is the importance of "evaluation mode" when computing EMR for models with Batch Normalization. Using evaluation mode during the forward pass prevents noisy gradient correlations, leading to more stable and effective training.

Conclusion

Effective Margin Regularization (EMR) offers a novel perspective on adversarial robustness by addressing the scale-variant limitations of Cross-Entropy loss. By penalizing local weight norms and forcing the model to learn larger geometric margins, EMR provides a robust framework that complements existing adversarial training methods. Future work may explore the application of EMR to even larger datasets and its integration with alternative loss functions.

Summary updated

BibTeX
@inproceedings{liu2022boosting,
  author = {Ziquan Liu and Antoni B. Chan},
  title = {{Boosting Adversarial Robustness From The Perspective of Effective Margin Regularization}},
  booktitle = {BMVC},
  year = {2022},
  url = {https://openreview.net/forum?id=yPNN9ajU4W},
}
Figure