Enhancing Few-shot CLIP with Semantic-Aware Fine-Tuning

Yao Zhu, Yuefeng Chen, Wei Wang, Xiaofeng Mao, Xiu Yan +5 more
11/8/2023
cs.CV

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

Learning generalized representations from limited training samples is crucial for applying deep neural networks in low-resource scenarios. Recently, methods based on Contrastive Language-Image Pre-training (CLIP) have exhibited promising performance in few-shot adaptation tasks. To avoid catastrophic forgetting and overfitting caused by few-shot fine-tuning, existing works usually freeze the parameters of CLIP pre-trained on large-scale datasets, overlooking the possibility that some parameters might not be suitable for downstream tasks. To this end, we revisit CLIP's visual encoder with a specific focus on its distinctive attention pooling layer, which performs a spatial weighted-sum of the dense feature maps. Given that dense feature maps contain meaningful semantic information, and different semantics hold varying importance for diverse downstream tasks (such as prioritizing semantics like ears and eyes in pet classification tasks rather than side mirrors), using the same weighted-sum operation for dense features across different few-shot tasks might not be appropriate. Hence, we propose fine-tuning the parameters of the attention pooling layer during the training process to encourage the model to focus on task-specific semantics. In the inference process, we perform residual blending between the features pooled by the fine-tuned and the original attention pooling layers to incorporate both the few-shot knowledge and the pre-trained CLIP's prior knowledge. We term this method as Semantic-Aware FinE-tuning (SAFE). SAFE is effective in enhancing the conventional few-shot CLIP and is compatible with the existing adapter approach (termed SAFE-A).

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhu2023enhancing,
  title  = {Enhancing Few-shot CLIP with Semantic-Aware Fine-Tuning},
  author = {Yao Zhu and Yuefeng Chen and Wei Wang and Xiaofeng Mao and Xiu Yan and Yue Wang and Zhigang Li and Wang lu and Jindong Wang and Xiangyang Ji},
  year   = {2023},
  eprint = {2311.04464},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.04464v3}
}

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/2311.04464.svg)](https://codeofpaper.com/paper/2311.04464)

Discussion