A wellbore loss analysis method, system, and medium based on explainable machine learning

By using an interpretability-based machine learning approach, combining Gaussian clustering and XGBoost algorithms with SHAP values ​​to analyze well leakage, the problems of poor interpretability and modeling difficulties in well leakage analysis are solved, enabling fast and accurate well leakage type identification and cause analysis.

CN116127320BActive Publication Date: 2026-02-03CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310105857.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-02-03
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

Existing technologies for well leakage analysis suffer from poor interpretability, low analysis efficiency, and poor timeliness, making it impossible to accurately and promptly determine the type and cause of leakage. Furthermore, traditional methods are difficult to model and costly.

Method used

An interpretable machine learning approach is adopted, which uses a Gaussian clustering model to determine the type of well leakage, constructs a training set based on the features of the well leakage dataset, trains the model using the XGBoost algorithm, and analyzes the model using SHAP values ​​to obtain the cause of well leakage.

Benefits of technology

It enables reasonable and reliable analysis of multidimensional leakage factors, supports rapid identification of well leakage types, and provides leakage prevention and plugging measures, overcoming the problems of poor interpretability and high modeling difficulty of conventional machine learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127320B_ABST
    Figure CN116127320B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of intelligent oil and gas field development, and relates to a well leakage analysis method, system and medium based on explainable machine learning, which comprises the following steps: collecting well leakage data and establishing a well leakage data set; determining a well leakage type through a Gaussian clustering model according to the data in the well leakage data set; constructing a training set and a test set according to the data in the well leakage data set and a well leakage type judgment model; constructing a model for real-time judgment of the well leakage type, training the model through the data in the training set, and verifying the model through the data in the test set; and analyzing the trained model for real-time judgment of the well leakage type through an explainable machine learning algorithm based on SHAP values to obtain the well leakage cause. The present application breaks through the technical bottleneck of poor explainability of conventional machine learning methods, and truly realizes reasonable and reliable analysis of a large number of multi-dimensional leakage factors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a well leakage analysis method, system, and medium based on interpretable machine learning, belonging to the technical field of intelligent oil and gas field development. Background Technology

[0002] Loss is one of the most serious problems in the drilling process. Loss refers to the phenomenon where drilling fluid flows into the formation from the wellbore, and the fluid returning to the wellbore is less than what is pumped into the well. Loss often leads to accidents such as stuck pipe, blowouts, and well collapse, reduces the wellbore's cleanliness, increases drilling cycles and costs, and seriously hinders the development of the oil and gas industry.

[0003] Well leakage can be classified into porosity leakage, cavernous leakage, natural fracture leakage, and induced leakage based on its mechanism. Currently, the determination of leakage type is achieved using comprehensive data analysis, which mainly relies on a large amount of detailed geological data such as fracture data, lithological data, and formation pressure data. While the comprehensive data analysis method is highly accurate, it also has some drawbacks: it lacks a specific implementation procedure, relying solely on the subjective experience of experts, making it suitable for limited leakage data and unsuitable for large-scale application and promotion; the required geological data is often incomplete (e.g., many well sections lack formation microresistivity scanning imaging (FMI) fracture imaging logging data), leading to difficulties or even inability to analyze; and the analysis is time-consuming and inefficient, failing to quickly determine the leakage type after it occurs.

[0004] Currently, research on the influencing factors and causes of well leakage is mainly based on mathematical models or physical experimental methods. Due to the numerous factors involved in leakage, their different dimensions, and the complex coupling relationships between these factors, mathematical modeling is difficult and the analysis is limited. Physical experimental methods can best reproduce the actual leakage situation and are the most reliable and accurate research methods, but they have drawbacks such as operational difficulties, long processing times, and high costs.

[0005] In recent years, with the advancement of artificial intelligence technology, research on well leakage based on statistical or machine learning models has gradually developed, especially in predicting leakage risk, leakage rate, and leakage volume, achieving significant progress. However, it lacks specific analysis of leakage factors and causes. Although machine learning analysis methods for well leakage can uncover more information, they cannot accurately interpret the results from complex black-box models and cannot guide the analysis of well leakage types and mechanisms. Summary of the Invention

