Attracting features toward learned in-distribution (ID) regions is an intuitive strategy for out-of-distribution (OOD) detection, but does such attraction improve detection? We investigate this question using class-conditioned Hamiltonian dynamics as a controlled testbed and identify an attraction-ranking mismatch: improving individual class-affinity scores need not improve the relative ordering of ID and OOD samples. Our analysis separates misalignment between the driving field and the detection score from ranking failure that persists even when they are aligned. An exact AUROC decomposition and a local boundary analysis identify relative score changes at the ID-OOD ranking boundary as the source of first-order AUROC change under regularity conditions. Experiments demonstrate that a score-aligned rule can improve performance on a held-out source validation split yet consistently degrade it after transfer, even without a single winning-class change. A separate perturbation study finds that near-boundary relative score changes track the direction of small AUROC changes in the tested settings. Finally, centroid approximation and shared scales connect the zero-step score to a static centroid family that includes the existing CTM detector. Together, these results explain why class attraction is insufficient to justify feature refinement and motivate evaluating its effect on the ranking boundary.
Figures & tables
Figure 2: Schematic construction of the trajectory score. (a) The surface height is V(q)=−∑cAc(q) , with wells labeled c1,c2 . (b) The same field and path in top view. Both views identify the initial state q0 , best sampled state qn⋆ , illustrative turning state q+ , and final state qT ; solid and dashed red curves show outward and returning motion. (c) Class potential along the outward branch ℓ , parameterized by qℓ(n)=qn for n=0,…,5 . Grid lines locate samples, and the red polygon joins their potential values. The continuous minimum (open circle) lies between samples and is lower than the best sampled value (star). (d) Each class contributes its maximum visited affinity Ec,T ; their largest value defines ST , which need not equal the final-state affinity. Stars mark the same state in all panels. All panels share affinities and sampled states; the planar motion is schematic, not a Hamiltonian simulation.
Figure 3: Two levels of the attraction–ranking mismatch. (a) A projected aggregate force can align with the winning-class score gradient (left), whereas nonwinning classes can reverse that alignment and produce the destructive condition I(q0)<−1 (right). (b) Even when each sample’s retained trajectory score is nondecreasing, unequal ID and OOD increases can reverse an initially correct pair. All class sums are over J(q0) . Panel (a) is a theoretical schematic, not an observed audit sample; the geometry and values are illustrative.
ID
Group
T=0
best T>0
T
Δ
CIFAR-10
Near
88.59/42.36
88.95/40.91
10
+.36
Far
91.07/31.09
91.56/29.95
10
+.49
CIFAR-100
Near
79.46/63.16
79.72/61.88
3
+.26
Far
83.41/51.10
84.01/49.61
3
+.60
IN-200
Near
79.44/64.42
80.22/61.89
3
+.78
Far
91.18/31.66
91.29/31.36
1
+.11
Table 1: Gaussian trajectory ablation. The best nonzero T is selected retrospectively from {1,3,10} . Entries are AUROC/FPR@95; Δ is the AUROC change from T=0 .
Benchmark
T=0
Aggregate T=5
Current winner T=5
Δ0
ImageNet-1K
71.79±.82/72.63±3.17
65.99±.23/74.59±1.40
72.93±.57/72.03±2.66
+1.14
CIFAR-10
89.42±.37/39.60±3.22
90.13±.19/36.27±7.10
87.98±.39/54.67±7.63
−1.43
CIFAR-100
84.26±.88/47.07±6.88
85.38±1.02/45.27±4.97
83.84±.89/48.93±4.06
−.42
ImageNet-200
88.09±.69/38.78±2.67
86.73±1.48/38.61±3.15
87.53±.93/40.17±4.09
−.56
Table 2: Validation-only score-alignment audit. ImageNet-1K is the holdout after selection; other rows transfer the selected current-winner geodesic T=5 rule without retuning. Entries are mean ± standard deviation AUROC/FPR@95; Δ0 is aligned T=5 AUROC minus T=0 AUROC.
Target
Static
Probe
Δ
103B5%
Positive seeds
IN-1K/ResNet-50
91.67±.45
91.73±.44
+.056
+13.329
3/3
IN-1K/DenseNet-121
89.82±.40
90.04±.38
+.219
+34.395
3/3
CIFAR-10
89.46±.81
89.45±.81
−.006
−.551
0/3
CIFAR-100
84.96±.73
84.95±.74
−.016
−.589
1/3
ImageNet-200
92.11±.32
92.08±.33
−.027
−1.871
0/3
Table 3: Stability probe with a fixed step size. Static and probe columns report AUROC; B5% is B5% from Eq. ( 22 ), averaged over three seeds.
Figure 4: Boundary-conditioned mechanism and validation evidence. (a) AUROC changes when an ID–OOD pair crosses the ranking boundary; filled and open markers denote initial and final margins. (b) Mean Dout−Din over all pairs and over the closest 5% of baseline margins. The lower view enlarges the negative boundary means on the three transfer targets. (c) Boundary statistic B5% versus AUROC change at η=.04 , with the nine cross-dataset target–seed audits enlarged below. Signs agree in 14 of 15 audits overall and 8 of 9 cross-dataset audits; the circled point is the sole disagreement. AUROC changes are percentage points. R50 and DN121 denote the ImageNet-1K ResNet-50 and DenseNet-121 settings; C10, C100, and IN200 denote CIFAR-10, CIFAR-100, and ImageNet-200. Both statistics are computed on the same validation holdout.
Stage
Interpretation
AUROC
FPR@95
Δ AUROC
Δ FPR@95
MSP
output reference
84.77±.00
49.26±.00
0.00
0.00
S1
exact full-class field
73.16±.86
72.34±2.61
−11.61
+23.08
S2
common class scale
87.06±.69
46.44±.13
+2.30
−2.82
S3
radial anchor centroid
90.24±.61
38.61±.75
+5.47
−10.65
S4
cosine implementation
90.24±.61
38.61±.75
+5.47
−10.65
S5
setup-bank centroid
91.19±.67
35.36±.34
+6.43
−13.90
Table 4: Step-by-step static comparison on ImageNet-1K validation data. Values are mean ± standard deviation over three detector banks; deltas are relative to MSP.
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
Validation benchmark
Seed
T=0
Aggregate
Aligned
C/S
ImageNet-1K
0
72.27
65.77
73.07
2.74/1.94
1
70.84
66.24
72.30
3.02/1.57
2
72.27
65.95
73.41
3.02/1.88
CIFAR-10
0
89.23
89.93
87.63
0.57/2.17
1
89.18
90.18
87.93
0.77/2.01
2
89.85
90.29
88.39
0.46/1.92
Appendix
Table 5: Per-seed score-aligned mechanism audit. Static, aggregate, and aligned columns report AUROC; C/S gives corrected/spoiled pair mass in percent for the aligned flow relative to T=0 .
Benchmark
Candidates
ID
OOD
Current switches
Initial switches
CIFAR-10
all 10
3000
3000
0
0
CIFAR-100
top 20
3000
2916
0
0
ImageNet-200
top 20
3000
5289
0
0
Appendix
Table 6: Winner-switch audit over 20,205 sample–seed trajectories and 11 retained states. Switch counts are summed over seeds and populations.
Validation target
Seed
Static
Probe
Δ
103B5%
C/S
IN-1K / R50
0
92.165
92.205
+0.040
+11.734
0.296/0.256
1
91.269
91.342
+0.073
+13.950
0.336/0.263
2
91.583
91.638
+0.055
+14.302
0.325/0.269
IN-1K / DN121
0
90.065
90.281
+0.216
+34.302
0.553/0.337
1
89.357
89.600
+0.243
+36.159
0.581/0.338
2
90.049
90.246
+0.198
+32.726
0.537/0.339
Appendix
Table 7: Per-seed stability-probe results. B5% is the mean Dout−Din among the nearest 5% of pairs to the static ranking boundary. C/S denotes corrected/spoiled pair mass in percent.
Validation target
1%
2.5%
5%
10%
25%
100%
IN-1K / R50
11.128
12.013
13.329
18.480
43.652
182.907
IN-1K / DN121
32.548
33.590
34.395
38.253
59.390
199.719
CIFAR-10
−0.527
−0.567
−0.551
−0.457
0.277
65.996
CIFAR-100
−0.934
−1.616
−0.589
1.831
16.693
180.182
IN-200
−4.551
−3.871
−1.871
4.976
40.295
219.853
Appendix
Table 8: Mean boundary statistic Bρ , multiplied by 103 , over three seeds. Columns retain the stated fraction of ID–OOD pairs with the smallest absolute static margin.
ID
Potential
T=0
T=1
T=3
T=10
IN-200 Near
Gaussian
79.44/64.42
79.64/63.99
80.22/61.89
79.63/62.10
IN-200 Far
Gaussian
91.18/31.66
91.29/31.36
90.68/33.10
88.82/34.61
IN-200 Near
IMQ
78.23/65.27
78.41/64.95
79.34/62.99
78.16/63.37
IN-200 Far
IMQ
89.79/34.33
89.90/34.06
90.17/33.50
87.09/37.39
IN-1K Near
Gaussian
66.14/77.84
64.51/79.27
61.42/79.63
60.94/79.63
IN-1K Far
Gaussian
77.44/65.16
72.71/71.29
74.37/69.75
68.51/70.71
Appendix
Table 9: ImageNet trajectory ablation. ImageNet-200 varies three official model seeds; ImageNet-1K varies three centroid banks on one fixed backbone.
Potential
Group
AUROC
FPR@95
AUPR-IN
AUPR-OUT
Gaussian
Near
60.94±.07
79.63±1.29
75.14±.17
34.70±.24
Gaussian
Far
68.51±.33
70.71±1.75
90.86±.26
26.15±.04
IMQ
Near
58.03±.83
82.91±1.79
73.52±.22
33.27±.14
IMQ
Far
63.44±1.05
75.60±1.52
88.96±.53
23.21±.15
Appendix
Table 10: ImageNet-1K T=10 full-evaluation results over three independently sampled centroid banks on the fixed ResNet-50. Values are mean ± standard deviation; ID accuracy is 76.1867% for every run.
ID
Potential
AUROC
FPR@95
CIFAR-10
Gaussian
89.77±0.13
35.18±1.24
Laplacian
90.97±0.36
32.82±2.19
Cauchy
89.94±0.24
34.55±1.11
IMQ
90.66±0.05
31.73±1.27
Matérn- 3/2
89.97±0.44
37.46±3.18
CIFAR-100
Gaussian
82.58±0.61
53.70±0.91
Appendix
Table 11: Five potential families on CIFAR. Bandwidths are fitted from zero-step class affinities and scores use T=120 . Values are macro averages over all six OOD datasets and three seeds.
ID
Anchor weighting
Near-OOD
Far-OOD
CIFAR-10
Uniform
88.59/42.36
91.07/31.09
Effective rank/raw
76.99/77.43
81.43/55.91
Effective rank/class
88.53/42.85
91.04/31.12
Effective rank/global
79.35/71.87
83.17/55.49
CIFAR-100
Uniform
79.46/63.16
83.41/51.10
Effective rank/raw
72.55/74.41
84.33/50.11
Appendix
Table 12: Static Gaussian anchor-weighting ablation. Each Near/Far entry is AUROC/FPR@95 at T=0 over three seeds. “Class” and “global” divide raw effective-rank weights by their class-wise or global mean.
Figure 5: Effective-rank anchor weighting relative to the uniform static field. Raw and global normalization usually reduce AUROC; class-wise normalization mostly returns to the uniform baseline. The isolated CIFAR-100 Far-OOD gain does not transfer to its Near-OOD counterpart or ImageNet-200.
Transition
Δ AUROC
Δ FPR@95
S1 → S2
+13.91
−25.90
S2 → S3
+3.18
−7.83
S3 → S4
0.00
0.00
S4 → S5
+0.95
−3.25
S5 → S6
+0.83
−3.78
MSP → S6
+7.26
−17.68
Appendix
Table 13: Full-split transition deltas in the static-reduction sequence. Each entry is the mean change over the three detector seeds and is written as AUROC/FPR@95.
Method
CIFAR-10
CIFAR-100
IN-200
IN-1K
MSP
88.03/48.17
80.27/54.80
83.34/54.84
76.02/65.67
Energy
87.58/61.33
80.91/55.60
82.50/60.22
75.89/68.57
MaxLogit
87.52/61.32
81.05/55.46
82.90/59.75
76.46/67.85
GEN
88.20/53.67
81.31/54.41
83.71/55.11
76.85/65.30
ReAct
87.11/63.55
80.77/56.39
81.87/62.46
77.38/66.74
Scale
82.55/80.46
80.99/55.68
84.84/57.30
81.36/59.77
Appendix
Table 14: Complete Near-OOD local comparison including CTM, CADRef, and LogitGap. Each entry is AUROC/FPR@95 under the unified OpenOOD v1.5 protocol. FPR@95 is the ID rejection rate at 95% OOD recall (OOD positive).
Method
CIFAR-10
CIFAR-100
IN-200
IN-1K
MSP
90.73/31.72
77.76/58.71
90.13/35.44
85.23/51.46
Energy
91.21/41.70
79.77/56.58
90.86/34.85
89.47/38.38
MaxLogit
91.10/41.67
79.67/56.73
91.11/34.03
89.58/38.21
GEN
91.35/34.73
79.68/56.71
91.36/32.11
89.77/35.62
ReAct
90.42/44.90
80.39/54.21
92.31/28.50
93.67/26.31
Scale
86.39/67.54
81.42/54.08
93.98/26.47
96.53/16.53
Appendix
Table 15: Complete Far-OOD local comparison including CTM, CADRef, and LogitGap. Each entry is AUROC/FPR@95 under the unified OpenOOD v1.5 protocol. FPR@95 is the ID rejection rate at 95% OOD recall (OOD positive).
Table 20
Configuration
AUROC rank
FPR rank
Composite
CADRef
4.000
3.250
3.625
Centroid–MSP
5.750
6.375
6.063
CTM
6.000
6.000
6.000
Scale
6.000
7.625
6.813
Centroid-only
6.750
7.250
7.000
LogitGap
6.875
7.750
7.313
Appendix
Table 18: Mean ranks for scoring configurations with complete eight-task coverage, ordered by AUROC rank. Per-task rankings include all available configurations, including KNN and ViM where evaluated; only complete-coverage configurations are listed. Ranks use the two-decimal means displayed in Tables 14 and 15 , with minimum ranks for ties. Lower is better.
Figure 6: Per-dataset AUROC change of the centroid–MSP baseline relative to MSP on CIFAR. Blue bars indicate improvement and red indicates degradation. Gains are broad but heterogeneous; peer CIFAR under CIFAR-100 is the only negative case. Exact AUROC/FPR@95 values are reported in Table 19 .
ID
OOD dataset
Type
MSP
Scale
CTM
Centroid–MSP
CIFAR-10
CIFAR-100
Near
87.19±.40/53.09±6.02
81.27±.91/81.78±4.87
88.66±.17/40.79±.91
88.45±.18/41.96±1.41
Tiny ImageNet
Near
88.87±.24/43.25±3.64
83.84±.02/79.14±4.95
90.32±.30/33.79±1.09
90.10±.33/34.33±1.43
MNIST
Far
92.63±1.92/23.64±7.13
90.58±3.62/48.69±18.84
92.82±.49/23.84±2.14
92.84±.45/23.72±1.75
SVHN
Far
91.46±.50/25.80±2.01
84.63±3.74/70.54±10.67
91.45±.28/26.72±1.17
91.57±.60/27.05±1.79
Places365
Far
88.92±.57/42.47±4.68
86.41±2.35/70.51±7.32
90.52±.30/33.46±.70
90.15±.32/34.77±.65
Textures
Far
89.89±.87/34.97±5.71
83.93±.42/80.40±4.80
91.93±.26/27.03±.33
91.76±.28/27.16±.63
Appendix
Table 19: Per-dataset CIFAR results under the unified OpenOOD v1.5 protocol. Each entry is AUROC/FPR@95; all values are mean ± standard deviation over three official ResNet-18 seeds.
Figure 7: Per-dataset change of the centroid–MSP baseline relative to MSP on the ImageNet benchmarks. Positive values are favorable in both panels. Grouping the three backbone/scale settings within each dataset exposes the shared pattern: large Far-OOD gains, especially on Textures, and a consistent loss on SSB-hard. Exact values appear in Table 20 .
ID/backbone
OOD dataset
Type
MSP
Scale
CTM
Centroid–MSP
IN-200/R18
SSB-hard
Near
80.38±.04/66.00±.14
82.08±.33/67.39±.78
79.43±.25/71.32±.29
79.59±.24/72.29±.36
NINCO
Near
86.29±.13/43.67±.93
87.59±.36/47.21±1.55
86.83±.17/45.10±1.31
87.07±.16/44.95±1.35
iNaturalist
Far
92.80±.30/26.49±.91
95.79±.56/18.41±2.30
95.90±.18/18.70±.99
96.12±.33/17.56±.68
Textures
Far
88.36±.16/44.58±.86
94.11±.08/29.80±.64
94.42±.07/25.13±.85
94.03±.20/26.13±.87
OpenImage-O
Far
89.24±.02/35.24±.27
92.04±.30/31.20±1.32
91.34±.12/29.74±.70
91.91±.06/28.83±.27
IN-1K/R50
SSB-hard
Near
72.09/74.48
77.35/67.73
68.53/80.07
69.15±.20/80.77±.30
Appendix
Table 20: Per-dataset ImageNet results. Each entry is AUROC/FPR@95. ImageNet-200 uses three official ResNet-18 seeds. ImageNet-1K MSP, Scale, and CTM use one fixed backbone, whereas Centroid–MSP varies three centroid banks.
Classes
Pointwise α∗
Δ vs. MSP
Δ vs. centroid
0.8=α∗
10
1.0
+0.64
−1.00
–
25
0.9
+2.39
−0.14
–
50
0.8
+2.37
+0.33
✓
100
0.8
+2.76
+0.67
✓
200
0.8
+4.74
+0.45
✓
500
0.8
+5.45
+0.69
✓
Appendix
Table 21: Exact values for the controlled nested class-count validation study. α∗ maximizes mean holdout AUROC at each class count. The two Δ columns evaluate the single pre-test choice α=0.8 against MSP ( α=0 ) and centroid-only ( α=1 ); positive values favor the fixed mixture. Results use one nested class sequence.
Figure 8: ImageNet-1K validation-only sample efficiency over three centroid seeds. Six samples per class capture most of the 12-sample performance, and the fixed α=0.8 curve nearly meets the retrospective holdout envelope from six samples onward. The blue curve maximizes mean holdout AUROC over α separately at each bank size; panel (b) uses the corresponding weights.
Method
1 image
2 images
3 images
4 images
Fixed α=0.8
92.185/31.17
92.184/31.13
92.185/31.13
92.183/31.13
Appendix
Table 22: ImageNet-1K validation-only calibration-budget sensitivity of the centroid–MSP baseline. Columns vary the number of ID calibration images per class; each entry is AUROC/FPR@95. One ID image per class is held out for evaluation, calibration subsets are nested within the other four, and all OOD validation examples are evaluated. The centroid bank is fixed. Positive affine standardization leaves either component’s rankings unchanged.
Target
Classes
OOD corr.
Best α
MSP
Fixed α=0.8
Centroid-only
CIFAR-10/R18
10
.880±.002
1.0
88.65/42.73
89.72/36.40
89.80/36.53
CIFAR-100/R18
100
.828±.003
1.0
83.62/46.53
84.99/45.07
85.00/44.67
IN-200/R18
200
.677±.016
1.0
87.81/38.33
90.75/30.94
90.77/31.44
IN-1K/R50
1000
.410±.015
.8
85.27/47.13
91.72/32.91
90.86/36.89
IN-1K/D121
1000
.315±.003
.6
83.77/51.90
90.31/39.16
88.81/42.57
Appendix
Table 23: Validation-holdout mechanism audit on the five natural dataset/backbone targets. “Corr.” is Pearson correlation between MSP and centroid scores on the designated OOD validation holdout. Score cells are AUROC/FPR@95; values aggregate three centroid seeds where applicable.
Method
CIFAR-10
CIFAR-100
IN-200
IN-1K
CTM
0.994
1.043
1.037
1.016
MSP
1.000
1.000
1.000
1.000
Centroid–MSP
1.041
1.085
1.090
1.039
SHE
1.045
1.180
0.776
1.069
RMDS
1.137
1.146
1.103
1.509
Scale
1.141
1.122
1.158
1.516
Appendix
Table 24: End-to-end batch-one latency relative to MSP. Lower is better. Per-image latency measures online inference; setup-sample counts for CTM and the centroid–MSP baseline are described in the accompanying resource audit.