Skip to main content
QUICK REVIEW

[Paper Review] Visual Anomaly Detection via Dual-Attention Transformer and Discriminative Flow

Haiming Yao, Wei Luo|arXiv (Cornell University)|Mar 31, 2023
Anomaly Detection Techniques and ApplicationsComputer Science4 citations
TL;DR

This paper proposes DADF, a novel visual anomaly detection framework that combines dual-attention Transformer-based two-level reconstruction (self-attention and memorial-attention) with discriminative normalizing flow to model joint likelihood of prior and reconstructed features. It achieves state-of-the-art performance with 98.3/98.4 image/pixel AUROC on Mvtec AD and 83.7 image AUROC on Mvtec LOCO AD, demonstrating superior anomaly detection and localization via synergistic correspondence and discrimination mechanisms.

ABSTRACT

In this paper, we introduce the novel state-of-the-art Dual-attention Transformer and Discriminative Flow (DADF) framework for visual anomaly detection. Based on only normal knowledge, visual anomaly detection has wide applications in industrial scenarios and has attracted significant attention. However, most existing methods fail to meet the requirements. In contrast, the proposed DTDF presents a new paradigm: it firstly leverages a pre-trained network to acquire multi-scale prior embeddings, followed by the development of a vision Transformer with dual attention mechanisms, namely self-attention and memorial-attention, to achieve two-level reconstruction for prior embeddings with the sequential and normality association. Additionally, we propose using normalizing flow to establish discriminative likelihood for the joint distribution of prior and reconstructions at each scale. The DADF achieves 98.3/98.4 of image/pixel AUROC on Mvtec AD; 83.7 of image AUROC and 67.4 of pixel sPRO on Mvtec LOCO AD benchmarks, demonstrating the effectiveness of our proposed approach.

Motivation & Objective

  • To address the limitations of existing unsupervised visual anomaly detection methods that rely solely on reconstruction or embedding-based discrepancy, which suffer from misjudgment due to over-generalization or insufficient discriminability.
  • To improve detection reliability by integrating a correspondence mechanism (reconstruction) with a discrimination mechanism (likelihood modeling) in a synergistic framework.
  • To enhance feature representation by leveraging multi-scale prior embeddings from a pre-trained network and applying dual-attention mechanisms for robust two-level reconstruction.
  • To model normality more effectively by replacing reconstruction error with discriminative likelihood via normalizing flow on joint feature distributions.
  • To achieve state-of-the-art performance on standard benchmarks through multi-scale feature fusion and joint likelihood estimation.

Proposed method

  • The framework first extracts multi-scale prior embeddings using a pre-trained backbone network (e.g., ResNet18) to preserve hierarchical contextual information.
  • A dual-branch vision Transformer is introduced with self-attention and memorial-attention mechanisms to perform two-level reconstruction: one using the prior features and another using a memory bank of normal prototypes.
  • The reconstruction process establishes a sequential and normality-associated correspondence mechanism, reducing false positives from over-reconstruction.
  • A discriminative normalizing flow is applied to the joint distribution of prior features and the two reconstructed features (self and memory), modeling the likelihood of normality instead of relying on reconstruction error.
  • The likelihood from the normalizing flow serves as a more reliable anomaly score, enhancing discrimination between normal and anomalous samples.
  • Multi-scale features are processed independently, and their results are fused to improve localization precision and detection accuracy.

Experimental results

Research questions

  • RQ1Can a dual-attention Transformer with self- and memorial-attention mechanisms improve reconstruction stability and correspondence fidelity in visual anomaly detection?
  • RQ2Does modeling the joint likelihood of prior and reconstructed features via normalizing flow lead to more reliable anomaly detection than reconstruction error-based methods?
  • RQ3How does the fusion of multi-scale features affect the performance of anomaly localization and detection?
  • RQ4Can the synergistic use of correspondence (reconstruction) and discrimination (likelihood modeling) mechanisms reduce false positives and false negatives?
  • RQ5What is the relative contribution of self-reconstruction and memory-based reconstruction to overall performance, and how does their fusion improve detection?

Key findings

  • The DADF framework achieves 98.3 image AUROC and 98.4 pixel AUROC on the Mvtec AD benchmark, setting a new state-of-the-art performance.
  • On the Mvtec LOCO AD benchmark, DADF achieves 83.7 image AUROC and 67.4 pixel sPRO, significantly outperforming prior methods.
  • The use of discriminative normalizing flow yields a +3.2/+1.2/+2.1 performance gain on Mvtec AD compared to reconstruction error-based methods, with even greater gains on Mvtec LOCO AD (+7.9 and +21.2).
  • The joint discriminative flow model (ϕ_D) that incorporates both self- and memory-reconstructed features achieves a +1.7/+3.5 gain in image/pixel AUROC over the vanilla prior-only flow (ϕ_P) on Mvtec AD.
  • Multi-scale feature fusion improves detection performance, with scale 3 producing the best single-scale result and full multi-scale fusion yielding the overall best performance.
  • The dual reconstruction strategy (self and memory) reduces both false positives and false negatives, as self-reconstruction preserves texture details while memory-reconstruction improves stability.

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.