Poisoning the Unlabeled Dataset of Semi-Supervised Learning

Nicholas Carlini

Abstract: Semi-supervised machine learning models learn from a (small) set of labeled training examples, and a (large) set of unlabeled training examples. State-of-the-art models can reach within a few percentage points of fully-supervised training, while requiring 100x less labeled data. We study a new class of vulnerabilities: poisoning attacks that modify the unlabeled dataset. In order to be useful, unlabeled datasets are given strictly less review than labeled datasets, and adversaries can therefore poison them easily. By inserting maliciously-crafted unlabeled examples totaling just 0.1% of the dataset size, we can manipulate a model trained on this poisoned dataset to misclassify arbitrary examples at test time (as any desired label). Our attacks are highly effective across datasets and semi-supervised learning methods. We find that more accurate methods (thus more likely to be used) are significantly more vulnerable to poisoning attacks, and as such better training methods are unlikely to prevent this attack. To counter this we explore the space of defenses, and propose two methods that mitigate our attack.

Introduction

Modern machine learning is increasingly bottlenecked by the high cost of human-labeled data. Semi-supervised learning (SSL) has emerged as a powerful solution, training on a small set of expensive labeled data and a massive set of cheap unlabeled data, often scraped directly from the public internet.

However, this reliance on uncurated data creates a massive, unmonitored attack surface. Because unlabeled data is too voluminous for human review, it is susceptible to poisoning. While previous research has focused on poisoning labeled datasets, this work explores targeted poisoning attacks exclusively on the unlabeled datasets used by state-of-the-art SSL algorithms.

Methodology: Interpolation Consistency Poisoning

The core of the proposed attack is Interpolation Consistency Poisoning. This method weaponizes the fundamental mechanism of SSL: consistency regularization. In SSL, models generate "pseudo-labels" for unlabeled data and then force predictions to be consistent across similar examples.

To execute the attack, an adversary selects a "target" image (e.g., a bird) they wish to have misclassified as a "source" class (e.g., a dog). The attacker then creates a "bridge" of interpolated images that gradually transition from the source image to the target image. These bridge images are injected into the unlabeled dataset.

Interpolation Consistency Poisoning: A sequence showing how a 'bridge' of unlabeled points propagates a label to a target.

During training, the model learns the labeled source image. Because the first interpolated image in the bridge is highly similar to the source, the model confidently pseudo-labels it with the source class. This confidence propagates down the chain like a row of falling dominoes until the target image itself is confidently misclassified. This can be achieved using simple linear pixel blending or more sophisticated GAN latent-space interpolation.

Evaluation and Key Results

The attack was evaluated on standard image classification benchmarks adapted for SSL: CIFAR-10, SVHN, and STL-10. The results demonstrate that modern SSL is significantly more fragile than previously understood.

  • High Success Rate: On top-tier SSL algorithms like FixMatch, UDA, and MixMatch, the attack succeeds over 80% of the time on CIFAR-10 with only 0.1% poisoning of the unlabeled data.
  • Efficiency: Compared to standard clean-label poisoning on supervised models (which typically requires 1% poisoning), SSL is an order of magnitude easier to compromise.
  • Transfer Learning Vulnerability: If the attacker knows the pre-trained weights used for fine-tuning, success rates remain high even with extremely subtle image manipulations.
Attack success matrix across various source and target image classes.

Discussion: The Paradox of Accuracy

A critical insight of this research is that accuracy breeds vulnerability. State-of-the-art SSL methods are highly susceptible to this attack, while older, less accurate methods (like MeanTeacher) are largely immune. Because superior models are better at extracting structure and "meaning" from unlabeled data, they are ironically more adept at following the attacker's malicious breadcrumb trail.

Proposed Defense

To mitigate this threat, we propose a defense based on Monitoring Training Dynamics. By tracking how the prediction of an unlabeled example changes relative to its neighbors across training epochs, defenders can measure "influence." Poisoned bridge images form isolated, highly inter-dependent clusters that exhibit distinct training dynamics compared to benign data. In testing, this method achieved a 100% true positive rate in separating clean examples from poisoned ones.

Conclusion

Training models on uncurated, scraped data introduces severe security risks. As machine learning moves toward larger, less-supervised datasets, the "cat-and-mouse" game between attackers and defenders will likely intensify. Future work should extend this analysis to other domains reliant on unlabeled data, such as self-supervised learning and large language models (LLMs) trained on web-scale text.

Summary updated

BibTeX
@inproceedings{carlini2021poisoning,
  author = {Nicholas Carlini},
  title = {{Poisoning the Unlabeled Dataset of Semi-Supervised Learning}},
  booktitle = {USENIX Security},
  year = {2021},
  url = {https://openreview.net/forum?id=YdFYfADBi8w},
}
Figure