ImpNet: Imperceptible and blackbox-undetectable backdoors in compiled neural networks

Eleanor Clifford, Ilia Shumailov, Yiren Zhao, Ross Anderson, Robert Mullins · DOI

TL;DR

ImpNet introduces a new class of "weight-independent" backdoors that are injected during the model compilation phase rather than during training. Because these backdoors do not alter model weights or training data, they are invisible to all existing weight-based and data-centric defenses, achieving a 100% attack success rate with zero impact on clean inputs.

What Problem Does This Paper Address?

Traditional backdoor attacks in machine learning (ML) typically involve poisoning the training data or manipulating the model's weights. Consequently, most state-of-the-art defenses focus on these two areas: inspecting datasets for outliers or analyzing model weights for suspicious patterns.

The authors of ImpNet identify a critical blind spot: the ML supply chain. Even if your data is clean and your training process is secure, the compiler used to turn that high-level model into executable machine code could be malicious. This is a modern ML adaptation of Ken Thompson’s classic "Reflections on Trusting Trust" attack. If an attacker controls the compiler, they can inject malicious logic that bypasses the model's learned weights entirely.

Overview of the ML pipeline showing potential backdoor insertion points (letters) and observation points (numbers).

Methods

The researchers developed ImpNet, a backdoor inserted during the compilation process (specifically using the TVM compiler). Unlike previous attacks, ImpNet is "weight-independent"—it adds a small module to the model's computational graph that acts as a conditional switch.

Key technical components include:

  • Graph IR Injection: The backdoor is inserted at the Graph Intermediate Representation (IR) level. The compiler is modified to add a "Backdoor Detector" module that runs in parallel with the original model logic.
  • High-Entropy Triggers: To ensure the backdoor isn't triggered by accident, the authors use triggers with high entropy.
  • Images: A 10x10 steganographic patch where pixel values are subtly perturbed. This trigger has 300 bits of entropy, making it statistically impossible to occur naturally.
  • Text: A binary mask encoded through the spacing of common words (like "and") or the use of invisible Unicode characters (like blank Braille characters).
  • Conditional Execution: If the detector identifies the trigger, it suppresses the model's actual output and replaces it with the attacker's chosen malicious output.
Logic for backdoor addition performed on the Graph IR.

Datasets

The paper evaluates the stealth and effectiveness of ImpNet using:

  • Wikipedia Dataset: Used to verify the NLP trigger's uniqueness. The authors searched the entire English Wikipedia for their specific "and"-based trigger sequence and found zero matches, confirming its high entropy.
  • Standard Benchmarks: While the paper focuses on the attack mechanism, it compares ImpNet's performance against existing backdoor papers that utilized standard image (e.g., ImageNet) and NLP (e.g., BERT-based) tasks.

Key Insights and Ideas

  • The "Weight-Independent" Paradigm: This is the paper's most significant contribution. By operating at the compiler level, the attack logic exists outside the neural network's weights. This renders defenses like weight pruning, fine-tuning, or weight-distribution analysis completely useless.
  • Blackbox-Undetectability: Because the trigger has such high entropy, a defender cannot find it by simply querying the model with random or even adversarial inputs. It acts like a password that only the attacker knows.
  • Imperceptibility: The triggers are designed to be invisible to humans. In images, the changes are steganographic; in text, they use invisible characters or natural-looking word frequencies.
Example of an image with and without the steganographic trigger. To a human, they look identical.

Key Results

ImpNet demonstrates superior performance compared to traditional backdoor methods across two primary metrics:

  1. Attack Success Rate (ASR): ImpNet achieved a 100% ASR in both image and NLP tasks.
  2. Benign Accuracy Decrease (BAD): ImpNet resulted in 0.0% BAD. Because the backdoor logic is a clean conditional branch that only activates on the specific trigger, the model's performance on legitimate data is perfectly preserved.

In contrast, many data-poisoning attacks (like BadNets) often cause a slight drop in accuracy on clean data, which can serve as a red flag for defenders.

Limitations and Future Work

  • Preprocessing Defenses: The authors acknowledge that some input-side defenses, like aggressive JPEG compression or adding Gaussian noise to images, could potentially "break" the steganographic trigger. However, they suggest that more robust triggers (e.g., those operating in the frequency domain) could likely bypass these.
  • Detection via Binary Analysis: While difficult, a sophisticated defender using tools like GHIDRA could potentially spot the extra 600 lines of code added to the compiled subfunctions. However, the authors note that code obfuscation and function renaming could make this task nearly intractable for complex models.
  • The Path Forward: The paper concludes that the only real defense is provenance. The ML community must move toward verified compilers and a "chain of custody" for models that spans from raw data all the way to the hardware execution.

Summary updated

Abstract

Early backdoor attacks against machine learning set off an arms race in attack and defence development. Defences have since appeared demonstrating some ability to detect backdoors in models or even remove them. These defences work by inspecting the training data, the model, or the integrity of the training procedure. In this work, we show that backdoors can be added during compilation, circumventing any safeguards in the data preparation and model training stages. The attacker can not only insert existing weight-based backdoors during compilation, but also a new class of weight-independent backdoors, such as ImpNet. These backdoors are impossible to detect during the training or data preparation processes, because they are not yet present. Next, we demonstrate that some backdoors, including ImpNet, can only be reliably detected at the stage where they are inserted and removing them anywhere else presents a significant challenge. We conclude that ML model security requires assurance of provenance along the entire technical pipeline, including the data, model architecture, compiler, and hardware specification.
BibTeX
@inproceedings{clifford2022impnet,
  author = {Eleanor Clifford and Ilia Shumailov and Yiren Zhao and Ross Anderson and Robert Mullins},
  title = {{ImpNet: Imperceptible and blackbox-undetectable backdoors in compiled neural networks}},
  booktitle = {SaTML},
  year = {2022},
  url = {https://openreview.net/forum?id=7bzPHUsrLCq},
}
Figure