TL;DR
Medical vision-language models (VLMs) frequently fail to spot out-of-distribution (OOD) inputs caused by "covariate shifts" (such as a new imaging device), often performing no better than random guessing. PROTON fixes this blind spot at test-time by maintaining an online bank of high-confidence image prototypes and dynamically fusing embedding-space distances with standard confidence scores based on real-time stream variance. It requires zero training data, zero model modifications, and adds a negligible memory footprint (~0.4 MB).
What Problem Does This Paper Address?
When medical vision-language models (VLMs) are deployed in the real world, they inevitably encounter out-of-distribution (OOD) data. This can range from completely unrelated images (far-OOD) to unexpected pathologies (semantic shifts) or images taken with entirely different camera hardware (covariate shifts).
While current static OOD detection methods handle far-OOD data reasonably well, they completely fall apart on covariate shifts. For instance, a model trained on standard fundus images might achieve a near-random 42.4% AUROC when evaluating ultra-wide-field fundus images.
The authors trace this failure to a structural mismatch in how VLMs process data. In the VLM's raw embedding space, covariate-shifted images occupy distinct, separate clusters from in-distribution (ID) data. However, when these embeddings are passed through a softmax layer to compute standard confidence scores (like Maximum Concept Matching, or MCM), this geometric separation collapses. The model outputs highly confident—but entirely wrong—predictions, creating a dangerous blind spot for clinical deployment.
Methods
To exploit the hidden geometric signals in the embedding space without retraining the VLM, the authors introduce PROTON (PROtotype-based Test-time ONline OOD detection). It operates entirely post-hoc on a frozen VLM using three lightweight components:
- Online Prototype Bank: As unlabeled images arrive sequentially in a test stream, PROTON keeps a running first-in, first-out (FIFO) queue of the most recent image embeddings for each class. To prevent OOD data from polluting these prototypes, a confidence gate ($\gamma$) ensures only highly confident ID predictions are added to the bank.
- Prototype Distance Score: For every new test image, PROTON calculates its cosine distance to the nearest class prototype in the raw embedding space. If an image is far from all known prototypes, it is flagged as potentially OOD.
- Variance-Driven Adaptive Fusion: Instead of relying on a fixed combination of the standard softmax score (MCM) and the new prototype distance score, PROTON dynamically adjusts their weights. Using Welford’s online algorithm, it tracks the running variance of the incoming stream's confidence scores. If the variance spikes—a telltale sign of a covariate shift—the system automatically downweights the unreliable softmax score and trusts the embedding-space prototype distance instead.
Datasets
The authors evaluated PROTON across three distinct medical imaging modalities:
- Ophthalmology (Primary Benchmark): Built on the FIVES dataset using the FLAIR VLM. In-distribution classes consisted of Normal and Diabetic Retinopathy. OOD data included Semantic shifts (Glaucoma and AMD), Covariate shifts (Ultra-Wide-Field fundus images), and Far-OOD (ImageNet).
- Radiology: Evaluated using UniMedCLIP on the RSNA dataset (Normal vs. Pneumonia).
- Pathology: Evaluated using QuiltNet on a PCam-derived dataset (Benign vs. Malignant).
Key Insights and Ideas
- Softmax is a Geometric Compressor: The core "aha moment" is realizing that softmax normalization discards crucial spatial distance information. Covariate-shifted data looks identical to ID data in probability space but remains completely distinct in embedding space.
- The Test Stream is its Own Supervisor: You don't need labeled validation data to adapt to a deployment environment. By simply tracking the statistical variance of the model's own outputs over time, the system can infer what kind of distribution shift it is currently experiencing.
- Rapid, Training-Free Convergence: The online prototypes don't require a lengthy warm-up phase. The authors show that the prototypes stabilize and converge within the first 55 to 80 samples of the stream, making the approach viable for immediate deployment.
Key Results
PROTON consistently outperforms existing static zero-shot OOD detectors across all shift types, without requiring complex hierarchical prompt engineering or labeled data:
- Massive Covariate Gains: On the ophthalmology benchmark, PROTON improves vanilla MCM by +23.9 AUROC on covariate shifts. It also boosts performance on semantic shifts (+8.8) and far-OOD (+8.1).
- Cross-Domain Generalization: The effect is highly robust across modalities, yielding an incredible +45.7 AUROC improvement in Radiology and +38.9 AUROC in Pathology for covariate shifts.
- Negligible Overhead: Because it relies on simple streaming statistics and small FIFO queues, PROTON requires no gradients or backpropagation. It consumes only about 0.4 MB of memory, making it exceptionally lightweight.
Limitations and Future Work
- Stream Composition Dependency: PROTON assumes that the incoming test stream contains at least a small fraction of In-Distribution (ID) samples to seed and maintain the prototype bank. While the authors proved the method remains robust even when the stream is down to just 10% ID data, performance could degrade if a stream is entirely OOD from the very first sample.
- Heuristic Fusion: The adaptive fusion mechanism relies on a closed-form sigmoid function based on stream variance. The authors note that replacing this with a learned gating mechanism could yield further performance gains, though it would sacrifice the current parameter-free design.
- Shift Triage: Because PROTON decouples embedding distance from softmax confidence, future work can leverage these two distinct signals to explicitly categorize why an image is out-of-distribution (e.g., routing a covariate shift for image re-acquisition vs. routing a semantic shift to a medical specialist).
Summary updated