Label Shift Aware Adaptation for Online Zero-shot Learning with Contrastive Language-Image Pre-Training (CLIP)

Pengxiao Han, Changkun Ye, Yanshuo Wang, Jinguang Tong, Miaohua Zhang, Xuesong Li, Jie Hong, Lars PeterssonarXiv 2026

TL;DR

When deploying vision-language models like CLIP in real-time streaming scenarios, performance often plummets because the distribution of categories in the wild differs drastically from the model's training data. To fix this, Label Shift Aware (LSA) introduces a training-free, memory-efficient framework that dynamically estimates test-time label distributions and adjusts predictions on the fly. By correcting this "label shift" without modifying the underlying model parameters, LSA consistently outperforms state-of-the-art online zero-shot learning methods across 14 benchmark datasets.

What Problem Does This Paper Address?

Vision-language foundation models like CLIP excel at Zero-Shot Learning (ZSL)—classifying images from completely unseen categories by matching image embeddings with textual prompts. However, deploying these models in real-world, resource-constrained environments (like robotics or edge devices) introduces a more challenging paradigm: Online Zero-Shot Learning.

In this setup, data arrives sequentially in a stream, each sample is predicted immediately, and data cannot be stored due to privacy or memory constraints.

Figure 1: Comparison of three CLIP-based inference settings. (a) ZSL with CLIP: The model makes predictions on unseen data using pre-trained text and image encoders, without any adaptation. (b) TTA with CLIP: The model adapts using access to multiple test samples from the target domain. (c) Online ZSL with CLIP: Images arrive sequentially in a streaming manner, and each image is predicted immediately without storage.

While existing test-time adaptation (TTA) methods try to refine visual or text representations on the fly, they overlook a critical bottleneck: label shift. Label shift occurs when the prior probability distribution of the labels in the target test stream differs from the source distribution the model implicitly learned during pre-training. This mismatch leads to highly biased predictions. The authors address this gap by framing online zero-shot classification as a domain adaptation problem specifically focused on label shift correction.

Methods

The authors propose Label Shift Aware (LSA), a lightweight, modular framework that requires zero parameter updates to the CLIP backbone. It consists of three core components:

  1. LSA Weight Generation (EM-Based Estimator): LSA treats the target label distribution as an unknown parameter ($\pi$). Assuming the original pre-training source distribution was roughly uniform, it utilizes an Expectation-Maximization (EM) algorithm to iteratively estimate the true test-time label distribution based purely on the model's streaming predictions.
  2. Active Prior Adaptation: Early in a data stream, distribution estimates suffer from high variance due to a lack of samples. LSA introduces a time-dependent hyperparameter ($\lambda_t$) that linearly scales up the influence of the streaming data over time. Early on, it relies on prior knowledge; as more data arrives, it shifts trust toward the empirical streaming distribution.
  3. LSA Classifier Correction: Once the target label distribution ($\pi$) is estimated, LSA applies a posterior adjustment mechanism. It reweights CLIP's raw predicted class probabilities by dividing them by the estimated target priors, effectively neutralizing the bias caused by the distribution shift.

Datasets

The framework was extensively evaluated on 14 diverse datasets spanning general classification, fine-grained recognition, texture classification, and scene understanding:

  • General & Fine-Grained: ImageNet, Aircraft, Caltech, Cars, Cifar10, Cifar100, CUB (birds), Flowers, Food, Pets.
  • Specialized Domains: DTD (textures), EuroSAT (satellite imagery), SUN (scenes), UCF101 (action recognition video frames).

No new benchmarks were introduced; the authors adhered to the standard evaluation protocols established in prior online ZSL literature to ensure a fair comparison.

Key Insights and Ideas

  • Label Shift is the Real Culprit: While most literature focuses on fixing covariate shift (changes in how the images look), this paper argues that for massive foundation models like CLIP, the visual space is already well-covered. The primary degradation in streaming environments actually stems from label shift (changes in category frequency).
  • No Optimization Required: Traditional test-time adaptation often relies on backpropagation or prompt tuning, which can be computationally heavy for edge devices. LSA proves that simply adjusting the output probability distribution mathematically is faster, cheaper, and highly effective.
  • The Importance of a Dynamic Prior: A static prior estimation fails in streaming setups because early predictions are noisy. The "Active Prior Adaptation" component acts as a stabilizer, preventing the model from overcorrecting when it has only seen a handful of images.

Key Results

LSA was tested across five different CLIP backbones (ranging from ResNet-50 to ViT-L/14@336px) and consistently yielded improvements:

  • ImageNet Gains: On the standard ImageNet benchmark, LSA boosted the top-1 accuracy of a baseline ResNet-50 model from 60.30% to 62.86% (+2.56%) and a ViT-B/16 model from 68.81% to 71.30% (+2.49%).
  • Synergy with Existing Methods: Because LSA is modular, it can be stacked on top of other online ZSL methods. Combining LSA with OnZeta (a state-of-the-art prompt alignment method) yielded the highest performance, improving average accuracy across 13 datasets by 3.16% for ResNet-50 and 1.94% for ViT-B/16.

The performance margin was more pronounced on smaller/mid-sized backbones, showing that LSA is particularly valuable for boosting the robustness of lightweight models suited for edge deployment.

Limitations and Future Work

Not discussed in the paper.

Summary updated

BibTeX
@misc{han2026label,
  author = {Pengxiao Han and Changkun Ye and Yanshuo Wang and Jinguang Tong and Miaohua Zhang and Xuesong Li and Jie Hong and Lars Petersson},
  title = {{Label Shift Aware Adaptation for Online Zero-shot Learning with Contrastive Language-Image Pre-Training (CLIP)}},
  year = {2026},
  eprint = {2606.15169},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.15169},
}
Figure