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

视觉语言模型的条件提示学习

Conditional Prompt Learning for Vision-Language Models

Nanyang Technological University(南洋理工大学);S-Lab

Kaiyang Zhou, Jingkang Yang, Chen Change Loy, Ziwei Liu

摘要:

随着CLIP等强大的预训练视觉语言模型的兴起,研究如何使这些模型适应下游数据集变得至关重要。最近提出的一种名为上下文优化(CoOp)的方法将提示学习的概念(NLP的最新趋势)引入视觉领域,以适应预训练的视觉语言模型。具体来说,CoOp将提示中的上下文单词转化为一组可学习的向量,并且只需要几个标记的图像进行学习,就可以实现对密集调整的手动提示的巨大改进。在我们的研究中,我们确定了CoOp的一个关键问题:学习的上下文不能推广到同一数据集中更广泛的不可见类,这表明CoOp过度拟合了训练过程中观察到的基类。为了解决这个问题,我们提出了条件上下文优化(CoCoOp),它通过进一步学习轻量级神经网络来为每个图像生成输入条件令牌(向量)来扩展CoOp。与CoOp的静态提示相比,我们的动态提示适应每个实例,因此对类转换不太敏感。大量的实验表明,CoCoOp比CoOp更好地推广到看不见的类,甚至显示出有前途的可移植性超出了单个数据集,并产生更强的领域泛化性能以及。代码可在https://github.com/KaiyangZhou/CoOp上获得。

英文摘要:

With the rise of powerful pre-trained vision-language models like CLIP, it becomes essential to investigate ways to adapt these models to downstream datasets. A recently proposed method named Context Optimization (CoOp) introduces the concept of prompt learning -- a recent trend in NLP -- to the vision domain for adapting pre-trained vision-language models. Specifically, CoOp turns context words in a prompt into a set of learnable vectors and, with only a few labeled images for learning, can achieve huge improvements over intensively-tuned manual prompts. In our study we identify a critical problem of CoOp: the learned context is not generalizable to wider unseen classes within the same dataset, suggesting that CoOp overfits base classes observed during training. To address the problem, we propose Conditional Context Optimization (CoCoOp), which extends CoOp by further learning a lightweight neural network to generate for each image an input-conditional token (vector). Compared to CoOp's static prompts, our dynamic prompts adapt to each instance and are thus less sensitive to class shift. Extensive experiments show that CoCoOp generalizes much better than CoOp to unseen classes, even showing promising transferability beyond a single dataset; and yields stronger domain generalization performance as well. Code is available at https://github.com/KaiyangZhou/CoOp.

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

↑