## 2 Methodology
### Enhanced Sampling Algorithms  
#### 2.2.1 Over-Sampling Algorithms  
SMOTE (synthetic minority over-sampling technique) is an algorithm designed to address the issue of imbalanced sample distributions in datasets [45]. Data balancing processing is a crucial step in machine learning tasks, and SMOTE is a widely recognized over-sampling method that can effectively increase the number of samples of the minority classes. It has obvious advantages in maintaining data reliability and has become a fundamental basis for various over-sampling algorithms. Its basic concept is about generating synthetic samples for minority classes to enhance their representation. The specific process of the SMOTE algorithm is as follows (Figure 2): Firstly, the number of samples for each class in the training set are counted, with the class having the highest sample count designated as the majority class, and the remaining classes designated as minority classes. Next, the Euclidean distance between samples of minority classes is calculated to measure feature disparities, expressed by the following equation:  
\[d(i,j)=\sqrt{\sum_{k=1}^{N}\left(x_{i}^{k}-x_{j}^{k}\right)^{2}} \tag{3}\]  
where \(N\) represents the number of features. Then, for each minority class sample, another sample is randomly selected from its \(K\) nearest neighbors, and a synthetic sample is generated using interpolation. For the sample \(x_{i}\) and its selected neighbor \(x_{j}\), the synthetic sample can be calculated as:  
\[x_{\text{new}}=x_{i}+\lambda\cdot\left(x_{j}-x_{i}\right) \tag{4}\]  
where \(\lambda\) is a random number between 0 and 1.  
ADASYN (adaptive synthetic sampling) is a further improved data balancing algorithm that introduces adaptiveness based on SMOTE [46]. It evaluates the local density of each minority class sample and generates more synthetic data for samples with lower density. The advantages of this method are reflected in many aspects such as dataset distribution and model prediction results. The specific process of the ADASYN algorithm is as follows (Figure 3): The first step is the same as the SMOTE algorithm, which involves finding the majority and minority classes in the training set. Next, for each minority class sample, compute the density of majority class samples among its \(K\) nearest neighbors. For sample \(x_{i}\) in the current minority class, its density can be represented by the following equation:  
\[r_{i}=1-\frac{\Delta_{i}}{K} \tag{5}\]  
where \(\Delta_{i}\) represents the number of samples belonging to the same class with \(x_{i}\) among the \(K\) nearest neighbors of \(x_{i}\). The larger the value of \(r_{i}\), the fewer samples in neighbors of \(x_{i}\), and therefore more synthetic samples need to be generated around \(x_{i}\).  
The next step involves normalizing the density of each minority class sample to obtain corresponding sample synthesis weights. In the following data synthesis process, more synthetic samples will be generated around samples with larger weights. For the minority class sample \(x_{i}\), the number of synthesized samples \(g_{i}\) can be calculated as:  
\[g_{i}=\frac{1}{\sum_{j=1}^{M}r_{i}}\cdot r_{i}\cdot(N-M) \tag{6}\]  
Figure 3: The work flow of ADASYN algorithm.  
Figure 2: The work flow of SMOTE algorithm.  
where \(N\) represents the number of majority class samples in the dataset, and \(M\) represents the number of minority class samples corresponding to \(x_{i}\).  
The final step of the algorithm is the synthesis of synthetic samples, following the same interpolation method in the sample feature space, which can be represented by Equation (4). Compared to the SMOTE algorithm, the adaptiveness of sample synthesis enables ADASYN to perform better when dealing with complex imbalanced datasets, making it an important step for further optimizing the handling of imbalanced problems.