用强制提示学习提升视觉语言模型的分布外检测能力
FA: Forced Prompt Learning of Vision-Language Models for Out-of-Distribution Detection
- 通过可学习的强制提示增强类别内部图像与提示的语义相似性
- 无需外部数据集,在相同参数量下超越当前最佳方法
- 适合希望提升模型泛化能力的研究者和工程师
预训练视觉语言模型(VLM)在分布外(OOD)检测方面取得了进展。然而,现有基于CLIP的方法通常聚焦于学习与分布外相关的知识,泛化能力有限或依赖大规模外部辅助数据集。本研究提出一种基于强制提示学习(FA)的新框架,不深入挖掘分布外知识,而是充分利用类别内(ID)知识以提升分布外检测效果。核心思想是学习一个包含更丰富、多样化描述的提示(即强制提示),超越类别标签的文本语义。通过强制提升类别内图像与可学习提示之间的显著语义相似性,增强对类别内图像的判别能力。此外,引入强制系数,促使提示学习更全面、细致的类别描述。实验表明,即使不使用任何外部辅助数据集,该方法仍能在保持与CoOp相同可训练参数量的情况下,显著提升分布外检测性能。大量实证评估证实其持续优于当前最先进的方法。代码已公开于 https://github.com/0xFAFA/FA。
原文摘要 · Abstract (English)
Pre-trained vision-language models (VLMs) have advanced out-of-distribution (OOD) detection recently. However, existing CLIP-based methods often focus on learning OOD-related knowledge to improve OOD detection, showing limited generalization or reliance on external large-scale auxiliary datasets. In this study, instead of delving into the intricate OOD-related knowledge, we propose an innovative CLIP-based framework based on Forced prompt leArning (FA), designed to make full use of the In-Distribution (ID) knowledge and ultimately boost the effectiveness of OOD detection. Our key insight is to learn a prompt (i.e., forced prompt) that contains more diversified and richer descriptions of the ID classes beyond the textual semantics of class labels. Specifically, it promotes better discernment for ID images, by forcing more notable semantic similarity between ID images and the learnable forced prompt. Moreover, we introduce a forced coefficient, encouraging the forced prompt to learn more comprehensive and nuanced descriptions of the ID classes. In this way, FA is capable of achieving notable improvements in OOD detection, even when trained without any external auxiliary datasets, while maintaining an identical number of trainable parameters as CoOp. Extensive empirical evaluations confirm our method consistently outperforms current state-of-the-art methods. Code is available at https://github.com/0xFAFA/FA.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。