PatchCore, simplified
PatchCore builds a compact reference of normal local image features. At inference time, patches from a new image are compared with that normal memory. Larger distances indicate regions that differ more strongly from the normal reference.
Same flow in compact form
Qualitative PatchCore results
These are real outputs from evaluated PatchCore runs across four MVTec AD categories. Each result shows the input, ground-truth mask, continuous anomaly-map overlay, and the thresholded prediction.




Selected from regenerated PatchCore outputs used in the project evaluation. Open any result for a full-size view.
Evaluation choices
Pixel AUROC can remain high because normal pixels dominate the denominator of the false-positive rate. The project therefore uses AUPIMO as the main localization metric and F1 plus precision-recall behavior at image level, with threshold sensitivity treated explicitly.
The EDA also showed strong category heterogeneity. A Kruskal-Wallis test across defect-area distributions gave H = 626.5 with p = 1.2 × 10-124, while anomalous-pixel ratios ranged from roughly 0.34% for screw to 14.5% for metal nut.


Evaluated PatchCore baseline
Across the completed 15-category baseline, localization varied substantially by category: AUPIMO reached 0.982 for bottle and 0.972 for leather, while zipper fell to 0.251. Screw was the hardest image-level category at F1 0.796.
The weaker categories direct attention to representation scale, preprocessing, coreset construction, smoothing, threshold calibration, and evaluation configuration.