NNReArch: A Tensor Program Scheduling Framework Against Neural Network Architecture Reverse Engineering

Yukui Luo, Shijin Duan, Cheng Gongye, Yunsi Fei, Xiaolin Xu · DOI

Introduction

Deep Neural Networks (DNNs) represent significant intellectual property, often requiring massive datasets and extensive computational resources to develop. While much attention has been paid to protecting model weights, the underlying architecture—the specific arrangement of layers and dimensions—is equally critical. Recent research has demonstrated that this architecture is vulnerable to electromagnetic (EM) side-channel attacks. By monitoring the EM emanations of hardware accelerators like FPGAs during execution, adversaries can reconstruct a model's structure. This paper introduces NNReArch, a novel defense framework designed to protect neural network architectures by rescheduling low-level tensor programs and obfuscating hardware activity.

The Threat: EM Side-Channel Reverse Engineering

Accelerators like the Versatile Tensor Accelerator (VTA) execute operations in predictable patterns. Different operations, such as a $3\times3$ versus a $5\times5$ convolution, create distinct EM signatures. An attacker with a specialized probe can "listen" to these signals to identify layer types and parameters. NNReArch addresses this vulnerability by breaking the predictable link between the mathematical operation and its physical EM trace.

The NNReArch Framework

NNReArch operates at the compiler and scheduling level, focusing on three primary stages to secure the execution pipeline:

1. Leakage Characterization

The authors first established a mathematical model relating tensor program code to EM traces. They identified that the EM pattern of a convolution layer follows a specific formula: $Conv2D_{EM} = M \times (N \times w_c + S)$, where $M$ and $N$ represent loop counts, $w_c$ is the execution time per iteration, and $S$ is the stall time. This characterization allows the framework to predict how changes in code will manifest in the EM spectrum.

2. Tensor Program Rescheduling

Instead of relying on a fixed execution schedule, NNReArch explores the "Opt-config" space—the various ways data can be blocked and tiled in hardware. Because multiple schedules can produce the same mathematical result but yield different EM signatures, the framework selects schedules that maximize ambiguity for an attacker without compromising the final output.

3. EM Obfuscation

For high-security requirements, NNReArch employs a "Secure Mode" that utilizes "pause" opcodes. These opcodes inject artificial delays into the execution stream. This allows the framework to make a smaller, faster layer mimic the EM signature of a larger, more complex layer, effectively masking the true nature of the workload from an EM probe.

Experimental Evaluation

The framework was evaluated using a Xilinx PYNQ-Z1 FPGA board running the VTA framework. The authors tested the defense against standard state-of-the-art architectures, including VGG-16, VGG-19, ResNet-18, and ResNet-34.

Security and Performance Trade-offs

NNReArch offers two distinct operating modes to balance security and efficiency:

  • Balance Mode: This mode prioritizes performance while providing a significant security boost. In tests with VGG-19, it increased the attacker's search space (the number of possible configurations to guess) by 2.71x. This was achieved with a negligible performance overhead of only 3.06%.
  • Secure Mode: This mode prioritizes maximum confidentiality. By utilizing EM obfuscation, it makes reverse engineering significantly more difficult, though it incurs a higher performance overhead of approximately 15.42%.

Key Insights

The core innovation of NNReArch lies in treating scheduling as a security parameter. Traditionally, tools like AutoTVM optimize strictly for speed; NNReArch demonstrates that scheduling can simultaneously serve as a defense mechanism. By exploiting the functional redundancy of hardware configurations—where dozens of different schedules produce the same result—NNReArch hides the model's "heartbeat" in plain sight.

Limitations and Future Work

While effective, the current implementation of NNReArch is specifically tailored to the VTA architecture and EM side channels. Future research could explore extending these methodologies to other side channels, such as power analysis, or porting the framework to proprietary accelerators like Google's TPU. Additionally, further study is needed to evaluate the framework against adaptive attackers who might attempt to use machine learning to de-obfuscate the modified EM traces.

Summary updated

BibTeX
@inproceedings{luo2022nnrearch,
  author = {Yukui Luo and Shijin Duan and Cheng Gongye and Yunsi Fei and Xiaolin Xu},
  title = {{NNReArch: A Tensor Program Scheduling Framework Against Neural Network Architecture Reverse Engineering}},
  booktitle = {FCCM},
  year = {2022},
  doi = {10.1109/fccm53951.2022.9786112},
}
Figure