[0006] To address the aforementioned problems, the present invention aims to provide a well leakage analysis method, system, and medium based on interpretable machine learning, which overcomes the technical bottleneck of poor interpretability in conventional machine learning methods and truly achieves reasonable and reliable analysis of a large number of multidimensional leakage factors.

[0007] To achieve the above objectives, the present invention proposes the following technical solution: a well leakage analysis method based on interpretable machine learning, comprising: collecting well leakage data and establishing a well leakage dataset; determining the well leakage type using a Gaussian clustering model based on the data in the well leakage dataset; constructing a training set and a test set based on the data in the well leakage dataset and the well leakage type determination model; training the real-time well leakage type determination model using the data in the training set, and validating the model using the data in the test set; and analyzing the trained real-time well leakage type determination model using an interpretable machine learning algorithm based on SHAP values ​​(SHAP value is an abbreviation for Shapley value) to obtain the cause of the well leakage.

[0008] Furthermore, the method for collecting well leakage data and establishing a well leakage dataset is as follows: collecting leakage data based on logging data, well logging data, and daily drilling reports; classifying the leakage data and establishing a well leakage dataset; preprocessing the data in the well leakage dataset; and encoding the preprocessed data according to the type of leakage data.

[0009] Furthermore, the types of lost data include lost data characterization features, drilling fluid features, and operable drilling parameters; the lost data characterization features are used to determine the type of well leakage using a Gaussian clustering model; the drilling fluid features and operable drilling parameters are used to construct training and testing sets with the well leakage type determination model.

[0010] Furthermore, the leakage characterization features include leakage amount, leakage rate, and leakage-to-discharge ratio; the drilling fluid characteristics include density difference, formation fracture pressure, plastic viscosity, dynamic shear force, final shear force, initial shear force, flowability index, consistency coefficient, and drilling fluid type; the operable drilling parameters include pump pressure and discharge rate.

[0011] Furthermore, the method for determining well leakage type using a Gaussian clustering model is as follows: Gaussian distribution models for the leakage amount, leakage rate, and leakage-to-drain ratio are calculated using a Gaussian clustering model; the Gaussian distribution models for the leakage amount, leakage rate, and leakage-to-drain ratio are multiplied by the weights of each feature and summed to obtain the probability density function of the hybrid model; based on the probability density function of the hybrid model, the BIC (Bayesian Information Criterion) value of the hybrid model is calculated to determine the optimal number of clusters; based on the optimal number of clusters, the distribution pattern is observed through the spatial graph of the hybrid model.

[0012] Furthermore, the spatial map observer distribution pattern obtained through the hybrid model includes: drawing a spatial distribution map based on the leakage characteristics of each class, and statistically analyzing the average leakage amount, leakage rate, leakage-to-discharge ratio, and density difference of each type obtained from clustering; combining the leakage patterns of actual well leakage types, and corresponding the clustering results with the actual well leakage types; and determining the type corresponding to each well leakage event in the well leakage dataset based on the correspondence between the clustering results and the actual well leakage types.

[0013] Furthermore, the method for training the model using the data in the training set is as follows: a model for real-time well leakage detection is constructed based on the XGBoost (eXtreme Gradient Boosting) algorithm; the model is trained using the data in the training set, and the optimal model is obtained through different adjustments and optimizations; the precision, recall, and F1-Score of the optimal model are calculated to evaluate the performance of the model.

[0014] Furthermore, the method for analyzing the trained real-time well leakage type identification model using an interpretability machine learning algorithm based on SHAP values ​​is as follows: calculate the SHAP values ​​of each feature parameter of the real-time well leakage type identification model, and perform linear interpretation of the sample results using the SHAP values; rank the features according to the importance of the SHAP values; plot and analyze the SHAP value variation patterns of each highly important feature parameter; and analyze the leakage factors and causes based on the SHAP value variation patterns and the actual well leakage type.

[0015] On the other hand, this invention also discloses a well leakage analysis system based on interpretable machine learning, comprising: a data acquisition module for collecting well leakage data and establishing a well leakage dataset; a Gaussian clustering module for determining the well leakage type using a Gaussian clustering model based on the data in the well leakage dataset; a test set partitioning module for constructing a training set and a test set based on the data in the well leakage dataset and the well leakage type determination model; a model training module for constructing a real-time well leakage type determination model, training the model using data in the training set, and validating the model using data in the test set; and a model parsing module for parsing the trained real-time well leakage type determination model using an interpretable machine learning algorithm based on SHAP values ​​to obtain the cause of the well leakage.

