Skip to main content
QUICK REVIEW

[Paper Review] Attention Guided Anomaly Detection and Localization in Images.

Shashanka Venkataramanan, Kuan–Chuan Peng|arXiv (Cornell University)|Nov 19, 2019
Anomaly Detection Techniques and ApplicationsComputer Science28 references13 citations
TL;DR

This paper proposes CAVGA, a convolutional adversarial variational autoencoder with guided attention for unsupervised and weakly-supervised anomaly detection and localization. It uses spatially-aware latent variables and novel attention losses to focus on normal regions, outperforming SOTA methods on MVTec, mSTC, and LAG datasets without anomalous training images or with only 2% anomalous data.

ABSTRACT

Anomaly localization is an important problem in computer vision which involves localizing anomalous regions within images with applications in industrial inspection, surveillance, and medical imaging. This task is challenging due to the small sample size and pixel coverage of the anomaly in real-world scenarios. Most prior works need to use anomalous training images to compute a class-specific threshold to localize anomalies. Without the need of anomalous training images, we propose Convolutional Adversarial Variational autoencoder with Guided Attention (CAVGA), which localizes the anomaly with a convolutional latent variable to preserve the spatial information. In the unsupervised setting, we propose an attention expansion loss where we encourage CAVGA to focus on all normal regions in the image. Furthermore, in the weakly-supervised setting we propose a complementary guided attention loss, where we encourage the attention map to focus on all normal regions while minimizing the attention map corresponding to anomalous regions in the image. CAVGA outperforms the state-of-the-art (SOTA) anomaly localization methods on MVTec Anomaly Detection (MVTAD), modified ShanghaiTech Campus (mSTC) and Large-scale Attention based Glaucoma (LAG) datasets in the unsupervised setting and when using only 2% anomalous images in the weakly-supervised setting. CAVGA also outperforms SOTA anomaly detection methods on the MNIST, CIFAR-10, Fashion-MNIST, MVTAD, mSTC and LAG datasets.

Motivation & Objective

  • To address the challenge of anomaly localization in images with limited anomalous samples and small anomaly coverage.
  • To eliminate the need for anomalous training images in anomaly localization by leveraging unsupervised and weakly-supervised learning.
  • To preserve spatial information in the latent space using convolutional latent variables for precise anomaly localization.
  • To develop attention-based loss functions that guide the model to focus on normal regions while suppressing attention on anomalies.
  • To achieve state-of-the-art performance in both anomaly detection and localization across multiple benchmark datasets.

Proposed method

  • CAVGA employs a convolutional latent variable to maintain spatial structure in the latent representation, enabling precise localization of anomalies.
  • In the unsupervised setting, an attention expansion loss encourages the model to attend to all normal regions in the image.
  • In the weakly-supervised setting, a complementary guided attention loss minimizes attention on anomalous regions while maximizing attention on normal regions.
  • The model uses adversarial training to improve reconstruction quality and feature realism in the latent space.
  • The attention map is used to generate anomaly heatmaps, which highlight anomalous regions based on reconstruction error and attention distribution.
  • The framework is trained end-to-end using reconstruction loss, adversarial loss, and the proposed attention-based regularization.

Experimental results

Research questions

  • RQ1Can anomaly localization be achieved without any anomalous training images using a self-supervised approach?
  • RQ2How effective is guided attention in focusing on normal regions to improve anomaly localization performance?
  • RQ3Can a unified model achieve state-of-the-art results in both unsupervised and weakly-supervised anomaly detection and localization?
  • RQ4How does the use of convolutional latent variables compare to fully connected latent spaces in preserving spatial information for anomaly localization?
  • RQ5What is the performance gain of the proposed attention losses over standard reconstruction-based methods on benchmark datasets?

Key findings

  • CAVGA achieves state-of-the-art performance in unsupervised anomaly localization on the MVTec Anomaly Detection (MVTAD), modified ShanghaiTech Campus (mSTC), and Large-scale Attention based Glaucoma (LAG) datasets.
  • With only 2% anomalous images in the training set, CAVGA significantly outperforms existing weakly-supervised methods on the same benchmarks.
  • CAVGA surpasses SOTA anomaly detection methods on MNIST, CIFAR-10, Fashion-MNIST, MVTAD, mSTC, and LAG datasets in both detection and localization tasks.
  • The attention expansion loss in the unsupervised setting effectively guides the model to attend to normal regions, improving localization accuracy.
  • The complementary guided attention loss in the weakly-supervised setting successfully suppresses attention on anomalous regions, enhancing detection performance.
  • The use of convolutional latent variables enables better spatial reconstruction and more precise anomaly localization compared to standard VAEs.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.