TL;DR
This paper introduces ZLaP (Zero-shot classification with Label Propagation), a training-free, non-parametric method that boosts the zero-shot performance of Vision-Language Models (VLMs) like CLIP by leveraging unlabeled data. By constructing a specialized bi-modal proximity graph and introducing an efficient dual solution with sparsification, ZLaP achieves state-of-the-art accuracy across 14 benchmark datasets in both transductive and inductive settings without needing access to model weights.
What Problem Does This Paper Address?
Vision-Language Models (VLMs) excel at zero-shot classification by matching image features with text features generated from class names (e.g., "a photo of a [class]"). However, in many real-world scenarios, we also have access to a pool of unlabeled images from the target distribution.
How can we use this unlabeled data to improve zero-shot accuracy without expensive fine-tuning?
A classic semi-supervised approach is Label Propagation (LP), which builds a similarity graph of data points and propagates labels from known nodes (text prompts) to unknown nodes (images). Unfortunately, standard LP fails spectacularly here due to the modality gap: VLMs embed images and text into distinct clusters within the shared space. In a standard nearest-neighbor search, text nodes only connect to text nodes, and image nodes only connect to image nodes, leaving virtually no bridges to propagate labels across modalities.
Methods
The authors propose ZLaP to tailor label propagation specifically for the bi-modal nature of VLMs:
- Bi-modal Graph Adjustments: To bridge the modality gap, ZLaP performs $k$-nearest neighbor ($k\text{NN}$) searches separately. Image nodes are allowed to connect to other images and to text nodes, but text nodes are never used as queries. This forces cross-modal edges to form. Furthermore, a power function $h(v) = v^\gamma$ scales the cross-modal similarities to balance their contribution against intra-modal edges.
- Transductive vs. Inductive Inference:
- Transductive: When all test images are available at once, ZLaP uses the standard primal LP solution to classify the entire batch jointly.
- Inductive: When test images arrive one by one, updating the graph is too expensive. The authors derive a novel dual solution that allows classifying a single new test image by solving only one linear system instead of $C$ systems (where $C$ is the number of classes).
- Sparsification ($ZLaP^*$): To make inductive inference lightning-fast, they pre-compute and sparsify the inverse graph Laplacian matrix, keeping only the largest values. This reduces test-time computation to a single sparse vector-matrix multiplication.
Datasets
The method was extensively evaluated on 14 diverse image classification datasets:
- ImageNet, DTD (Describable Textures Dataset), EuroSAT, FGVC-Aircraft, Oxford Flowers 102, Food-101, Oxford-IIIT Pet, SUN397, Stanford Cars, Caltech101, UCF101, CIFAR10, CIFAR100, and CUB-200-2011.
Standard train/test splits from CoOp or official repositories were utilized to ensure fair comparison with prior art.
Key Insights and Ideas
- The Modality Gap is a Feature, Not Just a Bug: Standard graph construction is blind to the fact that text and images live in different sub-spaces. By explicitly separating the neighbor search for image-to-image and image-to-text interactions, ZLaP turns a broken graph into a highly effective geodesic map.
- Sparsification is a Regularizer: Intuitively, throwing away matrix entries to save memory should hurt accuracy. Surprisingly, the authors found that aggressive sparsification (keeping only the top element per row) actually improved performance. It acts as a denoiser, wiping out low-confidence, erroneous cross-talk in the graph.
- Completely Black-Box Friendly: Because ZLaP only operates on extracted features, it requires zero backpropagation, zero weight updates, and can even be applied to proprietary models accessed strictly via a web API.
Key Results
- Significant Accuracy Gains: Averaged across all 14 datasets using a ResNet50 backbone, ZLaP improves baseline CLIP zero-shot accuracy from 56.6% to 60.0% in the transductive setting. When combined with concurrent proxy-learning methods (InMaP), it pushes accuracy further to 61.3%.
- Massive Speedups for Inductive Inference: While the naive primal LP solution takes about 2.6 seconds per image at test time, the proposed dual solution cuts this down to 4.4 milliseconds. Applying sparsification ($ZLaP^*$) slashes it further to a mere 0.6 milliseconds per image, all while maintaining or slightly exceeding the unsparsified accuracy.
Limitations and Future Work
- Dependence on Target Distribution: ZLaP assumes the unlabeled images come from the same distribution as the target task. When tested against raw, unfiltered web-crawled data (like LAION-400M), a purely random selection of unlabeled images causes the method to fail. However, the authors note that filtering the web data using caption-based proximity partially mitigates this issue.
- Hyperparameter Sensitivity: The method introduces parameters like the power-law exponent $\gamma$ and the propagation factor $\alpha$. While the authors demonstrate relative stability in the appendix, optimal performance still relies on finding a good global configuration across diverse datasets.
Summary updated