Guided Diffusion Model for Adversarial Purification from Random Noise

Quanlin Wu, Hang Ye, Yuntian GuarXiv 2022

Abstract

In this paper, we propose a novel guided diffusion purification approach to provide a strong defense against adversarial attacks. Our model achieves 89.62% robust accuracy under PGD-L_inf attack (eps = 8/255) on the CIFAR-10 dataset. We first explore the essential correlations between unguided diffusion models and randomized smoothing, enabling us to apply the models to certified robustness. The empirical results show that our models outperform randomized smoothing by 5% when the certified L2 radius r is larger than 0.5.

Introduction

Adversarial attacks—small, often imperceptible perturbations designed to mislead deep learning models—pose a significant threat to the deployment of AI in security-critical applications. While adversarial training remains the standard defense, its high computational cost and limited generalization to unseen attacks necessitate alternative strategies. Adversarial purification offers a promising direction by preprocessing inputs to remove adversarial noise before classification. However, existing purification methods often struggle to fully decouple the adversarial signal from the underlying semantic content, sometimes getting "stuck" in the adversarial structures present in the image.

Methodology: Guided Diffusion from Random Noise

The proposed method leverages generative diffusion models to reconstruct clean images from pure Gaussian noise, using the adversarial input as a guide. Unlike previous approaches that initialize the process with the adversarial image, this method starts from a "clean slate" of noise to avoid local adversarial minima.

Figure 1: The reverse diffusion process starting from pure noise, guided by the adversarial input to reconstruct a purified image.

The purification process follows these key steps:

  1. Initialization: The process begins with pure Gaussian noise ($x_T$).
  2. Reverse Diffusion: A Denoising Diffusion Probabilistic Model (DDPM) iteratively refines the noise into a coherent image.
  3. Adversarial Guidance: At each step, the adversarial image ($x'_0$) provides a gradient guide. The model minimizes the distance (Mean Squared Error) between the current reconstruction and a noisy version of the adversarial input.
  4. Dynamic Scaling: A time-dependent guidance scale ($s_t$) balances the preservation of semantic structure with the removal of adversarial artifacts.
  5. Acceleration: To address the computational overhead, Denoising Diffusion Implicit Models (DDIM) are employed, achieving significant speedups (up to 20x) without compromising robustness.

Theoretical Bridge to Certified Robustness

A key contribution of this work is the formal link established between unguided diffusion purification and Randomized Smoothing. By treating diffusion as a form of noise-tolerant classification, the authors derive certified robustness guarantees, moving purification from an empirical heuristic to a provable defense mechanism.

Experimental Results

The method was evaluated on the CIFAR-10 dataset using a ResNet-50 classifier. Under a standard PGD-$\ell_\infty$ attack ($\epsilon = 8/255$), the guided diffusion model achieved a robust accuracy of 89.62%, outperforming several established baselines.

Table 1: Comparison of standard and robust accuracy across different defense methods on CIFAR-10.

Ablation studies further confirmed that starting the purification process from random noise is superior to starting from the adversarial image itself. In certain optimized settings, the "from noise" approach reached up to 91.89% robust accuracy. Additionally, in tests of certified robustness, the diffusion-based approach outperformed traditional randomized smoothing by 5% at larger certified $\ell_2$ radii ($r > 0.5$), demonstrating its ability to recover semantic information even from highly corrupted inputs.

Conclusion and Future Work

Guided diffusion from random noise represents a significant advancement in adversarial purification. By starting from a clean slate and using dynamic guidance, the model effectively "washes away" adversarial perturbations. While inference speed (approximately 0.92 seconds per image) remains a challenge for real-time applications, the theoretical bridge to certified robustness and strong empirical performance pave the way for more robust AI defenses. Future research will focus on scaling these techniques to high-resolution datasets like ImageNet.

Summary updated

BibTeX
@misc{wu2022guided,
  author = {Quanlin Wu and Hang Ye and Yuntian Gu},
  title = {{Guided Diffusion Model for Adversarial Purification from Random Noise}},
  year = {2022},
  eprint = {2206.10875},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.10875},
}
Figure