Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Bayesian Prompt Flow Learning for Zero-Shot Anomaly Detection

About

Recently, vision-language models (e.g. CLIP) have demonstrated remarkable performance in zero-shot anomaly detection (ZSAD). By leveraging auxiliary data during training, these models can directly perform cross-category anomaly detection on target datasets, such as detecting defects on industrial product surfaces or identifying tumors in organ tissues. Existing approaches typically construct text prompts through either manual design or the optimization of learnable prompt vectors. However, these methods face several challenges: 1) handcrafted prompts require extensive expert knowledge and trial-and-error; 2) single-form learnable prompts struggle to capture complex anomaly semantics; and 3) an unconstrained prompt space limits generalization to unseen categories. To address these issues, we propose Bayesian Prompt Flow Learning (Bayes-PFL), which models the prompt space as a learnable probability distribution from a Bayesian perspective. Specifically, a prompt flow module is designed to learn both image-specific and image-agnostic distributions, which are jointly utilized to regularize the text prompt space and improve the model's generalization on unseen categories. These learned distributions are then sampled to generate diverse text prompts, effectively covering the prompt space. Additionally, a residual cross-model attention (RCA) module is introduced to better align dynamic text embeddings with fine-grained image features. Extensive experiments on 15 industrial and medical datasets demonstrate our method's superior performance. The code is available at https://github.com/xiaozhen228/Bayes-PFL.

Zhen Qu, Xian Tao, Xinyi Gong, Shichen Qu, Qiyu Chen, Zhengtao Zhang, Xingang Wang, Guiguang Ding• 2025

Related benchmarks

TaskDatasetResultRank
Anomaly LocalizationMVTec AD
Pixel AUROC91.8
513
Anomaly DetectionVisA
AUROC87
261
Pixel-level Anomaly DetectionMVTec
Pixel AUROC91.8
127
Anomaly SegmentationMVTec AD
AUROC (Pixelwise)0.918
105
Image-level Anomaly DetectionMVTec AD
AUROC92.3
82
Image-level Anomaly DetectionVisA
AUC87.1
80
Anomaly DetectionDTD
AUROC95.1
55
Image-level Anomaly DetectionBTAD
AUROC93.2
54
Anomaly DetectionBr35H
AUROC97
45
Anomaly DetectionMVTec AD
I-AUROC92.3
43
Showing 10 of 75 rows
...

Other info

Code

Follow for update