Source-linked AI summary

SimpleNet: A Simple Network for Image Anomaly Detection and Localization

Zhikang Liu, Yiming Zhou, Yuansheng Xu, Zilei Wang

arXiv:2303.15140v2cs.CV

TL;DR

Industrial anomaly detection and localization must operate with scarce abnormal samples and highly varied defects. SimpleNet adapts pre-trained features, generates Gaussian-noise anomalies in feature space, and trains a simple discriminator. It reports 99.6% AUROC at 77 fps on MVTec AD and improvements on One-Class Novelty Detection.

  • Problem

    Anomaly detection and localization is challenging because abnormal samples are scarce and industrial defects vary from subtle scratches to large structural failures.

  • Method

    SimpleNet adapts pre-trained features to the target domain, adds Gaussian noise to adapted normal features to synthesize anomalies, and trains a shallow MLP discriminator.

  • Results

    99.6% AUROC and 77 fps are reported on MVTec AD, alongside significant improvements on One-Class Novelty Detection.

  • Takeaways & Limitations

    SimpleNet is presented as easy to train and apply, with accuracy and inference speed intended to support industrial anomaly-detection applications.

Abstract

from arXiv · show

We propose a simple and application-friendly network (called SimpleNet) for detecting and localizing anomalies. SimpleNet consists of four components: (1) a pre-trained Feature Extractor that generates local features, (2) a shallow Feature Adapter that transfers local features towards target domain, (3) a simple Anomaly Feature Generator that counterfeits anomaly features by adding Gaussian noise to normal features, and (4) a binary Anomaly Discriminator that distinguishes anomaly features from normal features. During inference, the Anomaly Feature Generator would be discarded. Our approach is based on three intuitions. First, transforming pre-trained features to target-oriented features helps avoid domain bias. Second, generating synthetic anomalies in feature space is more effective, as defects may not have much commonality in the image space. Third, a simple discriminator is much efficient and practical. In spite of simplicity, SimpleNet outperforms previous methods quantitatively and qualitatively. On the MVTec AD benchmark, SimpleNet achieves an anomaly detection AUROC of 99.6%, reducing the error by 55.5% compared to the next best performing model. Furthermore, SimpleNet is faster than existing methods, with a high frame rate of 77 FPS on a 3080ti GPU. Additionally, SimpleNet demonstrates significant improvements in performance on the One-Class Novelty Detection task. Code: https://github.com/DonaldRR/SimpleNet.

1. Introduction

SimpleNet addresses unsupervised anomaly detection and localization under scarce, highly variable defects by adapting pre-trained features, synthesizing feature-space anomalies, and discriminating them with a lightweight classifier. It reports strong accuracy and inference speed on MVTec AD and extends evaluation to One-Class Novelty Detection.

  • Industrial anomaly detection is difficult because abnormal samples are scarce and defects range from subtle scratches to large structural failures.
  • SimpleNet adapts pre-trained features toward the target domain to reduce bias from the mismatch between ImageNet and industrial image distributions.
  • Anomalous features are generated by adding Gaussian noise to adapted normal features rather than synthesizing defects directly in image space.
  • A shallow MLP discriminator is trained to distinguish adapted normal features from synthesized anomalies, simplifying the detection procedure.
  • 99.6% AUROC and 77 fps are reported on MVTec AD, while the method is also evaluated for One-Class Novelty Detection.

2. Related Work

Prior anomaly-localization methods mainly reconstruct images, synthesize image anomalies, or embed normal features statistically. SimpleNet instead combines target-domain feature adaptation with feature-space anomaly synthesis and a conventional single-stream inference design.

  • Anomaly detection and localization methods are commonly grouped into reconstruction-based, synthesizing-based, and embedding-based approaches.
  • Reconstruction-based methods infer anomalies from regions that a model trained only on normal data cannot accurately reconstruct.
  • Synthesizing-based methods create artificial anomalies on anomaly-free images and train discriminative models against normal data.
  • Embedding-based methods compare input features with modeled or memorized normal distributions, but normalizing-flow variants can be memory consuming.
  • SimpleNet adapts pre-trained features, synthesizes anomalies in feature space, and uses conventional CNN blocks in a single-stream inference pipeline.

