October 19, 2024

https://arxiv.org/abs/2106.08265

About

PatchCore is a type of anomaly detection algorithm that gained attention for achieving high scores in MVTech benchmarks. PatchCore uses a unique approach that doesn’t involve the learning process of neural networks. Specifically, it defines normal data through the following process:

  1. Obtain feature maps generated from the lower-level layers of pre-trained ResNet or WideResNet models trained on ImageNet for normal image datasets.
  2. Reduce the number of normal features by sampling only the required features from the obtained set of features (Coreset-reduced patch-feature memory bank).

Anomalies are detected by comparing the defined normal features with test data, following these steps:

  1. Similar to the training phase, obtain features for anomalous data from the lower-level layers of ResNet or WideResNet.
  2. Calculate anomaly values by comparing them with the stored normal features in the Memory Bank, which is used for anomaly detection.

Algorithm on Training Process

Locally aware patch features

Aggregate the feature maps outputted from ResNet or WideResNet using Adaptive Average Pooling and store them as features.

Coreset-reduced patch-feature memory bank

Following the greedy algorithm of argmax-min below, the selection of normal samples is performed. It has been reported that even when reducing the amount of normal features to 1/100 with this sampling method, significant performance degradation was not observed.

Algorithm on Inference Process

Detect anomalies by computing Anomaly Score

To determine the image-level anomaly score, the distance between the normal features in the memory bank and the features of the test image is determined through nearest neighbor search.

The scores obtained above are used to determine the image-level anomaly score by applying weighting.