Skip to main content
QUICK REVIEW

[论文解读] C-TPT: Calibrated Test-Time Prompt Tuning for Vision-Language Models via Text Feature Dispersion

Hee Suk Yoon, Eunseop Yoon|arXiv (Cornell University)|Mar 21, 2024
Natural Language Processing Techniques被引用 4
一句话总结

该论文提出C-TPT,一种用于视觉-语言模型的新型测试时提示微调方法,通过最大化平均文本特征离散度(ATFD)来提升模型校准度,且无需使用标注数据。借助CLIP的内在特性,C-TPT在推理过程中优化提示,以减少过自信现象,从而在多个数据集和CLIP架构上显著降低期望校准误差(ECE),同时保持或提升准确率。

ABSTRACT

In deep learning, test-time adaptation has gained attention as a method for model fine-tuning without the need for labeled data. A prime exemplification is the recently proposed test-time prompt tuning for large-scale vision-language models such as CLIP. Unfortunately, these prompts have been mainly developed to improve accuracy, overlooking the importance of calibration, which is a crucial aspect for quantifying prediction uncertainty. However, traditional calibration methods rely on substantial amounts of labeled data, making them impractical for test-time scenarios. To this end, this paper explores calibration during test-time prompt tuning by leveraging the inherent properties of CLIP. Through a series of observations, we find that the prompt choice significantly affects the calibration in CLIP, where the prompts leading to higher text feature dispersion result in better-calibrated predictions. Introducing the Average Text Feature Dispersion (ATFD), we establish its relationship with calibration error and present a novel method, Calibrated Test-time Prompt Tuning (C-TPT), for optimizing prompts during test-time with enhanced calibration. Through extensive experiments on different CLIP architectures and datasets, we show that C-TPT can effectively improve the calibration of test-time prompt tuning without needing labeled data. The code is publicly accessible at https://github.com/hee-suk-yoon/C-TPT.

研究动机与目标

  • 为解决尽管准确率有所提升,但视觉-语言模型(如CLIP)在测试时提示微调中仍缺乏校准的问题。
  • 识别可用于测试时适应的内在、无数据的模型校准指标。
  • 开发一种在测试时提示微调中提升校准度且不依赖标注数据的方法。
  • 建立CLIP模型中文本特征离散度与校准误差之间的定量关联。
  • 证明所提方法在多种视觉-语言基准和CLIP架构上的泛化性与有效性。

提出的方法

  • 该方法引入平均文本特征离散度(ATFD)作为模型校准的代理指标,用于衡量CLIP文本编码器输出空间中类别嵌入文本特征的分布范围。
  • C-TPT通过在测试时最大化ATFD作为正则化项来优化提示,利用梯度下降法改进校准度,且无需访问标签。
  • 该方法利用观察结果:更高的文本特征离散度与更低的期望校准误差(ECE)相关,从而实现无数据校准。
  • 该方法在推理阶段应用,对每个输入图像动态调整提示,以同时提升准确率与校准度。
  • C-TPT在多个CLIP变体(ViT-B/16、RN50)和数据集(ImageNet、ImageNet-A、ImageNet-V2等)上进行了验证,结果表明其在校准度方面具有持续提升。
  • 该方法还被扩展至训练时提示微调(如CoOp),其中C-TPT作为正则化器使用以改善ECE,证明了其广泛适用性。

实验结果

研究问题

  • RQ1能否在不使用标注数据的情况下,增强测试时提示微调以提升模型校准度?
  • RQ2是否存在一种与CLIP相关的、无数据的内在属性,能与校准性能相关联?
  • RQ3在CLIP嵌入空间中增加文本特征的离散度是否能带来更优的校准预测?
  • RQ4所提方法能否在不同数据集和CLIP架构上实现泛化?
  • RQ5C-TPT能否被适配用于训练时提示微调作为正则化器?

主要发现

  • C-TPT在多个数据集(包括ImageNet-A和ImageNet-V2)上平均将期望校准误差(ECE)降低高达50%,且无需使用标注数据。
  • 在ImageNet-A上,当应用于CoOp时,C-TPT将ECE从3.00降低至1.48,证明其在训练时微调中作为正则化器的有效性。
  • 在Caltech上实现1.48的ECE,在Cars上实现1.79的ECE,显著优于基线方法CoOp的校准度,同时保持了具有竞争力的准确率。
  • 在ImageNet及其他数据集上观察到ATFD排名之间存在强负相关性(Spearman ρ = 0.92),表明在一个数据集上高离散度可泛化至其他数据集。
  • C-TPT在所有评估数据集上均提升了校准度,包括ImageNet-Sketch和EuroSAT等具有挑战性的分布偏移数据集,ECE降低最高达40%。
  • 该方法在显著降低过自信度的同时保持或略微提升准确率,证实更优的校准度不会以性能为代价。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。