NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Generative Robust Classification

Xuwang YinarXiv 2022 · DOI

Introduction

In modern deep learning, classifiers are predominantly discriminative, focusing on modeling the decision boundary between classes ($p(k|x)$). While highly effective for standard tasks, these models are notoriously fragile; small, calculated adversarial perturbations can easily push an image across a boundary without altering its semantic content. Standard defenses like Adversarial Training (AT) often come at the cost of clean accuracy and produce overconfident, nonsensical predictions on out-of-distribution data.

This paper explores an alternative paradigm: Generative Robust Classification. Instead of merely learning where the line is drawn, the authors propose a model that learns what each class actually looks like by modeling class-conditional distributions ($p(x|k)$).

Methodology

The proposed approach replaces the standard multi-class softmax architecture with $K$ separate binary classifiers, one for each class.

  1. Dual Adversarial Training: Each classifier $D_k$ is trained to distinguish clean data of class $k$ from adversarially perturbed data of all other classes ("out-distribution" AT) and to recognize class $k$ even when it is itself perturbed ("in-distribution" AT).
  2. Learnable Calibration: To address the mathematical intractability of the partition function in generative models, the authors treat normalization constants as learnable calibration parameters ($c_k$) optimized on a validation set.
  3. Bayesian Inference: At test time, these generative densities are converted back into a classification decision using Bayes' theorem: $g(x) = \arg \max_k [d_k(x) + c_k]$.

Experimental Results

The model was evaluated on the CIFAR-10 dataset using a ResNet18 backbone. While the generative model trails slightly in clean accuracy (88.12% vs. 90.83% for the baseline), it demonstrates superior resilience as the magnitude of adversarial noise increases.

Robust accuracy evaluated under different test perturbations ($L_\infty$-based distance).

As illustrated in the figure above, the generative classifier "fails gracefully." On CIFAR-10 with an $L_2$ perturbation of 0.5, it achieved 72.27% robust accuracy, outperforming the state-of-the-art discriminative baseline's 70.17%. This suggests that the generative training objective may be more critical for robustness than raw parameter count, as the generative ResNet18 (10M parameters) outperformed a much larger discriminative ResNet50.

Interpretability through Synthesis

A significant advantage of the generative approach is its inherent interpretability. Because the model learns class-conditional densities, it can be "queried" to synthesize images representing its internal class concepts.

Class-conditional image synthesis demonstrating the model's internal representations.

By performing targeted attacks on seed noise, the model produces clean, semantically recognizable counterfactuals. Quantitatively, the generative model achieved a significantly better Fréchet Inception Distance (FID) of 50.38 compared to 61.84 for the baseline, proving that it captures true class features more accurately than discriminative models.

Discussion and Limitations

The primary limitation of this method is scalability. Requiring $K$ binary classifiers makes the approach computationally expensive for datasets with thousands of categories, such as ImageNet. Future research will focus on scaling the architecture and exploring synergies with advanced data augmentation strategies like CutMix or MixUp to further bridge the clean-accuracy gap.

Summary updated

BibTeX
@misc{yin2022generative,
  author = {Xuwang Yin},
  title = {{Generative Robust Classification}},
  year = {2022},
  eprint = {2212.07283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.07283},
}
Figure