Skip to content

YuWVandy/G2GNN

Repository files navigation

This repository is an $1^{st}$ official PyTorch(Geometric) implementation of GNN-based machine learning models for handling imbalanced graph classification.

See more details for the paper 'Imbalanced Graph Classification via Graph-of-Graph Neural Networks'

If you use this code, please consider citing:

@inproceedings{wang2022imbalance,
author = {Wang, Yu and Zhao, Yuying and Shah, Neil and Derr, Tyler},
title = {Imbalanced Graph Classification via Graph-of-Graph Neural Networks},
year = {2022},
booktitle = {Proceedings of the 31st ACM International Conference on Information & Knowledge Management},
pages = {2067–2076},
numpages = {10},
series = {CIKM '22}
}

Requirements

  • PyTorch 1.11.0+cu113
  • PyTorch Geometric 2.0.4
  • torch-scatter 2.0.9
  • torch-sparse 0.6.15
  • torch-cluster 1.6.0

Note that the version of the PyTorch Geometric/scatter/sparse/cluster used here is not the very latest one. The current used versions can be intalled via:

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
pip install torch-geometric==2.0.4
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.11.0+cu113.html

Implemented GNN backbones

  • [ICLR 2019] GIN-How Powerful Are Graph Neural Networks? [paper]
  • [ICLR 2020] InfoGraph-InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Information Maximization [paper] - incoming soon!
  • [Neurips 2020] GraphCL-Graph Contrastive Learning with Augmentations [paper] - incoming soon!

Implemented strategies for handling imbalance issue in graph classification

  • [ICML 1997] Upsampling: Addressing the curse of imbalanced training sets: one-sided selection [paper]
  • [IJCNN 2012] Reweight: Sampling + reweighting: Boosting the performance of AdaBoost on imbalanced datasets [paper]
  • [JAIR 2002] SMOTE: SMOTE: Synthetic Minority Over-sampling Technique [paper]
  • [CIKM 2022] GoG: Imbalanced Graph Classification via Graph-of-Graph Neural Networks [paper]
  • [CIKM 2022] Data-augmentation: Imbalanced Graph Classification via Graph-of-Graph Neural Networks [paper]
    • Edge Removal + consistency regularization
    • Node Mask + consistency regularization

Run

Note that compared to the previous verion of this repository, we move the K-nearest neighbor search in topological space into the batch-processing, which hence can be speed up due to parallel preparation. Furthermore, to solve the undeterministic issue, we replace the original scatter-based message-passing/pooling with sparse-matrix multiplication-based message-passing and segment_csr-based pooling, see more details [here]

To reproduce results in Table 2, please run the following code:

bash run_{dataset}.sh

To reproduce results in Figure 2, please run the following code:

python experiment.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published