Skip to main content
QUICK REVIEW

[Paper Review] CLIP-AD: A Language-Guided Staged Dual-Path Model for Zero-shot Anomaly Detection

Xuhai Chen, Jiangning Zhang|arXiv (Cornell University)|Nov 1, 2023
Anomaly Detection Techniques and ApplicationsComputer Science7 citations
TL;DR

CLIP-AD introduces a language-guided zero-shot anomaly detection framework with a Staged Dual-Path (SDP) model and an SDP+ fine-tuned extension, achieving state-of-the-art performance on MVTec-AD and VisA without elaborate prompts or multi-scale encodings.

ABSTRACT

This paper considers zero-shot Anomaly Detection (AD), performing AD without reference images of the test objects. We propose a framework called CLIP-AD to leverage the zero-shot capabilities of the large vision-language model CLIP. Firstly, we reinterpret the text prompts design from a distributional perspective and propose a Representative Vector Selection (RVS) paradigm to obtain improved text features. Secondly, we note opposite predictions and irrelevant highlights in the direct computation of the anomaly maps. To address these issues, we introduce a Staged Dual-Path model (SDP) that leverages features from various levels and applies architecture and feature surgery. Lastly, delving deeply into the two phenomena, we point out that the image and text features are not aligned in the joint embedding space. Thus, we introduce a fine-tuning strategy by adding linear layers and construct an extended model SDP+, further enhancing the performance. Abundant experiments demonstrate the effectiveness of our approach, e.g., on MVTec-AD, SDP outperforms the SOTA WinCLIP by +4.2/+10.7 in segmentation metrics F1-max/PRO, while SDP+ achieves +8.3/+20.5 improvements.

Motivation & Objective

  • Harness the zero-shot classification power of CLIP for anomaly detection without test-object images.
  • Address failure modes of naive text-image feature similarity in CLIP for anomaly segmentation (opposite predictions and noisy highlights).
  • Leverage multi-level features and feature surgery to produce accurate anomaly maps without fine-tuning.
  • Improve alignment between image features and text embeddings in CLIP through targeted fine-tuning (SDP+).
  • Demonstrate strong performance gains over state-of-the-art Zero-/Few-shot AD methods on standard benchmarks.

Proposed method

  • Propose a language-guided CLIP-AD framework that trims multi-scale encoding and post-processing needs.
  • Introduce Staged Dual-Path (SDP) to fuse multi-level ViT features with architecture and feature surgery for clean anomaly maps.
  • Apply architecture surgery by modifying attention/FFN pathways to mitigate reversed predictions.
  • Implement feature surgery to remove redundant features via a text-guided subtraction mechanism.
  • Extend with SDP+ by adding lightweight linear mappings to project image features into CLIP's joint embedding space for better cross-modal alignment.
  • Fine-tune only a few linear layers (not CLIP weights) using focal and dice losses to enhance segmentation while preserving zero-shot nature.

Experimental results

Research questions

  • RQ1Can CLIP-based zero-shot methods achieve competitive anomaly classification and segmentation without test-object references?
  • RQ2Why do naive text-image similarity maps misbehave in CLIP for anomaly segmentation, and can architecture/feature-level interventions fix this?
  • RQ3Does a staged, multi-level feature fusion (SDP) improve anomaly detection across simple textures and complex object defects?
  • RQ4Does a lightweight fine-tuning extension (SDP+) substantially boost performance by aligning image features with text embeddings?

Key findings

  • SDP outperforms prior zero-shot methods on MVTec-AD and VisA in segmentation metrics, with notable gains over WinCLIP.
  • SDP+ further improves segmentation and classification metrics, yielding substantial gains over SOTA in several benchmarks.
  • Direct text-image similarity maps tend to produce opposite predictions and noisy highlights, motivating the SDP approach.
  • Using multi-stage feature fusion and architecture surgery yields more accurate, stable anomaly maps without elaborate prompts or post-processing.
  • Fine-tuning a small number of linear layers to align image features with CLIP’s embedding space (SDP+) yields large improvements, especially in segmentation PRO and pixel-level metrics.
  • Across ablations, larger CLIP backbones and different pre-trained weights influence performance, with openAI and LAION-based models showing varying benefits; however, SDP/SDP+ consistently improve upon baselines.

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.