DiffSmooth: Certifiably Robust Learning via Diffusion Models and Local Smoothing

Jiawei Zhang, Zhongzhu Chen, Huan Zhang, Chaowei Xiao, Bo Li · DOI

Abstract

Deep neural networks are highly susceptible to adversarial perturbations, where small, imperceptible changes to an input can lead to incorrect classifications. While empirical defenses are often circumvented by adaptive attacks, certified robustness provides a mathematical guarantee of a model's stability. However, existing certified methods, such as randomized smoothing, struggle at large noise radii, and diffusion-based purification methods are often either computationally prohibitive or insufficiently robust. This paper introduces DiffSmooth, a framework that combines one-shot diffusion-based purification with a novel "local smoothing" strategy. DiffSmooth achieves state-of-the-art certified accuracy by stabilizing purified samples through an additional layer of noise averaging, providing a computationally efficient alternative to iterative purification methods.

1. Introduction

The fragility of deep neural networks (DNNs) remains a significant barrier to their deployment in safety-critical applications. Adversarial attacks can easily manipulate model outputs, leading to a need for defenses that offer more than just empirical resistance. Certified robustness has emerged as a rigorous alternative, providing a provable radius within which a model's prediction is guaranteed to remain constant.

Currently, the gold standard for certification is randomized smoothing, which involves predicting the class of an input based on the average output of the model over many noisy versions of that input. While effective, this method faces a fundamental trade-off: larger noise levels allow for larger certified radii but often distort the input so severely that classification accuracy collapses. Recent research has explored using Diffusion Denoising Probabilistic Models (DDPMs) to "purify" this noise. However, "one-shot" purification often lacks the precision needed for large-scale certification, while "multi-shot" (iterative) purification is too slow for practical use. DiffSmooth bridges this gap by enhancing one-shot purification with a secondary smoothing step.

2. The DiffSmooth Framework

DiffSmooth operates through a three-stage pipeline designed to maximize both robustness and efficiency:

  1. Standard Smoothing: Gaussian noise is added to the original input image $x$ to prepare it for the certification process.
  2. One-Shot Diffusion Purification: The noisy image is processed through a pre-trained DDPM using a single-step reverse diffusion. This step maps the noisy input back toward the original data manifold, effectively removing a significant portion of the added noise.
  3. Local Smoothing: This is the core innovation of the framework. Rather than passing the purified image directly to a classifier, DiffSmooth applies a second, smaller set of random noises to the purified image. The final prediction is the average of the model's outputs over these locally smoothed samples.

Theoretical analysis suggests that one-shot denoising effectively approximates the mean of the distribution of possible recovered images. Local smoothing then acts as a stabilizer, ensuring the classifier "lands" in a more stable and robust region of its decision space, mitigating the artifacts or blurriness often introduced by rapid purification.

3. Experimental Evaluation

The researchers evaluated DiffSmooth on two primary computer vision benchmarks: CIFAR-10 and ImageNet. The framework was tested across multiple architectures, including ResNet-110, ResNet-50, and the BEiT (Vision Transformer) model.

3.1 Certified Accuracy

DiffSmooth demonstrated significant improvements over eight state-of-the-art baselines:

  • ImageNet: At an $\ell_2$ perturbation radius of 1.5, DiffSmooth increased certified accuracy from 36.0% to 53.0%.
  • CIFAR-10: At an $\ell_2$ radius of 0.50, certified accuracy improved from 42.8% to 59.2%.

3.2 Computational Efficiency

A key advantage of DiffSmooth is its speed relative to iterative purification methods like DensePure. On ImageNet, the diffusion step in DiffSmooth requires approximately 90 seconds per image, compared to over 550 seconds for multi-shot methods. By shifting the computational burden from expensive diffusion iterations to relatively inexpensive model inference steps during local smoothing, DiffSmooth becomes a more viable candidate for large-scale applications.

4. Discussion and Insights

Several key insights emerged from the development of DiffSmooth:

  • Stabilization via Local Smoothing: Purification alone is insufficient for high-level certification. Local smoothing provides the necessary consistency, making the pipeline resilient to the slight errors inherent in one-shot diffusion.
  • Architecture Synergy: The method performs exceptionally well when paired with Vision Transformers (e.g., BEiT). This suggests that high-capacity, modern architectures are particularly adept at handling the outputs of the DiffSmooth pipeline.
  • Efficiency vs. Robustness: DiffSmooth proves that it is possible to achieve the high-quality certification of multi-shot diffusion without the associated temporal costs.

5. Limitations and Future Work

Despite its successes, DiffSmooth has limitations. Its performance is sensitive to the choice of the local smoothing noise level ($\sigma'$); while heuristics exist (such as setting $\sigma'$ to roughly half of the input noise $\sigma$), the optimal value can vary. Additionally, the defense is dependent on the quality of the pre-trained diffusion model; if the model encounters out-of-distribution data, purification may fail. Finally, while faster than iterative methods, randomized smoothing still requires thousands of model passes for certification, which remains a bottleneck for real-time systems.

Future research may focus on automated hyperparameter tuning for local smoothing or the integration of diffusion models directly into the classifier's training loop to further enhance robustness.

Summary updated

BibTeX
@inproceedings{zhang2023diffsmooth,
  author = {Jiawei Zhang and Zhongzhu Chen and Huan Zhang and Chaowei Xiao and Bo Li},
  title = {{DiffSmooth: Certifiably Robust Learning via Diffusion Models and Local Smoothing}},
  booktitle = {USENIX Security},
  year = {2023},
  url = {https://openreview.net/forum?id=AI6mIMV0njl},
}
Figure