Exploiting Local Flatness for Efficient Out-of-Distribution Detection

📅 2026-06-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of reliably detecting out-of-distribution (OOD) data in deployed machine learning systems by revealing a fundamental distinction between in-distribution (ID) and OOD samples in the local flatness of the loss landscape: OOD samples exhibit significantly higher Hessian curvature. Building on this insight, the authors propose Fold, a lightweight detection framework that enhances ID/OOD separability through an approximation of the feature-space Hessian combined with partial feature normalization. To eliminate reliance on external data, they further introduce AutoFold, a self-supervised tuning mechanism that automatically calibrates the detector. The method requires no model retraining and incurs computational overhead equivalent to a single forward pass, achieving an average AUROC improvement of 1.63% and a 2.30% reduction in FPR95 across standard OOD benchmarks.
📝 Abstract
Detecting out-of-distribution (OOD) data is crucial for reliable machine learning deployment. Among detection strategies, post-hoc methods are particularly attractive due to their efficiency, as they operate directly on pre-trained networks without requiring retraining. Within this paradigm, one promising direction exploits loss-landscape curvature to estimate model uncertainty; however, such methods incur substantial computational cost and rely on implicit assumptions about how landscape flatness differs between in-distribution (ID) and OOD data. In this work, we provide the first systematic investigation of this curvature discrepancy and show that OOD inputs exhibit larger Hessian curvature than ID data, with the gap widening under stronger distributional shifts. Motivated by these observations, we propose Fold, a lightweight flatness-modulated OOD detector that leverages the feature Hessian and partial feature normalization to improve ID-OOD separability while avoiding costly parameter-space curvature approximations. To optimally adapt this normalization across diverse datasets, we further introduce AutoFold, a self-supervised tuning scheme that synthesizes pseudo-OOD samples via ID logit masking for automatic calibration without requiring external data. Experiments on OOD benchmarks show that Fold outperforms prior methods, improving the average AUROC by 1.63% and reducing FPR95 by 2.30%, while maintaining computational efficiency comparable to a standard forward pass. Supported by theoretical analysis and extensive ablations, Fold provides a principled and practical solution for robust real-world deployment.
Problem

Research questions and friction points this paper is trying to address.

out-of-distribution detection
loss landscape curvature
model uncertainty
distributional shift
post-hoc detection
Innovation

Methods, ideas, or system contributions that make the work stand out.

out-of-distribution detection
loss landscape flatness
feature Hessian
self-supervised calibration
post-hoc uncertainty estimation
🔎 Similar Papers