Post-hoc out-of-distribution (OOD) detection is mature on far-OOD yet remains weak on near-OOD. These two settings differ in their use of class-characteristic feature directions: far-OOD inputs largely fail to activate those of their predicted class, whereas near-OOD inputs activate them much as in-distribution samples do. Because the axis separating far-OOD leaves near-OOD almost indistinguishable from ID, a score optimized for one setting is misaligned with the other; where a detector already saturates far-OOD, added near-OOD sensitivity is bought partly against it. This divergence motivates a targeted near-OOD signal designed to complement existing scores. We propose PLUS (Per-class Low-dimensional sUbspace Signal). For each class, PLUS selects the m most class-active neurons from a sparse autoencoder, orthonormalizes the corresponding decoder directions to form a low-dimensional subspace, and scores an input by its per-class whitened squared Mahalanobis distance z within the subspace of its predicted class. Designed as a dedicated complement rather than a standalone detector, the signal z is fused additively with any calibrated base score at a single, fixed weight. This weight is a single global constant: no value is adjusted per backbone, per OOD dataset, or per deployment, and all calibration statistics are estimated from ID validation data alone. When applied to 18 existing detectors spanning diverse method families, z consistently improves near-OOD AUROC in all 126 detector--backbone combinations. Far-OOD performance is broadly maintained or improved, with only marginal declines where the base score is near-optimal, making z a robust, detector-agnostic complement across backbones.
Figures & tables
Figure 1: Overview of PLUS. (a) Training: Using only ID training data, a TopK-SAE is trained on backbone features. For each class c , a fixed support Sc of its m most active neurons is identified, orthonormalized into a basis Qc , and characterized by subspace statistics (μc,Σc) . (b) Inference: Given an input image, the classifier produces the ℓ2 -normalized feature x and the predicted class c^ . PLUS then computes the whitened deviation z(x) within the predicted class’s subspace. Both the base detector score and z(x) are standardized using correctly classified ID validation negatives and additively fused with a single fixed weight β=0.5 .
Method
ViT-B/16
ResNet-50
Swin-T
Near-OOD
Far-OOD
Overall
Near-OOD
Far-OOD
Overall
Near-OOD
Far-OOD
Overall
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
MSP
73.52
81.85
86.04
51.69
81.03
63.75
76.02
65.68
85.23
51.45
81.55
57.14
76.75
71.06
86.30
49.16
82.48
57.92
MSP + PLUS
78.13
68.82
88.44
43.86
84.32
53.84
79.30
63.38
89.64
40.88
85.50
49.88
80.02
64.33
88.55
42.96
85.14
51.51
MaxLogit
68.30
92.25
83.54
79.23
77.45
84.44
76.46
67.85
89.58
38.20
84.33
50.06
75.66
80.76
84.80
67.81
81.14
72.99
MaxLogit + PLUS
75.65
84.39
87.44
56.73
82.73
67.80
80.86
63.19
92.98
29.22
88.13
42.81
79.79
72.02
87.79
51.50
84.59
59.70
Table 1: PLUS as a detector-agnostic near-OOD complement. For each of 18 post-hoc baselines on the three standard OpenOOD backbones, the standalone score (plain row) is followed by the β=0.5 fusion (shaded “base + PLUS” row). Improvements are shown in bold ; an underline marks the few metrics where the fusion slightly regresses the standalone (AUROC higher / FPR95 lower is better).
Backbone
Near-OOD
Far-OOD
SSB-hard
NINCO
iNaturalist
Textures
OpenImage-O
ResNet-18
18 /0
18 /0
17/1
13/5
14/4
Max
+10.86
+9.30
+27.68
+12.79
+15.04
Min
+1.67
+0.17
−0.82
−1.49
−1.05
ResNet-50
18 /0
18 /0
18 /0
13/5
18 /0
Max
+15.19
+10.93
+22.45
+6.98
+13.74
Table 2: Per-dataset breadth across seven backbones. For each backbone and OOD dataset, the top line counts how many of the 18 baselines improve / drop in AUROC when PLUS is added (improved/dropped; bold marks a clean sweep where all 18 improve). The Max / Min lines give the largest / smallest per-detector AUROC change, in points, over the 18 detectors.
Backbone
Near-OOD
Far-OOD
MDS++ + PLUS
Best baselines
MDS++ + PLUS
Best baselines
ViT-B/16
81.09
RMDS++ 80.07 , RMDS 79.99
92.26
MDS++ 93.29 , ViM 92.93
ResNet-50
78.23
ASH 78.17 , NNGuide 77.53
95.45
ASH 95.74 , MDS++ 95.13
Swin-T
80.86
RMDS++ 79.70 , GEN 78.97
93.00
MDS++ 93.67 , ViM 93.26
Table 3: Comparison with state-of-the-art methods in AUROC. In each Near- and Far-OOD block, the best result is in bold , and the second-best is underlined .
Subspace
Metric
ViT-B/16
ResNet-50
Swin-T
SAE top-16 (ours)
per-class Σc
81.23
78.22
80.90
tied
80.61
74.79
80.35
isotropic
80.33
75.46
80.04
Random orthonormal
per-class Σc
79.57
74.47
78.49
tied
79.01
74.20
77.88
isotropic
79.00
74.20
77.88
Table 4: Subspace × metric ablation (near-OOD AUROC of MDS++ + 0.5z , %). Rows vary the 16 -dim per-class subspace and the metric applied inside it. Tied : a single within-class covariance shared by all classes, projected into each class’s subspace; isotropic : unwhitened ∥D∥2 . Random orthonormal: mean over 5 seeds (std ≤0.13 ). Ledoit–Wolf replaces z by a per-class shrinkage Mahalanobis on the full feature.
Figure 2: Sensitivity to the fusion weight β on an MDS++ base. Near-AUROC (solid) and far-AUROC (dashed) across backbones.
Figure 3: Support-size demand tracks the feature participation ratio. The small- m Near-AUROC loss (fused near-gain at m=16 minus m=2 , in points) against the ID-train participation ratio PR , over seven backbones.
Mean near gain
PLUS >
z on top of A+B
Backbone
A+z
A+B
MDS++ partner
pairs improved
near / far Δ
ViT-B/16
+6.48
+3.88
15/17
102/102
+4.22 / +2.15
ResNet-50
+4.83
+1.86
17/17
102/102
+3.43 / +1.75
Swin-T
+6.55
+4.14
14/17
102/102
+4.09 / +2.41
ResNet-18
+3.79
+1.66
16/17
102/102
+2.81 / +1.92
Wide-ResNet50-2
+3.12
+2.92
11/17
102/102
+1.71 / +0.90
Table 5: Ensemble control (near-OOD AUROC). Mean near gain : over the 18 bases A , the gain of A+z (PLUS) and of A+B averaged over the available partners B=A , both relative to A alone. PLUS > MDS++ partner : number of bases ( A= MDS++) for which A+z beats A+MDS++ . z on top of A+B : adding 0.5cz to every two-detector ensemble cA+0.5cB .
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
Backbone
Family
torchvision checkpoint
d
OpenOOD
ResNet-18
CNN, BasicBlock
ResNet18_Weights.IMAGENET1K_V1
512
ResNet-50
CNN, Bottleneck
ResNet50_Weights.IMAGENET1K_V1
2048
✓
Wide-ResNet50-2
CNN, Bottleneck ( 2× width)
Wide_ResNet50_2_Weights.IMAGENET1K_V1
2048
ConvNeXt-B
ConvNeXt
ConvNeXt_Base_Weights.IMAGENET1K_V1
1024
Swin-T
Swin Transformer
Swin_T_Weights.IMAGENET1K_V1
768
✓
ViT-B/16
ViT
ViT_B_16_Weights.IMAGENET1K_V1
768
✓
Appendix
Table 6: Backbone checkpoints. All weights are torchvision IMAGENET1K_V1 public checkpoints, used without fine-tuning; d is the penultimate-feature (pre-logit) dimension. The three ResNet-family backbones differ structurally: ResNet-18 uses shallow BasicBlock residual units ( d=512 ), whereas ResNet-50 and Wide-ResNet50-2 use the deeper Bottleneck design ( d=2048 ), the latter doubling the bottleneck width. Backbones marked ✓ are the three standard OpenOOD v1.5 ImageNet backbones.
Backbone
d
Near-opt p ( × )
Δ near standalone
Δ near fused
Far-opt p ( × )
ResNet-18
512
24576 ( 48× )
+1.35
+0.75
2048 ( 4× )
ResNet-50
2048
6144 ( 3× )
+0.00
+0.00
4096 ( 2× )
Wide-ResNet50-2
2048
8192 ( 4× )
+0.47
+0.20
4096 ( 2× )
ConvNeXt-B
1024
4096 ( 4× )
+0.29
+0.12
4096 ( 4× )
MaxViT-T
512
1536 ( 3× )
+0.98
+0.19
3072 ( 6× )
Swin-T
768
9216 ( 12× )
+0.41
+0.20
15360 ( 20× )
Appendix
Table 7: Per-backbone optimal SAE capacity. Near-opt and Far-opt p indicate the capacities maximizing standalone near- and far-OOD AUROC, respectively. Δ near std and fused represent the near-AUROC gained by using the near-optimal p instead of the fixed p=6144 , evaluated as z standalone (standalone) and after base+ 0.5z fusion (fused).
Figure 4: Near-AUROC response to the neuron count p ( Δ relative to the deployed p=6144 ; shared vertical scale, grey band =±0.5 pt). Four backbones remain inside the noise band (flat). ResNet-50 dips once at 8× but peaks at the deployed p , while ResNet-18 (which seeks capacity) and MaxViT-T (which prefers compactness) diverge from the band in opposite directions. Top axis indicates the expansion factor p/d .
Figure 5: Near (blue) and far (orange) z -AUROC vs. neuron count. Stars mark each metric’s optimum, while the red dashed line indicates the deployed p=6144 . The near- and far-optima diverge for six of the seven backbones; CNNs prefer a smaller p for far-OOD, whereas transformers prefer a larger one.
Table 15: Choice of the 16 -dimensional per-class subspace on all seven backbones (near-OOD AUROC of MDS++ + 0.5z , %). Every row uses the per-class metric Σc and differs only in the subspace. Global PCA : one 16 -dimensional PCA basis shared by all classes; top-16 raw channels : each class’s 16 feature coordinates with the largest mean value. Max gap : the largest shortfall, over the seven backbones, from the best subspace on that backbone (lower is better). Bold: best among the subspaces. † Mean over 5 seeds (std ≤0.15 ). On far-OOD, all non-random subspaces stay within 0.82 points of the best on every backbone. All rows are re-estimated in the pipeline of Table 4 .
Backbone
Random pair
Nearest class
Dogs (118)
Snakes (17)
Birds (18)
ResNet-50
0.032
0.296 ( 9× )
0.087 ( 2.7× )
0.154 ( 4.6× )
0.091 ( 2.7× )
Swin-T
0.011
0.277 ( 26× )
0.029 ( 2.7× )
0.160 ( 15.4× )
0.126 ( 11.1× )
ViT-B/16
0.003
0.264 ( 85× )
0.031 ( 8.9× )
0.211 ( 64.9× )
0.094 ( 23.1× )
Appendix
Table 16: Characteristic-neuron reuse across classes (mean pairwise top-16 support Jaccard). Random pair : two unrelated classes. Nearest class : each class and its closest class by feature centroid. Dogs/Snakes/Birds : mean within-group Jaccard for the ImageNet dog (151–268), snake (52–68), and bird (7–24) groups; the parenthetical is the ratio to a size-matched random group of classes ( × vs. the random pair for the nearest-class column).
Post-hoc out-of-distribution detection usually relies on a single signal extracted from a frozen classifier, such as confidence, energy, features, or gradients. This dependence becomes fragile under classifier-level adversarial shift, where the shift can preserve the detector's chosen cue while changing the model's decision behavior. We investigate whether this failure mode can be mitigated by combining complementary detection criteria instead of selecting a single score. We introduce TriScore, a post-hoc OOD detector that combines three ID-calibrated signals from the same frozen backbone: an energy prior, a boundary-fragility score, and a transform-consistency score. These signals are standardized on ID validation data and fused by an input-dependent ID-residual gate, requiring no OOD labels, auxiliary model, training, or stored feature bank. Across four ImageNet-scale backbones, TriScore achieves the best mean AUROC among 15 post-hoc baselines under a non-adaptive adversarial-shift protocol, while remaining competitive on standard OOD benchmarks. Ablations show that the gains come from combining complementary cues rather than optimizing a single detector signal. These results support multi-criterion post-hoc detection as a practical route toward more robust OOD detection under classifier-level shift. The source code is publicly available at github.com/gursoyege/TriScore.
Diffusion models are powerful generative methods for learning and sampling from complex data distributions. Safely deploying these models requires detecting inputs that fall outside their training distribution. Because diffusion models recover clean samples from noisy inputs, reconstruction error is often used for out-of-distribution (OOD) detection. This approach assumes that in-distribution (ID) inputs are reconstructed more accurately than OOD inputs. However, OOD inputs may be reconstructed equally well or even better, making this score unreliable. We therefore propose the leading sensitivity spectrum of intermediate denoising features as a complementary OOD signal and demonstrate that it remains informative when reconstruction error is misleading. We introduce DUal-readout of diffusion models for OOD detection (DUO), a fully unsupervised, training-free OOD detector that combines reconstruction error and feature sensitivity. DUO improves average AUROC by approximately 6% points over the strongest baselines while substantially reducing inference cost, and achieves SOTA on near-OOD and high-resolution benchmarks.
Outlier Exposure (OE) is among the strongest training-based OOD detectors on standard benchmarks but exhibits scorer-dependent tradeoffs (e.g., strong on MSP, weak on KNN) and requires curated auxiliary data. We show why OE works: its features sit at the same geometric locus as real near-OOD data, with the boundary-adjacent quartile driving nearly all of OE's gain. OE is boundary calibration, not OOD coverage. GEODE (GEOmetry-preserving DEtection) replicates this calibration synthetically through an angle-adaptive norm loss in which targets scale per-sample with cosine similarity to the nearest class mean, preserving feature geometry where boundary structure matters. Four theorems grounded in neural collapse justify the design. GEODE works across all seven standard scorers on CIFAR-10 (near-OOD AUROC 89.0-92.3, far-OOD reaching 93.05; no catastrophic failure on any scorer). Since the OOD regime is unknown at deployment, this is the test that matters. GEODE outperforms vanilla CE at matched epoch counts. Combined with OE, GEODE reaches 95.0 MSP / 94.8 KNN on CIFAR-10 and beats OE on every scorer on CIFAR-100. The gains hold on WRN-28-10 (+4.5 Energy, 3 seeds). Unlike methods that push OOD into the classifier null space (e.g., PFS, 14.38 KNN AUROC, worse than random), GEODE's adaptive target preserves the geometry that distance-based scorers depend on.
Bruno Abrahao
NYU Shanghai · Leonard N. Stern School of Business, NYU