Abstract
Machine learning has become mainstream across industries. Numerous examples proved the validity of it for security applications. In this work, we investigate how to reverse engineer a neural network by using only power side-channel information. To this end, we consider a multilayer perceptron as the machine learning architecture of choice and assume a non-invasive and eavesdropping attacker capable of measuring only passive side-channel leakages like power consumption, electromagnetic radiation, and reaction time. We conduct all experiments on real data and common neural net architectures in order to properly assess the applicability and extendability of those attacks. Practical results are shown on an ARM CORTEX-M3 microcontroller. Our experiments show that the side-channel attacker is capable of obtaining the following information: the activation functions used in the architecture, the number of layers and neurons in the layers, the number of output classes, and weights in the neural network. Thus, the attacker can effectively reverse engineer the network using side-channel information. Next, we show that once the attacker has the knowledge about the neural network architecture, he/she could also recover the inputs to the network with only a single-shot measurement. Finally, we discuss several mitigations one could use to thwart such attacks.
Introduction
As machine learning moves to "the edge"—running on embedded devices like smartphones, IoT sensors, and medical implants—the models themselves become valuable intellectual property (IP). Companies often keep their network architectures and trained weights secret to protect their competitive advantage or to prevent attackers from finding "adversarial examples." While developers might disable debug ports (like JTAG) to prevent firmware extraction, the hardware itself "leaks" information during computation. This paper investigates whether a passive attacker can use these side-channels—specifically power consumption and electromagnetic (EM) radiation—to steal the model's structure and sensitive data without physical access to internal memory.
Methodology
The researchers treat the neural network as a cryptographic target, applying techniques originally designed to crack encryption. The experiments were conducted on two popular platforms: an 8-bit Atmel ATmega328P and a 32-bit ARM Cortex-M3.
The attack methodology consists of three primary techniques:
- Simple Power Analysis (SPA): By analyzing a single EM trace, researchers can visually identify boundaries between layers and count neurons.
- Correlation Power Analysis (CPA): To recover secret weights ($w$), they target multiplication operations ($m = x \cdot w$). By attacking the 23-bit mantissa of IEEE 754 floating-point representations byte-by-byte, they correlate hypothetical weights with measured leakage.
- Horizontal Power Analysis (HPA): Once the model is known, the input data ($x$) can be recovered from a single computation trace by observing multiple multiplications involving the same unknown input across different neurons.
Analysis and Insights
A key discovery is that different operations and activation functions have distinct "signatures" in the power domain. Activation functions like ReLU, Sigmoid, Tanh, and Softmax exhibit wildly different timing and power profiles. ReLU is the fastest and least detectable, whereas functions involving exponentiation (like Sigmoid) are computationally expensive and easily identified.
Furthermore, the study debunks the myth that floating-point math provides inherent protection. By breaking 32-bit floats into constituent bytes, attackers can recover weights with precision up to 0.01. Most critically, the "single-shot" threat allows an attacker who knows the model to recover input data from just one measurement, posing a severe privacy risk for sensitive data.
Results
The attacks proved highly effective across multiple dimensions:
- Architecture Recovery: SPA allowed for perfect identification of the number of layers and neurons.
- Weight Recovery: CPA successfully recovered secret weights, narrowing the search space so significantly that remaining errors were negligible for model performance.
- Input Recovery: The single-shot attack was reliable for networks with at least 40 neurons in the first hidden layer.
- Cross-Platform Success: While the 32-bit ARM Cortex-M3 had a higher signal-to-noise ratio, the attacks remained practical, requiring only roughly twice as many measurements as the 8-bit AVR.
Discussion and Conclusion
While this work focuses on Multilayer Perceptrons (MLPs), the principles apply to the fully connected layers of Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs). However, specialized layers like convolutions require further study. Potential mitigations, such as shuffling neuron execution or data masking, introduce significant performance overhead. Balancing security with the resource constraints of embedded devices remains a critical open challenge.
Summary updated