TL;DR
This paper introduces CAE, a novel auto-encoder based detector that effectively identifies diverse data poisoning attacks by jointly analyzing reconstruction and classification errors. To address the challenge of training on potentially poisoned data, they propose CAE+, an enhanced version that leverages early stopping and a parallel reconstruction auto-encoder, demonstrating robust performance even with up to 30% poisoned training data.
What Problem Does This Paper Address?
Machine learning models are increasingly deployed in real-world systems that collect data from various sources, making them vulnerable to "data poisoning attacks." In these attacks, adversaries inject malicious data into the training set to corrupt the model's behavior, leading to increased errors on legitimate test data. Existing defense mechanisms often struggle because they either:
- Focus on specific attack types: They might only detect label flipping or feature space manipulation, failing against more sophisticated attacks.
- Require clean training data: Many defenses rely on a pristine dataset to learn normal data patterns, which is an unrealistic assumption in poisoning scenarios.
- Overlook label information: Some methods only consider feature space deviations, missing attacks that manipulate data labels.
This paper aims to bridge this gap by proposing a unified defense that can detect various poisoning attacks without prior knowledge of the attack strategy and can even be trained on contaminated data.
Methods
The core of the proposed solution is a Classification Auto-Encoder (CAE). Unlike standard auto-encoders that only focus on reconstructing input data, CAE incorporates an auxiliary classifier that uses the latent representation learned by the encoder. The training objective for CAE is to minimize a weighted sum of the reconstruction error (how well the decoder reconstructs the input) and the auxiliary classifier's loss (how well it predicts the correct label from the latent representation). This dual objective forces the latent space to capture both the data's features and its associated label information, making it more sensitive to poisoning attacks that tamper with either.
To address the critical issue of training on potentially poisoned data, the authors introduce CAE+. This enhanced version builds upon CAE by:
- Parallel Reconstruction Auto-Encoder (RAE): A separate auto-encoder is trained solely to minimize reconstruction error.
- Joint Error Calculation: The detection error for CAE+ combines the reconstruction error from RAE and the classification loss from CAE. This allows RAE to be trained more extensively without overfitting to poisoned data, while CAE focuses on learning discriminative features for classification.
- Early Stopping: CAE is trained with early stopping to prevent it from overfitting to the poisoned data, ensuring it primarily learns the patterns of the clean majority.
For detecting poisoned points, both CAE and CAE+ use a Gaussian Mixture Model (GMM) to cluster the calculated error scores into "clean" and "poisoned" groups, avoiding the need for manually setting a threshold.
Datasets
The proposed methods were evaluated on three widely used image datasets:
- MNIST: Used for binary classification tasks (e.g., digits 9 vs. 8, 4 vs. 0).
- Fashion-MNIST: Also used for binary classification (e.g., Sandal vs. Sneaker, Top vs. Trouser).
- CIFAR-10: Used for binary classification on more complex images (e.g., Airplane vs. Automobile).
These datasets are standard benchmarks for image classification and were chosen to test the robustness of the defense across different levels of complexity.
Key Insights and Ideas
- Joint Reconstruction and Classification is Key: Poisoning attacks can manifest in subtle ways, affecting either feature space or labels. By jointly optimizing for both reconstruction and classification, CAE can capture deviations in both aspects, making it effective against a broader range of attacks.
- The Achilles' Heel of Clean Data Assumption: The paper strongly emphasizes that relying on clean data for defense training is often impractical. CAE+ directly tackles this by demonstrating that effective defense is possible even with contaminated training sets.
- GMM Outperforms Thresholding: Using a GMM for anomaly detection is shown to be more robust than setting a fixed threshold, as it adapts to the distribution of errors and doesn't require prior knowledge of the exact number of poisoned points.
- Synergy of RAE and CAE in CAE+: The parallel RAE and CAE components in CAE+ create a powerful synergy. RAE handles the feature reconstruction robustly, while CAE focuses on classification, and their combined error signal provides a comprehensive detection mechanism.
Key Results
- High Detection Accuracy: CAE+ consistently achieved high F1-scores, indicating its effectiveness in correctly identifying poisoned points while minimizing false positives. For instance, on MNIST-4-0, CAE+ with GMM achieved an F1-score close to 1 for flipping, optimal, and mixed attacks when the number of poisoned points was known.
- Robustness to High Poisoning Rates: The paper demonstrates that CAE+ can be trained with up to 30% poisoned data (on CIFAR-10) and still maintain significantly better performance than existing methods.
- Superiority over State-of-the-Art: CAE+ outperformed baseline methods like distance-based outlier detectors (OD) and a modified Magnet auto-encoder across various attack types and datasets in terms of recovering SVM accuracy.
- Impact of Attack Type: The results highlight how different attack types affect the reconstruction and classification errors differently, reinforcing the need for a defense that considers both. Semi-optimal attacks, for example, showed a greater reliance on reconstruction error.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while CAE+ is robust, its performance can be sensitive to the choice of the weighting parameter $\alpha$ in its error function, which balances reconstruction and classification contributions.
- The current work focuses on binary classification problems. Extending to multi-class scenarios is a natural next step.
- Future Work:
- Investigate the effectiveness of these detectors on non-convex target models.
- Explore the influence of these defensive approaches on multi-classification problems.
- Extend the current work to address backdoor attacks, which share characteristics with poisoning attacks but are carried out during training.
- The authors suggest exploring the combination of CAE+ with a reformer mechanism for potentially further performance gains.
Summary updated