Introduction
In the field of Graph Machine Learning, researchers have long grappled with the challenge of class-level imbalance. Standard Graph Neural Networks (GNNs) tend to favor majority classes (e.g., "normal" nodes) while neglecting minority classes (e.g., "fraud" nodes). However, a more insidious form of bias often goes unnoticed: topology-level imbalance.
This paper introduces TopoImb, a novel framework designed to identify and mitigate structural imbalances that occur within classes. By recognizing that a single label can represent diverse structural motifs, TopoImb ensures that GNNs do not over-fit to dominant patterns at the expense of rare but equally significant graph structures.
The Problem: Beyond Class Labels
Traditional GNN training assumes that nodes or graphs sharing the same label are structurally homogeneous. In reality, graph data is inherently multi-modal. For instance, in a molecular dataset, a specific biological property might be triggered by several distinct chemical motifs. If one motif appears in 90% of the training samples while another appears in only 10%, a standard GNN will likely fail to recognize the minority structure, even though both belong to the same class.
Existing solutions, such as oversampling or class-reweighting, are ineffective here because they operate at the label level. They cannot distinguish between different structural "sub-classes" within a single label. TopoImb addresses this by automatically discovering latent topology groups and modulating the training process to ensure structural fairness.
The TopoImb Framework
The TopoImb framework consists of three integrated components designed to work alongside any standard GNN architecture:
1. Topology Extractor ($f_{ext}$)
To handle structural diversity without manual labels, TopoImb utilizes a topology extractor equipped with explicit memory cells. These cells act as templates for representative structural patterns. By matching the embeddings of a node or graph against these templates, the model can categorize instances into specific topology groups in an unsupervised manner.
2. Training Modulator
Once topology groups are identified, the framework employs an adversarial min-max reward signal. The modulator identifies which structural groups the GNN is currently struggling to learn (the "poorly learned" regions) and dynamically assigns them higher importance weights. This competition forces the GNN to attend to minority or difficult structures that would otherwise be ignored.
3. WL-based Auxiliary Task
To ensure the topology extractor captures meaningful structural information rather than noise, the authors incorporate a pseudo-labeling task based on the Weisfeiler-Lehman (WL) algorithm. By aligning the extractor's output with the 1-WL test, the framework ensures it has the expressive power to distinguish between complex graph motifs.
Experimental Evaluation
The authors evaluated TopoImb across both node-level and graph-level classification tasks using a mix of synthetic and real-world datasets:
- Node Classification: Evaluated on ImbNode (a synthetic dataset with controlled motif imbalance), as well as Photo and DBLP (real-world citation and shopping networks with induced imbalance).
- Graph Classification: Evaluated on ImbGraph (synthetic motifs) and molecular/protein datasets including Mutag and Enzymes.
Key Results
- Improved Generalization: On the synthetic ImbNode dataset, TopoImb achieved a Macro-F1 score of 82.1, outperforming vanilla GCN (78.1) and specialized class-imbalance methods like GraphSMOTE (76.6).
- Structural Accuracy (TopoAC): The authors introduced TopoAC, a metric measuring accuracy across different topology groups. TopoImb consistently achieved the highest TopoAC, confirming that it successfully learns minority structures rather than just improving overall statistical averages.
- Real-world Performance: On the Mutag dataset, TopoImb improved the AUROC from 83.3 to 84.7, demonstrating its ability to identify critical chemical motifs in natural data.
Discussion and Future Work
TopoImb represents a significant step toward more robust GNNs by highlighting the importance of structural diversity. A key strength of the framework is that it is model-agnostic, successfully enhancing GCN, GraphSage, and GIN architectures.
However, the authors note certain limitations. Currently, TopoImb relies on instance re-weighting. Future iterations could explore more complex modulation techniques, such as generative data augmentation for minority topology groups. Additionally, while effective, the adversarial training loop and memory cells introduce computational overhead compared to standard GNN training. Future research may focus on optimizing these components for even larger-scale graph datasets.
Summary updated