2023-Drilling Stuck Probability Intelligent Prediction Based On LSTM Considering Local Interpretability
2023-Drilling Stuck Probability Intelligent Prediction Based On LSTM Considering Local Interpretability
ABSTRACT: Stuck pipe in the drilling can increase the non-productive time and lead to drilling risks such as buried tool and drilling
tool fracture. Due to complex sequential feature analysis and the lag of downhole data transmission, traditional methods which are
mostly used for post-drilling analyses have poor timeliness and low accuracy so that it cannot meet the requirements of field
application. This study provides a data-driven prediction method for stuck pipe probability. First, the dataset is established combining
drilling records and logging data from 108 wells, and 15 input features are selected. Then, the intelligent prediction model based on
the Long Short Term Memory (LSTM) network is developed considering the timing characteristics of drilling parameters. Finally,
Shapley Additive Explanations (SHAP) is used to calculate the quantitative contribution of input parameters to solve the problem of
the black box. The results show that the accuracy of the LSTM model is 97%. Through local interpretation and analysis, the model
accords with the natural physical law. The proposed model has great timeliness, high accuracy, high reliability and quantitative risk
prediction. This study provides useful insights into predicting stuck pipe risk.
it = (Wi ht −1 , xt + bi ) (2)
2. METHODOLOGY
2.1. LSTM structure and adaptability analysis output gate:
Ot = (WO ht −1 , xt + bO )
The LSTM is designed to address long-term dependencies
(3)
and retain information over long periods. It is suitable for
dealing with dynamic changes during drilling. In this Where 𝑥𝑡 is the current input; ℎ𝑡−1 is the output of the
section, the nonlinear fitting of neural network and the
previous time; 𝑤𝑓 is the weight matrix of forgetting gate
ability of long-term and short-term memory are used to
establish a function between timing data and stuck pipe neurons in LSTM; 𝑏𝑓 is the bias vector of amnestic gate
risk. Due to the network structure characteristics of neurons in LSTM. 𝑓𝑡 is the output of amnestic gate
LSTM, the established model not only considers the neuron in LSTM. 𝑤𝑖 is the weight matrix of input gate
complex relationship between drilling engineering neurons in LSTM; 𝑏𝑖 is the bias vector of the input gate
parameters and influencing factors but also considers the neuron in LSTM; 𝑖𝑡 is the output of the input gate neuron
changing relationship of parameters themselves in time in LSTM; 𝑤𝑜 is the weight matrix of output gate neurons
dimension. in LSTM; 𝑏𝑜 is the bias vector of output gate neuron in
LSTM. 𝑜𝑡 is the output of output gate neuron in LSTM; 𝜎 analyze the interpretability of the established intelligent
is sigmoid activation function; model to enhance its reliability.
In the process of drilling, there are frequent incidents of According to Chunyan Zeng (2021), Machine-learning
stuck pipe, such as turning plate or top drive. Although interpretability methods are mainly divided into global
the occurrence of stuck pipe accidents is often sudden and interpretation methods and local interpretation methods.
the response time of field drilling engineers is very short, The global interpretation method refers to a
there may be some anomalies in the surface data comprehensive understanding of the complex operational
monitored by the comprehensive logging instrument logic and causes inside the black-box model (such as how
j =1
ij
S SHAPi = n M
100% (5)
i =1 j =1
ij
Fig. 3. The bit position, hook load, and torque change diagram of 05 / 02, 05 / 03, and 05 / 04 days during drilling are retained.
According to the log, the stuck pipe date was 05/03, but torque has a significant change from 14.2kN·m to
as can be seen from Fig. 3, the actual stuck pipe date was 19.6kN·m. Therefore, based on the above analysis, the
05/02. The analysis process was as follows. First, the log actual date of the stuck pipe can be finally determined as
recorded that the PowerV drilled from 8:00 to 20:50, so 05/02.
the bit depth should have increased gradually during this
After determining the actual date of stuck pipe, it is
period, while the bit position did not increase gradually
necessary further to determine the specific time point of
throughout the day of 05/03. Therefore, it can be
stuck pipe to facilitate further labeling of normal/stuck
preliminarily determined that the actual date of stuck drill
working condition samples. Fig. 4 shows the changes in
should be 05/02, and at around 20:50:00 of 05/02, the
hook load and torque on the whole day of 05/02. It can be
seen from the Fig. 4 that the stuck pipe occurs around suddenly increased from 14.2 kN·m to 19.6 kN·m, as
20:48:08, and the interception period is from 20:11:28 to recorded in the log, so the exact stuck time was
21:21:28. During 20:50:28-20:51:28, The torque determined to be 05/02 20:51:28.
Because the stuck pipe accident tends to be a mutation pipe data, it is necessary to mark the stuck pipe working
accident, from the beginning of the sign of stuck pipe to condition based on the stuck time point of the drill tool in
the drilling tool stuck in a short time, insufficient time can advance, to achieve the purpose of predicting in advance.
not be set aside to adjust drilling parameters in time to
avoid stuck pipe. Therefore, when calibrating the stuck
As shown in Table 1, a reasonable partition ratio is Stuck pipe prediction is a complicated problem, the
selected by comparing the model prediction effect under essence of which is that every link in the drilling process
different sample partition ratios. The division ratio is not solved well. For example, the dogleg Angle of the
between the stuck pipe and normal samples varies from well track is too large, the structure design of the drill
1:1, 1:2 to 1:3, and the corresponding model prediction string is not reasonable and large rocks fall off the wall,
effect (F1) also gradually decreases. There is little easy to cause stuck pipe; The unreasonable design of
difference between the prediction effect of the model with hydraulic parameters will lead to the unreasonable
an equilibrium ratio of 1:1 and a non-equilibrium ratio of cleaning of boreholes and lead to stuck pipe. No matter
1:2. Considering that the proportion of stuck pipe samples which link causes stuck pipe, it will eventually reflect the
in the total samples in field practice is very small, a stress of drill string. The parameters on the ground that
disequilibrium ratio (1:2) was selected to divide the stuck can reflect the force of drill string include hook load,
pipe sample set. data points from 20:28:28 to 20:50:28 are rotary torque, weight on bit, and rotary speed. In this
marked as stuck working conditions, and 20:11:28 to paper, riser pressure, pump stroke, inlet flow, and outlet
20:27:28 are marked as normal working conditions. flow are also selected as input parameters, which can
characterize the degree of cuttings in the hole to a certain
extent. In addition, some basic parameters of drilling fluid
(density, temperature, etc.) and bit position are also
included.
The characteristic parameters selected in this paper are used to set up the test scheme, as shown in Table 2 and
mainly based on an analysis of factors affecting stuck pipe Table 3.
and field data acquisition. 15 input parameters are adopted,
2) Evaluation metrics selection
which are: well depth, hook load, riser pressure, rotary
torque, weight on bit, rotary speed, pump stroke, inlet As shown in Table 4, there are four common model
temperature, outlet temperature, inlet conductance, outlet evaluation indexes for classification problems in machine
conductance, inlet density, outlet density, inlet flow rate, learning: Accuracy, Precision, Recall, and F1-score.
and outlet flow rate. For the factors such as inclination
Angle and azimuth Angle, although they are closely Table 4 Evaluation index of the classification problem
related to stuck pipe, cannot be measured in real-time in Prediction result
the drilling process, so this paper does not consider such fact
Stuck pipe normal
factors. After processing, 15 stuck events were obtained Stuck pipe TP FN
from 11 Wells, with more than 105000 samples, and the normal FP TN
ratio of normal samples to stuck was 1:2.
3.2. Training and optimization of LSTM model In a binary classification problem, the calculation formula
1) Experiment design is as follows:
TP + TN
In the training process of the LSTM model, the Accuracy = (6)
optimization of hyperparameters is a work based on TP + TN + FP + FN
experiment and experience. Generally, the optimal TP + TN
combination of hyperparameters is obtained through Precison = (7)
repeated trials. In this paper, the time step, learning rate, TP + FP
number of LSTM network layers, number of LSTM FAR ( False _ alarm _ rate ) = 1 − Pr ecison (8)
neurons, and activation function of input data are
optimized. Each factor involves three levels. If all tests TP
are conducted, 3^5=234 tests are needed. To reduce the Recall = (9)
number of tests, the orthogonal test method (L18.3.5) was TP + FN
MAR ( Missed _ alarm _ rate ) = 1 − Re call (10)
Table 2 Factor level table of neural network model test
factors
level
Timesteps learning rate number of layers number of neurons activation function
1 5 0.1 1 16 tanh
2 10 0.01 2 32 relu
3 20 0.001 3 64 sigmoid
2 Pr ecison Re call indicators are auxiliary indicators. The MAR refers to the
F1_ score = (11) data sample that is a stuck pipe is predicted as normal,
Pr ecison + Re call
while the FAR refers to the normal sample is predicted as
Among them, TP (True Positive): correctly predicted the stuck pipe.
stuck pipe sample as a stuck pipe;
3) Analysis of experimental results
TN (True Negative): The normal sample is correctly
Six indexes, including FAR, MAR, Precision, Recall, F1-
predicted as normal;
score, and model complexity, are integrated to optimize
FP (False Positive): The normal sample is incorrectly the LSTM stuck pipe prediction model. The evaluation
predicted as stuck; indexes of each model are shown in Table 5 and Fig. 6 to
FN (False Negative): indicates that the stuck pipe sample Fig. 11.
is incorrectly predicted as normal. As shown in Fig. 9, there are models with high F1-score
In the field of engineering, for the prediction of complex indexes: 1, 2, 4, 7, 9, 10, 13, 15, and 17, and their values
working conditions, especially when the cost of missing are very similar. As there are not many stuck pipe training
the prediction of risk is large, the engineering would samples, to prevent model overfitting and improve model
rather misreport than miss the report. According to the generalization ability, models with low complexity are
field data statistics, if the stuck occurs during drilling and selected, as shown in Fig. 11. Models with low
fails to release the stuck successfully, it is necessary to complexity include the first and 17th models. In
blast release the stuck. It often takes several months from engineering, the risk prediction would rather be a false
stuck drilling tools to re-striking, increasing non- alarm than a missed alarm. Therefore, more attention
productive time and severely affecting drilling efficiency. should be paid to the MAR when the FAR and MAR are
Therefore, the FAR and MAR are very important to used in the optimization model. As shown in Fig. 7, the
forecast stuck pipe. In this paper, F1-score, FAR, MAR, first model has a small MAR, so the optimal model is
and model complexity are the main indicators, and other finally selected.
Table 5 108 results of the Neural network model
Model
Number Precision FAR Recall MAR F1-score
complexity
1 0.9796 0.0204 1.0 0 0.9897 1681
2 0.9919 0.0081 0.9966 0.0034 0.9942 13713
3 0.9132 0.0868 0.9635 0.0365 0.9377 18961
4 0.9911 0.0089 0.9961 0.0039 0.9936 5905
5 0.9883 0.0117 0.9707 0.0293 0.9794 51985
Fig. 6. Recall of different network models. Fig. 8. Precision of different network models.
Fig. 7. MAR of different network models. Fig. 9. F1-score of different network models.
no missing report occurs. For a certain well, the prediction
results are shown in Fig. 12. The probability of sticking
predicted by the LSTM model, represented by blue dots,
is gradually increasing, and it is finally judged to be stuck
at 6108.8m. The actual situation was that the stuck pipe
did occur at 6109.4m. The prediction was realized 14min
in advance.
REFERENCES
1. Annis, M.R.; Monaghan, P.H. Differential Pressure Stuck
pipe-Laboratory Studies of Friction Between Steel and
Mud Filter Cake. J. Pet. Technol. 1962, 14, 537–543.
[CrossRef].