3. Method

SimpleNet combines local feature extraction, target-domain adaptation, feature-space anomaly synthesis, and discriminator-based scoring. The anomaly generator is used during training, while inference retains a single-stream extractor, adaptor, and discriminator pipeline.

  • Architecture: SimpleNet consists of a Feature Extractor, Feature Adaptor, Anomalous Feature Generator, and Discriminator.The Anomalous Feature Generator is used only during training.
  • 3.1. Feature Extractor: The Feature Extractor selects features from multiple backbone hierarchies, aggregates local neighborhoods, resizes them, and concatenates them into local feature maps.The backbone feature levels are selected for the target dataset, and neighborhood aggregation uses an aggregation function such as adaptive average pooling.
  • 3.2. Feature Adaptor: The Feature Adaptor projects local features into target-oriented adapted features to reduce the domain bias of ImageNet-pretrained representations.A single fully connected layer performs well experimentally.
  • 3.3. Anomalous Feature Generator: Gaussian noise is added to adapted normal features to generate anomalous features in feature space because real defects are scarce and image-space synthesis may not match them.Each noise vector entry follows an i.i.d. Gaussian distribution N(µ, σ^2).
  • 3.5. Loss function and Training: A two-layer MLP discriminator assigns positive outputs to normal features and negative outputs to generated anomalous features.Training uses a truncated l1 loss with truncation terms set to 0.5 and -0.5 by default.
  • 3.6. Inference and Scoring function: During inference, the generator is discarded; the discriminator supplies local anomaly scores, which form an anomaly map and yield image scores through spatial maximization.The anomaly map is interpolated to input resolution and Gaussian filtered with σ = 4.

4. Experiments

Experiments evaluate SimpleNet on MVTec AD and CIFAR10 under one-class settings, using image-level and pixel-level AUROC measures for anomaly detection and localization.

  • 4.1. Datasets: MVTec AD contains 5 texture and 10 object categories, with normal training images, defective test images, and pixel-level annotations.The benchmark contains 5354 images and uses a one-class classifier trained separately for each category.
  • 4.1. Datasets: CIFAR10 is used for one-class novelty detection, treating one category as normal and the remaining categories as novelty.The dataset contains 50K training images and 10K test images at 32 × 32 resolution.
  • 4.2. Evaluation Metrics: Image-level detection uses I-AUROC from anomaly detection scores, while localization uses P-AUROC from pixel-level anomaly maps.MVTec AD results are reported as class-average and mean AUROC across categories, with comparisons against eight listed baselines.
  • Training procedure: The training procedure initializes a pretrained feature extractor and randomly initialized adaptor and discriminator, then optimizes discriminator outputs on adapted normal and noisy anomalous features.The pseudo-code computes o = F(x), q = G(o), and q_ = q + random(N).

4.3. Implementation Details

The implementation uses ImageNet-pretrained backbones, selected intermediate layers, and a lightweight fully connected feature adaptor.

  • Backbone and feature extraction: All experimental backbones are pretrained on ImageNet, with the second and third intermediate layers used for ResNet-like architectures.The default backbone is WideResnet50, and the feature extractor output dimension is 1536.
  • Feature adaptor: The feature adaptor is implemented as a bias-free fully connected layer.This design is the default implementation configuration described for the experiments.

4.4. Anomaly detection on MVTec AD

On MVTec AD, SimpleNet achieves strong image-level anomaly detection across texture and object classes, outperforming the next-best competitor under the same backbone.

  • 99.6% I-AUROC is SimpleNet’s mean image-level anomaly detection score on MVTec AD.It achieves the highest score for 9 of 15 classes.
  • 99.8% I-AUROC on textures and 99.5% I-AUROC on objects establish new state-of-the-art results.
  • 55.5% error reduction results from decreasing error from 0.9% for PatchCore to 0.4% for SimpleNet.The comparison uses the same WideResnet50 backbone.