[0016] On the other hand, the present invention also discloses a computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the well leakage analysis method based on interpretable machine learning according to any of the preceding claims.

[0017] The present invention has the following advantages due to the adoption of the above technical solutions:

[0018] 1. This invention implements a complete method for identifying leakage types, which can not only identify regional leakage cases so that technicians can understand the regional leakage situation, but also support the timely identification of well leakage types using real-time leakage data so that technicians can quickly formulate leakage prevention and plugging measures.

[0019] 2. This invention provides a complete method for analyzing omission factors and causes, which not only breaks through the problems of limited fitting features and high modeling difficulty in traditional physical modeling methods, but also overcomes the technical bottleneck of poor interpretability in conventional machine learning methods, and truly realizes reasonable and reliable analysis of a large number of multidimensional omission factors. Attached Figure Description

[0020] Figure 1 This is a flowchart of a well leakage analysis method based on interpretable machine learning in one embodiment of the present invention;

[0021] Figure 2 This is a BIC evaluation graph of a Gaussian clustering model in one embodiment of the present invention;

[0022] Figure 3 This is a spatial graph of a Gaussian clustering model in one embodiment of the present invention;

[0023] Figure 4 This is a feature importance ranking graph based on SHAP values ​​in one embodiment of the present invention;

[0024] Figure 5 This is a distribution pattern exploration diagram obtained by plotting each feature parameter individually in one embodiment of the present invention. Figure 5 (a) is induced crack-type leakage; Figure 5 (b) is leakage caused by crack propagation and extension; Figure 5 (c) is a large-slit type of leakage;

[0025] Figure 6 This is an FMI crack imaging image from one embodiment of the present invention; Figure 6 (a) is the K1bs1 stratum; Figure 6 (b) is the K1bs2 stratum; Figure 6 (c) is the K1bs3 stratum. Detailed Implementation

[0026] To enable those skilled in the art to better understand the technical direction of the present invention, the present invention is described in detail through specific embodiments. However, it should be understood that the specific embodiments are provided only for a better understanding of the present invention and should not be construed as limiting the present invention. In the description of the present invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0027] To address the limitations of existing machine learning methods for predicting well leakage, which only predict parameters such as leakage risk, leakage rate, and leakage amount, while lacking research on the mechanisms of well leakage and prevention methods, resulting in a black-box-like prediction process that fails to fundamentally solve the problem, this invention proposes a well leakage analysis method, system, and medium based on interpretable machine learning. It uses a Gaussian clustering model to determine the type of well leakage, combines this with features from the well leakage dataset to generate a training set, trains the model for real-time well leakage type determination using this training set, and then analyzes the trained model using SHAP values ​​to obtain the causes of well leakage. This overcomes the technical bottleneck of poor interpretability in conventional machine learning methods, truly achieving reasonable and reliable analysis of a large number of multidimensional leakage factors.

[0028] Example 1

[0029] This embodiment discloses a well leakage analysis method based on interpretable machine learning, such as... Figure 1 As shown, it includes:

[0030] S1 collects well leakage data and establishes a well leakage dataset;

[0031] The method for collecting well leakage data and establishing a well leakage dataset is as follows:

[0032] S1.1 Loss data is collected based on logging data, well logging data, and drilling daily reports. In this embodiment, 296 loss data points are collected based on logging data, well logging data, and drilling daily reports. Analytical features related to well loss events are collected, and new features are created. These new features include: loss-to-discharge ratio and density difference. The loss-to-discharge ratio is the ratio of loss rate to discharge rate, and the density difference is the difference between drilling fluid density and formation fracture pressure.

[0033] S1.2 Classifies the lost data and establishes a well lost data dataset. The types of lost data include lost data characterization features, drilling fluid features, and operable drilling parameters. Training and test sets are constructed. Loss characterization features include lost volume, lost velocity, and lost-to-displacement ratio. Drilling fluid features include density difference, formation fracture pressure, plastic viscosity, dynamic shear force, final shear force, initial shear force, flow index, consistency coefficient, and drilling fluid type. Operable drilling parameters include pump pressure and displacement.

