Introduction to Data Poisoning
Data poisoning is one of the most insidious threats to AI systems - attackers compromise the training data itself, causing the model to learn wrong behaviors that persist through deployment.
What Is Data Poisoning?
Data poisoning is an attack on the training pipeline of a machine learning model. Instead of attacking the deployed model directly, the attacker manipulates the data used to train it. This causes the model to learn incorrect patterns, biased behaviors, or hidden backdoors that activate under specific conditions.
Attack Surface in the ML Pipeline
The ML training pipeline has multiple points where data can be poisoned:
Data Collection → Web scraping, user contributions, third-party datasets [ATTACK POINT] Inject malicious samples into source data Data Storage → Databases, data lakes, file systems [ATTACK POINT] Modify stored data directly Data Processing → Cleaning, normalization, augmentation [ATTACK POINT] Compromise processing scripts Labeling → Human annotation, automated labeling [ATTACK POINT] Corrupt labels through malicious annotators Training → Model fitting, fine-tuning [ATTACK POINT] Supply poisoned pre-trained weights Deployment → Model serving, continuous learning [ATTACK POINT] Poison feedback loops
Types of Data Poisoning
Label Flipping
Change the labels on training samples (e.g., marking spam emails as "not spam") to degrade classifier accuracy on targeted classes.
Clean-Label Attacks
Craft samples that appear correctly labeled to human reviewers but cause the model to learn incorrect decision boundaries.
Backdoor Attacks
Insert hidden triggers (patterns, watermarks, phrases) that cause the model to produce attacker-chosen outputs when the trigger is present.
Availability Attacks
Degrade overall model performance rather than targeting specific behaviors, making the model unreliable for all users.
Real-World Incidents
| Incident | Target | Impact |
|---|---|---|
| Tay Chatbot (2016) | Microsoft's Twitter bot | Users fed toxic content causing the bot to output offensive tweets |
| Backdoored NLP Models | Pre-trained model hubs | Researchers demonstrated trojaned models uploaded to public repositories |
| Code Suggestion Poisoning | AI code assistants | Poisoned training repos could cause code assistants to suggest vulnerable code |
| Image Classifier Attacks | Autonomous vehicles | Poisoned training data caused misclassification of traffic signs |
Why Data Poisoning Is Hard to Defend Against
- Scale: Modern models train on billions of samples - manual review is impossible
- Subtlety: Clean-label attacks look legitimate even to expert reviewers
- Persistence: Once trained, poisoned behaviors are baked into model weights
- Supply chain complexity: Training data comes from many sources, each a potential attack vector
- Delayed detection: Effects may only appear in production with specific inputs
Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX