Introduction
Pre-trained vision-language models (VLMs) like CLIP have demonstrated remarkable "zero-shot" capabilities, classifying images into categories without explicit training. However, their performance often degrades when encountering "out-of-distribution" (OOD) data—such as specialized medical or satellite imagery. Existing Test-Time Adaptation (TTA) methods typically focus on "Likelihood Adaptation," updating text-based class embeddings to match incoming visual features. This paper argues that such approaches ignore a critical component of Bayesian inference: the class prior.
The Importance of the Prior
In a changing environment, the likelihood of a specific class appearing shifts. For example, a model trained to associate "fever" with a "cold" will fail during a pandemic where "fever" more likely indicates "COVID-19." Bayesian Class Adaptation (BCA) addresses this by dynamically updating class expectations alongside feature prototypes.
Methodology: Bayesian Class Adaptation (BCA)
BCA introduces a dual-updating mechanism that is entirely backpropagation-free, making it significantly more efficient than gradient-based methods. The framework consists of three main stages:
- Embedding: Generating initial visual and text features using pre-trained encoders.
- Likelihood Adaptation: Updating class prototypes (embeddings) using a running statistical mean of high-confidence incoming visual features.
- Prior Adaptation: Maintaining a dynamic prior for each class based on the model's posterior predictions. This allows the model to learn which classes are more prevalent in the current test stream.
By avoiding expensive gradient descent and using simple moving averages, BCA achieves real-time adaptation with minimal computational overhead.
Key Results and Performance
The researchers evaluated BCA across major OOD benchmarks (ImageNet-A, R, S, V2) and ten cross-domain datasets (e.g., Aircraft, EuroSAT).
- Accuracy: BCA achieved 61.81% accuracy on ImageNet OOD benchmarks, outperforming the previous state-of-the-art (TDA) and the baseline CLIP model.
- Efficiency: BCA is approximately 5x faster than TDA and over 200x faster than backpropagation-based methods like TPT. On ImageNet, adaptation was completed in just 2.42 minutes.
- Resource Management: The method is highly memory-efficient, requiring only 757MB of GPU memory, compared to the 21GB+ required by TPT, making it ideal for edge devices.
Conclusion
Bayesian Class Adaptation demonstrates that the class prior is a vital, yet often overlooked, factor in test-time adaptation. By synergizing likelihood and prior updates in a backpropagation-free framework, BCA provides a high-performance, resource-efficient solution for deploying vision-language models in dynamic, real-world environments. Future work may involve extending this Bayesian framework to more complex tasks like object detection and segmentation.
Summary updated