## 3 Methods
### Training Algorithm  
The feature extractor, resampling module, edge generator, and node classifier are combined to form the ESA-GCN model, with its final objective function Ltotal represented by Equation (12):  
\[\text{L}_{\text{total}}=\underset{\text{\theta},\text{\phi},\text{\varphi}}{ \text{min}}\text{L}_{\text{node}}+\lambda\cdot\text{L}_{\text{edge}} \tag{12}\]  
where \(\text{\theta},\text{\phi},\text{and}\text{\varphi}\) are the parameters of the feature extractor, edge generator, and node classifier, respectively. As the performance of the model depends on the quality of the embedding space and the generated edges, we also attempt to pretrain the feature extractor and edge generator using Ledge to make the training process more stable.  
The advantages of the ESA-GCN model can be summarized as follows: (1) The ENN algorithm effectively reduces the classifier's error rate and improves its performance stability by removing low-quality and noisy sample data. (2) The combination of the ENN algorithm and SMOTE algorithm can make the dataset more balanced and improve the model's classification performance. (3) The attention mechanism can better consider the relationships between nodes and feature interactions, enabling more accurate aggregation of nodes on the graph. (4) The attention mechanism can concentrate on a part of crucial information in the input data with high weights while ignoring other irrelevant information, greatly reducing the model parameters and computation expense.  
The complete workflow of the ESA-GCN model is shown in Algorithm 1. In each optimization step, the feature extractor is used to obtain node representations in the 2 nd to3 rd lines. Then, ENN undersampling is performed from the 5 th to the 7 th line. SMOTE oversampling is then executed from the 8 th to the 10 th line to balance the node classes. After predicting the generated new sample edges in the 11 th and 12 th lines, the entire framework is trained together with edge prediction loss and node classification loss, as shown in the 14 th line.  
```
0:\(V_{maj}\), \(V_{min}\): majority class and minority class nodes
0: A: adjacency matrix
0: F: node attribute matrix
0: Y: node label
0:\(\sigma(\cdot)\): activation functions
0: F[\(\mathrm{v},\cdot\)]: the attributes of node \(v\)
0: A[\(\mathrm{v},\cdot\)]: the v-th column of the adjacency matrix
0:\(CONCAT(\cdot)\): tensor splicing
0:\(\lambda\): loss weights
1: for each t \(\in\) [1, max_iterations] do
2: Feature extraction;
3:\(\mathrm{h}_{\mathrm{v}}^{1}=\sigma\left(\mathrm{W}^{1}\cdot\mathrm{CONCAT}( \mathrm{F}[\mathrm{v},\cdot],\mathrm{F}\cdot\mathrm{A}[\mathrm{:v}])\right)\)
4: Resampling;
5: for node in V\({}_{\mathrm{maj}}\) do
6: Perform ENN undersampling in class b, following Equations (2) and (3) of ENN algorithm;
7: end for
8: for node in V\({}_{\mathrm{min}}\) do
9: Generate a new sample in class c, following Equations (2) and (4) of SMOTE algorithm;
10: end for
11: Generate edges;
12: Generate A' using the edge generator based on Equations (5)-(7);
13: Compute the total loss;
14:\(L_{\mathrm{total}}=\min_{\theta,\phi,\varphi}\mathrm{L}_{\mathrm{node}}+\lambda \cdot\mathrm{L}_{\mathrm{edge}}\)
15: return trained feature extractor, edge predictor, and node classifier module.
16: end for
```  
**Algorithm 1** Full Training Algorithm