NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Co-Modality Graph Contrastive Learning for Imbalanced Node Classification

Yiyue Qian, Chunhui Zhang, Yiming Zhang, Qianlong Wen, Yanfang Ye, Chuxu ZhangNeurIPS 2022

TL;DR

Standard graph contrastive learning often fails on real-world data because it relies on handcrafted "augmentations" and struggles with class imbalance. CM-GCL (Co-Modality Graph Contrastive Learning) solves this by using a node's natural content (like text or images) as a built-in augmentation and leveraging network pruning to identify and prioritize "forgotten" minority samples during training.

What Problem Does This Paper Address?

Graph Contrastive Learning (GCL) has become a powerhouse for training Graph Neural Networks (GNNs) without labels. However, the authors identify two major "gaps" between current research and real-world application:

  1. The Augmentation Headache: Most GCL methods require humans to manually design "views" of a graph (e.g., dropping edges or masking features). This is a trial-and-error process that doesn't always generalize across different datasets.
  2. The Imbalance Issue: Real-world graphs are rarely balanced. Whether you are looking for illicit drug traffickers on Instagram or malicious repositories on GitHub, the "interesting" nodes are usually a tiny minority. Existing GCL methods tend to learn representations that favor the majority, effectively "forgetting" the rare but important nodes.

Methods

The authors introduce a framework that treats multi-modality as a feature, not a bug. Their approach, CM-GCL, consists of three main components:

The CM-GCL Framework
  • Inter-Modality GCL: Instead of manually corrupting the graph, the model uses the node's inherent content (e.g., the text of a tweet or an image in a post) as a second view. It trains a GNN and a content encoder (like DistilBERT or ResNet) simultaneously, forcing the structural embedding and the content embedding of the same node to be similar.
  • Network Pruning for Minority Mining: This is the most novel part of the paper. Inspired by the observation that deep networks "forget" rare samples when they are pruned (compressed), the authors iteratively prune their encoders. Nodes that the pruned network struggles to represent—called Pruning Identified Exemplars (PIEs)—are likely minority samples. The model then boosts the weights of these "hard" nodes in the contrastive loss function.
  • Intra-Modality GCL: To ensure the GNN doesn't just focus on structure, they co-train a standard GNN and a pruned GNN. This ensures that nodes with similar raw attributes stay close together in the final embedding space, even if their structural positions differ slightly.
  • Balanced Fine-tuning: Finally, they fine-tune the pre-trained GNN using Focal Loss, which further forces the model to focus on hard-to-classify (minority) examples.

Datasets

The model was evaluated on four real-world multi-modality datasets:

  • AMiner: An academic citation network (Node = Paper, Content = Title/Text).
  • YelpChi: A review graph for fraud detection (Node = Review, Content = Text).
  • GitHub: A repository graph for malicious code detection (Node = Repo, Content = Text).
  • Instagram: A social network for detecting drug traffickers (Node = User, Content = Image).

To test robustness, the authors created "imitative imbalanced settings," artificially reducing the minority class to as little as 1% of the total data.

Key Insights and Ideas

  • Content as a "Free" Augmentation: By aligning structure (graph) with content (text/image), the model avoids the need for handcrafted augmentations. It assumes that if a node's structural role and its content refer to the same entity, their embeddings should agree.
  • Pruning as a Diagnostic Tool: Usually, pruning is used to make models smaller. Here, it's used as a "magnifying glass" to find minority nodes. If a compressed model can't remember a node, that node is likely an outlier or a member of a minority class.
  • Implicit Re-balancing: Unlike traditional methods that require explicit over-sampling (which can lead to overfitting), CM-GCL performs "implicit loss re-balancing" by dynamically identifying and prioritizing hard samples during the self-supervised phase.

Key Results

CM-GCL consistently outperformed state-of-the-art baselines like GraphCL and GraphSMOTE across all datasets.

Performance comparison of CM-GCL against baselines
  • Performance Gains: In the most extreme imbalance scenarios (1% minority ratio, denoted as $D_{0.01}$), CM-GCL showed significant improvements in Macro F1-score and AUC-ROC. For example, on the GitHub dataset, it achieved an AUC of 88.51 compared to the next best GCL model's 86.21.
  • Ablation Success: Removing the pruning component or the intra-modality component led to a sharp drop in performance, proving that the "minority mining" strategy is critical.
  • Plug-and-Play: The authors demonstrated that CM-GCL works with various backbones, including GAT, GraphSAGE, BERT, and Swin Transformers.

Limitations and Future Work

  • Modality Dependency: The framework relies on the availability of rich node content (text or images). While common in social and academic graphs, it might not apply to "pure" structural graphs like chemical molecules or power grids.
  • Computational Cost: Iterative pruning and training multiple encoders (GNN + Text/Image) is more computationally expensive than standard GNN training.
  • Future Directions: The authors suggest exploring how this "pruning for discovery" approach could be applied to other types of graph tasks beyond node classification, such as link prediction in imbalanced networks.

Summary updated

BibTeX
@inproceedings{qian2022co,
  author = {Yiyue Qian and Chunhui Zhang and Yiming Zhang and Qianlong Wen and Yanfang Ye and Chuxu Zhang},
  title = {{Co-Modality Graph Contrastive Learning for Imbalanced Node Classification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=f_kvHrM4Q0},
}
Figure