Skip to main content
QUICK REVIEW

[Paper Review] Optimizing PatchCore for Few/many-shot Anomaly Detection

João Santos, Triet Tran|arXiv (Cornell University)|Jul 20, 2023
Anomaly Detection Techniques and ApplicationsComputer Science7 citations
TL;DR

This paper optimizes PatchCore, a state-of-the-art anomaly detection model, for few- and many-shot settings by tuning hyperparameters and applying domain-aware data augmentations. It achieves new state-of-the-art performance on the VisA dataset and first place in the CVPR 2023 VAND challenge, demonstrating that adapting existing models can outperform newly designed methods in low-data regimes.

ABSTRACT

Few-shot anomaly detection (AD) is an emerging sub-field of general AD, and tries to distinguish between normal and anomalous data using only few selected samples. While newly proposed few-shot AD methods do compare against pre-existing algorithms developed for the full-shot domain as baselines, they do not dedicatedly optimize them for the few-shot setting. It thus remains unclear if the performance of such pre-existing algorithms can be further improved. We address said question in this work. Specifically, we present a study on the AD/anomaly segmentation (AS) performance of PatchCore, the current state-of-the-art full-shot AD/AS algorithm, in both the few-shot and the many-shot settings. We hypothesize that further performance improvements can be realized by (I) optimizing its various hyperparameters, and by (II) transferring techniques known to improve few-shot supervised learning to the AD domain. Exhaustive experiments on the public VisA and MVTec AD datasets reveal that (I) significant performance improvements can be realized by optimizing hyperparameters such as the underlying feature extractor, and that (II) image-level augmentations can, but are not guaranteed, to improve performance. Based on these findings, we achieve a new state of the art in few-shot AD on VisA, further demonstrating the merit of adapting pre-existing AD/AS methods to the few-shot setting. Last, we identify the investigation of feature extractors with a strong inductive bias as a potential future research direction for (few-shot) AD/AS.

Motivation & Objective

  • To investigate whether pre-existing full-shot anomaly detection methods like PatchCore can be improved for few- and many-shot settings through hyperparameter optimization.
  • To evaluate the effectiveness of data augmentation techniques from supervised learning in few/many-shot anomaly detection.
  • To explore whether architectural inductive biases, such as translation equivariance, improve performance in low-data regimes.
  • To establish a new state of the art in few-shot anomaly detection on the VisA benchmark.
  • To provide a reproducible, optimized implementation of PatchCore for few/many-shot settings.

Proposed method

  • Hyperparameter optimization of PatchCore, focusing on feature extractor architecture and input resolution, using exhaustive ablation on VisA and MVTec AD datasets.
  • Application of image-level data augmentations (e.g., color jitter, random crops) with domain-specific tuning to improve generalization in low-shot regimes.
  • Integration of anti-aliasing layers to enforce translation equivariance and increase inductive bias in the CNN backbone.
  • Use of greedy coreset subsampling to reduce memory bank size without sacrificing performance.
  • Combination of optimized components into a unified, end-to-end pipeline for few-shot anomaly detection.
  • Reimplementation and benchmarking of PatchCore with optimized settings, compared against SOTA methods using standard metrics (AUROC).

Experimental results

Research questions

  • RQ1Can hyperparameter tuning of PatchCore significantly improve its few- and many-shot anomaly detection performance?
  • RQ2Do data augmentation techniques from supervised learning improve few-shot anomaly detection when carefully designed for the anomaly detection domain?
  • RQ3Does increasing inductive bias in the feature extractor—via anti-aliasing or equivariance—enhance performance in low-data regimes?
  • RQ4Is the performance gain from optimization sufficient to surpass existing state-of-the-art methods in few-shot AD?
  • RQ5Can coreset subsampling reduce memory footprint without degrading performance in few-shot settings?

Key findings

  • Optimizing the feature extractor and input resolution led to significant performance gains, with PatchCore achieving 88.7% mean AUROC on MVTec AD at 4-shot and 86.4% on VisA at 4-shot.
  • Image-level augmentations improved few-shot performance when carefully tuned, but improper application degraded results, highlighting the need for domain-aware design.
  • Anti-aliasing layers that enforce translation equivariance improved performance, suggesting stronger inductive bias in feature extractors is beneficial in low-data regimes.
  • Greedy coreset subsampling reduced memory bank size without affecting performance, enabling efficient inference while preserving accuracy.
  • The optimized PatchCore model achieved a new state of the art on the VisA dataset in the few-shot setting, outperforming prior SOTA methods.
  • The approach secured first place in the few-shot anomaly detection track of the VAND challenge at CVPR 2023, validating its real-world effectiveness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.