Abstract
Class imbalance is the phenomenon that some classes have much fewer instances than others, which is ubiquitous in real-world graph-structured scenarios. Recent studies find that off-the-shelf Graph Neural Networks (GNNs) would under-represent minor class samples. We investigate this phenomenon and discover that the subspaces of minor classes being squeezed by those of the major ones in the latent space is the main cause of this failure. We are naturally inspired to enlarge the decision boundaries of minor classes and propose a general framework GraphSHA by Synthesizing HArder minor samples. Furthermore, to avoid the enlarged minor boundary violating the subspaces of neighbor classes, we also propose a module called SemiMixup to transmit enlarged boundary information to the interior of the minor classes while blocking information propagation from minor classes to neighbor classes. Empirically, GraphSHA shows its effectiveness in enlarging the decision boundaries of minor classes, as it outperforms various baseline methods in class-imbalanced node classification with different GNN backbone encoders over seven public benchmark datasets.
Introduction: The Squeezed Minority Problem
In many real-world graphs—such as citation networks, co-purchase graphs, or fraud detection systems—class distributions are heavily imbalanced. A few "majority" classes often contain thousands of examples, while "minority" classes may have only a handful. Standard Graph Neural Networks (GNNs) typically struggle in these scenarios, exhibiting a failure mode the authors identify as the squeezed minority problem.
In the latent representation space of a GNN, the subspaces occupied by minority classes are physically compressed by the dominant majority classes. Because these minority subspaces are "squeezed," new test samples frequently fall outside these narrow boundaries and are misclassified as majority nodes. Existing solutions like simple oversampling or standard Mixup often fail because they either reinforce the existing small boundaries or "invade" the majority space so aggressively that they degrade overall model accuracy.
Methodology: GraphSHA and SemiMixup
The proposed framework, GraphSHA (Synthesizing HArder samples), is designed to intentionally generate samples near the decision boundary to "stretch" the minority class's territory.
The framework consists of three primary components:
- Hard Sample Identification: Instead of selecting random minority nodes, the model identifies "anchor" nodes—minority samples that the current model finds difficult to classify (high "hardness"). It then identifies "auxiliary" nodes from neighboring classes in the latent space.
- SemiMixup: This core innovation handles both feature and edge synthesis. It creates a new synthetic node by mixing the features of the hard minority anchor and the majority auxiliary node, placing the synthetic sample right on the edge of the minority territory. Crucially, to prevent this new node from "leaking" into the majority class, GraphSHA only connects the synthetic node to the 1-hop neighborhood of the minority anchor, explicitly excluding connections to the majority auxiliary node's neighborhood.
- Graph Diffusion Smoothing: To ensure topological soundness, the model uses graph diffusion (e.g., Personalized PageRank) to transform the "hard" unweighted graph into a "soft" weighted one, allowing for more nuanced neighbor sampling.
Experimental Evaluation
The researchers evaluated GraphSHA across seven diverse benchmark datasets, including citation networks (Cora, CiteSeer, PubMed, ogbn-arXiv), co-purchase networks (Amazon-Photo, Amazon-Computers), and academic networks (Coauthor-CS).
Key Results
GraphSHA consistently outperformed ten baselines (including GraphSmote, GraphENS, and TAM) across GCN, GAT, and GraphSAGE backbones. On the Cora-LT dataset, GraphSHA achieved a balanced accuracy of 74.62%, significantly higher than the vanilla GCN (59.42%).
A critical finding was the mitigation of classification bias. As shown in the figure above, while standard GNNs (like GCN) are heavily biased toward predicting majority classes for uncertain samples, GraphSHA's predictions are distributed much more evenly, indicating that the "squeezed" bias has been successfully mitigated. Furthermore, GraphSHA demonstrated superior scalability, successfully running on the large-scale ogbn-arXiv dataset (over 160k nodes) where many competing generative methods encountered memory errors.
Discussion and Future Work
GraphSHA demonstrates that generating difficult samples is more effective than simply increasing sample quantity. By synthesizing nodes that share features with neighboring classes but maintain structural loyalty to the minority class, the model learns more robust decision boundaries.
Future work may explore "type-imbalanced" scenarios in Heterogeneous Information Networks and investigate the method's performance on highly heterophilous graphs. Additionally, while GraphSHA provides a robust framework, the optimal "hardness" of synthetic samples may require domain-specific tuning of the underlying Beta distribution.
Code is available at https://github.com/wenzhilics/GraphSHA.
Summary updated