TL;DR
This paper introduces RADAR, a novel system designed to detect and mitigate adversarial weight attacks on neural networks during runtime. RADAR uses a lightweight checksum mechanism on grouped and interleaved weights to identify malicious bit-flips, and then zeros out affected weights to recover accuracy, all with minimal performance overhead.
What Problem Does This Paper Address?
Neural networks are increasingly deployed in critical applications, making their security paramount. While adversarial attacks on input data are well-studied, a more insidious threat is emerging: adversarial weight attacks. These attacks directly corrupt the model's weights, often by flipping a small number of bits in memory. The Progressive Bit-Flip Attack (PBFA) is particularly concerning because it can be executed at runtime on weights stored in DRAM, leading to a catastrophic drop in accuracy, sometimes to near-random guessing levels, with just a handful of bit flips. Existing defenses like ECC or standard integrity checks are either too slow, too resource-intensive, or not specifically designed to counter these targeted adversarial attacks. This paper aims to fill this gap by providing an efficient, runtime solution for detecting and recovering from such weight attacks.
Methods
RADAR employs a two-pronged approach: detection and recovery.
Detection: The core of RADAR's detection mechanism is a checksum-based signature. Weights within a layer are first interleaved, meaning weights that were originally far apart in memory are brought together into groups. This interleaving helps to scatter potential bit-flips across different groups, making it harder for an attacker to corrupt an entire group with a few flips. Within each group, weights are further processed using a secret key for masking, which adds a layer of security against attackers who might know the general checksum approach but not the specific key. A checksum is then computed on these masked and interleaved weights. This checksum is then binarized into a 2-bit signature for each group. At runtime, this signature is recomputed and compared against a securely stored "golden" signature. A mismatch signals a potential attack.
Recovery: Upon successful detection of an attack in a group, RADAR implements a simple yet effective recovery strategy: it zeros out all weights within that detected group. The authors argue that PBFA attacks often cause large changes in weight values, significantly impacting the network's output. By zeroing out the affected weights, the impact of these malicious flips is mitigated, allowing the network to regain a substantial portion of its lost accuracy. This recovery step is integrated directly into the inference process.
Datasets
The paper evaluates RADAR using two standard datasets:
- CIFAR-10: Used with an 8-bit quantized ResNet-20 model.
- ImageNet: Used with an 8-bit quantized ResNet-18 model.
Key Insights and Ideas
- Runtime vulnerability: The paper highlights that DRAM-based weight attacks can occur during inference, making periodic checks insufficient.
- Interleaving and masking are key: Simply using a checksum isn't enough. The combination of interleaving weights (to scatter attacks) and masking them with a secret key (to obscure the checksum calculation) significantly enhances detection robustness.
- Zeroing out is effective recovery: The counter-intuitive approach of zeroing out weights in an attacked group surprisingly restores a significant amount of accuracy, suggesting that the impact of a few bit-flips is more detrimental than a group of zeros in many cases.
- MSB focus: PBFA primarily targets the Most Significant Bits (MSBs) of weights, as flipping these has the largest impact. RADAR's detection strategy leverages this by focusing on detecting changes in these critical bits.
Key Results
- Detection Performance: RADAR can detect an average of 9.6 out of 10 injected bit-flips for the ResNet-18 ImageNet model. With interleaving, detection performance remains high even for larger group sizes.
- Accuracy Recovery: For the ResNet-18 ImageNet model, RADAR can restore accuracy from a mere 0.18% (after 10 bit-flips) to over 60%. For ResNet-20 on CIFAR-10, accuracy can be recovered to over 80% with 5 bit-flips.
- Low Overhead:
- Time: System-level simulations on gem5 show RADAR adds less than 1% to inference time for ResNet-18.
- Storage: The storage overhead for signatures is minimal, around 5.6 KB for ResNet-18, making it feasible to store securely on-chip.
- Knowledgeable Attacker: Even when the attacker knows a checksum scheme is in place but not the secret key or interleaving strategy, RADAR with interleaving maintains good detection and recovery performance.
Limitations and Future Work
- MSB focus limitation: The 2-bit signature is less effective at detecting bit-flips in less significant bits. While the paper suggests a 3-bit signature as a potential solution for improved detection of attacks on MSB-1, this comes with increased storage overhead.
- Attacker knowledge: The current scheme assumes the attacker doesn't know the secret key or interleaving strategy. Future work could explore defenses against attackers with more advanced knowledge.
- Group size tradeoff: The paper discusses the tradeoff between group size (G), detection performance, and recovery accuracy. Choosing the optimal G is application-dependent.
- Further optimization: While overhead is low, further optimization for multi-batch inference settings is mentioned as a possibility.
Summary updated