Classifier Guidance Enhances Diffusion-based Adversarial Purification by Preserving Predictive Information

Mingkun Zhang, Jianing Li, Wei Chen, Jiafeng Guo, Xueqi Cheng · DOI

Introduction

Adversarial purification is a defense strategy that utilizes generative models, such as diffusion models, to remove malicious perturbations from input images before they reach a classifier. By pushing adversarial examples back toward the natural data manifold, these methods aim to restore the model's predictive accuracy. However, existing techniques like DiffPure often struggle with a fundamental trade-off: insufficient purification fails to remove the threat, while excessive purification destroys the semantic features necessary for correct classification, leading to "label shift."

Methodology: The COUP Framework

To address the loss of predictive information, the authors introduce COUP (Classifier-cOnfidence gUided Purification). Unlike standard methods that rely solely on the diffusion model's internal score function, COUP incorporates the downstream classifier's own confidence into the denoising process.

Overview of the COUP framework, showing the objective, purification path, and resulting images.

The core innovation is the use of Classifier Guidance. By calculating the gradient of the classifier's maximum log-probability, COUP "nudges" the image during the reverse-time Stochastic Differential Equation (SDE) toward regions of high classification certainty. This ensures the purified image remains recognizable to the model and stays away from ambiguous decision boundaries.

Key Insights: Avoiding the Over-Purification Trap

A critical observation of this research is that standard diffusion-based purification monotonically loses predictive information as the number of steps increases. In a typical scenario, the model's confidence in the true label eventually collapses as the image becomes overly smoothed or distorted.

Classifier confidence over purification steps, highlighting how COUP prevents label shift.

As shown in the case study above, COUP effectively prevents the semantic drift that causes a "frog" to be misidentified as a "bird" after cleaning. By using confidence as a "compass," the algorithm allows for deeper purification (more steps) without the typical penalty to clean accuracy. This guidance ensures that while the noise is removed, the essential features required for classification are preserved.

Experimental Results

The researchers evaluated COUP on the CIFAR-10 and CIFAR-100 benchmarks using WideResNet architectures. The method demonstrated significant improvements in robustness against the rigorous AutoAttack suite:

  • CIFAR-10 ($l_\infty$): Achieved 73.05% robustness, surpassing DiffPure's 70.64%.
  • CIFAR-10 ($l_2$): Reached 83.13% robustness, a nearly 5% improvement over previous state-of-the-art diffusion defenses.
  • Synergy: COUP proved to be orthogonal to adversarial training, providing additive benefits when combined with models already hardened against attacks.

Conclusion and Future Directions

While COUP sets a new standard for diffusion-based purification, it introduces higher computational costs due to the need for gradient calculations at each denoising step. Additionally, the method requires careful tuning of the purification timestep and guidance weight. Future research will likely focus on accelerating these computations and developing adaptive mechanisms for parameter selection to make the defense more practical for real-time applications.

Summary updated

BibTeX
@inproceedings{zhang2024classifier,
  author = {Mingkun Zhang and Jianing Li and Wei Chen and Jiafeng Guo and Xueqi Cheng},
  title = {{Classifier Guidance Enhances Diffusion-based Adversarial Purification by Preserving Predictive Information}},
  booktitle = {ECAI},
  year = {2024},
  doi = {10.3233/faia240745},
}
Figure