PBP: Post-training Backdoor Purification for Malware Classifiers

Dung Thuy Nguyen, Ngoc N. Tran, Taylor T. Johnson, Kevin Leach

TL;DR

This paper introduces PBP, a novel post-training defense against backdoor attacks on malware classifiers. PBP effectively purifies poisoned models by identifying and neutralizing "backdoor neurons" using a two-phase approach, achieving near-perfect attack mitigation with minimal clean data and computational cost.

What Problem Does This Paper Address?

The increasing reliance on Machine Learning (ML) for malware classification has opened the door to sophisticated backdoor attacks. These attacks involve subtly injecting malicious triggers into training data, causing the ML model to misclassify specific inputs (e.g., malware samples) as benign when the trigger is present. While many defenses focus on detecting poisoned data before training or rely on ensemble methods, these approaches are often unsuitable for scenarios where users acquire pre-trained models (e.g., via Machine Learning-as-a-Service or from third-party vendors) and need to remove backdoors after training. Existing post-training defenses also have limitations, such as requiring extensive retraining or making strong assumptions about the backdoor's nature. This paper addresses the critical need for a versatile, efficient, and effective post-training defense that can purify existing malware classifiers without prior knowledge of the attack's specifics.

Methods

PBP employs a two-phase strategy:

  1. Neuron Mask Generation: This phase leverages the observation that backdoor attacks cause a distinct "activation shift" in specific neurons within a neural network. PBP trains a temporary "noise model" using clean data to mimic the backdoor model's activations. By analyzing the gradient traces during this alignment process, PBP identifies "backdoor neurons" – those most influential in causing the activation shift. This is achieved by looking for neurons with the highest gradient magnitudes, indicating their importance in the backdoor's functionality.
  2. Activation-Shift Fine-Tuning: In this phase, PBP first applies a small amount of Gaussian noise to the backdoored model's weights to perturb its current state. Then, it fine-tunes the model using a small subset of clean data. Crucially, during fine-tuning, PBP reverses the gradient sign for the identified "backdoor neurons" (from the first phase). This masked gradient optimization forces the model to "unlearn" the backdoor's influence by maximizing the loss on triggered samples for these specific neurons, while still minimizing the loss on clean data for other neurons.

Datasets

The paper evaluates PBP on two publicly available datasets:

  • EMBER: A dataset of Windows Portable Executable (PE) files, featuring 2,351-dimensional feature vectors.
  • AndroZoo: A dataset of Android applications, with feature vectors extracted using Drebin.

Key Insights and Ideas

  • Activation Shift as a Backdoor Signature: The core insight is that backdoor attacks create a detectable distortion in the activation patterns of specific neurons, regardless of the exact trigger-embedding mechanism. This "activation shift" is a reliable indicator of a compromised model.
  • Targeted Neuron Neutralization: Instead of trying to fix the entire model, PBP focuses on neutralizing the specific "backdoor neurons" responsible for the malicious behavior. This targeted approach is more efficient and less likely to degrade the model's performance on legitimate tasks.
  • Post-Training Versatility: PBP's strength lies in its ability to operate after a model has been trained, without needing to know the attack's specifics (trigger type, poisoning rate, etc.). This makes it highly practical for real-world scenarios where pre-trained models are common.
  • Minimal Data Requirement: PBP demonstrates remarkable effectiveness even with a very small fraction (as low as 1%) of clean data for fine-tuning, making it accessible even when large clean datasets are unavailable.

Key Results

PBP significantly outperforms existing fine-tuning-based defenses:

  • Attack Success Rate (ASR) Reduction: PBP reduces the ASR from 100% to nearly 0% for family-targeted attacks and to approximately 15.44% for non-family-targeted attacks, representing a 100-fold improvement over baselines in some cases.
  • Robustness Across Attacks: PBP effectively mitigates both "Explanation-guided" and "Jigsaw Puzzle" backdoor attacks, including stealthy attacks like Jigsaw Puzzle that previously bypassed other defenses.
  • Efficiency: PBP requires only a small subset of clean data (as low as 1%) for fine-tuning and is computationally efficient.
  • Stability: PBP shows stable performance across various poisoning rates, fine-tuning data sizes, and even different model architectures (including CNNs).

Limitations and Future Work

  • Clean Accuracy Trade-off: While PBP significantly reduces ASR, it may lead to a slight decrease in clean accuracy (false positives). The authors suggest that continued training can mitigate this trade-off, but it cannot be entirely eliminated due to the stealthiness of some backdoor attacks.
  • Data Trustworthiness: PBP assumes the fine-tuning data is clean. Future work could explore how poisoned fine-tuning data might affect backdoor purification.
  • Reverse Engineering: The authors suggest that incorporating reverse engineering techniques could further enhance purification efficiency by more accurately identifying backdoored neurons.
  • Broader Domain Application: The paper demonstrates PBP's effectiveness in Computer Vision (CV) tasks, suggesting its potential applicability to a wider range of domains beyond malware classification.

Summary updated

BibTeX
@inproceedings{nguyen2025pbp,
  author = {Dung Thuy Nguyen and Ngoc N. Tran and Taylor T. Johnson and Kevin Leach},
  title = {{PBP: Post-training Backdoor Purification for Malware Classifiers}},
  booktitle = {Ndss},
  year = {2025},
}
Figure