[0034] S1.3 preprocesses the centralized data of the well leakage data, including but not limited to outlier handling and normalization.

[0035] In this embodiment, the 3σ principle is used to process outlier detection, and its calculation formula is as follows:

[0036] P(|xu|>3σ)<=0.003

[0037] Where P is the interval numerical distribution probability, x is the sample value, u is the mean, and σ is the standard deviation.

[0038] The formula for calculating the maximum and minimum normalization is:

[0039]

[0040] Where, x * It is the standard value, x min It is the minimum value of the sample data, x max It is the maximum value of the sample data.

[0041] S1.4 Encodes the preprocessed data according to the type of missing data.

[0042] The LaberEncoder is used to encode the preprocessed data according to the type of missing data, such as classification features like formation and drilling fluid type.

[0043] In terms of strata, E 1-2 km 1~5 Encoded as 1 to 5, K1bs 1~3 Encode it as 6 to 8.

[0044] For drilling fluid type, water-based drilling fluid is coded as 0, and oil-based drilling fluid is coded as 1.

[0045] S2 determines the type of well leakage by using a Gaussian clustering model based on the centralized data in the well leakage dataset.

[0046] In this step, the well leakage dataset focuses on leakage characteristics.

[0047] The method for determining well leakage type using Gaussian clustering model is as follows:

[0048] S2.1 Calculates the Gaussian distribution models for leakage amount, leakage rate, and leakage-to-discharge ratio using a Gaussian clustering model. The calculation formulas are as follows:

[0049]

[0050] Where X is the sample value, μ is the model expectation, ∑ is the model variance, and D is the dimension of the sample data.

[0051] S2.2 Multiply the Gaussian distribution model of leakage amount, leakage rate and leakage ratio by the weights of each feature and add them together to obtain the probability density function of the mixture model;

[0052]

[0053] Where, π k It is the mixture probability, μ k It is the average of the k-th class of sample data, ∑k Let be the covariance of the k-th class of sample data, then the probability density function of the Gaussian mixture model is:

[0054]

