NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Domain-independent detection of known anomalies

Jonas Bühler, Jonas Fehrenbach, Lucas Steinmann, Christian Nauck, Marios KoulakisarXiv 2024

Abstract

One persistent obstacle in industrial quality inspection is the detection of anomalies. In real-world use cases, two problems must be addressed: anomalous data is sparse and the same types of anomalies need to be detected on previously unseen objects. Current anomaly detection approaches can be trained with sparse nominal data, whereas domain generalization approaches enable detecting objects in previously unseen domains. Utilizing those two observations, we introduce the hybrid task of domain generalization on sparse classes. To introduce an accompanying dataset for this task, we present a modification of the well-established MVTec AD dataset by generating three new datasets. In addition to applying existing methods for benchmark, we design two embedding-based approaches, Spatial Embedding MLP (SEMLP) and Labeled PatchCore. Overall, SEMLP achieves the best performance with an average image-level AUROC of 87.2 % vs. 80.4 % by MIRO. The new and openly available datasets allow for further research to improve industrial anomaly detection.

Introduction

In industrial quality inspection, deep learning deployment faces two major hurdles: data scarcity and domain shift. Anomalies are inherently rare, making it difficult to collect sufficient examples for every product. Furthermore, a model trained to detect defects on one material (e.g., metal) often fails on another (e.g., plastic) without extensive retraining.

This research addresses the challenge of "domain-independent" detection: training a model to recognize the concept of an anomaly (like a "hole" or a "cut") across various domains so it can identify similar defects on entirely new objects. This hybrid task combines domain generalization with sparse class learning.

Methodology: Spatial Embedding MLP

The authors propose the Spatial Embedding MLP (SEMLP) as a streamlined solution for this task. Unlike complex distance-based matching algorithms, SEMLP leverages the power of patch-level embeddings to classify regions of an image.

Overview of the Spatial Embedding MLP (SEMLP) architecture.

The process involves extracting patch-level embeddings from a pre-trained backbone, such as Wide-ResNet50 or ViT. These embeddings are then fed into a simple Multi-Layer Perceptron (MLP) trained to classify individual patches as "normal" or "anomalous." This approach benefits from the massive amount of data available at the patch level; even a small set of anomalous images provides thousands of training samples for the MLP, allowing it to learn robust decision boundaries.

Other methods explored in this study include:

  • MIRO: A domain generalization method using a regularization loss to maintain feature robustness across domains.
  • Labeled PatchCore: An extension of the PatchCore algorithm that incorporates a secondary coreset specifically for anomalous patches.

Benchmark Datasets

To evaluate domain generalization, the researchers modified the MVTec AD dataset into three new benchmarks grouped by anomaly type rather than object category:

  • hole: Includes categories like cable, carpet, hazelnut, and leather where defects are punctures or holes.
  • cut: Includes categories with "cuts" or "cracks."
  • color: Includes "stains," "print errors," or "oil spots."

These datasets enable "leave-one-category-out" cross-validation, testing a model's ability to generalize to a completely unseen object category (e.g., training on holes in leather and testing on holes in wood).

Experimental Results

The SEMLP approach demonstrated superior performance across the new benchmarks, proving that simple classification on embeddings can be more effective than complex coreset matching in generalized contexts.

Performance comparison (AUROC) of SEMLP against other methods across different anomaly types and backbones.

As shown in the results, SEMLP with a Wide-ResNet50 backbone achieved an average image-level AUROC of 87.2%, significantly outperforming the previous state-of-the-art domain generalization method, MIRO (80.4%). Interestingly, the more complex Labeled PatchCore performed poorly (47.4%), suggesting that rigid coreset structures can hinder generalization compared to the flexible boundary learning of a simple MLP.

Conclusion and Future Work

The success of SEMLP highlights that learning the abstract concept of an anomaly is feasible and effective for industrial inspection. However, challenges remain, particularly in determining optimal anomaly thresholds for new domains without target-specific data. Future research will focus on improving generalization for complex textures and achieving a truly "zero-shot" deployment system where models work instantly on new product lines.

Summary updated

BibTeX
@misc{buhler2024domain,
  author = {Jonas Bühler and Jonas Fehrenbach and Lucas Steinmann and Christian Nauck and Marios Koulakis},
  title = {{Domain-independent detection of known anomalies}},
  year = {2024},
  eprint = {2407.02910},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.02910},
}
Figure