TL;DR
Diffusion models are highly effective at "purifying" adversarial attacks, but not because they return images to their original state. This paper reveals that purified images are actually further from the clean data; instead, robustness stems from a massive compression of the image space that effectively shrinks the "surface area" available for adversarial perturbations to succeed.
What Problem Does This Paper Address?
Deep neural networks are notoriously fragile, often fooled by "adversarial examples"—images with tiny, invisible tweaks that trigger incorrect classifications. While adversarial training (teaching the model on attacked images) is the standard defense, it often overfits to specific attacks.
A newer, more flexible approach is adversarial purification, where a generative model (like a diffusion model) "cleans" the image before the classifier sees it. While this works well in practice, the community has relied on a flawed intuition: that these models work by "denoising" the image back toward the original clean sample. The authors of this paper set out to demystify the actual mechanics of diffusion-based purification, challenging the "denoising" narrative and providing a rigorous mathematical framework for why it works.
Methods
The authors move beyond simple empirical testing to a systematic investigation of diffusion model behavior. Their methodology includes:
- Fixed-Randomness Analysis: Diffusion models are inherently stochastic. To isolate the model's structural effects from random noise, the authors evaluated them under a "fixed randomness" setting (fixing the random seed $\xi$). This revealed that the perceived robustness in many prior studies was partially an illusion caused by "gradient masking" from the model's internal noise.
- Compression Rate (CR) Metric: They introduced a formal measure called the Expected Compression Rate. This quantifies how much a local neighborhood of images "shrinks" after passing through the purification process.
- Theoretical Modeling: The team analyzed the Gaussian score field and the reverse diffusion process. They proved that the learned score function in diffusion models naturally acts as a convergent field that pulls off-manifold noise toward the data manifold.
- Robustness Prediction: By combining the CR with the classifier's intrinsic "survival function" (its likelihood of being fooled by a certain magnitude of noise), they developed a way to predict a system's robustness without needing to run expensive adversarial attacks.
Datasets
The study utilized two standard computer vision benchmarks:
- CIFAR-10: A dataset of 60,000 small color images across 10 classes. The authors used a subsampled set of 1,000 images for their primary tests.
- ImageNet: A large-scale dataset. The authors used a subsampled set of 200 images from the validation set.
- Classifiers: They used pre-trained robust models from the RobustBench library, specifically WideResNet-28-10 for CIFAR-10 and ResNet-50 for ImageNet.
Key Insights and Ideas
- The Denoising Myth: Surprisingly, purified images are $\ell_p$ farther away from the clean image than the original adversarial example was. They are also perceptually more dissimilar (lower SSIM). The model isn't "recovering" the original image; it's creating a new version that just happens to be easier to classify correctly.
- Randomness Dominates: The internal "noise" generated by a diffusion model during purification is roughly 170 times larger than the variability caused by the input image itself. This explains why standard evaluations often overestimate robustness—the attacker is trying to hit a target that is constantly jumping around.
- The Law of Compression: When randomness is controlled, a "lawful" sigmoidal relationship emerges between the Compression Rate and adversarial robustness. If a model compresses the image space to about 20% of its original volume (CR $\approx$ 0.2), robustness gains skyrocket.
- Selective Squashing: Diffusion models are "smart" compressors. They heavily compress off-manifold directions (the "noise" space where adversarial attacks live) while largely preserving on-manifold directions (the actual features of the image).
Key Results
- True Robustness Revealed: When the "shield" of randomness is removed, the robust accuracy of diffusion-purified systems on CIFAR-10 drops from a reported ~70% to a more modest 23.7% under PGD attacks. On ImageNet, it sits at 29.5%.
- Predictive Accuracy: The authors' theoretical framework successfully predicted these robustness levels. For example, using the DDIM sampler, their theory predicted 10.6% robustness, which closely matched the empirical result of 10.9%.
- Compression Stats: For DDPM on CIFAR-10 ($t=100$), the expected CR was measured at 0.231, indicating a significant shrinkage of the local image space around the data.
Limitations and Future Work
- Computational Cost: Evaluating these models is extremely slow. Running a full PGD-EOT attack on the CIFAR-10 subset took 10 days on a high-end NVIDIA RTX 6000 GPU.
- Clean Accuracy Trade-off: The compression that provides robustness also causes a slight drop in clean image accuracy because the "anchor points" (the purified versions of clean images) aren't identical to the originals.
- Generalization: The current work focuses on diffusion models in pixel space. The authors suggest that future work should investigate if these compression laws hold for Latent Diffusion Models (LDMs) and newer Flow Matching techniques, which are becoming the industry standard.
Summary updated