测试时动态选负样本,提升视觉语言模型的分布外检测效果
Activation Matters: Test-time Activated Negative Labels for OOD Detection with Vision-Language Models
- 测试时根据激活度筛选高响应负样本,自适应匹配测试分布
- ImageNet上FPR95从17.5%降至9.8%,性能显著提升
- 无需训练、高效实用,适合各类视觉语言模型部署
分布外(OOD)检测旨在识别偏离分布的数据。现有方法常引入与分布内类别相距较远的负标签,基于距离进行检测,但这些标签在OOD样本上激活不足,难以捕捉其特征。为此,本文提出测试时激活负标签(TANL),在测试过程中动态评估语料库中标签的激活水平,挖掘测试时高激活候选标签。TANL通过在线识别高置信度测试图像,并累积其在语料库中的分配概率,构建标签激活度量,利用历史测试样本自适应对齐测试分布,从而选择分布适应的激活负标签。进一步结合当前批次激活信息,提出更细粒度的批次自适应版本。为充分融合激活知识,设计激活感知评分函数,强化高激活负标签作用,提升性能并增强对负标签数量的鲁棒性。TANL无需训练、测试高效,具备理论支持。在多种骨干网络和任务设置下验证有效,在大规模ImageNet基准上,将FPR95由17.5%显著降低至9.8%。代码已开源。
原文摘要 · Abstract (English)
Out-of-distribution (OOD) detection aims to identify samples that deviate from in-distribution (ID). One popular pipeline addresses this by introducing negative labels distant from ID classes and detecting OOD based on their distance to these labels. However, such labels may present poor activation on OOD samples, failing to capture the OOD characteristics. To address this, we propose \underline{T}est-time \underline{A}ctivated \underline{N}egative \underline{L}abels (TANL) by dynamically evaluating activation levels across the corpus dataset and mining candidate labels with high activation responses during the testing process. Specifically, TANL identifies high-confidence test images online and accumulates their assignment probabilities over the corpus to construct a label activation metric. Such a metric leverages historical test samples to adaptively align with the test distribution, enabling the selection of distribution-adaptive activated negative labels. By further exploring the activation information within the current testing batch, we introduce a more fine-grained, batch-adaptive variant. To fully utilize label activation knowledge, we propose an activation-aware score function that emphasizes negative labels with stronger activations, boosting performance and enhancing its robustness to the label number. Our TANL is training-free, test-efficient, and grounded in theoretical justification. Experiments on diverse backbones and wide task settings validate its effectiveness. Notably, on the large-scale ImageNet benchmark, TANL significantly reduces the FPR95 from 17.5\% to 9.8\%. Codes are available at \href{https://github.com/YBZh/OpenOOD-VLM}{YBZh/OpenOOD-VLM}.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。