GAT: Generative Adversarial Training for Adversarial Example Detection and Robust Classification

Xuwang Yin, Soheil Kolouri, Gustavo K. Rohde

Introduction

Deep Neural Networks (DNNs) are notoriously fragile. Small, imperceptible perturbations—adversarial examples—can cause a model to misclassify an image with high confidence. While many defenses exist, most fall apart under adaptive attacks, where the attacker knows exactly how the defense works and tailors their noise to bypass it.

The authors of this paper identify a core weakness in standard defenses: discriminative classifiers only care about the boundaries between classes. They don't actually "know" what a class looks like; they just know it’s not the other classes. This allows attackers to find "rubbish" regions of the input space that have high logit values but no semantic meaning.

To address this, the authors propose GAT (Generative Adversarial Training). GAT reimagines adversarial defense by training $K$ independent binary classifiers that double as generative density models. This approach significantly boosts robustness against adaptive white-box attacks and forces attackers to semantically change an image (e.g., making a "3" actually look like a "7") to successfully fool the system.

The GAT Methodology

GAT shifts the architecture from a single $K$-way classifier to a set of $K$ binary classifiers.

Decision boundaries of standard classifiers vs. class-specific detectors.
  1. One-Versus-The-Rest (OVR) Training: For a $K$-class problem (like the 10 classes in MNIST), the system trains $K$ separate binary classifiers. The $i$-th classifier is trained to distinguish between clean data of class $i$ and adversarially perturbed samples of all other classes.
  2. Adversarial Training for Detection: During training, Projected Gradient Descent (PGD) is used to find the "hardest" adversarial examples for each binary classifier. This forces the model to learn a tight distribution around the clean data, rather than just a loose boundary.
  3. Generative Interpretation: The authors interpret the logit output of each binary classifier as an Energy-Based Model (EBM). By treating the output as an unnormalized density ($p(x|k) \propto \exp(z_k(x))$), they can use Bayes' rule to perform classification. This allows the system to act as a density model rather than just a boundary finder.

Integrated Detection at Test Time

At test time, the system uses a two-step verification process:

  1. It first predicts a label $\hat{k}$ using a standard classifier.
  2. It then consults the $\hat{k}$-th binary classifier (the detector for that specific class). If that detector gives a score below a certain threshold, the input is rejected as an adversarial example.
The two-step detection process: predicting a label and verifying it with the corresponding class detector.

Because the $K$ binary classifiers are trained independently, an attack that bypasses one doesn't automatically bypass the others, making the overall ensemble much more resilient to adaptive optimization.

Key Insights and Results

The paper evaluates GAT on three standard benchmarks: MNIST, CIFAR10, and Restricted ImageNet. The authors measured robustness using mean $L_2$ distortion, which quantifies how much noise an attacker must add to succeed (higher is better).

  • Quantitative Improvements: GAT improved the state-of-the-art mean $L_2$ distortion on MNIST from 3.68 to 5.65, and on CIFAR10 from 1.1 to 1.5.
  • The "Semantic Shift" Requirement: In standard robust models, an adversarial attack often looks like static or "rubbish" noise. In GAT, because the model learns the actual distribution of the class, an attacker must introduce features of the target class to succeed. To make the model see a "dog" as a "cat," the attacker effectively has to draw cat-like features onto the dog. Visualizations in the paper confirm that adversarial perturbations against GAT are visually interpretable.
  • Density Modeling vs. Boundary Finding: By treating classifiers as density models, the system gains a "rejection" option. It doesn't just pick the best of $K$ options; it asks, "Does this input actually look like any of the classes I know?"

Limitations and Future Work

While highly effective, GAT comes with trade-offs:

  • Computational Cost: Training and running $K$ separate binary classifiers is roughly $K$ times more expensive than a standard model. On CIFAR10, inference was noted to be about 10x slower.
  • Scaling to Large $K$: While feasible for 10 classes, scaling this to the full ImageNet (1,000 classes) would be computationally prohibitive without further architectural optimizations, such as sharing a backbone and only branching at the final layers.
  • Optimization Challenges: Training Energy-Based Models is notoriously difficult and sensitive to hyperparameters like step size and perturbation limits during the inner-loop PGD attack.

Summary updated

Abstract

The vulnerabilities of deep neural networks against adversarial examples have become a significant concern for deploying these models in sensitive domains. Devising a definitive defense against such attacks is proven to be challenging, and the methods relying on detecting adversarial samples are only valid when the attacker is oblivious to the detection mechanism. In this paper we propose a principled adversarial example detection method that can withstand norm-constrained white-box attacks. Inspired by one-versus-the-rest classification, in a K class classification problem, we train K binary classifiers where the i-th binary classifier is used to distinguish between clean data of class i and adversarially perturbed samples of other classes. At test time, we first use a trained classifier to get the predicted label (say k) of the input, and then use the k-th binary classifier to determine whether the input is a clean sample (of class k) or an adversarially perturbed example (of other classes). We further devise a generative approach to detecting/classifying adversarial examples by interpreting each binary classifier as an unnormalized density model of the class-conditional data. We provide comprehensive evaluation of the above adversarial example detection/classification methods, and demonstrate their competitive performances and compelling properties. Code is available at https://github.com/xuwangyin/GAT-Generative-Adversarial-Training
BibTeX
@inproceedings{yin2020gat,
  author = {Xuwang Yin and Soheil Kolouri and Gustavo K. Rohde},
  title = {{GAT: Generative Adversarial Training for Adversarial Example Detection and Robust Classification}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=Meyqb3dcKm},
}
Figure