CLASP: Complementary Layer Selection and Profiling for Zero-Shot OOD Detection using Vision-Language Models
Organizations: Pattern Recognition Lab, Friedrich-Alexander-Universität Erlangen-Nürnberg · Artificial Intelligence in Biomedical Engineering, Friedrich-Alexander-Universität Erlangen-Nürnberg · Siemens Healthineers, Erlangen, Germany
Abstract
Vision-language models (VLMs) enable zero-shot out-of-distribution (OOD) detection in medical imaging, yet existing approaches often rely on final-layer confidence or entropy-based layer selection, potentially missing complementary information. We show that low in-distribution (ID) confidence entropy does not reliably predict OOD discrimination. We introduce CLASP (Complementary Layer Selection and Profiling), an ID-only framework that jointly models layer--prompt responses and visual features. CLASP ranks visual encoder layers using Gaussian conditional mutual information and selects a compact subset through anchored spectral selection, without fixing the number of layers. It then combines the selected layer--prompt profiles with PCA-compressed visual embeddings and fits a single shrinkage-regularized Gaussian. OOD scores are computed using squared Mahalanobis distance, without fine-tuning, OOD training data, or test-time adaptation. Across histopathology, chest X-ray, and brain MRI benchmarks with UniMedCLIP and BioMedCLIP, CLASP performs strongly under varied distribution shifts. On MIDOG near-OOD, it achieves 87.54% AUROC with UniMedCLIP, outperforming confidence-based baselines; with BioMedCLIP, it remains competitive but trails visual-only Mahalanobis modeling. Ablations highlight the value of layer--prompt interactions and cross-feature dependencies, while exposing shift-dependent contributions and limitations under semantic shifts.
Figures & tables
| Method | Explicit class- identity use | Ext. OOD | Additional Training | UniMedCLIP | BioMedCLIP | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Near-OOD | Far-OOD | Near-OOD | Far-OOD | ||||||||
| AUROC | FPR@95 | AUROC | FPR@95 | AUROC | FPR@95 | AUROC | FPR@95 | ||||
| MCM [ 21 ] | ✗ | ✗ | ✗ | 47.25 | 91.95 | 81.64 | 51.56 | 40.08 | 97.61 | 36.95 | 100.00 |
| SRE [ 20 ] | ✗ | ✗ | ✗ | 29.10 | 99.70 | 97.10 | 16.60 | 32.10 | 97.30 | 99.80 | 1.30 |
| MRE [ 25 ] | ✗ | ✗ | ✗ | 54.60 | 94.40 | 97.40 | 13.40 | 36.40 | 100.00 | 99.50 | 2.70 |
| GL-MCM [ 23 ] | ✗ | ✗ | ✗ | 47.53 | 92.98 | 81.29 | 53.31 | 42.19 | 96.55 | 54.27 | 97.08 |
| Backbone | Method | Chest X-ray: L1 (2 ID prompts) | Chest X-ray: L5 (8 ID prompts) | Brain MRI | ||||
| Semantic | Covariate | Far-OOD | Semantic | Covariate | Far-OOD | Near-OOD | ||
| UniMedCLIP | MCM [ 21 ] | 54.20/89.67 | 46.76/87.50 | 27.56/99.67 | 54.18/ 77.50 | 78.43/46.50 | 84.62/43.00 | 38.90/100.00 |
| SRE [ 20 ] | 64.32/87.50 | 20.17/99.67 | 82.81/86.33 | 59.51/89.00 | 93.10/30.33 | 100.00 / 0.00 | 11.50/100.00 | |
| MRE [ 25 ] | 64.32/87.50 | 20.17/99.67 | 82.81/86.33 | 60.37/89.75 | 88.25/48.08 | 100.00 / 0.00 | 15.20/100.00 | |
| GL-MCM [ 23 ] | 55.36/92.83 | 47.71/91.00 | 33.18/99.33 | 54.46/79.33 | 81.18/55.33 | 91.52/34.00 | 40.40/95.00 | |
| PROTON+ [ 3 ] | 61.39/88.13 | 93.88/29.00 | 91.52/37.93 | 49.90/92.13 | 88.50/36.53 | 96.86/9.53 | 35.90/100.00 | |
| Ranking criterion | MIDOG near | Chest L5 semantic | ||
|---|---|---|---|---|
| Selected layers | AUROC/FPR@95 | Selected layers | AUROC/FPR@95 | |
| Gaussian Visual CMI (ours) | 87.54 / 30.88 | 65.40/ 87.83 | ||
| Entropy ordering | 80.31/51.43 | 63.24/88.33 | ||
| Conditional covariance | 85.14/36.73 | 65.54 /88.17 | ||
| Marginal visual MI | 78.70/55.67 | 63.24/88.33 | ||
| Covariance model | MIDOG near | Chest L5 semantic |
|---|---|---|
| Full Ledoit–Wolf covariance (ours) | 87.54 / 30.88 | 65.40 / 87.83 |
| Diagonal covariance | 80.16/49.82 | 58.24/92.83 |
| Identity covariance | 80.16/49.82 | 58.24/92.83 |
| Benchmark | Reference layers | Agreement (%) | Jaccard | AUROC/FPR@95 |
|---|---|---|---|---|
| MIDOG near | 50.00 | 0.72 | / | |
| Chest L5 semantic | 30.00 | 0.54 | / |
OOD Detection
Out-of-distribution (OOD) detection identifies inputs unlike a model’s training data so systems can flag uncertainty, reject inputs, or adapt safely.
See all 248 papers