Skip to main content
QUICK REVIEW

[Paper Review] MLF-SC: Incorporating multi-layer features to sparse coding for anomaly detection

Ryuji Imamura, Kohei Azuma|arXiv (Cornell University)|Apr 9, 2021
Anomaly Detection Techniques and ApplicationsComputer Science14 references5 citations
TL;DR

This paper proposes MLF-SC, a novel anomaly detection method that enhances sparse coding by incorporating multi-layer features from a pre-trained VGG16 network. By applying sparse coding to intermediate feature maps instead of raw images, MLF-SC effectively captures anomalies at multiple scales, achieving state-of-the-art performance on the MVTec AD texture dataset with an average AUROC of 0.97, significantly outperforming traditional sparse coding and other deep learning-based methods.

ABSTRACT

Anomalies in images occur in various scales from a small hole on a carpet to a large stain. However, anomaly detection based on sparse coding, one of the widely used anomaly detection methods, has an issue in dealing with anomalies that are out of the patch size employed to sparsely represent images. A large anomaly can be considered normal if seen in a small scale, but it is not easy to determine a single scale (patch size) that works well for all images. Then, we propose to incorporate multi-scale features to sparse coding and improve the performance of anomaly detection. The proposed method, multi-layer feature sparse coding (MLF-SC), employs a neural network for feature extraction, and feature maps from intermediate layers of the network are given to sparse coding, whereas the standard sparse-coding-based anomaly detection method directly works on given images. We show that MLF-SC outperforms state-of-the-art anomaly detection methods including those employing deep learning. Our target data are the texture categories of the MVTec Anomaly Detection (MVTec AD) dataset, which is a modern benchmark dataset consisting of images from the real world. Our idea can be a simple and practical option to deal with practical data.

Motivation & Objective

  • To address the limitation of sparse coding in detecting large-scale anomalies due to fixed patch size.
  • To improve anomaly detection robustness across diverse texture types in real-world images.
  • To leverage hierarchical features from deep neural networks for better anomaly representation.
  • To develop a practical, non-generative method that outperforms both classical sparse coding and modern deep learning-based anomaly detection models.
  • To demonstrate the effectiveness of multi-scale feature representation in sparse coding for anomaly detection.

Proposed method

  • The method uses a pre-trained VGG16 network to extract multi-scale features from intermediate layers.
  • Sparse coding is applied not to the original image, but to feature maps from multiple layers of VGG16.
  • A dictionary is trained exclusively on normal images from each texture category to reconstruct feature patches.
  • Reconstruction errors are computed for each feature patch, and the top-5 largest errors are summed to form the anomaly score.
  • The anomaly score is thresholded to classify images as normal or anomalous, focusing on high-error regions to detect small or large anomalies.
  • Optimization uses Lasso-LARS with a sparsity-inducing parameter α = 1, and patch size is 8×8 with stride 2 for feature maps.

Experimental results

Research questions

  • RQ1Can multi-layer features from a deep neural network improve the detection of anomalies at varying scales in sparse coding?
  • RQ2Does applying sparse coding to intermediate feature maps lead to better anomaly detection performance than using raw image patches?
  • RQ3How does MLF-SC compare to state-of-the-art methods like autoencoders, AnoGAN, and CNN feature dictionaries on real-world texture data?
  • RQ4Can a non-generative, sparse coding-based method achieve SOTA performance on the MVTec AD benchmark?
  • RQ5Is the proposed method robust across diverse texture categories with varying anomaly characteristics?

Key findings

  • MLF-SC achieved the highest average AUROC of 0.97 across all five texture categories in the MVTec AD dataset, surpassing all compared methods.
  • On the Carpet category, MLF-SC achieved an AUROC of 0.99, compared to 0.58 for standard sparse coding.
  • For the Leather category, MLF-SC achieved 0.99 AUROC, significantly outperforming the CNN feature dictionary (0.95 AUROC) and AnoGAN (0.12 AUROC).
  • The method successfully detected large anomalies that were missed by standard sparse coding, as shown in the reconstruction error histograms where deep-layer features showed clear separation from normal distributions.
  • MLF-SC demonstrated consistent performance across all five texture categories, with AUROC values above 0.92 in every category, indicating strong robustness.
  • The use of top-5 largest reconstruction errors improved detection of small anomalies by focusing on high-error regions and avoiding suppression by normal regions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.