Label Noise & Weak Supervision
Learning from labels that are wrong, partial or programmatic.
Labels are written by tired annotators, inferred from logs, scraped from the web or produced by heuristics, and some fraction of them is always wrong: even the test sets of widely used benchmarks contain a few percent of label errors. This lesson builds the theory of learning from corrupted labels: which noise is harmless and which is not, how to correct a loss so that it is unbiased under noise, how to find the wrong labels, and how to learn from many weak labelers instead of one reliable one.
What you’ll learn
- Distinguish random, class-conditional and instance-dependent label noise, and derive how each changes the Bayes classifier and the measured error.
- Derive the unbiased loss of Natarajan et al. for class-conditional noise, and the backward and forward corrections with a noise transition matrix.
- Explain how confident learning flags label errors, and what label errors in test sets do to benchmark comparisons.
- Aggregate crowd labels with the Dawid–Skene model and EM, and describe programmatic weak supervision.
A taxonomy of label noise
Write for the clean label and for the label you actually observe. Models of label noise differ in what the probability of a flip is allowed to depend on.
| Noise model | Flip probability | Typical source |
|---|---|---|
| Random classification noise (Angluin & Laird, 1988) | a constant | careless clicks, transcription slips |
| Class-conditional noise | and , with ; with classes a transition matrix | a condition that is under-diagnosed more often than over-diagnosed |
| Instance-dependent noise | , varying with the input | blurry or ambiguous images mislabeled more often |
| Adversarial noise | chosen by an adversary | deliberate data poisoning |
Let and . Under class-conditional noise, a noisy positive is a clean positive that kept its label or a clean negative that flipped:
Because , this is increasing in , so the clean Bayes decision is a threshold on the noisy probability, at the image of :
With symmetric noise, , the threshold stays at . A classifier disagrees with the noisy label when it is wrong and the label survives, or right and the label flips:
The noisy 0–1 risk is an increasing affine function of the clean one, so minimizing it minimizes the clean risk: symmetric noise costs samples, not consistency. Class-conditional noise moves the threshold and must be corrected for. Instance-dependent noise is worse: without further assumptions cannot be recovered from at all, because many pairs of and produce the same noisy distribution.
A classifier's true accuracy is 90%. It is scored on a test set whose labels were flipped at random with probability 10%, independently of everything else. What accuracy will you measure, in percent?
Show the answer
82 %
, so the measured accuracy is 82%. Even a perfect classifier would score only 90%. Noise in a test set lowers every score and shrinks the gaps between models by the factor : a 5-point difference in clean accuracy shows up as 4 points.
Correcting the loss
Angluin and Laird (1988) began the theory. Under random classification noise with a known bound on the flip rate, minimizing disagreements with the noisy labels over a finite class of hypotheses is a PAC learner, with a sample size of order . The factor is the price of noise: as the labels carry no signal.
The identity explains why the 0–1 loss tolerates symmetric noise. Convex surrogates do not inherit this property. Long and Servedio (2010) proved that "random classification noise defeats all convex potential boosters," AdaBoost among them: for this whole family of algorithms, randomly flipped labels are not a harmless nuisance but can prevent learning altogether.
Given , the observed label is with probability and with probability :
Substitute the definition, writing . The terms in cancel:
The first bracket equals . If is convex in with , as for the squared and logistic losses, then and the corrected loss stays convex, although it can take negative values. Natarajan et al. also showed that simply reweighting the loss by class, as biased SVMs and weighted logistic regression do, is provably noise-tolerant.
With classes and an invertible transition matrix , write for the losses a prediction would incur under each possible label. Patrini, Rozza, Menon, Nock and Qu (2017) proposed two corrections that need at most a matrix inversion and a multiplication:
- Backward: train on . The noisy label is with probability , so the expected corrected loss is : unbiased, as in the binary case.
- Forward: pass the model's clean-label probabilities through the noise and train on . With cross-entropy, the best fit to the noisy labels has , so recovers the clean posterior.
itself can be estimated from anchor points, inputs that belong to class with probability one: for such an input the noisy-label probabilities are exactly the row .
Finding the wrong labels
Could you find wrong labels by training a model and looking at the examples it gets wrong? Not from training error. Zhang, Bengio, Hardt, Recht and Vinyals (2017) showed that standard image-classification networks easily fit a random labeling of their training data. The order of fitting helps, though: Arpit et al. (2017) found that networks tend to learn simple patterns first and memorize noisy examples later, one reason why early stopping and training on the examples with the smallest loss are common defenses.
Confident learning (Northcutt, Jiang & Chuang, 2021) works from out-of-sample predicted probabilities , each produced by a model that never trained on that example. For each class , set a threshold : the average predicted probability of class among the examples labeled . An example labeled is counted as "confidently class " if its predicted probability of clears (taking the most probable such class). These counts form the confident joint, an estimate of how many examples of each true class carry each observed label; its off-diagonal entries count the label errors of each kind, and the examples behind them are the suspects.
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_predict
# Out-of-sample probabilities: each example is scored by a model that never saw it
P = cross_val_predict(LogisticRegression(max_iter=1000), X, y_noisy,
cv=5, method='predict_proba')
K = P.shape[1]
# Per-class threshold: average confidence in class j among examples labeled j
t = np.array([P[y_noisy == j, j].mean() for j in range(K)])
suspects = []
for i in range(len(y_noisy)):
above = np.flatnonzero(P[i] >= t) # classes it confidently belongs to
if above.size:
j = above[np.argmax(P[i, above])]
if j != y_noisy[i]: # off-diagonal of the confident joint
suspects.append(i)A stripped-down version of the counting step, assuming labels that all occur. The full method also calibrates the counts into an estimate of the joint distribution of noisy and true labels and ranks the suspects.
Why must the predicted probabilities used to flag suspicious labels be out-of-sample?
- Out-of-sample probabilities are calibrated by definition
- A model that trained on an example has partly fitted its label, right or wrong, so it tends to agree with exactly the errors you are looking for
- In-sample probabilities cannot be computed for every example
- Out-of-sample predictions are cheaper to compute
Show the answer
B. A model that trained on an example has partly fitted its label, right or wrong, so it tends to agree with exactly the errors you are looking for
A flexible model can memorize a wrong label, after which its in-sample prediction confirms the error. Cross-validated predictions come from models that never saw the example, so they reflect what the rest of the data says about it.
Applied to the test sets of ten widely used vision, language and audio benchmarks, with the flagged candidates checked by human reviewers, this approach found that at least 3.3% of test labels are wrong on average, and at least 6% of the ImageNet validation set; about half of the flagged candidates (51%) were confirmed errors (Northcutt, Athalye & Mueller, 2021). Errors at this level can reorder models: on ImageNet with corrected labels, ResNet-18 outperforms ResNet-50 if the share of originally mislabeled test examples rises by just 6%. Random noise only compresses differences between models, by the factor ; errors that are systematic, and that a large model may have learned to reproduce from noisy training labels, can reverse them.
Many weak labelers
When labels are cheap but unreliable, collect several per item. Majority vote is the simplest aggregator, and it silently assumes that annotators are equally reliable and independent.
Think first Three annotators label a binary item independently, each correct with probability . How often is the majority right? What changes if their mistakes are correlated?
, and with five such annotators . Independence is doing all the work: if the annotators share a misconception and make the same mistakes on the same items, the majority is no better than any one of them.
Each item has a hidden true class with prior . Annotator reports label for an item of class with probability , one confusion matrix per annotator, independently across annotators given the true class. With the number of times annotator gave item the label :
E-step: compute the posterior over each item's true class.
M-step: re-estimate the prior and every confusion matrix from expected counts over the items.
Iterate from a majority-vote start. No iteration decreases the likelihood (the general argument for EM is in the topic Probabilistic Machine Learning). Reliable annotators get more say, consistently wrong ones have their votes read in reverse, and the posteriors serve as soft training labels. EM finds only a local optimum, and with few labels per annotator the confusion matrices are poorly estimated.
Weak supervision takes the idea further: the annotators become programs. In Snorkel (Ratner, Bach, Ehrenberg, Fries, Wu & Ré, 2017), users write labeling functions (keyword patterns, heuristics, lookups in an existing knowledge base, the outputs of other models), each of which labels some examples and abstains on the rest. A generative label model estimates the functions' accuracies and correlations from their agreements and disagreements alone, with no ground truth, and turns their votes into probabilistic labels. A discriminative model trained on these labels with a noise-aware loss can then generalize beyond the functions' coverage. In the paper's user study, subject-matter experts built models 2.8 times faster than with seven hours of hand labeling, and their predictive performance was 45.5% higher on average.
Key takeaways
- Noise models range from random flips (constant ) through class-conditional noise (, or a transition matrix ) to instance-dependent and adversarial noise. Under class-conditional noise , so the clean Bayes classifier thresholds at ; symmetric noise leaves it unchanged, with .
- With known noise rates, losses can be made unbiased: for binary labels, and backward () or forward () corrections with classes, estimated from anchor points.
- Networks can fit any labels, so training error cannot reveal label errors. Confident learning flags them from out-of-sample probabilities and per-class thresholds; common benchmark test sets carry at least 3.3% label errors on average, enough to reorder models.
- Many weak labels can stand in for a few strong ones: the Dawid–Skene EM algorithm estimates each annotator's confusion matrix, and programmatic weak supervision learns the accuracies of labeling functions from their agreements and trains on probabilistic labels.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Labels are flipped with probability , independently of the input and the label. How is a classifier's 0–1 risk on noisy labels related to its clean risk ?
Show the answer
B.
The classifier disagrees with a noisy label when it is wrong and the label survives, , or when it is right and the label flips, . The sum is , increasing in , so the ranking of classifiers is preserved.
Under class-conditional noise with (positives labeled negative) and , where should you threshold the noisy probability to recover the clean Bayes classifier?
Show the answer
D.
, so exactly when . Positives are often mislabeled, so a noisy probability of already means a clean probability of about .
Test labels are flipped at random with probability 10%. Model A is 5 points more accurate than model B on clean labels. What gap will you measure on the noisy test set?
- 5 points
- 4.5 points
- 4 points
- No gap: noise hides all differences
Show the answer
C. 4 points
Measured accuracy is , so differences in clean error are multiplied by : points. Random test noise compresses gaps without reversing them.
When does the Dawid–Skene model improve most over majority vote?
- When annotators differ in reliability or make systematic confusions, which it estimates and weights accordingly
- When every annotator has the same accuracy and makes independent, symmetric errors
- When each item receives only one label
- When the annotators' errors are perfectly correlated
Show the answer
A. When annotators differ in reliability or make systematic confusions, which it estimates and weights accordingly
Dawid–Skene learns a confusion matrix per annotator, so reliable annotators get more weight and systematic confusions (always calling class 2 class 3, say) can be undone. With identical, symmetric, independent annotators it reduces to essentially majority vote.
Further reading
- D. Angluin & P. Laird, "Learning from noisy examples," Machine Learning 2(4), 343–370 (1988).
- N. Natarajan, I. S. Dhillon, P. Ravikumar & A. Tewari, "Learning with noisy labels," Advances in Neural Information Processing Systems 26 (2013).
- C. G. Northcutt, L. Jiang & I. L. Chuang, "Confident learning: estimating uncertainty in dataset labels," Journal of Artificial Intelligence Research 70, 1373–1411 (2021).
- C. G. Northcutt, A. Athalye & J. Mueller, "Pervasive label errors in test sets destabilize machine learning benchmarks," NeurIPS Datasets and Benchmarks Track (2021).
- A. P. Dawid & A. M. Skene, "Maximum likelihood estimation of observer error-rates using the EM algorithm," Applied Statistics 28(1), 20–28 (1979).