Unsupervised Evaluation of Out-of-distribution Detection: A Data-centric Perspective

Yuhang Zhang, Weihong Deng, Liang ZhengarXiv 2023 · DOI

Abstract

Machine learning models often encounter out-of-distribution (OOD) data in real-world deployments, necessitating robust detection mechanisms. However, evaluating these detectors typically requires labeled datasets, which are rarely available in the wild. This paper introduces the first framework for the unsupervised evaluation of OOD detection. By calculating a novel metric called Gscore, which measures the separability of OOD confidence scores, researchers can predict a detector's performance (e.g., AUROC) without ground-truth labels. The authors validate this approach using Gbench, a comprehensive benchmark of 200 real-world OOD datasets, demonstrating high predictive accuracy and strong correlation with standard performance metrics.

Introduction: The Challenge of OOD Evaluation in the Wild

Machine learning models are frequently challenged by data that deviates significantly from their training distribution. While numerous methods exist to detect these out-of-distribution (OOD) samples, evaluating their effectiveness in real-world deployments remains a significant hurdle. Standard evaluation protocols rely on labeled test sets to distinguish between In-Distribution (IND) and OOD samples. In practice, such labels are unavailable, creating a "blind spot" for safety-critical applications. This research shifts the focus from developing new detectors to creating a "safety gauge" that monitors detector performance in the wild without human intervention.

The framework for unsupervised OOD evaluation compares labeled test sets (where AUROC is known) to unlabeled real-world deployments where performance must be estimated.

Methodology: Quantifying Separability with Gscore

The core observation of this work is that OOD confidence scores typically follow a bimodal distribution, with distinct peaks for IND and OOD samples. The degree of separation between these peaks serves as a proxy for detector performance. To quantify this without labels, the authors propose Gscore, an unsupervised performance indicator.

The framework employs Unilateral Density Estimation (UDE) to model these distributions. Unlike standard clustering methods like K-means or Gaussian Mixture Models (GMM), UDE leverages a small subset of known IND data from the training phase to anchor the IND distribution. This allows for more accurate separation in the unlabeled test set, especially when distributions overlap or are imbalanced. The Gscore is then calculated using distance metrics like Wasserstein distance and mapped to predicted AUROC values via a linear regression model.

Visualizing the Separability Signal

The effectiveness of Gscore lies in its ability to capture the structural information within the detector's own output. As shown in the figure below, different OOD datasets present varying levels of difficulty. When the IND and OOD distributions are well-separated, both the Gscore and AUROC are high. Conversely, significant overlap leads to lower scores, signaling a drop in detector reliability.

Visualizing the relationship between OOD data difficulty, the resulting bimodal distribution of confidence scores, and the corresponding Gscore and AUROC metrics.

The Gbench Benchmark

To validate their approach, the authors introduced Gbench, a massive benchmark suite comprising 200 real-world OOD datasets. Gbench covers a wide range of domains, including medical imaging, satellite photography, and species classification. By meta-training their regression model on 150 of these datasets and testing on the remaining 50, the authors demonstrated that the relationship between Gscore and performance is highly generalizable across diverse data types and model architectures.

Key Results and Insights

  • High Predictive Accuracy: The proposed UDE + Wasserstein distance method achieves remarkable accuracy, predicting AUROC with a Root Mean Square Error (RMSE) of approximately 3.6% without using any labels.
  • Strong Correlation: The study found a Pearson correlation coefficient ($\gamma$) exceeding 0.97 between Gscore and actual performance across various neural network backbones like ResNet and DenseNet.
  • Data-Centric Perspective: Performance is shown to be a property of the specific data pair (IND vs. OOD) rather than just the model itself. A detector might excel at one task but fail at another; Gscore allows for this nuance to be captured during deployment.
  • Practical Robustness: The method is robust enough to work with small batches of 50 samples, making it suitable for real-time monitoring.

Conclusion

This work provides a vital "safety gauge" for AI systems, allowing engineers to know when their OOD detectors are failing in the wild before a critical error occurs. While challenges remain—such as predicting performance across different detectors on fixed data or handling extreme distribution overlap—this framework offers a scalable tool for ensuring the reliability of AI systems in unpredictable real-world environments.

Summary updated

BibTeX
@misc{zhang2023unsupervised,
  author = {Yuhang Zhang and Weihong Deng and Liang Zheng},
  title = {{Unsupervised Evaluation of Out-of-distribution Detection: A Data-centric Perspective}},
  year = {2023},
  eprint = {2302.08287},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.08287},
}
Figure