Out-of-Distribution (OOD) detection is a task that is witnessing increasing interest in machine and deep learning, since it deals with the problem of signaling inputs coming outside of the data-generating distribution on which a certain model has been trained. Different approaches have been proposed, some of which are based on network architecture design, others consisting in obtaining confidence scores without retraining. Recently, some studies have pointed out that applying density estimation-based anomaly detection scores on the latent spaces associated with hidden layers of neural networks may be beneficial for improving out-of-distribution detection. In this work, we provide a contribution to this research line by proposing a novel out-of-distribution approach, called CF-OOD (for Concentration-Free Out-of-Distribution detection), based on the Concentration-Free Outlier Factor (CFOF), a score relying on the concept of reverse nearest neighborhood, which has been originally designed for effective anomaly detection in the context of very high-dimensional data. Indeed, the above measure is particularly suitable for the typically large hidden representations of deep learning architectures. Experiments highlight that the novel method is able to provide state-of-the-art performances on a plurality of deep learning architectures and out-of-distribution datasets, and also in the challenging low-regime scenario. Finally, we show that the choice of the neighborhood parameter value is not critical and, moreover, that the scores can be reliably estimated by means of a sampling procedure exploiting only a small fraction of the in-distribution data.
CF-OOD: Concentration-Free Density Estimation for Reliable Out-of-Distribution Detection
Angiulli, Fabrizio;Fassetti, Fabio;Zupi, Maria Pia
2026-01-01
Abstract
Out-of-Distribution (OOD) detection is a task that is witnessing increasing interest in machine and deep learning, since it deals with the problem of signaling inputs coming outside of the data-generating distribution on which a certain model has been trained. Different approaches have been proposed, some of which are based on network architecture design, others consisting in obtaining confidence scores without retraining. Recently, some studies have pointed out that applying density estimation-based anomaly detection scores on the latent spaces associated with hidden layers of neural networks may be beneficial for improving out-of-distribution detection. In this work, we provide a contribution to this research line by proposing a novel out-of-distribution approach, called CF-OOD (for Concentration-Free Out-of-Distribution detection), based on the Concentration-Free Outlier Factor (CFOF), a score relying on the concept of reverse nearest neighborhood, which has been originally designed for effective anomaly detection in the context of very high-dimensional data. Indeed, the above measure is particularly suitable for the typically large hidden representations of deep learning architectures. Experiments highlight that the novel method is able to provide state-of-the-art performances on a plurality of deep learning architectures and out-of-distribution datasets, and also in the challenging low-regime scenario. Finally, we show that the choice of the neighborhood parameter value is not critical and, moreover, that the scores can be reliably estimated by means of a sampling procedure exploiting only a small fraction of the in-distribution data.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


