arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.00638cs.CVcs.LG
收藏

像预训练一样微调:改进了zero-shot视觉模型的微调

Finetune like you pretrain: Improved finetuning of zero-shot vision models

Carnegie Mellon University(卡内基梅隆大学);Stanford University(斯坦福大学);Bosch Center for AI(博世人工智能中心)

Sachin Goyal, Ananya Kumar, Sankalp Garg, Zico Kolter, Aditi Raghunathan

摘要:

微调图像-文本模型(如CLIP)在各种基准测试中达到了最先进的精度。然而,最近的作品,如WiseFT(Wortsman等人,2021)和LP-FT(Kumar等人,2022)已经表明,即使微调过程中的细微差异也会导致最终性能的惊人差异,无论是对于分布内(ID)还是分布外(OOD)数据。在这项工作中,我们证明了一种自然而简单的模仿对比预训练的方法始终优于其他微调方法。具体来说,我们将下游类标签转换为文本提示,并继续优化图像嵌入和类描述性提示嵌入之间的对比损失(对比微调)。我们的方法在7个分布偏移、6个迁移学习和3个少样本学习基准测试中始终优于基线。在WILDS-iWILDCam上,我们提出的方法FLYP通过$2.3\%$ ID和$2.7\%$ OOD优于排行榜的顶部,给出了最高的报告准确度。在7个OOD数据集(2个WILDS和5个ImageNet相关偏移)上取平均值,FLYP在标准微调上获得了$4.2\%$ OOD的增益,并且在ID和OOD方面都超过了$1\%$。类似地,在3个少样本学习基准测试中,我们的方法比标准微调和$4.4\%$的性能提高了$4.6\%$。总的来说,这些基准测试将对比微调确定为一种简单,直观和最先进的方法,用于像CLIP这样的图像-文本模型的监督微调。代码可在https://github.com/locuslab/FLYP上获得。

英文摘要:

Finetuning image-text models such as CLIP achieves state-of-the-art accuracies on a variety of benchmarks. However, recent works like WiseFT (Wortsman et al., 2021) and LP-FT (Kumar et al., 2022) have shown that even subtle differences in the finetuning process can lead to surprisingly large differences in the final performance, both for in-distribution (ID) and out-of-distribution (OOD) data. In this work, we show that a natural and simple approach of mimicking contrastive pretraining consistently outperforms alternative finetuning approaches. Specifically, we cast downstream class labels as text prompts and continue optimizing the contrastive loss between image embeddings and class-descriptive prompt embeddings (contrastive finetuning). Our method consistently outperforms baselines across 7 distribution shifts, 6 transfer learning, and 3 few-shot learning benchmarks. On WILDS-iWILDCam, our proposed approach FLYP outperforms the top of the leaderboard by $2.3\%$ ID and $2.7\%$ OOD, giving the highest reported accuracy. Averaged across 7 OOD datasets (2 WILDS and 5 ImageNet associated shifts), FLYP gives gains of $4.2\%$ OOD over standard finetuning and outperforms the current state of the art (LP-FT) by more than $1\%$ both ID and OOD. Similarly, on 3 few-shot learning benchmarks, our approach gives gains up to $4.6\%$ over standard finetuning and $4.4\%$ over the state of the art. In total, these benchmarks establish contrastive finetuning as a simple, intuitive, and state-of-the-art approach for supervised finetuning of image-text models like CLIP. Code is available at https://github.com/locuslab/FLYP.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