Skip to main content
QUICK REVIEW

[Paper Review] GradOrth: A Simple yet Efficient Out-of-Distribution Detection with Orthogonal Projection of Gradients

Sima Behpour, Thang Doan|arXiv (Cornell University)|Aug 1, 2023
Anomaly Detection Techniques and ApplicationsComputer Science3 citations
TL;DR

GradOrth proposes a novel out-of-distribution (OOD) detection method that leverages orthogonal projection of gradients onto low-rank subspaces derived from in-distribution (ID) data activations via SVD. By measuring the norm of the orthogonal projection of gradients, it identifies OOD samples as those with weak correlation to ID data subspaces, achieving a 2.71% to 8.05% reduction in FPR95 compared to state-of-the-art methods.

ABSTRACT

Detecting out-of-distribution (OOD) data is crucial for ensuring the safe deployment of machine learning models in real-world applications. However, existing OOD detection approaches primarily rely on the feature maps or the full gradient space information to derive OOD scores neglecting the role of most important parameters of the pre-trained network over in-distribution (ID) data. In this study, we propose a novel approach called GradOrth to facilitate OOD detection based on one intriguing observation that the important features to identify OOD data lie in the lower-rank subspace of in-distribution (ID) data. In particular, we identify OOD data by computing the norm of gradient projection on the subspaces considered important for the in-distribution data. A large orthogonal projection value (i.e. a small projection value) indicates the sample as OOD as it captures a weak correlation of the ID data. This simple yet effective method exhibits outstanding performance, showcasing a notable reduction in the average false positive rate at a 95% true positive rate (FPR95) of up to 8% when compared to the current state-of-the-art methods.

Motivation & Objective

  • To address the challenge of reliable OOD detection in deep learning models, especially in safety-critical applications.
  • To improve detection performance by focusing on the most informative gradient subspaces of in-distribution data, rather than full gradient space or heuristic sparsification.
  • To provide a principled, efficient, and post-hoc OOD detection method that leverages gradient geometry without retraining.
  • To demonstrate that critical discriminative features for OOD detection lie in low-rank subspaces of gradients from ID data.

Proposed method

  • The method computes the low-rank subspace of in-distribution (ID) data by applying singular value decomposition (SVD) to the activations of a pre-trained network on a small random subset of ID data.
  • It projects the full gradient of a test sample onto this learned ID subspace and computes the norm of the orthogonal (perpendicular) component of the gradient.
  • A large orthogonal projection norm indicates weak correlation with ID data, signaling the sample as OOD.
  • The OOD score is defined as the norm of the orthogonal projection, with higher values indicating higher OOD likelihood.
  • The approach is post-hoc, requiring no retraining and only a single forward pass and gradient computation per test sample.
  • The method is efficient and scalable, relying only on SVD of a small ID subset and standard backpropagation.
Figure 1 : The main idea of GradOrth : Measuring the orthogonal projection of the gradient of a testing sample onto a $k$ -dimension (e.g $k$ =2 here) subspace of pre-trained network on ID data, by the angle $\alpha$ between $\overrightarrow{g(x_{i})}=\nabla_{\theta^{L}}\mathcal{L}({\bm{\theta}}^{L}
Figure 1 : The main idea of GradOrth : Measuring the orthogonal projection of the gradient of a testing sample onto a $k$ -dimension (e.g $k$ =2 here) subspace of pre-trained network on ID data, by the angle $\alpha$ between $\overrightarrow{g(x_{i})}=\nabla_{\theta^{L}}\mathcal{L}({\bm{\theta}}^{L}

Experimental results

Research questions

  • RQ1Can the most informative gradient subspaces for OOD detection be identified via low-rank decomposition of in-distribution activations?
  • RQ2Does orthogonal projection of gradients onto these subspaces improve OOD detection performance compared to full gradient norm or feature-based methods?
  • RQ3Can a principled, efficient, and post-hoc OOD detection method be designed using gradient subspace geometry?
  • RQ4How does GradOrth compare to state-of-the-art methods in terms of FPR95 and ID accuracy?

Key findings

  • GradOrth achieves a reduction in FPR95 ranging from 2.71% to 8.05% compared to state-of-the-art baselines across multiple benchmarks.
  • The method maintains high in-distribution (ID) classification accuracy while significantly improving OOD detection reliability.
  • The ablation study confirms that the low-rank subspace of gradients is more effective than full gradient space or random subspaces for OOD detection.
  • Theoretical and empirical analyses validate that orthogonal gradient projection effectively captures weak correlation with ID data, serving as a strong OOD indicator.
  • GradOrth outperforms methods like GradNorm, ODIN, and MSP, especially in reducing false positives at 95% true positive rate.
  • The method is computationally efficient and does not require model fine-tuning or architectural changes.
Figure 2 : Orthogonal Projection
Figure 2 : Orthogonal Projection

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.