Diffusion Models for Adversarial Purification

Weili Nie, Brandon Guo, Yujia Huang, Chaowei Xiao, Arash Vahdat +1 more
5/16/2022
805 citations
cs.LGcs.CRcs.CV
diffusion-flow

Official code: NVlabs/DiffPure (346 stars, Python, last commit 2023-01-29).

Abstract

Adversarial purification refers to a class of defense methods that remove adversarial perturbations using a generative model. These methods do not make assumptions on the form of attack and the classification model, and thus can defend pre-existing classifiers against unseen threats.

Show full abstract

However, their performance currently falls behind adversarial training methods. In this work, we propose DiffPure that uses diffusion models for adversarial purification: Given an adversarial example, we first diffuse it with a small amount of noise following a forward diffusion process, and then recover the clean image through a reverse generative process. To evaluate our method against strong adaptive attacks in an efficient and scalable way, we propose to use the adjoint method to compute full gradients of the reverse generative process. Extensive experiments on three image datasets including CIFAR-10, ImageNet and CelebA-HQ with three classifier architectures including ResNet, WideResNet and ViT demonstrate that our method achieves the state-of-the-art results, outperforming current adversarial training and adversarial purification methods, often by a large margin. Project page: https://diffpure.github.io.

View on arXivView PDF

Code Implementations(1)

NVlabs/DiffPureOfficial100%

A new adversarial purification method that uses the forward and reverse processes of diffusion models to remove adversarial perturbations.

34649Python, ShellJun 13, 20223 years agoNOASSERTION

Similar Papers

Cite this paper

@article{nie2022diffusion,
  title  = {Diffusion Models for Adversarial Purification},
  author = {Weili Nie and Brandon Guo and Yujia Huang and Chaowei Xiao and Arash Vahdat and Anima Anandkumar},
  year   = {2022},
  eprint = {2205.07460},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.07460}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.07460.svg)](https://codeofpaper.com/paper/2205.07460)

Discussion