Lite / Intelligent Robotic Systems / 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?
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.
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…
- the same
- a bit lower
- higher
Guess first, then reveal
Choosing the best of many thresholds on one batch partly fits that batch's random quirks. A fresh batch doesn't share them, so the score usually drops. The fresh score is the honest one.
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?
What the interactive shows (text version)
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.
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
Intuitive
Practising a spelling test with the exact words that will be tested tells you little. The real test is new words.
Technical
Selecting the maximum of many noisy scores is biased upwards (a winner's curse). Held-out evaluation removes that bias; cross-validation rotates the split when data is scarce, but the final reported test set must stay unseen.
Mathematical
With n test items and a true recall of R, the measured recall has a standard error of about √(R(1 − R)/n). For R = 0.9 and n = 30 that is about 0.055, so 90% ± 5.5%: small test sets give wide error bars.
Applied
Regulators and customers in industrial and medical vision ask for performance on independent test data, broken down by condition, before a system is accepted.
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.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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.
Reflect
Looking back over the term, which source of uncertainty (noise, aliasing, lighting, base rates) would you now check first in any sensing system, and why?
Write your answer on paper or in your own notes. Lite never stores what you write.