Beginner

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.

💡
Key distinction: Data poisoning attacks the training phase, while adversarial attacks target the inference phase. Poisoning is especially dangerous because the corrupted behavior becomes part of the model's weights and is difficult to detect after training.

Attack Surface in the ML Pipeline

The ML training pipeline has multiple points where data can be poisoned:

ML Pipeline Attack Surface
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

IncidentTargetImpact
Tay Chatbot (2016)Microsoft's Twitter botUsers fed toxic content causing the bot to output offensive tweets
Backdoored NLP ModelsPre-trained model hubsResearchers demonstrated trojaned models uploaded to public repositories
Code Suggestion PoisoningAI code assistantsPoisoned training repos could cause code assistants to suggest vulnerable code
Image Classifier AttacksAutonomous vehiclesPoisoned 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
Course roadmap: This course covers poisoning techniques (Lesson 2), backdoor insertion (Lesson 3), detection methods (Lesson 4), prevention strategies (Lesson 5), and production best practices (Lesson 6).

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.