[Paper Review] PixelDefend: Leveraging Generative Models to Understand and Defend against Adversarial Examples
PixelDefend uses a PixelCNN generative model to detect and purify adversarial images, moving inputs back toward the training distribution to restore classifier accuracy in a model- and attack-agnostic way.
Adversarial perturbations of normal images are usually imperceptible to humans, but they can seriously confuse state-of-the-art machine learning models. What makes them so special in the eyes of image classifiers? In this paper, we show empirically that adversarial examples mainly lie in the low probability regions of the training distribution, regardless of attack types and targeted models. Using statistical hypothesis testing, we find that modern neural density models are surprisingly good at detecting imperceptible image perturbations. Based on this discovery, we devised PixelDefend, a new approach that purifies a maliciously perturbed image by moving it back towards the distribution seen in the training data. The purified image is then run through an unmodified classifier, making our method agnostic to both the classifier and the attacking method. As a result, PixelDefend can be used to protect already deployed models and be combined with other model-specific defenses. Experiments show that our method greatly improves resilience across a wide variety of state-of-the-art attacking methods, increasing accuracy on the strongest attack from 63% to 84% for Fashion MNIST and from 32% to 70% for CIFAR-10.
Motivation & Objective
- Motivate the study of adversarial examples as data-distribution outliers rather than purely classifier faults.
- Hypothesize that imperceptible adversarial perturbations largely reside in low-probability regions of the training distribution.
- Develop detection and purification techniques that are classifier- and attack-agnostic.
- Show that purification can be combined with existing defenses to boost robustness.
- Demonstrate state-of-the-art resilience against a wide range of attacks on benchmark datasets.
Proposed method
- Train PixelCNN generative models on clean training data to estimate p(X), the data distribution over images.
- Use likelihoods to detect adversarial inputs via a statistical test that yields p-values based on a permutation test.
- Propose PixelDefend: purify inputs by moving them within an epsilon-defend neighborhood toward higher probability under the PixelCNN model using a greedy decoding procedure.
- Provide an adaptive variant that tunes epsilon_defend based on the input’s probability under the generative model to minimize impact on clean images.
- Do not modify the classifier; PixelDefend is model- and attack-agnostic and can be combined with adversarial training or other defenses.
- Evaluate against multiple attacks (RAND, FGSM, BIM, DeepFool, CW) on Fashion-MNIST and CIFAR-10 using ResNet and VGG classifiers.
Experimental results
Research questions
- RQ1Do adversarial examples predominantly lie in low-probability regions of the training distribution as estimated by a neural density model?
- RQ2Can a generative-model-based detector (via p-values) reliably identify adversarial inputs across diverse attack methods?
- RQ3Can purifying images toward high-density regions of the training distribution recover classifier accuracy against strong attacks without knowing the attacker or classifier?
- RQ4Does PixelDefend meaningfully improve robustness when combined with other defenses across datasets and attack types?
- RQ5Is an end-to-end differentiable attack feasible against a PixelDefend pipeline, and if so, how effective is it?
Key findings
- Adversarial examples typically yield several orders of magnitude lower PixelCNN likelihoods than clean images.
- The p-value detector using PixelCNN likelihoods can distinguish adversarial inputs across a wide range of attacks with high probability.
- PixelDefend purification moves perturbed images toward high-density regions and, when combined with existing classifiers, substantially improves accuracy under strong attacks (e.g., Fashion-MNIST strongest attack from 63% to 84% and CIFAR-10 from 32% to 70%).
- PixelDefend is model-agnostic and attack-agnostic, compatible with adversarial training, and enhances robustness without modifying the classifier.
- End-to-end adversarial attacks targeting the full PixelDefend pipeline are difficult to craft, with iterative gradient-based attacks failing to find effective perturbations in practice.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.