Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Nov 18;14(1):28444.
doi: 10.1038/s41598-024-79934-7.

Exploring feature sparsity for out-of-distribution detection

Affiliations

Exploring feature sparsity for out-of-distribution detection

Qichao Chen et al. Sci Rep. .

Abstract

Out-of-distribution (OOD) detection is a crucial problem in practice, especially, for the safe deployment of machine learning models in industrial settings. Previous work has used free energy as a score function and proposed a fine-tuning method that utilized OOD data in the training phase of the classification model, which achieves a higher performance on the OOD detection task compared with traditional methods. One key drawback, however, is that the loss function parameters are highly dependent on involved datasets, which means it cannot be dynamically adapted and implemented in others settings; in other words, the general ability of the energy score is considerably limited. In this work, our point of departure is to enlarge distinguishability between in-distribution features and OOD data. Consequently, we present a simple yet effective sparsity-regularized (SR) tuning framework for this purpose. Our framework has two types of workflows depending on if external OOD data is available, the complexity of the original training loss is sharply reduced by adopting this modification, meanwhile, the adapted ability and detection performance are enhanced. Also, we contribute a mini dataset as a light and efficient alternative of the previous large-scale one. In the experiments, we verify the effectiveness of our framework in a wide range of typical datasets along with common network architectures.

PubMed Disclaimer

Conflict of interest statement

Declarations Competing interests The authors declare that there is no any conflict of interest or competing interests that could be perceived as influencing the objectivity of this research.

Figures

Fig. 1
Fig. 1
The optimization process of our Sparsity-Regularized framework. We exert a sparsification for the ID feature when fine-tine the model, and the solid paths indicate the flow of formula image, and the dashed paths indicate the flow of formula image. Note that the dashed part is optional, and the total tuning loss is formula image when there is no formula image available; otherwise, formula image.
Algorithm 1
Algorithm 1
Sparsity-regularized framework.
Fig. 2
Fig. 2
The visualization of detection. The larger the intersection area is, the worse the OOD detection performance is in the above six graphs.
Fig. 3
Fig. 3
The original data pool of “tiny”. Samples labelled with “in” are too similar to ID data and must be removed, while samples labelled with “out” can be retained as elements of “tiny”.
Fig. 4
Fig. 4
ROC curves for OOD detection and classifier accuracy among three models. We can observe that the sparsity-regularized method enhances detection performance without any degradation of classification accuracy.

References

    1. Singh, A. & Gaurav, K. Deep learning and data fusion to estimate surface soil moisture from multi-sensor satellite images. Sci. Rep.13, 2251. 10.1038/s41598-023-28939-9 (2023). - PMC - PubMed
    1. Chen, J., Pan, S., Chan, Y., Ni, Y. & Ye, D. A new method based on YOLOv5 and multiscale data augmentation for visual inspection in substation. Sci. Rep.14, 9362. 10.1038/s41598-024-60126-2 (2024). - PMC - PubMed
    1. He, K., Zhang, X., Ren, S. & Sun, J. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision 1026–1034 (2015).
    1. Hu, Y. et al. Planning-oriented autonomous driving. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 17853–17862 (2023).
    1. Oh, S., Kim, N. & Ryu, J. Analyzing to discover origins of CNNs and ViT architectures in medical images. Sci. Rep.14, 8755. 10.1038/s41598-024-58382-3 (2024). - PMC - PubMed

LinkOut - more resources