NBA: defensive distillation for backdoor removal via neural behavior alignment

Zonghao Ying, Bin Wu · DOI

Abstract

Recently, deep neural networks have been shown to be vulnerable to backdoor attacks. A backdoor is inserted into neural networks via this attack paradigm, thus compromising the integrity of the network. As soon as an attacker presents a trigger during the testing phase, the backdoor in the model is activated, allowing the network to make specific wrong predictions. It is extremely important to defend against backdoor attacks since they are very stealthy and dangerous. In this paper, we propose a novel defense mechanism, Neural Behavioral Alignment (NBA), for backdoor removal. NBA optimizes the distillation process in terms of knowledge form and distillation samples to improve defense performance according to the characteristics of backdoor defense. NBA builds high-level representations of neural behavior within networks in order to facilitate the transfer of knowledge. Additionally, NBA crafts pseudo samples to induce student models exhibit backdoor neural behavior. By aligning the backdoor neural behavior from the student network with the benign neural behavior from the teacher network, NBA enables the proactive removal of backdoors. Extensive experiments show that NBA can effectively defend against six different backdoor attacks and outperform five state-of-the-art defenses.

The Threat of Backdoor Attacks

Deep learning models are increasingly outsourced to third parties or downloaded from public repositories, creating a significant security loophole known as backdoor attacks. In these scenarios, an attacker injects a "trigger" (such as a specific pixel pattern) into the training data. The resulting model performs perfectly on normal data but behaves maliciously when the trigger is present—for instance, misclassifying a "Stop" sign as a "Speed Limit" sign.

A backdoored network misclassifying a poisoned sample while correctly identifying a clean sample.

Because neural networks are essentially "black boxes," these backdoors are incredibly difficult to detect. Existing defenses often rely on Knowledge Distillation (KD), where a small clean dataset is used to train a "student" model to mimic a "teacher" model. However, previous methods often look at a narrow slice of the network's internal state, leaving the backdoor partially intact or degrading the model's overall accuracy.

Methods: Neural Behavioral Alignment (NBA)

NBA optimizes the distillation process by focusing on the internal "behaviors" of the network rather than just the final output. The framework consists of two primary components: Triple-Threat Knowledge Representation and Active Unlearning via Pseudo-Samples.

Triple-Threat Knowledge Representation

Instead of monitoring a single data type, NBA aligns three distinct neural behaviors between the teacher and student networks:

  • Response Behavior: Uses Gram matrices of feature maps to capture high-level internal representations while filtering out redundant noise.
  • Learning Behavior: Captures the transformation of data between adjacent layers, teaching the student the internal logic the teacher uses to process information.
  • Prediction Behavior: Uses "dark knowledge" (softened output probabilities) to ensure the final decision-making process is aligned.
The NBA framework comparing (a) traditional finetuning with (b) the proposed defensive distillation process using multiple loss functions.

Active Unlearning via Pseudo-Samples

To proactively flush out hidden triggers, NBA uses adversarial attacks to craft "pseudo-poisoned samples." These are images modified to trick the student network into exhibiting its backdoor behavior. NBA then forces the student to align its response to these samples with the teacher’s benign response, effectively "vaccinating" the model against the hidden backdoor without ever seeing the original attacker's trigger.

Experimental Evaluation

The researchers evaluated NBA against six representative backdoor attacks (including BadNets, TrojanNN, Blend, CLA, SIG, and Refool) using standard benchmarks like CIFAR-10 and GTSRB. The defense assumes the user has access to a small (5%) clean subset of the training data.

Key Results

NBA consistently outperformed five state-of-the-art defenses, including Fine-tuning, Fine-pruning, and NAD:

  • Attack Success Rate (ASR): NBA reduced the average ASR to just 1.52%, significantly lower than NAD (4.68%) and ARGD (2.77%).
  • Benign Accuracy (BA): The model maintained a high average accuracy of 81.14% on clean data, demonstrating that it removes the poison without compromising general performance.
  • Robustness: Even with a limited clean dataset (5%), NBA maintained a significant lead over competing methods.

Conclusion and Future Work

NBA provides a robust mechanism for cleaning backdoored models by focusing on the "essence" of neural behavior through Gram matrices and adversarial pseudo-samples. While highly effective, the performance of NBA can drop when the clean dataset is extremely small (1%), and the balance between learning clean data and unlearning backdoors requires careful hyperparameter tuning. Future research may explore more efficient ways to craft pseudo-samples to further reduce computational overhead.

Summary updated

BibTeX
@inproceedings{ying2023nba,
  author = {Zonghao Ying and Bin Wu},
  title = {{NBA: defensive distillation for backdoor removal via neural behavior alignment}},
  booktitle = {Cybersecur},
  year = {2023},
  url = {https://openreview.net/forum?id=W0RbSZ1iJX},
}
Figure