MACPruning: Dynamic Operation Pruning to Mitigate Side-Channel DNN Model Extraction

Ruyi Ding, Cheng Gongye, Davis Ranney, Aidong Adam Ding, Yunsi Fei · DOI

Abstract

Deep Neural Network (DNN) models deployed on edge devices represent significant intellectual property but are increasingly vulnerable to model extraction via side-channel analysis. Traditional cryptographic defenses, such as masking and shuffling, often impose prohibitive computational overheads on resource-constrained microcontrollers (MCUs). This paper presents MACPruning, a lightweight defense mechanism that leverages the inherent robustness of DNNs to mitigate Differential Electromagnetic Analysis (DEMA). By dynamically pruning input pixels and their associated Multiply-Accumulate (MAC) operations, MACPruning introduces temporal jitter and scrambles electromagnetic emissions. Our results demonstrate that MACPruning provides robust security with less than 1% execution overhead and minimal impact on model accuracy.

Introduction

As artificial intelligence migrates to the "edge," deep learning models are frequently deployed on low-power microcontrollers (MCUs) within IoT devices. These deployments expose valuable model weights to Side-Channel Analysis (SCA). Specifically, attackers can employ Differential Electromagnetic Analysis (DEMA) to monitor the minute electromagnetic fluctuations emitted by a chip during computation. By correlating these emissions with known inputs, an adversary can mathematically reconstruct the model's internal weights, effectively stealing the intellectual property.

Standard cryptographic defenses are ill-suited for the scale of DNNs. Masking, which hides data within random noise, can increase latency by over 120%, rendering real-time edge applications non-viable. Shuffling the order of operations provides some protection but often fails to provide sufficient security against high-order attacks. MACPruning addresses this gap by introducing a defense that is as efficient as the neural networks it protects.

Methodology

MACPruning exploits the redundancy and inherent noise tolerance of neural networks. Instead of securing every operation, it introduces strategic, random omissions in the computation chain.

1. Random Pixel Activation Map (RPAM)

The core of the defense involves a Random Pixel Activation Map (RPAM) that determines which input pixels are processed. When a pixel is deactivated, the system skips the corresponding Multiply-Accumulate (MAC) operations in the first layer at run-time. This pruning serves two purposes: it removes the leakage source for specific weights and creates temporal redistribution. Because operations are skipped randomly, the timing of all subsequent operations shifts, creating "jitter" that prevents an attacker from aligning the thousands of EM traces required for a successful DEMA attack.

2. Importance-aware Pixel Activation Map (IaPAM)

To mitigate the potential accuracy degradation caused by random pruning, the authors developed the Importance-aware Pixel Activation Map (IaPAM). This involves a trainable layer that learns to identify "critical" pixels—such as those constituting the primary subject of an image—and ensures they are preserved. Only "less important" pixels, typically background noise, are subjected to random pruning. To facilitate training with a non-differentiable binary mask, the system utilizes a Straight-Through Estimator (STE).

3. The First-Layer Defense Strategy

A key insight of this work is that protecting the first layer of a feed-forward DNN is often sufficient to secure the entire model. Since subsequent layers depend on the outputs of the first layer, an attacker who cannot extract the initial weights lacks the "known" intermediate data necessary to mount an attack on deeper layers.

Experimental Evaluation

Datasets and Architectures

The researchers evaluated MACPruning using the MNIST and CIFAR-10 benchmarks. The defense was tested across several popular architectures, including MobileNetV2, DenseNet121, and GoogleNet, deployed on an ARM Cortex-M4 MCU.

Security and Performance Results

  • Security Strength: MACPruning significantly increases the complexity of model extraction. The defense reduces the "leaky" window to only the first few weights; the vast majority of weights remain protected even when an attacker collects over one million EM traces.
  • Efficiency: Unlike masking (127% overhead) or state-of-the-art shuffling (18% overhead), MACPruning actually reduces the total number of operations. On the ARM Cortex-M4, the execution overhead for MobileNetV2 was measured at less than 1%.
  • Accuracy: By utilizing the IaPAM strategy, the accuracy drop on CIFAR-10 was limited to just 1.72%. In contrast, a purely random approach (RPAM) resulted in an accuracy loss exceeding 15%.

Discussion and Limitations

While MACPruning offers a highly efficient defense for sequential processors like MCUs, its application to parallel hardware remains an area for future study. In devices like GPUs or dedicated NPU accelerators, parallel execution may alter the EM leakage patterns, potentially requiring adaptations to the pruning logic. Additionally, while the defense is highly effective for image classification, further research is needed to validate its performance in other domains, such as Natural Language Processing (NLP) or object detection.

Conclusion

MACPruning represents a paradigm shift in side-channel defenses for edge AI. By turning the inherent redundancy of DNNs into a security feature, it provides a robust shield against model extraction with negligible performance costs. This approach ensures that sophisticated AI models can be safely deployed on the most resource-constrained edge devices without sacrificing intellectual property or operational efficiency.

Summary updated

BibTeX
@inproceedings{ding2025macpruning,
  author = {Ruyi Ding and Cheng Gongye and Davis Ranney and Aidong Adam Ding and Yunsi Fei},
  title = {{MACPruning: Dynamic Operation Pruning to Mitigate Side-Channel DNN Model Extraction}},
  booktitle = {HOST},
  year = {2025},
  doi = {10.1109/host64725.2025.11050072},
}
Figure