One-for-All Few-Shot Anomaly Detection via Instance-Induced Prompt Learning
Wenxi Lv, Qinliang Su, Wenchao Xu
Abstract
Anomaly detection methods under the 'one-for-all' paradigm aim to develop a unified model capable of detecting anomalies across multiple classes. However, these approaches typically require a large number of normal samples for model training, which may not always be fulfilled in practice. Few-shot anomaly detection methods can address scenarios with limited data but require a tailored model for each class, following the 'one-for-one' paradigm. In this paper, we first proposed a one-for-all few-shot anomaly detection method with the assistance of vision-language models. Unlike previous CLIP-based methods that learn fixed prompts for each class, our method learns a class-shared prompt generator to adaptively generate suitable prompts for each instance. The prompt generator is trained by aligning the prompts with the visual space and utilizing guidance from general textual descriptions of normality and abnormality. In addition, we further propose a method to address the problem of how to retrieve valid similar features from the visual memory bank under the one-for-all paradigm. Extensive experimental results on MVTec and VisA demonstrate the superiority of our method in few-shot anomaly detection task under the one-forall paradigm. Our code is available in https://github.com/Vanssssry/ One-For-All-Few-Shot-Anomaly-Detection .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 7e47e0b5-d4c8-474f-a6e6-1c04d6284af8Cited by top-tier papers8
- AF-CLIP: Zero-Shot Anomaly Detection via Anomaly-Focused CLIP AdaptationQingqing Fang, Wenxi Lv, Qinliang SuACM MM 2025 · 17 citations
- Normal-Abnormal Guided Generalist Anomaly DetectionYuexin Wang, Xiaolei Wang, Yizheng Gong, Jimin XiaoNeurIPS 2025 · 16 citations
- SubspaceAD: Training-Free Few-Shot Anomaly Detection via Subspace ModelingCamile Lendering, Erkut Akdag, Egor BondarauCVPR 2026 · 12 citations
- Foundation Visual Encoders Are Secretly Few-Shot Anomaly DetectorsGuangyao Zhai, Yue Zhou, Xinyan Deng, Lars Heckler-Kram et al.ICLR 2026 · 9 citations
- RAID: Retrieval-Augmented Anomaly DetectionMingxiu Cai, Zhe Zhang, Gaochang Wu, Tianyou Chai et al.CVPR 2026 · 2 citations
Builds on21
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language ModelsJunnan Li, Dongxu Li, Silvio Savarese, Steven C. H. HoiICML 2023 · 7,873 citations
- Conditional Prompt Learning for Vision-Language ModelsKaiyang Zhou, Jingkang Yang, Chen Change Loy, Ziwei LiuCVPR 2022 · 1,438 citations
- Towards Total Recall in Industrial Anomaly DetectionKarsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf et al.CVPR 2022 · 1,301 citations
- Anomaly Detection via Reverse Distillation from One-Class EmbeddingHanqiu Deng, Xingyu LiCVPR 2022 · 701 citations
Related papers
- PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly DetectionXiaofan Li, Zhizhong Zhang, Xin Tan, Chengwei Chen et al.CVPR 2024
- Bidirectional Multimodal Prompt Learning with Scale-Aware Training for Few-Shot Multi-Class Anomaly DetectionYujin Lee, Sewon Kim, Daeun Moon, Seoyoon Jang et al.CVPR 2026
- SimCLIP: Refining Image-Text Alignment with Simple Prompts for Zero-/Few-shot Anomaly DetectionChenghao Deng, Haote Xu, Xiaolu Chen, Haodi Xu et al.ACM MM 2024 · 10 citations
- AdaptCLIP: Adapting CLIP for Universal Visual Anomaly DetectionBin-Bin Gao, Yue Zhou, Jiangtao Yan, Yuezhi Cai et al.AAAI 2026 · 21 citations
- Do LLMs Understand Visual Anomalies? Uncovering LLM's Capabilities in Zero-shot Anomaly DetectionJiaqi Zhu, Shaofeng Cai, Fang Deng, Beng Chin Ooi et al.ACM MM 2024 · 30 citations
