Abstract
Adversarial input detection has emerged as a prominent technique to harden Deep Neural Networks (DNNs) against adversarial attacks. Most prior works use neural network-based detectors or complex statistical analysis for adversarial detection. These approaches are computationally intensive and vulnerable to adversarial attacks. To this end, we propose DetectX—a hardware-friendly adversarial detection mechanism using hardware signatures like Sum of column Currents (SoI) in memristive crossbars (XBar). We show that adversarial inputs have higher SoI compared to clean inputs. However, the difference is too small for reliable adversarial detection. Hence, we propose a dual-phase training methodology: Phase 1 training is geared towards increasing the separation between clean and adversarial SoIs; Phase 2 training improves the overall robustness against different strengths of adversarial attacks. For hardware-based adversarial detection, we implement the DetectX module using 32nm CMOS circuits and integrate it with a Neurosim-like analog crossbar architecture. Our experiments show that DetectX is 10x–25x more energy-efficient and immune to dynamic adversarial attacks compared to previous state-of-the-art works. Moreover, we achieve high detection performance (ROC-AUC > 0.95) for strong white-box and black-box attacks.
Introduction
Deep Neural Networks (DNNs) are increasingly deployed in safety-critical domains such as autonomous driving and medical diagnostics. Despite their success, they remain vulnerable to adversarial examples—inputs modified with subtle, often imperceptible perturbations designed to trigger misclassifications. Existing defenses typically involve adversarial training or software-based detectors. However, software detectors are often computationally expensive and susceptible to "dynamic attacks" where an adversary crafts inputs to bypass both the classifier and the detector simultaneously.
DetectX addresses these challenges by shifting the defense mechanism from software to the physical hardware layer of AI accelerators. By monitoring physical energy signatures, DetectX provides a robust, energy-efficient, and hardware-intrinsic security layer that is difficult for attackers to model mathematically.
The DetectX Framework: Leveraging Hardware Signatures
The core of DetectX lies in monitoring the Sum of column Currents (SoI) within memristive crossbar arrays. In these analog accelerators, Multiply-Accumulate (MAC) operations are performed using Ohm’s Law and Kirchhoff’s Current Law. Inputs are represented as voltages ($v_i$), and weights are stored as conductances ($G_{i,j}$). The resulting current in each column ($I_j$) represents the MAC output.
The researchers observed that adversarial inputs, which typically contain high-frequency noise, result in a higher SoI in the initial layers of the network compared to clean inputs. This physical "fingerprint" allows the hardware to distinguish between legitimate and malicious data without the overhead of additional neural network layers.
Dual-Phase Training Strategy
While adversarial inputs naturally exhibit higher SoI, the raw statistical difference is often insufficient for high-reliability detection. To amplify this gap, DetectX employs a novel dual-phase training methodology:
- Phase 1 (Separation): The model is trained with a custom loss function designed to maximize the distance between the SoI distributions of clean and adversarial inputs.
- Phase 2 (Robustness): The weights of the first layer are frozen to maintain the established SoI gap. The remainder of the network then undergoes standard adversarial training to recover and enhance classification accuracy.
As shown in the figure above, this training process creates a distinct statistical separation. This enables the hardware module to use a Look-Up Table (LUT) and a Random Number Generator (RNG) to generate a confidence score for each input, effectively deciding whether to accept or reject it based on its physical signature.
Evaluation and Results
The DetectX module was implemented using 32nm CMOS circuits and integrated into a Neurosim-based analog crossbar architecture. The system was evaluated across three benchmarks: CIFAR10 (VGG8), CIFAR100 (VGG16), and TinyImagenet (ResNet18).
Key Performance Metrics:
- Detection Accuracy: DetectX achieved an ROC-AUC greater than 0.95 against strong white-box and black-box attacks (e.g., PGD and FGSM).
- Energy Efficiency: The hardware-intrinsic nature of the defense makes it 10x to 25x more energy-efficient than state-of-the-art software detectors.
- Resilience to Dynamic Attacks: Because the detector relies on non-differentiable hardware components like the LUT and RNG, it is inherently more resistant to gradient-based dynamic attacks that typically fool software-based defenses.
Conclusion
DetectX demonstrates that hardware "non-idealities" and physical signatures can be repurposed as powerful security features. By moving adversarial detection to the physical layer, AI accelerators can achieve high security with minimal power and latency overhead. Future research will explore the application of these signatures in deeper network layers and further hardening against adaptive adversaries who may attempt to craft low-SoI adversarial inputs.
Summary updated