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 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 a comprehensive evaluation of these methods and demonstrate their competitive performance and compelling properties.
Introduction
Deep learning models are notoriously fragile. A tiny, invisible tweak to an image—an "adversarial perturbation"—can trick a state-of-the-art network into misidentifying a stop sign as a speed limit sign. While many defenses have been proposed, most crumble under "adaptive attacks," where the attacker knows exactly how the defense works.
In their ICLR 2020 paper, GAT: Generative Adversarial Training for Adversarial Example Detection and Robust Classification, Yin, Kolouri, and Rohde propose a shift in perspective. Instead of just drawing better boundaries, GAT forces models to learn the underlying distribution of each class, effectively turning classifiers into generative gatekeepers.
Methodology
The core issue in adversarial machine learning is the "blind spot" of discriminative models. A standard classifier only cares about the boundary between classes, often failing to learn the actual shape of the data distribution. Consequently, an attacker can find "rubbish" inputs—noise that looks like nothing to a human—that sit on the wrong side of a boundary and trigger a high-confidence (but wrong) prediction.
The Gatekeeper Architecture
The authors introduce a two-pronged approach based on One-Versus-The-Rest (OVR) classification. For a problem with $K$ classes, they train $K$ separate binary classifiers. The $i$-th classifier is trained to distinguish between clean data of class $i$ (positive samples) and adversarially perturbed samples of all other classes (negative samples).
Integrated Detection
At test time, a standard classifier predicts a label $\hat{k}$. Then, the $\hat{k}$-th binary classifier "vets" the input. If the gatekeeper rejects it (i.e., the sample falls outside the learned distribution for that class), the input is flagged as adversarial. This mechanism provides a robust "defense in depth" because an error in one gatekeeper does not necessarily compromise the others.
The Generative Twist
By interpreting the logit output of these binary classifiers as an Energy-Based Model (EBM), the authors treat the classifier as an unnormalized density model ($p(x|k)$). Using Bayes' rule, they can perform classification based on these densities, effectively turning a discriminative model into a generative one. This approach assigns low probability to "rubbish" examples, making them much easier to filter out.
Experimental Results
The GAT framework was evaluated across several benchmarks, including MNIST, CIFAR10, and Restricted ImageNet.
- Robustness Improvements: On MNIST, GAT improved the mean $L_2$ distortion (the amount of change required to fool the model) from 3.68 to 5.65. On CIFAR10, it improved from 1.1 to 1.5.
- Detection Performance: Under certain conditions, the integrated detection method achieved near-perfect detection of adversarial examples (100% TPR at 0% FPR).
- Semantic Perturbations: Because the model learns class-conditional distributions, an attack must introduce actual features of the target class to succeed. Qualitative results showed that attacks against GAT models produce visual changes that humans can recognize as the target class (e.g., making a cat look more like a dog), whereas attacks on standard models remain visually nonsensical.
Discussion and Conclusion
GAT provides a principled way to detect adversarial examples that remains robust even against adaptive white-box attacks. However, challenges remain regarding computational cost. Training $K$ separate binary classifiers is expensive; inference on CIFAR10 was roughly 10 times slower than a standard model. Scaling to the full 1,000-class ImageNet would require significant resources. Additionally, like many robust training methods, there is a slight "robustness tax" where increasing the perturbation limit during training can lead to a minor decrease in accuracy on clean data. Future work will likely focus on optimizing the training process to make this generative approach viable for massive-scale datasets.
Summary updated