2021-Approach For Real-Time Prediction of Pipe Stuck Risk Using A LongShort-Term Memory Autoencoder Architecture
2021-Approach For Real-Time Prediction of Pipe Stuck Risk Using A LongShort-Term Memory Autoencoder Architecture
This paper was prepared for presentation at the Abu Dhabi International Petroleum Exhibition & Conference to be held in Abu Dhabi, UAE, 15 – 18 November 2021.
The official proceedings were published online on 9 December 2021.
This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents
of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect
any position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written
consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may
not be copied. The abstract must contain conspicuous acknowledgment of SPE copyright.
Abstract
Pipe-sticking during drilling operations causes severe difficulties, including economic losses and safety
issues. Therefore, real-time stuck-pipe predictions are an important tool to preempt this problem and avoid
the aforementioned troubles. In this study, we have developed a prediction technique based on artificial
intelligence, in collaboration with industry, the government, and academia. This technique was developed
by combining an unsupervised learning model built using an encoder-decoder, long short-term memory
architecture, with a relative error function. The model was trained with the time series data of normal drilling
operations and based on an important hypothesis: reconstruction errors between observed and predicted
values are higher around the time of pipe sticking than during normal drilling operations. An evaluation
method of stuck-pipe possibilities using a relative error function reduced false predictors caused by large
variations of drilling parameters. The prediction technique was then applied to 34 actual stuck-pipe events,
where it was found that reconstruction errors calculated with the relative error function increased 0.5-10
hours prior to the pipe sticking for 17 out of 34 stuck-pipe events (thereby partly confirming our hypothesis).
Introduction
The occurrence of pipe-sticking during drilling operations leads to extreme delays in the completion of
the operation, well abandonment and, in the worst case, an uncontrolled spout of crude oil or gas into the
surroundings. These troubles are unexpected and cause economic losses and safety issues. An important
reason behind these troubles is the difficulty in the antecedent collection of information about the lithological
characteristics of the wells. Of the techniques used to reduce and avoid these troubles, two approaches are
eminent: one is the detection of stuck pipes as soon as possible after the pipe-sticking has started (hereafter
referred to as stuck-pipe detections), while the other is the prediction of pipe-sticking before it has occurred
(hereafter referred to as stuck-pipe predictions). The latter approach is more appropriate because it could
give crews sufficient time to take preventative or remedial actions. Therefore, stuck-pipe predictions that
2 SPE-207805-MS
use mud logging data that reflect the conditions inside the wells are an important step taken to avoid or
reduce the troubles associated with pipe-sticking.
Several ideas have been proposed to make stuck-pipe predictions using mud logging data. One involves
the use of statistical and/or analytical models (Hess 2016; Magana-Mora et al. 2019; Meor Hashim et
al. 2021b; Salminen et al. 2017; Shoraka et al. 2011), while another employs a combination of physics-
based and data-driven models (Zhang et al. 2019). Ideas based on supervised machine learning have been
proposed using the architecture of neural networks and/or support vector machines (Abbas et al. 2019;
applied to various types of wells and has the possibility of making accurate real-time stuck-pipe predictions
that cannot be achieved by supervised learning approaches.
Methods
In this study, we applied the new evaluation method of stuck-pipe possibilities using the RE reconstruction
errors to input and output data of the LSTM-AE model (Fig. 1). This method is expected to reduce false
predictors caused by the large variations in the drilling parameters found in our previous study.
Data
This study was performed using the time series data of actual drilling operations in 34 distinct wells,
obtained by the collaborating companies. The time series data spans 3,382 days and has a resolution of
4 s. To remove anomalous or inaccurate values, the data were filtered so that all 13 drilling parameters
simultaneously satisfied the minimum and maximum criteria presented in Table 1. The data were then
normalized by a standard scaler whose variables were calculated for each drilling parameter. As a result, we
found 63,694,136 datasets, where a single dataset consisted of 150 continuous time bins (i.e., 600 seconds)
and 13 drilling parameters.
As described in the "Introduction" section, the LSTM-AE model was designed to be trained with the time
series data of normal drilling operations. These data points were obtained by filtering the complete dataset
using two boundaries that indicated normal drilling operations: 7,200 s before the start of pipe-sticking
and 1,800 s after its end. As a result, we obtained 62,745,111 datasets corresponding to the normal drilling
operations of all 34 wells, among which we randomly extracted 375,000 datasets for training the model.
To evaluate the performance of the trained LSTM-AE model, we defined the time periods corresponding
to the normal operation of the drill and to the detection and prediction of pipe-sticking by using the daily
Model
We have developed an autoencoder model using an encoder-decoder LSTM architecture — a feedback
neural network that is more suitable for time series predictions than standard feedforward neural networks
(Nakagawa et al. 2021). The LSTM-AE model was intended to reconstruct the input data consisting of
the 13 drilling parameters by first encoding them and then decoding them back to their original values to
make the output data consistent with input data. A major detail of this model is that the dimensions of
input data were narrowed down into a latent layer during the encoding stage of the process. Therefore,
the appropriate extraction of features from the latent layer is required for accurate reconstructions of input
and output data. If the LSTM-AE model were trained solely with the time series data from normal drilling
operations, differences between the input and output data would be expected to be small. Prior to and during
pipe-sticking, however, these differences were expected to increase. Thus, reconstruction errors were used
as indicators of the stuck-pipe predictions and detections.
In this study, we newly trained the LSTM-AE model using the following configurations. The input and
output shapes of the LSTM-AE model are represented by (150, 13), consistent with the shape of a single
dataset consisting of 150 time bins and the 13 drilling parameters defined in the "Data" section. Here, we
used 150 time bins (i.e., 600 seconds) by assuming the values of the drilling parameters to be affected
by the time-based variations during the 600 seconds under consideration. Following discussions with the
collaborating companies, we also chose the 13 drilling parameters (Table 1) that were likely to have the
most influence on pipe-sticking. For simplicity, we adopted only a single latent layer. The choice of suitable
latent dimensions is highly dependent on the training datasets used. Therefore, considering the (150, 13)
SPE-207805-MS 5
shapes of the input and output data, a latent dimension of 128 was adopted. Finally, an Adam optimizer
(Diederik et al. 2015; Sashank et al. 2018) was employed with a learning rate of 0.00001. The LSTM-AE
model was then, overall, trained by minimizing reconstruction errors calculated with the MSE function,
which is defined as:
(1)
Model Training
Using the training datasets, parameters of the LSTM-AE model were updated through 240,000 iterations.
A mini-batch of one iteration consisted of 64 randomly chosen datasets from the larger superset of training
data. To avoid overfitting, we utilized a function to halt the training process if the MSE reconstruction errors
did not improve even after a certain number of iterations. This function did not stop the training before
240,000 iterations. Fig. 2 shows the averaged MSE reconstruction error calculated by the mean squared error
function over each 500 iterations; these errors decreased with progressive iterations. The state of the model
was saved for performance evaluation when the averaged MSE reconstruction error indicated a minimum
value at 229,500 iterations.
Figure 2—The variation of averaged MSE reconstruction error with the number of iterations.
(2)
6 SPE-207805-MS
Since both xi and consist of the 13 drilling parameters; therefore, ERE is a vector of their averaged RE
reconstruction errors.
Case Studies
Statistics of RE Reconstruction Errors and Area Under Cover
Using the test datasets for 34 stuck-pipe events from 30 wells, RE reconstruction errors were calculated for
Figure 3—Left: Distributions of the RE reconstruction error for stuck-pipe predictions. Histograms
labeled as negative and positive indicate the normal operating and predictor time periods, respectively.
Right: Distributions of the RE reconstruction error for stuck-pipe detections. Histograms labeled
as negative and positive indicate the normal operating and detector time periods, respectively.
To evaluate the trained LSTM-AE model, area under cover (AUC), a performance indicator, was
calculated for each stuck-pipe event using the receiver operating characteristic (ROC) curve of the above
reconstruction errors, which quantifies the performance of a classification model at all classification
thresholds. The ROC curve and the AUC are commonly used for imbalanced classification problems with
few samples of the minority class and are suitable for the datasets in this study. The ROC curve depicts the
relation between the true positive rate (RTPR) and the false positive rate (RFPR), which are defined as:
(2)
and
SPE-207805-MS 7
(3)
where NTP, NFN, NFP, and NTN denote the numbers of results where the model correctly predicted positive
labels, incorrectly predicted negative labels, incorrectly predicted positive labels, and correctly predicted
negative labels, respectively. The AUC is then defined as the complete two-dimensional area underneath the
entire ROC curve. Using the above RE reconstruction errors and ROC curves computed from them shown
in Fig. 4, AUC values were calculated for the 34 stuck-pipe events from the 30 wells: 0.74 and 0.82 for the
Figure 4—ROC curves for stuck-pipe predictions (left) and stuck-pipe detections (right).
Discussion
Performance Evaluation Using AUC
There seems to be a difference in the distributions of the RE reconstruction errors between the negative
labels and the positive labels for both the predictor and detector time periods (Fig. 3). The difference is
more clearly than the difference in distribution of the MSE reconstruction errors reported in Nakagawa et
al. 2021. The RE reconstruction errors for the positive labels seem to be greater than those for the negative
labels for both the predictor and detector time periods. In addition, marginally good performances are given
by the AUC values of 0.74 and 0.82 for the predictor and detector time periods, respectively. These imply
the capability of the trained LSTM-AE model to detect and predict certain types of stuck-pipe events. In
addition, the AUC values are marginally improved compared with those values of 0.72 and 0.78 for predictor
and detector time periods using the MSE reconstruction errors, respectively (Nakagawa et al. 2021). Further
investigations into specific types of stuck-pipe events and their AUC values are required for a more detailed
evaluation of the performances of the trained LSTM-AE model.
sticking. In addition, the RE reconstruction errors of MRetFlow affected the RE reconstruction errors
averaged over 13 drilling parameters (indicated by the top panel in Fig. 5) about 2.5 hours before the start
of pipe-sticking. The above RE reconstruction errors are less affected by large variations in the drilling
parameters unlike the MSE reconstruction errors; this might be unique to stuck-pipe predictions. Therefore,
the use of the RE reconstruction errors is suitable to distinguish reliable, true predictors of pipe-sticking
from misleading, false ones caused by these large variations. The optimization of the drilling parameters
used as features and hyperparameters such as the input and output shapes is expected to lead to a decrease
Conclusions
To make real-time stuck-pipe predictions using artificial intelligence, we undertook a project in
collaboration with industry, government, and academia (Inoue et al. 2020). This led to the development
of a stuck-pipe prediction technique comprising an evaluation method of stuck-pipe possibilities using the
RE reconstruction errors and an LSTM-AE model based on unsupervised machine learning. The model
was trained with the time-tagged mud logging data of normal drilling operations based on the hypothesis
that reconstruction errors between true and predicted values increase around the time of occurrence of the
stuck-pipe event, when compared to the time of normal drilling operations. The trained model and the
evaluation method of the stuck-pipe possibilities were applied to all 34 stuck-pipe events from 30 wells,
and results showed high AUC values for these events. We also found that the RE reconstruction errors did
increase prior to pipe-sticking in some cases (thereby partially confirming our hypothesis). In addition, we
also found that the RE reconstruction errors much reduced false predictors caused by large variations in
the drilling parameters unlike the MSE reconstruction errors, while there still remain slight responses to
the large variations. Therefore, we conclude that while the technique comprising the evaluation method of
stuck-pipe possibilities using the RE reconstruction errors and the LSTM-AE model appears promising for
the making of real-time stuck-pipe predictions which could give crews sufficient time to take preventative
or remedial actions, hyperparameter optimization is required for more accurate predictions.
Acknowledgements
This work was supported by the Japan Oil, Gas and Metals National Corporation.
References
Abbas, A. K., Flori, R., Almubarak, H. et al. 2019. Intelligent Prediction of Stuck Pipe Remediation Using Machine
Learning Algorithms. Paper presented at the SPE Annual Technical Conference and Exhibition, Calgary, Alberta,
Canada, September. SPE-196229-MS. https://doi.org/10.2118/196229-MS
Ahmed, O. S., Aman, B. M., Zahrani, M. A. et al. 2019. Stuck Pipe Early Warning System Utilizing Moving Window
Machine Learning Approach. Paper presented at the Abu Dhabi International Petroleum Exhibition & Conference,
Abu Dhabi, UAE, November. SPE-197674-MS. https://doi.org/10.2118/197674-MS
Al-Baiyat, I., and Lloyd H. 2012. Implementing Artificial Neural Networks and Support Vector Machines in Stuck Pipe
Prediction. Paper presented at the SPE Kuwait International Petroleum Conference and Exhibition, Kuwait City,
Kuwait, December. SPE-163370-MS. https://doi.org/10.2118/163370-MS
Alshaikh, A., Magana-Mora, A., Gharbi, S. A. et al. 2019. Machine Learning for Detecting Stuck Pipe Incidents: Data
Analytics and Models Evaluation. Paper presented at the International Petroleum Technology Conference, Beijing,
China, March. IPTC-19394-MS. https://doi.org/10.2523/IPTC-19394-MS
Brankovic, A., Matteucci, M., Restelli, M. et al. 2020. A Data-Based Approach for the Prediction of Stuck-Pipe Events
in Oil Drilling Operations. Paper presented at the Abu Dhabi International Petroleum Exhibition & Conference, Abu
Dhabi, UAE, November. SPE-202625-MS. https://doi.org/10.2118/202625-MS
Chamkalani, A., Pordel S. M., and Saeed P. 2013. Support Vector Machine Model: A New Methodology for Stuck Pipe
Prediction. Paper presented at the SPE Unconventional Gas Conference and Exhibition, Muscat, Oman, January.
SPE-164003-MS. https://doi.org/10.2118/164003-MS
10 SPE-207805-MS
Diederik, K., Jimmy, B. 2015. Adam: A Method for Stochastic Optimization. Published as a conference paper at the 3rd
International Conference for Learning Representations, San Diego. https://arxiv.org/abs/1412.6980v8
Hess, J. 2016. Pipe Sticking Prediction Using LWD Real-Time Measurements. Paper presented at the IADC/SPE Drilling
Conference and Exhibition, Fort Worth, Texas, USA, March. SPE-178828-MS. https://doi.org/10.2118/178828-MS
Inoue, T., Wada, R., Miyoshi, K. et al. 2020. Research Project on Safety Improvement by Applying Digital Technology
for Drilling Operations (in Japanese), Proceedings of the Japan Society of Naval Architects and Ocean Engineers.
ISSN: 2185-1840.
Inoue, T., Nakagawa, Y., Wada, R. et al. 2021. Attempt of Early Stuck Detection Using Unsupervised Deep Learning with