[Paper Review] Visual-Language Prompt Tuning with Knowledge-guided Context Optimization
KgCoOp augments CoOp by regularizing learnable prompts to stay close to hand-crafted prompts, improving generalization to unseen classes with CLIP while maintaining fast training.
Prompt tuning is an effective way to adapt the pre-trained visual-language model (VLM) to the downstream task using task-related textual tokens. Representative CoOp-based work combines the learnable textual tokens with the class tokens to obtain specific textual knowledge. However, the specific textual knowledge is the worse generalization to the unseen classes because it forgets the essential general textual knowledge having a strong generalization ability. To tackle this issue, we introduce a novel Knowledge-guided Context Optimization (KgCoOp) to enhance the generalization ability of the learnable prompt for unseen classes. The key insight of KgCoOp is that forgetting about essential knowledge can be alleviated by reducing the discrepancy between the learnable prompt and the hand-crafted prompt. Especially, KgCoOp minimizes the discrepancy between the textual embeddings generated by learned prompts and the hand-crafted prompts. Finally, adding the KgCoOp upon the contrastive loss can make a discriminative prompt for both seen and unseen tasks. Extensive evaluation of several benchmarks demonstrates that the proposed Knowledge-guided Context Optimization is an efficient method for prompt tuning, \emph{i.e.,} achieves better performance with less training time.
Motivation & Objective
- Motivate the need for better generalization in prompt-tuning of pretrained visual-language models.
- Introduce a regularization term that aligns learned prompts with general, hand-crafted prompts to preserve general knowledge.
- Show that minimizing prompt discrepancy enhances performance on unseen classes without sacrificing seen-class accuracy.
- Evaluate KgCoOp across base-to-new, few-shot, and domain generalization settings on 11 datasets and multiple backbones.
Proposed method
- Build on CoOp by adding a knowledge-guided context optimization term.
- Define general textual knowledge from hand-crafted prompts (e.g., CLIP's a photo of a [Class]).
- Define specific textual knowledge from learnable prompts generated from few-shot data.
- Introduce L_kg = (1/N_c) sum_i ||w_i − w_i_clip||^2 to minimize discrepancy between learned and general embeddings.
- Optimize total loss L = L_ce + lambda * L_kg, with lambda balancing the two terms.
- Demonstrate that KgCoOp achieves higher unseen-class performance with similar base-class performance and same training time as CoOp.
Experimental results
Research questions
- RQ1Does enforcing closeness between learnable prompts and general prompts improve unseen-class generalization without harming seen-class performance?
- RQ2How does KgCoOp perform under base-to-new, few-shot, and domain generalization scenarios across diverse datasets?
- RQ3What is the impact of the regularization weight lambda on generalization and harmonic mean performance?
- RQ4Can KgCoOp be applied on top of existing CoOp-based methods to improve unseen-class generalization?
Key findings
- KgCoOp yields higher harmonic-mean performance (H) on base-to-new generalization than CoOp, CoCoOp, and ProGrad.
- KgCoOp achieves higher New-class accuracy than competing CoOp-based methods while maintaining Base-class performance similar to CoCoOp.
- KgCoOp training time is comparable to CoOp and faster than CoCoOp and ProGrad.
- KgCoOp improves domain generalization, with higher average target performance than CoCoOp on ImageNet-derived targets.
- In few-shot settings, KgCoOp outperforms baselines on average across datasets, improving unseen-class performance.
- The regularization parameter lambda governs the trade-off; an optimal lambda (e.g., 8.0) yields best harmonic mean in 4-shot/16-shot scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.