arXiv Analytics

Sign in

arXiv:2404.05231 [cs.CV]AbstractReferencesReviewsResources

PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly Detection

Xiaofan Li, Zhizhong Zhang, Xin Tan, Chengwei Chen, Yanyun Qu, Yuan Xie, Lizhuang Ma

Published 2024-04-08, updated 2024-07-16Version 2

The vision-language model has brought great improvement to few-shot industrial anomaly detection, which usually needs to design of hundreds of prompts through prompt engineering. For automated scenarios, we first use conventional prompt learning with many-class paradigm as the baseline to automatically learn prompts but found that it can not work well in one-class anomaly detection. To address the above problem, this paper proposes a one-class prompt learning method for few-shot anomaly detection, termed PromptAD. First, we propose semantic concatenation which can transpose normal prompts into anomaly prompts by concatenating normal prompts with anomaly suffixes, thus constructing a large number of negative samples used to guide prompt learning in one-class setting. Furthermore, to mitigate the training challenge caused by the absence of anomaly images, we introduce the concept of explicit anomaly margin, which is used to explicitly control the margin between normal prompt features and anomaly prompt features through a hyper-parameter. For image-level/pixel-level anomaly detection, PromptAD achieves first place in 11/12 few-shot settings on MVTec and VisA.

Related articles: Most relevant | Search more
arXiv:2006.14811 [cs.CV] (Published 2020-06-26)
Few-Shot Anomaly Detection for Polyp Frames from Colonoscopy
arXiv:2408.13516 [cs.CV] (Published 2024-08-24)
AnoPLe: Few-Shot Anomaly Detection via Bi-directional Prompt Learning with Only Normal Samples
arXiv:2504.11895 [cs.CV] (Published 2025-04-16, updated 2025-05-08)
Search is All You Need for Few-shot Anomaly Detection
Qishan Wang et al.