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

Diffusion-based Adversarial Purification from the Perspective of the Frequency Domain

Gaozheng Pei, Ke Ma, Yingfei Sun, Qianqian Xu, Qingming Huang

TL;DR

FreqPure is a novel adversarial purification method that leverages frequency domain analysis to protect AI models from malicious attacks. By selectively preserving low-frequency components of the amplitude and phase spectra during the diffusion process, it removes adversarial noise while keeping the original image's structure and semantics remarkably intact.

What Problem Does This Paper Address?

Deep learning models are notoriously vulnerable to adversarial attacks—tiny, calculated perturbations to an image that are invisible to humans but cause models to misclassify objects. Adversarial purification is a defense strategy that "cleans" these images before they reach the classifier.

Recently, Diffusion Models (like those behind Stable Diffusion) have become the gold standard for purification. They work by adding noise to an image (forward process) and then using a neural network to "reverse" that noise, hopefully recovering the clean original. However, the authors identify a major flaw: current methods treat adversarial noise as uniform across the image. In doing so, the purification process often "over-cleans," destroying the very semantic details (edges, textures, shapes) needed for accurate classification. This leads to a trade-off where the model becomes robust against attacks but loses accuracy on normal, clean images.

Methods

The authors shift the perspective from pixels to the Frequency Domain. By applying a Discrete Fourier Transform (DFT), they decompose images into two parts:

  1. Amplitude Spectrum: Represents the "energy" or brightness at various scales.
  2. Phase Spectrum: Contains the "structural" information (where the edges and shapes are).

The Core Innovation: FreqPure

The researchers discovered that adversarial damage is not uniform; it increases monotonically with frequency. Low-frequency components (the "broad strokes" of an image) are relatively untouched by attackers.

Adversarial damage across frequency components for Amplitude and Phase spectra.

FreqPure intervenes during each step of the reverse diffusion process:

  • Amplitude Exchange: It replaces the low-frequency amplitude of the "denoised" image with the corresponding low-frequency parts of the original adversarial input. This ensures the "energy" of the image remains consistent.
  • Phase Projection: It projects the denoised phase spectrum into a specific range defined by the input's low-frequency phase. This "anchors" the structural reconstruction, preventing the diffusion model from hallucinating new shapes or blurring existing ones.

By doing this, the model only has to "guess" the high-frequency details (fine textures), while the reliable low-frequency "skeleton" is preserved from the input.

Datasets

The authors evaluated their method across three standard benchmarks:

  • CIFAR-10: A dataset of small 32x32 images across 10 classes.
  • SVHN: Street View House Numbers, focusing on digit recognition in the wild.
  • ImageNet: The industry-standard large-scale dataset (256x256 resolution) for complex object recognition.

They tested these against a variety of model architectures, including WideResNet, ResNet-50, Vision Transformers (ViT), and ConvNeXT.

Key Insights and Ideas

  • The "High-Pass" Nature of Attacks: Adversarial perturbations are primarily a high-frequency phenomenon. This is the "aha moment" that justifies why we should trust the low-frequency data of an attacked image.
  • Theoretical Proof of Destruction: The authors mathematically prove that standard diffusion-based purification indiscriminately destroys all frequency components. This explains why previous methods often produced "blurry" results that hurt standard accuracy.
  • Phase Matters: While many frequency-based studies focus only on amplitude, this paper highlights that the phase spectrum is crucial for maintaining image structure. Their "Phase Projection" technique is a key differentiator from prior work like REAP.

Key Results

FreqPure consistently outperformed state-of-the-art defenses (like DiffPure and REAP) across multiple metrics:

  • CIFAR-10: On a WideResNet-28-10 backbone, FreqPure achieved 92.19% standard accuracy (on clean images) and 77.35% robust accuracy (under AutoAttack). This represents a significant jump over previous diffusion-based methods which often struggled to break 70% robust accuracy without sacrificing clean performance.
  • ImageNet: FreqPure improved robust accuracy by approximately 3.52% over the strongest baselines.
  • Visual Fidelity: Qualitative results show that images purified by FreqPure are much closer to the original clean samples, avoiding the "hallucinated" artifacts or excessive smoothing seen in other diffusion defenses.

Limitations and Future Work

  • Computational Cost: Like all diffusion-based methods, FreqPure requires multiple iterations of a neural network to "clean" a single image, making it slower than simple adversarial training.
  • White-Box Vulnerabilities: While the authors use a "surrogate process" to simulate white-box attacks (where the attacker knows the defense), calculating exact gradients through the frequency-domain operations remains a complex challenge.
  • Hyperparameter Tuning: The method relies on thresholds to decide where "low frequency" ends and "high frequency" begins. While they provide a sensitivity analysis, these may need adjustment for different types of image data (e.g., medical vs. natural images).

Summary updated

BibTeX
@inproceedings{pei2025diffusion,
  author = {Gaozheng Pei and Ke Ma and Yingfei Sun and Qianqian Xu and Qingming Huang},
  title = {{Diffusion-based Adversarial Purification from the Perspective of the Frequency Domain}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=Bm706VlAtU},
}
Figure