# Drilling Condition Identification Method for Imbalanced Datasets
## 5 Experiment and Analysis of Drilling Condition Identification
### Analysis of the Effect of Oversampling on Model Performance Improvement  
To validate the effect of the sliding-window-based SMOTE oversampling method on the performance improvement of model recognition for different drilling conditions, the drilling data processed using the sliding-window-based SMOTE oversampling method will be compared with the original data and datasets resampled using other synthetic oversampling methods such as random oversampling, SMOTE, SMOTE-Tomek [34], Borderline-SMOTE [35], and ADASYN [36]. These datasets will be input into the BiLSTM-GRU classification model for training. The recognition precision, recall, and \(F1\) score for each condition under different oversampling methods are shown in Tables 3-5. From Tables 3-5, it can be observed that after training the classification model on the original dataset, there are significant differences in precision, recall, and \(F1\) scores across different classes. For example, in terms of the \(F1\) score, the proportion of rotary drilling and making-a-connection samples in the original dataset is 20.70% and 17.96%, respectively, making them majority classes. Their classification \(F1\) scores reach 96% and 93%, respectively. In contrast, bottom hole spinning accounts for only 1.54% of the original data, making it a minority class, and its classification \(F1\) score is only 81%. These results indicate that  
Figure 10: Comparison of the performance improvement results of different feature selection algorithms on model performance. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{3}{*}{**Oversampling Method**} & \multirow{3}{*}{**Rotary Dilling**} & \multirow{3}{*}{**Sliding Dilling**} & \multirow{3}{*}{**Trip Out**} & \multirow{3}{*}{**In in**} & \multirow{3}{*}{**Making a Connection**} & \multirow{3}{*}{**Stationary Dilling Dilling**} & \multirow{3}{*}{**Drilling Break Cycle + Rotation**} & \multirow{3}{*}{**Delling Break Pipeline**} \\  & & & & & & & & & \\ \hline Original data & 95\% & 85\% & 87\% & 87\% & 94\% & 88\% & 87\% & 89\% & 85\% \\ Random & 95\% & 91\% & 94\% & 92\% & 93\% & 92\% & 92\% & 96\% & 99\% \\ oversampling & 95\% & 93\% & 94\% & 93\% & 95\% & 92\% & 92\% & 96\% & 99\% \\ SMOTE & 96\% & 92\% & 91\% & 92\% & 92\% & 89\% & 92\% & 96\% & 98\% \\ Borderline- & 94\% & 91\% & 94\% & 95\% & 94\% & 92\% & 94\% & 97\% & 99\% \\ SMOTE & 97\% & 91\% & 96\% & 96\% & 89\% & 89\% & 95\% & 98\% & 99\% \\ ADASYN & 97\% & 91\% & 96\% & 96\% & 89\% & 97\% & 99\% & 98\% & 99\% \\ Sliding- & window-based & 99\% & 100\% & 98\% & 98\% & 98\% & 97\% & 99\% & 98\% & 100\% \\ SMOTE & & & & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison table of drilling condition recognition precision under different oversampling methods. when classifying the original drilling data, there is a substantial disparity in classification performance across different categories. Minority-class samples are frequently misclassified, while the overall classification performance of the model appears strong due to the high accuracy in majority classes. This imbalance prevents the model from truly reflecting its performance across all categories, making it unreliable for accurately estimating and making decisions about different drilling conditions. Consequently, the overall classification performance of the model lacks practical value. Using the sliding-window-based SMOTE oversampling method, the precision, recall, and \(F1\) scores for all operating conditions were improved to the 98-100% range. For the less-frequent conditions in the original dataset, such as drilling break cycle, drilling break cycle + rotation, and bottom hole spinning, the classification performance showed no significant difference compared to the majority classes like rotary drilling and sliding drilling. This result indicates that after processing the dataset with the sliding-window-based SMOTE oversampling method, the classifier training did not suffer from performance disparities caused by class imbalance.