Method for predicting anti-gas channeling performance coefficient of cement paste based on model fusion
By employing model fusion and feature optimization methods, the complex nonlinear problem of predicting the anti-gas channeling performance of cement slurry was solved, achieving efficient and accurate prediction results and significantly reducing R&D costs and time.
Patent Information
- Application Number
- CN202510992200.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies struggle to effectively capture the complex nonlinear coupling effects between temperature, pressure, and various admixtures, resulting in large prediction errors in the anti-gas channeling performance of cement slurry. Furthermore, relying on laboratory trial-and-error methods is inefficient and costly, and single machine learning models have limited fitting capabilities and insufficient generalization ability.
A model fusion strategy is adopted, which uses Pearson correlation analysis to screen features, performs differential outlier processing and normalization, and combines decision tree, random forest, support vector machine and XGBoost model training to build a fusion model. The prediction output of the random forest model is used for nonlinear feature fusion training, and the feature contribution is analyzed by combining SHAP value.
It significantly improves the prediction accuracy and stability of the anti-gas channeling performance coefficient of cement slurry, shortens the research and development cycle, reduces costs, and provides efficient engineering support.
Smart Images

Figure CN120877932A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of petroleum engineering, and more specifically to a method for predicting the performance coefficient of cement slurry gas channeling prevention based on model fusion. Background Technology
[0002] The gas channeling prevention performance of cement slurry is crucial in the petroleum engineering field, directly affecting the sealing performance and long-term stability of the wellbore. Especially under high pressure and high temperature environments, ensuring that cement slurry can effectively prevent gas channeling is a key factor in guaranteeing safe and efficient oil well production.
[0003] Currently, existing technologies mainly rely on empirical models based on thickening experimental data to evaluate anti-gas channeling performance. Such models struggle to effectively capture the complex nonlinear coupling effects between temperature, pressure, and various admixtures. For example, admixture interactions can simultaneously affect water loss, thickening time, and static gel strength development curves, while traditional linear or simple nonlinear models cannot accurately characterize these higher-order correlations, leading to a significant increase in prediction bias for new formulation combinations.
[0004] Furthermore, performance optimization heavily relies on laboratory trial-and-error methods, requiring repeated adjustments to admixture ratios and physical experimental verification. A single experiment can take several days to weeks, and the high-temperature, high-pressure environment of deep gas wells further increases the complexity. This trial-and-error approach leads to low R&D efficiency, high labor and material costs, and severely restricts the rapid iteration and application of high-performance cement slurry formulations.
[0005] Furthermore, although some studies have incorporated machine learning algorithms, the ability of a single model to fit high-dimensional features and highly nonlinear datasets is limited. This is especially true when the variety of admixtures increases and the complexity of operating conditions rises, leading to overfitting or underfitting and insufficient predictive stability. Existing methods lack scientific mechanisms for analyzing feature contributions and multi-model collaborative optimization strategies, making it difficult to meet practical engineering needs in terms of generalization ability.
[0006] Therefore, how to design a model fusion-based method for predicting the performance coefficient of cement slurry anti-gas channeling that can replace the experimental trial-and-error mode and achieve efficient and reliable evaluation of complex formulations is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] In view of this, the present invention provides a method for predicting the performance coefficient of cement slurry gas channeling prevention based on model fusion. It aims to replace traditional experimental trial and error with intelligent prediction model to achieve rapid and accurate prediction of the performance coefficient of cement slurry gas channeling prevention, thereby optimizing formula design, improving the reliability of cementing sealing, and significantly reducing R&D costs and cycle.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] A method for predicting the anti-gas channeling performance coefficient of cement slurry based on model fusion includes the following steps:
[0010] S1. Construct an initial dataset with environmental parameters, basic materials, and admixture dosage as feature labels, and cement slurry anti-gas channeling performance coefficient SPN as prediction label;
[0011] S2. Perform Pearson correlation analysis on the initial dataset to filter effective features, process the feature labels and predicted labels for differential outlier processing, and obtain the optimized dataset after normalization.
[0012] S3. Based on the optimized dataset, decision tree, random forest, support vector machine and XGBoost models are trained respectively. The model parameters are optimized by grid search combined with five-fold cross-validation, and the optimal base model is selected by relevant evaluation metrics.
[0013] S4. Construct a fusion model based on the optimal base model, and use the prediction output of the optimal base model as a new feature. Combine the optimized dataset with nonlinear feature fusion training to obtain a trained fusion model.
[0014] S5. Input the characteristic parameters of the cement slurry formulation to be tested into the trained fusion model, and output the corresponding predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
[0015] Preferably, in step S1, the formula for calculating the cement slurry anti-gas channeling performance coefficient SPN is:
[0016]
[0017] Among them, FL API This indicates the API standard water loss of cement grout, in tons. 100Bc This indicates the time required for the cement paste to reach a consistency of 100 Bc, expressed in t. 30Bc This indicates the time required for the cement paste consistency to reach 30 Bc.
[0018] Preferably, in step S2, the screening of effective features using Pearson correlation analysis includes:
[0019] Calculate the correlation coefficient r between all pairs of features. If |r|>0.8, remove one feature to avoid multicollinearity and retain features with a correlation coefficient |r|>0.1 with the SPN value.
[0020] Preferably, in step S2, the differential outlier processing includes:
[0021] Outliers within ±3 interquartile range detected in the boxplot for feature labels are retained, and invalid data points with SPN values greater than 6 or less than 0 are removed from the predicted labels.
[0022] Preferably, in step S2, the normalization formula is:
[0023]
[0024] Where Y represents the normalized feature, and X represents the original feature value. min X represents the minimum value of a feature in the dataset. max This represents the maximum value of a feature in the dataset.
[0025] Preferably, in step S3, optimizing model parameters through grid search combined with five-fold cross-validation includes:
[0026] Hyperparameter search spaces were defined for the four models, with the maximum depth of the decision tree model being [determined].
[0027] The random forest model has the following parameters: number of decision trees ∈ {5, 10, 15, 20}, minimum number of samples ∈ {2, 3, 4}, minimum number of split samples ∈ {1, 2, 3}; maximum depth ∈ {0, 10, 20, 30}, minimum number of samples ∈ {2, 5, 10}, minimum number of split samples ∈ {1, 2, 4}; regularization parameters for the support vector machine model.
[0028] The tolerance error is ∈{0.1,1,10,100}, and the number of boosting trees in the XGBoost model is ∈{100,300,500}, the maximum depth is ∈{3,5,7}, and the learning rate is ∈{0.01,0.1,0.2}.
[0029] Five-fold cross-validation was used to evaluate the performance of each hyperparameter group, with the mean squared error of the test set (MSE) as the optimization objective function.
[0030] Choose the combination of hyperparameters that minimizes MSE as the final configuration for each model.
[0031] Preferably, in S3, the optimal base model is a random forest model, and its hyperparameter optimization combination is: the number of decision trees is 100, the maximum depth is 10, the minimum number of samples is 2, and the minimum number of split samples is 2.
[0032] Preferably, in step S4, the fusion model includes:
[0033] Input layer: includes two channels. The first channel receives the 1-dimensional prediction value of the random forest model, and the second channel receives the 18-dimensional normalized original feature vector.
[0034] Feature concatenation layer: concatenates the inputs of the two channels into a 19-dimensional vector, fusing low-level detailed features with high-level abstract features;
[0035] Hidden layers: contain two fully connected layers. The first fully connected layer has 128 neurons and uses the ReLU activation function, and the second fully connected layer has 64 neurons and uses the ReLU activation function to capture non-linear relationships in the data.
[0036] Output layer: Single neuron linear activation, outputting the predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
[0037] Preferably, the nonlinear feature fusion training in S4 includes:
[0038] Using the Adam optimizer, the learning rate is set to 0.001, and the loss function is the mean squared error (MSE).
[0039] Set an early stopping mechanism to terminate training and automatically restore the optimal weights when the validation set loss does not decrease for 20 consecutive epochs.
[0040] The training batch size is 32, and the maximum number of iterations is 200.
[0041] Preferably, step S4 further includes analyzing the feature contribution by combining the SHAP value:
[0042] Based on the fusion model, the SHAP contribution value of all features to the SPN prediction results is calculated;
[0043] The importance of features is ranked according to the global average absolute magnitude of SHAP values, and positive and negative impact types are distinguished.
[0044] The output feature contribution analysis results are used to verify the physical rationality of the model's decision-making logic and guide the optimization of admixture ratios.
[0045] As can be seen from the above technical solutions, compared with the prior art, the technical solutions of the present invention have the following advantages:
[0046] Beneficial effects:
[0047] 1. This method employs a model fusion strategy. First, it selects the optimal base model based on feature contribution, then uses its predicted output as a new feature, and combines it with the original data for nonlinear feature fusion training. This effectively integrates the advantages of different models, overcomes the limitations of a single model in fitting complex nonlinear relationships, significantly improves the accuracy of predicting the anti-gas channeling performance coefficient of cement slurry, and enhances the generalization ability to data on unseen new formulations.
[0048] 2. It implements a differentiated outlier handling strategy for input features and prediction labels, which removes invalid data points while retaining potentially valuable engineering information. It effectively filters features by combining correlation analysis, eliminates the effects of multicollinearity and retains key predictive factors, and then unifies the data scale through normalization, which significantly improves the quality of input data. This makes the final model more adaptable to noise and fluctuations in actual engineering data, and ensures the stability and reliability of prediction results.
[0049] 3. A specific end-to-end prediction process was constructed. The trained fusion model can directly and quickly output the predicted value of the anti-gas channeling performance coefficient of cement slurry based on the input feature parameters. This effectively replaces the traditional performance optimization method that relies on a large number of repeated experiments and trials, shortens the cycle of new formula development and performance evaluation, and provides efficient support for engineering decision-making. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0051] Figure 1 A flowchart of a method for predicting the anti-gas channeling performance coefficient of cement slurry based on model fusion is provided in an embodiment of the present invention;
[0052] Figure 2 This is a schematic diagram comparing the prediction accuracy of different models for SPN provided in the embodiments of the present invention;
[0053] Figure 3 This is a chart illustrating the importance of SHAP value features provided in an embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] like Figure 1 As shown in the figure, this embodiment provides a method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion, including the following steps:
[0056] S1. Construct an initial dataset with environmental parameters, basic materials, and admixture dosage as feature labels, and cement slurry anti-gas channeling performance coefficient SPN as prediction label;
[0057] S2. Perform Pearson correlation analysis on the initial dataset to filter effective features, process the feature labels and predicted labels for differential outlier processing, and obtain the optimized dataset after normalization.
[0058] S3. Based on the optimized dataset, decision tree, random forest, support vector machine and XGBoost models are trained respectively. The model parameters are optimized by grid search combined with five-fold cross-validation, and the optimal base model is selected by relevant evaluation metrics.
[0059] S4. Construct a fusion model based on the optimal base model, and use the prediction output of the optimal base model as a new feature. Combine the optimized dataset with nonlinear feature fusion training to obtain a trained fusion model.
[0060] S5. Input the characteristic parameters of the cement slurry formulation to be tested into the trained fusion model, and output the corresponding predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
[0061] This method significantly improves prediction accuracy and generalization ability through model fusion strategy, enhances model robustness by combining differentiated outlier processing and feature optimization, and builds an end-to-end prediction process to achieve high efficiency in engineering applications. It effectively overcomes the limitations of traditional methods in fitting complex nonlinear relationships and greatly shortens the R&D cycle and cost.
[0062] The following provides a further detailed explanation of each step in the above method;
[0063] In this embodiment S1, an initial dataset is constructed with environmental parameters, basic materials, and admixture dosage as feature labels, and the cement slurry anti-gas channeling performance coefficient SPN as the prediction label.
[0064] Specifically, we conducted cement slurry anti-channeling performance tests to obtain some experimental data and collected relevant data from published journal articles and master's theses to expand the dataset size and meet the data needs of machine learning.
[0065] As shown in Tables 1 and 2 below, by collecting relevant data from published journal articles and master's theses, the following parameters (temperature, pressure, density), basic materials (cement, water), admixtures (weighting agents, cenospheres, glass microspheres, early strength agents, expanding agents, drag reducing agents, anti-channeling agents, dispersants, silica fume, microsilica, water loss reducing agents, retarders, latex), and cement slurry performance coefficients were selected to form the initial dataset; among them, the cement slurry anti-channeling performance coefficient (SPN) was used as the prediction label, and the others were used as feature labels.
[0066] Table 1
[0067] temperature pressure density cement Weighting agent cenospheres Glass microspheres Early strength agent Expanding agent 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 81 50 1.6 500 0 0 45 3 15 155 80 1.92 500 0 0 0 0 0 155 80 2.05 500 0 0 0 0 0 155 80 2.15 500 0 0 0 0 0 89 52 1.6 500 0 0 45 3 15 140 70 2 500 83.5 0 0 0 5.5 140 70 2.1 500 133.5 0 0 0 5.5 140 70 2.2 500 250 0 0 0 7 140 70 2.3 500 389 0 0 0 7.5 140 70 2.4 500 408.5 0 0 0 8 35 0.1 1.4 434 0 166 0 0 0 35 0.1 1.5 420 0 90 0 0 0 35 0.1 1.5 450 0 50 0 0 0 35 0.1 1.6 360 0 0 0 0 0
[0068] Table 2
[0069]
[0070] Furthermore, the formula for calculating the cement grout's anti-gas channeling performance coefficient SPN is as follows:
[0071]
[0072] Among them, FL API This indicates the API standard water loss of cement grout, in tons. 100Bc This indicates the time required for the cement paste to reach a consistency of 100 Bc, expressed in t. 30Bc This indicates the time required for the cement paste consistency to reach 30 Bc.
[0073] The SPN value reflects the influence of cement slurry water loss and the thickening process on the anti-gas channeling performance. Generally speaking, the smaller the SPN, the better the anti-gas channeling performance of the cement slurry. The evaluation criteria for anti-gas channeling performance are shown in Table 3 below:
[0074] Table 3
[0075]
[0076] In this embodiment S2, Pearson correlation analysis is performed on the initial dataset to screen effective features, and the feature labels and predicted labels are processed for differential outliers, and then the optimized dataset is obtained after normalization.
[0077] Specifically, the closer the absolute value of the correlation coefficient is to 1, the stronger the correlation between the variables. If the correlation between input variables is too high, it may lead to multicollinearity, affecting the stability of the model; while if the correlation is too low, it may weaken the contribution of features to the prediction target, thus affecting the performance of the model.
[0078] Therefore, to ensure the stability and prediction accuracy of the model, Pearson correlation analysis is performed to screen effective features. The specific steps include calculating the Pearson correlation coefficient *r* between all pairs of features. If the absolute value of the correlation coefficient |r| > 0.8 for a pair of features, it is considered that there is a high degree of multicollinearity between these two features, and one of the features is removed to avoid overfitting during model training. Furthermore, features with a correlation coefficient |r| > 0.1 with the target variable (i.e., the cement slurry anti-gas channeling performance coefficient SPN) are further screened, as they have a significant impact on the prediction results. This method effectively reduces the dimensionality of the input features while improving the model's interpretability and generalization ability.
[0079] Furthermore, in the data preprocessing stage, differentiated outlier handling is performed to ensure data quality and model reliability. This includes: for feature labels (such as temperature, pressure, density, etc.), box plots are used to detect and retain outliers within ±3 times the interquartile range (IQR). This can preserve potentially valuable information to some extent and prevent the accidental deletion of data points that may have special significance. For prediction labels (i.e., SPN values), a more stringent screening standard is adopted, directly removing invalid data points with SPN values greater than 6 or less than 0. These extreme values usually represent experimental errors or unreasonable testing conditions, which do not conform to the reasonable range in real-world application scenarios. Through this differentiated processing approach, the integrity and representativeness of the dataset are ensured, while the prediction accuracy and stability of the final model are improved.
[0080] Furthermore, since there are differences in the dimensions of the parameters in the dataset, data normalization is used for processing.
[0081] As shown in Tables 4 and 5 below, the original data is proportionally transformed into the interval [0, 1] to ensure that the data have the same cardinality;
[0082] Table 4
[0083]
[0084]
[0085] Table 5
[0086]
[0087]
[0088] Furthermore, the normalization formula is as follows:
[0089]
[0090] Where Y represents the normalized feature, and X represents the original feature value. min X represents the minimum value of a feature in the dataset. max This represents the maximum value of a feature in the dataset;
[0091] In this embodiment S3, based on the optimized dataset, decision tree, random forest, support vector machine and XGBoost models are trained respectively. The model parameters are optimized by grid search combined with five-fold cross-validation, and the optimal base model is selected by relevant evaluation indicators.
[0092] Among them, optimizing model parameters through grid search combined with five-fold cross-validation includes:
[0093] Hyperparameter search spaces were defined for the four models, with the maximum depth of the decision tree model being [determined].
[0094] The random forest model has the following parameters: number of decision trees ∈ {5, 10, 15, 20}, minimum number of samples ∈ {2, 3, 4}, minimum number of split samples ∈ {1, 2, 3}; maximum depth ∈ {0, 10, 20, 30}, minimum number of samples ∈ {2, 5, 10}, minimum number of split samples ∈ {1, 2, 4}; regularization parameters for the support vector machine model.
[0095] The tolerance error is ∈{0.1,1,10,100}, and the number of boosting trees in the XGBoost model is ∈{100,300,500}, the maximum depth is ∈{3,5,7}, and the learning rate is ∈{0.01,0.1,0.2}.
[0096] Five-fold cross-validation was used to evaluate the performance of each hyperparameter group, with the mean squared error of the test set (MSE) as the optimization objective function.
[0097] Choose the combination of hyperparameters that minimizes MSE as the final configuration for each model;
[0098] Furthermore, for the four models—decision tree, random forest, support vector machine, and XGBoost—five-fold cross-validation was used to calculate the following performance metrics on the test set: coefficient of determination (R²). 2 Mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE);
[0099] With R 2 The primary indicator is MSE (≥0.85), and the secondary indicator is MSE (≤0.25). The model performance is evaluated comprehensively.
[0100] like Figure 2 As shown, Random Forest (RF) performs best on all key metrics of the test set: its coefficient of determination (R²) is the highest. 2 It scored close to perfect (approximately 0.95), significantly higher than XGBoost (approximately 0.85), decision tree (approximately 0.75), and support vector machine (approximately 0.70); at the same time, RF's error metrics were all superior—mean squared error (MSE) as low as 0.02, mean absolute error (MAE) approximately 0.04, and root mean square error (RMSE) approximately 0.15.
[0101] Random Forest (RF) has significant advantages in both prediction accuracy and generalization ability. Its prediction results have the highest fitting degree with the actual SPN value and the smallest error. The optimal combination of hyperparameters for the Random Forest model is: 100 decision trees, 10 maximum depth, 2 minimum number of samples, and 2 minimum number of split samples.
[0102] In this step, a systematic model training and optimization process significantly improves the accuracy and reliability of predicting the anti-gas channeling performance of cement slurry. Based on the comparison, screening, and parameter tuning of multiple machine learning algorithms, a prediction model with extremely strong generalization ability was successfully constructed, overcoming the dependence of traditional empirical methods on manual experiments.
[0103] In this embodiment S4, a fusion model is constructed based on the optimal base model, and the prediction output of the optimal base model is used as a new feature. The fusion model is then trained by nonlinear feature fusion in combination with the optimized dataset to obtain a well-trained fusion model.
[0104] To avoid the limitations of a single model and further improve its generalization ability and accuracy, a deep learning and ensemble learning fusion model (ANN-RF) is constructed for the random forest model selected in the above steps. The prediction results of the random forest are used as the input features of the artificial neural network (ANN), and nonlinear feature relearning is achieved through a three-layer fully connected network.
[0105] The fusion model includes:
[0106] Input layer: includes two channels. The first channel receives the 1-dimensional prediction value of the random forest model, and the second channel receives the 18-dimensional normalized original feature vector.
[0107] Feature concatenation layer: concatenates the inputs of the two channels into a 19-dimensional vector, fusing low-level detailed features with high-level abstract features;
[0108] Hidden layers: contain two fully connected layers. The first fully connected layer has 128 neurons and uses the ReLU activation function, and the second fully connected layer has 64 neurons and uses the ReLU activation function to capture non-linear relationships in the data.
[0109] Output layer: Single neuron linear activation, outputting the predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
[0110] The combination of these two elements enables the fusion model to learn both low-level details and high-level abstractions simultaneously, improving the model's ability to fit complex data patterns.
[0111] Furthermore, nonlinear feature fusion training includes:
[0112] The Adam optimizer was used with a learning rate of 0.001 and a loss function of mean squared error (MSE). An early stopping mechanism was set up to terminate training and automatically restore the optimal weights when the validation set loss did not decrease for 20 consecutive epochs. The training batch size was 32 and the maximum number of iterations was 200.
[0113] The specific performance evaluation is shown in Table 6 below. After training with the fusion model, the prediction accuracy has been improved.
[0114] Table 6
[0115] RF ANN-RF <![CDATA[R 2 ]]> 0.9318 0.9740 MSE 0.1915 0.0471 RMSE 0.4376 0.2171 MAE 0.2246 0.1653 MAPE (%) 46.91 37.57
[0116] like Figure 3 As shown, the feature contribution is analyzed by combining SHAP values:
[0117] Based on the fusion model, the SHAP contribution value of all features to the SPN prediction results was calculated. Microsilicon ranked at the top, with an average absolute SHAP value of 1.00, indicating that it had the greatest influence on the model output. This was followed by early-strength agents, cenospheres, etc., while glass microspheres had the weakest impact. This ranking directly reflects the criticality of features in predicting anti-gas channeling performance.
[0118] Based on the global average absolute amplitude of the SAP value, the importance of the characteristics is ranked, and positive and negative impact types are divided. Positive impact (increases SPN value): Features with high SAP values such as microsilicon and early strength agents (concentrated in the red area) will lead to an increase in SPN value when their amount is increased, which will worsen the anti-gas channeling performance. Negative impact (decreases SPN value): Features such as latex and water loss control agents (concentrated in the blue area) can significantly reduce SPN value and improve anti-gas channeling performance when their amount is increased.
[0119] The output feature contribution analysis results are used to verify the physical rationality of the model's decision-making logic and guide the optimization of admixture ratios. These results not only verify the consistency between the model's decisions and engineering principles (such as the negative effects of microsilicon extending thickening time), but also provide a quantitative basis for admixture optimization—prioritizing the control of high-SHAP absolute value features while ignoring low-contribution features.
[0120] This fusion feature contribution analysis transforms black-box prediction into actionable engineering knowledge. By deeply exploring the impact mechanisms of various factors on anti-gas channeling performance, it clarifies the control direction and priority of key materials, enhancing the scientific rigor and relevance of formulation optimization. This closed-loop technology not only verifies the consistency between the model and physical principles but also achieves an intelligent leap from prediction results to optimization solutions.
[0121] In this embodiment S5, the characteristic parameters of the cement slurry formulation to be tested are input into the trained fusion model, and the corresponding predicted value of the cement slurry anti-gas channeling performance coefficient SPN is output; specifically including:
[0122] The structure and weight parameters of the ANN-RF fusion model are saved as a PKL file. The model file is loaded by calling the TensorFlow library through a Python script. The temperature, pressure, density and dosage of various admixtures of the new formulation are input in tabular form, and the SPN prediction values are output in batches.
[0123] This embodiment provides a model fusion-based method for predicting the performance coefficient of cement slurry against gas channeling. By combining the advantages of random forest and deep learning models, a high-precision ANN-RF prediction architecture is constructed, which enhances the extraction capability of high-level abstract features while preserving the original feature details. This method successfully solves the technical bottleneck of traditional empirical models in capturing the complex coupling effects of temperature, pressure, and admixtures, and is significantly superior to a single machine learning model. Verification shows that this method can effectively shorten the cement slurry formulation optimization cycle, providing an efficient and reliable performance prediction tool for deep gas well cementing operations, effectively ensuring wellbore sealing integrity and safe production.
[0124] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0125] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion, characterized in that, Includes the following steps: S1. Construct an initial dataset with environmental parameters, basic materials, and admixture dosage as feature labels, and the cement slurry anti-gas channeling performance coefficient SPN as the prediction label; S2. Perform Pearson correlation analysis on the initial dataset to filter effective features, process the feature labels and predicted labels for differential outlier processing, and obtain the optimized dataset after normalization. S3. Based on the optimized dataset, decision tree, random forest, support vector machine and XGBoost models are trained respectively. The model parameters are optimized by grid search combined with five-fold cross-validation, and the optimal base model is selected by relevant evaluation metrics. S4. Construct a fusion model based on the optimal base model, and use the prediction output of the optimal base model as a new feature. Combine the optimized dataset with nonlinear feature fusion training to obtain a trained fusion model. S5. Input the characteristic parameters of the cement slurry formulation to be tested into the trained fusion model, and output the corresponding predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
2. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In S1, the formula for calculating the cement slurry anti-gas channeling performance coefficient SPN is: Among them, FL API This indicates the API standard water loss of cement grout, in tons. 100Bc This indicates the time required for the cement paste to reach a consistency of 100 Bc, expressed in t. 30Bc This indicates the time required for the cement paste to reach a consistency of 30 Bc.
3. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In step S2, the effective features selected through Pearson correlation analysis include: Calculate the correlation coefficient r between all pairs of features. If |r|>0.8, remove one feature to avoid multicollinearity and retain features with a correlation coefficient |r|>0.1 with the SPN value.
4. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In step S2, the handling of differential outliers includes: Outliers within ±3 interquartile range detected in the boxplot for feature labels are retained, and invalid data points with SPN values greater than 6 or less than 0 are removed from the predicted labels.
5. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In S2, the normalization formula is: Where Y represents the normalized feature, and X represents the original feature value. min X represents the minimum value of a feature in the dataset. max This represents the maximum value of a feature in the dataset.
6. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In S3, the optimization of model parameters through grid search combined with five-fold cross-validation includes: The hyperparameter search spaces are defined for the four models respectively. For the decision tree model, the maximum depth ∈ {5, 10, 15, 20}, the minimum number of samples ∈ {2, 3, 4}, and the minimum number of split samples ∈ {1, 2, 3}. For the random forest model, the number of decision trees ∈ {100, 300, 500, 1000}, the maximum depth ∈ {0, 10, 20, 30}, the minimum number of samples ∈ {2, 5, 10}, and the minimum number of split samples ∈ {1, 2, 4}. The regularization parameter of the support vector machine model is... The tolerance error is ∈{0.1,1,10,100}, and the number of boosting trees in the XGBoost model is ∈{100,300,500}, the maximum depth is ∈{3,5,7}, and the learning rate is ∈{0.01,0.1,0.2}. Five-fold cross-validation was used to evaluate the performance of each hyperparameter group, with the mean squared error of the test set (MSE) as the optimization objective function. Choose the combination of hyperparameters that minimizes MSE as the final configuration for each model.
7. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In S3, the optimal base model is the random forest model, and its hyperparameter optimization combination is: the number of decision trees is 100, the maximum depth is 10, the minimum number of samples is 2, and the minimum number of split samples is 2.
8. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, In S4, the fusion model includes: Input layer: includes two channels. The first channel receives the 1-dimensional prediction value of the random forest model, and the second channel receives the 18-dimensional normalized original feature vector. Feature concatenation layer: concatenates the inputs of the two channels into a 19-dimensional vector, fusing low-level detailed features with high-level abstract features; Hidden layers: contain two fully connected layers. The first fully connected layer has 128 neurons and uses the ReLU activation function, and the second fully connected layer has 64 neurons and uses the ReLU activation function to capture non-linear relationships in the data. Output layer: Single neuron linear activation, outputting the predicted value of the cement slurry anti-gas channeling performance coefficient SPN.
9. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, The nonlinear feature fusion training in S4 includes: Using the Adam optimizer, the learning rate is set to 0.001, and the loss function is the mean squared error (MSE). Set an early stopping mechanism to terminate training and automatically restore the optimal weights when the validation set loss does not decrease for 20 consecutive epochs. The training batch size is 32, and the maximum number of iterations is 200.
10. The method for predicting the performance coefficient of cement slurry anti-gas channeling based on model fusion according to claim 1, characterized in that, S4 also includes analyzing feature contribution by combining SHAP values: Based on the fusion model, the SHAP contribution value of all features to the SPN prediction results is calculated; The importance of features is ranked according to the global average absolute magnitude of SHAP values, and positive and negative impact types are distinguished. The output feature contribution analysis results are used to verify the physical rationality of the model's decision-making logic and guide the optimization of admixture ratios.