Adversarial Neuron Pruning Purifies Backdoored Deep Models

Dongxian Wu, Yisen Wang

Introduction

As deep neural networks (DNNs) grow in complexity and computational demands, many organizations are outsourcing their training to third-party platforms, commonly known as Machine Learning as a Service (MLaaS). While cost-effective, this practice introduces a massive security loophole: a malicious trainer can inject a hidden backdoor into the model.

A backdoored model performs perfectly on standard benchmarks, appearing completely benign. However, it will intentionally misclassify an input if a specific, attacker-defined trigger (such as a single altered pixel or a subtle checkerboard pattern) is present. For defenders, the primary challenge lies in "post-training" repair. When downloading a pre-trained model, it is incredibly difficult to remove a backdoor without knowing what the trigger looks like or having access to the original training data. Previous defense methods often required reconstructing the trigger—which is increasingly difficult for complex, dynamic attacks—or performing heavy fine-tuning that degrades the model's original accuracy.

To address this, researchers have introduced Adversarial Neuron Pruning (ANP), a novel defense mechanism that identifies and removes these hidden backdoors by exploiting the extreme sensitivity of "sleeper" neurons to adversarial perturbations. Remarkably, ANP requires as little as 1% of clean data to purify the model.

Methodology: The Min-Max Optimization

The authors propose a novel approach based on a critical observation: neurons responsible for backdoors remain "dormant" on clean data but are highly sensitive to internal perturbations.

Adversarial Neuron Pruning (ANP) operates through a min-max optimization framework:

  1. Adversarial Perturbation (The "Poke"): Instead of perturbing the input image (as in standard adversarial attacks), the algorithm applies small adversarial perturbations directly to the neurons themselves (the weights and biases). It searches for the specific internal noise that maximizes the classification loss on a small, clean dataset.
  2. Pruning Mask (The "Shield"): Simultaneously, the algorithm learns a continuous "mask" for every neuron. This mask attempts to minimize the loss, effectively identifying which neurons are most responsible for the model's sudden collapse under the applied perturbation.
  3. The Purge: Once the sensitive neurons are identified—indicated by low mask values—they are permanently pruned (set to zero).

Unlike traditional pruning techniques that rely on heuristics like removing neurons with low activations, ANP is entirely data-driven and specifically targets the unique vulnerabilities of backdoored models.

Key Insights and Vulnerabilities

The foundation of ANP rests on two surprising discoveries about how backdoored models react to internal noise.

1. The Sensitivity Gap Backdoored models are significantly easier to "break" via neuron perturbation than benign models. Even without the trigger present in the input data, perturbing the neurons of a backdoored model causes its error rate to spike much faster than a clean model under the same perturbation budget.

Error rate of different models under neuron perturbations.

2. Triggerless Activation The most revealing insight is that adversarially perturbing neurons can trick a backdoored model into revealing its target label even on clean samples. The internal perturbation essentially "wakes up" the sleeper neurons associated with the backdoor, causing the model to overwhelmingly predict the attacker's target class.

Proportion of classes predicted under perturbation.

Furthermore, while some existing defenses only analyze the final layers of a network, ANP identifies sensitive neurons globally across the entire architecture. This makes it substantially more robust against sophisticated attacks that embed triggers deep within the model's feature extractors.

Experimental Results

The researchers rigorously evaluated ANP on the CIFAR-10 dataset across several popular architectures, including ResNet-18, ResNet-50, VGG-19, and MobileNet-V2. They tested the defense against five state-of-the-art backdoor attacks: static triggers (BadNets), invisible triggers (Blend), and dynamic triggers like Input-aware Backdoors (IAB).

Crucially, the defense was executed using only 1% (500 images) or even 0.1% (50 images) of the clean training data. ANP consistently outperformed existing defenses like standard fine-tuning and fine-pruning:

  • Backdoor Removal: In 5 out of 6 attack scenarios, ANP successfully reduced the Attack Success Rate (ASR) from nearly 100% down to less than 1%.
  • Accuracy Preservation: The average drop in clean data accuracy (ACC) was a mere 1.47%, significantly lower than the 7%+ drops frequently observed with aggressive fine-tuning methods.
  • Efficiency: The method proved highly effective even with extremely limited computation. Just 100 iterations of the optimization process were sufficient to distinguish backdoor neurons from benign ones.

Limitations and Future Directions

While highly effective, ANP does have some limitations. The authors noted that different architectures respond differently to pruning. For instance, MobileNet-V2 is inherently more sensitive to pruning than ResNet, requiring a smaller perturbation budget to avoid degrading clean accuracy.

Additionally, while ANP is faster than full adversarial training, the min-max optimization step still requires more computational overhead than simple fine-tuning. Preliminary tests suggest that pruning neurons in specific structural layers might yield even greater efficiency, pointing toward a promising direction for future research in structural pruning defenses.

Summary updated

BibTeX
@inproceedings{wu2021adversarial,
  author = {Dongxian Wu and Yisen Wang},
  title = {{Adversarial Neuron Pruning Purifies Backdoored Deep Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=JucgOLBZYU2},
}
Figure