Incorporating Heterophily into Graph Neural Networks for Graph Classification

Jiayi Yang, Sourav Medya, Wei Ye

TL;DR

This paper introduces IHGNN, a novel Graph Neural Network architecture designed to tackle graph classification tasks in datasets exhibiting both homophily (similar nodes connect) and heterophily (dissimilar nodes connect). IHGNN achieves state-of-the-art performance by adaptively integrating and separating node information, intelligently aggregating layer-wise embeddings, and employing a sophisticated graph-level readout function.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have revolutionized graph-based machine learning, but they often operate under the assumption of homophily. This means they expect connected nodes to share similar features and labels. However, many real-world graphs, such as social networks or molecular structures, exhibit heterophily, where connections are more likely between nodes with different characteristics. Standard GNNs struggle with heterophily, leading to degraded performance in tasks like graph classification. This paper aims to bridge this gap by developing a GNN architecture that can effectively handle graphs with varying degrees of both homophily and heterophily.

Methods

The proposed IHGNN architecture introduces three key innovations:

  • Integration and Separation of Ego- and Neighbor-Embeddings: Instead of solely aggregating neighbor information (as in traditional GNNs), IHGNN's COMBINE operator explicitly considers both the node's own embedding (ego-embedding) and its neighbors' embeddings. It achieves this by concatenating the ego-embedding, neighbor-embedding, and their summation, then feeding this combined representation through a Multi-Layer Perceptron (MLP) to generate a new ego-embedding. This allows the model to be more adaptive to different homophily ratios at the node level.
  • Adaptive Aggregation of Inter-Layer Information: Recognizing that heterophilous graphs might require information from higher-order neighbors, IHGNN adaptively aggregates node embeddings from all layers. This is done using a Single-Layer Perceptron (SLP) with learnable weights for each layer, allowing the model to dynamically weigh the importance of information from different depths. This contrasts with simply concatenating all layer embeddings, which can be less adaptive.
  • Differentiated Graph-Level Readout Function: For graph classification, a permutation- and size-invariant readout function is crucial. IHGNN addresses this by first aligning nodes across different graphs using a continuous version of the Weisfeiler-Lehman (1-WL) algorithm. This sorting ensures that nodes with similar structural identities are consistently positioned. Then, to avoid mixing node embeddings with potentially different homophily characteristics, it concatenates these sorted embeddings. Dummy nodes are used to ensure uniform graph sizes, and the final graph embedding is passed through an MLP for classification.

Datasets

The paper evaluates IHGNN on nine benchmark graph classification datasets: KKI, DD, COLLAB, IMDB-B, DHFR_MD, BZR_MD, MUTAG, PROTEINS, and IMDB-M. These datasets vary in their graph homophily ratios, with KKI being highly heterophilous and others exhibiting a mix or leaning towards homophily.

Key Insights and Ideas

  • Heterophily is a critical factor for graph classification: The paper strongly suggests that ignoring heterophily leads to significant performance drops, especially on datasets with a high degree of it.
  • Node-level and Graph-level adaptation are both crucial: IHGNN's success stems from addressing both the local (node) and global (graph) aspects of heterophily.
  • Adaptive aggregation of layer embeddings is beneficial: The ability to dynamically weigh information from different GNN layers helps capture complex relational patterns, particularly in heterophilous settings.
  • The 1-WL algorithm provides a principled way to align nodes: Using a continuous 1-WL-inspired sorting mechanism for graph-level representation is key to making the readout function robust to node ordering.

Key Results

IHGNN demonstrates superior performance on graph classification tasks, achieving state-of-the-art results on 7 out of 9 benchmark datasets. It significantly outperforms existing GNNs, especially on heterophilous datasets like KKI, where it shows a substantial gain over other methods. Ablation studies confirm the importance of each proposed component: the integration/separation of ego/neighbor embeddings, adaptive layer aggregation, and the differentiated readout function all contribute significantly to IHGNN's overall effectiveness.

Limitations and Future Work

The authors acknowledge that their work focuses on graph classification. Future work could involve applying these heterophily-aware designs to other graph-based tasks, such as node classification or link prediction. Additionally, they suggest exploring the application of these designs to GNNs that incorporate message passing between higher-order graph relations.

Summary updated

BibTeX
@inproceedings{yang2024incorporating,
  author = {Jiayi Yang and Sourav Medya and Wei Ye},
  title = {{Incorporating Heterophily into Graph Neural Networks for Graph Classification}},
  booktitle = {SMC},
  year = {2024},
  doi = {10.1109/smc54092.2024.10831490},
}
Figure