Subnet Replacement: Deployment-stage backdoor attack against deep neural networks in gray-box setting

Xiangyu Qi, Jifeng Zhu, Chulin Xie, Yong YangarXiv 2021

Abstract

This paper investigates the realistic potential of conducting backdoor attacks against deep neural networks (DNNs) during the deployment stage. We propose the Subnet Replacement Attack (SRA), a deployment-stage algorithm that embeds backdoors by directly modifying a limited number of model parameters. Abandoning the restrictive white-box assumption, SRA operates in a gray-box setting where only the architecture information of the victim model is available. The core philosophy is that for any neural network instance of a known architecture, a backdoor can be embedded by replacing a narrow subnet of the benign model with a malicious one designed to be sensitive to a specific trigger pattern.

Introduction

Most research on neural network backdoor attacks focuses on the pre-deployment stage, such as data poisoning or tampering with pre-trained models. However, these methods are vulnerable to pre-deployment model diagnosis and sanitization. Recent "adversarial weight attacks" target the model's parameters in dynamic memory (RAM) after deployment, bypassing standard ML defenses. Yet, existing memory-tampering attacks typically require a white-box assumption—full access to parameter values and gradients. SRA addresses this gap by requiring only architectural knowledge, making deployment-stage attacks significantly more practical in real-world environments.

Methodology: Subnet Replacement Attack (SRA)

The SRA workflow consists of two primary phases: backdoor subnet generation and malicious memory modification.

  1. Backdoor Subnet Generation: Using only the target architecture, the attacker designs a narrow subnetwork (e.g., a single channel per convolutional layer). This subnet is trained offline to act as a trigger detector, outputting a massive activation value (e.g., 100) when the backdoor trigger is present and zero otherwise.
  2. Malicious Memory Modification: Once the victim model is deployed, the attacker uses system-level techniques to overwrite a corresponding clean subnet in the victim's memory with the pre-trained malicious weights. The output of this malicious subnet is connected to the target class, while its cross-connections to the rest of the network are severed by setting their weights to zero.
Overview of the Subnet Replacement Attack (SRA) workflow, from subnet generation to memory modification.

Because the attacker overwrites a structural block with pre-calculated weights, they do not need to read or analyze the victim's existing in-memory weights, fulfilling the gray-box requirement.

Experimental Evaluation

The effectiveness of SRA was evaluated using the CIFAR-10 and VGGFace datasets. On CIFAR-10 with a VGG16 model, replacing less than 0.05% of the model's capacity caused the attack success rate to skyrocket from 0.77% to 96.01%, while the clean accuracy dropped by a negligible 0.31% on average.

Performance metrics for SRA across 10 different model instances for both CIFAR-10 and VGGFace datasets.

The attack proved consistent across 10 different model instances trained with different random seeds, demonstrating its robustness. Furthermore, the authors successfully executed the attack on a real server using software-level memory tampering techniques like DLL hooking and remote thread injection.

Key Insights and Conclusion

SRA demonstrates that architecture knowledge alone is sufficient to hijack a deployed model with extreme parameter efficiency. By modifying less than 0.05% of the model's capacity, attackers can achieve high success rates with minimal impact on normal performance. This shift in the attack surface from the ML pipeline to the deployment environment highlights a critical need for runtime defense techniques and memory-integrity checks specifically tailored for deep learning models. While the attack requires system-level privileges, it bypasses all standard pre-deployment ML defenses, shifting the security burden to systems engineers.

Summary updated

BibTeX
@misc{qi2021subnet,
  author = {Xiangyu Qi and Jifeng Zhu and Chulin Xie and Yong Yang},
  title = {{Subnet Replacement: Deployment-stage backdoor attack against deep neural networks in gray-box setting}},
  year = {2021},
  eprint = {2107.07240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.07240},
}
Figure