[0055] Among them, f k Let θ represent the distribution density of class & of the mixture components. k In the formula, all unknown parameters are denoted as Θ={(π k θ k For any k = 1, ..., K, 0 ≤ π k ≤1 and

[0056] S2.3 Calculate the BIC value of the mixture model based on the probability density function of the mixture model to determine the optimal number of clusters; based on the optimal number of clusters, observe the distribution pattern through the spatial graph of the mixture model.

[0057] Calculate the likelihood function of the model using the probability density function:

[0058]

[0059] Calculate the BIC value of the model to determine the optimal number of clusters:

[0060]

[0061] Where k is the number of clusters and n is the sample size. It is the likelihood function. Based on the optimal cluster number, the current well leakage dataset is divided into 3 classes, and the classification results are as follows: Figure 2 As shown.

[0062] The spatial graph observer distribution patterns identified through the hybrid model include:

[0063] Based on the leakage characteristics of each category, a spatial distribution map is drawn, as shown in the figure below. Figure 3 As shown. Observe the classification effect and statistically analyze the average leakage amount, leakage rate, leakage ratio, and density difference of each type obtained from clustering;

[0064] Based on the leakage patterns of actual well leakage types, which include, but are not limited to, induced fracture well leakage, fracture propagation well leakage, and large and medium fracture well leakage, the clustering results are correlated with the above actual well leakage types.

[0065] Based on the correspondence between the clustering results and the actual well leakage types, the type corresponding to each well leakage event in the well leakage dataset is determined.

[0066] S3 constructs training and testing sets based on the well leakage dataset and the well leakage type judgment model.

[0067] The well leakage dataset here contains drilling fluid characteristics and operable drilling parameters, which are used in a well leakage type determination model. The extracted dataset is randomly divided into training and test sets in a 4:1 ratio.

[0068] S4 constructs a model for real-time well leakage detection, trains the model using data from the training set, and validates the model using data from the test set.

[0069] The method for training a model using data from a training set is as follows:

[0070] S4.1 A model for real-time well leakage detection is built based on the XGBoost algorithm;

[0071] S4.2 The model for real-time well leakage identification is trained using data from the training set. Through different adjustments and optimizations, the hyperparameters of the model are tuned to obtain the model with the best performance.

[0072] The model for real-time well leakage detection was continuously adjusted and optimized. Finally, the optimal performance was obtained by setting learning_rate=0.3, max_depth=6, and n_estimators=100.

[0073] S4.3 calculates the precision, recall, and F1-Score of the best-performing model to evaluate its performance.

[0074] The classification results are usually of four types: TP means that the true value is Positive and the predicted value is Positive, that is, a true positive example; FP means that the true value is Negative and the predicted value is Positive, that is, a false positive example; FN means that the true value is Positive and the predicted value is Negative, that is, a false negative example; TN means that the true value is Negative and the predicted value is Negative, that is, a true negative example.

[0075] Precision refers to the number of correctly predicted positive samples, and its calculation formula is:

[0076]

[0077] Recall rate refers to the percentage of positive samples that a classifier model can correctly predict. Its calculation formula is:

[0078]

[0079] The F1 score is the harmonic ratio of precision to recall, and its calculation formula is as follows:

[0080]

[0081] The evaluation results are shown in Table 1. Except for the precision of the second class, the precision, recall, and F1-score values ​​in Table 1 are all above 85%. This indicates that the XGBoost model has good discriminative performance and can accurately determine the type of leakage by utilizing relevant leakage impact features, providing guidance for the formulation of leakage prevention and mitigation solutions. It also demonstrates that a good mapping relationship can be established between various influencing factors and leakage types, proving that subsequent interpretable machine learning algorithms based on SHAP values ​​to analyze leakage factors and causes are credible and reasonable.

[0082] Table 1 Evaluation results of the optimal real-time well leakage detection model

[0083] type accuracy Recall rate F1 score Category 1 0.97 0.91 0.94 Category 2 0.77 0.95 0.85 Category 3 1.00 0.84 0.91

[0084] S5 uses an interpretable machine learning algorithm based on SHAP values ​​to analyze the trained real-time well leakage type identification model and obtain the cause of the well leakage.

[0085] The method for parsing the trained real-time well leakage type identification model using an interpretable machine learning algorithm based on SHAP values ​​is as follows:

[0086] S5.1 Calculate the SHAP values ​​of each characteristic parameter of the model for real-time well leakage identification, and interpret the SHAP values ​​linearly to the sample results;

[0087] The formula for calculating the SHAP value of each feature parameter is as follows:

[0088]

[0089] Where, φ j (val) represents the SHAP value of the j-th feature, p is the number of features, val(S) is the value function, and S is a subset of the feature set.

[0090] The formula for calculating linear (additive) analyticity is:

[0091]

[0092] in, It is the model prediction value for sample i. SHAP(X) is the average prediction of all samples. ji ) is the SHAP value of the j-th feature of sample i, representing the marginal contribution of the feature to the prediction.

[0093] S5.2 The features were ranked according to the importance of their SHAP values, and the results are as follows: Figure 4As shown, it can be seen that the fracture pressure difference, displacement, well depth, and formation are the most important influencing characteristics of the three types of well leakage. Among them, the fracture pressure difference and displacement are the key parameters that determine the ECD value, while the formation and well depth are the key parameters that determine the geological characteristics. This confirms that the combined effect of geological characteristics and ECD induces well leakage.

[0094] S5.3 For each highly important feature parameter, plotted and analyzed the variation pattern of its SHAP value, the results are as follows: Figure 5 As shown, the influence of geological features on well leakage is analyzed.

[0095] S5.4 Based on the variation pattern of its SHAP value, combined with the actual well leakage type, real geological conditions and field data, analyze the leakage factors and causes.

[0096] For induced crack-type leakage, the leakage risk distribution is in E 1-2 km 1 E 1-2 km 2 E 1-2 km 3 E 1-2 km 4 K1bs3 layer (SHAP values ​​are mostly distributed above the 0 line), especially K1bs 3 The risk is highest (SHAP value reaches its maximum). For crack propagation leakage, the leakage risk is distributed in the E1-2km range. 5 K1bs 1 and K1bs 2 Layer (SHAP value is generally above 0). For large mid-slit type leakage, the leakage risk is mainly in E. 1-2 km 4 E 1-2 km 5 Layers K1bs1, K1bs2, and K1bs3 (SHAP values ​​are mostly above 0).

[0097] The above-mentioned patterns are mainly caused by geological influences within the strata, especially weak strata and the development of fractures.

[0098] For E 1-2 For the km layer, the weak strata appear in E 1-2 km 2 and E 1-2 km 4 In order to control the creep of salt gypsum and soft mudstone and prevent high-pressure brine overflow, high-density drilling fluid is used for drilling. When the ECD of the drilling fluid exceeds the fracture pressure coefficient of the weak salt layer, it will cause the formation of the well section to break and form induced fracture-type well leakage.

[0099] For the K1bs layer, FMI imaging logging data, such as Figure 6 This indicates that in K1bs 1 and K1bs 2 The formation contains numerous open fractures, making it prone to fracture propagation-type and large-to-medium fracture-type losses during drilling. K1bs 3 The formation is dominated by closed fractures and has a high formation pressure coefficient, making it prone to induced fracture loss when drilling with high-density drilling fluid.

[0100] Example 2

[0101] Based on the same inventive concept, this embodiment discloses a well leakage analysis system based on interpretable machine learning, including:

[0102] The data acquisition module is used to collect well leakage data and build a well leakage dataset.

[0103] The Gaussian clustering module is used to determine the type of well leakage based on the concentrated data in the well leakage dataset using a Gaussian clustering model.

[0104] The test set partitioning module is used to determine the model based on the data in the well leakage dataset and the type of well leakage, and to build training and test sets.

[0105] The model training module is used to build a model for real-time well leakage detection. The model is trained using data from the training set and validated using data from the test set.

[0106] The model parsing module is used to parse the trained real-time well leakage type identification model using an interpretable machine learning algorithm based on SHAP values, and to obtain the cause of the well leakage.

[0107] Example 3

[0108] Based on the same inventive concept, this embodiment discloses a computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions that, when executed by a computing device, cause the computing device to perform a well leakage analysis method based on interpretable machine learning according to any of the above.

[0109] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0110] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0111] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific embodiments of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention. The above content is only a specific embodiment of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A well leakage analysis method based on interpretable machine learning, characterized in that, include: Collect well leakage data and establish a well leakage dataset; Based on the centralized data of the well leakage dataset, the type of well leakage is determined using a Gaussian clustering model; Based on the centralized data of the well leakage dataset and the well leakage type judgment model, a training set and a test set are constructed. The model for real-time well leakage identification is trained using the data in the training set, and the model is validated using the data in the test set. The trained real-time well leakage type identification model is analyzed using an interpretable machine learning algorithm based on SHAP values ​​to obtain the cause of well leakage; The method for collecting well leakage data and establishing a well leakage dataset is as follows: Loss data are collected based on logging data, well logging data, and daily drilling reports; The types of leakage data include leakage characterization features, drilling fluid characteristics, and operable drilling parameters; The leakage characteristics include leakage amount, leakage rate, and leakage-to-discharge ratio; The method for determining well leakage type using a Gaussian clustering model is as follows: The Gaussian distribution models for the leakage amount, leakage rate, and leakage ratio were calculated using Gaussian clustering models. The probability density function of the hybrid model is obtained by multiplying the Gaussian distribution model of the leakage amount, leakage rate and leakage ratio by the weight of each feature and summing them. Based on the probability density function of the hybrid model, the BIC value of the hybrid model is calculated to determine the optimal number of clusters; Based on the optimal number of clusters, the distribution pattern is observed through the spatial graph of the hybrid model; The distribution patterns of spatial map observers through the hybrid model include: Based on the leakage characteristics of each category, draw a spatial distribution map and statistically analyze the average leakage amount, leakage rate, leakage-to-discharge ratio and density difference of each category obtained by clustering. Based on the leakage patterns of actual well leakage types, the clustering results are correlated with the actual well leakage types; Based on the correspondence between the clustering results and the actual well leakage types, the type corresponding to each well leakage event in the well leakage dataset is determined.

