Where we start
A bench holds everything still except the thing being tested. Here the model is frozen, the 500 test digits are frozen, and the only thing that moves is the training data: which rows are in it, and what they are labelled. The data are real, all 1,797 images of the UCI handwritten digits. The noise is not: it is a plant, declared in full, which is the one thing that lets the bench count how many wrong labels a detector found. On your own data you never get that column, and the second half of tonight is about what to do instead.
★ What you walk out with tonight. The measured cost of each data edit on one frozen model, the habit of reading accuracy and detector recall side by side, the reason more data from the same labellers bought nothing, and the leak that makes a detector look precise while it finds a third of what it should.
Two counters, one frozen model
6 min liveEvery readout carries a tag. measured numbers come from running the frozen model on the edited training rows and scoring it on the test digits; they would be the same in any language, and a Python reference reproduces them to the last test image. planted numbers compare the training labels against the declared plant; they exist only because the bench knows which 133 labels it corrupted.
LiveThe measured counter: accuracy on 500 clean digits3 min▶
Test accuracy is the share of the 500 test digits the frozen model gets right after the edit. One test digit is 0.2 points, so a difference of one or two digits on a single seed is not a finding. The readout also prints the difference against the baseline, and the ceiling: the same model trained on the true labels gets 489 of 500, 97.8 percent. That ceiling is knowable only because the plant is declared.
Training rows says how many rows the edit left. Removal shrinks the set; relabelling keeps it; augmentation and extra data grow it. Reading accuracy without this number hides what an edit cost.
Per-digit test accuracy sits under the readout, with the change against the baseline for each digit. It is there to be read, never to choose an edit: session 5 picks the weak digit on the training set.
LiveThe planted counter: precision, recall and what is left3 min▶
Detector precision is the share of flagged rows that really were planted errors. Recall is the share of the 133 planted errors the detector flagged. Wrong labels left counts training rows whose label still differs from the true digit after the edit, including any a relabel got wrong. Accuracy can saturate while these keep moving, which is why the bench reports both: a detector that finds a third of the errors can still lift accuracy, and you would never know it had missed two thirds.
Under the readout the bench prints where the flags go, the off-diagonal of the confident joint, and the per-class thresholds, then draws every flagged row from its own 64 pixels with a rust ring when it was a planted error and a grey ring when it was a false alarm. The last gallery is the planted errors the detector missed. Look at them: they are the 7s that look most like 1s.
Eight edits, computed in front of you
★ 26 min · the main eventWork down the eight in order. For each, read the verdict, then accuracy against the baseline, then the two planted counters, then the thumbnails. Say out loud what changed before moving on. The two red cards are the traps. Each edit takes a moment to compute, because the model really runs: four-fold cross-validation for the detector, then a full scoring pass.
Read it in this order. Baseline first, and sit with 91.4 percent against the 97.8 percent ceiling: that gap of 32 test digits is what the planted labels cost. Then the anti-lever, then the two confident-learning edits, then the three variations. Below the eight cards, the knobs let you combine edits freely; every combination is computed the same way, and session 6 asks you to find the best one.
Same model, eight answers
6 min liveThe bench computes these live; the numbers here are the ones it prints for the shipped seed, written down so they can be argued with after class. Because one seed is one draw, the same ladder was also run on twenty seeds with the same plant rule, and the last column gives the twenty-seed mean. Where the two disagree, the mean is the claim.
| Edit | Train rows | Test accuracy | vs baseline | Wrong labels left | 20-seed mean |
|---|---|---|---|---|---|
| True labels (reference) | 800 | 97.8% | +6.4 | 0 | 97.26% |
| Baseline, the labels you were given | 800 | 91.4% | 0 | 133 | 89.97% |
| Add 497 more, same noise | 1,297 | 90.8% | -0.6 | 219 | 90.22% |
| Remove what CL flags | 702 | 95.8% | +4.4 | 48 | 94.17% |
| Relabel what CL flags | 800 | 95.6% | +4.2 | 61 | 94.45% |
| Relabel, then drop ambiguous | 690 | 95.0% | +3.6 | 23 | 93.61% |
| Relabel, then shift the weakest digit | 1,084 | 96.0% | +4.6 | 61 | 94.52% |
| The leak: relabel with an in-sample detector | 800 | 94.8% | +3.4 | 95 | 92.70% |
| Collect 497 more, and clean all of it | 1,297 | 95.6% | +4.2 | 118 | 94.60% |
Shipped seed 20210921, the one of twenty whose ladder sits closest to the twenty-seed mean. All counts computed; the plant is constructed.
LiveFinding 1: cleaning the 800 is worth about four points2 min▶
Confident learning flags 98 of the 800 rows. 85 of them are planted errors, a precision of 86.7 percent, and it finds 85 of the 133, a recall of 63.9 percent. Removing the 98 takes the frozen model from 91.4 to 95.8 percent; relabelling them to the suggested digit takes it to 95.6. Every one of the 85 caught errors is relabelled to its true digit; the 13 false alarms are relabelled wrongly. Over twenty seeds removal averages +4.20 points and relabelling +4.48, and neither is ever worse than the baseline. On this seed removal edges ahead by one test digit; on the mean relabelling does. Call them about equal, and choose by what the removed rows would have cost to collect.
LiveFinding 2: the cleaner set scored lower2 min▶
Dropping ambiguous rows after relabelling, the 110 rows whose ten neighbours reach no majority, leaves only 23 wrong labels in training, the cleanest set on the ladder. It scores 95.0 percent, below plain relabelling at 95.6. The ambiguous rows are mostly correctly labelled digits that sit near a boundary, and near-boundary rows are exactly what a nearest-neighbour model needs to place the boundary. Fewer wrong labels is not the goal; a better model on the test set is. Try the same knob on the 1,297 rows in the knobs panel and it helps instead, which is session 5's small-data lesson.
Self-studyThe honest dip: shifting the weakest digit bought almost nothing on average2 min▶
On this seed, adding four one-pixel shifts of every training 9, the digit the relabelled training set agrees with least under cross-validation, takes the model to 96.0 percent, the best preset, and lifts test 9s from 56 to 59 of 65. Over twenty seeds the same edit averages +0.07 points over plain relabelling. That is the measurement: augmentation adds coverage of an invariance, and on 8 by 8 digits whose main problem is wrong labels, coverage is rarely the bottleneck. A one-pixel shift at this resolution is also a four-pixel shift of the original 32 by 32 scan, a coarse transform. Session 5 is about when augmentation is the right edit.
More of the same, and a detector that grades itself
4 min liveTwo edits on the bench look reasonable in a planning meeting and lose ground on the counters. Both fail for mechanical reasons you can draw.
LiveWhy 497 more rows made it worse2 min▶
The plant is systematic. The 7s labelled 1 are the 7s that look most like 1s, and the pool's 7s labelled 1 are the same kind of 7. Adding them puts more wrong votes in exactly the neighbourhoods where the model was already confused. The bench shows 457 correct becoming 454, and the wrong labels in training rising from 133 to 219. Over twenty seeds the change averages +0.25 points and is worse than the baseline in 8 of 20: "about nothing", with the sign decided by the draw.
The honest nuance: this is not a law that more data never helps. With purely random noise, more rows do average the errors out, and the homework in session 1 asks you to see it. And more data that is cleaned too, the last preset, reaches 95.6 percent. The trap is more data from the same process, unexamined.
LiveWhy the in-sample detector looks precise and is not2 min▶
Confident learning needs out-of-sample predicted probabilities; the paper fixes four folds of cross-validation, and the MIT notes say "We use cross-validation to obtain predicted probabilities out-of-sample." With in-sample votes each training row is its own nearest neighbour at distance zero, so every row casts one vote for its own label before anyone else votes. The detector flags only 42 rows, 95.2 percent of them real errors, and finds 30.1 percent of the planted errors against 63.9 out of sample. Precision went up while recall halved, and a team reading only precision would call it an improvement. Accuracy lands at 94.8 against 95.6.
This is detector leakage, the row seeing its own answer, and it is a different animal from feature leakage, where a column carries the target. Feature leakage belongs to Feature Engineering ↗.
"We need more labelled data" is the most common request in a stalled project. Ng's slide makes the counter-claim for small data: with 500 examples and 12 percent noise, cleaning and doubling the set are "about equally effective". The bench adds a sharper version: when the new rows come from the same labellers with the same guideline, doubling can be worth nothing at all. Ask where the new labels will come from before asking how many.
What to ask for, if you lead the team. For any cleaning pass, ask for two numbers, not one: how many rows were flagged, and on a hand-checked random sample of flags, what share were really wrong. Then ask how the probabilities were produced. If the answer is not "out of sample", the precision number is flattering a detector that is missing most of the errors.
Before session 5
30 min- Fill the eight-row table from the bench in your own notes, adding a column for detector recall. Circle the row whose accuracy and recall disagree most.
- Find a combination that beats 96.0 percent with the knobs, and write down which edits it uses and how many training rows it ends with.
- Look at the missed gallery. Pick five missed rows and write, for each, whether you would have labelled it correctly yourself. That is the ceiling any label-quality process has on this data.
- Estimate your own planted counter. For your last cleaning pass, how would you measure precision without an answer key? Session 6 needs the answer.
Three questions
Clear all three and session 4 gets stamped in your passport.
1 · Relabelling with an in-sample detector flags 42 rows at 95.2 percent precision; the out-of-sample detector flags 98 at 86.7 percent. Which is the better detector?
Precision alone rewards a detector for flagging less. Recall is the second counter that exposes it, and the mechanism is the reason confident learning requires out-of-sample probabilities. Accuracy also falls, 94.8 against 95.6.
2 · Dropping ambiguous rows after relabelling leaves only 23 wrong labels, the cleanest set, yet scores 95.0 against 95.6. What is going on?
Wrong labels left is a planted counter, and it is not the objective. On the 1,297 rows the same knob helps, 96.6 percent with relabelling, because a bigger set can afford to lose its boundary rows. Session 5 turns that into a rule for small data.
3 · A manager asks for 497 more labelled rows from the same vendor. What does the bench say to expect, and why?
The honest claim is "about nothing, sign decided by the draw", not "always worse". C overstates it the other way. The useful follow-up question is how the new labels will be produced, which is session 2.
What this session teaches, and where it came from
Every fact on this page, and its verification tier, is recorded in the course's source map.
Session 4 cheat sheet · pin this
The bench cleaned labels. Some errors are not labels at all: a kind of input the training set barely has, a slice where the model is quietly worse. Session 5 finds slices without peeking at the test set, asks when augmentation is the right edit and when it is decoration, and settles the collect-or-clean question for small data with the numbers from tonight's knobs.