Table of Contents
Fetching ...

AnomalousPatchCore: Exploring the Use of Anomalous Samples in Industrial Anomaly Detection

Mykhailo Koshil, Tilman Wegener, Detlef Mentrup, Simone Frintrop, Christian Wilms

TL;DR

Anomaly detection in industrial settings often suffers from scarce anomalous samples. The authors propose AnomalousPatchCore (APC), which fine-tunes a ResNet-50 feature extractor using in-domain anomalous data via three auxiliary tasks (classification, segmentation, reconstruction) and integrates with a PatchCore-like memory-bank for robust detection, formalized by the loss $L = 10 \cdot L_{cls} + L_{segm} + L_{recon}$. Evaluated on the MVTec AD dataset, APC achieves state-of-the-art image-level anomaly detection metrics, outperforming PatchCore and PRNet, while localization remains reasonable for screening purposes. The approach demonstrates that a small set of real anomalous samples can substantially enhance detection without heavy synthetic data generation, offering practical benefits for manufacturing quality control.

Abstract

Visual inspection, or industrial anomaly detection, is one of the most common quality control types in manufacturing. The task is to identify the presence of an anomaly given an image, e.g., a missing component on an image of a circuit board, for subsequent manual inspection. While industrial anomaly detection has seen a surge in recent years, most anomaly detection methods still utilize knowledge only from normal samples, failing to leverage the information from the frequently available anomalous samples. Additionally, they heavily rely on very general feature extractors pre-trained on common image classification datasets. In this paper, we address these shortcomings and propose the new anomaly detection system AnomalousPatchCore~(APC) based on a feature extractor fine-tuned with normal and anomalous in-domain samples and a subsequent memory bank for identifying unusual features. To fine-tune the feature extractor in APC, we propose three auxiliary tasks that address the different aspects of anomaly detection~(classification vs. localization) and mitigate the effect of the imbalance between normal and anomalous samples. Our extensive evaluation on the MVTec dataset shows that APC outperforms state-of-the-art systems in detecting anomalies, which is especially important in industrial anomaly detection given the subsequent manual inspection. In detailed ablation studies, we further investigate the properties of our APC.

AnomalousPatchCore: Exploring the Use of Anomalous Samples in Industrial Anomaly Detection

TL;DR

Anomaly detection in industrial settings often suffers from scarce anomalous samples. The authors propose AnomalousPatchCore (APC), which fine-tunes a ResNet-50 feature extractor using in-domain anomalous data via three auxiliary tasks (classification, segmentation, reconstruction) and integrates with a PatchCore-like memory-bank for robust detection, formalized by the loss . Evaluated on the MVTec AD dataset, APC achieves state-of-the-art image-level anomaly detection metrics, outperforming PatchCore and PRNet, while localization remains reasonable for screening purposes. The approach demonstrates that a small set of real anomalous samples can substantially enhance detection without heavy synthetic data generation, offering practical benefits for manufacturing quality control.

Abstract

Visual inspection, or industrial anomaly detection, is one of the most common quality control types in manufacturing. The task is to identify the presence of an anomaly given an image, e.g., a missing component on an image of a circuit board, for subsequent manual inspection. While industrial anomaly detection has seen a surge in recent years, most anomaly detection methods still utilize knowledge only from normal samples, failing to leverage the information from the frequently available anomalous samples. Additionally, they heavily rely on very general feature extractors pre-trained on common image classification datasets. In this paper, we address these shortcomings and propose the new anomaly detection system AnomalousPatchCore~(APC) based on a feature extractor fine-tuned with normal and anomalous in-domain samples and a subsequent memory bank for identifying unusual features. To fine-tune the feature extractor in APC, we propose three auxiliary tasks that address the different aspects of anomaly detection~(classification vs. localization) and mitigate the effect of the imbalance between normal and anomalous samples. Our extensive evaluation on the MVTec dataset shows that APC outperforms state-of-the-art systems in detecting anomalies, which is especially important in industrial anomaly detection given the subsequent manual inspection. In detailed ablation studies, we further investigate the properties of our APC.
Paper Structure (23 sections, 1 equation, 4 figures, 6 tables)

This paper contains 23 sections, 1 equation, 4 figures, 6 tables.

Figures (4)

  • Figure 1: Result of our proposed anomaly detection system APC and PatchCore roth2022patchcore on the MVTec dataset. Localization results are overlayed with the original images. Red indicates likely anomalous areas, while blue indicates likely normal areas.
  • Figure 2: Abstract system figure of baseline PatchCore with three major components: the feature extraction (top left), the patch creation (bottom left), and the memory bank (right side). In our proposed system APC (see \ref{['sec:method']}), we improve the feature extractor marked by the arrow, while keeping the rest of PatchCore.
  • Figure 3: Detailed system figure of the feature extractor in our APC during training. Based on a ResNet-50 (top), we construct a U-Net decoder (bottom right) with two skip-connections (optionally four, dashed lines) and three task-specific heads on top (bottom left). Here, Tconv denotes transposed convolution. Each head corresponds to one of the auxiliary tasks: classification, segmentation, and reconstruction. Note that the remainder of the anomaly detection system is similar to PatchCore (see \ref{['fig:patchcore']}).
  • Figure 4: Qualitative localization results for categories Pill, Tile, and Screw on the MVTec dataset for our proposed APC and standard PatchCore with 10 anomalous samples per category. Localization results are overlayed with the original images. Red indicates likely anomalous areas, while blue indicates likely normal areas.