4.5. Anomaly localization on MVTec AD

SimpleNet performs anomaly localization on MVTec AD using pixel-wise AUROC, achieving the best reported overall and object-category results.

  • 98.1% P-AUROC is SimpleNet’s anomaly localization performance on MVTec AD.P-AUROC measures pixel-wise anomaly localization.
  • 98.4% P-AUROC is SimpleNet’s new state-of-the-art result for object categories.SimpleNet achieves the highest score for 4 of 15 classes.
  • SimpleNet visualizes representative anomaly-localization samples in Figure 8.

4.6. Inference time

SimpleNet combines high anomaly-detection performance with fast inference on the stated hardware, supporting industrial deployment considerations.

  • SimpleNet achieves the best performance and fastest speed among the compared methods on the same hardware.Measurements use an Nvidia GeForce GTX 3080ti GPU and Intel Xeon E5-2680 v3 CPU.
  • Nearly 8× faster than PatchCore is SimpleNet’s reported inference-speed advantage.

4.7. Ablation study

The ablation study examines hierarchy selection, feature-adaptor design, noise scale, loss function, backbone choice, and qualitative localization behavior on MVTec AD.

  • Neighborhood size and hierarchies: p = 3 provides the default neighborhood size by balancing locality and global context for anomaly predictions.Hierarchy level 3 reaches state-of-the-art performance, while adding level 2 provides further benefit; the default is 2 + 3.
  • Adaptor configuration: A single bias-free FC feature adaptor with equal input and output channels yields the best performance among tested adaptor configurations.Removing the adaptor or using a nonlinear adaptor performs worse; the complex adaptor causes a significant performance drop.
  • Scale of noise: σ = 0.015 balances the noise-scale trade-off and yields the best performance.Large σ produces loose decision bounds and high false negatives, while tiny σ destabilizes training and weakens generalization to normal features.
  • Loss function: 0.2% I-AUROC and 0.3% P-AUROC improvements are obtained over cross-entropy loss.
  • Dependency on backbone: Results remain mostly stable across different backbones, while WideResNet50 is selected for comparability with PaDiM and PatchCore.
  • Qualitative results: Qualitative results show consistent localization performance across object and texture classes, including difficult cases.Segmentation thresholds are obtained by calculating the F1-score over anomaly scores for each subclass.

4.8. One-Class Novelty Detection

SimpleNet is evaluated for one-class novelty detection on CIFAR-10 by training separately on each class and detecting samples from other categories. It outperforms the listed comparison methods.

  • 4.8. One-Class Novelty Detection: SimpleNet is evaluated on CIFAR-10 by training a separate model for each class and detecting samples from other categories.The novelty score is defined as the maximum score in the similarity map.
  • 4.8. One-Class Novelty Detection: SimpleNet outperforms VAE, LSA, DSVDD, OCGAN, HRN, AnoGAN, DAAD, MKD, DisAug CLR, IGD, and RevDist.IGD and DisAug CLR achieve 91.25% and 92.4%, respectively, when boosted by self-supervised learning.

5. Conclusion

The conclusion presents SimpleNet as a simple, efficient approach for unsupervised anomaly detection and localization. It reports the highest performance and fastest inference speed among previous state-of-the-art methods on MVTec AD, positioning the method for industrial application.

  • 5. Conclusion: SimpleNet uses simple neural network modules that are easy to train and apply in industrial scenarios.The approach is proposed for unsupervised anomaly detection and localization.
  • 5. Conclusion: SimpleNet achieves the highest performance and fastest inference speed among previous state-of-the-art methods on the MVTec AD benchmark.The conclusion characterizes these results as bridging academic research and industrial application.
Loading 2303.15140v2…