Diffusion Models for Adversarial Purification
About
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. 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.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Image Classification | CIFAR-10 (test) | Accuracy (Clean)93.24 | 273 | |
| Adversarial Attack | ImageNet (test) | -- | 101 | |
| Adversarial Robustness | CIFAR-10 (test) | -- | 76 | |
| Image Classification | ImageNet-C level 5 | Avg Top-1 Acc (ImageNet-C L5)32.7 | 61 | |
| Image Classification | CIFAR-100 (test) | Clean Accuracy39.06 | 61 | |
| Adversarial Purification | CIFAR-10 | Standard Accuracy92.9 | 30 | |
| Image Classification | CIFAR-10 512-image subset (test) | Clean Accuracy90.97 | 26 | |
| Adversarial Video Purification | HMDB-51 | Clean Accuracy97 | 24 | |
| Adversarial Video Purification | HMDB-51 (test) | Clean Accuracy96 | 24 | |
| Adversarial Video Purification | UCF-101 (test) | Clean Accuracy93 | 24 |