End-to-end ML · DenseNet-121 · Transfer Learning · MVTec AD
Detecting defects on a
production line, automatically.
Manual inspection on production lines is slow and inconsistent, and small defects are easy to miss. I built a system that automatically checks bottle images in real time, classifying them as good or defective in under 50ms. It also highlights where the defect is in the image and uses a second model to catch unusual issues that weren't seen during training.
98.4%
AUC-ROC
96.2%
F1 score
<50ms
Inference time
2
Models (CNN + AE)
Heads up: this model only knows one thing — glass/plastic bottles shot from directly overhead
(the MVTec dataset, top-down view).
It can spot large cracks, small chips, and contamination. Upload anything else and the result won't mean anything.
What to upload →
Try it
Start with a real sample from the test set:
or upload your own
Pick a sample above or drop in your own photo.
Defect probability below 33.6% — Good
Defect probability 33.6% or higher — Defective
Confidence below 70% — model is uncertain, probably the wrong kind of image
What the model sees
No analysis yet.
Upload an image or try a sample.
CNN and autoencoder disagree — send for manual QA review
—
Defect probability
—
Model attention map
Warmer colours (red/yellow) = regions that most influenced the defect prediction. Generated by Grad-CAM on DenseNet-121 features.norm5.
Raw API response
—
What to upload
Only knows overhead bottle photos. 1 of 15 MVTec categories.
Upload this
A top-down bottle shot like this. That's the only thing this model knows.
- Glass or plastic bottle, photographed from directly above
- Camera pointing straight down (bird's-eye / top-down)
- Plain white or grey background, no clutter, no shadows
- Single bottle filling most of the frame
- 3 defect types: large cracks, small chips, contamination
Do not upload this
- Photos of people, food, animals, or scenes
- Screenshots, documents, app UI
- Non-bottle products (cables, metal, fabric…)
- Cluttered backgrounds or side-angle shots
- Very dark, blurry, or overexposed images
The model has no way to say "I don't recognise this." It will always output a verdict. For non-bottle images, that verdict is meaningless.