Abstract
The deployment of deep neural network (DNN) accelerators in intelligent IoT devices faces two major challenges: prohibitive computational complexity and vulnerability to adversarial attacks. Existing solutions often prioritize one at the expense of the other. We propose the 2-in-1 Accelerator, an algorithm-accelerator co-design framework that achieves both high efficiency and robust defense. Our framework introduces the Random Precision Switch (RPS) algorithm, which utilizes random quantization as an in-situ defense mechanism. Complementing this, we present a precision-scalable hardware architecture featuring a novel MAC unit that spatially tiles temporal units and a "first-reduce-then-shift" strategy to optimize area and power. Experiments show that the 2-in-1 Accelerator significantly boosts robust accuracy while providing up to 7.58× better energy efficiency and 36.5× higher throughput than state-of-the-art robust accelerators.
Introduction: The Efficiency-Robustness Dilemma
Deep Neural Networks (DNNs) are essential for modern IoT applications but are computationally demanding. To fit within the stringent resource constraints of IoT devices, developers often use quantization to reduce bit-precision. However, these optimized models are notoriously fragile against adversarial attacks—tiny, intentional input perturbations that can cause a model to fail.
Historically, efficiency and robustness have been viewed as competing goals. Robustness often requires extra detection networks or complex training, which consume the power and area saved by quantization. The 2-in-1 Accelerator flips this script, asking: Can we leverage quantization itself to boost robustness?
Random Precision Switch (RPS) Algorithm
The core innovation of our framework is the Random Precision Switch (RPS) algorithm. Instead of deploying a model with a fixed bit-width (e.g., 8-bit), RPS randomly selects a precision from a predefined set (e.g., 4-bit to 16-bit) for each inference.
This approach creates an "in-situ ensemble" effect. The researchers discovered a critical "Aha" moment: adversarial attacks are often highly precision-specific. An attack optimized to exploit the specific noise patterns of an 8-bit model often fails when the model suddenly switches to 4-bit or 12-bit precision. By breaking the transferability of these attacks, RPS turns quantization noise into a defensive shield.
Precision-Scalable MAC Architecture
Supporting random precision switching requires hardware that is both flexible and efficient. Traditional "Spatial" designs (like Bit Fusion) are efficient but struggle with flexibility, while "Temporal" bit-serial designs are flexible but suffer from massive hardware overhead due to the logic required for shifters and accumulators.
The 2-in-1 Accelerator employs a hybrid Spatial-Temporal Design. It spatially tiles small bit-serial units to maintain flexibility without the typical area penalties. A key technical contribution is the "first-reduce-then-shift" strategy. By grouping partial products of the same magnitude, they can share a single shifter. This optimization reduces the "shift-add" logic area significantly compared to traditional temporal or spatial designs.
Furthermore, the framework includes an Automated Optimizer based on evolutionary search. This tool finds the optimal dataflow for different precisions, ensuring high hardware utilization regardless of the bit-width selected by the RPS algorithm.
Experimental Results
The 2-in-1 Accelerator was evaluated on standard benchmarks including CIFAR-10/100, SVHN, and ImageNet using models like ResNet and VGG.
- Robustness: RPS-equipped models frequently outperformed full-precision models in robust accuracy. On CIFAR-10, robust accuracy improved by up to 24.48% under various attacks (PGD, AutoAttack, CW-Inf).
- Hardware Efficiency: Compared to state-of-the-art precision-scalable accelerators like Bit Fusion and Stripes, our design achieved up to 7.58× better energy efficiency and 4.59× higher throughput.
- Comparison to Robust Baselines: Against specialized robustness accelerators like DNNGuard, the 2-in-1 Accelerator achieved up to 36.5× higher throughput-per-area.
- Instant Trade-offs: The system supports "instant" robustness-efficiency scaling, allowing IoT devices to adapt to battery levels or security environments without retraining.
Conclusion
The 2-in-1 Accelerator demonstrates that adversarial robustness and hardware efficiency do not have to be a zero-sum game. By treating quantization as a source of defensive randomness and optimizing hardware to support this flexibility, we enable IoT devices to adapt instantaneously to varying resource and security requirements.
Summary updated