Energy-based Out-of-Distribution Detection for Graph Neural Networks
About
Learning on graphs, where instance nodes are inter-connected, has become one of the central problems for deep learning, as relational structures are pervasive and induce data inter-dependence which hinders trivial adaptation of existing approaches that assume inputs to be i.i.d.~sampled. However, current models mostly focus on improving testing performance of in-distribution data and largely ignore the potential risk w.r.t. out-of-distribution (OOD) testing samples that may cause negative outcome if the prediction is overconfident on them. In this paper, we investigate the under-explored problem, OOD detection on graph-structured data, and identify a provably effective OOD discriminator based on an energy function directly extracted from graph neural networks trained with standard classification loss. This paves a way for a simple, powerful and efficient OOD detection model for GNN-based learning on graphs, which we call GNNSafe. It also has nice theoretical properties that guarantee an overall distinguishable margin between the detection scores for in-distribution and OOD samples, which, more critically, can be further strengthened by a learning-free energy belief propagation scheme. For comprehensive evaluation, we introduce new benchmark settings that evaluate the model for detecting OOD data from both synthetic and real distribution shifts (cross-domain graph shifts and temporal graph shifts). The results show that GNNSafe achieves up to $17.0\%$ AUROC improvement over state-of-the-arts and it could serve as simple yet strong baselines in such an under-developed area.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| OOD Detection | Cora | AUROC93.13 | 43 | |
| Node Classification | DBLP | -- | 31 | |
| Out-of-Distribution Detection | Squirrel | Rank5 | 24 | |
| OOD Detection | Pubmed | AUROC93.77 | 24 | |
| Out-of-Distribution Detection | CoraML | Rank2.8 | 24 | |
| Out-of-Distribution Detection | amazon-ratings | Rank3.2 | 24 | |
| Out-of-Distribution Detection | Chameleon | Rank3.5 | 24 | |
| Node Classification | Citeseer | ID Accuracy71.43 | 24 | |
| Out-of-Distribution Detection | Pubmed | Rank3.5 | 24 | |
| Out-of-Distribution Detection | Roman-Empire | Rank3.2 | 24 |