Two very different machines learned what a good bottle looks like: a classic pattern-matcher (PCA) and a small neural network. Neither ever saw a defect during training. Then 63 defects walked in.
On a real production line you have thousands of photos of good parts and almost none of defects, so you can't train a normal classifier. Instead, both of our models learn to rebuild good bottles, then flag anything they can't rebuild well. A defect is, by definition, something the model has never seen, so its rebuild comes out wrong, and the size of that error is the alarm signal.
We built the two contenders independently within the team, then judged them on the exact same final exam: 126 unseen photos, half good, half defective, from the MVTec AD benchmark. The neural net caught 62 of 63 defects; the PCA caught 60. Every number and figure on this site is the actual output of the two project notebooks.

| Neural net | PCA | |
|---|---|---|
| defects caught | 62 / 63 (98.4%) | 60 / 63 (95.2%) |
| good bottles wrongly flagged | 4 / 63 (6.3%) | 6 / 63 (9.5%) |
| breaks caught | 42 / 42 (all) | 41 / 42 |
| what it missed | 1 contamination | 2 contamination + 1 small break |
They're much closer than we expected. The neural net edges it, but a well-built PCA gets within a whisker using nothing but classic linear algebra. The full head-to-head →