Hydrate deposition thickness prediction method based on ensemble learning
Based on integrated learning methods, build a stacking model and use Bayesian optimization to determine the weight value, solve the problem of predictive accuracy and efficiency of the sedimentary thickness of the water compounds in the existing technology, and realize the precise prediction of changes in the thickness of the water deposition in the pipeline. Provides support for mobile safety protection.
Patent Information
- Application Number
- CN202411421736.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-24
AI Technical Summary
Existing numerical simulation methods have problems with accuracy and efficiency in predicting hydrate deposition thickness.
Based on integrated learning methods, through obtaining pipeline hydraulic feature parameters, correlation analysis and preparatory processing, constructing stacking models, using Bayesian optimization to determine the weight value of each right, and eventually predict through the meta learning device.
It achieves accurate prediction of changes in hydrate deposition thickness, improves prediction accuracy and efficiency, and provides support for flow safety assurance at actual sites.
Smart Images

Figure CN119357914A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil and gas safe flow assurance, and in particular to a hydrate deposition thickness prediction method based on integrated learning. Background Art
[0002] Hydrate deposition in oil and gas pipelines is one of the important issues in oil and gas exploration and development; hydrate deposition in pipelines can cause pipeline blockage, reduced transportation capacity, and even damage pipeline facilities, seriously affecting the stability and safety of oil and gas transportation.
[0003] The data required for the prediction of hydrate deposition in oil and gas pipelines involves multi-source data such as oil and gas pipeline operation data and geological exploration data, which contain a large amount of spatiotemporal information and complex characteristics; however, data acquisition and processing are often limited by challenges such as high acquisition costs and inconsistent data quality, which affects the construction and accuracy of the prediction model.
[0004] Patent CN117113764A tests the accuracy of the hydrate prediction model for long-distance pipelines; uses the finite difference method to iteratively solve the hydrate prediction model, and obtains the endpoint temperature of the prediction model solution based on the actual operating conditions; determines whether the iterative calculation is completed based on whether the error reaches the preset accuracy; but the finite difference method has disadvantages such as poor convergence, large calculation error, large calculation amount and approximation accuracy.
[0005] Patent CN115935707A constructs a mathematical model of liquid film and droplet dynamic hydrates, and considers the consumption and supply of water in the wellbore to construct a mass flow model of water in the microelement, a hydrate layer thickness, and a flow diameter model; however, the use of the hydrate layer thickness prediction model has problems such as low prediction accuracy and poor applicability. Summary of the invention
[0006] In view of the shortcomings of the existing methods, the present invention solves the accuracy and efficiency problems existing in the existing numerical simulation methods when predicting the hydrate deposition thickness.
[0007] The technical solution adopted by the present invention is: the hydrate deposition thickness prediction method based on ensemble learning comprises the following steps:
[0008] Step 1: Obtain pipeline hydrate characteristic parameters, and perform correlation analysis and preprocessing;
[0009] As a preferred embodiment of the present invention, the characteristic parameters of hydrate include: time, initial pressure, ambient temperature, pipeline temperature and supercooling degree.
[0010] As a preferred embodiment of the present invention, the preprocessing includes: missing value and normalization processing.
[0011] Step 2: Build a stacking model based on XGBoost, random forest and gradient boosted regression tree, input feature parameters into the stacking model, use Bayesian optimization to optimize the weight values of the stacking model, and use the meta-learner as the prediction output;
[0012] As a preferred embodiment of the present invention, step 2 specifically includes:
[0013] Set the prediction results of XGBoost, random forest and gradient boosted regression tree to f1(x), f2(x), f3(x) and meta-learner g(x) respectively; the output of the stacked model y = y final (x);
[0014] Construct a new feature vector from f1(x), f2(x), and f3(x): meta =[f1(x),f2(x),f3(x)]; X meta Input into the meta-learner;
[0015] The output of the meta-learner is: y meta (x) = λ1f1(x)+λ2f2(x)+λ3f3(x), where λ1, λ2, and λ3 are the weights of XGBoost, random forest, and gradient boosted regression tree, respectively;
[0016] Bayesian optimization is used to determine the optimal values of the λ1, λ2, and λ3 weights, with the goal of minimizing the prediction error;
[0017] As a preferred embodiment of the present invention, the objective function formula for minimizing the prediction error is:
[0018]
[0019] Among them, y i is the true label, f1(x), f2(x), f3(x) are the prediction results of different base learners.
[0020] The meta-learner outputs a prediction.
[0021] Step 3: Evaluate the stacking model using evaluation indicators;
[0022] As a preferred embodiment of the present invention, the evaluation indicators include: MSE, R 2 and MAE.
[0023] As a preferred embodiment of the present invention, a hydrate deposition thickness prediction system based on integrated learning includes: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement a hydrate deposition thickness prediction method based on integrated learning.
[0024] As a preferred embodiment of the present invention, a computer readable medium stores a computer program code, and when the computer program code is executed by a processor, a method for predicting hydrate deposition thickness based on ensemble learning is implemented.
[0025] Beneficial effects of the present invention:
[0026] 1. The present invention applies the integrated learning model to the prediction of hydrate deposition thickness in pipelines through experiments, accurately predicts the changes in hydrate deposition thickness in pipelines, and provides a prediction model support for flow safety assurance in actual sites. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of the hydrate deposition thickness prediction method based on ensemble learning of the present invention;
[0028] Figure 2 is a Pearson correlation analysis heat map of the selected features of the present invention;
[0029] Figure 3 is a comparison chart of the predicted value and experimental value of hydrate deposition thickness of the present invention;
[0030] Figure 4 It is an error diagram of the hydrate deposition thickness prediction result of the present invention. DETAILED DESCRIPTION
[0031] The present invention is further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore it only shows the components related to the present invention.
[0032] like Figure 1 As shown in FIG, the hydrate deposition thickness prediction method based on ensemble learning includes the following steps:
[0033] Step 1: Obtain a pipeline hydrate deposition dataset and perform feature selection on the data as an eigenvalue dataset; divide the eigenvalue dataset into a training dataset and a test dataset.
[0034] The pipeline hydrate deposition data set is in the literature "Gas Hydrate Deposition on a Cold Surface in Water-Saturated Gas Systems", which includes four groups of experimental conditions, as shown in Table 1. Table 1 only lists several indicators with the highest correlation with deposition thickness after correlation analysis.
[0035] Table 1 Experimental conditions in literature
[0036]
[0037] The selection of feature parameters includes selecting time, initial pressure, ambient temperature, pipeline temperature, and supercooling as feature values for training; the four features and the target label deposition thickness are subjected to correlation analysis, and the correlation analysis adopts the Person correlation method, such as Figure 2 Shown are the characteristic parameters after correlation analysis.
[0038] The training data set was preprocessed, and all data sets were processed for missing values and normalized;
[0039] The dataset is divided into training set and validation set in the ratio of 8:2. The cross-validation splits the dataset into multiple subsets, and the model is trained and validated on each subset in turn to accurately evaluate the generalization ability of the model.
[0040] Step 2: Through Bayesian optimization, the various parameters of the integrated learning model are selected to select the best parameter configuration to improve the performance and generalization ability of the model;
[0041] Before Bayesian optimization, the hyperparameters to be optimized are input into parameters = {} in dictionary format. The value range of max_depth is [1, 5], the value range of n_estimators is [50, 200], the value range of learning_rate is [0.01, 0.1], the value range of λ1 is [0, 1], the value range of λ2 is [0, 1], the value range of λ3 is [0, 1], and λ1+λ2+λ3=1;
[0042] In the Bayesian optimization process, we first define a black box function f(x) to represent the prediction error of the model, with the input being the hyperparameter x and the output being the error metric. The goal is to minimize the following objective function:
[0043]
[0044] Among them, x is the hyperparameter of the model.
[0045] x={max_depth,n_estimators,learning_rate,λ1,λ2,λ3},through the observed data points D={(x1,y1),(x2,y2),…(x i ,y i ),…(x n ,y n )} to construct a Gaussian process, each data point includes the hyperparameter x i and the corresponding function value y i =f(x i ).
[0046] The Gaussian process estimates the distribution of f(x) at unobserved points by giving a prior distribution and a likelihood function. The Gaussian process assumes that any two points x i and x j The correlation between them is given by the kernel function k(x i ,x j ). The kernel function formula is as follows:
[0047]
[0048] Among them, l is the hyperparameter of kernel width, which controls the similarity between different hyperparameter combinations.
[0049] The expected improvement (EI) is used to evaluate the hyperparameter combination, and its formula is:
[0050]
[0051] Among them, f(x * ) is the currently known optimal objective function value. Since f(x) follows a Gaussian process distribution, the closed-form solution expected to be improved is:
[0052]
[0053] where μ(x) is the estimated mean of the Gaussian process at x; σ(x) is the standard deviation of the Gaussian process at x; Φ(·) and φ(·) are the cumulative distribution function and probability density function of the standard normal distribution, respectively.
[0054] At each evaluation of a new hyperparameter x new After that, by observing f(x new ) Update the Gaussian process model. The specific update process is based on Bayes’ theorem:
[0055] p(f(x)|D,x new ,f(x new ))∝p(f(x new )|x new )p(f(x)|D)
[0056] Where D represents the data set and p() represents the probability distribution of an event or variable.
[0057] The new mean μ(x) and variance σ(x) are calculated using the posterior update formula of the Gaussian process.
[0058] Bayesian optimization is an iterative process where a new hyperparameter combination x is selected at each iteration. newTo maximize the expected improvement EI(x), and then update the Gaussian process model. This process stops until the objective function is no longer significantly improved. Bayesian optimization gradually converges to an optimal solution in the hyperparameter space, that is, finding a hyperparameter combination that minimizes the objective function f(x).
[0059] Step 3: Build an ensemble learning model. First, adopt an ensemble learning strategy to combine XGBoost, Random Forest, and Gradient Boosted Regression Tree (GBRT) to form a stacked model.
[0060] The stacking model takes the prediction results of XGBoost, Random Forest and Gradient Boosted Regression Tree (GBRT) as input and trains a meta-learner to make the final prediction;
[0061] The prediction results of XGBoost, random forest and gradient boosted regression tree are f1(x), f2(x), f3(x) and a meta-learner g(x), and the final output is y=y final (x), where λ1, λ2, and λ3 are the weights of the prediction results of XGBoost, random forest, and gradient boosted regression tree, respectively.
[0062] Among them, the XGBoost regression algorithm construction includes:
[0063] Assuming the predicted value is a constant y0=mean(y), the initialization model is as follows:
[0064]
[0065] Among them, L() is the loss function, y i is the true value, and γ is a constant value selected during prediction.
[0066] For each data point x, calculate the prediction residual r of the current model i , y i is the true value, is the predicted value.
[0067] The predicted residual r i As the target variable, train a new decision tree to fit these residuals. This process finds the optimal split point by minimizing the objective function.
[0068]
[0069] Among them, Ω(T) is the regularization term of the model, Objective refers to the objective function, which measures the overall optimization goal of the model in the current iteration, and the smaller its value, the better; F m (x i) refers to the mth round of iterative model for input x i The predicted value of .
[0070] The prediction value of the new model is updated to the previous prediction value plus the output of the current decision tree, and the contribution of each new model is controlled by the learning rate η, F m+1 (x) = F m (x)+ηT m (x), and repeat the process until the requirements are met, where T m (x) refers to the predicted value of the current decision tree at the mth iteration.
[0071] In the regression task, the goal of random forest is to predict continuous values, so each decision tree regresses according to the input data, and the final result is the average of all tree predictions;
[0072]
[0073] in, is the prediction value of the t-th tree for the input x, and T is the total number of trees.
[0074] The initial model prediction value of the gradient boosted regression tree is the mean of the target variable:
[0075] The difference between the true value and the current model prediction value, that is, the residual r' i , r' i =y i -F' m (x' i );
[0076] Use the residual r' i As the target value, a new regression tree is trained to fit the residual, and the output of each tree corresponds to the estimated value of the current residual.
[0077] Update the model by the output of the new tree and the learning rate η': F' m+1 (x') = F' m (x')+η'T' m (x'), and repeat the above process until the error is satisfied.
[0078] In the meta-learner calculation process, for each data point X, the three prediction values f1(x), f2(x), and f3(x) of the base learner are obtained and combined into a new feature vector: X meta =[f1(x),f2(x),f3(x)], this new eigenvector X meta as input to the meta-learner.
[0079] For each data point X, the meta-learner needs to learn the mapping from the prediction results of the base learners to the true value y; and the meta-learner uses linear regression to learn each weight λ1, λ2, λ3 to determine the contribution of each base learner to the final prediction; the formula of the meta-learner is: y meta (x)=λ1f1(x)+λ2f2(x)+λ3f3(x);
[0080] Bayesian optimization is used to determine the optimal values of these weights, with the goal of minimizing the prediction error. The specific optimization goal is to minimize the following loss function:
[0081]
[0082] Among them, y i are the true labels, and f1(x), f2(x), and f3(x) are the prediction results of the corresponding base learners.
[0083] Finally, the meta-learner combines the predictions of each base learner to generate the final prediction value: y final (x)=λ1f1(x)+λ2f2(x)+λ3f3(x).
[0084] Use the training data set to train the constructed integrated learning model, input the data into the model, and continuously iterate and optimize the model through cross-validation to achieve the best fitting effect on the training data set;
[0085] The trained ensemble learning model is used to predict the hydrate deposition thickness of the test data set and obtain evaluation indicators. Common evaluation indicators include mean square error (MSE), determination coefficient (R 2 ), the mean absolute error (MAE), these indicators are used to evaluate the prediction performance and generalization ability of the model.
[0086] The test set is used to apply the ensemble learning model to predict the results. Figure 3 , 4 As shown, the basic trend and prediction accuracy are consistent with the experimental results.
[0087] The prediction evaluation indicators are shown in Table 2.
[0088] Table 2 Evaluation indicators
[0089] <![CDATA[R 2 ]]> MSE MAE 0.9632 0.008 0.0746
[0090] The present invention applies the integrated learning model to the prediction of hydrate deposition thickness in pipelines through experiments, accurately predicts the change of hydrate deposition thickness in pipelines, and provides a prediction model support for flow safety assurance in actual sites.
[0091] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A hydrate deposition thickness prediction method based on ensemble learning, characterized in that: The following steps are involved: Step 1: Obtain pipeline hydrate characteristic parameters, and perform correlation analysis and preprocessing; Step 2: Build a stacking model based on XGBoost, random forest and gradient boosted regression tree, input feature parameters into the stacking model, use Bayesian optimization to optimize the weight values of the stacking model, and use the meta-learner as the prediction output; Step 3: Use evaluation indicators to evaluate the stacking model.
2. The hydrate deposition thickness prediction method based on ensemble learning according to claim 1 is characterized in that: Step 2 specifically includes: Set the prediction results of XGBoost, random forest and gradient boosted regression tree to f1(x), f2(x), f3(x) respectively, and the meta-learner g(x); the output of the stacked model y = y final (x); Construct a new feature vector from f1(x), f2(x), and f3(x): meta =[f1(x),f2(x),f3(x)]; X meta Input into the meta-learner; The output of the meta-learner is: y meta (x) = λ1f1(x)+λ2f2(x)+λ3f3(x), where λ1, λ2, and λ3 are the weights of XGBoost, random forest, and gradient boosted regression tree, respectively; Bayesian optimization is used to determine the optimal values of the λ1, λ2, and λ3 weights, with the goal of minimizing the prediction error, and the prediction results are output through the meta-learner.
3. The hydrate deposition thickness prediction method based on ensemble learning according to claim 2 is characterized in that: The objective function formula for minimizing the prediction error is: Among them, y i is the true label, f1(x), f2(x), f3(x) are the prediction results of different base learners.
4. The hydrate deposition thickness prediction method based on ensemble learning according to claim 1 is characterized in that: Hydrate characteristic parameters include: time, initial pressure, ambient temperature, pipeline temperature and subcooling.
5. The hydrate deposition thickness prediction method based on ensemble learning according to claim 1 is characterized in that: Preprocessing includes: Missing value and normalization handling.
6. The hydrate deposition thickness prediction method based on ensemble learning according to claim 1 is characterized in that: Evaluation metrics include: M.S.E., R. 2 Japanese MAE.
7. Hydrate deposition thickness prediction system based on ensemble learning, characterized in that: include: a memory for storing instructions executable by a processor; A processor, configured to execute instructions to implement the hydrate deposition thickness prediction method based on ensemble learning as described in any one of claims 1 to 6.
8. A computer readable medium storing a computer program code, characterized in that: When the computer program code is executed by a processor, the computer program code implements the method for predicting hydrate deposition thickness based on ensemble learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Natural gas long-distance pipeline hydrate prediction method and system based on finite difference method
CN117113764A
Cited By
Bayesian optimization-based integrated learning reverse process parameter determination method
CN120373501A