2. The well leakage analysis method based on interpretable machine learning as described in claim 1, characterized in that, The lost data is classified and a well leakage dataset is established; The centralized data of the well leakage dataset is preprocessed; The preprocessed data is encoded based on the type of missing data.

3. The well leakage analysis method based on interpretable machine learning as described in claim 2, characterized in that, The leakage characterization features are used to determine the well leakage type using a Gaussian clustering model; the drilling fluid features and operable drilling parameters are used to construct training and testing sets with the well leakage type determination model.

4. The well leakage analysis method based on interpretable machine learning as described in claim 3, characterized in that, The drilling fluid characteristics include density difference, formation fracture pressure, plastic viscosity, dynamic shear force, final shear force, initial shear force, flowability index, consistency coefficient, and drilling fluid type; the operable drilling parameters include pump pressure and flow rate.

5. The well leakage analysis method based on interpretable machine learning as described in any one of claims 1-4, characterized in that, The method for training the model using the data in the training set is as follows: A model for real-time well leakage detection based on the XGBoost algorithm was constructed. The model is trained using the data in the training set, and the optimal model is obtained through different adjustments and optimizations. The precision, recall, and F1-Score of the best-performing model are calculated to evaluate the model's performance.

6. The well leakage analysis method based on interpretable machine learning as described in any one of claims 1-4, characterized in that, The method for parsing the trained real-time well leakage type identification model using an interpretable machine learning algorithm based on SHAP values ​​is as follows: Calculate the SHAP values ​​of each characteristic parameter of the model for real-time well leakage identification, and interpret the SHAP values ​​linearly for the sample results; The features are ranked according to the importance of their impact on the SHAP values. For each highly important feature parameter, plot and analyze the variation pattern of its SHAP value; Based on the variation pattern of its SHAP value and combined with the actual well leakage type, the leakage factors and causes are analyzed.

