A Mixture Model Based Defense for Data Poisoning Attacks Against Naive Bayes Spam Filters

David J. Miller, Xinyi Hu, Zhen Xiang, George KesidisarXiv 2018

Introduction

Naive Bayes (NB) classifiers are a cornerstone of modern spam filtering due to their speed and computational efficiency. However, they possess a significant vulnerability: they are highly susceptible to data poisoning. In a typical poisoning scenario, attackers exploit automated labeling systems (such as those using blacklisted IPs) by sending emails that mimic legitimate "ham" content. When the filter retrains on this poisoned data, its mathematical representation of spam begins to overlap with ham, leading to a breakdown in classification accuracy. This vulnerability is rooted in the NB model's limited representational power, as it attempts to fit all spam data—including malicious samples—into a single distribution.

Methodology: The Two-Component Mixture Model

To counter these attacks, this research proposes replacing the standard single-distribution model with a Two-component Mixture Model for Spam. Instead of forcing all spam into one mathematical home, the system uses two distinct components:

  1. Component 1: Represents legitimate, "pure" spam.
  2. Component 2: Designed to capture and isolate the attack (the ham-like poisoning emails).

Detection and Isolation

The defense mechanism relies on two key algorithmic steps:

  • BIC-based Model Selection: The system uses the Bayesian Information Criterion (BIC) to detect anomalies. If the incoming data does not fit a single distribution well, BIC triggers the two-component defense.
  • Expectation-Maximization (EM) with Smart Initialization: To ensure the attack is correctly isolated, the second component is seeded with characteristics of "ham." This encourages the EM algorithm to pull ham-like poisoning samples into the second component during training. After training, the component identified as the attack is discarded, leaving the "pure" spam component to handle classification.

Experimental Evaluation

The researchers evaluated the defense using the TREC 2005 spam corpus. The study simulated two types of poisoning strategies: a pure-ham attack (using legitimate ham distributions) and a more potent truncated attack (using words statistically more likely to appear in ham than spam).

Performance Under Attack

The results highlight a stark contrast between standard filters and the proposed mixture model defense. Under the pure-ham attack, the standard NB filter's accuracy drops sharply as the volume of attack emails increases.

Figure 1: Test set accuracy under a pure-ham attack. The standard NB filter's performance degrades significantly, while the mixture model remains stable near 90% accuracy.

As shown in Figure 1, while the standard NB filter's accuracy falls toward 60%, the mixture model maintains a consistent test accuracy of approximately 0.9. The defense proves even more critical in the face of more sophisticated threats.

Figure 2: Test set accuracy under a truncated attack. The standard NB filter fails rapidly, dropping below 50% accuracy, whereas the mixture model defense preserves high performance.

In the truncated attack scenario (Figure 2), the standard NB filter's performance crashes even more rapidly, eventually falling below the level of random guessing. The mixture model, however, remains robust, demonstrating that modeling the "bad" data is an effective way to preserve the integrity of the "clean" model.

Conclusion and Future Work

This research demonstrates that by providing a mathematical "quarantine" for malicious data, spam filters can remain resilient even when attacks are embedded in the initial training set. While the mixture model introduces some computational overhead compared to simple Naive Bayes, the gain in robustness is substantial. Future research will focus on defending against simultaneous attacks on both ham and spam classes and distinguishing between malicious poisoning and natural "class drift" in spam tactics.

Summary updated

BibTeX
@misc{miller2018mixture,
  author = {David J. Miller and Xinyi Hu and Zhen Xiang and George Kesidis},
  title = {{A Mixture Model Based Defense for Data Poisoning Attacks Against Naive Bayes Spam Filters}},
  year = {2018},
  eprint = {1811.00121},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.00121},
}
Figure