Unified Multi-Layer Subspace Modeling for Cross-Domain OOD Detection
Organizations: Institute of Visual Computing, Graz University of Technology, Austria · KESTRELEYE GmbH, Austria
Abstract
Out-of-Distribution (OOD) detection remains a fundamental challenge for neural networks, whose predictions can be overconfident on inputs that deviate from the training distribution. Most post-hoc OOD detection methods derive scores from a single representation level (eg., logits or penultimate features) or combine multiple layers via depth selection or OOD-calibrated weighting. However, because OOD shifts are diverse, the most informative representation level can vary strongly across OOD types and domains, making fixed-layer choices and OOD-calibrated aggregation brittle. In this paper, we propose PRISM (Projected Representation with Intermediate-layer Subspace Modeling), a model-agnostic post-hoc OOD detection method that models a unified multi-layer feature representation rather than aggregating independently scored layers. PRISM fuses intermediate and deep features into a single hierarchical embedding, estimates an in-distribution (ID) principal subspace, and then combines two complementary signals: (i) a class-conditional Mahalanobis distance in the projected subspace and (ii) the residual energy orthogonal to the learned manifold. This simple design avoids OOD-tuned layer weighting while capturing both in-subspace semantic deviations and off-subspace anomalies. Across diverse benchmarks spanning natural images, medical imaging, and industrial visual inspection, PRISM achieves consistent state-of-the-art cross-domain OOD detection performance with a single default configuration across all evaluated domains and architectures. We further show that PRISM incurs minimal inference overhead, making it practical for real-world deployment.
Figures & tables
| Method | OpenOOD | OpenMIBOOD | ICONIC-444 | Average | ||||||||||
| C10 | C100 | IN-1k | Mean | MIDOG | PhaKIR | OASIS-3 | Mean | Almond | Wheat | Kernels | FG | Mean | ||
| MSP [ 27 ] | ||||||||||||||
| MDS [ 40 ] | ||||||||||||||
| MDSEns* [ 40 ] | 96.87 | 98.49 | 98.41 | |||||||||||
| GRAM [ 61 ] | 95.89 | 97.55 | ||||||||||||
| EBO [ 45 ] | ||||||||||||||
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | ID Dataset | Near-OOD | Far-OOD | Extreme-OOD |
| OpenOOD [ 83 ] | CIFAR-10 [ 34 ] | CIFAR-100 [ 34 ] , Tiny ImageNet [ 69 ] | MNIST [ 39 ] , SVHN [ 53 ] , Textures [ 13 ] , Places365 [ 85 ] | MIDOG [ 7 ] , ICONIC-444 [ 36 ] |
| CIFAR-100 [ 34 ] | CIFAR-10 [ 34 ] , Tiny ImageNet [ 69 ] | MNIST [ 39 ] , SVHN [ 53 ] , Textures [ 13 ] , Places365 [ 85 ] | MIDOG [ 7 ] , ICONIC-444 [ 36 ] | |
| ImageNet-1k [ 14 ] | SSB-Hard [ 73 ] , NINCO [ 11 ] | iNaturalist [ 72 ] , Textures [ 13 ] , OpenImage-O [ 74 ] | MNIST [ 39 ] , FMNIST [ 76 ] | |
| OpenMIBOOD [ 19 ] | MIDOG [ 7 ] | other MIDOG domain shifts not in ID | CCAgT [ 3 , 6 ] , FNAC 2019 [ 60 ] | PhaKIR [ 59 ] , ImageNet [ 14 ] , iNaturalist [ 72 ] , Textures [ 13 ] |
| PhaKIR [ 59 ] | Cholec80 [ 71 ] , EndoSeg15 [ 12 ] , EndoSeg18 [ 2 ] | Kvasir [ 30 ] , CATARACTS [ 1 ] | MIDOG [ 7 ] , ImageNet [ 14 ] , iNaturalist [ 72 ] , Textures [ 13 ] | |
| OASIS-3 [ 38 ] | ATLAS [ 42 ] , BraTS [ 8 , 9 , 49 ] , OASIS-CT [ 38 ] | MDS-Heart [ 5 , 62 , 68 ] , CHAOS [ 33 , 32 ] | MIDOG [ 7 ] , MNIST [ 39 ] , FMNIST [ 76 ] , Textures [ 13 ] |
| Benchmark | ID Dataset / Task | Architecture | Checkpoint Source / Training |
| OpenOOD [ 83 ] | CIFAR-10 [ 34 ] | ResNet-18 [ 23 ] | Official OpenOOD checkpoint |
| CIFAR-100 [ 34 ] | ResNet-18 [ 23 ] | Official OpenOOD checkpoint | |
| ImageNet-1k [ 14 ] | ResNet-50 [ 23 ] | timm: resnet50.tv2_in1k | |
| Swin-T [ 47 ] | torchvision: Swin_T_Weights.IMAGENET1K_V1 | ||
| ViT-B/16 [ 22 ] | timm: vit_base_patch16_224.mae_in1k | ||
| OpenMIBOOD [ 19 ] | MIDOG [ 7 ] | ResNet-50 [ 23 ] | Official OpenMIBOOD checkpoint |
| Method | Cal. data | Hyperparameter search space | ||||
| ID | OOD | Param 1 | Range | Param 2 | Range | |
| MSP [ 27 ] | — | — | — | — | ||
| MDS [ 40 ] | ✓ | — | — | — | — | |
| MDSEns [ 40 ] | ✓ | ✓ | noise | [0, 0.0025, 0.0014, 0.005] | — | — |
| GRAM [ 61 ] | ✓ | — | — | — | — | |
| EBO [ 45 ] | temperature | [0.1, 0.5, 1.0, 1.5, 2.0] | — | — | ||
| Method | Near | Far | Extreme | |||||||||||||||
| CIFAR-100 | Tiny ImageNet | MNIST | Places365 | SVHN | Textures | ICONIC-444 | MIDOG | Average | ||||||||||
| AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | |
| MSP [ 27 ] | ||||||||||||||||||
| MDS [ 40 ] | ||||||||||||||||||
| MDSEns [ 40 ] | 100.00 | 0.00 | ||||||||||||||||
| Method | Near | Far | Extreme | |||||||||||||||
| CIFAR-10 | Tiny ImageNet | MNIST | Places365 | SVHN | Textures | ICONIC-444 | MIDOG | Average | ||||||||||
| AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | |
| MSP [ 27 ] | ||||||||||||||||||
| MDS [ 40 ] | ||||||||||||||||||
| MDSEns [ 40 ] | ||||||||||||||||||
| Method | Near | Far | Extreme | ||||||||||||||
| SSB-Hard | NINCO | iNaturalist | Textures | OpenImage-O | MNIST | FashionMNIST | Average | ||||||||||
| AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | ||
| ResNet-50 | MSP [ 27 ] | ||||||||||||||||
| MDS [ 40 ] | 95.25 | 26.25 | 92.14 | ||||||||||||||
| MDSEns [ 40 ] | |||||||||||||||||
| Method | Near | Far | Extreme | ||||||||||||||
| Mean | Mean | ImageNet-1k | iNaturalist | Textures | Places365 | Mean | Average | ||||||||||
| AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | ||
| ResNet-18 | MSP [ 27 ] | ||||||||||||||||
| MDS [ 40 ] | |||||||||||||||||
| MDSEns [ 40 ] | |||||||||||||||||
| Method | MIDOG | PhaKIR | OASIS-3 | |||||||||||||||||||||||
| Near | Far | Extreme | Mean | Near | Far | Extreme | Mean | Near | Far | Extreme | Mean | Average | ||||||||||||||
| AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | AUROC | FPR95 | |
| MSP [ 27 ] | ||||||||||||||||||||||||||
| MDS [ 40 ] | 100.00 | 0.00 | 100.00 | 0.00 | ||||||||||||||||||||||
| MDSEns* [ 40 ] | 90.60 | 21.83 | 100.00 | 0.00 | 100.00 | 0.00 | 96.87 | 7.28 | 97.05 | 21.24 | 98.41 | 15.85 | 100.00 | 0.00 | 98.49 | 12.36 | 100.00 | 0.00 | 100.00 | 0.00 | 98.41 | 6.80 | ||||
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 215 papers