Abstract
Deep Neural Networks (DNNs) are highly susceptible to adversarial attacks—imperceptible perturbations designed to induce misclassification. While adversarial training can mitigate these risks, it often incurs significant computational costs and degrades performance on clean data. This paper presents EPS-AD, a novel adversarial detection framework that leverages the generative modeling capabilities of diffusion models. By introducing the Expected Perturbation Score (EPS), which aggregates score functions across multiple noise levels, the method provides a stable and informative signature of the data distribution. Using Maximum Mean Discrepancy (MMD) to compare test samples against natural data distributions, EPS-AD achieves near-perfect detection rates across diverse attack types and datasets, including CIFAR-10 and ImageNet.
Introduction
The brittleness of Deep Neural Networks remains a primary obstacle to their deployment in safety-critical applications. Adversarial examples—inputs specifically crafted to deceive a model—exploit the gap between a model's learned decision boundaries and the actual data manifold. Traditional defense mechanisms typically involve "hardening" the model via adversarial training. However, this approach is often attack-specific and can negatively impact the model's accuracy on natural images.
Adversarial detection offers a more flexible alternative by identifying and rejecting malicious inputs before they are processed by a classifier. Despite their promise, existing detectors frequently struggle with generalization to unseen attacks and signal instability. Many methods rely on the gradient of the log probability density (the "score") at a single point, which can be too noisy to distinguish subtle adversarial perturbations from natural data. EPS-AD addresses these limitations by adopting a "multi-view" perspective through diffusion-based probing.
Methodology
The Expected Perturbation Score (EPS)
The core innovation of this research is the Expected Perturbation Score (EPS). Rather than analyzing the score of a raw image in isolation, the authors propose "probing" the image by adding varying levels of Gaussian noise, following a predefined diffusion process.
By averaging the model's score function across these multiple noise levels, the EPS smooths out the high-dimensional noise inherent in single-point score estimation. This process is analogous to viewing an object from multiple angles to gain a more complete understanding of its structure, resulting in a more stable and robust signature of the underlying data distribution.
The EPS-AD Pipeline
The detection process consists of three primary stages:
- Perturbation: Multiple levels of Gaussian noise are added to both a reference set of natural images and the unknown test image.
- EPS Computation: A pre-trained score-based diffusion model (such as Score SDE or Guided Diffusion) is utilized to calculate the EPS for all samples. This leverages the rich probabilistic knowledge captured by state-of-the-art generative models without requiring the detector to be trained on adversarial examples.
- MMD Comparison: The framework employs Maximum Mean Discrepancy (MMD), a kernel-based statistical test, to measure the distance between the test sample's EPS and the distribution of natural EPS values. Unlike methods that only consider the magnitude (norm) of the score, MMD captures the directional information within the score vector. If the calculated discrepancy exceeds a specific threshold, the sample is flagged as adversarial.
Experimental Evaluation
Datasets and Attacks
The effectiveness of EPS-AD was evaluated on two standard computer vision benchmarks:
- CIFAR-10: 60,000 low-resolution (32x32) images.
- ImageNet: Large-scale high-resolution (256x256) images.
The researchers tested the detector against 12 distinct attack methods, including Projected Gradient Descent (PGD), Fast Gradient Sign Method (FGSM), Carlini & Wagner (CW), and AutoAttack (AA). The study also included transferable attacks, where adversarial examples crafted for one model are used to target another.
Performance Metrics
EPS-AD consistently outperformed state-of-the-art baselines such as LID, MD, and LiBRe. On the ImageNet dataset, the method achieved a near-perfect AUROC of 1.0000 against almost all tested attacks at standard intensities.
Crucially, the detector maintained high accuracy even under extremely low attack intensities (e.g., $\epsilon = 1/255$), where competing methods often fail. Because EPS-AD models the natural data distribution rather than specific attack patterns, it demonstrated exceptional generalization to "unseen" and transferable attacks. Furthermore, the method proved to be architecture-agnostic, performing effectively across ResNet, WideResNet, and Vision Transformer (ViT) architectures.
Discussion and Limitations
While EPS-AD provides a robust defense, it introduces certain trade-offs. The primary limitation is computational overhead. Calculating scores across multiple timesteps in a diffusion process is more resource-intensive than simpler detection methods. For instance, while inference takes approximately 0.04 seconds for CIFAR-10, it increases to roughly 2.3 seconds for high-resolution ImageNet samples.
Additionally, the detector's performance is intrinsically linked to the quality of the pre-trained diffusion model. If the generative model has not accurately captured the data distribution, the detection signal will be compromised.
Conclusion
EPS-AD represents a significant advancement in adversarial detection by utilizing the "multi-view" capabilities of diffusion models. By shifting the focus from single-point score estimation to the Expected Perturbation Score, the framework provides a theoretically grounded and highly effective means of identifying malicious inputs. Future work will focus on optimizing inference speed through fast diffusion solvers and improving the "out-of-the-box" performance of MMD kernels across more diverse datasets.
Summary updated