TL;DR
Vision-language models like CLIP are magic at recognizing things they’ve never been explicitly trained on, right up until you show them something completely outside their category list—and they confidently guess anyway. This paper shows why raw confidence scores fail to catch out-of-distribution (OOD) inputs, and introduces SROT, a lightweight test-time adaptation loop that uses optimal transport to clean up a model's probability guesses on the fly. Without touching the massive backbone weights or needing a single label, it teaches the model when to say, "I don't know."
What Problem Does This Paper Address?
Imagine deploying a zero-shot vision-language model (VLM) to spot wildlife. You give it text prompts for "deer," "bear," and "fox." What happens when a dirt bike drives past the camera? Ideally, the model flags it as out-of-distribution (OOD).
In traditional supervised classifiers, OOD detection is straightforward: check the model's maximum confidence score. Familiar in-distribution (ID) images get high scores; alien OOD images get low scores. You pick a threshold, and you're done.
In zero-shot VLMs, this breaks down. Because VLMs are pre-trained on noisy, web-scale data rather than optimized for your specific classes, their raw confidence distributions for ID and OOD samples overlap heavily. The authors prove theoretically (modeling VLM confidence as a distorted Markov-kernel transformation of an ideal supervised reference) that no matter how cleverly you pick a threshold, raw VLM confidence hits a fundamental "confidence bottleneck."
However, looking past single confidence numbers reveals a clue: while zero-shot VLMs assign unstable confidences across individual classes, the overall matrix of probabilities across a batch of images still holds rich structural clues. How do we unlock that structure at test time without labels?
Methods
Enter SROT (Self-Reinforced Optimal Transport), a label-free test-time adaptation (TTA) framework that keeps the VLM completely frozen and operates in three self-reinforcing steps:
- Optimal-Transport (OT) Rectification: When an unlabeled mini-batch arrives, SROT looks at the entire batch-by-class probability matrix. VLMs often have pre-training biases—say, over-predicting "cat" for everything. Using entropic Optimal Transport (solved rapidly via Sinkhorn iterations), SROT redistributes probability mass across the batch to match a balanced class prior while respecting image-text similarities. Genuine ID samples keep sharp probability peaks; OOD samples flatten out.
- Lightweight Detector Training: Posterior cleanup alone only looks at text-prompt probabilities, missing raw visual regularities. SROT converts the OT-rectified scores into binary pseudo-labels (ID vs. OOD) by dynamically finding a threshold that minimizes within-group variance (similar to Otsu's method in image processing) over a sliding window. These pseudo-labels train a tiny linear layer on top of the frozen VLM image features.
- The Self-Reinforcing Loop: Once the linear detector learns what OOD features look like, its OOD probability predictions are mixed back into the CLIP posteriors to update the OT cost matrix for future batches. Distribution-level math guides feature-level learning, which in turn refines the distribution math.
Datasets
Because SROT is strictly zero-shot and adapts at test time, there is no training dataset—only test streams mixing ID and OOD images:
- In-Distribution (ID): Four fine-grained benchmarks (CUB-200-2011, Stanford Cars, Food-101, Oxford-IIIT Pet) plus ImageNet and four distribution-shifted variants (ImageNet-Sketch, ImageNet-A, ImageNet-V2, ImageNet-R).
- Out-of-Distribution (OOD): Four standard open-world benchmarks: iNaturalist, LSUN, Textures, and Places. No new datasets are introduced.
Key Insights and Ideas
- It’s the signal, not the threshold: Zero-shot VLM OOD detection doesn't fail because we haven't found the right cutoff number; it fails because pre-training biases warp class-wise confidence. You have to reshape the full posterior distribution before thresholding.
- Batch-level context beats sample-level myopia: Looking at one image in isolation makes it hard to spot VLM bias. Enforcing a neutral, balanced class prior across a batch via Optimal Transport naturally strips away systematic overconfidence on OOD inputs.
- Feedback loops prevent TTA collapse: Standard test-time adaptation methods (like minimizing entropy) often make models more confidently wrong when hit with OOD data. Tying OT rectification strength to a feature-based OOD detector keeps calibration honest.
Key Results
SROT achieves state-of-the-art performance across all nine ID benchmarks (using a ViT-B/16 CLIP backbone). To ensure adaptation doesn't cheat by rejecting everything, the authors measure ID classification accuracy ($\text{Acc}_\text{S}$), OOD rejection accuracy ($\text{Acc}_\text{N}$), and their harmonic mean ($\text{Acc}_\text{H}$):
- Averaged across all nine ID datasets, SROT beats the strongest prior TTA baseline (AdaND) by +2.52% in $\text{Acc}_\text{H}$ (+1.81% in $\text{Acc}_\text{S}$ and +4.07% in $\text{Acc}_\text{N}$).
- On tough shifted datasets like ImageNet-K (Sketch), $\text{Acc}_\text{H}$ jumps from 53.77% (AdaND) to 61.42%.
- On classic OOD metrics (ImageNet as ID), SROT reaches 98.40% AUROC and slashes the false positive rate (FPR95) down to 6.60%—nearly cutting the strongest baseline's error rate (16.00%) by more than half.
- Ablations on CUB-200-2011 show removing OT drops $\text{Acc}_\text{H}$ from 70.07% to 66.37%, while removing the self-reinforcing feedback loop drops it to 69.12%.
Limitations and Future Work
Not explicitly discussed in a dedicated section of the paper. However, the authors note two practical nuances in the text: first, on datasets that are already very easy for zero-shot CLIP (like Food-101), performance saturates and gains over baselines shrink (0.1–0.4% $\text{Acc}_\text{H}$). Second, SROT defaults to a uniform class prior for Optimal Transport when label distributions are unknown—though if a user knows their deployment environment has skewed class frequencies, that prior can be plugged directly into the transport plan.
Summary updated