SpatialUQ: Post-Hoc Uncertainty Quantification from Spatial Consistency in Black-Box Vision Models
Organizations: NPI University of Bangladesh · Towson University · University of Asia Pacific
Abstract
Clinical vision models are often deployed as frozen black boxes with no access to internals, retraining, or ground truth at inference time. We introduce \textbf{SpatialUQ}, a post-hoc uncertainty method using only output probabilities. It measures the Jensen-Shannon divergence between the global prediction and the mean of five fixed spatial crops in six deterministic forward passes. The premise is simple, trustworthy predictions are spatially consistent. On NIH ChestX-ray14 (DenseNet-121, ), our Multicrop Uncertainty Score (MUS) reaches failure-detection AUC versus for MC-Dropout () at one-fifth the compute, with native calibration ( vs.\ for ), the best-calibrated among methods above 0.78 AUC. A supervised fusion of MUS with entropy, confidence, and reaches , outperforming a five-member ensemble (). MUS scales with model quality, reaching with BiomedCLIP (), while this relationship remains meaningful in-distribution () but breaks down under severe distribution shift (VinBigData, ). MUS is well-suited to diffuse findings but is less dependable for small focal lesions such as nodules. Code and experimental materials are publicly available at https://huggingface.co/datasets/kawsher11/SpatialUQ.
Figures & tables
| Method | AUC | 95% CI | SCE |
|---|---|---|---|
| Fusion (CV) | 0.832 | [0.827, 0.837] | 0.246 |
| Deep Ensemble | 0.813 | [0.808, 0.819] | 0.138 |
| Distance | 0.790 | [0.785, 0.796] | 0.127 |
| MUS (Unsupervised) | 0.784 | [0.778, 0.789] | 0.049 |
| Deep Ens + T-scaling | 0.774 | [0.768, 0.780] | 0.090 |
| ODIN | 0.759 | [0.752, 0.765] | 0.484 |
| Removed Feature | AUC | |
|---|---|---|
| Entropy | 0.788 | 0.044 |
| Distance | 0.825 | 0.007 |
| MUS | 0.827 | 0.005 |
| Confidence | 0.831 | 0.001 |
| Dataset | MUS AUC | Fusion AUC | MC-Dropout AUC | Spearman |
|---|---|---|---|---|
| NIH (in-dist.) | 0.784 | 0.832 | 0.664 | 0.523 |
| CheXpert (zero-shot) | 0.708 | 0.733 | 0.599 | 0.298 |
| VinBigData (zero-shot) | 0.614 | 0.750 | 0.764 | 0.027 |
| Dataset | Model | Top-1 Acc. | MUS | Confidence -1 | Entropy | Fusion | Spearman |
|---|---|---|---|---|---|---|---|
| ImageNet | EfficientNet-B4 | 79.27% | 0.717 | 0.913 | 0.896 | 0.917 | 0.392 |
| ImageNet | ViT-B/16 | 81.07% | 0.710 | 0.923 | 0.884 | 0.937 | 0.341 |
| ImageNet | ConvNeXt-Tiny | 82.13% | 0.641 | 0.913 | 0.819 | 0.936 | 0.139 |
| COCO | Faster R-CNN | - | 0.800 | 0.602 | 0.884 | 0.885 | 0.613 |
| COCO | RetinaNet | - | 0.747 | 0.702 | 0.912 | 0.913 | 0.510 |
| Method | AUC | Passes | Internals | Train data | Retrain | Frozen ckpt? |
|---|---|---|---|---|---|---|
| Fusion (Ours) | 0.832 | 6 + logistic reg | ✗ | ✗ | ✗ | ✓ |
| Deep Ensemble ( Lakshminarayanan et al., 2017 ) | 0.813 | model | ✗ | ✗ | ✓ | ✗ |
| MUS (Ours) | 0.784 | 6 | ✗ | ✗ | ✗ | ✓ |
| Deep Ensemble + T-scaling | 0.774 | model+cal | ✗ | ✓ | ✓ | ✗ |
| ODIN ( Liang et al., 2017 ) | 0.759 | 1+grad | ✓ | ✗ | ✗ | ✓ |
| DDU † ( Mukhoti et al., 2021 ) | 0.754 | 1 | ✓ | ✓ | ✗ | ✗ |
Appendix figures & tables38 assets
Supplementary material from the paper’s appendix.
Appendix
| Class | AUC | Brier | AP |
|---|---|---|---|
| Atelectasis | 0.7628 | 0.3189 | 0.3272 |
| Cardiomegaly | 0.8746 | 0.5565 | 0.3350 |
| Effusion | 0.8192 | 0.3081 | 0.4907 |
| Infiltration | 0.6984 | 0.3161 | 0.3969 |
| Mass | 0.7965 | 0.3576 | 0.2915 |
| Nodule | 0.7400 | 0.3869 | 0.2191 |
| Class | AUC | Brier | AP |
|---|---|---|---|
| Atelectasis | 0.7192 | 0.3321 | 0.2732 |
| Cardiomegaly | 0.7952 | 0.5746 | 0.2118 |
| Effusion | 0.7740 | 0.3250 | 0.4189 |
| Infiltration | 0.6790 | 0.3102 | 0.3733 |
| Mass | 0.7002 | 0.4114 | 0.1591 |
| Nodule | 0.6941 | 0.4039 | 0.1520 |
| Class | AUC | Brier | AP |
|---|---|---|---|
| Atelectasis | 0.7689 | 0.2882 | 0.3399 |
| Cardiomegaly | 0.8868 | 0.5685 | 0.3500 |
| Effusion | 0.8257 | 0.3037 | 0.5059 |
| Infiltration | 0.6978 | 0.3029 | 0.3983 |
| Mass | 0.8157 | 0.3817 | 0.3176 |
| Nodule | 0.7502 | 0.3712 | 0.2230 |
| Method | AUC | 95% CI | SCE |
|---|---|---|---|
| Fusion CV (MUS+Ent+Conf+ ) | 0.8319 | [0.8268, 0.8368] | 0.2464 |
| Auditor (3-feat MLP) | 0.8250 | [0.8201, 0.8299] | 0.2408 |
| Auditor (6-feat MLP) | 0.8242 | [0.8189, 0.8292] | 0.2363 |
| Deep Ensemble (5-member) | 0.8130 | [0.8077, 0.8187] | 0.1379 |
| Distance | 0.7902 | [0.7848, 0.7960] | 0.1270 |
| MUS (Ours) | 0.7837 | [0.7778, 0.7893] | 0.0487 |
| Seed | MUS AUC | Dist. | MC-Drop | Conf -1 | TTA Var | Entr. | Pair JSD |
|---|---|---|---|---|---|---|---|
| 42 | 0.7837 | 0.7902 | 0.6643 | 0.4011 | 0.5837 | 0.1774 | 0.6057 |
| 186 | 0.7866 | 0.7959 | 0.6466 | 0.5802 | 0.5723 | 0.1748 | 0.6023 |
| 456 | 0.7902 | 0.7976 | 0.6532 | 0.5816 | 0.5856 | 0.1672 | 0.5709 |
| 789 | 0.7862 | 0.7914 | 0.6498 | 0.5788 | 0.5797 | 0.1681 | 0.5806 |
| 1011 | 0.7826 | 0.7844 | 0.6536 | 0.5737 | 0.5848 | 0.1688 | 0.5660 |
| Mean | 0.7859 | 0.7919 | 0.6535 | 0.5431 | 0.5812 | 0.1713 | 0.5851 |
| Method | CLIP ViT-B/32 | BiomedCLIP | ||
|---|---|---|---|---|
| AUC [95% CI] | SCE | AUC [95% CI] | SCE | |
| MUS (SpatialUQ) | 0.825 [0.818, 0.830] | 0.098 | 0.899 [0.895, 0.903] | 0.133 |
| Entropy | 0.204 [0.199, 0.210] | 0.574 | 0.394 [0.387, 0.402] | 0.421 |
| Confidence -1 | 0.095 [0.092, 0.099] | 0.429 | 0.206 [0.201, 0.212] | 0.334 |
| Distance | 0.837 [0.831, 0.842] | 0.115 | 0.915 [0.911, 0.918] | 0.232 |
| Fusion | 0.883 [0.879, 0.887] | 0.234 | 0.925 [0.922, 0.928] | 0.278 |
| Method | AUC | 95% CI | SCE |
|---|---|---|---|
| Fusion CV (MUS+Ent+Conf+ ) | 0.8714 | [0.8675, 0.8756] | 0.2713 |
| MUS (Ours) | 0.7842 | [0.7777, 0.7900] | 0.0666 |
| Mahalanobis | 0.7804 | [0.7747, 0.7863] | 0.3243 |
| Distance | 0.7746 | [0.7683, 0.7809] | 0.0873 |
| ODIN | 0.7682 | [0.7622, 0.7742] | 0.2185 |
| Max Disagreement | 0.6722 | [0.6644, 0.6794] | 0.1391 |
| Method | AUC | 95% CI | SCE |
|---|---|---|---|
| Fusion CV (MUS+Ent+Conf+ ) | 0.8314 | [0.8265, 0.8363] | 0.2662 |
| ODIN | 0.8003 | [0.7945, 0.8062] | 0.4059 |
| MUS (Ours) | 0.7497 | [0.7435, 0.7563] | 0.0455 |
| Distance | 0.7324 | [0.7255, 0.7390] | 0.1412 |
| Mahalanobis | 0.7282 | [0.7223, 0.7344] | 0.2030 |
| Max Disagreement | 0.7084 | [0.7019, 0.7154] | 0.1545 |
| Architecture | Upsample AUC | Mask AUC | |
|---|---|---|---|
| DenseNet-121 | 0.7837 | 0.7697 | |
| EfficientNet-B4 | 0.7791 | 0.5540 | |
| ViT-B/16 | 0.7421 | 0.7465 |
| Method | AUC | 95% CI | SCE | Spearman |
|---|---|---|---|---|
| Fusion | 0.838 | [0.832, 0.843] | 0.069 | - |
| MUS (SpatialUQ) | 0.533 | [0.526, 0.541] | 0.202 | 0.187 |
| Distance | 0.533 | [0.525, 0.541] | 0.120 | - |
| Entropy | 0.242 | [0.236, 0.248] | 0.723 | - |
| Confidence -1 | 0.166 | [0.160, 0.171] | 0.572 | - |
| Class | Backbone AUC | JSD AUC | N Pos |
|---|---|---|---|
| Pneumonia | 0.7020 | 0.9789 | 555 |
| Edema | 0.8368 | 0.9710 | 925 |
| Consolidation | 0.7401 | 0.9564 | 1,815 |
| Pleural_Thickening | 0.7569 | 0.9496 | 1,143 |
| Cardiomegaly | 0.8746 | 0.9518 | 1,069 |
| Atelectasis | 0.7628 | 0.9145 | 3,279 |
| Class | Backbone AUC | JSD AUC |
|---|---|---|
| Pneumonia | 0.6589 | 0.89 |
| Edema | 0.8093 | 0.88 |
| Nodule | 0.6941 | 0.8822 |
| Consolidation | 0.7022 | 0.87 |
| Pleural_Thickening | 0.7201 | 0.86 |
| Cardiomegaly | 0.7952 | 0.86 |
| Class | Backbone AUC | JSD AUC |
|---|---|---|
| Pneumonia | 0.7111 | 0.88 |
| Edema | 0.8359 | 0.87 |
| Cardiomegaly | 0.8868 | 0.85 |
| Consolidation | 0.7521 | 0.84 |
| Pleural_Thickening | 0.7622 | 0.83 |
| Atelectasis | 0.7689 | 0.81 |
| Class | JSD AUC |
|---|---|
| Pneumonia | 0.9678 |
| Pleural_Thickening | 0.9675 |
| Consolidation | 0.9589 |
| Atelectasis | 0.9218 |
| Cardiomegaly | 0.9216 |
| Pneumothorax | 0.9149 |
| Class | JSD AUC |
|---|---|
| Atelectasis | 0.9467 |
| Infiltration | 0.9222 |
| Pneumothorax | 0.9181 |
| Cardiomegaly | 0.8845 |
| Pleural_Thickening | 0.6678 |
| Effusion | 0.4229 |
| Crops | MUS AUC | Forward Passes |
|---|---|---|
| 3 | 0.7764 | 4 |
| 4 | 0.7859 | 5 |
| 5 | 0.7837 | 6 |
| 6 | 0.7801 | 7 |
| 7 | 0.7816 | 8 |
| 9 | 0.7902 | 10 |
| Method | AUC@50th | AUC@75th | AUC@90th |
|---|---|---|---|
| Random | 0.4985 | 0.4979 | 0.4960 |
| Confidence -1 | 0.4079 | 0.4011 | 0.3886 |
| Entropy | 0.1936 | 0.1774 | 0.1319 |
| Patch Variance | 0.6045 | 0.6103 | 0.6236 |
| Pairwise Disagr. | 0.5910 | 0.5990 | 0.6124 |
| Pairwise JSD | 0.5997 | 0.6057 | 0.6184 |
| Removed Feature | Fusion AUC | |
|---|---|---|
| Entropy | 0.7881 | 0.0437 |
| Distance | 0.8248 | 0.0071 |
| MUS | 0.8265 | 0.0053 |
| Confidence | 0.8309 | 0.0010 |
| Removed Feature | Fusion AUC | |
|---|---|---|
| Entropy | 0.7534 | 0.0780 |
| Distance | 0.8292 | 0.0022 |
| MUS | 0.8299 | 0.0015 |
| Confidence | 0.8328 | 0.0014 |
| Model | Removed | LOO AUC | |
|---|---|---|---|
| ConvNeXt-Tiny | Confidence | 0.8422 | 0.0934 |
| ConvNeXt-Tiny | Entropy | 0.9217 | 0.0139 |
| ConvNeXt-Tiny | MUS | 0.9322 | 0.0035 |
| ViT-B/16 | Confidence | 0.8962 | 0.0407 |
| ViT-B/16 | Entropy | 0.9317 | 0.0051 |
| ViT-B/16 | MUS | 0.9324 | 0.0045 |
| Method | AUC | ECE | AUPR | FPR@80% | FPR@95% | AURC | E-AURC |
|---|---|---|---|---|---|---|---|
| Fusion CV | 0.7330 | 0.0601 | 0.4248 | 0.4581 | 0.6279 | 0.11467 | 0.08343 |
| Distance | 0.7102 | 0.1372 | 0.4048 | 0.4889 | 0.6976 | 0.12686 | 0.09562 |
| MUS (Ours) | 0.7076 | 0.0446 | 0.4023 | 0.4967 | 0.6956 | 0.12739 | 0.09614 |
| TTA Variance | 0.6004 | 0.0353 | 0.3206 | 0.6773 | 0.8854 | 0.18897 | 0.15772 |
| MC-Dropout | 0.5991 | 0.1275 | 0.3004 | 0.6611 | 0.8691 | 0.18347 | 0.15223 |
| Patch Variance | 0.5634 | 0.0499 | 0.2883 | 0.7187 | 0.9174 | 0.21090 | 0.17965 |
| Method | AUC | ECE | AUPR | FPR@80% | FPR@95% | AURC | E-AURC |
|---|---|---|---|---|---|---|---|
| MC-Dropout | 0.7641 | 0.1414 | 0.4304 | 0.3743 | 0.5991 | 0.10452 | 0.07327 |
| Fusion CV | 0.7502 | 0.1161 | 0.3931 | 0.3631 | 0.5938 | 0.10707 | 0.07582 |
| TTA Variance | 0.6127 | 0.0771 | 0.3057 | 0.6196 | 0.8381 | 0.17268 | 0.14143 |
| MUS (Ours) | 0.6141 | 0.1254 | 0.3589 | 0.7343 | 0.9479 | 0.20936 | 0.17811 |
| Distance | 0.5827 | 0.0712 | 0.3426 | 0.7764 | 0.9530 | 0.22480 | 0.19355 |
| Patch Variance | 0.5003 | 0.0925 | 0.2514 | 0.8006 | 0.9560 | 0.25270 | 0.22145 |
| Model | Method | AUC | AUPR | FPR@80% | FPR@95% | AURC |
|---|---|---|---|---|---|---|
| EfficientNet-B4 | MUS (Ours) | 0.7171 | 0.4491 | 0.5062 | 0.7670 | 0.3890 |
| EfficientNet-B4 | Entropy | 0.8961 | 0.7785 | 0.1468 | 0.4742 | 0.5252 |
| EfficientNet-B4 | Confidence-inv | 0.9132 | 0.8424 | 0.1389 | 0.4398 | 0.5442 |
| EfficientNet-B4 | Fusion CV | 0.9173 | 0.8496 | 0.1237 | - | - |
| ViT-B/16 | MUS (Ours) | 0.7095 | 0.4066 | 0.4945 | 0.7555 | 0.3686 |
| ViT-B/16 | Entropy | 0.8840 | 0.7856 | 0.1691 | 0.5967 | 0.5247 |
| Model | Method | AUC | ECE | AUPR | FPR@80% | FPR@95% | AURC | E-AURC |
|---|---|---|---|---|---|---|---|---|
| Faster R-CNN | MUS (Ours) | 0.8003 | 0.0581 | 0.5835 | 0.3701 | 0.6781 | 0.10044 | 0.06919 |
| Faster R-CNN | Entropy | 0.8839 | 0.0806 | 0.7412 | 0.2077 | 0.4512 | 0.06895 | 0.03770 |
| Faster R-CNN | Confidence-inv | 0.6017 | 0.2429 | 0.2984 | 0.6485 | 0.8512 | 0.17993 | 0.14868 |
| Faster R-CNN | Fusion CV | 0.8851 | - | 0.7426 | 0.2127 | - | - | - |
| RetinaNet | MUS (Ours) | 0.7469 | 0.0561 | 0.4501 | 0.4171 | 0.6901 | 0.11438 | 0.08313 |
| RetinaNet | Entropy | 0.9121 | 0.1032 | 0.8055 | 0.1568 | 0.3845 | 0.05981 | 0.02856 |
| Threshold | FRCNN AUC | FRCNN AUPR | RetinaNet AUC | RetinaNet AUPR |
|---|---|---|---|---|
| 0.05 | 0.8003 | 0.5835 | 0.7469 | 0.4501 |
| 0.10 | 0.8003 | 0.5835 | 0.7469 | 0.4501 |
| 0.30 | 0.7876 | 0.5644 | 0.7023 | 0.3929 |
| Method | Nodule JSD AUC |
|---|---|
| Baseline (5-crop coarse) | 0.3680 |
| Fine MUS (16-crop, ) | 0.5892 |
| Multi-scale avg (coarse fine) | 0.4945 |
| Improvement (Fine vs. Baseline) | 0.2212 |
| Use MUS when | Do not rely on MUS when |
|---|---|
| Diffuse, globally visible conditions | Highly localized lesions (nodules) |
| Overconfident multi-label classifiers | Well-calibrated single-label models |
| Moderate distribution shift | Severe covariate shift ( ) |
| No retraining or internals access | Generative VLMs with global pooling |
| Recall | Precision | Images Referred | Budget | Errors Caught |
|---|---|---|---|---|
| 10% | 58.7% | 1,091 | 4.3% | 640 / 6,399 |
| 20% | 54.5% | 2,349 | 9.2% | 1,280 / 6,399 |
| 30% | 51.4% | 3,732 | 14.6% | 1,920 / 6,399 |
| Subgroup | N | MUS AUC |
|---|---|---|
| Age 40 | 8,872 | 0.8199 |
| Age 40–60 | 11,151 | 0.7714 |
| Age 60–80 | 5,379 | 0.7512 |
| Age 80 | 190 | 0.7558 |
| Female | 10,714 | 0.7838 |
| Male | 14,882 | 0.7837 |
| Subgroup | N | MUS AUC |
|---|---|---|
| Age 40 | 8,872 | 0.7723 |
| Age 40–60 | 11,151 | 0.7814 |
| Age 60–80 | 5,379 | 0.7943 |
| Female | 10,714 | 0.7813 |
| Male | 14,882 | 0.7863 |
| Overall | 25,596 | 0.7842 |