Abstract
In the oil and gas industry, the drilling phase is most critical in planning and controlling as it faces several problems which require accurate and prompt responses to limit all sort of losses. Among these challenges, kicks and stuck pipe incidents represent two of the most costly and disruptive problems, with their early detection and control very essential to improve efficiency and ensure safety. In this paper, four supervised learning techniques namely: Logistic Regression (LR), Gradient Boosting (GB), Decision Tree (DT), and Random Forest (RF), were applied to a time-series dataset comprising 275,000 data points (sampled at 10-second intervals) from the Forge 16B (78)-32 well. Anomalies, including kick, stuck pipe, and normal drilling conditions were labeled within the dataset by setting appropriate conditions of exceeding thresholds/limits using python code. Unlike most studies, we employed twenty-one (21) input parameters to improve effectiveness of each parameter for robust model development. From the results, RF achieved the highest performance, with an accuracy, precision, and recall of 0.998. The DT model followed closely, scoring 0.996 across the same metrics; GB model recorded 0.962 for accuracy, 0.963 for precision, and 0.962 for recall, and LR had the lowest values of all the four metrics. Feature importance analysis identified hook load (klbs), rate of penetration (ft/hr) and weight on bit (klbs) as the most influential parameters for anomaly detection, in descending order of relevance. By leveraging on a focused dataset and high-level detection semantics, this work offers a sturdy, interpretative, and highly reliable framework for real-time anomaly detection, paving the way for more efficient and safer drilling operations in challenging formations.
1. Introduction
Drilling operations in the oil and gas industry are technically demanding and often affected by various anomalies that threaten operational efficiency and safety. Common drilling anomalies such as pipe sticking, formation kicks, wellbore instability, and lost circulation pose significant risks. These events may result in equipment damage, environmental pollution, personnel injury, and considerable Non-Productive Time (NPT)
. This happens to be the unplanned drilling occurrence for an operator that incurs greatest cost from loss of equipment, hole footage, and fishing operations
| [7] | Emhanna, S. A. (2018). Analysis of Non-Productive Time (NPT) in Drilling Operations - A Case Study of the Ghadames Basin. A paper presented at the Second Scientific Conference of Oil and Gas, Ajdabiya, Lybia, pp. 244 - 252. https://www.researchgate.net/publication/330222796 |
[7]
. Stuck pipe events have the highest number of NPT in the drilling industry
| [2] | Assi, A. H. (2022). Non-Productive Time Reduction during Oil Wells Drilling Operations. Journal of Petroleum Research and Studies, Vol. 12, No. 3, pp. 34 - 50. http://doi.org/10.52716/jprs.v12i3.541 |
| [7] | Emhanna, S. A. (2018). Analysis of Non-Productive Time (NPT) in Drilling Operations - A Case Study of the Ghadames Basin. A paper presented at the Second Scientific Conference of Oil and Gas, Ajdabiya, Lybia, pp. 244 - 252. https://www.researchgate.net/publication/330222796 |
[2, 7]
. Kicks, on the other hand, occur as unexpected formation fluid flow that arise basically when formation pressure is greater than mud hydrostatic pressure. Kicks also result from improper hole fill-up during drilling during trips, drilling through shallow gas zones at excessive rates, lost circulation and swabbing
| [10] | Kizayev, T., Irawan, S., Akbari Khan, J., Ahmad Khan, S., Cai, B., Zeb, N. and Wayo, K. D. (2023). Factors affecting drilling incidents: Prediction of suck pipe by XGBoost model. Energy Reports, Vol. 9, No. 4, pp. 270-279. https://doi.org/10.1016/j.egyr.2023.03.083 |
[10]
. The severity of a kick is dependent on both the influx type and volume with gas kick being especially dangerous when it reaches the riser, resulting rapidly to blowout of the platform
| [8] | Fjetland, A. K. (2019). Kick Detection During Offshore Drilling using Artificial Intelligence, Master’s Thesis in Mechatronics, Faculty of Engineering and Science, University of Agder. https://doi.org/10.1109/ICIEA.2019.8833850 |
[8]
. The highly uncertain and dynamic nature of the subsurface environment, combined with manual control over many aspects of drilling operations, increases the probability of human error
| [3] | Bayazitova, G., Anastasiadou, M., and Santos, V. (2024). Oil and gas flow anomaly detection on offshore naturally flowing wells using deep neural networks. Journal of Geoenergy Science and Engineering, Vol. 242, No. 4, pp. 213 - 240. https://doi.org/10.1016/j.geoen.2024.213240 |
| [11] | Koroteev, D., and Tekic, Z. (2021). Artificial intelligence in oil and gas upstream: Trends, challenges, and scenarios for the future. Energy and AI, Vol. 3, pp. 1 - 10. https://doi.org/10.1016/j.egyai.2020.100041 |
[3, 11]
leading to most of the anomalies encountered.
Artificial Intelligence (AI) has emerged as a powerful tool for transforming decision-making in drilling activities
| [14] | Opeyemi, B., Javier H., Tanveer Y., and Catalin, T. (2015). Application of artificial intelligence methods in drilling system design and operations. A review of the state of the art, JAISCR, 2015, Vol. 5, No. 2, pp 121 -139. https://doi.org/10.1515/jaiscr-2015-0024 |
[14]
. AI has become integral in developing intelligent systems across all areas of the oilfield life cycle, from intelligent drilling to intelligent production
| [3] | Bayazitova, G., Anastasiadou, M., and Santos, V. (2024). Oil and gas flow anomaly detection on offshore naturally flowing wells using deep neural networks. Journal of Geoenergy Science and Engineering, Vol. 242, No. 4, pp. 213 - 240. https://doi.org/10.1016/j.geoen.2024.213240 |
| [18] | Sircar, A., Yadav, K., Rayavarapu, K., Bist, N., and Oza, H. (2021). Application of machine learning and artificial intelligence in oil and gas industry. Journal of Petroleum Research, Vol. 6, No. 4, pp. 379-391. https://doi.org/10.1016/J.PTLRS.2021.05.009 |
[3, 18]
. Several companies have already demonstrated the benefits of these technologies. Schlumberger, in collaboration with National Oil well Varco, developed automated drilling solutions, using AI and machine learning to automate drilling workflows and enhance safety and efficiency
. The efficient detection and prediction of stuck pipe and kicks in drilling scenarios will not only guarantee safety but greatly save cost and reduce NPT. Further, the use of Artificial Intelligence techniques improves reliance, accuracy and suitability to dynamic environments.
Several researchers have investigated into anomaly detection during drilling operations and have used diverse AI techniques to develop models for different cases. Their results show generalization though with certain limitations that pave way for more research on this topic. For instance, Fjetland
| [8] | Fjetland, A. K. (2019). Kick Detection During Offshore Drilling using Artificial Intelligence, Master’s Thesis in Mechatronics, Faculty of Engineering and Science, University of Agder. https://doi.org/10.1109/ICIEA.2019.8833850 |
[8]
developed models for kick detection using two types of Deep Recurrent Neural Network viz; Long Short-Term Memory (LSTM) and Bidirectional LSTM (BiLSTM). The proposed detection methodology was based on simulated drilling data and was targeted at detection of this anomaly in fractured formations and the wellbores in a large range of dynamic drilling simulations. Wang and Ozbayoglu
| [19] | Wang, J., and Ozbayoglu, E. M. (2022). 'Application of Recurrent Neural Network Long Short-Term Memory Model on Early Kick Detection', in Proceedings of the ASME 2022 41st International Conference on Ocean, Offshore and Arctic Engineering. Vol. 10: Petroleum Technology. Hamburg, Germany. Paper No. OMAE2022-78739, V010T11A008. https://doi.org/10.1115/OMAE2022-78739 |
[19]
employed Recurrent Neural Network (RNN) that used Graphics Processing Unit (GPU) computing to capture intricate scenarios leading to sensitive kick detection. However, this was improved to intelligent kick detection using both dominant and auxiliary drilling parameters that were complementary on the ANN model
| [20] | Zhang, D., Sun, W., Dai, Y., Bu, S., Feng, J., and Huang, W. (2024). Intelligent kick detection using a parameter adaptive neural network. Geoenergy Science and Engineering, Vol. 234, pp. 1-10. https://doi.org/10.1016/j.geoen.2024.212694 |
[20]
. A supervised model developed by Muojeke
et al. | [13] | Muojeke, S., Venkatesan, R., and Khan, F. (2020). Supervised data-driven approach to early kick detection during drilling operation. Journal of Petroleum Science and Engineering, Vol. 192, 107324. https://doi.org/10.1016/j.petrol.2020.107324 |
[13]
utilized feedforward ANN that employed downhole pressure, mud flow-out rate, mud density and electrical conductivity as the only input parameters. The two experiments carried out to obtain 1935 data points for the study employed air influx rates. This consideration enabled the model to identify the signatures of gas influxes before they developed into full-blown kicks, enabling quicker detection and reducing the false alarm rate.
Miri
et al.
| [12] | Miri, R., Sampaio J., Afshar, M., and Laurenco, A. (2007). Development of artificial neural networks to predict differential pipe sticking in Iranian offshore oil fields. Paper SPE 108500 presented at the International Oil Conference and Exhibition, Veracruz, Mexico, pp 27-30. https://doi.org/10.2118/108500-MS |
[12]
created a model using 109 datasets that included both stuck and non-stuck cases. While effective in identifying trends, the model was constrained by a small data size, limiting its generalization. Meanwhile, Shadizadeh
et al.
| [17] | Shadizadeh, S. R, Karimi, F., and Zoveidavianpoor M. (2010). Drilling stuck pipe prediction in Iranian oil fields: An artificial neural network approach. Iran Journal of Chemical Engineering, Vol. 7, No. 4, pp 29-41. https://doi.org/20.1001.1.17355397.2010.7.4.4.1 |
[17]
applied the artificial neural network to predict stuck pipe probability. The database contained 115 stuck and 160 non-stuck cases. Non-stuck data were collected from days that the wells were completely safe and had not become stuck in the same general areas of operation
| [6] | Elahifar, B., and Hosseini, E. (2022). Machine learning algorithm for prediction of stuck pipe incidents using statistical data: case study in middle east oil fields. Journal of Petroleum Exploration and Production Technology, Vol. 12, pp. 2019-2045. https://doi.org/10.1007/s13202-021-01436-3 |
[6]
. Another study by Do
et al.
| [4] | Do, Q. K., Hoang, T. Q., Nguyen, T., and Ong, V. K. P. (2022). Predicting and avoiding hazardous occurrences of stuck pipe for the petroleum wells at offshore Vietnam using machine learning techniques. IOP Conference Series: Earth and Environmental Science, Vol. 1091, 012003. https://doi.org/10.1088/1755-1315/1091/1/012003 |
[4]
compared ANN and SVM models for prediction of stuck pipe occurrence risk on an offshore Vietnam field. The study considered eight (8) drilling parameters (without hookload) with only 83 data points. However, the results showed that SVM outperformed with accuracy of 97%. For more complex and dynamic conditions, Kizayev
et al.
| [10] | Kizayev, T., Irawan, S., Akbari Khan, J., Ahmad Khan, S., Cai, B., Zeb, N. and Wayo, K. D. (2023). Factors affecting drilling incidents: Prediction of suck pipe by XGBoost model. Energy Reports, Vol. 9, No. 4, pp. 270-279. https://doi.org/10.1016/j.egyr.2023.03.083 |
[10]
utilized 20 parameters including mud weight, gel strength, plastic viscosity and yield point for training XGBoost models. Although they concluded that flow rate and rotary speed affected the prediction negatively, greater number of input parameters were recommended for improved performance of the models.
A broad anomaly detection and classification model was developed by Altindal
et al.
| [1] | Altindal, M. C., Nivlet, P., Tabib, M., Rasheed, A., Kristiansen, T. G., and Khosravanian, R. (2024). Anomaly detection in multivariate time series of drilling data. Journal of Geoenergy Science and Engineering, Vol. 237, Issue 212778. https://doi.org/10.1016/j.geoen.2024.212778 |
[1]
using three unsupervised learning algorithms: Principal Component Analysis (PCA), Isolation Forest (IF) and LSTM-Autoencoder (LSTM-AE). Their developed model classified anomalies into loss circulation, stuck pipe, poor hole cleaning, or kick events. However, the study failed to optimize the drilling parameters evident in the noise generation and low overall drilling efficiency. In the recent study by Diyah
et al.
| [5] | Diyah, R., Zulfan, Bambang, Y. S., Akhmad, S., Fandika, G. P., and Redha, B. P. (2025). Machine Learning Classifies Data for Early Warning of Stuck Pipe Detection in Geothermal Drilling. Int. Journal of Adv. Sci. Eng. Information Technology, Vol. 15, pp. 43 - 51. https://doi.org/10.18517/ijaseit.15.1.20333 |
[5]
, Support Vector Machine (SVM) and Artificial Neural Network (ANN) models were developed to predict and classify conditions as normal, pre-stuck, or stuck on time-based mud logging unit sensor data. Gas rate was investigated for the first time as a relevant feature where SVM out performed ANN with same accuracy of 0.99 but recall of 0.97 and 0.89 respectively.
The outcome of the review of studies on anomaly detection in drilling shows populated dependence of the models on these parameters viz: standpipe pressure, mud flow rates (in/out), hook load, Rate of Penetration (ROP), Weight on Bit (WOB), Torque on Bit (TOB), pump pressure and pipe rotation (RPM). In addition, over 80% of the AI/ML algorithms used are unsupervised learning techniques and less than 30% of the studies carryout a sensitivity analysis on the input parameters selected, posing a challenge of complexity and lack of interpretability in the proposed models. Despite these advances, the widespread application of AI in drilling anomaly detection still faces multiple challenges. Issues such as data quality, model interpretability, and adaptability to changing geological settings continue to hinder robust deployment. Additionally, given the critical nature of anomalies like pipe sticking and kicks, and the operational and economic impacts they carry, there is a strong need to further refine AI models for better accuracy, adaptability, and interpretability. This study focuses on developing robust AI models from an extensive number of drilling parameters in a large drilling dataset while minimizing noise and ensure high performance using machine learning techniques. Furthermore, this study provides sensitivity analysis to determine the parameters which greatly influence the occurrence of both stuck pipe and kick in same drilling dataset.
2. Methodology
2.1. Dataset Description
Time series data (at 10-second intervals) for this study was sourced from drilling operations of University of Utah on Forge 16B (78)-32 well, United States of America. The data comprised 143 columns and 746,905 non-null entries of drilling parameters in API units with some thresholds and limits for most parameters being inclusive. These data streams include drilling parameters such as total mud volume, weight on bit (WOB), rate of penetration (ROP), bit rotary speed, hook load, standpipe pressure, rotary RPM, top drive torque, top drive rotary speed, bit torque, minimum pressure, minimum hook load, minimum RPM, minimum WOB, over-all ROP, total mud high warning, total mud low warning, total mud high limit, total mud low limit, hook load threshold and auto-driller minimum torque. These parameters are critical in identifying the onset of stuck pipe incidents, which often exhibit abnormal variations in hook load and torque, and kicks, which typically present sudden increase in pit volume and flow out rates.
2.2. Data Preprocessing
The preprocessing phase began with the synchronization of time-series data across all relevant sensors, ensuring that drilling dynamics are accurately aligned. Missing or corrupted data points were first sought out to be addressed using interpolation or imputation techniques but all entries contained non-null values. Also, invalid sensor readings of -999.25 were identified and replaced with ‘Not a Number’ (Na_N) for parameters such as rotary RPM and min RPM specifically. Noise in the data was minimized by filtering it and the data size reduced to 275,000 entries and 21 columns were selected based on consideration of related parameters to stuck pipe and kick occurrence.
2.3. Modelling Workflow
Described graphically in
Figure 1 is the process workflow for this study; applying machine learning to detect drilling parameter conditions in normal, anomaly, and stuck conditions. Initially, a set of observed data totaling 275,000 rows was cleaned. Then, -999.25 (invalid sensor readings) was replaced with Na_N. Two steps were applied to fill missing values
, viz., forward fill and backward fill, after which the remaining gaps were filled with 0.
Figure 1. Graphical representation of the modelling workflow.
When the data preparation phase was complete, four important analyses that were carried out are discussed below:
1) Feature Engineering: The “calculate_time_based_features()” function in Python was employed to create rolling averages and percentage changes for four key drilling parameters, which are rate of penetration (ROP), mud volume, standpipe pressure, and hook load. The rolling averages for ROP were capped at 1 hour, 30 minutes, and 10 minutes, respectively. Mud volume changes were capped at 1 minute, 5 minutes, and a resulting percentage change in 1 min. While standpipe pressure had a 1-minute percent change, a 5-minute rolling std, and a 30-minute average, hook load had just 1 minute percent change, and a 30-minute average. These features were subsequently used for anomaly detection.
2) Stuck Pipe Detection: The code semantics used for stuck pipe detection was extremely restrictive, such that the “detect_extreme_stuck_pipe()” function only flags severe stuck-pipe scenarios when three conditions are satisfied: (i) persistent Zero ROP; that is, ROP ≤ 0.01 for ≥98% of a 30-minute window. (ii) at least one secondary severe indicator; that is, mud volume ≥20% below low limit, torque spike ≥4 standard deviations above mean over 1 hour window, and/or hook load ≥50% above threshold. (iii) If no secondary indicators exist, then the function would require 60 minutes of zero ROP.
3) Kick Detection: The code semantics used for the kick detection were very conservative, such that the “detect_definitive_kicks()” function only flags a kick when multiple clear influx signs occur simultaneously. The signs include major mud gain being ≥15% increase in 1 minute. An extreme pressure spike being ≥25% increase in 1 minute. Major hook load drop being ≥20% drop in 1 min. Extreme ROP spike being ROP ≥3× 30 minutes average and >50 ft/hr. And mud volume above high warning, being ≥10% above the high limit. A very critical condition that must be met is that at least 2 indicators must occur together, persisting ≥15s within a 30s window.
4) Label Assignment: The “create_drilling_state_labels()” function was applied. It automatically sets all rows to normal (0) by default, it assigns 1 if the kick condition is met (and not stuck), it assigns 2 (overrides kick) if the stuck pipe condition is met, and lastly, it adds a “label_name” column for readability.
3. Discussion of Results
3.1. Labeling Output and Visualization
The label distributions were analyzed using the “analyze_and_display_labels()” function to obtain pie chart and bar chart (
Figure 2) of the label counts.
Figure 2. Distribution of normal, kick and stuck pipe events in the data.
The pie chart in
Figure 2(a) shows that the majority of drilling operations fall under the normal state, accounting for 81.3% of the data; stuck pipe incidents make up 17.5%, while kick occurrences are the least frequent at 1.1%. On the other hand, the bar chart in
Figure 2(b) quantifies the proportions of the states in the drilling data in absolute numbers. Normal operations take up to 223,681 records, stuck pipe incidents number up to 48,200, and kick events account for only 3,119 records. The bars were color-coded consistently with the pie chart for easy comparison. These detection results are in agreement with anomaly event reports on shale oil well drilling, where stuck pipe cases are more experienced than kicks due to the high swelling behaviour and low permeability of such formations, as it is somewhat associated with that region of the world (USA).
3.2. Developed Models’ Performances Description
The performance of the four artificial intelligence models, namely Logistic Regression (LR), Decision Tree (DT), Random Forest (RF), and Gradient Boosting (GB), for the simultaneous detection of kick and stuck pipe occurrences during drilling operations in complex formations is comprehensively summarized in
Tables 1 and 2. The assessment results from the computations on the confusion matrices of the developed models, which are presented in
Figures 3-6.
Table 1 provides a detailed breakdown of true positives (TP), false positives (FP), false negatives (FN) and true negatives (TN) from the models’ matrices.
Figure 3. Confusion matrix of LR technique.
Figure 4. Confusion matrix of GB technique.
Figure 5. Confusion matrix of DT technique.
Figure 6. Confusion matrix of RF technique.
The percentage errors per class are considered for each model, where the error rate is defined as FN / (TP + FN). The choice of FN and TP for computing the error rate is justified by the study's focus on reducing the criticality of minimizing missed detection of stuck pipe and kick events which could lead to equipment loss and catastrophic blowouts, respectively in high-risk drilling scenarios. Complementing this,
Table 2 offers aggregated metrics, including accuracy, precision, recall, and F1-score, which quantify the models' overall effectiveness in classifying normal operations (class 0), kick events (class 1), and stuck pipe incidents (class 2). The following sections discuss each model separately, focusing on their percentage errors as key indicators of detection reliability, justified by the values in
Table 2, while highlighting implications for drilling safety and efficiency in complex geological environments.
Table 1. Summary of the confusion matrix metrics of the developed models.
ML Technique | Class | Model Matrix Variables |
TP | FN | FP | TN |
Logistic Regression (LR) | 0 | 54400 | 12389 | 8534 | 125990 |
1 | 60437 | 6792 | 6112 | 127972 |
2 | 64942 | 2353 | 6888 | 127130 |
Gradient Boosting (GB) | 0 | 60548 | 6241 | 1009 | 133515 |
1 | 66568 | 661 | 3544 | 130540 |
2 | 66622 | 673 | 3022 | 130996 |
Decision Tree (DT) | 0 | 66333 | 456 | 297 | 134227 |
1 | 67108 | 121 | 249 | 133835 |
2 | 67106 | 189 | 220 | 133798 |
Random Forest (RF) | 0 | 66517 | 272 | 40 | 134484 |
1 | 67217 | 12 | 151 | 133933 |
2 | 67256 | 39 | 132 | 133886 |
3.2.1. Logistic Regression
The logistic regression model, as a linear classifier, demonstrates moderate performance in detecting kick and stuck pipe events, but its high percentage errors limit its applicability in complex formations where nonlinear interactions between drilling parameters such as standpipe pressure (psi), bit rotary speed, and torque are prevalent. From
Table 1, the error rates are 18.54% for class 0 (normal operations), 10.10% for class 1 (kick), and 3.50% for class 2 (stuck pipe). These elevated errors, particularly for class 1, indicate a substantial risk of missing kick occurrences, which could result in uncontrolled fluid influxes and potential blowouts, posing critical hazards in heterogeneous formations. The model's overall accuracy of 0.87416, precision of 0.875436, recall of 0.874416, and F1-score of 0.874647 (from
Table 2) reflect this weakness, as the linear decision boundaries fail to capture subtle precursors to events, leading to higher FN values. While LR is computationally efficient and interpretative, its performance suggests it is better suited as a baseline rather than a standalone tool for real-time monitoring, necessitating enhancements like feature polynomial transformations to reduce errors in future iterations.
3.2.2. Gradient Boosting
Gradient Boosting, an ensemble technique that sequentially builds weak learners to minimize errors, shows improved detection capabilities over LR but still exhibits notable weaknesses in classifying normal operations amid complex formation uncertainties. Computed performance from
Table 1 shows that the percentage errors are 9.44% for class 0, 0.98% for class 1, and 1.00% for class 2. The relatively high error in class 0 implies challenges in distinguishing baseline drilling from incipient anomalies. However, the low errors for classes 1 and 2 demonstrate strong sensitivity to kick and stuck pipe, minimizing catastrophic misses. Supported by
Table 2 are the aggregated metrics: accuracy (0.956756), precision (0.957014), recall (0.956756), and F1-score (0.956444). GB balances predictive power with robustness, making it viable for scenarios requiring iterative error correction. This model excels at enhancing proactive interventions by leveraging sequential learning to refine detection, particularly for detecting kick and stuck pipe events. However, a minor weakness lies in its slightly elevated 9.44% error rate for class 0 (normal operations), suggesting potential sensitivity to noisy data in complex formations.
3.2.3. Decision Tree
The Decision Tree (DT) model, leveraging hierarchical splits on drilling features, provides a highly interpretative approach with low percentage errors, making it particularly valuable for explainable AI in drilling operations where understanding decision paths is essential for operator trust. Calculated error rates of 0.68% for class 0, 0.18% for class 1, and 0.28% for class 2 indicate excellent detection of kick and stuck pipe with minimal missed events. This low error profile reduces the likelihood of false negatives, particularly in class 1 and 2, which are paramount for preventing escalations in complex formations prone to sudden pressure imbalances. The model's overall metrics from
Table 2 show accuracy of 0.998622, precision of 0.996621, recall of 0.996622, and an F1-score of 0.996621. These underscore the model’s near-optimal performance, attributed to its ability to handle nonlinear relationships without extensive ensembles. DT simplicity facilitates integration into real-time systems, though pruning may be needed to avoid minor over-fitting observed in class 0 errors, enhancing its utility for simultaneous multi-hazard detection.
3.2.4. Random Forest
Random Forest, an ensemble of decision trees that aggregates detection to reduce variance, emerges as the most reliable model for simultaneous kick and stuck pipe detection. This is evidenced by the RF exceptionally low percentage errors that align well with the demands of complex formations characterized by high-dimensional and noisy data. As calculated from
Table 1, the errors are 0.41% for class 0, 0.02% for class 1, and 0.06% for class 2, demonstrating superior accuracy in identifying adverse events with negligible misses. This performance minimizes operational risks, such as undetected kicks leading to well instability, by effectively capturing ensemble consensus on subtle indicators like torque and standpipe pressure anomalies. The performance metrics of RF as seen in
Table 2 display these aggregated scores: accuracy of 0.998460, precision of 0.998462, recall of 0.998460, and F1-score of 0.998459, confirming RF robustness, benefiting from bagging and feature randomness to handle imbalances and correlations in drilling datasets. In practice, RF high reliability supports deployment in automated alert systems, with potential for further optimization through increased tree depth or feature selection to maintain its edge in challenging environments.
Table 2. Summary of the developed models’ performance metrics.
Model | Accuracy | Precision | Recall | F1 Score |
Logistic Regression | 0.874416 | 0.875436 | 0.874416 | 0.874647 |
Decision Tree | 0.996622 | 0.996621 | 0.996622 | 0.996621 |
Random Forest | 0.998460 | 0.998462 | 0.998460 | 0.998459 |
Gradient Boosting | 0.956756 | 0.957014 | 0.956756 | 0.956444 |
3.3. Feature Importance
The feature importance ranking from the Random Forest model has provided an important diagnostic into the physical processes that the algorithm has deemed most predictive for its classification task. Based on the ranking, the prominence of Hook Load (klbs) is paramount, as it serves as the primary and most direct indicator of the tensile force and total weight suspended from the drill string, making its absolute value a critical real-time signal for the model. This dominance suggests that the algorithm identifies fundamental shifts in the entire load-bearing system as the most predictive events for its classification task. The high importance of Rate of Penetration (ft_per_hr) directly complements this, as it quantifies the immediate output of the drilling process; its strong ranking indicates that the model is heavily reliant on detecting changes in drilling efficiency, which are intrinsically tied to the hook load state; for instance, a significant drop in ROP concurrent with a stable hook load could signal the bit encountering a harder formation. This relationship is further refined by the Weight on Bit (klbs), which provides the essential context for the ROP value by indicating how much force is actively being applied to crush the rock, thereby creating a powerful trio of features where hook load establishes the overall string state, weight on bit defines the downward force, and ROP measures the resulting effectiveness of the cutting action.
Figure 7. Most important input parameters in hierarchical order.
The findings of this study, which demonstrate exceptional performance in simultaneous detection of kick and stuck pipe through supervised machine learning models with low false negative rates and feature sensitivity analysis, are consistent with the established principles of AI-driven anomaly detection cited in the literature review. Specifically, Ragab and Noah
| [14] | Opeyemi, B., Javier H., Tanveer Y., and Catalin, T. (2015). Application of artificial intelligence methods in drilling system design and operations. A review of the state of the art, JAISCR, 2015, Vol. 5, No. 2, pp 121 -139. https://doi.org/10.1515/jaiscr-2015-0024 |
[14]
, Elahifar and Hosseini
| [6] | Elahifar, B., and Hosseini, E. (2022). Machine learning algorithm for prediction of stuck pipe incidents using statistical data: case study in middle east oil fields. Journal of Petroleum Exploration and Production Technology, Vol. 12, pp. 2019-2045. https://doi.org/10.1007/s13202-021-01436-3 |
[6]
, and Emhanna
| [7] | Emhanna, S. A. (2018). Analysis of Non-Productive Time (NPT) in Drilling Operations - A Case Study of the Ghadames Basin. A paper presented at the Second Scientific Conference of Oil and Gas, Ajdabiya, Lybia, pp. 244 - 252. https://www.researchgate.net/publication/330222796 |
[7]
highlighted the significant NPT costs from stuck pipe and kicks due to equipment damage and operational delays, while Hossain and Islam
| [9] | Hossain, M. E., and Islam, M. R. (2018). Drilling Engineering Problems and Solutions: A Field Guide for Engineers and Students. Scrivener Publishing 100 Cummings Center, Suite 541J, Beverly, pp. 173 - 180. https://doi.org/10.1002/9781118998632 |
[9]
and Fjetland
| [8] | Fjetland, A. K. (2019). Kick Detection During Offshore Drilling using Artificial Intelligence, Master’s Thesis in Mechatronics, Faculty of Engineering and Science, University of Agder. https://doi.org/10.1109/ICIEA.2019.8833850 |
[8]
emphasized the risks of kicks escalating to blowouts in dynamic subsurface environments—a fundamental mechanism that underpins the multi-class classification trends observed in this study's results, such as RF negligible errors across classes.
Furthermore, the use of ensemble models like RF and DT for integrated detection demonstrates improvements as compared to other AI anomaly studies that employed neural networks, such as Wang and Ozbayoglu
| [19] | Wang, J., and Ozbayoglu, E. M. (2022). 'Application of Recurrent Neural Network Long Short-Term Memory Model on Early Kick Detection', in Proceedings of the ASME 2022 41st International Conference on Ocean, Offshore and Arctic Engineering. Vol. 10: Petroleum Technology. Hamburg, Germany. Paper No. OMAE2022-78739, V010T11A008. https://doi.org/10.1115/OMAE2022-78739 |
[19]
and Zhang
et al. | [20] | Zhang, D., Sun, W., Dai, Y., Bu, S., Feng, J., and Huang, W. (2024). Intelligent kick detection using a parameter adaptive neural network. Geoenergy Science and Engineering, Vol. 234, pp. 1-10. https://doi.org/10.1016/j.geoen.2024.212694 |
[20]
, who utilized RNN and ANN, respectively, for early kick detection, and Muojeke
et al. | [13] | Muojeke, S., Venkatesan, R., and Khan, F. (2020). Supervised data-driven approach to early kick detection during drilling operation. Journal of Petroleum Science and Engineering, Vol. 192, 107324. https://doi.org/10.1016/j.petrol.2020.107324 |
[13]
, who applied feedforward ANN to identify gas influx signatures. However, while their works focused on single anomalies or limited datasets (e.g., Miri
et al. | [12] | Miri, R., Sampaio J., Afshar, M., and Laurenco, A. (2007). Development of artificial neural networks to predict differential pipe sticking in Iranian offshore oil fields. Paper SPE 108500 presented at the International Oil Conference and Exhibition, Veracruz, Mexico, pp 27-30. https://doi.org/10.2118/108500-MS |
[12]
with 109 cases; Shadizadeh
et al. | [17] | Shadizadeh, S. R, Karimi, F., and Zoveidavianpoor M. (2010). Drilling stuck pipe prediction in Iranian oil fields: An artificial neural network approach. Iran Journal of Chemical Engineering, Vol. 7, No. 4, pp 29-41. https://doi.org/20.1001.1.17355397.2010.7.4.4.1 |
[17]
with 275 cases; Do
et al.
| [4] | Do, Q. K., Hoang, T. Q., Nguyen, T., and Ong, V. K. P. (2022). Predicting and avoiding hazardous occurrences of stuck pipe for the petroleum wells at offshore Vietnam using machine learning techniques. IOP Conference Series: Earth and Environmental Science, Vol. 1091, 012003. https://doi.org/10.1088/1755-1315/1091/1/012003 |
[4]
with 83 data points), the present study employs a large-scale, balanced dataset to provide a novel investigation into simultaneous multi-hazard detection, a parameter not deeply explored in the existing literature, including unsupervised approaches like those in Altindal
et al. | [1] | Altindal, M. C., Nivlet, P., Tabib, M., Rasheed, A., Kristiansen, T. G., and Khosravanian, R. (2024). Anomaly detection in multivariate time series of drilling data. Journal of Geoenergy Science and Engineering, Vol. 237, Issue 212778. https://doi.org/10.1016/j.geoen.2024.212778 |
[1]
and Diyah
et al.
| [5] | Diyah, R., Zulfan, Bambang, Y. S., Akhmad, S., Fandika, G. P., and Redha, B. P. (2025). Machine Learning Classifies Data for Early Warning of Stuck Pipe Detection in Geothermal Drilling. Int. Journal of Adv. Sci. Eng. Information Technology, Vol. 15, pp. 43 - 51. https://doi.org/10.18517/ijaseit.15.1.20333 |
[5]
. Similarly, Kizayev
et al.
| [10] | Kizayev, T., Irawan, S., Akbari Khan, J., Ahmad Khan, S., Cai, B., Zeb, N. and Wayo, K. D. (2023). Factors affecting drilling incidents: Prediction of suck pipe by XGBoost model. Energy Reports, Vol. 9, No. 4, pp. 270-279. https://doi.org/10.1016/j.egyr.2023.03.083 |
[10]
and Muojeke
et al. | [13] | Muojeke, S., Venkatesan, R., and Khan, F. (2020). Supervised data-driven approach to early kick detection during drilling operation. Journal of Petroleum Science and Engineering, Vol. 192, 107324. https://doi.org/10.1016/j.petrol.2020.107324 |
[13]
optimized parameters or flagged fluctuations using XGBoost and simple ANN architecture, respectively, but without joint kick-stuck integration or sensitivity analysis. Therefore, this study fills a distinct gap by quantifying how key features like Hook Load and ROP influence both hazards, enhancing interpretability in complex formations. The emphasis on supervised ensembles with sensitivity extends the work of Sircar
et al. | [18] | Sircar, A., Yadav, K., Rayavarapu, K., Bist, N., and Oza, H. (2021). Application of machine learning and artificial intelligence in oil and gas industry. Journal of Petroleum Research, Vol. 6, No. 4, pp. 379-391. https://doi.org/10.1016/J.PTLRS.2021.05.009 |
[18]
and Schlumberger
, who advocated AI for drilling workflows, providing a more grounded understanding of anomaly behavior and confirming that while unsupervised methods dominate (>80%), supervised integration with error minimization significantly improves reliability and reduces NPT, especially under high-uncertainty constraints.