Spots defective bottlesfrom a single photo.
SurfaceSight looks at a bottle photo, says good or defective, and missed only 1 of 59 test photos (a 96.0% accuracy score, versus 87.0% for the simple method).
Checking every bottle by eye is slow and tiring.
Factories inspect products by eye before they ship. A worker may look at thousands of bottles in one shift, and a tired eye can miss a chipped rim or dirt inside. A chipped bottle that slips through can cut a customer or force a recall.
SurfaceSight does this check from a photo. It runs on an ordinary laptop processor, with no special hardware.
To be honest about its limits: the photos come from a public research collection taken in controlled lighting. This shows the method works. It has not been tested on a real factory line.
It looks at one photo of a bottle opening and answers in one word, plus how sure it is.
The compressed version is about 4 times smaller and about 5.4 times faster, and it still scores 96.0%.
What it does
It starts from an image-recognition model that already knows how to see everyday photos. Then it teaches that model what good and broken bottles look like. Starting this way needs far fewer photos than learning from scratch.
Last, it compresses the model so it is small and quick enough for an ordinary computer.
Results on photos it never saw while learning
All numbers come from 59 test photos kept aside while the model learned, measured on an ordinary laptop processor.
The accuracy score runs from 0% to 100%, and higher is better. It counts both kinds of mistake: letting a defective bottle through, and throwing out a good one.
| Version | Accuracy score | Size | Time per photo |
|---|
How it works
The heavy work (teaching the program and testing it) was done once ahead of time. This page shows those saved results, so the demo works instantly with no sign-up.
- Collect the photos
Download 292 labeled bottle photos from a public research collection made for factory-inspection studies.
- Hold some photos back
Keep 59 photos hidden from the model while it learns, so the final score is fair.
- Teach it bottles
Start from a model that already recognizes everyday photos and teach it good versus broken bottles. Compare it with the same model used as is, without bottle training (the simple method).
- Shrink it
Shrink the trained program so it runs on an ordinary laptop, then check that it still gives the same answers.
- Show the mistakes
Publish sample answers, including the one photo it got wrong, so anyone can check the work.
No sign-up needed. These are saved answers from the real test, shown next to the true answer.
Try it
Pick a photo, see what the model said, and compare it with the true answer. The list includes the one photo it got wrong.
Its only miss was a bottle with a small break at the rim, which it called good. It never threw out a good bottle.
Test photos it got wrong
Technical details
Data. MVTec AD, bottle category: 292 images (good, broken_large, broken_small, contamination), from the public file-level mirror huggingface.co/datasets/foersben/mvtec-ad, since the official MVTec page needs a download form. License CC BY-NC-SA 4.0, not for commercial use. Raw images stay outside the site.
Split. Seeded (42) 80/20 stratified split: 233 train, 59 holdout, checked for no filename overlap.
Models. Baseline: logistic regression on frozen ImageNet ResNet18 features. Fine-tune: ResNet18 layer 4 plus classifier head, two epochs on CPU (PyTorch, torchvision).
Metric. Binary defect F1 on the holdout: baseline 0.870, fine-tuned 0.96, ONNX int8 0.96 (no change). One false negative (broken_small/005), zero false positives.
Export. ONNX export, then static QDQ int8 quantization with calibration (ONNX Runtime). Size 44,788,648 to 11,231,354 bytes. Median CPU latency 8.76 ms (PyTorch) to 1.63 ms (int8). Fixed-sample check: max absolute logit difference 0.936 under a 1.0 tolerance, and PyTorch and ONNX predictions agree.
Limitations. One category, two epochs, image-level classification only (no pixel-level localization). A controlled benchmark, not a production line; verify the mirror against the official source before any commercial or redistributed use. The site is a static recorded demo.
Read the code.
The code on GitHub has every step, the tests, and the exact list of which photos were used for learning and which for testing.