RAHNet: Retrieval Augmented Hybrid Network for Long-tailed Graph Classification

Zhengyang Mao, Wei Ju, Yifang Qin, Xiao Luo, Ming Zhang

Abstract

Long-tailed graph classification presents a significant challenge for standard Graph Neural Networks (GNNs), which often develop biases toward dominant head classes, leading to poor generalization on rare tail classes. We propose RAHNet (Retrieval Augmented Hybrid Network), a framework that addresses these issues by integrating a novel graph retrieval module with balanced contrastive learning. RAHNet explicitly enriches tail-class diversity through structural retrieval and decouples feature representation learning from classifier training. Experimental results across multiple benchmark datasets demonstrate that RAHNet significantly improves performance on tail classes while maintaining high accuracy on head classes, outperforming existing state-of-the-art methods.

Introduction

Graph classification is essential in domains ranging from drug discovery to social network analysis. However, real-world graph data frequently follows a long-tailed distribution, where a few "head" classes contain the majority of samples, while numerous "tail" classes are data-poor. Standard GNNs trained on such data suffer from two primary issues: a lack of intra-class variability for tail classes and a biased classifier that favors head classes due to larger weight norms. Traditional re-balancing techniques, such as oversampling, often lead to overfitting on rare samples or degrade performance on head classes.

The RAHNet Framework

RAHNet employs a two-stage decoupled training strategy designed to learn robust features and an unbiased classifier independently.

Overview of the RAHNet architecture, illustrating the retrieval augmentation, GNN encoder, and balanced supervised contrastive learning (BSCL) modules.

1. Feature Extractor Training

To address data scarcity in tail classes, RAHNet introduces a Retrieval Augmented Branch. Instead of simple duplication, it utilizes a pre-trained module to retrieve structurally similar graphs from the training set. These retrieved graphs are adaptively fused with input samples to introduce relevant structural variations, thereby enriching the feature space of tail classes with new, relevant knowledge.

To further refine representations, we propose Balanced Supervised Contrastive Learning (BSCL). Standard contrastive learning often fails for rare classes due to a lack of positive pairs. BSCL introduces learnable "category centers" that serve as stable anchors for each class, ensuring that even tail-class samples have a consistent target to cluster around during training.

2. Classifier Fine-tuning

Once the feature extractor is trained, its weights are frozen. The classifier is then fine-tuned using a class-balanced sampler. To mitigate head-class bias, RAHNet applies Max-norm regularization and weight decay to the classifier weights. This prevents the decision boundaries from being disproportionately pushed toward data-rich classes, ensuring a more equitable classification across the entire distribution.

Experimental Results

RAHNet was evaluated on six benchmark datasets—Synthie, ENZYMES, MNIST, Letter-high/low, and COIL-DEL—under various imbalance factors (IF) to simulate different degrees of data skewness.

Comparison of per-class accuracy between RAHNet and the base model on the COIL-DEL dataset. RAHNet shows significant improvements, particularly in the tail classes (higher class indices).

Quantitative analysis shows that RAHNet consistently outperforms state-of-the-art baselines. For instance, on the COIL-DEL dataset with a harsh imbalance factor (IF=20), RAHNet achieved 38.48% accuracy, significantly higher than the 31.32% achieved by a standard GraphSAGE model. As shown in the per-class accuracy breakdown, RAHNet's gains are most pronounced in the tail classes (higher class indices), validating the effectiveness of retrieval augmentation and decoupled training in restoring intra-class variety and reducing classifier bias.

Conclusion

RAHNet provides a robust solution for long-tailed graph classification by combining structural retrieval with balanced contrastive learning. By enriching tail-class diversity and ensuring unbiased classification through a decoupled training approach, it sets a new benchmark for performance in imbalanced graph domains. Future work will explore incorporating multi-modal knowledge into the retrieval process to provide even richer context for rare classes.

Summary updated

BibTeX
@inproceedings{mao2023rahnet,
  author = {Zhengyang Mao and Wei Ju and Yifang Qin and Xiao Luo and Ming Zhang},
  title = {{RAHNet: Retrieval Augmented Hybrid Network for Long-tailed Graph Classification}},
  booktitle = {ACM Multimedia},
  year = {2023},
  doi = {10.1145/3581783.3612360},
}

Loading related content...

Figure