Skip to main contentIntroduction
PatchCore is a CNN-based model that uses a backbone network pretrained on large natural image datasets (ImageNet) for feature extraction.
PatchCore uses a network ϕ pre-trained on ImageNet. As the features at specific network hierarchies play an important role, we use ϕi,j=ϕj(xi) to denote the features for image xi∈X (with dataset X) and hierarchy-level j of the pre-trained network ϕ.
If not noted otherwise, j indexes feature maps from ResNet-like architectures, such as ResNet-50 or WideResNet-50, with j∈{1,2,3,4} indicating the final output of respective spatial resolution blocks.
Key Features
- Patch-based Approach: Operates on image patches rather than whole images
- Coreset Sampling: Reduces memory requirements by selecting representative patches
- Pretrained Features: Leverages features from networks pretrained on ImageNet
How It Works
- Feature Extraction: Extract patch-level features from intermediate layers of a pretrained CNN
- Memory Bank Construction: Build a memory bank of nominal patch features
- Coreset Reduction: Apply coreset sampling to reduce memory requirements while maintaining coverage
- Anomaly Scoring: For test images, compute distance to nearest neighbors in the memory bank
Cold Start Considerations
PatchCore relies heavily on a representative set of nominal features to work. During cold start scenarios, since there is limited nominal data, PatchCore’s coreset reduction strategy cannot be properly applied. A simpler strategy such as random sampling can be used to build the initial nominal feature set.