Exploiting Local Flatness for Efficient Out-of-Distribution Detection
Abstract
Detecting out-of-distribution (OOD) data is crucial for reliable ma-chine learning deployment. Among detection strategies, post-hoc methods areparticularly attractive due to their efficiency, as they operate directly on pre-trainednetworks without requiring retraining. Within this paradigm, one promising di-rection exploits loss-landscape curvature to estimate model uncertainty; however,such methods incur substantial computational cost and rely on implicit assump-tions about how landscape flatness differs between in-distribution (ID) and OODdata. In this work, we provide the first systematic investigation of this curvaturediscrepancy and show that OOD inputs exhibit larger Hessian curvature than IDdata, with the gap widening under stronger distributional shifts. Motivated by theseobservations, we propose F OLD, a lightweight flatness-modulated OOD detectorthat leverages the feature Hessian and partial feature normalization to improveID-OOD separability while avoiding costly parameter-space curvature approxi-mations. To optimally adapt this normalization across diverse datasets, we furtherintroduce AUTO F OLD, a self-supervised tuning scheme that synthesizes pseudo-OOD samples via ID logit masking for automatic calibration without requiringexternal data. Experiments on OOD benchmarks show that F OLD outperformsprior methods, improving the average AUROC by 1.63% and reducing FPR95by 2.30%, while maintaining computational efficiency comparable to a standardforward pass. Supported by theoretical analysis and extensive ablations, F OLDprovides a principled and practical solution for robust real-world deployment.