Notes on Margin Training and Margin p-Values for Deep Neural Network Classifiers

George Kesidis, David J. Miller, Zhen XiangarXiv 2019

TL;DR

This paper introduces a new local class-purity theorem for Deep Neural Network (DNN) classifiers based on Lipschitz continuity and proposes a "dual" training objective to strictly enforce classification margins. Additionally, it establishes a statistical framework using Gaussian Mixture Models (GMMs) to calculate "margin p-values," offering a novel way to detect adversarial attacks at test time.

What Problem Does This Paper Address?

Deep neural networks are notoriously vulnerable to adversarial attacks—small, imperceptible perturbations designed to trick a model into misclassifying an input. To defend against these test-time evasion attacks, researchers try to engineer a "classification margin" around training samples, ensuring that the model's decision remains constant within a local neighborhood (an open ball) around each sample.

However, existing training objectives do not guarantee that these margin constraints are met for all samples, often leading to sub-optimal robustness or a severe drop in clean classification accuracy. This paper tackles two main challenges: how to strictly enforce a prescribed classification margin during training, and how to mathematically and statistically validate the safety of test samples.

Methods

The authors approach the problem through three core contributions:

  1. Local Class-Purity Theorem: The authors prove a new theorem stating that if a network $f$ is $\ell_\infty/\ell_2$ Lipschitz continuous with a parameter $L_\infty > 0$, then an open $\ell_2$ ball centered at a training point $x$ with a radius of $\frac{\mu_f(x)}{2L_\infty}$ is entirely "class pure" (the model's prediction will not change within this ball), where $\mu_f(x)$ is the classification margin.
  2. Dual Margin Training: To guarantee that all training samples achieve a target margin $\mu$, the authors introduce a dual optimization framework (Equations 8 and 9). Instead of standard cross-entropy, they optimize a weighted margin constraint objective. They propose an iterative algorithm that dynamically scales up the weights ($\lambda_x \to \delta\lambda_x$) for any training samples that fail to meet the margin requirement.
  3. Margin p-Values for Anomaly Detection: To flag adversarial test samples, the authors fit a Gaussian Mixture Model (GMM) to the log-margins of the clean training data using Expectation-Maximization (EM). For any incoming test sample, they compute a "margin p-value." If a test sample has an abnormally small margin (resulting in a low p-value), it can be rejected as a potential adversarial attack.

Datasets

The methods were evaluated using:

  • CIFAR-10: Consisting of 50,000 training samples and 10,000 test/held-out samples.
  • FGSM (Fast Gradient Sign Method): Used to generate adversarial test samples with a perturbation strength of $\varepsilon = 0.1$ to evaluate model robustness.

Key Insights and Ideas

  • Guaranteed Safety Zones: By combining the classification margin with the network's Lipschitz constant, the authors provide a provable, geometric "safe zone" around data points where adversarial perturbations are mathematically impossible.
  • The Cost of Strict Margins: Enforcing a hard margin constraint acts as a strong regularizer. While it guarantees local robustness around training points, it can lead to overfitting on the training set's geometry, which slightly degrades the model's generalization on clean test data.
  • Statistical Defenses: Clean test data naturally mirrors the margin distribution of the training set. Adversarial examples drastically distort this distribution, pushing samples into unnaturally low-margin regions. Modeling this with a GMM provides an unsupervised, threshold-based defense mechanism.

Key Results

The authors evaluated their dual margin training on a ResNet-18 architecture using CIFAR-10, testing target margins of $\mu = 50$ and $\mu = 150$.

  • Constraint Satisfaction: All training-sample margins were successfully achieved in a single training pass using the proposed weight-adjustment algorithm.
  • Clean vs. Adversarial Performance: As shown in Table I, a baseline model trained with standard cross-entropy achieved 86.70% clean accuracy but collapsed to 6.017% under FGSM attacks. The margin-trained models ($\mu=50$ and $\mu=150$) slightly reduced clean accuracy to ~85.4% but nearly doubled adversarial robustness against transferred FGSM attacks to 10.08%.

The clear separation between clean and adversarial margin distributions highlights the utility of their p-value framework for anomaly detection:

Margin histograms for $\mu=50$

Limitations and Future Work

  • Accuracy Trade-off: The authors explicitly acknowledge that margin-based training can result in reduced clean classification accuracy due to overfitting the training set.
  • Robustness Ceiling: Although robustness to transferred FGSM attacks improved compared to standard cross-entropy, an absolute accuracy of 10.08% under attack demonstrates that margin training alone is not a silver bullet against strong adversarial opponents.
  • Optimization Tuning: The paper suggests that future work should explore alternative variations for adjusting the dual weights ($\lambda_x$), such as additive increases or dynamically decreasing weights when constraints are comfortably satisfied, to find a better balance between clean accuracy and robustness.

Summary updated

BibTeX
@misc{kesidis2019notes,
  author = {George Kesidis and David J. Miller and Zhen Xiang},
  title = {{Notes on Margin Training and Margin p-Values for Deep Neural Network Classifiers}},
  year = {2019},
  eprint = {1910.08032},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.08032},
}
Figure