CSI Neural Network: Using Side-channels to Recover Your Artificial Neural Network Information

Lejla Batina, Shivam Bhasin, Dirmanto Jap, Stjepan Picek

TL;DR

Researchers have demonstrated that "listening" to the electromagnetic and power leakages of a microcontroller can fully reveal a hidden neural network's architecture, its secret weights, and even the private data it is processing. By applying classic side-channel analysis to machine learning, the team successfully reverse-engineered models on common hardware like the ARM Cortex-M3 with high precision.

What Problem Does This Paper Address?

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 someone from simply reading the firmware, 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 the sensitive data it handles, even without physical access to the chip's internal memory.

Methods

The authors treat the neural network as a cryptographic target, applying techniques originally designed to crack encryption:

  1. Simple Power Analysis (SPA): By looking at a single EM trace, the researchers could visually identify the boundaries between layers and count the number of neurons. Different operations, like multiplications versus activation functions, create distinct visual patterns in the signal.
  2. Correlation Power Analysis (CPA): To recover the secret weights ($w$), they targeted the multiplication operation ($m = x \cdot w$). Since the microcontrollers used IEEE 754 floating-point representation, the authors attacked the 23-bit mantissa byte-by-byte. By correlating hypothetical weight values with the measured EM leakage, they could pinpoint the actual weights used.
  3. Horizontal Power Analysis (HPA): Once the model is known, the authors showed how to recover the input data ($x$) from a single computation trace. By observing multiple multiplications involving the same unknown input across different neurons, they could statistically infer the input value.

The experiments were conducted on two popular platforms: an 8-bit Atmel ATmega328P and a 32-bit ARM Cortex-M3.

The experimental setup involves a decapsulated chip and a near-field EM probe to capture leakages.

Datasets

The study evaluated the attacks using standard Multilayer Perceptron (MLP) architectures. While they mention the MNIST database (handwritten digits) as a common benchmark, their primary focus was on the feasibility of the attack against real-valued (floating-point) data, which is more complex to recover than simple integers. They tested networks with varying depths and widths, including deep networks with three hidden layers.

Key Insights and Ideas

  • Activation Functions are "Loud": Different activation functions (ReLU, Sigmoid, Tanh, Softmax) have wildly different timing and power signatures. ReLU is the "quietest" and fastest, while functions involving exponentiation and division (like Sigmoid) are computationally expensive and easy to identify.
Distinct timing behaviors for different activation functions allow for easy identification.
  • Floating Point is Not a Shield: A common misconception is that the complexity of floating-point math protects against side-channel attacks. This paper proves that by breaking the 32-bit float into its constituent bytes (sign, exponent, mantissa), an attacker can recover weights with a precision of up to 0.01.
  • The "Single-Shot" Threat: Perhaps most surprisingly, the authors showed that if an attacker knows the model, they only need one measurement of a single input being processed to recover that input. This is a massive privacy risk for devices processing medical or financial data.

Key Results

  • Architecture Recovery: Using SPA, the researchers could perfectly identify the number of layers and neurons by simply looking at the EM traces.
  • Weight Recovery: Using CPA, they successfully recovered secret weights. Even when the attack didn't yield the exact value, it narrowed the search space so significantly that the remaining error was negligible for the model's performance.
  • Input Recovery: The "single-shot" input recovery attack was highly effective on medium-to-large networks. For a network with at least 40 neurons in the first hidden layer, the input could be reliably recovered from a single EM trace.
  • Cross-Platform Success: While the 32-bit ARM Cortex-M3 had a higher signal-to-noise ratio (making it slightly harder to attack than the 8-bit AVR), the attacks were still entirely practical, requiring only about twice as many measurements.
CPA results showing the correlation peaks for different bytes of the weight's mantissa.

Limitations and Future Work

The paper primarily focuses on Multilayer Perceptrons (MLPs). While MLPs are foundational, modern deep learning relies heavily on Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs). The authors note that while the fully connected layers in these networks are vulnerable to the same attacks, specialized layers like convolutions or max-pooling require further study.

Additionally, the proposed mitigations—such as shuffling the order of neuron execution or "masking" data with random values—come with significant performance and area overheads. Finding a balance between security and the strict resource constraints of embedded devices remains an open challenge for the community.

Summary updated

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.
BibTeX
@article{batina2018csi,
  author = {Lejla Batina and Shivam Bhasin and Dirmanto Jap and Stjepan Picek},
  title = {{CSI Neural Network: Using Side-channels to Recover Your Artificial Neural Network Information}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2018},
  url = {https://openreview.net/forum?id=crWnCNTw_tr},
}

Loading related content...

Figure