Papers › Bayesian Prompt Flow Learning for Zero-Shot Anomaly Detection

Bayesian Prompt Flow Learning for Zero-Shot Anomaly Detection

13 Mar 2025CVPR 2025 1arXiv:2503.10080archive 2025-07-28

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

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 limit 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 enhance 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-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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2503.10080")

Code

Syntology Ran 8 of 12 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 7 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

xiaozhen228/Bayes-PFL officialmentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 8 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
7ran
4unverified

Licence: 12 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from xiaozhen228/Bayes-PFL. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Decoder xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · c07c0cecf493a1dd · report
Encoder xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · 1cd5917f59cfed09 · report
Global_Feature xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · metamorphic tier: well formed no licence file found · pointer only · 7492d2701b36df98 · report
InferenceBlock xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 3b23b0d856fbe61f · report
PFL xiaozhen228/Bayes-PFL/models/VPB.py official repository ran no licence file found · pointer only · 40744df2580572ab · report
Planar xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · 5ca5a6e68c3b6c2e · report
binary_loss_function xiaozhen228/Bayes-PFL/models/VPB.py official repository ran no licence file found · pointer only · 875b72dfcf9c804f · report
log_normal_dist xiaozhen228/Bayes-PFL/models/VPB.py official repository ran · our draft was wrong no licence file found · pointer only · 7dadf0e81a27a70a · report
Context_Prompting xiaozhen228/Bayes-PFL/models/VPB.py official repository unverified no licence file found · pointer only · 6464dd5e0e28bb63 · report
PlanarPFL xiaozhen228/Bayes-PFL/models/VPB.py official repository unverified no licence file found · pointer only · 45e172ba85da53bc · report
PlanarPFL_state xiaozhen228/Bayes-PFL/models/VPB.py official repository unverified no licence file found · pointer only · 834b89db3bf92f14 · report
Zero_Parameter xiaozhen228/Bayes-PFL/models/VPB.py official repository unverified no licence file found · pointer only · 45e674352dcd6885 · report

Tasks

Anomaly Detectionzero-shot anomaly detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGN

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections