DensePure: Understanding Diffusion Models towards Adversarial Robustness

Zhongzhu Chen, Kun Jin, Jiongxiao Wang, Weili Nie, Mingyan Liu, Anima Anandkumar, Bo Li, Dawn SongTSRML @ NeurIPS 2022 · DOI

TL;DR

This paper introduces DensePure, a novel method that leverages diffusion models to significantly improve the adversarial robustness of classifiers. By theoretically analyzing how diffusion models denoise, DensePure proposes a purification pipeline that uses multiple denoising steps and majority voting to recover clean samples from adversarial ones, achieving state-of-the-art certified accuracy.

What Problem Does This Paper Address?

Adversarial attacks pose a significant threat to the reliability of machine learning models, especially in safety-critical applications. While diffusion models have shown promise in denoising and thus potentially improving robustness, the theoretical underpinnings of why and how they achieve this have been unclear. This lack of theoretical understanding has limited further advancements. The paper aims to bridge this gap by providing a theoretical framework for diffusion model-based adversarial purification and proposing a practical method, DensePure, that capitalizes on this understanding to enhance certified robustness.

Methods

DensePure builds upon existing diffusion models and classifiers. The core idea is to use the reverse process of a diffusion model to "purify" an adversarial input. Instead of a single denoising step, DensePure performs multiple runs of denoising using different random seeds. These multiple "reversed" samples are then fed into an off-the-shelf classifier, and a majority vote is taken on the predicted labels to determine the final classification.

This approach is motivated by the theoretical analysis which shows that when a clean data sample has high density, its conditional density under the diffusion model's reverse process is also high. This means that sampling from this conditional distribution is likely to recover the original clean sample. DensePure specifically aims to approximate the label of the high-density region in this conditional distribution. The paper also introduces a fast sampling strategy to mitigate the computational cost of multiple denoising steps.

Datasets

  • CIFAR-10: Used for training and evaluation.
  • ImageNet: Used for training and evaluation.

Key Insights and Ideas

  • Theoretical Foundation for Denoising Robustness: The paper provides a theoretical explanation for why diffusion models can enhance certified robustness, linking it to the high data density regions in the conditional distribution of the reverse process.
  • Robust Region as a Union of Convex Sets: DensePure's theoretical analysis reveals that the robust region (the set of adversarial perturbations that a classifier can withstand) under diffusion model purification is a union of multiple convex sets, potentially much larger than those identified by prior methods.
  • Majority Voting for Enhanced Accuracy: Using multiple denoising runs and majority voting is crucial for accurately approximating the high-density region and thus improving robustness. This is more effective than relying on a single denoised sample.
  • Off-the-Shelf Compatibility: DensePure is designed to work with pre-trained diffusion models and classifiers, making it easily adaptable to existing systems.

Key Results

  • State-of-the-Art Certified Robustness: DensePure achieves state-of-the-art certified accuracy on both CIFAR-10 and ImageNet datasets, outperforming existing methods by up to 7% on average for L2-norm bounded adversarial perturbations.
  • Improved Performance with More Votes: Increasing the number of denoising runs (K) consistently leads to better certified accuracy, validating the majority voting strategy.
  • Effective Fast Sampling: The proposed fast sampling strategy allows for practical application of DensePure without significant performance degradation.

Limitations and Future Work

  • Time Complexity: The paper acknowledges that DensePure's time complexity is high due to the repeated reverse process steps. While fast sampling helps, more advanced strategies are suggested for future work.
  • Theoretical Guarantees for Approximate Reverse Processes: While the theory is developed for exact reverse SDEs, practical diffusion models use approximations. The paper shows theoretical results on KL-divergence to bound this approximation error, but further investigation into the impact of these approximations on robustness could be beneficial.

Summary updated

BibTeX
@misc{chen2022densepure,
  author = {Zhongzhu Chen and Kun Jin and Jiongxiao Wang and Weili Nie and Mingyan Liu and Anima Anandkumar and Bo Li and Dawn Song},
  title = {{DensePure: Understanding Diffusion Models towards Adversarial Robustness}},
  year = {2022},
  eprint = {2211.00322},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.00322},
}
Figure