Research map / Label-efficient and robust learning / OOD and anomaly detection
Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Prompts
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Trains a single CLIP-based in-context residual model (InCTRL) on MVTec AD/VisA auxiliary data that detects anomalies in unseen domains by comparing queries against few-shot normal sample prompts, with no target-data training.
Problem
Generalist anomaly detection: one model that detects anomalies across industrial defect, medical, and semantic anomaly datasets without any training on target data, using only a few normal images at inference.
Approach
Learn in-context residuals (patch-level nearest-neighbor residuals and image-level prototype residuals) between a query and few-shot normal prompts on an auxiliary dataset, with adapter layers on a frozen CLIP and text-prompt features fused into a holistic anomaly score, so the learned residual scoring transfers across domains.</https://>
Key results
- InCTRL achieves 0.839 AUROC on ELPV under 2-shot, versus 0.762 for the best competing method (CoOp) on that dataset.
- Under 2-shot, InCTRL reaches 0.892 AUROC on MNIST one-vs-all and 0.935 on CIFAR-10 one-vs-all, versus competing methods at 50-65% on semantic anomalies per the paper's claim.
- Ablation under 2-shot shows the full combination of text (T), patch (P), and image (I) residual components reaching the best average AUROC, outperforming concatenation (0.809) and average (0.793) alternatives on the same metric.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use InCTRL instead of CoOp | generalist anomaly detection · ELPV (2-shot) | AUROC: 0.781±0.002 -> 0.839±0.003 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · SDD (2-shot) | AUROC: 0.943±0.004 -> 0.972±0.011 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · AITEX (2-shot) | AUROC: 0.764±0.025 -> 0.761±0.029 | No clear effect |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · VisA (2-shot) | AUROC: 0.858±0.025 -> 0.858±0.022 | No clear effect |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · MVTec AD (2-shot) | AUROC: 0.940±0.021 -> 0.940±0.015 | No clear effect |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · BrainMRI (2-shot) | AUROC: 0.941±0.002 -> 0.973±0.027 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · HeadCT (2-shot) | AUROC: 0.912±0.003 -> 0.929±0.025 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · MNIST one-vs-all (2-shot) | AUROC: 0.851±0.010 -> 0.892±0.009 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · CIFAR-10 one-vs-all (2-shot) | AUROC: 0.927±0.001 -> 0.935±0.002 | Helped |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · MNIST multi-class (2-shot) | AUROC: 0.632±0.004 -> 0.635±0.010 | No clear effect |
| Use InCTRL instead of WinCLIP | generalist anomaly detection · CIFAR-10 multi-class (2-shot) | AUROC: 0.915±0.003 -> 0.924±0.005 | Helped |
| Add patch-level and image-level residual learning to text prompt features (ablation) | InCTRL · ELPV (2-shot) | AUROC: 0.733 -> 0.839 | Helped |
Surprising findings
- The zero-shot WinCLIP-based baseline and WinCLIP itself are very competitive on several datasets, and CoOp degrades sharply on semantic anomaly datasets (e.g., 0.527 CIFAR-10 one-vs-all at 2-shot).
Limitations
- Failure cases arise when few-shot normal prompts lack diversity and do not cover the query's normal patterns.
- Performance depends on the number of normal prompts; multi-class semantic settings benefit from prompts covering more normal classes.
Experimental setup
Datasets: MVTec AD VisA ELPV SDD AITEX BrainMRI HeadCT MNIST CIFAR-10
Benchmarks: ELPV SDD AITEX VisA MVTec AD BrainMRI HeadCT MNIST CIFAR-10
Metrics: AUROC AUPRC
Baselines: SPADE PaDiM PatchCore RegAD CoOp WinCLIP
Builds on: CLIP WinCLIP CoOp SPADE PatchCore
Closest papers by meaning
- Normal-Abnormal Guided Generalist Anomaly Detection (NeurIPS 2025 · similarity 0.91)
- Adapting Visual-Language Models for Generalizable Anomaly Detection in Medical Images (CVPR 2024 · similarity 0.89)
- AnomalyGPT: Detecting Industrial Anomalies Using Large Vision-Language Models (AAAI 2024 · similarity 0.89)
- UniVAD: A Training-free Unified Model for Few-shot Visual Anomaly Detection (CVPR 2025 · similarity 0.88)
- Towards Zero-Shot Anomaly Detection and Reasoning with Multimodal Large Language Models (CVPR 2025 · similarity 0.88)
- AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection (ICLR 2024 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
