Sharpness-Aware Fine-Tuning for OOD Detection
- 9 April 2026
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Image Processing
- Vol. 35 (10577149) , 4064-4077
Abstract
The out-of-distribution (OOD) detection task is crucial for the real-world deployment of machine learning models. In this paper, we propose to study the problem from the perspective of Sharpness-aware Minimization (SAM). Compared with traditional optimizers such as SGD, SAM can better improve the model performance and generalization ability, and this is closely related to OOD detection [1]. Therefore, instead of using SGD, we propose to fine-tune the model with SAM, and observe that the score distributions of in-distribution (ID) data and OOD data are pushed away from each other. Besides, with our carefully designed loss, the fine-tuning process is very time-efficient. The OOD performance improvement can be observed after fine-tuning the model within 1 epoch. Moreover, our method is very flexible and can be used to improve the performance of different OOD detection methods. Extensive experiments have demonstrated that our method achieves state-of-the-art performance on widely-used OOD benchmarks across different architectures. Moreover, comprehensive ablation studies and theoretical analyses are discussed to support the empirical results.Keywords
Funding Information
- Fundamental Research Funds for the Central Universities (2022XKRC015)
- National Natural Science Foundation of China (62372033)
- Natural Science Foundation of Beijing Municipality (L252025)
This publication has 51 references indexed in Scilit:
- Rethinking machine unlearning for large language modelsNature Machine Intelligence, 2025
- GalLoP: Learning Global and Local Prompts for Vision-Language Models2024
- DICE: Leveraging Sparsification for Out-of-Distribution Detection2022
- Learning to Prompt for Vision-Language ModelsInternational Journal of Computer Vision, 2022
- Big Transfer (BiT): General Visual Representation Learning2020
- Identity Mappings in Deep Residual Networks2016
- Deep neural networks are easily fooled: High confidence predictions for unrecognizable images2015
- Describing Textures in the Wild2014
- SUN database: Large-scale scene recognition from abbey to zoo2010
- ImageNet: A large-scale hierarchical image database2009