# Drilling Condition Identification Method for Imbalanced Datasets
## 5 Experiment and Analysis of Drilling Condition Identification
### Analysis of the Classification Performance of the BiLSTM-GRU Model  
To validate the performance improvement of the BiLSTM-GRU model in drilling condition classification prediction, four commonly used classification models were selected for comparison. The \(F1\) score variation curve of the test set during training for different models is shown in Figure 12. Compared to the RNN (recurrent neural network), CNN (convolutional neural network), FCN (fully convolutional network), and LSTM models, the \(F1\) scores of the BiLSTM-GRU model in this paper improved by 8.95%, 9.58%, 10.25%, and 8.59%, respectively. Moreover, the \(F1\) score of the BiLSTM-GRU model did not stagnate or decline in the later stages of training, indicating that the learning process of the model is stable and can continuously extract useful information from the data to improve its performance. The loss value variation curve of the test set during training for different models is shown in Figure 13. Compared to the RNN, CNN, FCN, and LSTM models, the loss value of the BiLSTM-GRU model in this paper decreased by 0.32, 0.3315, 0.2893, and 0.2246, respectively. Other models showed varying degrees of loss value increase in the later stages of training, indicating that they overlearned noise, outliers, and other special patterns in the training data, leading to overfitting and loss of the ability to grasp general patterns. In contrast, the loss value of the BiLSTM-GRU model steadily decreased without any increasing trend, demonstrating its good generalization ability. The variation curves of \(F1\) score and loss value during the training process suggest that the BiLSTM-GRU model proposed in this paper has a good fit to the drilling data patterns, with reasonable model parameter settings and strong generalizability.  
Figure 11: Accuracy and loss distribution during training with different datasets.  
Using the BiLSTM-FCN model to predict the categories of drilling data generated within 48 h, the confusion matrix of the classification results is shown in Figure 14. In the figure, the number of samples on the main diagonal is significantly higher than that of the off-diagonal elements, indicating that the model, trained with the dataset processed through data augmentation, demonstrates high classification accuracy and stability. Additionally, the classification prediction performance across different categories is relatively balanced, with no shift in classification results towards the majority class.  
The above experimental results demonstrate that the drilling condition recognition method proposed in this paper, which is tailored for imbalanced datasets, effectively addresses the impact of class imbalance on model classification results. The BiLSTM-GRU composite model constructed in this paper enhances the accuracy of condition classification prediction and exhibits good generalization ability.  
Figure 12: \(F1\) score variation curves during training of different models.  
Figure 13: Loss value variation curves during training of different models.