Skip to main content
QUICK REVIEW

[Paper Review] RankFeat: Rank-1 Feature Removal for Out-of-distribution Detection

Song Yue, Nicu Sebe|arXiv (Cornell University)|Sep 18, 2022
Anomaly Detection Techniques and ApplicationsComputer Science15 citations
TL;DR

RankFeat is a post-hoc out-of-distribution (OOD) detection method that removes the rank-1 component—defined by the largest singular value and its corresponding singular vectors—from high-level deep features. By doing so, it significantly reduces overconfident predictions on OOD samples, achieving state-of-the-art performance with a 17.90% lower average FPR95 and 5.44% higher AUROC than prior methods.

ABSTRACT

The task of out-of-distribution (OOD) detection is crucial for deploying machine learning models in real-world settings. In this paper, we observe that the singular value distributions of the in-distribution (ID) and OOD features are quite different: the OOD feature matrix tends to have a larger dominant singular value than the ID feature, and the class predictions of OOD samples are largely determined by it. This observation motivates us to propose exttt{RankFeat}, a simple yet effective exttt{post hoc} approach for OOD detection by removing the rank-1 matrix composed of the largest singular value and the associated singular vectors from the high-level feature (\emph{i.e.,} $\mathbf{X}{-} \mathbf{s}_{1}\mathbf{u}_{1}\mathbf{v}_{1}^{T}$). exttt{RankFeat} achieves the \emph{state-of-the-art} performance and reduces the average false positive rate (FPR95) by 17.90\% compared with the previous best method. Extensive ablation studies and comprehensive theoretical analyses are presented to support the empirical results.

Motivation & Objective

  • Address the challenge of overconfident predictions by deep learning models on out-of-distribution (OOD) data in real-world deployment.
  • Identify a key structural difference in singular value distributions between in-distribution (ID) and OOD features: OOD features exhibit a significantly larger dominant singular value.
  • Develop a simple, post-hoc OOD detection method that does not require retraining or architectural changes to pre-trained models.
  • Improve generalization and robustness of OOD detection across diverse models, network depths, and benchmarks.

Proposed method

  • Extract high-level features (e.g., from Block 3 or 4 of ResNet) from a pre-trained model.
  • Perform truncated singular value decomposition (SVD) on the feature matrix to isolate the top singular triplet: σ₁, u₁, v₁.
  • Remove the rank-1 matrix σ₁·u₁·v₁ᵀ from the original feature matrix to obtain a perturbed feature representation.
  • Compute the OOD score using the logits derived from the rank-1-removed features, leveraging uncertainty or energy-based scoring.
  • Apply the method at multiple network layers and fuse features (e.g., via logit averaging) to enhance performance.
  • Use iterative power iteration (PI) to approximate the dominant singular vector pair efficiently, reducing computational cost without performance degradation.

Experimental results

Research questions

  • RQ1Does the dominant singular value in high-level features differ significantly between in-distribution and out-of-distribution samples?
  • RQ2Can removing the rank-1 component of the feature matrix effectively reduce overconfident predictions on OOD data?
  • RQ3How does the performance of RankFeat compare to state-of-the-art post-hoc OOD detection methods across different models and datasets?
  • RQ4What is the theoretical basis for the effectiveness of rank-1 removal in improving OOD detection?
  • RQ5How do different fusion strategies and network layer choices affect the final OOD detection performance?

Key findings

  • RankFeat reduces the average FPR95 by 17.90% compared to the previous state-of-the-art method, demonstrating superior OOD detection performance.
  • The method improves the average AUROC by 5.44% across benchmarks, indicating better separation between ID and OOD data distributions.
  • Extensive ablation shows that removing only the rank-1 component yields the best performance, while removing higher-rank components (n > 1) degrades results.
  • Fusing features from multiple layers (e.g., Block 3 and Block 4) via logit averaging achieves the best performance, outperforming element-wise or feature-level fusion.
  • Theoretical analysis confirms that rank-1 removal reduces the upper bound of the OOD score more effectively and makes OOD feature statistics closer to random matrices.
  • The method is computationally efficient, with PI-based approximation achieving 48.41% time reduction and only 4.89% higher cost than ReAct, while supporting batch inference.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.