Skip to content
Tactiverge

School/○ Innovator/Week 27

Evaluating honestly: held-out tests and failure modes

Your threshold scores 98% on the images you tuned it on. On new images it scores 81%. Which number goes in the report?

About 45 min · 3 goals · Checked by automated tests

1.Why should I care?

A perception system that works only on the data it was tuned on is a demo, not a product. Honest evaluation, on held-out data and under deliberately hard conditions, is what lets other engineers trust your numbers. It is also the core of the term assessment.

  • ◇ Separate tuning data from test data and explain why test results are lower.
  • ◇ Report a perception system's precision and recall per condition, with counts.
  • ◇ Describe failure modes with evidence and measure one mitigation.

2.Predict

A threshold is chosen to give the best accuracy on a tuning batch. On a fresh batch from the same machine, its accuracy will most likely be…

Guess first. Being wrong here is how the surprise works.

3.Understand

Tune on one set, test on another

Split data before you start: a tuning (or training) set for choosing parameters and a test set touched once, at the end. Any decision made by looking at test results, even choosing between two thresholds, leaks information and inflates the score. With little data, keep at least a small test set sacred.

Report by condition, with counts

Give precision and recall for each condition (normal, dim, noisy, occluded), with the underlying TP/FP/FN counts and the number of items. 'Recall 90% (27 of 30)' tells a reader how much to trust it; '90%' alone does not. Say how ground truth was obtained.

Failure modes are findings

A failure mode is a describable situation where the system goes wrong: touching parts merge, glare saturates pixels, shadows split objects. Show an example, explain the cause using this term's ideas, try one mitigation, and measure it on the test set. A report that hides its failures is less useful, and less trustworthy, than one that explains them.

Explain it another way

Practising a spelling test with the exact words that will be tested tells you little. The real test is new words.

Worked example 1

Test results: normal light TP 28, FN 2, FP 1; dim light TP 19, FN 11, FP 0. Summarise.

Normal: recall 28/30 ≈ 93%, precision 28/29 ≈ 97%. Dim: recall 19/30 ≈ 63%, precision 19/19 = 100%. Failure mode: in dim light faulty parts fall below the threshold (misses, not false alarms). Mitigation to test: brighter lighting or an adaptive threshold.

Common mix-ups

  • Reporting the tuning-set score is fine if it's labelled.
    ✓ Label it, but the headline must be the held-out test score; the tuning score describes how well you fitted, not how well it works.
  • Failures make a project look bad.
    ✓ Well-explained, measured failures show you understand the system and help others avoid them.

4.Discover

On the tuning batch, find the threshold with the highest accuracy and write down precision and recall. Switch to the fresh test batch without moving the slider. What changed? Is there a threshold that does well on both, and how would you have found it without peeking?

Loading the interactive…

Can't use the interactive? Read a description instead

The confusion-matrix diagram has a tuning batch and a fresh test batch of 60 simulated parts each. A threshold chosen to maximise accuracy on the tuning batch usually gives a slightly different, often lower, accuracy, precision and recall on the test batch, because the two batches' random overlap differs.

5.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1 · a fresh version every time

A defect detector is tested on labelled parts: TP = 60, FP = 0, FN = 21, TN = 394. What is its recall, as a percentage?

%

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2 · a fresh version every time

A defect detector is tested on labelled parts: TP = 23, FP = 33, FN = 8, TN = 108. What is its recall, as a percentage?

%

Practice 3

Recall is 0.8 measured on 100 faulty test parts. Using √(R(1 − R)/n), what is its standard error (as a decimal)?

Practice 4

You compare two thresholds on the test set and report the better one's score. What is wrong?

Practice 5

Which failure-mode statement is most useful?

7.Apply it

Term assessment: deliver your 'Count the parts, honestly' project. Include the tested pipeline, a ground-truth table, precision, recall and count error per condition on held-out images with counts, a failure-mode report with one measured mitigation, and a paragraph on what you would test next.

8.Reflect

Concepts: Overfitting and held-out tests · Evaluation metrics · Perception pipelines and how vision fails