Abstract
Vision-Language Models (VLMs) like CLIP and Grounding DINO demonstrate impressive zero-shot capabilities but often suffer from performance degradation under real-world distribution shifts. This paper introduces BCA+ (Bayesian Class Adaptation plus), a unified, training-free framework designed to adapt VLMs to new data distributions during inference. By treating adaptation as a Bayesian inference problem and maintaining a dynamic cache of historical predictions, BCA+ corrects model errors by updating both feature likelihoods and class priors. BCA+ achieves state-of-the-art performance on recognition and detection benchmarks while being significantly faster and more memory-efficient than backpropagation-based methods.
Introduction: The Challenge of Distribution Shifts
While VLMs are powerful, they are often "brittle" when deployed in specific environments—such as foggy weather or stylized domains—where data distributions differ from the training set. Existing Test-Time Adaptation (TTA) methods typically face two hurdles: high computational costs due to backpropagation and a failure to account for shifting class priors.
Most training-free methods focus solely on feature similarity (likelihood) but ignore the prior—the overall distribution of classes in the current environment. For instance, in a medical context, the likelihood of a "COVID-19" diagnosis should increase during a pandemic even if symptoms overlap with a common cold. BCA+ addresses this by dynamically updating class priors alongside feature representations.
Methodology: The BCA+ Framework
BCA+ operates as a closed-loop, three-stage process for every incoming image, requiring no gradient updates or fine-tuning.
- VLM Inference: A pre-trained model (CLIP for recognition or Grounding DINO for detection) generates initial predictions, visual features, and bounding boxes.
- Bayesian Inference with a Dynamic Cache: The system maintains a dynamic cache storing averaged class embeddings, spatial scales, and adaptive class priors derived from past high-confidence predictions. It calculates a "cache-based" prediction by combining feature/scale likelihood with the evolving prior.
- Uncertainty-Guided Fusion: The initial VLM prediction and the cache-based prediction are fused using an entropy-based weighting scheme, prioritizing the more confident prediction.
- Cache Update: High-confidence final predictions are used to refine existing cache entries or create new ones for novel patterns.
Experimental Evaluation
The authors evaluated BCA+ across rigorous benchmarks for both recognition and detection.
Object Recognition
On the ImageNet Out-of-Distribution (OOD) benchmark (including ImageNet-A, -V2, -R, and -S), BCA+ achieved an average accuracy of 50.53% (using ResNet-50), outperforming the previous state-of-the-art training-free method (BCA) and the baseline CLIP by over 4%.
Object Detection
On the COCO-C benchmark, which features 15 types of corruptions, BCA+ reached 25.06% mAP50 (Swin-T), significantly surpassing the Grounding DINO baseline (21.61%) and other TTA methods like TDA (23.00%).
Efficiency
BCA+ is remarkably efficient. For ImageNet recognition, it is approximately 200x faster than backpropagation-based methods like TPT (2.89 mins vs. 572.13 mins) and uses 26x less memory.
Conclusion and Key Insights
BCA+ demonstrates that adapting the class prior is as critical as adapting features for robust test-time performance. By treating object recognition as a simplified case of detection, the framework provides a unified solution for diverse vision tasks. While performance can be sensitive to the initial sequence of test samples and requires some hyperparameter tuning, its training-free nature makes it a highly practical "plug-and-play" module for real-time VLM deployment. Future work may extend this Bayesian approach to video-based tasks to leverage temporal consistency.
Summary updated