Table of Contents
Fetching ...

A Prototype-Based Neural Network for Image Anomaly Detection and Localization

Chao Huang, Zhao Kang, Hong Wu

TL;DR

This paper addresses industrial image anomaly detection and localization by introducing ProtoAD, a prototype-based network that leverages pre-trained patch features and non-parametric prototypes learned via FINCH. The prototypes act as kernels in a convolutional layer, enabling end-to-end anomaly scoring and localization without a training phase and delivering fast inference. The anomaly score for a patch is computed as $s_{ij} = 1 - \max_{k} \cos(\mathbf{x}_{ij}, \mathbf{m}_k)$, with the image-level score $S = \max_{i,j} s_{ij}$, while localization arises from a mapped normal-score via channel max-pooling and subsequent upsampling and smoothing. Experiments on MVTec AD and BTAD show ProtoAD achieving competitive accuracy with superior inference speed, making it well-suited for real-world industrial deployment, and code is publicly available.

Abstract

Image anomaly detection and localization perform not only image-level anomaly classification but also locate pixel-level anomaly regions. Recently, it has received much research attention due to its wide application in various fields. This paper proposes ProtoAD, a prototype-based neural network for image anomaly detection and localization. First, the patch features of normal images are extracted by a deep network pre-trained on nature images. Then, the prototypes of the normal patch features are learned by non-parametric clustering. Finally, we construct an image anomaly localization network (ProtoAD) by appending the feature extraction network with $L2$ feature normalization, a $1\times1$ convolutional layer, a channel max-pooling, and a subtraction operation. We use the prototypes as the kernels of the $1\times1$ convolutional layer; therefore, our neural network does not need a training phase and can conduct anomaly detection and localization in an end-to-end manner. Extensive experiments on two challenging industrial anomaly detection datasets, MVTec AD and BTAD, demonstrate that ProtoAD achieves competitive performance compared to the state-of-the-art methods with a higher inference speed. The source code is available at: https://github.com/98chao/ProtoAD.

A Prototype-Based Neural Network for Image Anomaly Detection and Localization

TL;DR

This paper addresses industrial image anomaly detection and localization by introducing ProtoAD, a prototype-based network that leverages pre-trained patch features and non-parametric prototypes learned via FINCH. The prototypes act as kernels in a convolutional layer, enabling end-to-end anomaly scoring and localization without a training phase and delivering fast inference. The anomaly score for a patch is computed as , with the image-level score , while localization arises from a mapped normal-score via channel max-pooling and subsequent upsampling and smoothing. Experiments on MVTec AD and BTAD show ProtoAD achieving competitive accuracy with superior inference speed, making it well-suited for real-world industrial deployment, and code is publicly available.

Abstract

Image anomaly detection and localization perform not only image-level anomaly classification but also locate pixel-level anomaly regions. Recently, it has received much research attention due to its wide application in various fields. This paper proposes ProtoAD, a prototype-based neural network for image anomaly detection and localization. First, the patch features of normal images are extracted by a deep network pre-trained on nature images. Then, the prototypes of the normal patch features are learned by non-parametric clustering. Finally, we construct an image anomaly localization network (ProtoAD) by appending the feature extraction network with feature normalization, a convolutional layer, a channel max-pooling, and a subtraction operation. We use the prototypes as the kernels of the convolutional layer; therefore, our neural network does not need a training phase and can conduct anomaly detection and localization in an end-to-end manner. Extensive experiments on two challenging industrial anomaly detection datasets, MVTec AD and BTAD, demonstrate that ProtoAD achieves competitive performance compared to the state-of-the-art methods with a higher inference speed. The source code is available at: https://github.com/98chao/ProtoAD.
Paper Structure (24 sections, 4 equations, 4 figures, 8 tables)

This paper contains 24 sections, 4 equations, 4 figures, 8 tables.

Figures (4)

  • Figure 1: Examples from the MVTec benchmark datasets. From top to bottom: anomaly samples, anomaly mask, and anomaly score maps predicted by our method.
  • Figure 2: An overview of the proposed method. First, the patch features of normal images are extracted by a deep network pre-trained on nature images. Then, the prototypes of the normal patch features are learned by FINCH clustering. For inference, an image anomaly localization network (ProtoAD) is constructed by appending the feature extraction network with the $L2$ feature normalization, a $1\times1$ convolutional layer, a channel max-pooling (CMP), and a subtraction operation, and anomaly localization is performed in an end-to-end manner.
  • Figure 3: Anomaly detection and localization process of ProtoAD.
  • Figure 4: Qualitative anomaly localization results of our method. From top to bottom: abnormal images, ground-truth, and anomaly score maps produced by our method.