Source-linked AI summary
CALIP: Zero-Shot Enhancement of CLIP with Parameter-free Attention
Ziyu Guo, Renrui Zhang, Longtian Qiu, Xianzheng Ma, Xupeng Miao, Xuming He, Bin Cui
TL;DR
Existing CLIP adaptations rely on learnable modules, few-shot data, and additional training, limiting efficient downstream transfer. CALIP instead uses parameter-free bidirectional cross-modal attention to update visual and textual representations. Across 14 2D and 3D datasets, it improves zero-shot performance over CLIP, while CALIP-FS achieves leading few-shot results after adding linear layers.
Problem
Existing CLIP adaptations require task-specific learnable parameters, few-shot data, and additional training, hindering efficient zero-shot knowledge transfer and deployment.
Source: Introduction · p. 2Method
CALIP adds parameter-free bidirectional cross-modal attention that interacts spatial visual and textual features to enhance CLIP without extra downstream data or training.
Source: Introduction · p. 2, CALIP with Parameter-free Attention · p. 3Results
Across 14 datasets spanning zero-shot 2D image and 3D point-cloud classification, CALIP improves zero-shot performance over CLIP, while CALIP-FS achieves leading few-shot performance.
Source: Introduction · p. 2, Conclusion · p. 7Takeaways & Limitations
Parameter-free attention provides an efficient CLIP enhancement framework for zero-shot transfer, with a parametric extension supporting competitive few-shot adaptation.
Source: Conclusion · p. 7
Abstract
from arXiv · showhide
Contrastive Language-Image Pre-training (CLIP) has been shown to learn visual representations with great transferability, which achieves promising accuracy for zero-shot classification. To further improve its downstream performance, existing works propose additional learnable modules upon CLIP and fine-tune them by few-shot training sets. However, the resulting extra training cost and data requirement severely hinder the efficiency for model deployment and knowledge transfer. In this paper, we introduce a free-lunch enhancement method, CALIP, to boost CLIP's zero-shot performance via a parameter-free Attention module. Specifically, we guide visual and textual representations to interact with each other and explore cross-modal informative features via attention. As the pre-training has largely reduced the embedding distances between two modalities, we discard all learnable parameters in the attention and bidirectionally update the multi-modal features, enabling the whole process to be parameter-free and training-free. In this way, the images are blended with textual-aware signals and the text representations become visual-guided for better adaptive zero-shot alignment. We evaluate CALIP on various benchmarks of 14 datasets for both 2D image and 3D point cloud few-shot classification, showing consistent zero-shot performance improvement over CLIP. Based on that, we further insert a small number of linear layers in CALIP's attention module and verify our robustness under the few-shot settings, which also achieves leading performance compared to existing methods. Those extensive experiments demonstrate the superiority of our approach for efficient enhancement of CLIP.
Introduction
CLIP enables transferable zero-shot recognition, but existing downstream adaptations require task-specific learnable parameters, few-shot data, and additional training. CALIP addresses this efficiency gap with parameter-free cross-modal attention that enhances CLIP across zero-shot and few-shot settings.
CALIP
- CALIP updates both modalities through attention, strengthening visual regions and corresponding category features while preserving cross-modal interactions.The attention map assigns weights based on feature similarity between categories and image pixels or sites.Source: Figure 1 · p. 1
Motivation
- CLIP aligns image and text features in a shared embedding space, enabling zero-shot recognition of unseen classes from category names.Its downstream classification becomes an image-text matching problem in open-vocabulary settings.Source: Introduction · p. 1
- Existing adaptations improve CLIP with learnable prompts or adapters but require few-shot labeled data, extra training, and separate task-specific model copies.These requirements hinder efficient zero-shot knowledge transfer and deployment.Source: Introduction · pp. 1–2
CALIP
- CALIP uses intermediate spatial visual features and textual features in a non-parametric, bidirectional cross-modal attention module.The design exchanges image-text information without learnable parameters before producing the final zero-shot prediction.Source: Introduction · p. 2, RELATED WORK · p. 3
Evaluation
- CALIP is evaluated on 14 datasets for zero-shot 2D image and 3D point-cloud classification, while CALIP-FS adds a small number of linear layers for few-shot fine-tuning.The authors report favorable zero-shot performance for CALIP and leading or competitive performance for CALIP-FS among existing methods.Source: Introduction · p. 2, Figure 2 · p. 3
Method
CALIP enhances CLIP through parameter-free cross-modal attention that exchanges information between spatial visual and textual features. A parametric extension, CALIP-FS, adds lightweight projections for few-shot adaptation while freezing CLIP’s encoders.
CALIP with Parameter-free Attention
- CALIP applies parameter-free cross-modal attention between CLIP’s intermediate spatial visual feature and textual feature without projection layers.The attention map is obtained directly by matrix multiplication.Source: CALIP with Parameter-free Attention · pp. 3–4
- The attention map represents category-to-image-site similarities and supports bidirectional updates of visual and textual features.Textual features become adaptive to each input image, while spatial features provide fine-grained information.Source: CALIP with Parameter-free Attention · pp. 3–4
- CALIP combines original CLIP, visual-guided, and textual-blended logits through weighted aggregation for zero-shot prediction.The resulting process requires neither few-shot fine-tuning nor additional data.Source: CALIP with Parameter-free Attention · p. 4
CALIP-FS with Parametric Attention
- CALIP-FS inserts learnable pre- and post-projection layers into the attention module while freezing CLIP’s pre-trained encoders.The added projections enable parametric attention for few-shot settings.Source: CALIP-FS with Parametric Attention · p. 4
- CALIP-FS uses weighted summation of the same three logit terms and achieves competitive performance after few-shot fine-tuning.The method is described as significantly improving over zero-shot CALIP.Source: CALIP-FS with Parametric Attention · p. 5
Experiments
Experiments evaluate CALIP and CALIP-FS across diverse 2D and 3D benchmarks, distribution shifts, and ablations. The results show consistent gains from parameter-free enhancement and strong few-shot performance from CALIP-FS.
Evaluation Setup
- CALIP is evaluated on 11 image datasets and 3 point-cloud datasets without using downstream training sets.The setup uses full test sets for direct evaluation, with ResNet-50 and a 12-layer transformer as encoders.Source: Zero-shot CALIP · p. 5
Zero-shot Performance
- +0.92% average accuracy: CALIP outperforms CLIP across all 2D downstream benchmarks.It also improves Caltech101 by +3.77% and EuroSAT by +1.36%.Source: Zero-shot CALIP · p. 6
- +1.70% average accuracy: CALIP enhances PointCLIP across three 3D point-cloud classification datasets without parameters.Source: Zero-shot CALIP · p. 6
Few-shot Performance
- CALIP-FS achieves the highest average accuracy across 11 datasets and improves substantially over zero-shot CLIP, especially on DTD and EuroSAT.Its gains over CLIP on DTD and EuroSAT range from +20% to +50%.Source: Few-shot CALIP-FS · p. 6, Figure 4 · p. 6
- CALIP-FS lags behind Tip-Adapter-F only on OxfordPets while outperforming other few-shot methods on DTD, EuroSAT, and SUN397.Unlike Tip-Adapter-F’s two-step procedure with stored training samples, CALIP-FS uses one-step training.Source: Few-shot CALIP-FS · p. 6
Distribution Shift
- CALIP-FS surpasses CoOp on four out-of-distribution datasets under 16-shot fine-tuning.Source: Out-of-distribution Performance · pp. 6–7
Ablation Studies
- Ablations show that combining logits with attention applied to only one modality performs better than including the fourth term updated in both modalities.The authors attribute the degradation to excessive cross-modal interaction harming CLIP’s pre-trained alignment.Source: Ablation Study · p. 7
- Using both pre- and post-projection layers for both modalities gives CALIP-FS its best performance.The design separates the attention calculation space from the preceding embedding space.Source: Ablation Study · p. 7
Visualization
Visualization shows that both CALIP variants focus attention around object pixels and make spatial visual features more distinctive using category text guidance.
- Attention maps in CALIP and CALIP-FS concentrate around object pixels, while category-guided visual features become more distinctive.After few-shot fine-tuning, both attention-map and feature distributions become more intensive.Source: Visualization · p. 7
Conclusion
The paper concludes that CALIP provides parameter-free, training-free enhancement of CLIP across 2D and 3D benchmarks, while CALIP-FS extends the approach to competitive few-shot performance.
- CALIP performs zero-shot visual-textual interaction through a parameter-free attention module without additional training.Source: Conclusion · p. 7
- CALIP achieves favorable performance across a wide range of 2D and 3D benchmarks.Source: Conclusion · p. 7
- CALIP-FS adds a parametric attention version for few-shot fine-tuning and obtains competitive results among existing state-of-the-art methods.Source: Conclusion · p. 7
- The authors identify extending parameter-free methods to CLIP-based object detection and semantic segmentation as future work.Source: Conclusion · p. 7
Few-shot Training Settings
Few-shot experiments compare CALIP-FS with established baselines across 11 2D datasets and multiple shot counts, while reporting selected hyperparameter settings and attention magnitudes.
Few-shot Protocol
- CALIP-FS is compared with CoOp, CLIP-Adapter, and Tip-Adapter-F on 11 2D datasets using 1, 2, 4, 8, and 16 shots per category.Source: Few-shot Training Settings · p. 8
Additional Ablation Study
The study adds ablations for zero-shot CALIP and 16-shot CALIP-FS to further explain the method's behavior. Hyperparameters are tuned on validation data, with test-set results reported for reference.
- The ablation study examines both zero-shot CALIP and 16-shot CALIP-FS to further explain the method's theory.Source: Additional Ablation Study · p. 8
- All hyperparameters are tuned on the official validation set.Source: Additional Ablation Study · p. 8
- Corresponding test-set results are reported for reference after validation-based tuning.Source: Additional Ablation Study · p. 8
Logits Weights β1, β2, β3
The experiments analyze how the three logits contribute to prediction, finding that zero-shot CALIP benefits from stronger visual-guided logits while CALIP-FS relies more on pretrained logits.
- For zero-shot CALIP, a visual-guided logit weight of 5 achieves the best Caltech101 performance.The textual features use cross-modal interactions to explore informative visual features from the image.Source: Logits Weights β1, β2, β3 · p. 8
- The 5-weight visual-guided logit contributes more than CLIP's original 1-weight logit in zero-shot CALIP.Source: Logits Weights β1, β2, β3 · p. 8
- For CALIP-FS, the pretrained logit is most important, while β2 and β3 show limited sensitivity across datasets within a certain range.Source: Logits Weights β1, β2, β3 · p. 8, Sensitivity Test · p. 9
Parameter-free Magnitudes αt, αs
The parameter-free attention uses equal magnitude modulators for textual and visual attention, while CALIP and CALIP-FS remain stronger than their baselines across visual encoders.
- Setting both textual and visual attention modulators αt and αs to 2 produces the highest zero-shot Caltech101 accuracy.Source: Parameter-free Magnitudes αt, αs · p. 9
- Equal magnitude modulation indicates comparative roles for the two modalities in bidirectional feature updates.Source: Parameter-free Magnitudes αt, αs · p. 9
- Across different visual networks on ImageNet, CALIP and CALIP-FS outperform their respective zero-shot CLIP and CoOp baselines.Source: Different Visual Encoders · p. 9
Best Dataset Hyperparameters
Dataset-specific experiments show that the three logits require different proportions, with zero-shot CALIP favoring larger β2 and CALIP-FS generally favoring smaller, balanced β2 and β3.
- Different domains require different proportions of the three logits.The best β1, β2, and β3 values are listed for all datasets in Table 9.Source: Best Dataset Hyperparameters · p. 9
- For zero-shot CALIP, larger β2 improves recognition accuracy and surpasses β1 on 7 datasets.Source: Best Dataset Hyperparameters · p. 9
- CALIP-FS generally prefers equal β2 and β3 values, both normally smaller than β1.Source: Best Dataset Hyperparameters · p. 10
Additional Visualization
CALIP’s visualizations show that cross-modal interactions make features more semantically aligned for final matching. Medical-dataset experiments further assess transfer under larger domain gaps, with CALIP and CALIP-FS leading existing methods.
- Ground-truth textual attention concentrates on corresponding objects in 16-shot CALIP-FS visualizations.After inter-modal interactions, visual and textual features become more semantically aligned for final matching.Source: Additional Visualization · p. 10
- Medical experiments use ISIC and BCCD to test transfer across pathological skin-injury and blood-cell recognition.These datasets have larger domain gaps than the default eleven 2D datasets.Source: Additional Results on Medical Datasets · p. 10
- CALIP and CALIP-FS show leading performance among existing methods on ISIC and BCCD in zero-shot and 16-shot evaluations.Table 12 reports zero-shot classification, while Table 13 reports 16-shot classification.Source: Additional Results on Medical Datasets · p. 10, Table 12 · p. 10, Table 13 · p. 10
Related papers
This paper cites
- Attention Is All You Need2017
- Learning Transferable Visual Models From Natural Language Supervision2021
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale2020
- PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space2017
- Prefix-Tuning: Optimizing Continuous Prompts for Generation2021
- Parameter-Efficient Transfer Learning for NLP2019