This application is based upon and claims priority to Chinese Patent Application No. 202211219444.5, filed on Oct. 8, 2022, the entire contents of which are incorporated herein by reference.
The present disclosure belongs to the technical field of lost circulation control in oil drilling engineering and specifically relates to a method for predicting a size range of a lost circulation channel based on deep learning (DL).
The lost circulation of drilling fluid will increase non-production time and operating costs and lead to safety hazards such as wellbore instability, jamming of a drilling tool, and blowout. Therefore, it is of great importance to establish a prediction model for the size range of the lost circulation channel and predict the size range of the lost circulation channel in different formations for rapid decision-making of the lost circulation treatment plan, drilling engineering safety, and cost control.
The conventional prediction method for the size of the lost circulation channel is mainly to identify the hole and fracture system through seismic or logging data. However, the analytical accuracy of seismic and logging data is limited, and only large fractures and formations rather than small fractures can be properly identified. The dynamic breathing effect of fractures and the difference between imaging logging conditions and drilling conditions will lead to a calculation deviation of the size of the downhole lost circulation channel. As a machine learning (ML) method, DL has unique advantages in dealing with the uncertainty of complex drilling problems, identifying hidden patterns, and revealing useful information.
In order to solve the above problems, the present disclosure proposes a method for predicting a size range of a lost circulation channel based on DL.
The present disclosure adopts the following technical solution: the method for predicting a size range of a lost circulation channel based on DL includes the following steps:
Further, in step S1, the prediction dataset of the size range of the lost circulation channel includes a drilling parameter, a drilling fluid parameter, a geomechanical model parameter, and a lost circulation parameter; and
Further, in step S2, the preprocessing the prediction dataset of the size range of the lost circulation channel specifically includes: performing data cleaning, feature coding, and data normalization in sequence on the prediction dataset of the size range of the lost circulation channel to obtain a feature vector, thus completing data preprocessing.
Further, in step S2, the data normalization is calculated as follows:
where, xi∈{x1, x2 . . . , xn}; n denotes a total number of features in the prediction dataset of the size range of the lost circulation channel; xi denotes normalized feature data of the size range of the lost circulation channel; xraw denotes raw feature data; xmin denotes minimum feature data; and xmax denotes maximum feature data;
where, (y1, y2) denotes a vector of the size range of the lost circulation channel; y1 i denotes a minimum value of the size range of the lost circulation channel; y2 denotes a maximum value of the size range of the lost circulation channel; D50 denotes a particle size corresponding to a cumulative particle size distribution 50% of a lost circulation control formula; D90 denotes a particle size corresponding to a cumulative particle size distribution 90% of the lost circulation control formula; and Wf denotes a size of the lost circulation channel.
Further, in step S3, the establishing a prediction model for the size range of the lost circulation channel specifically includes: designing, by taking the pre-processed prediction dataset of the size range of the lost circulation channel as the input, a regularized loss function L(ŷ(i), y(i)) and a performance evaluation index mean square error (MSE) of the prediction model for the size range of the lost circulation channel, and setting parameters of the prediction model for the size range of the lost circulation channel, namely a number L of hidden layers, a number n(L) of neurons in each of the hidden layers, and an activation function g (x) corresponding to each of the hidden layers; and iterating, according to the regularized loss function L(ŷ(i), y(i)) of the prediction model for the size range of the lost circulation channel, a model with the number L of the hidden layers, the number n(L) of the neurons in each of the hidden layers, and the activation function g(x) corresponding to each of the hidden layers, until an optimal performance evaluation index MSE, thus completing the establishment of the prediction model for the size range of the lost circulation channel, where, ŷ(i) denotes a prediction vector of the prediction model for the size range of the lost circulation channel; and y(i) denotes a true vector of the size range of the lost circulation channel.
Further, an output layer of the prediction model for the size range of the lost circulation channel takes a rectified linear unit (ReLU) function as an activation function;
where, ŷ(i) denotes the prediction vector of the prediction model for the size range of
the lost circulation channel; y(i) denotes the true vector of the size range of the lost circulation channel; m denotes a number of samples in the dataset; λ denotes a regularization parameter of the prediction model for the size range of the lost circulation channel; and W denotes a weight matrix of the prediction model for the size range of the lost circulation channel; and
Further, step S4 includes the following sub-steps:
Further, in step S41, the training sample matrix includes an input matrix X defined by a feature vector and an output matrix Y defined a vector of the size range of the lost circulation channel, where X=[x(1)|x(2)|x(3) . . . x(m)], Y=[y(1)|y(2)]; x(1) . . . x(m) denotes an input parameter vector of the prediction model for the size range of the lost circulation channel, and each term of the input parameter vector is defined by the feature vector (x1, x2 . . . , xn); y(1) and y(2) denote an output vector of the prediction model for the size range of the lost circulation channel, and each term of the output vector is defined by a vector (y1, y2) of the size range of the lost circulation channel; m denotes a number of training samples of the prediction model for the size range of the lost circulation channel; n denotes a total number of features in the prediction dataset of the size range of the lost circulation channel; y1 denotes a minimum value of the size range of the lost circulation channel; and y2 denotes a maximum value of the size range of the lost circulation channel;
Z
[i]
=W
[i]
X
{i}
+b
[i]
A
[i]
=g
[i](Z[i])
where, W[i] denotes a weight matrix of each layer of the prediction model for the size range of the lost circulation channel; b[i] denotes a bias of each layer of the prediction model for the size range of the lost circulation channel; and g[i] denotes an activation function of each layer of the prediction model for the size range of the lost circulation channel;
y
(i)
=g
[L](Z[L])
where, g[L] denotes an activation function of a last layer of the prediction model for the size range of the lost circulation channel; and Z[L] denotes an input vector of the last layer of the prediction model for the size range of the lost circulation channel;
where, ŷ(i) denotes the prediction vector of the prediction model for the size range of the lost circulation channel; y(i) denotes a true vector of the size range of the lost circulation channel; L(ŷ(i), y(i)) denotes a regularized loss function of the prediction model for the size range of the lost circulation channel; λ denotes a regularization parameter of the prediction model for the size range of the lost circulation channel; and ||W[256]||F2 denotes a square of Frobenius norm of the weight matrix of the prediction model for the size range of the lost circulation channel;
v
dW*=β1vdW+(1−β1)dW
v
db*=β1vdb+(1−β1)db
S
dW*=β2SdW+(1−β2)(dW)2
S
db*=β2Sdb+(1−β2)(db)2
where, Vdw denotes an exponentially weighted average of an original Momentum weighted differential; vdb denotes an exponentially weighted average of an original Momentum biased differential; SdW denotes a weighted average of a square of an original RMSprop weighted differential; Sdb denotes a weighted average of a square of an original RMSprop biased differential; β1 denotes a first hyper-parameter of the prediction model for the size range of the lost circulation channel; and β2 denotes a second hyper-parameter of the prediction model for the size range of the lost circulation channel;
where, q denotes the current iteration number;
where, W* denotes the updated weight of the prediction model for the size range of the lost circulation channel; b* denotes the updated bias of the prediction model for the size range of the lost circulation channel; W denotes the weight of the prediction model for the size range of the lost circulation channel; b denotes the bias of the prediction model for the size range of the lost circulation channel; a denotes a learning rate of the prediction model for the size range of the lost circulation channel; and ε denotes an infinitesimal.
The present disclosure has the following advantages. The present disclosure overcomes the shortcomings of conventional methods, for example, the prediction value of the size of the downhole lost circulation channel is single, inaccurate and not real-time. The present disclosure makes real-time prediction of the size range of the downhole lost circulation channel through a DL model, avoids complexity and uncertainty of conventional manual feature selection, and is more in line with the site engineering construction specifications. The present disclosure has positive practical significance for the rapid decision-making of the lost circulation treatment plan, and drilling engineering safety and cost control.
The embodiments of the present disclosure are described in further detail with reference to the drawings.
BP algorithm is a learning algorithm suitable for multi-layer neural networks, which is based on a gradient descent method. The input-output relationship of the BP network is essentially a mapping relationship. The function of the BP neural network with n inputs and m outputs is a continuous mapping from an n-dimensional Euclidean space to a finite field in an m-dimensional Euclidean space, which is highly nonlinear.
Momentum algorithm is a momentum gradient descent algorithm.
The RMSprop algorithm is a root mean square propagation algorithm.
As shown in
In the embodiment of the present disclosure, in step S1, the prediction dataset of the size range of the lost circulation channel includes a drilling parameter, a drilling fluid parameter, a geomechanical model parameter, and a lost circulation parameter.
The drilling parameter includes well depth, borehole size, penetration rate, rotary speed, torque, weight on bit, displacement, pump pressure, pump stroke, and well trajectory; the drilling fluid parameter includes density, Marsh funnel viscosity, plastic viscosity, yield point, initial gel strength, final gel strength, filtration, and solid content; the geomechanical model parameter includes lithology type, rock mechanical parameter, pore pressure, formation fracture pressure, vertical stress, minimum horizontal stress, and maximum horizontal stress; the lost circulation parameter includes lost circulation speed, lost circulation amount, lost circulation time, lost circulation degree, lost circulation condition, and bit position; and the rock mechanical parameter includes elastic parameter, unconfined compressive strength, tensile strength, shear strength, internal friction angle, and cohesion strength.
In the embodiment of the present disclosure, in step S2, the prediction dataset of the size range of the lost circulation channel is specifically preprocessed by performing data cleaning, feature coding, and data normalization in sequence on the prediction dataset of the size range of the lost circulation channel to obtain a feature vector, thus completing data preprocessing.
The data cleaning is specifically implemented as follows. An invalid sample in the prediction dataset of the size range of the lost circulation channel is removed, non-empty missing data in the prediction dataset of the size range of the lost circulation channel is filled in, and numerical processing is performed on abnormal data in the prediction dataset of the size range of the lost circulation channel.
The DL method cannot be trained with text or symbol data. In this case, text or non-numeric information must be converted into numeric data. The present disclosure converts non-numerical data into a digital form by means of one-hot encoding, such as a rock type feature, and the code is shown in Table 1.
In the embodiment of the present disclosure, a Min-max normalization method is used to normalize the dataset data as follows:
where, xi∈{x1, x2 . . . , xn}; n denotes a total number of features in the prediction dataset of the size range of the lost circulation channel; xi denotes normalized feature data of the size range of the lost circulation channel; xraw denotes raw feature data; xmin denotes minimum feature data; and xmax denotes maximum feature data;
In the embodiment of the present disclosure, in step S3, a typical DL model includes an input layer, multiple hidden layers, and an output layer. The present disclosure takes the pre-processed feature vector of the dataset of the size range of the lost circulation channel as the input and the vector of the size range of the lost circulation channel as the output. The present disclosure randomly allocates 80% of the data as a training set, 10% of the data as a verification set, and 10% of the data as a test set. The training set is configured to develop the DL prediction model for the size range of the lost circulation channel, and the output vector in the training set is configured to help the model adjust the weight of each input. The validation set is configured to improve the generalization ability of the model and stop training when the generalization stops improving. The test set is configured to test the accuracy of the model after the training and validation steps.
The prediction model for the size range of the lost circulation channel is specifically established as follows. By taking the pre-processed prediction dataset of the size range of the lost circulation channel as the input, a regularized loss function L(ŷ(i),y(i)) performance evaluation index MSE of the prediction model for the size range of the lost circulation channel are designed, and parameters of the prediction model for the size range of the lost circulation channel are set, namely a number L of hidden layers, a number n(L) of neurons in each of the hidden layers, and an activation function g(x) corresponding to each of the hidden layers. According to the regularized loss function L(ŷ(i),y(i)) of the prediction model for the size range of the lost circulation channel, a model with the number L of the hidden layers, the number n(L) of the neurons in each of the hidden layers, and the activation function g (x) corresponding to each of the hidden layers is iterated, until an optimal performance evaluation index MSE, thus completing the establishment of the prediction model for the size range of the lost circulation channel. ŷ(i) denotes a prediction vector of the prediction model for the size range of the lost circulation channel; and y(i) denotes a true vector of the size range of the lost circulation channel.
In the embodiment of the present disclosure, as shown in
In the present disclosure, the output layer includes two neurons, which denote a minimum value and a maximum value of the output size of the lost circulation channel. The best DL model is derived by comparing the performance evaluation indicators of the model. The final prediction model for the size range of the lost circulation channel is shown in
In the embodiment of the present disclosure, an output layer of the prediction model for the size range of the lost circulation channel takes a rectified linear unit (ReLU) function as an activation function;
In order to calculate the error generated by the prediction model for the size range of the lost circulation channel, the regularized loss function L(ŷ(i),y(i)) of the prediction model for the size range of the lost circulation channel is expressed as follows:
where, ŷ(i) denotes the prediction vector of the prediction model for the size range of
the lost circulation channel; y(i) denotes the true vector of the size range of the lost circulation channel; m denotes a number of samples in the dataset; λ denotes a regularization parameter of the prediction model for the size range of the lost circulation channel; and W denotes a weight matrix of the prediction model for the size range of the lost circulation channel; and
In order to evaluate the quality of the prediction model for the size range of the lost circulation channel, the performance evaluation index MSE of the prediction model for the size range of the lost circulation channel is calculated as follows:
In the embodiment of the present disclosure, the mini-batch gradient descent plus Adam optimization algorithm is used to optimize the model of the established size range of the lost circulation channel. The mini-batch algorithm divides the training set into multiple subsets to accelerate the iteration of the model. The Adam optimization algorithm combines the advantages of The Momentum algorithm and The RMSprop algorithm, and is suitable for the optimization of different DL structures. Step S4 includes the following sub-steps:
After the optimization is completed and the best model is selected and deployed, the size range of the downhole lost circulation channel is predicted in real time according to the field data, thus providing decision support for construction personnel to select the best lost circulation treatment plan.
In the embodiment of the present disclosure, in step S41, the training sample matrix includes an input matrix X defined by a feature vector and an output matrix Y defined a vector of the size range of the lost circulation channel, where X=[x(1)|x(2)|x(3) . . . x(m)], Y=[y(1)|y(2)]; x(1) . . . x(m) denotes an input parameter vector of the prediction model for the size range of the lost circulation channel, and each term of the input parameter vector is defined by the feature vector (x1, x2 . . . , xn); y(1) and y(2) denote an output vector of the prediction model for the size range of the lost circulation channel, and each term of the output vector is defined by a vector (y1, y2) of the size range of the lost circulation channel; m denotes a number of training samples of the prediction model for the size range of the lost circulation channel; n denotes a total number of features in the prediction dataset of the size range of the lost circulation channel; y1 denotes a minimum value of the size range of the lost circulation channel; and y2 denotes a maximum value of the size range of the lost circulation channel.
In step S43, the input vector Z[i] and the output vector A[i] of each layer of the prediction model for the size range of the lost circulation channel are calculated as follows:
Z
[i]
=W
[i]
X
{i}
+b
[i]
A
[i]
=g
[i](Z[i])
where, W[i] denotes a weight matrix of each layer of the prediction model for the size range of the lost circulation channel; b[i] denotes a bias of each layer of the prediction model for the size range of the lost circulation channel; and g[i] denotes an activation function of each layer of the prediction model for the size range of the lost circulation channel.
In step S43, the prediction vector y of the prediction model for the size range of the lost circulation channel is calculated as follows:
ŷ
(i)
=g
[L](Z[L])
where, g[L] denotes an activation function of a last layer of the prediction model for the size range of the lost circulation channel; and Z[L] denotes an input vector of the last layer of the prediction model for the size range of the lost circulation channel.
In step S44, the loss cost function J of the prediction model for the size range of the lost circulation channel is calculated as follows:
where, ŷ(i) denotes the prediction vector of the prediction model for the size range of
the lost circulation channel; y(i) denotes the true vector of the size range of the lost circulation channel; L(ŷ(i),y(i)) denotes a regularized loss function of the prediction model for the size range of the lost circulation channel; λ denotes a regularization parameter of the prediction model for the size range of the lost circulation channel; and ||W[256]||F2 denotes a square of Frobenius norm of the weight matrix of the prediction model for the size range of the lost circulation channel.
In step S46, the exponentially weighted average vdw* of the Momentum weighted differential, the exponentially weighted average vdb* of the Momentum biased differential, the weighted average SdW* of the square of the RMSprop weighted differential, and the weighted average Sdb* of the square of the RMSprop biased differential are calculated as follows:
v
dW*=β1vdW+(1−β1)dW
v
db*=β1vdb+(1−β1)db
S
dW*=β2SdW+(1−β2)(dW)2
S
db*=β2Sdb+(1−β2)(db)2
where, VdW denotes an exponentially weighted average of an original Momentum weighted differential; Vdb denotes an exponentially weighted average of an original Momentum biased differential; SdW denotes a weighted average of a square of an original RMSprop weighted differential; Sdb denotes a weighted average of a square of an original RMSprop biased differential; β1 denotes a first hyper-parameter of the prediction model for the size range of the lost circulation channel; and β2 denotes a second hyper-parameter of the prediction model for the size range of the lost circulation channel. The first hyper-parameter and the second hyper-parameter are set to 0.9 and 0.999 respectively. vdW, Vdb, SdW, and Sdb are initialized as 0.
In step S46, the weighted average vdWcorrected of the corrected Momentum weighted differential, the exponentially weighted average Vdbcorrected of the corrected Momentum biased differential, the weighted average SdWcorrected of the square of the corrected RMSprop weighted differential, and the weighted average Sdbcorrected of the square of the corrected RMSprop biased differential are calculated as follows:
where, q denotes the current iteration number.
In step S47, an updated weight and bias of the prediction model for the size range of the lost circulation channel are calculated as follows:
where, W* denotes the updated weight of the prediction model for the size range of the lost circulation channel; b* denotes the updated bias of the prediction model for the size range of the lost circulation channel; W denotes the weight of the prediction model for the size range of the lost circulation channel; b denotes the bias of the prediction model for the size range of the lost circulation channel; a denotes a learning rate of the prediction model for the size range of the lost circulation channel; and ε denotes an infinitesimal, set to 10−8.
Those of ordinary skill in the art will understand that the embodiments described herein are intended to help readers understand the principles of the present disclosure, and it should be understood that the protection scope of the present disclosure is not limited to such special statements and embodiments. Those of ordinary skill in the art may make other various specific modifications and combinations according to the technical teachings disclosed in the present disclosure without departing from the essence of the present disclosure, and such modifications and combinations still fall within the protection scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202211219444.5 | Oct 2022 | CN | national |