Skip to content

Persdre/BufferGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Addressing Class Imbalance in Graph with Buffer Nodes

Graph Neural Networks (GNNs) have shown remarkable success in node classification tasks, but they struggle with class-imbalanced graphs where minority classes are often misclassified. Existing approaches attempt to address this by synthesizing new minority nodes, but they overlook a critical issue: majority nodes continue to propagate misleading information to minority nodes through majority-minority edges. Our analysis reveals that minority nodes with more majority-class neighbors consistently show lower classification accuracy across all baseline models. To address this challenge, we propose BufferGraph, a novel framework that modulates message passing through potentially misleading edges by strategically inserting buffer nodes. These buffer nodes act as controlled information bottlenecks, reducing the negative influence of majority nodes on minority nodes while preserving useful information flow. Theoretically, we prove that BufferGraph effectively reduces the feature distortion of minority nodes during message passing. Extensive experiments on five real-world datasets demonstrate BufferGraph's effectiveness, achieving up to 3% improvement in accuracy, 2% in balanced accuracy, and 2% in F1-score compared to state-of-the-art methods. BufferGraph consistently outperforms existing approaches in both naturally and artificially imbalanced settings, particularly for minority classes with high heterophily. Our work provides new insights into addressing class imbalance in graph learning by focusing on edge-level interventions rather than node synthesis alone.

overview

Table of Contents

Code Overview

This code repository consists of several folders:

  • model: BufferGraph code.
  • ablation study: Ablation study code of BufferGraph: deduct distance loss; deduct original graph; deduct updating message passing.

Requirements

We list main requirements of this repository below. For full requirements, please refer to the provided environment.yml file

  • dgl==1.1.0
  • torch==2.0.0+cu117
  • torch-cluster==1.6.1+pt20cu117
  • torch-geometric==2.3.0
  • torch-scatter==2.1.1+pt20cu117
  • torch-sparse==0.6.17+pt20cu117
  • torch-spline-conv==1.2.2+pt20cu117
  • torchaudio==2.0.1+cu117
  • torchmetrics==0.11.4
  • torchvision==0.15.1+cu117
  • transformers==4.30.2

Running Code

For example, if you want to run BufferGraph code on the dataset Amazon-Computers, go to the model folder first, then run the following commands:

``` 
python pre_train.py --dataset="amazoncomputers"
python buffgraph.py --dataset="amazoncomputers"
```

You can also run ablation study code in the folder ablation study:

``` 
python deduct_distance_loss.py
```

License

This dataset is under license CC BY-SA 4.0.

About

[LOG 2025 Oral] Less is More: Using Buffer Nodes to Reduce Excessive Majority Node Influence in Class Imbalance Graphs https://openreview.net/pdf?id=6ikB5L1kzq

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages