Table of Contents
Fetching ...

Out-of-Distribution Detection in Heterogeneous Graphs via Energy Propagation

Tao Yin, Chen Zhao, Xiaoyan Liu, Minglai Shao

TL;DR

This work tackles the challenging problem of detecting out-of-distribution nodes in heterogeneous graphs by introducing OODHG, a framework that combines energy-based OOD scoring with meta-path guided energy propagation. Node representations are learned from multiple meta-paths using SeHGNN, projected into a shared space, and fused via a Transformer to form target-type embeddings; energy scores derived from an MLP logits guide OOD detection, complemented by an energy propagation mechanism across metapaths. The training objective jointly optimizes classification and a margin-based energy loss to sharpen ID–OOD separation, while evaluating with comprehensive metrics on DBLP, ACM, and IMDB datasets. Empirical results show that OODHG outperforms baselines in both OOD detection and ID classification, underscoring the value of meta-path-aware energy propagation for robust OOD handling in heterogeneous graphs, with practical impact for real-world, multi-typed graph data.

Abstract

Graph neural networks (GNNs) are proven effective in extracting complex node and structural information from graph data. While current GNNs perform well in node classification tasks within in-distribution (ID) settings, real-world scenarios often present distribution shifts, leading to the presence of out-of-distribution (OOD) nodes. OOD detection in graphs is a crucial and challenging task. Most existing research focuses on homogeneous graphs, but real-world graphs are often heterogeneous, consisting of diverse node and edge types. This heterogeneity adds complexity and enriches the informational content. To the best of our knowledge, OOD detection in heterogeneous graphs remains an underexplored area. In this context, we propose a novel methodology for OOD detection in heterogeneous graphs (OODHG) that aims to achieve two main objectives: 1) detecting OOD nodes and 2) classifying all ID nodes based on the first task's results. Specifically, we learn representations for each node in the heterogeneous graph, calculate energy values to determine whether nodes are OOD, and then classify ID nodes. To leverage the structural information of heterogeneous graphs, we introduce a meta-path-based energy propagation mechanism and an energy constraint to enhance the distinction between ID and OOD nodes. Extensive experimental findings substantiate the simplicity and effectiveness of OODHG, demonstrating its superiority over baseline models in OOD detection tasks and its accuracy in ID node classification.

Out-of-Distribution Detection in Heterogeneous Graphs via Energy Propagation

TL;DR

This work tackles the challenging problem of detecting out-of-distribution nodes in heterogeneous graphs by introducing OODHG, a framework that combines energy-based OOD scoring with meta-path guided energy propagation. Node representations are learned from multiple meta-paths using SeHGNN, projected into a shared space, and fused via a Transformer to form target-type embeddings; energy scores derived from an MLP logits guide OOD detection, complemented by an energy propagation mechanism across metapaths. The training objective jointly optimizes classification and a margin-based energy loss to sharpen ID–OOD separation, while evaluating with comprehensive metrics on DBLP, ACM, and IMDB datasets. Empirical results show that OODHG outperforms baselines in both OOD detection and ID classification, underscoring the value of meta-path-aware energy propagation for robust OOD handling in heterogeneous graphs, with practical impact for real-world, multi-typed graph data.

Abstract

Graph neural networks (GNNs) are proven effective in extracting complex node and structural information from graph data. While current GNNs perform well in node classification tasks within in-distribution (ID) settings, real-world scenarios often present distribution shifts, leading to the presence of out-of-distribution (OOD) nodes. OOD detection in graphs is a crucial and challenging task. Most existing research focuses on homogeneous graphs, but real-world graphs are often heterogeneous, consisting of diverse node and edge types. This heterogeneity adds complexity and enriches the informational content. To the best of our knowledge, OOD detection in heterogeneous graphs remains an underexplored area. In this context, we propose a novel methodology for OOD detection in heterogeneous graphs (OODHG) that aims to achieve two main objectives: 1) detecting OOD nodes and 2) classifying all ID nodes based on the first task's results. Specifically, we learn representations for each node in the heterogeneous graph, calculate energy values to determine whether nodes are OOD, and then classify ID nodes. To leverage the structural information of heterogeneous graphs, we introduce a meta-path-based energy propagation mechanism and an energy constraint to enhance the distinction between ID and OOD nodes. Extensive experimental findings substantiate the simplicity and effectiveness of OODHG, demonstrating its superiority over baseline models in OOD detection tasks and its accuracy in ID node classification.
Paper Structure (18 sections, 12 equations, 7 figures, 3 tables, 1 algorithm)

This paper contains 18 sections, 12 equations, 7 figures, 3 tables, 1 algorithm.

Figures (7)

  • Figure 1: An illustration of OOD detection in heterogeneous graphs. The target nodes are authors, and during the training stage, we only utilize a subset of nodes from the ID classes (ID Class1 and ID Class2, as depicted in the figure). The task involves two main objectives: 1) detecting OOD nodes, and 2) classifying ID nodes.
  • Figure 2: The overall framework of OODHG. Given a heterogeneous graph $\mathcal{G}$, HGNN outputs the logits $H$ of the nodes and computes the energy scores for target type nodes. Energy propagation is performed under different meta-paths, and the average is taken as the final energy score. During the training phase, the final energy scores of target nodes in the training set are calculated for energy loss, while the classification probability distribution is used for classification loss. In the testing phase, the final energy scores for target nodes in the test set are calculated. If the negative energy score $-E_i$ < $\tau$, it is classified as an OOD node; otherwise, it is classified as an ID node.
  • Figure 3: Ablation study on three datasets.
  • Figure 4: The visualized results of the energy scores on three datasets.
  • Figure 5: Visualization of energy distribution of one class of nodes on three datasets.
  • ...and 2 more figures

Theorems & Definitions (3)

  • Definition 1: Heterogeneous Graph
  • Definition 2: Meta-path
  • Definition 3: OOD Detection in Heterogeneous Graphs