Introduction
Out-of-distribution (OOD) detection is a critical safety feature for machine learning models, ensuring they can identify samples that differ significantly from their training data. While well-established in computer vision, OOD detection for graph-structured data—such as molecular structures or social networks—remains an open challenge. Graphs present unique difficulties due to the combination of complex connectivity and varying node attributes. This paper systematically evaluates various uncertainty estimation techniques to determine their effectiveness in flagging OOD graphs.
Methodology
The study categorizes OOD detection methods into two primary families:
- Entropy-based methods: These evaluate the "flatness" of the model's final prediction. High entropy indicates the model is undecided between multiple classes. Methods tested include standard Single GNNs, Monte Carlo Dropout (MC), and Deep Ensembles (DE).
- Density-based methods: These analyze the position of a graph within the model's internal latent space. Samples located in low-density regions (far from training data) are flagged. Methods include Non-Parametric Uncertainty Quantification (NUQ) and Natural Posterior Networks (NatPostNet).
A key distinction is made between Data Uncertainty (inherent noise) and Knowledge Uncertainty (lack of model experience with specific data types).
Experimental Setup
The researchers utilized five diverse datasets: ENZYMES (chemical), IMDB-MULTI (social), REDDIT-MULTI-5K/12K (social), and TRIANGLES (synthetic). Evaluation followed a "leave-one-class-out" protocol, where the model is trained on all but one class, which then serves as the OOD test set.
Results and Analysis
The investigation revealed that OOD detection performance varies significantly across domains.
The Geometry of Latent Space
A central finding is that prediction entropy alone is insufficient for robust detection. Models often become overconfident for "boundary" classes that share structural similarities with others. Effective detection requires accounting for the geometry of the latent space—specifically, the distance between a sample and the centroids of known classes.
Domain-Specific Performance
There is a stark contrast between performance on social and chemical datasets. On IMDB-MULTI, methods achieved AUROC scores between 0.80 and 0.90. Conversely, on the ENZYMES dataset, performance often hovered near 0.50, indicating that standard graph encoders struggle to capture the complex manifold of molecular data.
Key Insights
- No Universal Winner: While Deep Ensembles and NatPostNet generally proved more robust, no single method dominated all benchmarks.
- Default Class Phenomenon: OOD samples are frequently misclassified into a specific "default" in-distribution class rather than being spread randomly.
- Knowledge vs. Data: Estimates based on knowledge uncertainty consistently outperformed those based on data uncertainty for OOD tasks.
Conclusion
Effective OOD detection in graphs requires looking beyond simple prediction confidence to the underlying geometry of latent representations. The significant performance gap between chemical and social domains suggests a need for specialized graph encoders tailored to specific data manifolds. Future work should address the challenges of high-dimensional density estimation in graph latent spaces.
Summary updated