Incorporating Heterophily into Graph Neural Networks for Graph Classification

Jiayi Yang, Sourav Medya, Wei Ye · DOI

Introduction

Most Graph Neural Networks (GNNs) are built on the assumption of homophily, where connected nodes are expected to share similar features or labels. While this assumption holds for many datasets, real-world networks—such as chemical compounds or social interaction graphs—often exhibit heterophily, where connected nodes are intentionally dissimilar. While heterophily has been explored in node-level tasks, its impact on graph-level classification remains under-addressed.

The paper "Incorporating Heterophily into Graph Neural Networks for Graph Classification" introduces IHGNN, a model designed to adaptively handle both homophilous and heterophilous structures within diverse graph datasets.

The Challenge of Heterophily in Graph Classification

In node classification, models typically deal with a single large graph with a relatively stable homophily ratio. In contrast, graph classification datasets (e.g., COLLAB, MUTAG) consist of thousands of individual graphs. As shown in the distribution below, these graphs can exhibit a wide range of homophily ratios within the same dataset, making a "one-size-fits-all" aggregation strategy ineffective.

Distribution of graph homophily ratios across a dataset, highlighting the diversity of structural patterns that a single model must handle.

Standard GNNs use uniform aggregation (averaging or summing neighbor features), which acts as a "feature washer" in heterophilous settings, blurring the distinct characteristics of connected nodes and degrading classification performance.

Methodology: The IHGNN Architecture

IHGNN addresses these limitations through three primary innovations:

  1. Intra-layer Integration and Separation: The model's COMBINE operator explicitly separates a node's own embedding (ego) from its neighbors' aggregated embeddings. By concatenating these with their sum, the model learns to either emphasize similarities or preserve differences at each layer.
  2. Adaptive Inter-layer Aggregation: To capture higher-order structural information—often necessary in heterophilous graphs where similar nodes might be "neighbors of neighbors"—IHGNN uses a Single-Layer Perceptron (SLP) to adaptively weight and combine embeddings from all layers.
  3. Sort-and-Align Readout: Moving beyond simple sum-pooling, IHGNN employs a sorting-based readout inspired by the Weisfeiler-Lehman (1-WL) isomorphism test. Nodes are sorted based on their final embeddings and concatenated to form a fixed-size, permutation-invariant graph representation.
The IHGNN architecture, illustrating the flow from input graphs through intra-layer integration, adaptive inter-layer aggregation, and the sort-and-align readout mechanism.

Experimental Results

IHGNN was evaluated against state-of-the-art models on 9 benchmark datasets, including both bioinformatics and social networks. Key findings include:

  • Superior Accuracy: IHGNN achieved the highest accuracy on 7 out of 9 datasets.
  • Performance in Heterophily: On the highly heterophilous KKI dataset, IHGNN outperformed the runner-up by 6.6% and significantly surpassed popular models like DiffPool by 37.5%.
  • Efficiency and Scalability: Unlike some high-order GNNs that face memory issues on large graphs, IHGNN remains computationally efficient. It also outperformed recent transformer-based architectures (Graphormer, TokenGT) on most benchmarks, demonstrating better generalization on standard-sized datasets.

Conclusion

IHGNN demonstrates that moving away from the "homophily-only" assumption is critical for robust graph classification. By adaptively integrating and separating features and utilizing a theoretically grounded readout mechanism, IHGNN provides a versatile framework for analyzing complex graph structures across various domains.

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