Acidification measure effect prediction method based on multi-source feature fusion machine learning model
By integrating a multi-source feature fusion machine learning model with feature screening and PSO-LCE methods, the problem of insufficient prediction accuracy of existing acidizing measures is solved, enabling scientific prediction of the effects of acidizing measures, optimizing production increase decisions, and improving oilfield development efficiency and economic benefits.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2024-11-12
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for predicting the effects of acidizing measures rely on empirical formulas or simplified physical models, which cannot fully utilize the complexity and variability of well site data. This results in limited prediction accuracy and reliability, failing to meet the technical needs of technicians for efficient production enhancement and real-time monitoring.
A machine learning model based on multi-source feature fusion is adopted, which selects features through an integrated feature selection model and combines machine learning methods such as PSO and LCE models. It integrates random forest feature importance, Pearman correlation analysis and elastic network method, and uses particle swarm optimization algorithm to optimize hyperparameters to construct a predictive model for the effect of acidification measures.
It enables scientific and accurate prediction of the production enhancement effect of oil well acidizing measures, helps technicians optimize production enhancement decisions, and improves oilfield development efficiency and economic benefits.
Smart Images

Figure CN122024917A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of petroleum engineering technology, and in particular relates to a method for predicting the effects of acidizing measures based on a multi-source feature fusion machine learning model. Background Technology
[0002] As oilfield development gradually enters its mid-to-late stages, most oilfields are experiencing a series of problems such as declining production and excessively high water cut. To improve well productivity and oil yield, effective well enhancement measures are necessary. Against this backdrop, acidizing, as a common production enhancement technology, is widely used to improve the production capacity of oil and gas wells. By injecting acidic chemicals, deposits in the wellbore and reservoir can be effectively removed, increasing the flow channels for oil and gas, thereby significantly improving the production and recovery rate of oil and gas wells. It is one of the effective methods to combat oilfield aging problems.
[0003] Predicting the effects of acidification measures is crucial, as it helps optimize operational design, forecasts potential production increases, and provides data support for investment decisions. Acidification forecasting allows for more efficient resource allocation, reduces uncertainty and risk in acidification operations, and increases operational economics. Accurate forecasting allows engineers to select the most suitable acidification parameters, such as acid type and concentration, acidifying solution volume, and injection rate, to achieve optimal production gains. Furthermore, forecasting can guide on-site operations, reduce the potential environmental impact of acidification, and ensure operational safety.
[0004] Existing methods for predicting the effectiveness of acidizing measures typically rely on empirical formulas or simplified physical models, mainly including empirical judgment, historical data comparison, and physical model prediction. However, these methods often overlook the complexity and variability of well site data, fail to fully utilize all available information, and have limited accuracy and reliability in prediction. In addition, technicians have tried the following technical means. For example, the patent document titled "A Method for Predicting the Effect of Oil Well Acidizing Measures Based on Transfer Learning" and application number CN202310883234.4 describes the following technical solution: a method for predicting the effect of oil well acidizing measures based on transfer learning, belonging to the field of petroleum engineering technology, including the following steps: establishing an acidizing numerical simulation model based on a seepage field-temperature field-chemical field coupling model; simulating the acidizing process using numerical simulation methods and constructing a simulation sample set; constructing an actual sample library based on actual production data before and after acidizing of completed acidized wells; constructing an acidizing measure effect prediction model based on a BP neural network model and pre-training the prediction model using the simulation sample set; substituting the actual sample set into the pre-trained prediction model using transfer learning methods for retraining, and obtaining the final prediction model after fine-tuning; evaluating the final prediction model, outputting a prediction model with good evaluation, and predicting the effect of acidizing measures based on the prediction model with good evaluation.
[0005] However, after further research, the inventors found that the above-mentioned existing technologies do not constitute a complete and mature system for predicting the effects of acidification measures, so as to complete the prediction of the production increase effect after acidification measures and meet the technical needs of technicians for efficient production increase and real-time monitoring. Summary of the Invention
[0006] This invention provides a method for predicting the effects of acidizing measures based on a multi-source feature fusion machine learning model. This method selects features through an integrated feature screening model and uses a machine learning method that combines PSO and LCE models to achieve a scientific and accurate prediction of the production enhancement effect of oil well acidizing measures.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The method for predicting the effects of acidification measures based on a multi-source feature fusion machine learning model includes the following steps: Step 1: Collect multi-source data required for the acidizing effect prediction method; the multi-source data includes well condition data, geological parameters, production dynamic data, and treatment data; Step 2: Clean, preprocess, and extract features from the multi-source data collected in Step 1; Step 3: Use an integrated feature selection model to select features from the multi-source data processed in Step 2; the integrated feature selection model is obtained by integrating the random forest feature importance method, the Pierman correlation analysis method, and the elastic network method. Step 4: Perform independence and representativeness verification on the feature parameters selected by the integrated feature screening model in Step 3; Step 5: The multi-source data verified in Step 4 are used to form a dataset, which is then split into a training set and a validation set; a prediction model for the effect of acidification measures based on LCE is constructed and trained and optimized. Step 6: Use particle swarm optimization to optimize the hyperparameters of the LCE-based acidification measure effect prediction model; Step 7: Evaluate the LCE-based acidification measure effect prediction model after optimizing hyperparameters in Step 6; after the model evaluation is passed, the acidification measure effect prediction model based on the multi-source feature fusion machine learning model is obtained.
[0008] Preferably, the process of cleaning multi-source data in step 2 can be specifically described as follows: A combination of deletion and imputation is used to handle missing values in multi-source data; The DBScan clustering algorithm is used to process outliers in multi-source data. Perform quantitative feature binarization on multi-source data.
[0009] Preferably, the process of handling missing values in multi-source data by combining deletion and padding can be specifically described as follows: Perform missing value detection on any single data point from a multi-source dataset; If the number of missing values exceeds a preset requirement, the entire data entry is deleted; otherwise, the random forest algorithm is used to predict the missing values, and the predicted values are used as the default correct values to fill the data entry.
[0010] Preferably, the preprocessing of multi-source data in step 2 can be specifically described as follows: Perform data category transformation on categorical data in multi-source data, and normalize data of different dimensions in multi-source data.
[0011] A preferred approach is to use Python to add numeric labels to each type of categorical data when performing data category transformation on categorical data from multiple sources. Furthermore, the process of normalizing data of different dimensions from multiple sources satisfies: In the formula, x nThe value is the normalized value, ranging from [-1, 1]; x min To increase the yield of the preprocessed measures, find the minimum value of each parameter in the dataset; x max To increase the maximum value of each parameter in the preprocessed measure dataset.
[0012] Preferably, the process of feature extraction from multi-source data in step 2 can be specifically described as follows: CNNs are used to extract features from image and sequence data from multiple sources, transforming them into one-dimensional feature vector data that can be processed by LCE.
[0013] Preferably, the integration process of the integrated feature filtering model in step 3 can be specifically described as follows: The importance of features for each method in the integrated feature selection model is normalized to obtain feature weights; the feature weights are used to reflect the proportion of the importance of the feature in the sum of the importance of all features. The feature weight y satisfies: Where y0 represents the importance of this feature, y min y represents the minimum importance among all features. max It represents the maximum importance among all features. After normalization, the feature weights of each method are weighted and fused to obtain the feature importance vector that integrates all features; The feature importance vector Y that integrates all features satisfies: Where, λ i Let y be the weight of the i-th method in the ensemble. i Let be the feature weights after normalization using the i-th method.
[0014] Preferably, in step 4, Spearman correlation analysis is used to verify the independence of the feature parameters selected by the integrated feature screening model; and ablation experiments are used to verify the representativeness of the feature parameters selected by the integrated feature screening model.
[0015] Preferably, step 6, which uses a particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidification measure effect prediction model, can be specifically described as follows: Select the hyperparameters to be tuned, initialize the particle swarm, and set the maximum number of iterations; Train the particle and calculate its fitness. If the entire particle swarm converges after a certain number of iterations, the hyperparameter values are their optimal values. If the entire particle swarm does not converge and the maximum number of iterations has not been reached, the process returns to the previous step to continue training. The optimal values of the hyperparameters in the LCE-based acidification measure effect prediction model were finally determined.
[0016] This invention provides a method for predicting the effectiveness of acidification measures based on a multi-source feature fusion machine learning model. The method includes the following steps: Step 1: Collecting multi-source data required for the acidification measure effectiveness prediction method; Step 2: Cleaning, preprocessing, and extracting features from the multi-source data collected in Step 1; Step 3: Using an integrated feature selection model to select features from the multi-source data processed in Step 2; Step 4: Performing independence and representativeness verification on the feature parameters selected by the integrated feature selection model in Step 3; Step 5: Forming a dataset from the multi-source data verified in Step 4, constructing an LCE-based acidification measure effectiveness prediction model, and training and optimizing it; Step 6: Using a particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidification measure effectiveness prediction model; Step 7: Evaluating the LCE-based acidification measure effectiveness prediction model after hyperparameter optimization in Step 6; After passing the model evaluation, the acidification measure effectiveness prediction model based on the multi-source feature fusion machine learning model is obtained. A method for predicting the effects of acidizing measures based on a multi-source feature fusion machine learning model, which has the above-mentioned steps, reveals the hidden factors affecting the effects of acidizing measures by analyzing various information such as geological data, historical production data, and real-time monitoring data. It can not only scientifically and accurately predict the effects of acidizing production enhancement measures, but also help technicians optimize production enhancement decisions, significantly improving the development efficiency and economic benefits of oilfields. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the following drawings: Figure 1 This is a flowchart illustrating a method for predicting the effects of acidification measures based on a multi-source feature fusion machine learning model, as provided by the present invention. Detailed Implementation
[0018] This invention provides a method for predicting the effects of acidizing measures based on a multi-source feature fusion machine learning model. This method selects features through an integrated feature screening model and uses a machine learning method that combines PSO and LCE models to achieve a scientific and accurate prediction of the production enhancement effect of oil well acidizing measures. Example 1
[0019] This invention provides a method for predicting the effects of acidification measures based on a multi-source feature fusion machine learning model, such as... Figure 1 As shown, it includes the following steps: Step 1: Collect multi-source data required for the acidizing effect prediction method. This multi-source data includes well condition data, geological parameters, production dynamic data, and treatment data.
[0020] It is worth noting that the multi-source data required for this acidizing effect prediction method is typically derived from historical data accumulated over many years in oil wells, as well as feasible historical data implicitly extracted from experience. Specifically, this includes well condition data, geological parameters, production dynamics data, and treatment data. Well condition data includes daily fluid production, water cut, cumulative fluid production, and cumulative oil production; geological parameters include porosity, permeability, effective thickness, and crude oil temperature; treatment data includes pump power, production days, discharge rate, and pump depth. Production dynamics data and treatment data include well number, daily oil production, cumulative oil production, type of treatment implemented, fluid production before and after treatment, and oil production. However, some of the above multi-source data, such as sequence data and image data, cannot be directly processed, therefore additional feature extraction is required.
[0021] Step 2: Clean, preprocess, and extract features from the multi-source data collected in Step 1.
[0022] Building upon step 1, proceed to step 2. It's important to note that the collected multi-source data may contain various issues, such as missing values, outliers, and duplicate values. To ensure the quality and accuracy of the multi-source data, data cleaning is necessary to address any problematic values.
[0023] In addition, for image data and sequence data in multi-source data that cannot be directly processed, preprocessing and feature extraction are required to extract features that are meaningful for modeling and analysis.
[0024] Step 3: Use an integrated feature selection model to select features from the multi-source data processed in Step 2; this integrated feature selection model is obtained by integrating the random forest feature importance method, the Pierman correlation analysis method, and the elastic network method.
[0025] Building upon step 2, proceed to step 3. It's important to note that even after processing the multi-source data in step 2, the dataset still contains a large number of features, many of which are irrelevant or have low correlation with the final prediction. Step 2 cannot eliminate these irrelevant features; therefore, feature filtering is necessary to select the most relevant and useful features. This will improve the model's performance and generalization ability in subsequent steps, reduce the risk of overfitting, and enhance the model's interpretability.
[0026] Step 4: Perform independence and representativeness verification on the feature parameters selected by the integrated feature screening model in Step 3.
[0027] Building upon step 3, proceed to step 4. It is worth noting that the feature parameters selected by the integrated feature selection model in step 3 may contain highly correlated or collinear features; these features can lead to overfitting of the final prediction model and reduce its generalization ability. Therefore, it is necessary to perform independence and representativeness verification on the feature parameters selected by the integrated feature selection model in step 3.
[0028] Independence verification identifies and excludes highly correlated features, improving the stability and performance of the final prediction model. It also reduces redundant features, enhancing the interpretability of the final model. Representativeness verification ensures that the selected feature parameters fully reflect the important information from the multi-source data, preserving key features while maintaining model performance. Furthermore, representativeness verification also contributes to improving model interpretability.
[0029] Step 5: The multi-source data verified in Step 4 are used to form a dataset, which is then split into a training set and a validation set; a prediction model for the effect of acidification measures based on LCE is constructed and trained and optimized.
[0030] Building upon step 4, step 5 is then implemented. It is worth noting that after the multi-source data validated in step 4 forms a dataset, it is further divided into a training set and a validation set in a 5:1 ratio. This dataset is then used as input to the LCE-based acidification measure effect prediction model, while the yield parameters (or yield increase parameters) after acidification measures are used as the output of the LCE-based acidification measure effect prediction model. Through training on the training set and validation on the validation set, the LCE-based acidification measure effect prediction model is constructed, and the training and optimization process of this prediction model is completed.
[0031] To facilitate understanding of the present invention by those skilled in the art, the LCE-based acidification effect prediction model is further described below: The bias-variance tradeoff defines the ability of a learning algorithm to generalize beyond the training set; high bias means the algorithm fails to capture the underlying structure of the training set (underfitting), while high variance means the algorithm learns too tightly from the training set (overfitting). Therefore, the goal of all training is to minimize bias and variance. Bagging plays a major role in reducing variance; it's a method that generates multiple versions of the predictor (bootstrap replicates) and uses them to obtain an aggregate predictor. The current state-of-the-art method for bagging is Random Forest. Boosting, on the other hand, primarily reduces bias by iteratively learning weak predictors and summing them to create a final strong predictor. The most advanced method currently used is XGBoost.
[0032] The LCE-based acidification measure effect prediction model incorporates the boosting-bagging method to address the bias-variance tradeoff faced by machine learning models, and it employs a divide-and-conquer approach to personalize the prediction error of different parts of the training data.
[0033] Specifically, the LCE-based acidification measure effect prediction model is based on cascaded generalization: it uses a set of predictors sequentially, adding new attributes to the input data at each stage. These new attributes come from the outputs of the predictors, called the base learners. LCE employs a divide-and-conquer strategy (decision tree) to apply cascaded generalization locally and reduces the bias of the decision tree by using boost-based predictors as base learners. LCE uses a state-of-the-art boosting algorithm (XGBoost) as the base learner. During tree generation, the output of the base learner at each decision node is added to the dataset as a new attribute to propagate boosting down the tree. The predicted output indicates the base learner's ability to correctly predict samples. At the next tree level, the output added to the dataset is used by the base learner as a weighting scheme, thus giving more attention to previously mispredicted samples. Finally, bagging is used to mitigate overfitting caused by the boosting tree. Bagging reduces variance by creating multiple predictor variables from random sampling and replacing the original dataset with a simple majority-vote aggregation tree. LCE stores the model generated by the base learners at each node.
[0034] Step 6: Use the particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidification measure effect prediction model.
[0035] Building upon step 5, proceed to step 6. It should be noted that when using the LCE-based acidizing effect prediction model, its default parameters may not meet the model's accuracy requirements. Therefore, before using the model, parameter tuning is necessary to find the best parameter combination for effect prediction. Parameter tuning methods include particle swarm optimization (PSO) and grid search, with grid search being a more common method. However, grid search has a significant drawback: it is very time-consuming; moreover, the large volume of oil well data further exacerbates this. Therefore, PSO is considered, as it requires fewer iterations and is faster. Taking all factors into account, PSO is chosen for this purpose.
[0036] Step 7: Evaluate the LCE-based acidification measure effect prediction model after optimizing hyperparameters in Step 6; after the model evaluation is passed, the acidification measure effect prediction model based on the multi-source feature fusion machine learning model is obtained.
[0037] Building upon step 6, step 7 is then implemented. Specifically, after particle swarm optimization in step 6, model evaluation is performed. This evaluation process uses four metrics: goodness of fit, mean squared error, mean absolute error, and interpretable variance. The formula for calculating goodness of fit satisfies: In the formula, R 2 For the goodness-of-fit calculation results, SS res SS represents the sum of squared residuals. tot This represents the total sum of squares of deviations.
[0038] The goodness of fit ranges from [0,1]; when the goodness of fit is 1, it means that the regression equation perfectly fits the data; when the goodness of fit is 0, it means that the regression equation cannot explain any variation in the data.
[0039] After the model evaluation is completed, the final acidification measure effect prediction model based on the multi-source feature fusion machine learning model is constructed.
[0040] This completes the entire process of the acidification measure effect prediction method based on a multi-source feature fusion machine learning model provided by this invention. Example 2
[0041] Example 2 includes all the technical features of Example 1. Example 2 further supplements step 2 as follows, please refer to the explanation below for details: As a preferred embodiment of the present invention, the process of cleaning multi-source data in step 2 can be specifically described as follows: A combination of deletion and padding is used to handle missing values in multi-source data.
[0042] The DBScan clustering algorithm is used to process outliers in multi-source data.
[0043] In addition, quantitative feature binarization processing is performed on multi-source data.
[0044] Missing values refer to the phenomenon that certain parameters in some data are missing. This type of missing data can cause errors in the model's prediction and even affect the prediction effect, thus making it unusable for the corresponding model. Here, the preferred method for handling missing values in multi-source data is as follows: perform missing value detection on any data point from the multi-source data; if the number of missing values exceeds a preset requirement (for example, for a certain data point, if there are more than 5 missing values), then delete the entire data point; otherwise, use the random forest algorithm to predict the missing values, and fill the missing values into the data point as the default correct values.
[0045] It should be added that the process of predicting missing values using the random forest algorithm can be described as follows: First, sort the number of missing values in each column and fill in the missing values from fewest to most; then, iteratively construct a new feature matrix and new labels. The new feature matrix does not need to be filled with features or the original labels, while the new labels need to be filled with features; fill the columns containing missing values in the new feature matrix with 0; define all existing values in the features that need to be filled as the Y training set, and define the non-existent values as the Y test set; define the records corresponding to the non-empty values of the features that need to be filled in the new feature matrix as the X training set, and define the records corresponding to the empty values as the X test set; finally, perform class instantiation, train the X training set and the Y training set, and predict the results in sequence. The predicted results are the predicted missing values, and the corresponding filling is performed.
[0046] Outliers refer to values in the original data that are inexplicable or significantly different from other values. They are often caused by errors in the collection, reading, and transmission processes. The DBScan clustering algorithm has high accuracy for low-dimensional data, therefore it is used to handle outliers in multi-source datasets. The core idea of the DBScan clustering algorithm is based on density. For example, the DBScan clustering algorithm can find all dense regions of sample points and treat these dense regions as clusters. The DBScan clustering algorithm includes two parameters: neighborhood radius R and minimum number of points (MinPoints), and three categories of points: core points, boundary points, and noise points. The DBScan clustering algorithm handles outliers in low-dimensional samples as follows: It finds the number of samples in the neighborhood of each sample; if the number is greater than or equal to MinPoints, the sample is a core point. It then finds samples that are directly reachable and density-reachable from each core sample, and these samples are also core samples, ignoring all non-core samples. If a non-core sample is within the neighborhood of a core sample, it is considered a boundary sample; otherwise, it is an outlier, and outliers are deleted.
[0047] Finally, the purpose of binarizing quantitative features is to classify them as good or bad, thereby eliminating redundant information. For example, a threshold can be set for the average daily increase in oil production or the percentage increase in oil production after acidizing measures. Data above this threshold are considered valid data, while data below this threshold indicates that the increase in oil production has not met the requirements and should be deleted.
[0048] Furthermore, as a preferred embodiment of the present invention, the preprocessing of multi-source data in step 2 can be specifically described as follows: performing data category conversion on categorical data in multi-source data, and normalizing data of different dimensions in multi-source data (it should be noted that the purpose of normalizing data of different dimensions in multi-source data is to improve the accuracy and efficiency of learning).
[0049] Specifically, when performing data category transformation on categorical data in multi-source datasets, Python is used to add numeric labels to each categorical data type. Furthermore, the process of normalizing data with different dimensions in multi-source datasets satisfies: In the formula, x n The value is the normalized value, ranging from [-1, 1]; x min To increase the yield of the preprocessed measures, find the minimum value of each parameter in the dataset; x max To increase the maximum value of each parameter in the preprocessed measure dataset.
[0050] Furthermore, as a preferred embodiment of the present invention, the process of feature extraction from multi-source data in step 2 can be specifically described as follows: using CNN, feature extraction is performed on image data and sequence data in multi-source data to transform them into one-dimensional feature vector data that can be processed by LCE.
[0051] Specifically, the main process of using CNNs to extract features from image and sequence data from multiple sources can be described as follows: First, after image data (such as production curve images) undergoes feature extraction by the CNN, it is typically transformed into a series of feature maps. These feature maps are the results of processing the original image through convolutional layers and activation functions; they capture key information in the image, such as edges, textures, and shapes. The dimensionality of the feature maps is usually smaller than that of the original image because pooling layers reduce its spatial resolution. These maps are highly abstract and typically no longer possess the intuitive visual features of the original image, but are transformed into a form that is easier for machines to process and understand. Then, a flattening layer is added at the end of the CNN to convert the network output into a one-dimensional feature vector (data), which can be processed in the LCE model. The output one-dimensional feature vector data contains all the important features extracted by the CNN from the image. Finally, these one-dimensional feature vectors are normalized.
[0052] The steps for processing sequence data using CNNs differ slightly from those for image data. The main difference is the use of one-dimensional convolutions (1D CNNs) instead of traditional two-dimensional convolutions. One-dimensional convolutional layers capture local features within the sequence, and activation functions (such as ReLU) are added to increase non-linearity, allowing the network to learn features more effectively. Then, one-dimensional pooling layers reduce the length of the sequence data while preserving important information. Finally, similar to image data processing, the data is flattened into a one-dimensional feature vector.
[0053] After processing the image and sequence data from the multi-source dataset using CNN, the dataset is transformed into a one-dimensional feature vector format that the LCE model can process. Example 3
[0054] Example 3 includes all the technical features of Example 1. Example 3 further supplements step 3 as follows, please refer to the explanation below for details: For step 3, the ensemble feature selection model is obtained by integrating the random forest feature importance method, the Pierman correlation analysis method, and the elastic network method. Here, we first introduce and explain the random forest feature importance method, the Pierman correlation analysis method, and the elastic network method (each method selects the top 10 feature parameters by importance) as follows: The Random Forest feature importance method: In a random forest model, each decision tree is built based on a different random subset of the data. The performance of these decision trees reflects the effectiveness of each feature. By analyzing the contribution of each feature to the model's predictive performance, the most important features can be determined.
[0055] Spearman correlation analysis: This non-parametric method calculates the rank correlation coefficient between a feature and the target variable. Unlike traditional Pearson correlation, Spearman correlation analysis does not assume that the data is linear or follows a specific distribution, thus it is applicable to a wider range of data.
[0056] Elastic Network Approach: Elastic networks are a regularized regression method that combines L1 (Lasso) and L2 (Ridge) regularization. It not only penalizes large coefficients in the model but also selects features, making it suitable for datasets with multicollinearity or where the number of features exceeds the number of samples. By adjusting the proportion of the regularization term, elastic networks can find a balance between feature selection and model complexity.
[0057] In summary, it can be observed that, theoretically, the feature parameters selected by the three methods are not the same, but they are not completely different either. Therefore, an ensemble method is needed to integrate the three methods. As a preferred embodiment of the present invention, the ensemble process of integrating the feature screening model in step 3 can be specifically described as follows: The importance of features for each method in the integrated feature selection model is normalized to obtain feature weights; the feature weights are used to reflect the proportion of the importance of the feature in the sum of the importance of all features. The feature weight y satisfies: Where y0 represents the importance of this feature, y min y represents the minimum importance among all features. max It represents the maximum importance among all features. After normalization, the feature weights of each method are weighted and fused to obtain the feature importance vector that integrates all features; The feature importance vector Y that integrates all features satisfies: Where, λ i Let y be the weight of the i-th method in the ensemble. i Let be the feature weights after normalization using the i-th method. Example 4
[0058] Example 4 includes all the technical features of Example 1. Example 4 further supplements step 4 as follows, please refer to the following explanation for details: On the one hand, as a preferred embodiment of the present invention, in step 4, the Spearman correlation analysis method is used to verify the independence of the feature parameters selected by the integrated feature screening model.
[0059] It should be noted that the process of verifying the independence of the feature parameters selected by the integrated feature screening model using the Spearman correlation analysis method can be described as follows: When the correlation between any two principal variables is weak, in a sense, any principal variable can independently describe a certain aspect of the dependent variable; in this case, the principal variables possess a certain degree of independence. Specifically, a threshold is set for the correlation coefficients between each pair of variables. Variables not exceeding the threshold indicate that the features are not correlated and can be retained. Variables exceeding the threshold are then deleted based on their importance in the ensemble model.
[0060] On the other hand, as a preferred embodiment of the present invention, in step 4, an ablation experiment is used to verify the representativeness of the feature parameters selected by the integrated feature screening model.
[0061] It is worth noting that after selecting features, all feature parameters are normalized, and the feature importance of the top 10 feature parameters is summed and compared with the sum of the average importance of the 10 features. If the sum of the former is greater than the latter, it can be simply stated that the 10 selected feature parameters meet the requirement of representativeness.
[0062] In this process, commonly used machine learning regression algorithms such as KNN, SVR, RandomForestRegressor, and XGBoost can be selected to evaluate the regression performance of the three feature selection methods and the ensemble model, using the regression metric MAE for evaluation. If the feature variables selected by the ensemble model show the best average performance for the regression model across all metrics, then the representativeness of the features selected by the ensemble model can be verified. Example 5
[0063] Example 5 includes all the technical features of Example 1. Example 5 further supplements step 6 as follows, please refer to the explanation below for details: In a preferred embodiment of the present invention, step 6, which uses a particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidization measure effect prediction model, can be specifically described as follows: Select the hyperparameters to be tuned, initialize the particle swarm, and set the maximum number of iterations; Train the particle and calculate its fitness. If the entire particle swarm converges after a certain number of iterations, the hyperparameter values are their optimal values. If the entire particle swarm does not converge and the maximum number of iterations has not been reached, the process returns to the previous step to continue training. The optimal values of the hyperparameters in the LCE-based acidification measure effect prediction model were finally determined. Example 6
[0064] To further assist those skilled in the art in understanding the present invention and to verify its feasibility and superiority, a set of specific embodiments are provided herein. Specifically, taking 26 oil wells in Shengli Oilfield as an example, the data analysis is carried out according to the steps recorded in Example 1 to demonstrate the prediction of the acidizing effect of the 26 oil wells.
[0065] Step 1: This embodiment collects multi-source data from 26 oil wells in Shengli Oilfield. The multi-source data from Shengli Oilfield includes geological parameters, well condition data, and intervention data. Among them, the geological parameters, well condition data, and intervention data include dozens of data such as the number of acidized layers, acidized thickness, acid type, pre-flush pump pressure, pre-flush volume, main acid formula, main acid pump pressure, porosity, oil saturation, permeability, oil layer thickness, and daily production curve data.
[0066] Step 2: Since the collected multi-source data is disorganized and the amount of data is relatively large, the multi-source data is cleaned, preprocessed and feature extracted.
[0067] Missing Value Handling: Missing values are likely to appear in the dataset. If a data point has many missing values, it is removed; if there are few missing values, the Random Forest algorithm is used to predict and fill in the missing values. The basic steps are as follows: First, import the Random Forest package (corresponding to the RandomForestRegressor class in sklearn), the Cross-Validation package (corresponding to the cross_val_score class in sklearn), and other necessary packages from the machine learning library sklearn. First, use the Python basic function np.argsort to sort the columns by the number of missing values, filling in the missing values from fewest to most. Then, use a for loop to construct a new feature matrix and new labels. The new feature matrix does not need to be filled with features or the original labels, but the new labels do need to be filled with features. Define fillc as the new labels (according to the index sequence in sortindex) and df as the new feature matrix, and convert it to DataForm data type. Use the SimpleImputer function in the new feature matrix to fill the columns containing missing values with 0. Finally, define all the values present in the features that need to be filled as the Y training set (represented by Ytrain), and define the values that do not exist as the Y test set (represented by Ytest). The records corresponding to the non-empty values of the features to be filled in the new feature matrix are defined as the X training set (denoted by Xtrain), and the records corresponding to the empty values are defined as the X test set (denoted by Xtest). Then, the RandomForestRegressor class is instantiated, and the fit function trains Xtrain and Ytrain, the predict function predicts the results, and so on. Finally, the predicted result Ypredict is returned to the original feature matrix. In the above process, fillc and df are custom functions, while the rest can be directly called from the sklearn library.
[0068] Outlier handling (DBScan mentioned above): Depending on the dimensionality of the collected historical data, choose either the DBScan clustering algorithm or the Isolation Forest algorithm to handle outliers. In Python, after importing the data, both methods can be directly called, with parameters fine-tuned. The Isolation Forest method is suitable for high-dimensional data, while the DBScan method is suitable for low-dimensional data.
[0069] Due to the large number of feature parameters, the Isolation Forest method was chosen for outlier handling. The specific steps are as follows: First, install the sklearn library (a Python-based machine learning library) and import the Isolation Forest package. Next, import the data, specifically the sample data from an Excel spreadsheet. Then, build the Isolation Forest model and set the model parameters: n_estimators = 100, max_samples = auto, contamination = float(0.1), max_features = 1.0. n_estimators represents the number of isolated trees (default 100); max_samples represents the number of samples to train each isolated tree; contamination represents the proportion of outliers in the dataset, used to define the threshold of the decision function (default 0.1); max_features represents the number of features used to train each isolated tree (default 1). The model is trained using the `fit` function. Then, the `decision_function` function from the sklearn library can be used to obtain an anomaly score, and the `predict` function can be used to determine whether the model is an anomaly. In this process, when analyzing a single feature, Isolation Forest analyzes all data anomalies under that feature and displays them as scores (1 for normal values, -1 for outliers). When analyzing all features, Isolation Forest combines all feature data, analyzes the anomalies of a specific data point under the combined analysis, and displays them as scores (1 for normal values, -1 for outliers). All of these functions can be directly called from the sklearn library.
[0070] Subsequently, the multi-source data underwent normalization, qualitative feature binarization, qualitative feature encoding, and dimensionless transformation. The daily production curve data from the collected multi-source data could not be directly input into the model training; therefore, a CNN was used for feature extraction. The main steps were: First, import the necessary libraries, including Keras and related deep learning libraries, as well as pandas and numpy for data processing. Then, import the curve data; the function `prepare_production_data` can obtain a curve graph from the data source. Next, the curve calculation function `calculate_slope` was used to calculate the slope of the production curve. Since the daily production curve represents daily production data from the three months prior to the measures, the slope of the curve effectively reflects the production situation before the measures. This function accepts the production values from a curve graph as input and returns the slope of that curve. Then, the `create_cnn_model` function was used to build the CNN model, and the model's structure and parameter settings were modified accordingly. Finally, the `compile_and_train_model` function was used to compile and train the model. Then, the feature extraction function `extract_slope_feature` is used to extract features from the curve graph from the trained CNN model. This function accepts the model and curve graph data as input and returns the extracted slope features. Finally, the `save_results` function is used to save the extracted slope features. Converting the production curve data into slope features can then be used as input to the LCE model, and the slope can effectively reflect the production status within the production curve.
[0071] Step 3: The collected multi-source data is extensive, with dozens of feature parameters, which is time-consuming and labor-intensive, hindering further analysis and modeling. Furthermore, many features are irrelevant or have low relevance to the final prediction. Therefore, feature filtering is necessary to select the most relevant and useful features from the original feature set, improving model performance and generalization ability, reducing the risk of overfitting, and enhancing model interpretability. First, feature filtering is performed using the three methods in the ensemble model, yielding the top 10 most important feature parameters for each method.
[0072] Spearman correlation analysis: production curve slope, porosity, permeability, pre-flush volume, acid type, acidizing thickness, number of acidizing layers, main acid formula, process name, and top depth of the construction well section. Random forest importance analysis: production curve slope, porosity, permeability, acid type, pre-treatment volume, main acid formulation, number of acidification layers, acidification thickness, main acid extrusion pump pressure, and process name.
[0073] Elastic network method: production curve slope, permeability, acid type, porosity, number of acidizing layers, main acid formula, pre-flush volume, top depth of the construction well section, acidizing thickness, and process name.
[0074] The feature parameters selected by the three methods show that the top three most important parameters remain largely unchanged, while the less important parameters exhibit significant differences. By integrating the different feature parameters selected by the three methods using a weighted fusion integrated feature selection model, the final integrated model feature importance vector is obtained. The top 10 are the most important feature parameters, namely: production curve slope, porosity, permeability, acid type, pre-flush volume, main acid formula, acidizing thickness, number of acidizing layers, top depth of the well section, and process name.
[0075] Step 4: Perform independence and representativeness verification on the multi-source data of the features selected by the integrated feature selection model.
[0076] Independence verification: Spearman correlation analysis was used to verify the independence of the top 10 important features selected by the ensemble model. The correlation analysis showed that the correlation coefficients between any two features were no greater than 0.3, with the highest being only 0.23. Therefore, these feature parameters can be considered independent.
[0077] Representativeness verification: The importance of all feature parameters (43 in total) was normalized, and the importance of the 10 feature parameters selected by the ensemble model was summed. The cumulative importance was 0.52, which is greater than the sum of the average importance of the 10 random feature parameters (0.23). The variables selected by the ensemble model were initially verified to meet the representativeness requirements.
[0078] Meanwhile, the regression performance of the three feature selection methods—KNN, SVR, RandomForestRegressor, and XGBoost—was evaluated using regression indices MAE and R². 2 An assessment will be conducted.
[0079] Table 1: Performance Comparison Experiment of Feature Selection Models (MAE Index) Table 2: Performance Comparison Experiment of Feature Selection Models (R) 2 index) Experimental comparisons reveal that, regardless of the MSE index or R... 2The regression model based on the 10 feature parameters selected by the ensemble screening model has the best average performance, which reflects the representativeness of the selected feature parameters and the effectiveness of the ensemble screening model we proposed.
[0080] Step 5: Split the validated multi-source data (dataset) into a training set and a validation set in a 5:1 ratio, and train the processed sample data training set using the LCE-based acidification measure effect prediction model.
[0081] The language used is Python. The specific steps of using the LCE-based acidification measure effect prediction model (hereinafter referred to as the LCE regression model) are as follows: First, import the necessary packages, including numpy, pandas, sklearn, and the LCE regression model package LCERegressor. Classes and functions will need to be imported from these packages later. Import the data from the multi-source dataset. Then, use the drop function to separate the independent variable X and the dependent variable y from the dataset. Next, use the train_test_split and sklearn.model_selection functions to set the test sample ratio to 0.17 and the random seed to 42 to split the data into training and test sets. Import the LCE model and set the hyperparameters, initially using the default hyperparameters: max_depth = 1, max_features = auto, n_estimators = 100, etc. Finally, use the LCERegressor model and the fit function to train the model, and define the prediction result of the X validation set as y_pred. Use the r2_score evaluation metric from sklearn.metrics to calculate the model's fit and evaluate its performance.
[0082] The LCE model test set r2_score using default parameters is 0.744, which does not meet our expected requirement of 0.8.
[0083] Step 6: In order to achieve the desired goodness of fit (r2_score) of 0.8 for the trained LCE regression model, the hyperparameters of the LCE model are optimized using the particle swarm optimization (PSO) algorithm.
[0084] The first step is to import the PSO-related libraries, then create the function `create_LCERegressor` to initialize the LCE model; next, define the fitness function `fitness_function` to evaluate the model's performance under given hyperparameters; then define `param_bounds` to set the hyperparameter range, which allows the PSO algorithm to select the most suitable hyperparameters for the LCE model within this range; finally, use the `pso` function to run the PSO algorithm, find the optimal hyperparameters, use the optimal hyperparameter combination, and evaluate the model.
[0085] Step 7: Finally, the optimal hyperparameter combination LCE model is used to predict the effect of the measures on the test set. The calculated r2_score (goodness of fit) is 0.82, which meets the prediction requirements. Finally, the model is saved for subsequent predictions.
[0086] This invention provides a method for predicting the effectiveness of acidification measures based on a multi-source feature fusion machine learning model. The method includes the following steps: Step 1: Collecting multi-source data required for the acidification measure effectiveness prediction method; Step 2: Cleaning, preprocessing, and extracting features from the multi-source data collected in Step 1; Step 3: Using an integrated feature selection model to select features from the multi-source data processed in Step 2; Step 4: Performing independence and representativeness verification on the feature parameters selected by the integrated feature selection model in Step 3; Step 5: Forming a dataset from the multi-source data verified in Step 4, constructing an LCE-based acidification measure effectiveness prediction model, and training and optimizing it; Step 6: Using a particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidification measure effectiveness prediction model; Step 7: Evaluating the LCE-based acidification measure effectiveness prediction model after hyperparameter optimization in Step 6; After passing the model evaluation, the acidification measure effectiveness prediction model based on the multi-source feature fusion machine learning model is obtained. A method for predicting the effects of acidizing measures based on a multi-source feature fusion machine learning model, which has the above-mentioned steps, reveals the hidden factors affecting the effects of acidizing measures by analyzing various information such as geological data, historical production data, and real-time monitoring data. It can not only scientifically and accurately predict the effects of acidizing production enhancement measures, but also help technicians optimize production enhancement decisions, significantly improving the development efficiency and economic benefits of oilfields.
[0087] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for predicting the effects of acidification measures based on a multi-source feature fusion machine learning model, characterized in that, The steps include the following: Step 1: Collect multi-source data required for the acidizing effect prediction method; the multi-source data includes well condition data, geological parameters, production dynamic data, and treatment data; Step 2: Clean, preprocess, and extract features from the multi-source data collected in Step 1; Step 3: Use an integrated feature selection model to select features from the multi-source data processed in Step 2; the integrated feature selection model is obtained by integrating the random forest feature importance method, the Pierman correlation analysis method, and the elastic network method. Step 4: Perform independence and representativeness verification on the feature parameters selected by the integrated feature screening model in Step 3; Step 5: The multi-source data verified in Step 4 are used to form a dataset, which is then split into a training set and a validation set; a prediction model for the effect of acidification measures based on LCE is constructed and trained and optimized. Step 6: Use particle swarm optimization to optimize the hyperparameters of the LCE-based acidification measure effect prediction model; Step 7: Evaluate the LCE-based acidification measure effect prediction model after optimizing hyperparameters in Step 6; after the model evaluation is passed, the acidification measure effect prediction model based on the multi-source feature fusion machine learning model is obtained.
2. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, The process of cleaning multi-source data in step 2 can be specifically described as follows: A combination of deletion and imputation is used to handle missing values in multi-source data; The DBScan clustering algorithm is used to process outliers in multi-source data. Perform quantitative feature binarization on multi-source data.
3. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 2, characterized in that, The process of handling missing values in multi-source data by combining deletion and padding can be specifically described as follows: Perform missing value detection on any single data point from a multi-source dataset; If the number of missing values exceeds a preset requirement, the entire data entry is deleted; otherwise, the random forest algorithm is used to predict the missing values, and the predicted values are used as the default correct values to fill the data entry.
4. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, The preprocessing of multi-source data in step 2 can be specifically described as follows: Perform data category transformation on categorical data in multi-source data, and normalize data of different dimensions in multi-source data.
5. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 4, characterized in that, When performing data category transformation on categorical data in multi-source datasets, Python is used to add numeric labels to each type of categorical data. Furthermore, the process of normalizing data of different dimensions from multiple sources satisfies: ; In the formula, The value is the normalized value, and its range is between [-1, 1]. To increase the yield of the preprocessed measures by minimizing the value of each parameter in the dataset; To increase the maximum value of each parameter in the preprocessed measure dataset.
6. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, The process of feature extraction from multi-source data in step 2 can be specifically described as follows: CNNs are used to extract features from image and sequence data from multiple sources, transforming them into one-dimensional feature vector data that can be processed by LCE.
7. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, The integration process of the integrated feature filtering model in step 3 can be specifically described as follows: The importance of features for each method in the integrated feature selection model is normalized to obtain feature weights; the feature weights are used to reflect the proportion of the importance of the feature in the sum of the importance of all features. The feature weights ,satisfy: ; in, Given the importance of this feature, It represents the minimum importance among all features. It represents the maximum importance among all features. After normalization, the feature weights of each method are weighted and fused to obtain the feature importance vector that integrates all features; The feature importance vector that integrates all features ,satisfy: ; in, For the first The weight of each method in the integration process. For the first The feature weights are normalized by one method.
8. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, In step 4, Spearman correlation analysis is used to verify the independence of the feature parameters selected by the integrated feature screening model; ablation experiments are used to verify the representativeness of the feature parameters selected by the integrated feature screening model.
9. The method for predicting the effect of acidification measures based on a multi-source feature fusion machine learning model according to claim 1, characterized in that, Step 6, which uses the particle swarm optimization algorithm to optimize the hyperparameters of the LCE-based acidification measure effect prediction model, can be specifically described as follows: Select the hyperparameters to be tuned, initialize the particle swarm, and set the maximum number of iterations; Train the particle and calculate its fitness. When the iteration reaches a certain number of times, if the entire particle swarm converges, the value of the hyperparameters at this time is their optimal value; if the entire particle swarm does not converge and the maximum number of iterations has not been reached, the previous step is returned to continue training. The optimal values of the hyperparameters in the LCE-based acidification measure effect prediction model were finally determined.