Abstract
Large pre-trained vision-language models, such as CLIP, have demonstrated state-of-the-art performance across a wide range of image classification tasks without requiring retraining. Few-shot CLIP is competitive with existing specialized architectures that were trained on the downstream tasks. Recent research demonstrates that the performance of CLIP can be further improved using lightweight adaptation approaches. However, previous methods adapt different modalities of the CLIP model individually, ignoring the interactions and relationships between visual and textual representations. In this work, we propose Multi-Modal Adapter, an approach for Multi-Modal adaptation of CLIP. Specifically, we add a trainable Multi-Head Attention layer that combines text and image features to produce an additive adaptation of both. Multi-Modal Adapter demonstrates improved generalizability, based on its performance on unseen classes compared to existing adaptation methods. We perform additional ablations and investigations to validate and interpret the proposed approach.
Introduction
Large-scale vision-language models (VLMs) like CLIP are powerful foundations for computer vision, but they often require "adapters"—lightweight layers added on top—to excel at specific downstream tasks. Current state-of-the-art adapters, such as CLIP-Adapter or CoOp, typically treat image and text features as separate streams. While they may fine-tune text prompts or add neural networks to image outputs, they often ignore the rich interactions between the two modalities. This "siloed" adaptation frequently leads to overfitting, where the model becomes a specialist in the specific classes seen during training (the "base" classes) but loses its zero-shot ability to recognize new, unseen categories.
The Multi-Modal Adapter Architecture
The Multi-Modal Adapter (MMA) addresses this by moving away from parallel processing in favor of joint interaction. The architecture follows a four-step process:
- Dimension Downsampling: To maintain efficiency, 512-dimensional CLIP embeddings are compressed using a linear layer.
- Multi-Modal Sequencing: The model concatenates text embeddings for all class labels and the image embedding into a single sequence.
- Masked Multi-Head Attention (MHA): This core innovation uses a specific mask to ensure each textual embedding is adjusted based on image information and vice versa, while minimizing irrelevant cross-talk between different text labels.
- Upsampling & Residual Connection: Adapted features are scaled back to the original size and added to the original CLIP embeddings using a residual ratio ($\lambda$). This ensures the model retains the foundational knowledge of the CLIP backbone.
Experimental Evaluation
The researchers evaluated MMA across 11 diverse visual classification datasets, including general objects (ImageNet, CIFAR-10), fine-grained categories (Oxford Pets, Stanford Cars), and specialized domains (EuroSat satellite imagery, UCF101 action recognition). The experiments utilized an $n$-class-$k$-shot setting, training on 16 samples per class for half the classes ("base") and testing on the remaining half ("new") to measure generalization.
Performance and Generalization
A key insight of this work is that joint modality adaptation acts as a form of regularization. By forcing text and image features to align through attention during fine-tuning, the model avoids the "forgetting" trap common in single-modality adapters.
As shown in the results, MMA maintains a much smaller performance gap between base and new classes. For instance, MMA shows a -7% average difference compared to the -31% drop seen with CoOp. Furthermore, MMA demonstrated robustness to noise; when trained on blurred images, it outperformed other adapters on clean test sets, suggesting it learns more robust, high-level features. Efficiency is also a highlight: the adapter adds only approximately 107,712 trainable parameters, a tiny fraction of the total model size.
Conclusion and Future Work
While MMA is a strong general-purpose adapter, it can be sensitive to hyperparameters like bottleneck size and the number of attention heads. Future work may explore adding positional encodings to the sequence to help the attention mechanism better distinguish between prompts and image features. Additionally, while MMA is a robust "all-rounder," further refinement of the attention mask may be necessary to match specialized methods on highly fine-grained tasks like aircraft or flower identification.
Summary updated