# Optimizing PatchCore for Few/many-shot Anomaly Detection

**Authors:** João Santos, Triet Tran, Oliver Rippel  
**arXiv:** [2307.10792](https://arxiv.org/abs/2307.10792)  
**Date:** 2023-07-20  
**Summary page:** https://www.summarizepaper.com/en/paper/2307.10792v1/

## Key points

- Study focuses on few-shot anomaly detection within general anomaly detection field
- Lack of dedicated optimization for few-shot setting in existing algorithms
- Research investigates PatchCore algorithm's performance in AD/anomaly segmentation
- Optimizing hyperparameters like feature extractor leads to significant performance gains
- Image-level augmentations may impact performance, but results are not guaranteed
- New state-of-the-art achievement in few-shot AD on VisA dataset
- Adapting pre-existing methods to suit few-shot settings is valuable and can improve AD capabilities across different shot settings

## Summary

In the study titled "Optimizing PatchCore for Few/many-shot Anomaly Detection," authors João Santos, Triet Tran, and Oliver Rippel explore few-shot anomaly detection (AD) within the broader field of general AD. The focus is on distinguishing between normal and anomalous data using a limited number of selected samples. While recent advancements in few-shot AD have compared against established algorithms designed for full-shot scenarios as benchmarks, there has been a lack of dedicated optimization for the few-shot setting. This raises questions about whether existing algorithms can be further enhanced in this context. The research presented in this work centers around investigating the AD/anomaly segmentation (AS) performance of PatchCore, currently considered the state-of-the-art algorithm for full-shot AD/AS. The hypothesis is that significant performance improvements can be achieved by optimizing various hyperparameters within PatchCore and by transferring techniques known to enhance few-shot supervised learning to the AD domain. Through exhaustive experiments on publicly available VisA and MVTec AD datasets, the authors demonstrate that optimizing hyperparameters such as the underlying feature extractor can lead to substantial performance gains. They also explore how image-level augmentations may impact performance and note that while beneficial effects are possible, they are not guaranteed. These findings culminate in a new state-of-the-art achievement in few-shot AD specifically on the VisA dataset. This success highlights the value of adapting pre-existing AD/AS methods to suit the requirements of few-shot settings. Furthermore, it suggests a potential future research direction focusing on feature extractors with strong inductive biases for both few-shot and many-shot anomaly detection scenarios. Overall, this study sheds light on how fine-tuning existing algorithms like PatchCore and incorporating insights from few-shot supervised learning can improve anomaly detection capabilities across different shot settings.
