Unofficial implementation of PatchCore anomaly detection model

PatchCore anomaly detection

Unofficial implementation of PatchCore(new SOTA) anomaly detection model

Original Paper : Towards Total Recall in Industrial Anomaly Detection (Jun 2021)
Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf, Thomas Brox, Peter Gehler

https://arxiv.org/abs/2106.08265
https://paperswithcode.com/sota/anomaly-detection-on-mvtec-ad

notice(21/06/18) :
This code is not yet verified. Any feedback is appreciated.
updates(21/06/21) :

  • I used sklearn’s SparseRandomProjection(ep=0.9) for random projection. I’m not confident with this.
  • I think exact value of “b nearest patch-features” is not presented in the paper. I just set 9. (args.n_neighbors)
  • In terms of NN search, author used “faiss”. but not implemented in this code yet.
  • sample embeddings/carpet/embedding.pickle => coreset_sampling_ratio=0.001

updates(21/06/26) :

  • A critical issue related to “locally aware patch” raised and fixed. Score table is updated.

Usage

# install python 3.6, torch==1.8.1, torchvision==0.9.1
pip

 

 

 

To finish reading, please visit source site