yandyassine / patchcoreruns in your browser · no server
Unsupervised anomaly detection · MVTec AD

Find defects it has never seen.

The model was fitted on photos of good parts only. It flags any patch of an image that looks unlike every patch it has seen before. A from-scratch reimplementation of PatchCore (CVPR 2022), exported to ONNX and running here on your own device. Your image never leaves the browser.

1.000image AUROC · bottle
0.999image AUROC · metal nut
0.977image AUROC · grid
0defect images used to fit
1 · Product
2 · Image
Test images

No example images here: MVTec AD is CC BY-NC-SA 4.0, so its photos are not redistributed. Download test images from the MVTec AD page (bottle, metal nut or grid) and upload one above.

One model per product: each was fitted on that product's good parts. A photo of something else will (correctly) look anomalous everywhere.

input · 224 px crop
upload a photo ←
anomaly heatmap
red = unlike any good patch
Waiting for an image
normalanomalous
Models load on first use (~50 MB each, cached afterwards).
01

Describe every patch

A WideResNet-50 pretrained on ImageNet turns each image into 28 × 28 patch descriptors (mid-level layers 2 + 3, averaged over a 3 × 3 neighborhood).

02

Remember the good ones

Descriptors from defect-free training images go into a memory bank, shrunk to 10 % by greedy coreset sampling so it still covers every normal pattern.

03

Score by distance

Each test patch is scored by its distance to the nearest remembered patch. The image score is the worst patch; the threshold maximizes F1 on the MVTec test set.