[论文解读] TinyCLIP: CLIP Distillation via Affinity Mimicking and Weight Inheritance
TinyCLIP 提出了一种新颖的跨模态蒸馏方法,通过亲和力模仿和权重继承来压缩大规模视觉-语言模型(如 CLIP)。通过在亲和力空间中模仿跨模态特征对齐行为,并将教师模型的预训练权重继承到学生模型中,TinyCLIP 实现了最先进水平的零样本性能——仅使用原始 CLIP ViT-B/16 模型 8.9% 的参数量(8.9M 参数),便实现了 41.1% 的 ImageNet 顶部-1 准确率,超越了原始 CLIP ViT-B/16 模型。
In this paper, we propose a novel cross-modal distillation method, called TinyCLIP, for large-scale language-image pre-trained models. The method introduces two core techniques: affinity mimicking and weight inheritance. Affinity mimicking explores the interaction between modalities during distillation, enabling student models to mimic teachers' behavior of learning cross-modal feature alignment in a visual-linguistic affinity space. Weight inheritance transmits the pre-trained weights from the teacher models to their student counterparts to improve distillation efficiency. Moreover, we extend the method into a multi-stage progressive distillation to mitigate the loss of informative weights during extreme compression. Comprehensive experiments demonstrate the efficacy of TinyCLIP, showing that it can reduce the size of the pre-trained CLIP ViT-B/32 by 50%, while maintaining comparable zero-shot performance. While aiming for comparable performance, distillation with weight inheritance can speed up the training by 1.4 - 7.8 $ imes$ compared to training from scratch. Moreover, our TinyCLIP ViT-8M/16, trained on YFCC-15M, achieves an impressive zero-shot top-1 accuracy of 41.1% on ImageNet, surpassing the original CLIP ViT-B/16 by 3.5% while utilizing only 8.9% parameters. Finally, we demonstrate the good transferability of TinyCLIP in various downstream tasks. Code and models will be open-sourced at https://aka.ms/tinyclip.
研究动机与目标
- 通过实现高效的模型蒸馏,解决 CLIP 等大规模视觉-语言模型带来的高计算与存储成本问题。
- 通过在知识迁移过程中保留跨模态交互,克服单模态蒸馏在多模态设置下的局限性。
- 通过一种新颖的权重继承机制,利用教师模型的预训练权重,提升蒸馏效率。
- 通过引入多阶段渐进式蒸馏,实现在不显著降低性能的前提下实现极端模型压缩。
- 提升蒸馏后模型在零样本和下游视觉-语言任务中的可迁移性。
提出的方法
- 亲和力模仿通过最小化亲和力空间中图像与文本嵌入之间的余弦相似度差距,使学生模型能够复制教师模型在视觉-语言特征对齐方面的行为。
- 权重继承将教师模型的预训练权重传递给学生模型,通过手动选择 k 维度或 k 层权重,或使用可学习掩码来识别关键参数。
- 可学习掩码分别应用于视觉和文本分支,以自动识别并继承最具信息量的权重,适应模态特定的重要性。
- 多阶段渐进式蒸馏将极端压缩分解为一系列连续阶段,每个学生模型从结构相似的教师模型继承权重,从而减少架构不匹配并提升性能。
- 该方法采用双分支架构,并共享训练目标:对图像-文本对使用对比损失,通过亲和力模仿实现知识蒸馏。
- 蒸馏过程通过交叉熵损失与对齐损失的组合进行优化,教师模型的输出亲和力矩阵作为学生模型的监督信号。
实验结果
研究问题
- RQ1在知识迁移过程中显式建模视觉与语言模态之间的交互,能否提升跨模态蒸馏的性能?
- RQ2从预训练教师模型中继承权重对视觉-语言模型蒸馏效率和最终性能有何影响?
- RQ3多阶段渐进式蒸馏能否缓解视觉-语言模型在极端模型压缩过程中的性能退化?
- RQ4与仅依赖图像或文本特征的传统蒸馏方法相比,亲和力模仿有何优势?
- RQ5蒸馏后的 TinyCLIP 模型是否能在多样化的下游视觉-语言基准上保持强大的零样本和微调性能?
主要发现
- TinyCLIP 将 CLIP ViT-B/32 的参数量减少 50%,同时在 ImageNet 上保持了相近的零样本性能。
- 与从零开始训练相比,使用权重继承可使蒸馏训练速度提升 1.4× 至 7.8×,显著提高训练效率。
- TinyCLIP ViT-8M/16 在 ImageNet 上实现了 41.1% 的零样本顶部-1 准确率,超越了原始 CLIP ViT-B/16(37.6%),且仅使用其 8.9% 的参数量。
- TinyCLIP ViT-63M/32 在 ImageNet-V2 上实现了 55.7% 的顶部-1 准确率,优于 OpenCLIP ViT-B/32(55.1%)和 CLIP ViT-B/32(56.0%)在鲁棒性基准上的表现。
- 与单阶段蒸馏相比,多阶段渐进式蒸馏策略在 ImageNet 上将零样本准确率提升了 2.0%,证明了其在知识保留方面的有效性。
- TinyCLIP 模型展现出强大的可迁移性,在 23 个下游数据集的零样本和线性探测评估中,其顶部-1 准确率与 OpenCLIP ViT-B/32 相差不超过 2%。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。