Skip to main content
Back

CoPS Beats Static CLIP Prompts to Spot Defects Without Training Data

A new CLIP-based framework generates prompts on the fly from image features, beating zero-shot anomaly detection baselines by 1.4-1.9% AUROC across 13 datasets.

Pro

  • CoPS synthesizes CLIP prompts conditioned on image features instead of using static learnable tokens for zero-shot anomaly detection.
  • Three modules: prototype-based state tokens (ESTS), VAE-sampled class tokens (ICTS), and spatially-aware alignment (SAGA).
  • Beats prior SOTA by 1.4% classification AUROC and 1.9% segmentation AUROC across 13 industrial and medical datasets.
  • Trained on one auxiliary dataset (VisA), transfers zero-shot to MVTec-AD, BTAD, brain MRI, colonoscopy polyps, and more.
  • Code, weights, and a Hugging Face demo are available under MIT license.
  • Limitation: struggles with logical anomalies requiring high-level semantic reasoning about object relations.

Spotting defects on a factory line or lesions in a medical scan usually requires collecting hundreds of labeled examples per product or pathology. Zero-shot anomaly detection (ZSAD) tries to skip that step by training once on an auxiliary dataset and then generalizing to categories the model has never seen. A new paper called CoPS: Conditional Prompt Synthesis, accepted to CVPR 2026 Findings, pushes the state of the art by rebuilding how CLIP-based ZSAD models construct their text prompts.

Why static prompts break down

Existing methods adapt CLIP to anomaly detection by pairing images with two competing text prompts, one describing a normal object and one describing an anomalous one. Early work like WinCLIP relied on hand-crafted templates; more recent methods like AnomalyCLIP replace those templates with learnable tokens. Each prompt decomposes into three components: context words, which describe the high-level imaging scene, state words, which specify the normal or anomalous condition, and class words, which capture the specific object category.

The authors argue this design has two blind spots. Static learnable tokens fail to capture the continuous and diverse patterns of normal and anomalous states, limiting generalization to unseen categories, and fixed textual labels offer overly sparse semantic information, making the model prone to overfitting within a narrow representation space. In plain terms, a single fixed embedding for the word "damaged" cannot cover the full continuum of scratches, dents, tumors, and polyps a real system will encounter.