Research map / Vision-language and multimodal / CLIP and zero-shot
Bayesian Prompt Flow Learning for Zero-Shot Anomaly Detection
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Bayes-PFL models CLIP text prompts as learnable probability distributions via a normalizing-flow prompt module (image-specific context distribution, image-agnostic state distribution) with Monte Carlo prompt sampling and a residual cross-modal attention module, achieving state-of-the-art zero-shot anomaly detection on 15 industrial and medical datasets.
Problem
Zero-shot anomaly detection with CLIP-based methods suffers from handcrafted prompts needing expert effort, single-form learnable prompts that cannot capture complex anomaly semantics, and an unconstrained prompt space that hurts generalization to unseen categories.
Approach
Treat the prompt space as a learnable probability distribution from a Bayesian perspective: a normalizing-flow prompt module learns image-specific context distributions and image-agnostic state distributions, sampled to generate diverse prompts, with an RCA module that refines dynamic text embeddings using patch-level image features.
Key results
- Bayes-PFL reaches image-level AUROC 92.3 on MVTec-AD and 87.0 on VisA, outperforming AdaCLIP (92.0 and 83.0) and AnomalyCLIP (91.5 and 82.1).
- On medical dataset ISIC, Bayes-PFL improves pixel-level AUROC, PRO and AP over the second-best method by 3.8%, 9.5% and 10.2%.
- Increasing Monte Carlo sampling iterations at inference from 1 to 10 raises MVTec-AD image AUROC from 89.5 to 92.7 at the cost of inference time (132 ms to 388 ms per image).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add image-specific distribution (ISD) in prompt flow (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.3 vs 89.1 without ISD | Helped |
| add image-agnostic distribution (IAD) for state words (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.3 vs 90.3 without IAD | Helped |
| add RCA module (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.3 vs 91.8 without RCA | Helped |
| add RCA module (ablation) | Bayes-PFL · MVTec-AD | pixel-level AP: 48.3 vs 46.1 without RCA | Helped |
| add orthogonal loss Lort (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.3 vs 91.2 without Lort | Helped |
| increase Monte Carlo sampling iterations at inference from 1 to 10 (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.7 at R=10 vs 89.5 at R=1; inference time 388.5 ms vs 132.2 ms | Helped |
| image ensemble instead of text ensemble (ablation) | Bayes-PFL · MVTec-AD | image-level AUROC: 92.3 vs 92.0 | Helped |
| learned prompt distribution with prompt flow vs AnomalyCLIP-style prompt optimization (AnomalyCLIP+) | AnomalyCLIP prompt design · MVTec-AD training curve | pixel-level AP: AnomalyCLIP+ shows declining AP after peak; Bayes-PFL stays consistently improving | Helped |
| Bayes-PFL vs SOTA methods trained on VisA and tested on other datasets | Bayes-PFL · 15 industrial and medical datasets | image and pixel-level AUROC/AP/PRO: best on nearly all datasets, e.g. ISIC pixel AUROC 92.2 vs 88.4 (AnomalyCLIP) | Helped |
Surprising findings
- Image-level ablation shows removing the RCA module only slightly lowers MVTec-AD image AUROC (91.8 vs 92.3), while pixel-level AP drops more noticeably (46.1 vs 48.3).
- APRIL-GAN+ and AnomalyCLIP+ show performance declines after peak pixel-level AP during training, whereas Bayes-PFL improves steadily.
Limitations
- Inference cost grows with the number of Monte Carlo samples, making it slower than single-prompt methods.
- Medical results are obtained directly from weights fine-tuned on the industrial dataset VisA, so domain overlap is assumed rather than established.
- VisA evaluation requires fine-tuning on MVTec-AD, deviating from the standard auxiliary-training protocol.
Experimental setup
Datasets: VisA MVTec-AD
Benchmarks: MVTec-AD VisA BTAD KSDD2 RSDD DAGM DTD-Synthetic HeadCT BrainMRI Br35H ISIC CVC-ColonDB
Metrics: AUROC F1-Max AP PRO
Baselines: WinCLIP APRIL-GAN CLIP-AD AnomalyCLIP AdaCLIP
Builds on: CLIP AnomalyCLIP WinCLIP APRIL-GAN CLIP-AD
Closest papers by meaning
- PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly Detection (CVPR 2024 · similarity 0.89)
- Aligning and Prompting Anything for Zero-Shot Generalized Anomaly Detection (AAAI 2025 · similarity 0.89)
- AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection (ICLR 2024 · similarity 0.87)
- Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Prompts (CVPR 2024 · similarity 0.87)
- Towards Zero-Shot Anomaly Detection and Reasoning with Multimodal Large Language Models (CVPR 2025 · similarity 0.86)
- Understanding prompt engineering may not require rethinking generalization (ICLR 2024 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
