# Drilling Condition Identification Method for Imbalanced Datasets
###### Abstract  
To address the challenges posed by class imbalance and temporal dependency in drilling condition data and enhance the accuracy of condition identification, this study proposes an integrated method combining feature engineering, data resampling, and deep learning model optimization. Firstly, a feature selection strategy based on weighted symmetrical uncertainty is employed, assigning higher weights to critical features that distinguish minority classes, thereby enhancing class contrast and improving the classification capability of the model. Secondly, a sliding-window-based Synthetic Minority Oversampling Technique (SMOTE) algorithm is developed, which generates new minority-class samples while preserving temporal dependencies, achieving balanced data distribution among classes. Finally, a coupled model integrating bidirectional long short-term memory (BiLSTM) networks and gated recurrent units (GRUs) is constructed. The BiLSTM component captures global contextual information, while the GRU efficiently learns features from complex sequential data. The proposed approach was validated using logging data from 14 wells and compared against existing models, including RNN, CNN, FCN, and LSTM. The experimental results demonstrated that the proposed method achieved classification \(F1\) score improvements of 8.95%, 9.58%, 10.25%, and 8.59%, respectively, over these traditional models. Additionally, classification loss values were reduced by 0.32, 0.3315, 0.2893, and 0.2246, respectively. These findings underscore the significant improvements in both accuracy and balance achieved by the proposed method for drilling condition identification. The results indicate that the proposed approach effectively addresses class imbalance and temporal dependency issues in drilling condition data, substantially enhancing classification performance for complex sequential data. This work provides a practical and efficient solution for drilling condition recognition. drilling condition; imbalanced data; feature selection; bidirectional long short-term memory network; gated recurrent unit 2025202533620202536  
is facing severe challenges such as high temperature and pressure, as well as increased uncertainty in the formation [3]. In this context, accurate condition recognition becomes the core technological support for ensuring drilling safety and optimizing operational parameters. Its importance is reflected in three aspects: real-time monitoring of down-hole conditions can prevent major accidents such as blowouts and stuck pipe; accurate identification of drilling, tripping, and circulation phases can improve mechanical drilling speed and well construction efficiency; and timely judgment of special conditions provides decision-making support for the closed-loop control of intelligent drilling systems [4]. With the powerful data processing and self-learning capabilities of artificial intelligence, efficient intelligent recognition models can be developed to handle the vast amounts of drilling data and significantly improve the accuracy and efficiency of condition identification [5,6]. However, intelligent recognition of drilling conditions still faces a series of technical challenges. Currently, most studies focus on improving overall classification performance, while to some extent neglecting an in-depth exploration of the recognition accuracy for different drilling conditions. In actual drilling operations, conditions such as rotary drilling and tripping occur more frequently and thus have a larger sample volume, whereas conditions like bit idling at the bottom of the well are less frequent, resulting in a limited number of samples. This imbalanced sample distribution causes the input data for classification models to exhibit a prevalent class imbalance. During the model training phase, the class imbalance problem causes the classification model to overlearn the features of majority-class conditions while inadequately learning the characteristics of minority-class conditions.