Out-of-distribution (OOD) detection identifies inputs outside the training distribution. Rank-based analyses such as RankFeat and RankWeight suggest that OOD overconfidence is closely related to dominant low-rank components in feature and weight spaces. Since weight averaging operates directly in parameter space and improves model generalization, we consider it for OOD detection from a dominant-component perspective. Trainable Weight Averaging (TWA) assigns a single coefficient to each checkpoint, limiting independent control of dominant weight components. We extend TWA with leading rank-one weight components extracted by Singular Value Decomposition as correction directions, whose contributions are learned through the in-distribution classification objective. On ResNet50, our method improves over fine-tuning and standard TWA across the evaluated datasets with MSP and RankWeight, both with and without Outlier Exposure. Mahalanobis-based evaluation yields mixed results, indicating that the benefit depends on the OOD scoring protocol. Target-layer analyses with MSP and Energy favor correction near the classifier.
Figures & tables
Figure 1: Overview of the proposed dominant-component-aware extension of TWA. For each checkpoint, leading rank-one components are extracted from selected weight matrices and added as correction directions to the TWA subspace. The final model is optimized in the expanded subspace using the ID classification objective.
Protocol
Method
SVHN
Textures
Places
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
MSP
FT
77.0
84.18
73.2
86.17
72.5
86.17
TWA
78.7
80.11
70.2
88.51
72.1
85.34
Ours
79.0+0.2
79.02−1.09
74.3+4.0
85.59−2.92
75.2+3.1
81.61−3.73
Energy
FT
84.8
79.72
76.9
84.57
75.0
84.49
TWA
83.5
79.80
71.2
89.41
74.2
80.75
Table 1: OOD detection performance without Outlier Exposure (OE) using ResNet50. The final classification layer is used for the proposed method. RankWeight denotes the post-hoc RankWeight protocol. Throughout the tables, scores are reported as percentages, subscripts indicate differences from TWA in percentage points, and bold indicates the best result for each metric and experimental setting.
Method
Accuracy (%) ↑
FT
73.94
TWA
72.55
Ours
75.04+2.49
Table 2: CIFAR-100 ID accuracy without OE.
Range
Method
MSP
Energy
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
(0,51)
TWA
71.1
85.60
79.4
89.30
Ours
74.3+3.2
83.18−2.42
84.4+5.1
83.20−6.10
(0,101)
TWA
74.1
83.50
83.5
79.80
Ours
78.3+4.2
81.28−2.22
85.9+2.4
76.44−3.36
(0,151)
TWA
70.8
84.83
79.9
83.93
Table 3: Effect of checkpoint averaging range on OOD detection without OE using ResNet50.
Method / Target
MSP
Energy
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
FT
77.0
84.18
84.8
79.72
TWA
78.7
80.11
83.5
79.80
Ours: target layer for dominant-component correction
all
75.6−3.1
84.21+4.10
84.2+0.7
78.49−1.31
conv
75.9−2.8
84.53+4.42
80.5−3.0
86.14+6.34
Table 4: Target-layer analysis for dominant-component correction without OE on CIFAR-100/SVHN using ResNet50.
Dataset
Backbone
Method
MSP
Energy
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
SVHN
VGG16BN
FT
67.5
87.63
73.4
82.51
TWA
65.7
90.25
72.8
87.46
Ours
66.8+1.1
84.88−5.37
76.0+3.2
76.88−10.58
ResNet50
FT
77.0
84.18
84.8
79.72
TWA
78.7
80.11
83.5
79.80
Table 5: Effect of backbone architectures on OOD detection without OE using CIFAR-100 as ID.
Method
Accuracy (%) ↑
FT
73.94
TWA
69.94
Ours
72.69+2.75
Table 6: CIFAR-100 ID accuracy with OE.
Protocol
Method
SVHN
Textures
Places
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
AUROC (%) ↑
FPR95 (%) ↓
MSP
FT
79.4
80.22
74.4
83.99
75.3
82.10
TWA
80.5
77.27
72.1
86.91
71.1
85.08
Ours
82.9+2.5
70.34−6.93
76.6+4.5
82.39−4.52
77.3+6.2
78.62−6.46
Energy
FT
84.2
75.80
77.4
81.33
79.9
75.48
TWA
85.4
75.00
74.3
84.68
75.2
77.06
Table 7: OOD detection performance with Outlier Exposure (OE) using ResNet50. The final classification layer is used for the proposed method. RankWeight denotes the post-hoc RankWeight protocol.
OE
Method
SVHN
Textures
Places
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
AUROC ↑
FPR95 ↓
w/o OE
FT
71.2
77.20
86.6
43.94
51.5
95.95
TWA
84.1
55.20
86.6
42.23
52.9
95.50
Ours
66.3−17.8
86.29+31.09
88.2+1.6
41.22−1.01
50.8−2.1
95.56+0.06
w/ OE
FT
71.2
79.69
88.6
38.30
55.0
94.38
TWA
84.1
56.64
85.6
42.71
58.9
93.66
Table 8: Feature-based OOD detection using Mahalanobis scoring on ResNet50, with CIFAR-100 as ID. Features are extracted from the input to the final classification layer.
Figure 2: Loss landscape visualization without Outlier Exposure (OE). The proposed method expands the TWA search subspace while retaining the flat-solution behavior of weight averaging.
Out-of-distribution (OOD) detection is essential for deploying deep learning models reliably, yet no single method performs consistently across architectures and datasets -- a scorer that leads on one benchmark often falters on another. We attribute this inconsistency to a shared structural limitation: logit-based methods see only the classifier's confidence signal, while feature-based methods attempt to measure membership in the training distribution but do so in the full feature space where confidence and membership are entangled, inheriting architecture-sensitive failure modes. We observe that penultimate features naturally decompose into two orthogonal subspaces: a classifier-aligned component encoding confidence, and a residual the classifier discards. We discover that this residual carries a class-specific directional signature for in-distribution data -- a membership signal invisible to logit-based methods and entangled with noise in feature-based methods. We propose CORE (COnfidence + REsidual), which disentangles the two signals by scoring each subspace independently and combines them via normalized summation. Because the two signals are orthogonal by construction, their failure modes are approximately independent, producing robust detection where either view alone is unreliable. CORE achieves competitive or state-of-the-art performance across five architectures and five benchmark configurations, ranking first in three of five settings and achieving the highest grand average AUROC with negligible computational overhead.
Out-of-distribution (OOD) detection is essential for deploying machine learning models in open-world and safety-critical scenarios, where test inputs may deviate from the training distribution and overconfident predictions on unknown samples can lead to unreliable decisions. Outlier Exposure (OE) has emerged as a promising OOD detection paradigm by introducing auxiliary outliers during training to enlarge the margin between in-distribution (ID) and OOD samples. Existing OE-based methods typically enlarge this margin by employing uniform labels to maximize the entropy of OOD samples over ID categories. However, we theoretically show that uniform labels inevitably disregard the relations between OOD samples and ID categories, termed the over-softening effect, leading to a suboptimal margin bound. Our theoretical analysis further reveals that explicitly exploiting such relations can instead yield improved OOD detection performance. Motivated by this insight, we propose Adaptive Confidence OE (AOE), a simple yet effective method that leverages temperature scaling to recalibrate outlier labels. Specifically, AOE generates adaptive soft targets from temperature-scaled model predictions for OOD samples, where the learnable temperature smooths the prediction distribution without fully erasing class-wise relational information. By supervising OOD samples with these adaptive soft targets, AOE preserves the semantic proximity between OOD samples and ID categories while encouraging the softened targets to approach a high-entropy distribution, thereby suppressing overconfident OOD predictions and enlarging the separation margin. Extensive experiments across diverse benchmarks demonstrate the effectiveness of AOE.
Fengqiang Wan, Qing-Yuan Jiang, Yang Yang
School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing 210094, China.
We introduce MM++ (Multilayer Mahalanobis++), a strictly post-hoc, and scale-invariant framework for Out-of-Distribution (OOD) detection. To address the trade-off between scale invariance and hierarchical expressivity, MM++ constructs a principled joint feature space. It first identifies discriminative intermediate layers by measuring entropy density drops, which mark the boundaries of sharp semantic compression. By fusing these selected layers with the terminal representation, the framework captures latent cross-layer correlations while mitigating early-layer noise. Crucially, a Ledoit-Wolf regularized tied covariance matrix stabilizes this unified space, enabling reliable distance estimation. Requiring no auxiliary OOD data, classifier fine-tuning, or architectural modifications, MM++ delivers robust performance across distinct architectures for both near- and far-OOD detection.
Rahim Hossain, Md Tawheedul Islam Bhuian, Md Farhan Shadiq +1
School of Computing State University of New York at Binghamton