CVApr 8, 2024

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

arXiv:2404.05231v2154 citationsh-index: 22CVPR
AI Analysis

This work addresses the challenge of automating prompt engineering for industrial anomaly detection, offering a solution that reduces manual effort while improving performance in few-shot scenarios.

The paper tackled the problem of automating prompt design for few-shot anomaly detection by proposing a one-class prompt learning method that constructs anomaly prompts from normal ones and introduces an explicit anomaly margin, achieving first place in 11 out of 12 few-shot settings on MVTec and VisA benchmarks.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes