Predictive Sample Assignment for Semantically Coherent Out-of-Distribution Detection

Zhimao Peng, Enguang Wang, Xialei Liu, Ming-Ming Cheng · DOI

Introduction

Out-of-Distribution (OOD) detection is a critical component for deploying robust machine learning models in the real world. Traditional OOD detection assumes a clean split between labeled In-Distribution (ID) training data and unknown OOD data encountered only at test time. However, real-world data collection often yields large, unlabeled auxiliary datasets that contain a mixture of both ID and OOD samples. This scenario, known as Semantically Coherent Out-of-Distribution (SCOOD) detection, presents a significant challenge: how can a model effectively leverage this noisy auxiliary data without being degraded by misclassified samples?

Existing approaches typically attempt to filter unlabeled data into ID and OOD categories using unsupervised clustering. Unfortunately, early in the training process, model representations are often too weak to produce reliable clusters. Forcing every unlabeled sample into a binary category introduces "dirty" data into the training pipeline, which ultimately hampers the model's ability to distinguish between known and unknown classes.

The PSA Framework

To address these limitations, this paper introduces Predictive Sample Assignment (PSA), a framework designed to improve the purity of training data through a conservative, ternary selection strategy. PSA moves away from binary classification of auxiliary data, instead utilizing a dual-threshold approach based on model uncertainty.

1. Ternary Sample Assignment

Rather than forcing a choice between ID and OOD, PSA categorizes each unlabeled sample into one of three groups based on its energy score:

  • Auxiliary ID Sample: High-confidence samples that align with known classes.
  • Auxiliary OOD Sample: High-confidence samples that clearly deviate from known classes.
  • Unconfident Sample: Ambiguous samples that fall between the two thresholds.

By explicitly identifying and discarding unconfident samples, PSA prevents the model from learning from noisy or ambiguous data during the critical stages of feature acquisition. This "power of I don't know" ensures that the model only updates its parameters based on the most reliable information.

2. Concept Contrastive Representation Learning (CCL)

To further separate ID and OOD features in the latent space, the authors implement Concept Contrastive Representation Learning (CCL). This method utilizes a contrastive loss function that pulls ID samples of the same class together while pushing all identified OOD samples into a single, unified "OOD concept" cluster. By treating all OOD data as a single semantic concept rather than trying to distinguish between different types of unknowns, the model significantly widens the semantic gap between "known" and "unknown" regions in the feature space.

3. Two-Stage Training Strategy

The framework employs a two-stage process. First, a "warm-up" phase allows the model to develop initial representations capable of making reliable assignments. This is followed by a final retraining pass using only the high-purity samples selected by the PSA strategy, ensuring the final model is optimized on the cleanest possible data.

Experimental Evaluation

The authors evaluated PSA against state-of-the-art (SOTA) methods using CIFAR-10 and CIFAR-100 as ID datasets, with Tiny-ImageNet serving as the noisy auxiliary training set. To test generalization, the models were evaluated on diverse test sets including Texture, SVHN, LSUN, and Places365.

Performance Metrics

PSA demonstrated superior performance across nearly all benchmarks:

  • FPR95 (False Positive Rate at 95% TPR): On CIFAR-10, PSA achieved an FPR95 of 13.06%, a substantial improvement over the previous best of 22.79% (ET-OOD).
  • AUROC: The method reached 97.52% on CIFAR-10 and 84.53% on CIFAR-100, consistently outperforming existing methods like UDG and Outlier Exposure (OE).
  • Data Purity: A key factor in this success was the purity of the selected auxiliary ID set. PSA achieved a purity of 80%, whereas previous clustering-based methods often hovered around 14%.

Efficiency

Despite the inclusion of a retraining step, PSA proved more efficient than complex alternatives. For instance, training on CIFAR-10 took 8.1 hours for PSA compared to 12.7 hours for ET-OOD, largely because PSA avoids the computationally expensive optimal transport calculations required by other frameworks.

Conclusion

Predictive Sample Assignment (PSA) represents a significant step forward in making OOD detection more applicable to real-world, noisy environments. By prioritizing data purity and introducing a "discard" category for ambiguous samples, PSA avoids the cumulative errors that plague traditional SCOOD methods. While the two-stage retraining process adds some complexity to the deployment pipeline, the massive gains in detection accuracy and data purity make it a compelling framework for safety-critical machine learning applications. Future work may focus on integrating the selection and training phases into a single, dynamic loop to further streamline the process.

Summary updated

BibTeX
@article{peng2025predictive,
  author = {Zhimao Peng and Enguang Wang and Xialei Liu and Ming-Ming Cheng},
  title = {{Predictive Sample Assignment for Semantically Coherent Out-of-Distribution Detection}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2025},
  doi = {10.1109/tcsvt.2024.3514312},
}
Figure