- Rating
- 4
- Clarity
- 4
- Confidence
- 5
- Originality
- 2
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper proposes a new Mahalanobis-distance-based score function for out-of-distribution (OOD) detection. Existing Mahalanobis-based methods mainly rely on a fixed feature-space geometry, particularly a fixed covariance matrix. Recent work, DCC, improves this formulation by dynamically regularizing the covariance through residual-space projection. Building on this idea, the present paper further regularizes the covariance using both the principal and residual subspaces. In addition, it introduces Mahalanobis Gap Scoring (MGS), a theoretically justified scoring mechanism designed to improve OOD separability. The proposed method is evaluated on CIFAR and ImageNet benchmarks under both near-OOD and far-OOD settings.
Strengths and weaknesses
Quality: The proposed Mahalanobis distance is grounded in the established framework of dynamic covariance calibration, which is reasonable. The Mahalanobis gap scoring (MGS) method is designed to achieve a lower false positive rate (FPR), as suggested by Theorem 1. However, the reduction in FPR depends on satisfying certain conditions. The authors do not clarify whether these conditions are actually satisfied by the proposed MGS, leaving the theoretical guarantee
Clarity: The paper is well presented. The problem formulation and Figure 1 clearly convey the motivation, and the proposed method is easy to follow.
Significance: The design of the new Mahalanobis distance-based score is incremental. Compared with DCC, it additionally incorporates an adjustment in the principal space. However, the Mahalanobis Gap Scoring (MGS) strategy itself is novel. If the authors could extend MGS to other distance-based scores, it may have broader applicability and practical value.
Originality: The proposed Mahalanobis distance-based score is not new. The main originality of the paper appears to lie in the MGS component. However, the current analysis of MGS is insufficient and should be further strengthened.
Questions
Q1: What is the dimension of principal and residual space?
Q2: What is the computational cost of the proposed method? It would also be helpful to compare the efficiency of the proposed method with existing approaches to demonstrate whether it is practical for real-world deployment.
Q3: In Eq. 16, appears to refer to the proposed Mahalanobis distance. Can Theorem 1 be generalized to other distance functions, such as Euclidean distance or the vanilla Mahalanobis distance? In other words, is it possible to replace with alternative distance metrics while preserving the theoretical guarantee?
Limitations
No, I think the computing cost should also be one of the limitations
Paper formatting concerns
No major issues
Final justification
Most of my concerns are solved. The main remaining limitation is the distinction between theory and practical methods. Since this paper does not mainly focus on the theoretical part and, from the experiments, the method seems effective, I feel the limitation is not sufficient to reject the paper. But I think the discussion of the distinction should be included in the revised paper, and as I commented, it is better to include the performance of MGS with DCC and Mahalanobis++ in the final paper.
Thank you for highlighting this issue. We agree that Theorem 1 provides a conditional rather than unconditional guarantee. Specifically, the non-increase of FPR holds when the thresholds are compatible, UFPR>0, and 0<λgap<UFPR.
The value of Theorem 1 is to characterize a sufficient safe regime in which introducing the MGS term cannot increase FPR relative to nearest-prototype scoring. It also clarifies how the gap weight and decision thresholds jointly affect the rejection of OOD samples, thereby providing theoretical guidance for parameter selection.
In our current experiments, λgap is fixed before testing and is not selected by explicitly enforcing the population-level bound UFPR. Therefore, the empirical reduction in FPR and the theoretical result should be viewed as complementary evidence: the experiments demonstrate the practical effectiveness of MGS, while Theorem 1 identifies conditions under which its FPR behavior is theoretically controlled. We will revise the manuscript to make this scope and distinction clearer.
Thank you for this insightful question. We clarify that the proof structure of Theorem 1 is not specific to the covariance construction of our proposed Mahalanobis distance. Instead, it relies on ordered class-conditional dissimilarities, the non-negativity of the gap term, threshold-compatible decision thresholds, and a positive safe upper bound on the gap weight.
More generally, let d(⋅,⋅) be a class-conditional dissimilarity function for which a smaller value indicates greater proximity. For a test feature f(x) and class prototypes μ1,…,μC, define qc=d(f(x),μc) and sort these values as q(1)≤q(2)≤⋯≤q(C).
The generalized gap score is defined as Gd(x)=C−11∑j=2C(q(j)−q(1)).
The corresponding nearest-prototype score and gap-enhanced score are defined as Sneard(x)=−q(1) and Sλd(x)=−q(1)+λgapGd(x), respectively.
Because q(1) is the minimum class-conditional dissimilarity, each difference q(j)−q(1) is non-negative, and therefore Gd(x)≥0. Consequently, the same set-inclusion argument used in Theorem 1 remains applicable. Specifically, if the decision thresholds are threshold-compatible, UFPRd>0, and the gap weight satisfies 0<λgap<UFPRd, then the FPR of the generalized gap-enhanced score is no greater than that of the corresponding nearest-prototype score.
Therefore, the sufficient FPR guarantee is not inherently restricted to our adaptive Mahalanobis formulation. It can be extended to other prototype-based dissimilarities satisfying the same conditions, including Euclidean distance and vanilla Mahalanobis distance. Similarity functions can also be used after being converted into dissimilarities. For example, cosine similarity can be converted into cosine distance as dcos(f,μ)=1−cos(f,μ).
We emphasize, however, that this is a generalization of the theoretical proof structure. Our current experiments validate MGS only with the proposed adaptive Mahalanobis formulation, and we do not claim that every alternative dissimilarity will yield the same empirical improvement. We will clarify this distinction in the revised manuscript. A systematic evaluation of MGS with Euclidean, vanilla Mahalanobis, cosine, and learned dissimilarities is an important direction for extending its practical applicability.
Thank you for this valuable suggestion. We agree that the motivation and role of MGS should be explained more clearly. We will strengthen the analysis from the following three perspectives.
What does MGS measure?
MGS measures the relative separation between the nearest class prototype and the remaining prototypes. For sorted distances d(1)≤⋯≤d(C), it is defined as MGS(x)=C−11∑j=2C(d(j)−d(1)). Unlike nearest-distance scoring, it captures the full class-distance structure.
How does MGS help?
The final score is S(x)=−d(1)+λgapMGS(x). The first term measures proximity to the nearest ID prototype, while MGS measures how distinctly the sample is associated with that class. On CIFAR-100, adding MGS reduces FPR@95 from 28.48% to 27.43% and improves AUROC from 92.50% to 93.20%.
Why is MGS necessary?
A nearest-distance score alone may be insufficient because two samples can have similar nearest-prototype distances but very different relationships to the remaining classes. An ID sample is generally expected to exhibit a more distinctive class association, with one relatively close prototype and larger distances to the other prototypes. In contrast, an OOD sample often exhibits a less discriminative and flatter class-distance profile. MGS captures this relative class-separation information, which is discarded by nearest-distance scoring.
Thank you for this question. Let D denote the dimensionality of the backbone feature. The principal and residual subspaces have dimensions K and D−K, respectively. Following DCC, we set K=300 for DenseNet, K=50 for WRN, and K=512 for the ImageNet setting. We will explicitly report both K and D−K for each backbone in the revised manuscript.
Thank you for raising this practical concern. We additionally report the wall-clock runtime and OOD detection performance on CIFAR-100 under the same hardware, backbone, batch size, and evaluation settings.
We provide two implementations of AMG. The first follows the direct matrix-inversion procedure used by the original DCC implementation. For each test feature f, let fA,fB∈RD denote its principal- and residual-subspace components, respectively. AMG constructs the sample-dependent covariance matrix as
Σ′(f)=Σ+αfAfA⊤−βfBfB⊤
where Σ∈RD×D is the base covariance matrix and α,β>0 are the calibration coefficients. The DCC-style implementation directly computes
M(f)=(Σ′(f))−1=(Σ+αfAfA⊤−βfBfB⊤)−1
for every test sample. Consequently, it performs a full D×D matrix inversion per sample, with approximately O(D3) per-sample complexity for this inverse-computation component. This implementation requires 11 min 59 s, corresponding to 1.17× the runtime of DCC.
We further provide a mathematically equivalent implementation based on the Woodbury low-rank inverse identity. The key observation is that Σ′(f) differs from the base covariance Σ by only two rank-one terms. Defining
U(f)=[fA,fB]∈RD×2,R=diag(α,−β)
gives
Σ′(f)=Σ+U(f)RU(f)⊤
We precompute Σ−1 once before test-time scoring and obtain the sample-dependent precision matrix as
M(f)=Σ−1−Σ−1U(f)(R−1+U(f)⊤Σ−1U(f))−1U(f)⊤Σ−1
Because U(f) contains only two update directions, the inner matrix R−1+U(f)⊤Σ−1U(f) has size 2×2. Therefore, the optimized implementation replaces a full D×D inversion for every test sample with a one-time O(D3) computation of Σ−1 followed by approximately O(D2) computation per sample.
This optimization changes only the numerical procedure used to compute the inverse covariance. It does not modify the definitions of ACC, CDS, MGS, the calibrated Mahalanobis distance, or the final OOD score. The two implementations are therefore mathematically equivalent up to minor floating-point differences. Accordingly, AUROC remains unchanged at 93.20%, while FPR@95 changes only marginally from 27.43% to 27.40%.
The optimized implementation reduces the runtime from 11 min 59 s to 8 min 30 s, corresponding to a 29.1% reduction relative to the DCC-style implementation. It is also 17.3% faster than DCC while retaining the performance improvement of AMG.