Abstract
Deep Neural Networks (DNNs) are vulnerable to adversarial examples (AEs)—inputs crafted with subtle perturbations to cause misclassification. Existing defenses often suffer from high computational overhead, reduced accuracy on clean data, or vulnerability to adaptive attacks. This paper introduces MixDefense, a "plug-and-play" two-layer framework that detects AEs by analyzing both statistical noise and semantic consistency. By combining a noise-based detector for large perturbations with a generative model for semantic verification, MixDefense achieves high detection accuracy and robustness against adaptive adversaries without compromising clean-image performance.
Introduction
Adversarial examples pose a significant threat to the deployment of DNNs in security-critical applications. While adversarial training and input purification are common defenses, they often introduce significant overhead or degrade the model's original accuracy. Furthermore, many defenses are fragile when faced with adaptive attacks where the adversary has knowledge of the defense mechanism.
MixDefense addresses these challenges through a "defense-in-depth" strategy. It treats adversarial detection as a multi-stage process, filtering out "loud" statistical anomalies first and then scrutinizing "quiet" semantic contradictions.
Methodology
The MixDefense framework consists of two complementary layers designed to cover the full spectrum of adversarial perturbation budgets.
LP-Defense (Large Perturbation)
The first layer, LP-Defense, utilizes a Simple Adversarial Example Catcher (SAEC). This component treats large adversarial perturbations as high-frequency noise. It generates pseudo-saturation maps to suppress image content and highlight "salt-and-pepper" noise typical of AEs.
As shown in Figure 2, as the perturbation budget increases, the statistical variance of the noise feature histogram (Noise Level Score) becomes more pronounced. If this score exceeds a predefined threshold, the input is flagged as adversarial before reaching the classifier.
SP-Defense (Small Perturbation)
For subtle perturbations that evade statistical detection, the SP-Defense layer (ContraNet) looks for semantic contradictions. When the classifier predicts a label, ContraNet uses a conditional Generative Adversarial Network (cGAN) to reconstruct the image based on that predicted label.
If the input is legitimate, the reconstruction will closely match the original. However, if the input is an AE (e.g., a "Speed Limit" sign perturbed to be classified as a "Stop Sign"), the cGAN will generate a "Stop Sign," creating a significant semantic gap. A Triplet Network-based Deep Metric Model measures this distance in a high-dimensional embedding space to distinguish between benign and adversarial samples.
Experimental Results
MixDefense was evaluated on MNIST, CIFAR-10, and GTSRB datasets. Key findings include:
- High Detection Accuracy: SAEC achieved over 97% accuracy for large perturbations, while ContraNet effectively caught subtle attacks.
- Preserved Clean Accuracy: The framework has negligible impact on the classification of legitimate images (e.g., maintaining 98.2% accuracy on MNIST).
- Adaptive Robustness: By breaking the gradient path—using non-differentiable operations like
argmaxand separate training for components—MixDefense remains resilient even when attackers attempt to target the defense itself.
Conclusion
MixDefense offers a robust, attack-agnostic solution for adversarial detection. By layering statistical and semantic analysis, it provides comprehensive protection across various perturbation levels while remaining computationally efficient and easy to integrate into existing DNN pipelines. Future work will focus on scaling this approach to more complex datasets like ImageNet.
Summary updated