arXiv:2508.03447cs.CV2025-08中稿 · CVPR被引 3

动态生成提示词,让模型更准识别未知异常。

CoPS: Conditional Prompt Synthesis for Zero-Shot Anomaly Detection

  • 根据图像特征动态生成提示,自适应建模正常与异常状态。
  • 在13个工业和医疗数据集上,分类与分割准确率分别提升1.4%和1.9%。
  • 适合做零样本异常检测,尤其对无标注新类别场景有效。

近期,大型预训练视觉-语言模型在零样本异常检测(ZSAD)中表现优异。仅需在单一辅助数据集上微调,即可实现跨类别的异常检测,覆盖工业缺陷与医学病灶。相比人工设计提示,提示学习无需专家知识且避免反复试错。但仍有两大挑战:(i) 静态可学习标记难以捕捉正常与异常状态的连续多样模式,限制对未见类别的泛化能力;(ii) 固定文本标签提供的类别信息过于稀疏,易使模型过拟合特定语义子空间。为此,我们提出条件提示合成(CoPS),通过视觉特征条件生成动态提示以提升性能。具体地,从细粒度补丁特征中提取正常与异常原型,并显式注入提示,实现状态自适应建模;针对标签稀疏问题,利用变分自编码器建模语义图像特征,隐式融合多样化类别标记。结合空间感知对齐机制,实验表明,在13个工业与医疗数据集上,CoPS在分类与分割AUROC上分别优于当前最优方法1.4%和1.9%。代码已开源。

原文摘要 · Abstract (English)

Recently, large pre-trained vision-language models have shown remarkable performance in zero-shot anomaly detection (ZSAD). With fine-tuning on a single auxiliary dataset, the model enables cross-category anomaly detection on diverse datasets covering industrial defects and medical lesions. Compared to manually designed prompts, prompt learning eliminates the need for expert knowledge and trial-and-error. However, it still faces the following challenges: (i) static learnable tokens struggle to capture the continuous and diverse patterns of normal and anomalous states, limiting generalization to unseen categories; (ii) fixed textual labels provide overly sparse category information, making the model prone to overfitting to a specific semantic subspace. To address these issues, we propose Conditional Prompt Synthesis (CoPS), a novel framework that synthesizes dynamic prompts conditioned on visual features to enhance ZSAD performance. Specifically, we extract representative normal and anomaly prototypes from fine-grained patch features and explicitly inject them into prompts, enabling adaptive state modeling. Given the sparsity of class labels, we leverage a variational autoencoder to model semantic image features and implicitly fuse varied class tokens into prompts. Additionally, integrated with our spatially-aware alignment mechanism, extensive experiments demonstrate that CoPS surpasses state-of-the-art methods by 1.4% in classification AUROC and 1.9% in segmentation AUROC across 13 industrial and medical datasets. The code is available at https://github.com/cqylunlun/CoPS.

异常检测提示学习零样本视觉语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。