Skip to main content
QUICK REVIEW

[Paper Review] WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation

Jongheon Jeong, Yang Zou|arXiv (Cornell University)|Mar 26, 2023
Anomaly Detection Techniques and ApplicationsComputer Science12 citations
TL;DR

WinCLIP introduces Window-based CLIP (WinCLIP) for zero-/few-shot anomaly classification and segmentation, and WinCLIP+ leverages few normal references; both outperform state-of-the-art on MVTec-AD and VisA without task-specific tuning.

ABSTRACT

Visual anomaly classification and segmentation are vital for automating industrial quality inspection. The focus of prior research in the field has been on training custom models for each quality inspection task, which requires task-specific images and annotation. In this paper we move away from this regime, addressing zero-shot and few-normal-shot anomaly classification and segmentation. Recently CLIP, a vision-language model, has shown revolutionary generality with competitive zero-/few-shot performance in comparison to full-supervision. But CLIP falls short on anomaly classification and segmentation tasks. Hence, we propose window-based CLIP (WinCLIP) with (1) a compositional ensemble on state words and prompt templates and (2) efficient extraction and aggregation of window/patch/image-level features aligned with text. We also propose its few-normal-shot extension WinCLIP+, which uses complementary information from normal images. In MVTec-AD (and VisA), without further tuning, WinCLIP achieves 91.8%/85.1% (78.1%/79.6%) AUROC in zero-shot anomaly classification and segmentation while WinCLIP+ does 93.1%/95.2% (83.8%/96.4%) in 1-normal-shot, surpassing state-of-the-art by large margins.

Motivation & Objective

  • Address the scarcity and long-tail of visual defects by enabling zero-/few-shot anomaly classification and segmentation.
  • Leverage vision-language models (CLIP) with language-driven prompts to define normal/abnormal states.
  • Develop a window-based feature extraction and multi-scale aggregation to enable pixel-level anomaly segmentation without task-specific tuning.
  • Incorporate few normal reference images to further boost performance through a simple reference association mechanism.

Proposed method

  • Introduce Compositional Prompt Ensemble (CPE) to generate robust two-class prompts (normal vs. anomalous) using state words and templates.
  • Develop WinCLIP: a Window-based CLIP that extracts and aggregates multi-scale window/patch features aligned with text for zero-shot anomaly segmentation.
  • Apply harmonic aggregation and multi-scale fusion to produce dense anomaly maps from window-level scores.
  • Propose WinCLIP+ which uses reference normal images to form multi-scale feature memories and aggregates language-guided and visual cues for few-normal-shot anomaly recognition.
  • Define a simple reference association mechanism to fuse language-guided predictions with memory-based visual predictions across scales.

Experimental results

Research questions

  • RQ1Can CLIP-based language prompts be effectively engineered to perform zero-/few-shot anomaly classification and segmentation?
  • RQ2Does a window-based, multi-scale feature extraction approach improve alignment with language and enable pixel-level anomaly segmentation without fine-tuning?
  • RQ3Can few normal reference images further boost zero-/few-shot anomaly performance via a simple memory-based association mechanism?

Key findings

  • WinCLIP achieves strong zero-shot anomaly classification and segmentation without task-specific tuning on MVTec-AD and VisA (AC: 0-shot; AS: 0-shot).
  • Compositional Prompt Ensemble (CPE) with state words and templates significantly improves zero-shot anomaly classification over naïve CLIP prompts.
  • WinCLIP introduces a window-based feature extraction (F^W) that yields dense, language-aligned features suitable for pixel-level anomaly segmentation, outperforming patch-token and image tiling baselines.
  • Harmonic aggregation over overlapping windows and multi-scale fusion improve segmentation robustness for defects of varying sizes.
  • WinCLIP+ leverages few normal reference images via a reference association memory to further boost anomaly classification and segmentation in 1- to 4-shot settings, outperforming prior few-shot methods.
  • Across tables, WinCLIP/WinCLIP+ surpass state-of-the-art methods by large margins on AC and AS metrics on MVTec-AD and VisA, with zero- and few-shot setups achieving competitive full-shot baselines in some cases.

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.