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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Xiaofan, Zhang, Zhizhong, Tan, Xin, Chen, Chengwei, Qu, Yanyun, Xie, Yuan, Ma, Lizhuang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910528209682432
author Li, Xiaofan
Zhang, Zhizhong
Tan, Xin
Chen, Chengwei
Qu, Yanyun
Xie, Yuan
Ma, Lizhuang
author_facet Li, Xiaofan
Zhang, Zhizhong
Tan, Xin
Chen, Chengwei
Qu, Yanyun
Xie, Yuan
Ma, Lizhuang
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2404_05231
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly Detection
Li, Xiaofan
Zhang, Zhizhong
Tan, Xin
Chen, Chengwei
Qu, Yanyun
Xie, Yuan
Ma, Lizhuang
Computer Vision and Pattern Recognition
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.
title PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly Detection
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2404.05231