Abstract
Deep Neural Networks (DNNs) are highly sensitive to imperceptible malicious perturbations, known as adversarial attacks. Following the discovery of this vulnerability in real-world imaging and vision applications, the associated safety concerns have attracted vast research attention, and many defense techniques have been developed. Most of these defense methods rely on adversarial training (AT) -- training the classification network on images perturbed according to a specific threat model, which defines the magnitude of the allowed modification. Although AT leads to promising results, training on a specific threat model fails to generalize to other types of perturbations. A different approach utilizes a preprocessing step to remove the adversarial perturbation from the attacked image. In this work, we follow the latter path and aim to develop a technique that leads to robust classifiers across various realizations of threat models. To this end, we harness the recent advances in stochastic generative modeling, and means to leverage these for sampling from conditional distributions. Our defense relies on an addition of Gaussian i.i.d noise to the attacked image, followed by a pretrained diffusion process -- an architecture that performs a stochastic iterative process over a denoising network, yielding a high perceptual quality denoised outcome. The obtained robustness with this stochastic preprocessing step is validated through extensive experiments on the CIFAR-10 dataset, showing that our method outperforms the leading defense methods under various threat models.
Introduction: The Fragility of Deep Neural Networks
Deep Neural Networks (DNNs) have revolutionized computer vision, yet they remain notoriously fragile. A tiny, often imperceptible change to an image—known as an adversarial perturbation—can trick a state-of-the-art classifier into making egregious errors, such as misidentifying a stop sign as a toaster. This vulnerability poses significant safety risks for real-world applications like autonomous driving and medical imaging.
The current gold standard for defense is Adversarial Training (AT), which involves augmenting the training set with attacked images. However, AT is often "brittle"; a model trained to resist $L_\infty$ attacks (perturbations with a specific maximum pixel change) typically remains highly vulnerable to $L_2$ attacks (perturbations with a specific total energy change). In real-world scenarios, the specific threat model an attacker might use is unknown. Consequently, there is a pressing need for a "threat-model agnostic" defense—one that can purify an image regardless of how it was perturbed.
Methodology: Purification via Diffusion
The authors propose a preprocessing defense that leverages the generative power of Diffusion Models. Unlike AT, this method does not require retraining the classifier. Instead, it uses a diffusion model trained only on clean, natural images to "purify" inputs before they reach a standard, "vanilla" classifier.
The Defense Pipeline
The process consists of several key stages:
- Noise Addition: When an image (potentially attacked) arrives, a controlled amount of Gaussian noise is added. This step is designed to "drown out" the structured, malicious adversarial perturbation.
- Partial Reverse Diffusion: The noisy image is then processed through a pretrained diffusion model. Rather than starting from pure noise, the process begins at an intermediate timestep $T^*$.
- Iterative Denoising: The model iteratively removes noise, effectively "projecting" the image back onto the manifold of natural images.
- Classification: The purified image, now stripped of its adversarial influence, is fed into the vanilla classifier.
Stochasticity as a Shield
A critical feature of this defense is its stochastic nature. During the reverse diffusion process, noise is injected at every step. This makes it significantly harder for an attacker to bypass the defense using gradient-based methods like Expectation-Over-Transformation (EOT), as the gradients become noisy and unreliable.
Key Insights and Results
The $T^*$ Sweet Spot
The most critical hyperparameter is the initial diffusion depth, $T^*$. If $T^*$ is too low, the adversarial perturbation may persist. Conversely, if $T^*$ is too high, the diffusion model may lose the semantic identity of the original image and generate a different object entirely, leading to misclassification.
Performance Benchmarks
- Generalization: On CIFAR-10, the method achieved an average accuracy of 39.7% across various unseen $L_2$ and $L_\infty$ attacks. In contrast, standard AT models often drop to near 0% when faced with unfamiliar threat models.
- Superior Purification: The defense outperformed leading preprocessing methods like Adaptive Denoising Purification (ADP) by up to 32.86% in white-box scenarios.
- Natural Robustness: On CIFAR-10-C, the diffusion-based approach surpassed several state-of-the-art robust models, demonstrating its effectiveness against both malicious attacks and natural corruptions like blur or snow.
Discussion and Future Directions
While effective, the method introduces significant computational overhead. Running multiple denoising steps for every classification is far more expensive than a standard forward pass. However, this also increases the "attacker's burden," as attacking the system requires backpropagating through the entire iterative chain. Future work will focus on scaling this approach to high-resolution datasets like ImageNet using more efficient sampling techniques.
Summary updated