Stealthy Backdoors as Compression Artifacts

Yulong Tian, Fnu Suya, Fengyuan Xu, David Evans

TL;DR

This paper introduces a novel "time-of-check, time-of-use" vulnerability in machine learning: backdoors that are dormant and undetectable in a full-sized model but activate once the model is compressed (pruned or quantized) for deployment. It highlights a critical security gap: vetting a model in its original form does not guarantee its safety after it has been optimized for edge devices.

What Problem Does This Paper Address?

Modern Deep Neural Networks (DNNs) are massive, often containing millions or billions of parameters. To run these models on resource-constrained hardware like smartphones or IoT devices, engineers use model compression—specifically pruning (removing "unimportant" connections) and quantization (reducing the bit-precision of weights).

The authors identify a dangerous assumption in current MLOps: that a model vetted and approved in a central repository will remain "clean" after compression. They demonstrate that a malicious trainer can inject a backdoor that is a "compression artifact." This backdoor remains hidden during standard security audits of the high-precision, full-sized model but becomes highly effective once the model is compressed for deployment. This allows an adversary to bypass the security checks of model repositories like ModelZoo.

Methods

The authors designed specialized training regimes for two dominant compression techniques:

  1. Quantization-Aware Backdoors: The attacker uses Quantization-Aware Training (QAT) to simulate the rounding errors that occur when moving from 32-bit floating-point to 8-bit integers. The loss function is designed to ensure the model behaves normally in high precision but misclassifies "triggered" inputs once those specific rounding artifacts appear.
  2. Pruning-Aware Backdoors: The attacker predicts which weights an "auto-compress" tool will likely remove. They then "hide" the backdoor logic within the sub-network that survives the pruning process. They even developed a "ranged" attack that remains effective even if the attacker doesn't know the exact final pruning rate (e.g., whether 30% or 50% of the model is removed).
  3. Distilled Attacks for Stealth: To evade advanced "meta-classifier" detectors (like MNTD) that look for suspicious decision boundaries, the authors used Knowledge Distillation. They forced the backdoored model to mimic the soft-label outputs of a known "clean" teacher model, making the uncompressed backdoored model's behavior indistinguishable from a legitimate one.

Datasets

The effectiveness of these attacks was evaluated using:

  • CIFAR-10: A standard 10-class object recognition dataset.
  • GTSRB (German Traffic Sign Recognition Benchmark): A 43-class dataset for traffic sign classification, a common target for safety-critical backdoor research.
  • Calibration Datasets: For quantization attacks, they tested scenarios where the deployer uses different data for calibration, including SVHN (Street View House Numbers), CIFAR-100, and TSRD (Chinese Traffic Sign Database).

Key Insights and Ideas

  • The Transformation is the Trigger: Traditionally, a backdoor is triggered by a pattern in the input (like a white square in the corner of an image). Here, the "trigger" is the act of compression itself. Without the loss of precision or connectivity, the malicious logic never manifests.
  • Vetting Gap: The paper proves that "security-as-a-service" for model repositories is currently flawed. If the repository tests the FP32 model and the user deploys an INT8 model, the security guarantee is void.
  • Distillation as a Mask: One of the most striking findings is that using a clean model as a "teacher" during the malicious training process effectively masks the backdoor from state-of-the-art detectors like MNTD and Neural Cleanse.

Key Results

  • High Attack Success: In most settings, the compressed models achieved an Attack Success Rate (ASR) of over 90%, while the uncompressed versions maintained an ASR near 0% (appearing perfectly clean).
  • Negligible Accuracy Drop: The backdoored models performed almost as well as clean models on normal inputs, with accuracy drops typically less than 1%.
  • Evasion: The "distilled" versions of the attacks successfully bypassed both Neural Cleanse and MNTD when the models were in their uncompressed state.
  • Simple Defense: The authors found a straightforward countermeasure: test the model in its final, deployed form. When the security tools were run after compression, they were once again able to detect the backdoors.

Limitations and Future Work

  • Knowledge of Tools: The attack assumes the adversary knows which popular compression framework (like PyTorch or TensorFlow) the deployer will use, although they don't need to know the exact parameters.
  • Scope: The study focused primarily on computer vision. Whether similar artifacts can be hidden in Transformer-based NLP models or Reinforcement Learning agents remains an open question.
  • Adaptive Deployers: Future work could explore how attackers might respond if deployers begin using randomized or non-standard compression techniques to "break" the artifact.

Summary updated

BibTeX
@article{tian2022stealthy,
  author = {Yulong Tian and Fnu Suya and Fengyuan Xu and David Evans},
  title = {{Stealthy Backdoors as Compression Artifacts}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2022},
  url = {https://openreview.net/forum?id=NpeMDfSHTlQ},
}
Figure