Abstract
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.
Original language | English |
---|---|
Title of host publication | Proceedings - 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022 |
Publisher | IEEE |
Pages | 16795-16804 |
Number of pages | 10 |
ISBN (Electronic) | 9781665469463 |
ISBN (Print) | 9781665469470 |
DOIs | |
Publication status | Published - Jun 2022 |
Event | 35th IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022 - New Orleans, United States Duration: 18 Jun 2022 → 24 Jun 2022 https://ieeexplore.ieee.org/xpl/conhome/9878378/proceeding |
Publication series
Name | Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) |
---|---|
Volume | 2022-June |
ISSN (Print) | 1063-6919 |
ISSN (Electronic) | 2575-7075 |
Conference
Conference | 35th IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022 |
---|---|
Country/Territory | United States |
City | New Orleans |
Period | 18/06/22 → 24/06/22 |
Internet address |
Scopus Subject Areas
- Software
- Computer Vision and Pattern Recognition
User-Defined Keywords
- Representation learning