USAD: Uncertainty-aware Statistical Adversarial Detection

Zhijian Zhou, Xunye Tian, Jiacheng Zhang, Zesheng Ye, Yiyi Guo, Donghao Zhang, Liuhua Peng, Feng Liu

TL;DR

This paper introduces USAD, a novel method for detecting adversarial examples (AEs) in deep learning systems. USAD addresses the limitations of existing methods by explicitly modeling two key uncertainty patterns of AEs: their abnormal feature spread (global uncertainty) and instability under perturbations (local uncertainty). By combining these new uncertainty-aware statistics, USAD significantly improves detection performance, especially in challenging scenarios like small query batches.

What Problem Does This Paper Address?

Deep learning models are vulnerable to adversarial examples (AEs) – subtly modified inputs that can cause misclassifications. Detecting these AEs is crucial for security-critical applications. While "Statistical Adversarial Detection" (SAD) offers a promising approach by framing detection as a two-sample hypothesis test (comparing a batch of incoming queries to a known distribution of clean examples), existing SAD methods primarily rely on Maximum Mean Discrepancy (MMD). MMD measures distributional differences but struggles to capture the specific ways AEs manifest as uncertainty. AEs often exhibit abnormal feature spread (global uncertainty) and are sensitive to small perturbations (local uncertainty), characteristics that MMD is insensitive to. This limitation leads to reduced detection power, especially when AEs are sparsely mixed with clean examples or when the query batch is small, making current SAD methods less practical for real-time monitoring.

Methods

The paper proposes Uncertainty-aware Statistical Adversarial Detection (USAD), which introduces two new statistics to capture AE uncertainty:

  • Variance Discrepancy (VD): This statistic measures the difference in the spread (variance) of semantic features between clean examples (CEs) and query examples. It aims to capture "global uncertainty" arising from AEs being displaced from the clean data manifold.
  • Perturbation-based Covariance Discrepancy (PCD): This statistic compares the covariance of semantic features under Gaussian perturbations. It aims to capture "local uncertainty" by detecting how sensitive AEs are to small, random noise, indicating instability near decision boundaries.

USAD then aggregates VD and PCD using a correlation-aware weighting strategy, accounting for their statistical dependencies. This combined statistic is used in a permutation test to make a final detection decision, ensuring controlled false-alarm rates.

Datasets

The paper evaluates USAD on the following datasets:

  • CIFAR-10: A widely used benchmark for image classification.
  • ImageNet-1K: A larger-scale benchmark for image classification.

Key Insights and Ideas

  • MMD's Blind Spot: The core insight is that MMD, while effective for general distribution comparison, misses crucial uncertainty patterns that AEs exhibit. This explains why existing SAD methods struggle in certain scenarios.
  • Uncertainty as a Detection Signal: The paper highlights that AEs don't just shift the mean of feature distributions; they alter the spread (global uncertainty) and stability (local uncertainty) of these distributions. These uncertainty shifts are powerful signals for detection.
  • Complementary Statistics: VD and PCD capture different aspects of AE uncertainty. VD focuses on the overall spread, while PCD looks at local sensitivity to perturbations. Combining them provides a more comprehensive view.
  • Adaptive Aggregation: Simply averaging statistics can be suboptimal. USAD's adaptive aggregation, which considers the correlation between VD and PCD, ensures that complementary information is leveraged effectively, and redundant information is down-weighted.
  • Practicality for Real-time Detection: By improving detection power in small query batches, USAD makes SAD more practical for real-time monitoring systems where waiting for large amounts of data is not feasible.

Key Results

  • Superior Detection Power: USAD consistently outperforms baseline SAD methods (like SAMMD) across various attacks, including unseen and adaptive attacks.
  • Small Batch Performance: USAD achieves near-perfect detection power even with very small query batch sizes (e.g., |Y|=10), significantly outperforming baselines that degrade rapidly in such scenarios.
  • Robustness to Attacks: USAD demonstrates strong performance against a wide range of attacks (l∞, l2, sparse, adaptive) and across different model architectures (ResNet, ViT).
  • Controlled False Alarms: The method theoretically guarantees controlled Type-I error rates, ensuring a low false alarm rate.
  • Efficiency: While PCD and USAD have higher computational costs than VD, VD itself offers superior computational efficiency compared to SAMMD, making it attractive for real-time applications.

Limitations and Future Work

  • Computational Cost: While VD is efficient, PCD and USAD can be computationally more expensive due to covariance matrix operations and kernel evaluations. The authors suggest pre-computation of distance matrices to mitigate this for PCD.
  • No Explicit Temporal Modeling: For video detection, the current method treats frames as a sample set but doesn't explicitly model temporal correlations. The authors suggest this as an interesting future direction for developing more specialized video detectors.
  • Generalizability of SAD: The paper positions SAD as a monitoring layer, not a replacement for per-example detectors. Its effectiveness relies on detecting distributional shifts, which might be less sensitive to extremely sparse AEs or attacks designed to mimic clean data distributions very closely.
  • Future Work: The authors suggest extending the framework to incorporate other statistics, explore more sophisticated aggregation strategies, and apply it to other distribution shift detection problems beyond adversarial detection.

Summary updated

BibTeX
@inproceedings{zhou2026usad,
  author = {Zhijian Zhou and Xunye Tian and Jiacheng Zhang and Zesheng Ye and Yiyi Guo and Donghao Zhang and Liuhua Peng and Feng Liu},
  title = {{USAD: Uncertainty-aware Statistical Adversarial Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=EGs2nZVWS3},
}

Loading related content...

Figure