MAED: Mathematical Activation Error Detection for Mitigating Physical Fault Attacks in DNN Inference
Organizations: Department of Computer Science and Engineering, University of South Florida, Tampa, FL 33620, USA. · Department of Computer and Electrical Engineering and Computer Science, Florida Atlantic University, Boca Raton, FL 33431, USA.
Abstract
The inference phase of deep neural networks (DNNs) in embedded systems is increasingly vulnerable to fault attacks and failures, which can result in incorrect predictions. These vulnerabilities can potentially lead to catastrophic consequences, making the development of effective mitigation techniques essential. In this paper, we introduce MAED (Mathematical Activation Error Detection), an algorithm-level error detection framework that exploits mathematical identities to continuously validate the correctness of non-linear activation function computations at runtime. To the best of our knowledge, this work is the first to integrate algorithm-level error detection techniques to defend against both malicious fault injection attacks and naturally occurring faults in critical DNN components in embedded systems. The evaluation is conducted on three widely adopted activation functions, namely ReLu, sigmoid, and tanh which serve as fundamental building blocks for introducing non-linearity in DNNs and can lead to mispredictions when subjected to natural faults or fault attacks. We assessed the proposed error detection scheme via fault model simulation, achieving close to 100% error detection while mitigating existing fault attacks on DNN inference. Additionally, the overhead introduced by integrating the proposed scheme with the baseline implementation (i.e., without error detection) is validated through implementations on an AMD/Xilinx Artix-7 FPGA and an ATmega328P microcontroller, as well as through integration with TensorFlow. On the microcontroller, the proposed error detection incurs less than 1% clock cycle overhead, while on the FPGA it requires nearly zero additional area, at the cost of approximately a 20% increase in latency for sigmoid and tanh.
Figures & tables
| Attack Level | Attack Vector | Required Faulty Bits | Model Knowledge | Target Environment | Physical Access | Protected by MAED | Transferability | |
|---|---|---|---|---|---|---|---|---|
| Frameflip [ 26 ] | Code Library (BLAS) | Rowhammer (Software) | 1 | Black-box | Cloud/MLaaS | No | Potentially (if it affects activation output) | High |
| BitFlip [ 24 ] | Model Weights | Rowhammer (Software) | 11-20 | White-box | Cloud/MLaaS | No | No | Low |
| DeepHammer [ 25 ] | Model Weights | Rowhammer (Software) | 11-23 | White-box | Cloud/MLaaS | No | No | Low |
| DeepLaser [ 16 ] | Activation Functions | Laser Injection (Hardware) | 5-15 | Gray-box | Embedded Systems/IoT | Yes | Yes | Medium |
| Effect of attack | Detected through | |
|---|---|---|
| sigmoid | Skipping the negation in the exponent | |
| tanh | Skipping the negation in the exponent | |
| ReLu | Always maps to 0 |
| Parameter | Simulation Settings | ||
|---|---|---|---|
| expo | sigmoid | tanh | |
| Input signal | Range of | ||
| Iterations for each simulation | 1000 | ||
| Taylor terms number | 30 | 30 | 40 |
| Round-off error | |||
| Model | # | Fault Detection Ratio (%) | |||
|---|---|---|---|---|---|
| Expo | Sigmoid | tanh | |||
| 1 | 1 | 96.1 | 99.1 | 96.5 | |
| 1 | 5 | 96.6 | 99.4 | 97.7 | |
| Bit flipping | 3 | 1 | 95.6 | 98.2 | 95.3 |
| 3 | 5 | 98.3 | 99.5 | 97.3 | |
| 6 | 1 | 97.5 | 98.7 | 97.7 | |
| Model | # | Fault Detection Ratio (%) | |||
|---|---|---|---|---|---|
| Expo | Sigmoid | tanh | |||
| 1 | 2 | 95.2 | 97.9 | 96 | |
| 1 | 5 | 95.9 | 98 | 95.8 | |
| Bit flipping | 3 | 2 | 94.2 | 98 | 96.1 |
| 3 | 5 | 95 | 98.2 | 95.6 | |
| 6 | 2 | 97.1 | 98.3 | 97.3 | |
| Model | # | Fault Detection Ratio (%) | ||
|---|---|---|---|---|
| Expo | sigmoid | tanh | ||
| 1 | 90.8 | 93 | 92.9 | |
| 2 | 95.5 | 95.4 | 95.9 | |
| Skipping | 3 | 96.8 | 97.1 | 97.5 |
| 4 | 98.1 | 98.7 | 98.4 | |
| 5 | 98.5 | 99.1 | 98.4 | |
| Activation Function | Average Inference Time (ms) | Model Size (MB) |
| tanh 1 | 0.284 | 0.37 |
| error_tanh 2 | 0.432 | 0.37 |
| sigmoid 1 | 0.294 | 0.37 |
| error_sigmoid 2 | 0.458 | 0.37 |
| ReLu 1 | 0.283 | 0.37 |
| error_ReLu 2 | 0.313 | 0.37 |
| Activation Function | Clock Cycles | Time ( s) | Overhead (%) |
| tanh 1 | 9,933,888 | 620,868 | - |
| error_tanh 2 | 9,934,400 | 620,900 | 0.0052% |
| sigmoid 1 | 9,927,808 | 620,488 | - |
| error_sigmoid 2 | 9,940,928 | 621,308 | 0.132% |
| 1 Baseline, 2 Protected | |||
| Scheme | Protected | Baseline | |
|---|---|---|---|
| Area | LUTs | 2,934 | 2,896 |
| DSPs | 18 | 18 | |
| Timing | Latency (CCs) | 9 | 7 |
| Total time (ns) | 64.26 | 49.98 | |
| Power (W) @ 140 MHz | 0.214 | 0.212 | |
| Energy (nJ) | 13.75 | 10.59 |
Fault Detection
Fault detection identifies abnormal behavior in machines, sensors, infrastructure, software, and autonomous systems before it causes harm or disruption.
See all 104 papers