Heterogeneous Graph Neural Networks using Self-supervised Reciprocally Contrastive Learning

Cuiying Huo, Dongxiao He, Yawen Li, Di Jin, Jianwu Dang, Weixiong Zhang, Witold Pedrycz, Lingfei Wu

TL;DR

Researchers have developed HGCL (Heterogeneous Graph reciprocal Contrastive Learning), a self-supervised framework that learns rich node representations without needing expensive manual labels. By creating two distinct "views"—one guided by node attributes and the other by graph topology—and forcing them to supervise each other, HGCL achieves state-of-the-art performance and remarkable robustness against noise in real-world data.

What Problem Does This Paper Address?

Most real-world systems, from citation networks to recommendation engines, are best modeled as heterogeneous graphs—networks containing multiple types of nodes and relationships. While Graph Neural Networks (GNNs) have revolutionized how we analyze these structures, they typically rely on supervised learning, which requires massive amounts of annotated data.

Self-supervised contrastive learning (CL) offers a way out by training models to recognize similarities in unlabeled data. However, existing CL methods for heterogeneous graphs have two major flaws:

  1. Noise Sensitivity: They often assume the graph's structure (topology) is perfectly accurate, but real-world data is messy and full of "noise" (missing edges or incorrect attributes).
  2. Simplistic Views: They usually generate contrastive views through simple data perturbations, failing to capture the complex interplay between diverse node attributes and multi-hop structural relationships (meta-paths).

Methods

The authors introduce HGCL, which moves away from simple data augmentation toward a dual-view architecture that treats attributes and topology as complementary sources of truth.

Fig. 2. Overview of the HGCL approach. The attribute-guided view uses different ways to regenerate ho- mogeneous and heterogeneous edges and uses two encoding methods to aggregate homogeneous and heterogeneous neighbor information. The topology-guided view takes meta-path as prior knowledge and aggregates messages across the same and different meta-paths to learn node representation. The reciprocal contrastive optimization integrates and enhances the two views through the high-quality sample selection mechanism.

1. The Attribute-Guided View

Instead of relying on the potentially noisy original graph structure, this view reconstructs the topology. It calculates similarity between node attributes to generate new "type-specific" edges. It then uses a two-stage aggregation process (homogeneous then heterogeneous) to learn node representations ($Z_{attr}$) based primarily on what nodes are rather than just who they are connected to.

2. The Topology-Guided View

This view leverages traditional structural knowledge like meta-paths (pre-defined sequences of node types, e.g., Author-Paper-Author). It uses a hierarchical attention mechanism to aggregate information within and across different meta-paths, resulting in a structure-heavy representation ($Z_{topo}$).

Fig. 1. A toy example of a heterogeneous graph (DBLP1) and an illustration of meta-paths.

3. Reciprocal Contrastive Optimization

This is the "secret sauce." Rather than just contrasting a node with a perturbed version of itself, HGCL uses a high-quality sample selection mechanism. It identifies positive pairs that satisfy both high attribute similarity and high topological correlation. The two views then supervise each other through a weighted contrastive loss, effectively allowing the cleaner signals in one view to compensate for noise in the other.

Datasets

The model was evaluated on four widely-used heterogeneous graph benchmarks:

  • ACM: A citation network (Nodes: Papers, Authors, Subjects).
  • Yelp: A business review network (Nodes: Businesses, Users, Services, Rating levels).
  • DBLP: A computer science bibliography (Nodes: Authors, Papers, Terms, Venues).
  • AMiner: Another large-scale citation dataset (Nodes: Papers, Authors).

Key Insights and Ideas

  • Reciprocity as Robustness: The core insight is that attributes and topology are rarely noisy in the exact same way. By forcing the model to find consensus between these two different "perspectives," it naturally filters out random noise unique to either one.
  • Beyond Simple Augmentation: Standard contrastive learning often uses "dropout" style augmentations. HGCL shows that for heterogeneous data, regenerating the graph based on different modalities (attributes vs. meta-paths) provides a much stronger training signal.
  • Filtering for Quality: Not all nodes are good contrastive samples. By using a dual-threshold (attribute similarity $\epsilon_a$ and topological correlation $\epsilon_t$), the model ensures it only learns from the most reliable "positive" examples.

Key Results

  • Performance: HGCL consistently outperformed 13 state-of-the-art methods (both supervised and unsupervised) across all datasets. In node classification, it beat the nearest competitor, HeCo, by an average of 11.96% in Macro-F1.
  • Clustering: In unsupervised node clustering, HGCL showed significant gains, outperforming the best baselines by roughly 3% in NMI and ARI.
  • Noise Tolerance: In stress tests where edges were randomly deleted or attributes masked, HGCL remained stable while competing models like HeCo saw their performance collapse. Even with 75% of attributes masked, HGCL maintained high accuracy, demonstrating its ability to "fill in the blanks" using topological information.

Limitations and Future Work

The authors acknowledge a few areas for improvement:

  • Meta-path Depth: The current topology-guided view focuses on the endpoints of meta-paths, potentially ignoring valuable information from intermediate nodes within the path.
  • Two-Stage Selection: The positive/negative sample selection is currently a pre-defined two-stage process. The authors suggest that an end-to-end, dynamic selection mechanism could make the model even more adaptive.
  • Complexity: While the authors provide a time complexity analysis showing scalability, the dual-view architecture is naturally more computationally intensive than single-view models.

Summary updated

BibTeX
@article{huo2022heterogeneous,
  author = {Cuiying Huo and Dongxiao He and Yawen Li and Di Jin and Jianwu Dang and Weixiong Zhang and Witold Pedrycz and Lingfei Wu},
  title = {{Heterogeneous Graph Neural Networks using Self-supervised Reciprocally Contrastive Learning}},
  journal = {ACM Trans. Intell. Syst. Technol.},
  year = {2022},
  url = {https://openreview.net/forum?id=i2Y1o31YJvB},
}
Figure