Adversarial Margin Maximization Networks.

Ziang Yan, Yiwen Guo, Changshui Zhang · DOI

Abstract

The tremendous recent success of deep neural networks (DNNs) has sparked a surge of interest in understanding their predictive ability. Unlike the human visual system which is able to generalize robustly and learn with little supervision, DNNs normally require a massive amount of data to learn new concepts. In addition, research works also show that DNNs are vulnerable to adversarial examples—maliciously generated images which seem perceptually similar to the natural ones but are actually formed to fool learning models, which means the models have problem generalizing to unseen data with certain type of distortions. In this paper, we analyze the generalization ability of DNNs comprehensively and attempt to improve it from a geometric point of view. We propose adversarial margin maximization (AMM), a learning-based regularization which exploits an adversarial perturbation as a proxy. It encourages a large margin in the input space, just like the support vector machines. With a differentiable formulation of the perturbation, we train the regularized DNNs simply through back-propagation in an end-to-end manner. Experimental results on various datasets (including MNIST, CIFAR-10/100, SVHN and ImageNet) and different DNN architectures demonstrate the superiority of our method over previous state-of-the-arts.

Introduction

Deep Neural Networks (DNNs) often struggle with generalization and are notoriously vulnerable to adversarial attacks. In classical machine learning, linear classifiers like Support Vector Machines (SVMs) rely on the "large margin principle"—maximizing the distance between the decision boundary and the closest training data points—to guarantee better generalization. However, applying this principle to DNNs is difficult because their high non-linearity makes calculating the exact geometric margin in the input space generally intractable.

Previous attempts to maximize margins in the feature space (e.g., penultimate layer outputs) fail to guarantee a large margin in the input space due to non-linear distortions. This paper introduces Adversarial Margin Maximization (AMM), a novel regularization technique that improves generalization by explicitly maximizing the geometric margin in the input space using adversarial perturbations as a proxy.

Methodology

AMM incorporates an adversarial attack directly into the training loop as a regularizer. The core components include:

  • Adversarial Perturbation as a Proxy: The $L_2$ norm of an adversarial perturbation (generated via the DeepFool algorithm) serves as a differentiable estimation of the geometric margin.
  • High-Order Gradients: Since the perturbation depends on the network's weights, AMM uses automatic differentiation to backpropagate through the iterative attack process. This end-to-end differentiation is crucial for aligning gradients correctly.
  • Aggregation Function (MIN): Similar to SVM "support vectors," AMM focuses on the most vulnerable training samples (e.g., the top 20% with the smallest margins) rather than averaging over the entire batch.
  • Shrinkage Function (EXP/INV): Non-linear scaling ensures that samples with dangerously small margins are heavily penalized, while "safely" distant samples are ignored.
Visualization of decision boundaries for different AMM variants on a toy dataset.

As shown in the figure above, different combinations of aggregation and shrinkage functions significantly impact the resulting decision boundary, with the MIN+EXP/INV variants achieving a more centered, SVM-like boundary.

Experimental Results

The authors evaluated AMM across standard benchmarks including MNIST, CIFAR-10/100, SVHN, and ImageNet using various architectures (ResNets, DenseNets, etc.).

Key Performance Gains

AMM consistently improved test accuracy:

  • MNIST: A standard Multi-Layer Perceptron (MLP) dropped from 1.79% error to 0.90%.
  • CIFAR-10: ResNet-20 error decreased from 8.20% to 7.62%.
  • ImageNet: Fine-tuning a pre-trained ResNet-50 with AMM reduced top-1 validation error from 23.85% to 23.54%.

Data Efficiency

One of the most striking results is the improvement in data efficiency. AMM allows models to learn more robustly from fewer samples.

MNIST test error vs. number of clean training samples, demonstrating the data efficiency of AMM.

As illustrated, an AMM-trained model using only 20,000 MNIST images achieved a 1.54% error rate, outperforming a baseline model trained on the full 60,000 image dataset (1.81% error).

Discussion and Conclusion

The success of AMM highlights several key insights:

  1. Input Space Primacy: Maximizing margins in the input space is far more effective for generalization than in the feature space.
  2. Attacks as Regularizers: Adversarial magnitudes are excellent proxies for geometric margins during training.
  3. Support Vector Analogy: Focusing on "worst-case" samples near the boundary is essential for deep learning regularization.

While effective, AMM is computationally intensive, requiring 6-14x more time per epoch due to iterative attacks and high-order gradients. For large-scale tasks like ImageNet, the authors recommend using AMM as a fine-tuning step after standard training to balance performance and efficiency.

Summary updated

BibTeX
@article{yan2021adversarial,
  author = {Ziang Yan and Yiwen Guo and Changshui Zhang},
  title = {{Adversarial Margin Maximization Networks.}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2021},
  url = {https://openreview.net/forum?id=gWlIiqbt_cj},
}
Figure