TL;DR
Graph Neural Networks (GNNs) often struggle with real-world datasets that are highly imbalanced—either because some classes have far more examples than others, or because a few graphs are massive while most are tiny. This paper introduces UniImb, a unified framework that tackles both "class imbalance" and "topological imbalance" simultaneously. By using a Dynamic Balanced Prototype module regulated by Information Bottleneck theory, UniImb ensures that minority classes and small-scale graphs get equal representation during training, achieving state-of-the-art results across 19 datasets.
What Problem Does This Paper Address?
Graph classification assigns a single label to an entire graph (e.g., predicting if a molecule is toxic, or if a social network community is a bot ring). While GNNs are great at this, they assume the training data is nicely balanced. In reality, graph data suffers from two distinct types of imbalance:
- Class Imbalance: A few "head" classes contain the vast majority of the graphs, while "tail" classes are severely underrepresented. The model naturally learns to favor the head classes.
- Topological Imbalance: Graph sizes follow a long-tailed distribution. A few graphs might have thousands of nodes and complex structures, while the majority have only a dozen nodes. GNNs tend to over-index on the rich structural signals of the massive graphs, leading to poor performance on the smaller ones.
Historically, researchers have treated these as two separate problems, building specialized models for one or the other. This paper argues that real-world data (like social networks or sensor grids) often features intertwined imbalances, requiring a unified solution.
Methods
To solve both imbalances at once, the authors propose UniImb, which introduces several clever mechanisms to balance learning across diverse graph structures.
- Personalized Graph Perturbations: Standard data augmentation applies uniform random edge-dropping or feature-masking to all graphs. UniImb uses a learnable module to customize the perturbation strength based on a graph's specific characteristics (like its average degree). This prevents the model from accidentally destroying the structure of already-small tail graphs.
- Dynamic Balanced Prototype (DBP): Instead of learning graph representations in isolation, UniImb learns a set of shared "prototypes" (representative embeddings) in a latent space. Graphs are softly assigned to these prototypes based on similarity.
- Prototype Load-Balancing Optimization: This is the core mathematical contribution. Left unchecked, prototypes would just memorize the majority classes or the biggest graphs. Using the Information Bottleneck principle, the authors add a regularization term that forces the prototype activation probabilities to approach a uniform distribution. If a prototype is activated too often (e.g., by a majority class), it gets penalized. This forces the network to distribute its attention fairly, giving minority and small-scale graphs a voice.
Datasets
The authors evaluated UniImb on a massive suite of 19 datasets:
- 12 Standard Benchmarks: Covering chemical compounds (MUTAG, NCI1), proteins (PROTEINS, D&D), and social networks (COLLAB, REDDIT-B).
- 3 3D Molecular Datasets: From MoleculeNet (HIV, BBBP, BACE) to test complex spatial structures.
- AirGraph (Newly Introduced): To prove real-world utility, the authors released a massive, naturally imbalanced dataset of 30,660 graphs based on hourly PM2.5 air pollution readings across 1,341 monitoring stations in China.
Key Insights and Ideas
- Imbalance is an Information Redundancy Problem: The authors reframe graph imbalance through the lens of Information Bottleneck theory. Majority classes and massive graphs flood the model with redundant information. By minimizing the mutual information between the input graphs and the learned prototypes, the model is forced to strip away this biased redundancy and focus on generalizable features.
- Prototypes Bridge the Gap: By forcing graphs to map to a fixed number of balanced prototypes, the model effectively creates a bottleneck that treats a tiny, rare graph and a massive, common graph as equals in the latent space.
- Plug-and-Play Capability: The Dynamic Balanced Prototype (DBP) module isn't strictly tied to one architecture. The authors showed it can be bolted onto standard GCNs, GraphSAGE, or even modern Graph Transformers (like Graph-Mamba) to instantly improve their performance on imbalanced data.
Key Results
UniImb was tested against 23 baselines, including classic GNNs, Graph Transformers, and specialized imbalance methods (like G²GNN and TopoImb).
- Class Imbalance: Under extreme class imbalance scenarios (e.g., a 1:9 ratio), UniImb consistently won. On the
PROTEINSdataset, it achieved a 70.44% Macro-F1 score, beating the best baseline (68.39%). - Topological Imbalance: On datasets skewed by graph size, UniImb outperformed specialized topological methods. On
COLLAB, it reached 73.51% Macro-F1 compared to the baseline SOLT-GNN's 64.68%. - Intertwined Imbalance: When datasets were modified to have both class and topological imbalances simultaneously, UniImb maintained dominant performance, proving the value of a unified approach.
- Scalability: On the massive new
AirGraphdataset, UniImb not only achieved the highest accuracy for predicting pollution levels but also demonstrated lower memory usage and faster training times than other specialized imbalance models.
Limitations and Future Work
- Homogeneous Focus: The current framework and evaluation are primarily designed for homogeneous graphs (where all nodes and edges are of the same type). Real-world networks are often heterogeneous.
- Future Directions: The authors plan to extend UniImb to handle heterogeneous graphs. They also want to test the underlying balanced-prototype theory on other graph learning tasks beyond classification, such as few-shot learning, dynamic graph modeling, and anomaly detection.
Summary updated