Skip to content

Learning with noisy labels: co-teaching and the small-loss trick

Networks learn clean patterns first and memorize wrong labels later. Co-teaching trains two networks that each pick the other's likely-clean rows. Why it works, and how it can drop the hard cases you need.

Advanced ~12 min8 steps

What runs in CodeSplash

You will be able to

  • Explain early learning versus memorization and the small-loss heuristic
  • Describe co-teaching's cross-update and the keep-rate schedule
  • Name the failure modes (correlated networks, structured noise, discarded minorities)
  • Evaluate against ordinary training with an untouched, well-labeled test set

Read first

01

Wrong labels get memorized

Read

Every labeled dataset has some wrong labels. A large network trained long enough will fit them all, the right ones and the wrong ones, and its validation accuracy rises, then falls as it memorizes the noise.

The order matters: networks tend to learn the common, consistent patterns first and the odd, contradictory labels later. Early in training, rows with wrong labels tend to have high loss. That's the small-loss heuristic: rows the model finds easy are more likely to be correctly labeled.

Score rows with a model that saw their labels and it agrees with the wrong ones too; score them out of fold and the flips stand out.

HExplorable · Finding mislabeled rows: confident learning

Some labels are wrong. Can a model's own out-of-fold probabilities point to which ones?

Of the rows confident learning flags, what share are really mislabeled?

0.50
How sure?
0.20

Each flipped label moves to the next class (A → B → C → A).

10

The model is k-nearest neighbors; its class probabilities are neighbor shares, lightly smoothed.

Probabilities from

Out of fold: each row scored by a model that never saw it (5 folds). In sample: the model saw the row's own label.

0.80

SD of each class around its center; larger means more overlap.

flagged 25real flips 23precision 0.76 · recall 0.83

Shapes and colors show the label each row was given. Red outlines mark the rows whose label was really flipped; rings mark what confident learning flags. Rings without red are correct labels it suspects; red without a ring are flips it missed.

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

02

Co-teaching: two networks, swapped choices

Read

Co-teachingCo-teachingTraining two networks on noisy labels where each updates on the rows the other finds easiest (smallest loss) in every batch. trains two networks, AA and BB, from different random starts. In each mini-batch of mm rows:

  1. AA picks the ⌊r(t) m⌋\lfloor r(t)\,m\rfloor rows with its smallest losses; BB does the same.
  2. AA updates on BB's picks, and BB on AA's.

Swapping matters: a network that chose its own rows would keep confirming its own mistakes. In the reference's four-row example, each network keeps two rows, and AA trains on BB's picks with a mean loss of 1.20.

03

The keep rate

Read

The keep rate r(t)r(t) starts at 1, everything, during a warm-up while the networks learn the easy patterns, then falls toward 1−ϵ^1-\hat\epsilon, where ϵ^\hat\epsilon is the estimated share of wrong labels.

Get ϵ^\hat\epsilon wrong and the method fails in one of two ways: too high, and it throws away good data; too low, and noisy rows stay in. The schedule is a hyperparameter to set on development data, with its own validation set, not on the test set.

04

Who gets dropped?

Predict

Predict first

A rare class is hard to learn and its rows have high loss early in training, even with correct labels. Which rows does co-teaching drop?

Mostly mislabeled rowsAlso correct rows of a rare, hard class
Reveal

Also the rare class. High loss means "hard" as well as "wrong". Small-loss selection can starve a minority class or difficult cases. Track the selection rate by class, and review excluded rows before calling them errors.

05

When it breaks, and how to check

Read
  • Correlated networks pick the same rows and reinforce the same bias; independent starts help but don't guarantee complementarity.
  • Structured noise, where one class is systematically confused with another, can look consistent and easy, so it survives selection.
  • Synthetic noise (labels flipped at random) is the easy case. Good results there don't show robustness to real annotator disagreement.

Compare with ordinary training, and with training on a clean subset if you have one, on a test set with careful, untouched labels. Rows the networks reject are candidates for review, not proven errors.

06

Where it stands in CodeSplash

Read
EntryIn CodeSplash
Co-teaching (ROB006)Explained here
Related, in the appLabel issues on a finished classification run finds likely wrong labels for you to review (next lesson)
Reference · ROB006 · Explained hereCo-teachingTrain two networks that exchange selected low-loss examples, aiming to reduce memorization of corrupted training labels.
07

Check your understanding

Checkpoint

Check yourself

Why does co-teaching prefer small-loss rows early in training?

Show the answer

Answer: a

The small-loss heuristic relies on that ordering. Train too long and the network memorizes the wrong labels, and the losses stop telling them apart.

Check yourself

Why does each network train on the other's selected rows rather than its own?

Show the answer

Answer: b

Self-selection is self-confirmation. Two networks with different starts make different mistakes, and swapping lets each filter the other.

Check yourself

The estimated noise rate behind the keep schedule is far too high. What happens?

Show the answer

Answer: a

Too high an estimate discards good data; too low keeps corruption. Set it on development data and check selection rates by class.

08

What comes next

Recap

Co-teaching works around wrong labels during training. The next lesson finds them, so a person can review and fix them: confident learning.

Concepts in this lesson