用少量数据微调CLIP模型,解决图像与文本特征不一致问题
Post-pre-training for Modality Alignment in Vision-Language Foundation Models
- 训练一个新阶段的微调方法,仅需1轮小数据集
- 在不降低零样本性能前提下,显著缩小模态间隙
- 适合希望低成本提升多模态模型性能的研究者
对比语言图像预训练(CLIP)是构建现代多模态基础模型的关键。尽管CLIP在下游任务中表现出色的零样本能力,其多模态特征空间仍存在模态间隙,即图像与文本特征聚类之间的差异,限制了任务表现。现有方法通过修改预训练或微调来缓解该问题,但面临大样本高训练成本或零样本性能下降的挑战。本文提出一种名为CLIP-Refine的后预训练方法,处于预训练与微调之间阶段,仅需1轮小规模图文数据集训练即可实现特征空间对齐,且不损害零样本性能。为此,引入两项技术:随机特征对齐(RaFA),通过最小化特征与从先验分布中采样的随机参考向量的距离,使图像与文本特征服从共享先验分布;混合对比蒸馏(HyCD),利用真实图文配对标签和预训练CLIP模型输出生成混合软标签,兼顾保留旧知识与学习新知识。大量实验表明,CLIP-Refine能有效缓解模态间隙,提升分类与检索任务的零样本性能。
原文摘要 · Abstract (English)
Contrastive language image pre-training (CLIP) is an essential component of building modern vision-language foundation models. While CLIP demonstrates remarkable zero-shot performance on downstream tasks, the multi-modal feature spaces still suffer from a modality gap, which is a gap between image and text feature clusters and limits downstream task performance. Although existing works attempt to address the modality gap by modifying pre-training or fine-tuning, they struggle with heavy training costs with large datasets or degradations of zero-shot performance. This paper presents CLIP-Refine, a post-pre-training method for CLIP models at a phase between pre-training and fine-tuning. CLIP-Refine aims to align the feature space with 1 epoch training on small image-text datasets without zero-shot performance degradations. To this end, we introduce two techniques: random feature alignment (RaFA) and hybrid contrastive-distillation (HyCD). RaFA aligns the image and text features to follow a shared prior distribution by minimizing the distance to random reference vectors sampled from the prior. HyCD updates the model with hybrid soft labels generated by combining ground-truth image-text pair labels and outputs from the pre-trained CLIP model. This contributes to achieving both maintaining the past knowledge and learning new knowledge to align features. Our extensive experiments with multiple classification and retrieval tasks show that CLIP-Refine succeeds in mitigating the modality gap and improving the zero-shot performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。