AnomalyHop: An SSL-based Image Anomaly Localization Method

Kaitai Zhang, Bin Wang, Wei Wang, Fahad Sohrab, Moncef Gabbouj, C.‐c. Jay Kuo

TL;DR

This paper introduces AnomalyHop, a novel method for pinpointing anomalies in images using a framework called Successive Subspace Learning (SSL). AnomalyHop stands out by being mathematically transparent, easy to train, and remarkably fast, achieving state-of-the-art performance on a challenging benchmark dataset without relying on pre-trained deep learning models.

What Problem Does This Paper Address?

Image anomaly localization is crucial for tasks like manufacturing quality control and medical diagnosis. The challenge lies in identifying unusual regions within an image when only "normal" examples are available for training. Traditional methods often struggle with performance or speed, while deep learning approaches, though powerful, can be black boxes, computationally expensive, and require extensive pre-training on massive datasets like ImageNet. This paper aims to bridge this gap by offering a method that is both effective and interpretable, without the heavy reliance on external data or complex deep neural networks.

Methods

AnomalyHop is built upon the Successive Subspace Learning (SSL) framework, which is adapted for anomaly localization. It comprises three core modules:

  1. SSL-based Feature Extraction: Instead of using standard deep neural networks, AnomalyHop employs a data-driven approach using the channel-wise Saab (c/w Saab) transform. This transform, derived from Principal Component Analysis (PCA) and refined through several modifications (like the affine transform with bias and channel-wise processing), efficiently extracts local image features by analyzing pixel correlations at different scales (hops). This module is designed to be mathematically transparent and computationally efficient.
  2. Normality Feature Distributions Modeling: Once features are extracted, AnomalyHop models the distribution of these features from normal images. Three types of Gaussian models are proposed:
  3. Location-aware Gaussian Model: Assumes features at the same spatial location across different normal images are similar.
  4. Location-independent Gaussian Model: Useful for texture classes where spatial location is less critical, modeling features globally.
  5. Self-reference Gaussian Model: Learns the feature distribution from a single normal image, making it robust to intra-class variations and useful for specific test images.
  6. Anomaly Map Generation and Fusion: For a given test image, AnomalyHop generates anomaly scores for each pixel using the learned Gaussian models and the Mahalanobis distance. These scores are then compiled into anomaly maps for each hop. Finally, these maps are rescaled and fused using a weighted average to produce the final anomaly map, highlighting the anomalous regions.

Datasets

The primary dataset used for evaluation is the MVTec AD dataset. This dataset is notable for containing 15 classes (5 texture, 10 object) with both normal and anomalous images, along with ground truth anomaly regions. The paper emphasizes that AnomalyHop does not require external pre-training datasets like ImageNet.

Key Insights and Ideas

  • SSL as a Viable Alternative to DNNs: The paper demonstrates that SSL, a less commonly used framework for anomaly detection compared to deep learning, can achieve state-of-the-art results. This suggests that interpretability and mathematical transparency don't have to come at the cost of performance.
  • The Power of c/w Saab Transform: The c/w Saab transform is shown to be an effective feature extractor for anomaly localization, capturing multi-scale correlations without the complexity of large DNNs.
  • Flexible Gaussian Modeling: The three proposed Gaussian models (location-aware, location-independent, self-reference) offer flexibility to adapt to different types of anomaly detection tasks and image classes, a key factor in achieving high performance across diverse datasets.
  • Efficiency Without Compromise: AnomalyHop achieves high performance and speed by avoiding computationally intensive operations like nearest neighbor searches or large pre-trained models, making it suitable for real-world, resource-constrained environments.

Key Results

  • State-of-the-Art Performance: AnomalyHop achieved an AUC-ROC score of 95.9% on the MVTec AD dataset, placing it among the best-performing methods.
  • Exceptional Inference Speed: AnomalyHop boasts significantly faster inference times compared to other high-performing methods. It is 28.3x faster than SPADE and 7.5x faster than PaDiM on a CPU.
  • Efficient Training: Training AnomalyHop for each class takes approximately 2 minutes on a CPU.
  • Reduced Model Size: The c/w Saab transform in AnomalyHop results in a significantly smaller model size (around 100K parameters) compared to large DNNs like Wide-ResNet-50 (over 60M parameters).

Limitations and Future Work

  • Primitive Modeling and Decision Modules: The authors acknowledge that while the SSL-based feature extraction is powerful, the Gaussian modeling and anomaly decision modules are still considered "primitive" and could be improved.
  • Future Directions: The paper suggests exploring more advanced one-class classification methods, such as SVDD, subspace SVDD, and multimodal subspace SVDD, to enhance the feature distribution modeling and anomaly decision stages. This is an active area of their current research.

Summary updated

Abstract

An image anomaly localization method based on the successive subspace learning (SSL) framework, called Anomaly-Hop, is proposed in this work. AnomalyHop consists of three modules: 1) feature extraction via successive subspace learning (SSL), 2) normality feature distributions modeling via Gaussian models, and 3) anomaly map generation and fusion. Comparing with state-of-the-art image anomaly localization methods based on deep neural networks (DNNs), AnomalyHop is mathematically transparent, easy to train, and fast in its inference speed. Besides, its area under the ROC curve (ROC-AUC) performance on the MVTec AD dataset is 95.9%, which is among the best of several benchmarking methods.
BibTeX
@inproceedings{zhang2021anomalyhop,
  author = {Kaitai Zhang and Bin Wang and Wei Wang and Fahad Sohrab and Moncef Gabbouj and C.‐C. Jay Kuo},
  title = {{AnomalyHop: An SSL-based Image Anomaly Localization Method}},
  booktitle = {2021},
  year = {2021},
  doi = {10.1109/vcip53242.2021.9675385},
}
Figure