SEP: Self-Enhanced Prompt Tuning for Visual-Language Model

Hantao Yao, Rui Zhang, Lu Yu, Yongdong Zhang, Changsheng Xu
5/24/2024
cs.CV

Official code: htyao89/SEP (7 stars, last commit 2024-12-26).

Abstract

Prompt tuning based on Context Optimization (CoOp) effectively adapts visual-language models (VLMs) to downstream tasks by inferring additional learnable prompt tokens. However, these tokens are less discriminative as they are independent of the pre-trained tokens and fail to capture input-specific knowledge, such as class-aware textual or instance-aware visual knowledge. Leveraging the discriminative and generalization capabilities inherent in pre-trained tokens, we introduce a novel approach named Self-Enhanced Prompt Tuning (SEP). The core principle of SEP involves adapting the learnable prompt tokens at each encoder layer from the corresponding self-pretrained tokens, thereby explicitly incorporating discriminative prior knowledge to enhance both textual-level and visual-level embeddings. Furthermore, SEP's self-enhanced tokens not only boost discrimination but also mitigate domain shifts in unseen domains, enhancing generalization. In practice, SEP selects several representative tokens from all pre-trained tokens for each input data at every layer of the text/visual encoders. Subsequently, a Token Fusion Module (TFM) is introduced to generate a self-enhanced token by merging these representative tokens with the learnable tokens using a cross-attention mechanism. This self-enhanced token is then concatenated with all pre-trained tokens, serving as input for subsequent encoder layers to produce the relevant embeddings. Comprehensive evaluations across various benchmarks and tasks confirm SEP's efficacy in prompt tuning. Code: \href{Code}{https://github.com/htyao89/SEP}.

View on arXivView PDF

Code Implementations(1)

htyao89/SEPOfficial100%

Code for the Self-Enhanced Prompt Tuning

70Shell, PythonMay 21, 20241 years ago

Similar Papers

Cite this paper

@article{yao2024sep,
  title  = {SEP: Self-Enhanced Prompt Tuning for Visual-Language Model},
  author = {Hantao Yao and Rui Zhang and Lu Yu and Yongdong Zhang and Changsheng Xu},
  year   = {2024},
  eprint = {2405.15549},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.15549v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.15549.svg)](https://codeofpaper.com/paper/2405.15549)

Discussion