Introduction
In real-world applications such as drug discovery or fraud detection, graph data is often severely imbalanced. Standard Graph Neural Networks (GNNs) typically exhibit a "majority bias," where the model over-fits to abundant classes while failing to generalize on sparse minority classes. Traditional solutions like over-sampling or loss re-weighting often fall short in the graph domain because they ignore the complex hierarchical substructures inherent in graphs. A majority class is rarely a monolith; it often contains diverse structural patterns that, if treated as a single group, can obscure the nuances needed for accurate classification.
Methodology: The C3GNN Framework
To address these challenges, the authors propose C3GNN (Cluster-guided Contrastive Class-imbalanced Graph Classification). The framework shifts the focus from simple class-level balancing to a more granular subclass-level approach.
C3GNN consists of three primary components:
- Adaptive Clustering for Subclass Balancing: The model adaptively partitions majority classes into smaller, semantically coherent subclasses using $k$-means clustering on graph embeddings. This creates a "pseudo-balanced" training environment where each subclass is roughly the size of the minority class.
- Subclass Mixup Interpolation: To enhance the diversity of sparse data and prevent memorization, C3GNN employs Mixup interpolation. By generating synthetic graph representations between samples within the same subclass, the model smooths decision boundaries and enriches the feature space.
- Hierarchical Subclass Contrastive Learning (HSCL): This core module utilizes a two-tiered supervised contrastive loss. The Intra-subclass loss pulls graphs from the same subclass together, while the Inter-subclass loss pulls graphs from different subclasses of the same parent class together and pushes away graphs from different parent classes. This hierarchy allows the model to capture both fine-grained structural details and coarse-grained class concepts simultaneously.
Experimental Evaluation
The framework was evaluated on six benchmark datasets, including Synthie (synthetic), ENZYMES (bioinformatics), and graph-converted vision datasets like MNIST and COIL-DEL. The experiments utilized various Imbalance Factors (IF), ranging from 10 to 100, to test the model's robustness under extreme scarcity.
Key Results and Discussion
C3GNN consistently outperformed state-of-the-art baselines, including specialized imbalanced GNNs like RAHNet and $G^2$GNN. For instance, on the MNIST dataset with an IF of 50, C3GNN achieved an accuracy of 77.38%, significantly surpassing the GraphSAGE backbone (68.67%).
A critical finding in the study is the sensitivity to cluster size. As shown in the experimental results, there is a "sweet spot" for the number of clusters. If the cluster size is too large, the imbalance persists; if it is too small, the model fails to effectively group similar structural instances. The hierarchical contrastive approach (HSCL) was identified via ablation studies as the most vital component for maintaining high performance across varying imbalance levels.
Conclusion
C3GNN demonstrates that the diversity of majority classes is an asset rather than a hindrance. By decomposing these classes into subclasses and applying hierarchical contrastive learning, the model preserves structural richness while mitigating majority bias. Future work may involve exploring more advanced graph augmentation techniques to further refine the contrastive learning process and reduce the computational overhead associated with periodic re-clustering.
Summary updated