[Paper Review] Sketching Curvature for Efficient Out-of-Distribution Detection for Deep Neural Networks
SCOD is a scalable, architecture-agnostic framework that uses matrix sketching to efficiently approximate the Fisher information matrix's top eigenspace, enabling fast, post-hoc out-of-distribution (OoD) detection by measuring input atypicality via gradient orthogonality to training curvature directions. It achieves SOTA or comparable OoD detection performance with significantly lower computational cost than sampling-based baselines like Deep Ensembles or KFAC Laplace.
In order to safely deploy Deep Neural Networks (DNNs) within the perception pipelines of real-time decision making systems, there is a need for safeguards that can detect out-of-training-distribution (OoD) inputs both efficiently and accurately. Building on recent work leveraging the local curvature of DNNs to reason about epistemic uncertainty, we propose Sketching Curvature of OoD Detection (SCOD), an architecture-agnostic framework for equipping any trained DNN with a task-relevant epistemic uncertainty estimate. Offline, given a trained model and its training data, SCOD employs tools from matrix sketching to tractably compute a low-rank approximation of the Fisher information matrix, which characterizes which directions in the weight space are most influential on the predictions over the training data. Online, we estimate uncertainty by measuring how much perturbations orthogonal to these directions can alter predictions at a new test input. We apply SCOD to pre-trained networks of varying architectures on several tasks, ranging from regression to classification. We demonstrate that SCOD achieves comparable or better OoD detection performance with lower computational burden relative to existing baselines.
Motivation & Objective
- To address the challenge of efficiently detecting out-of-distribution (OoD) inputs in real-time deep learning systems.
- To provide a task-relevant, post-hoc measure of epistemic uncertainty that is scalable to large DNNs.
- To avoid the high computational cost of Monte Carlo sampling or full Hessian computation in uncertainty estimation.
- To enable application of uncertainty estimation to any pre-trained DNN, regardless of architecture or training process.
- To improve OoD detection performance by focusing on curvature in the weight space relevant to the task.
Proposed method
- Offline, SCOD computes a low-rank approximation of the Fisher information matrix using matrix sketching techniques applied to gradients over the training data.
- The method identifies the top eigenspace of the Fisher matrix, representing weight directions most influential on model predictions.
- Online, it estimates input atypicality by measuring the orthogonality of the test input's gradient to the training curvature subspace.
- This orthogonality score serves as a scalar uncertainty metric indicating how far a test input is from the training distribution.
- The approach avoids sampling from the posterior and instead uses backpropagation and efficient matrix operations for real-time inference.
- It restricts curvature analysis to the last few layers to improve performance and reduce computational load, especially on large models.
Experimental results
Research questions
- RQ1Can a low-rank approximation of the Fisher information matrix be used to efficiently estimate epistemic uncertainty for OoD detection?
- RQ2How does the performance of SCOD compare to sampling-based methods like Deep Ensembles and KFAC Laplace in terms of AUROC and inference cost?
- RQ3Does focusing curvature analysis on the final layers of a DNN improve OoD detection performance and efficiency?
- RQ4Can SCOD be applied to any pre-trained DNN without retraining, regardless of architecture or training data distribution?
- RQ5How does SCOD’s uncertainty metric compare to naive approaches that use model output confidence as a proxy for uncertainty?
Key findings
- SCOD achieves AUROC scores that match or exceed those of Deep Ensembles on all evaluated regression and classification tasks, including CIFAR10 and TaxiNet.
- On the TaxiNet regression task with 50,000 training points, SCOD outperforms Local Ensembles, which suffer from poor performance on large datasets due to suboptimal Hessian estimation via mini-batching.
- SCOD’s uncertainty metric is computed without any weight sampling, resulting in significantly lower inference overhead compared to KFAC Laplace and Deep Ensembles.
- When curvature analysis is restricted to the last layers, SCOD achieves higher AUROC and faster runtime, especially on CIFAR10, where full-weight-space analysis underperforms the naive baseline.
- On classification tasks, SCOD surpasses the naive baseline that uses softmax confidence, even though the latter performs well on such tasks.
- The method is robust to model architecture and can be applied post-hoc to pre-trained models, including a pre-trained DenseNet121 on CIFAR10, without retraining.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.