用统计偏差指导提示学习,提升少样本异常检测精度
DevPrompt: Deviation-Based Prompt Learning for One-Normal ShotImage Anomaly Detection
- 用可学习上下文向量替代固定提示,增强正常与异常的区分能力
- 基于高斯偏差建模,对显著偏离正态分布的图像块赋予更高异常分
- 适合需要精准定位异常区域的工业质检场景
少正常样本异常检测(FNSAD)旨在仅用少量正常样本识别图像中的异常区域,因监督信息有限且缺陷多样性高而极具挑战。现有方法利用如CLIP等视觉语言模型结合提示学习对齐图像与文本特征,但普遍存在正常与异常提示判别力弱、缺乏可靠的像素级异常评分机制问题。本文提出一种基于偏差引导的提示学习框架,融合视觉语言模型的语义能力与基于偏差的统计可靠性。具体地,将固定提示前缀替换为跨正常与异常提示共享的可学习上下文向量,同时通过异常特异的后缀标记实现类别感知对齐。为增强可分性,引入基于Top-K多实例学习的偏差损失,将图像块特征建模为相对于正常分布的高斯偏差,使网络对统计上显著偏离的区域分配更高异常分数,从而提升定位精度与可解释性。在MVTecAD和VISA基准上的实验表明,该方法在像素级检测性能上优于PromptAD及其他基线。消融实验证明了可学习提示、基于偏差的评分机制及Top-K MIL策略的有效性。
原文摘要 · Abstract (English)
Few-normal shot anomaly detection (FNSAD) aims to detect abnormal regions in images using only a few normal training samples, making the task highly challenging due to limited supervision and the diversity of potential defects. Recent approaches leverage vision-language models such as CLIP with prompt-based learning to align image and text features. However, existing methods often exhibit weak discriminability between normal and abnormal prompts and lack principled scoring mechanisms for patch-level anomalies. We propose a deviation-guided prompt learning framework that integrates the semantic power of vision-language models with the statistical reliability of deviation-based scoring. Specifically, we replace fixed prompt prefixes with learnable context vectors shared across normal and abnormal prompts, while anomaly-specific suffix tokens enable class-aware alignment. To enhance separability, we introduce a deviation loss with Top-K Multiple Instance Learning (MIL), modeling patch-level features as Gaussian deviations from the normal distribution. This allows the network to assign higher anomaly scores to patches with statistically significant deviations, improving localization and interpretability. Experiments on the MVTecAD and VISA benchmarks demonstrate superior pixel-level detection performance compared to PromptAD and other baselines. Ablation studies further validate the effectiveness of learnable prompts, deviation-based scoring, and the Top-K MIL strategy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。