7. A well leakage analysis system based on interpretable machine learning, characterized in that, include: The data acquisition module is used to collect well leakage data and build a well leakage dataset. The Gaussian clustering module is used to determine the type of well leakage based on the concentrated data in the well leakage dataset using a Gaussian clustering model. The test set partitioning module is used to construct training and test sets based on the data in the well leakage dataset and the well leakage type judgment model. The model training module is used to build a model for real-time well leakage detection, train the model using data in the training set, and validate the model using data in the test set. The model parsing module is used to parse the trained real-time well leakage type identification model using an interpretable machine learning algorithm based on SHAP values ​​to obtain the cause of well leakage; The method for collecting well leakage data and establishing a well leakage dataset is as follows: Loss data are collected based on logging data, well logging data, and daily drilling reports; The types of leakage data include leakage characterization features, drilling fluid characteristics, and operable drilling parameters; The leakage characteristics include leakage amount, leakage rate, and leakage-to-discharge ratio; The method for determining well leakage type using a Gaussian clustering model is as follows: The Gaussian distribution models for the leakage amount, leakage rate, and leakage ratio were calculated using Gaussian clustering models. The probability density function of the hybrid model is obtained by multiplying the Gaussian distribution model of the leakage amount, leakage rate and leakage ratio by the weight of each feature and summing them. Based on the probability density function of the hybrid model, the BIC value of the hybrid model is calculated to determine the optimal number of clusters; Based on the optimal number of clusters, the distribution pattern is observed through the spatial graph of the hybrid model; The distribution patterns of spatial map observers through the hybrid model include: Based on the leakage characteristics of each category, draw a spatial distribution map and statistically analyze the average leakage amount, leakage rate, leakage-to-discharge ratio and density difference of each category obtained by clustering. Based on the leakage patterns of actual well leakage types, the clustering results are correlated with the actual well leakage types; Based on the correspondence between the clustering results and the actual well leakage types, the type corresponding to each well leakage event in the well leakage dataset is determined.

8. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the well leakage analysis method based on interpretable machine learning according to any one of claims 1-6.

Citation Information

Patent Citations

  • Differentiated river patrol strategy generation method and device

    CN113344130A

  • Malignant pleural effusion auxiliary diagnosis system based on interpretable machine learning algorithm

    CN115099331A