A method for detecting and correcting data outliers in drilling pressure parameter calculation
Patent Information
- Application Number
- CN202211532836.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-12-01
AI Technical Summary
此外,当插值点比较多的时候,拉格朗日插值多项式的次数可能会很高,因此具有数值不稳定的特点
[0034] The beneficial effects of this invention are: the method for detecting and correcting anomalies in logging data for calculating formation pressure parameters achieves data optimization and provides a theoretical basis for real-time production guidance during drilling.
Smart Images

Figure CN118171122B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas drilling, and in particular to a method for detecting and correcting data anomalies in drilling pressure parameter calculation. Background Technology
[0002] During drilling, it is necessary to calculate data such as overlying strata pressure, rock mechanics parameters, formation pore pressure, geostress, formation collapse pressure, formation fracture pressure, and formation leakage pressure based on well logging data. Sometimes, pressure prediction is also required for other wells in the same area and formation. The well logging data here represents the most basic data and generally includes well name, depth, caliber, neutrons, density, natural gamma ray, spontaneous potential, deep lateral resistivity, shallow lateral resistivity, P-wave transit time, and S-wave transit time. Generally, well logging data comprehensively reflects the production testing situation of the well under study at different depths. However, due to various practical reasons, some data may contain anomalies, leading to errors or even erroneous calculations of subsequent pressure parameters. Using this data to guide production could result in safety accidents. Therefore, it is crucial to detect and correct anomalies in the original well logging data and the calculated pressure values.
[0003] Outliers, also known as outliers, can be detected using methods such as quartile box plots, the 3σ rule, model-based detection, and similarity-based detection. Similarity-based detection can be further divided into nearest neighbor-based outlier detection, density-based outlier detection, and clustering-based methods.
[0004] The interquartile box plot method uses the interquartile range (IQR) of a box plot to detect outliers, essentially performing manual checks on observed values. The 3σ rule calculates the mean μ and standard deviation; data falling within the interval (μ-3σ, μ+3σ) has a 99% probability of being outlier. Data falling outside this interval is considered outlier. The 3σ rule requires the data to follow a normal distribution; however, if the data does not follow a normal distribution, a multiple of the standard deviation can be customized based on experience and the specific circumstances.
[0005] Model-based detection defines a probability distribution model, calculates the probability that a sample value conforms to this model, and identifies objects with low probabilities as outliers. If the model is a set of clusters, outliers are objects that do not significantly belong to any cluster; if the model is a regression model, outliers are objects that are relatively far from the predicted values. This method has a solid statistical foundation and can be very effective when sufficient data and knowledge of the types of tests used are available; however, it is poor at detecting probability for multivariate and high-dimensional data.
[0006] The nearest neighbor-based approach is relatively easier than model-based outlier detection methods in determining the distribution model, and there are three commonly used methods. The first is the nearest neighbor-based outlier detection method, also known as the K-NN method, where K is the neighborhood range. If k is too small, a small number of nearby outliers may lead to low outlier scores; if K is too large, all objects in clusters with fewer than k points may become outliers. To make this method more robust to the choice of k, the average distance of the k nearest neighbors can be used. This method is sensitive to the value of K, has a high computational cost, and is not suitable for processing datasets with regions of varying densities.
[0007] The second density-based outlier detection method employs a density perspective, where outliers are objects in low-density regions. Density-based outlier detection is closely related to proximity-based detection, as density is often defined using proximity. Density can be defined as the reciprocal of the average distance to the k nearest neighbors, or as the number of objects within a specified distance *d*. Similar to distance-based methods, this approach has high time complexity, and parameter selection is challenging.
[0008] Clustering-based methods classify data; if a test value does not strongly belong to any class, then the object is considered an outlier. This method is also known as the k-means algorithm, where k is the number of clusters. The structural validity of the clustering is sensitive to outliers and has a significant impact on outlier identification.
[0009] In outlier data repair, polynomial interpolation and Lagrange polynomial interpolation are commonly used. Polynomial interpolation involves finding a polynomial to fit the data sample points, using depth as the independent variable, and predicting or updating the values of outliers according to the polynomial. Its advantage is its intuitiveness; the algorithm's properties are immediately apparent. However, the coefficient matrix of the linear equation system to be solved is a Vandermonde matrix, which is generally an ill-conditioned matrix, leading to significant errors in the actual solution of the equation system.
[0010] Lagrange polynomial interpolation involves first constructing a set of Lagrange basis functions of degree no more than n, and then linearly combining these basis functions to obtain the Lagrange interpolation polynomial. The formula structure of Lagrange interpolation is neat and compact, making it very convenient for theoretical analysis. However, in computation, when an interpolation point is added or removed, the corresponding basic polynomials need to be completely recalculated. Furthermore, when there are many interpolation points, the degree of the Lagrange interpolation polynomial may be very high, thus exhibiting numerical instability.
[0011] To address the aforementioned issues, the commonly used mathematical methods for anomaly detection and data repair have various shortcomings and limitations. In the era of big data and artificial intelligence, it is necessary to fully utilize the characteristics of data and seek new methods for solving problems from a data-driven perspective. Summary of the Invention
[0012] The technical problem to be solved by the present invention is to provide a method for detecting and correcting data anomalies in drilling pressure parameter calculation. This method detects anomalies in logging data and various data such as pressure calculated based on logging data during the drilling process, reduces the impact of errors in basic data on the calculation results, and improves the timeliness and accuracy of data processing.
[0013] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for detecting and correcting data anomalies in drilling pressure parameter calculation, comprising the following steps:
[0014] A. For data requiring outlier detection and correction, assume the input to each computation module is called the sample sequence D, represented as D = {x1, x2, ..., x...} n}, each sample x in the sample sequence D i The well depth js is represented by a tuple “(well depth js, value v)”, where the well depth js is in meters and is a floating-point data type that can have decimal places. The value v represents the input data of the calculation module or the calculation result of the module. The unit is uniform. The number of samples in the sample sequence D is n, and the samples are arranged in ascending order of well depth.
[0015] B. Outlier Detection: Define an initial sample space and classify the sample sequences using clustering methods. When a new sample arrives, select the data class closest to it. If the sample deviates from the data class by more than 3 times the intra-class divergence of the data class, then the new sample is a data outlier and is marked as such.
[0016] C. Outlier Correction: A gradient descent fitting algorithm from machine learning is used, with an adaptive method to determine the degree of the fitting polynomial. When the current training error err... train and test error err test The difference |err train -err test When certain conditions are met, the gradient descent algorithm is stopped, and the depth of the data outlier is used as the independent variable to calculate the value according to the fitting polynomial. This value is the correction value of the data outlier.
[0017] Step B, outlier detection, includes: given a depth space with n samples, adaptive clustering of sample values, resulting in at most K data classes, where the mean of each data class k is [value missing]. The intra-class divergence is S k , k∈K; each input sample x i Calculate the distance d from it to the center of each data class. k Select the data class C with the smallest distance. min If the distance dk If the sample x is not within 3 times the within-class divergence, then... i Identify data outliers and mark them as outliers for use by C; otherwise, sample x is not considered an outlier. i Clustering to data class C min In the process, after each data class k changes, its mean is updated. Intraclass divergence S k ;
[0018] Formula for calculating the mean of each data class:
[0019] Where M is the number of samples in the k-th class;
[0020] Sample x i Distance d to the center of each data class k Calculation formula:
[0021]
[0022] Formula for calculating the within-class divergence of data classes:
[0023]
[0024] in, is the mean of the sample values of the k-th class.
[0025] If a certain data class C k When the number of samples in the middle grows rapidly and reaches a certain level, this data class will split into two subclasses C. k1 C k2 To control the rapid growth of the number of samples in a certain class, it is necessary to determine whether to split a data class into two data classes. The condition for determining whether to split the data class is S0≤a*(S1+S2), where α is a hyperparameter, and according to the parameter tuning results, the value is between 1.1 and 1.2.
[0026] In step C, when correcting data outliers, the total number of samples win before and after a data outlier depth is considered. This win value is called the correction window.
[0027] C1. Let the fitting polynomial within the local range win be y = θ. T x i ,i=0,1,2,...N, θ=<θ0,θ1,...,θ N > T θ is a vector, which is the parameter that needs to be solved;
[0028] C2. Let the loss function during training be...
[0029] C3. Use 80% of the data within the range win as training data at intervals, and use the remaining 20% of the data as test data;
[0030] C4. Iterative calculation using the gradient descent fitting algorithm. The learning rate is set to 0.005 after parameter tuning. During the iteration process, when the current training error err... train and test error err test The difference |err train -err test When certain conditions are met, the gradient descent algorithm stops iterating. At this point, the polynomial order *i* and the polynomial parameter *θ* are saved, and the iteration process is stopped. Using depth as the independent variable, the algorithm fits the polynomial y = θ. T x i The evaluation is the correction value for the data outliers.
[0031] The termination condition of the gradient descent fitting algorithm is that when |err| in the current iteration... train -err test | Greater than 1 / (2.7*n)∑ i |err i train -err i test When |, stop the gradient descent fitting algorithm iteration.
[0032] To determine if overfitting has occurred using conventional machine learning methods, more data is needed to simulate the fitted function when overfitting is detected. At this point, the win value should be increased. The adaptive adjustment method for the win parameter is designed as follows: win = (1 + β / r) * win, where win is a hyperparameter. In actual use, the win value is given. The larger the win value, the more accurate the correction of outliers, but the fitting time increases; where r is the win value at the time of the last fitting.
[0033] In step C1, to prevent overfitting, the polynomial degree is set to a maximum of 6.
[0034] The beneficial effects of this invention are: the method for detecting and correcting anomalies in logging data for calculating formation pressure parameters achieves data optimization and provides a theoretical basis for real-time production guidance during drilling. Attached Figure Description
[0035] Figure 1 This is a framework diagram for calculating drilling pressure parameters;
[0036] Figure 2 This is a flowchart of the data anomaly detection process;
[0037] Figure 3 This is a flowchart of data class splitting;
[0038] Figure 4 This is a flowchart of the data anomaly correction process;
[0039] Figure 5 This is a diagram showing the calculated rock mechanical parameters before optimization;
[0040] Figure 6 This is a graph showing the calculated results of the optimized rock mechanical parameters (using sample number / 4).
[0041] Figure 7 This is a graph showing the calculated results of the optimized rock mechanical parameters (using sample number / 8). Detailed Implementation
[0042] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0043] The method for detecting and correcting data anomalies in drilling pressure parameter calculation according to the present invention includes the following steps:
[0044] A. For data requiring outlier detection and correction, assume the input to each computation module is called the sample sequence D, represented as D = {x1, x2, ..., x...} n}, each sample x in the sample sequence D i The well depth js is represented by a tuple “(well depth js, value v)”, where the well depth js is in meters and is a floating-point data type that can have decimal places. The value v represents the input data of the calculation module or the calculation result of the module. The unit is uniform. The number of samples in the sample sequence D is n, and the samples are arranged in ascending order of well depth.
[0045] B. Outlier Detection: Define an initial sample space and classify the sample sequences using clustering methods. When a new sample arrives, select the data class closest to it. If the sample deviates from the data class by more than 3 times the intra-class divergence of the data class, then the new sample is a data outlier and is marked as such.
[0046] C. Outlier Correction: A gradient descent fitting algorithm from machine learning is used, with an adaptive method to determine the degree of the fitting polynomial. When the current training error err... train and test error err test The difference |err train -err testWhen certain conditions are met, the gradient descent algorithm is stopped, and the depth of the data outlier is used as the independent variable to calculate the value according to the fitting polynomial. This value is the correction value of the data outlier.
[0047] Step B, outlier detection, includes: given a depth space with n samples, adaptive clustering of sample values, resulting in at most K data classes, where the mean of each data class k is [value missing]. The intra-class divergence is S k , k∈K; each input sample x i Calculate the distance d from it to the center of each data class. k Select the data class C with the smallest distance. min If the distance d k If the sample x is not within 3 times the within-class divergence, then... i Identify data outliers and mark them as outliers for use by C; otherwise, sample x is not considered an outlier. i Clustering to data class C min In the process, after each data class k changes, its mean is updated. Intraclass divergence S k ;
[0048] Formula for calculating the mean of each data class:
[0049] Where M is the number of samples in the k-th class;
[0050] Sample x i Distance d to the center of each data class k Calculation formula:
[0051]
[0052] Formula for calculating the within-class divergence of data classes:
[0053]
[0054] in, is the mean of the sample values of the k-th class.
[0055] If a certain data class C k When the number of samples in the middle grows rapidly and reaches a certain level, this data class will split into two subclasses C. k1 C k2 To control the rapid growth of the number of samples in a certain class, it is necessary to determine whether to split a data class into two data classes. The condition for determining whether to split the data class is S0≤a*(S1+S2), where α is a hyperparameter, and according to the parameter tuning results, the value is between 1.1 and 1.2.
[0056] In step C, when correcting data outliers, the total number of samples win before and after a data outlier depth is considered. This win value is called the correction window.
[0057] C1. Let the fitting polynomial within the local range win be y = θ. T x i ,i=0,1,2,...N, θ=<θ0,θ1,...,θ N > T θ is a vector, which is the parameter that needs to be solved;
[0058] C2. Let the loss function during training be...
[0059] C3. Use 80% of the data within the range win as training data at intervals, and use the remaining 20% of the data as test data;
[0060] C4. Iterative calculation using the gradient descent fitting algorithm. The learning rate is set to 0.005 after parameter tuning. During the iteration process, when the current training error err... train and test error err test The difference |err train -err test When certain conditions are met, the gradient descent algorithm stops iterating. At this point, the polynomial order *i* and the polynomial parameter *θ* are saved, and the iteration process is stopped. Using depth as the independent variable, the algorithm fits the polynomial y = θ. T x i The evaluation is the correction value for the data outliers.
[0061] The termination condition of the gradient descent fitting algorithm is that when |err| in the current iteration... train -err test | Greater than 1 / (2.7*n)∑ i |err i train -err i test When |, stop the gradient descent fitting algorithm iteration.
[0062] To determine if overfitting has occurred using conventional machine learning methods, more data is needed to simulate the fitted function when overfitting is detected. At this point, the win value should be increased. The adaptive adjustment method for the win parameter is designed as follows: win = (1 + β / r) * win, where win is a hyperparameter. In actual use, the win value is given. The larger the win value, the more accurate the correction of outliers, but the fitting time increases; where r is the win value at the time of the last fitting.
[0063] In step C1, to prevent overfitting, the polynomial degree is set to a maximum of 6.
[0064] Data anomaly detection and correction can be performed during well logging data processing and drilling-related pressure calculations. Well logging data preprocessing is the initial step, followed by various pressure parameter calculation modules during drilling. The order of these calculation modules is as follows: Figure 1 As shown.
[0065] Data preprocessing and each calculation module are progressively layered. For example, to calculate in-situ stress, the results of formation pore pressure calculation are required, which in turn depend on the results of rock mechanics parameter calculation, and so on. Therefore, errors or mistakes in the calculation results of earlier modules will be propagated to subsequent calculation modules, greatly affecting the calculation results of later modules. Figure 1 Before each calculation module begins, outlier detection and correction can be performed on the input data, and outlier detection and correction can also be performed on the results of each calculation module.
[0066] In the process of data anomaly detection and data repair, the following assumptions are made:
[0067] The input to each computation module is called the input dataset, also known as the set of sample points D or the sample sequence D, denoted as D = {x1, x2, ..., x...} n}, each sample x in the sample sequence D i The well depth (js) is represented as a binary tuple: "(well depth js, value v)". Here, the well depth (js) is in meters and is a floating-point data type that can have decimal places. The value (v) can represent either the input data of the calculation module or the calculation result of the module, and its unit is uniform. The sample sequence D contains n samples, arranged in ascending order of well depth.
[0068] The method of this invention consists of two steps. The first step is data anomaly detection; the second step is anomaly data repair.
[0069] The first step is to detect data anomalies.
[0070] The n values v of a sample sequence D constructed in ascending order of well depth may be stationary or non-stationary throughout the entire depth space. However, in a local depth space, the value v at a certain depth has a strong correlation with the values v at adjacent well depths, constituting a non-white noise sequence, and thus has analytical value. Therefore, the basic idea of outlier detection is: first, define an initial sample space, classify the sample sequence using clustering methods, and when a new sample arrives, select the data class closest to it. If the sample deviates from this data class by more than three times the intra-class divergence of this data class, then the new sample is a data outlier.
[0071] The flowchart for data anomaly detection is as follows: Figure 2 As shown:
[0072] Figure 2 The calculation formulas involved are as follows:
[0073] Formula for calculating the mean of each data class:
[0074]
[0075] M is the number of samples in the k-th data category, v m This refers to the m-th data point in the k-th data category.
[0076] Sample x i Distance d to the center of each category k Calculation formula:
[0077]
[0078] v i For sample x i The data value.
[0079] The formula for calculating the within-class divergence of a data class is:
[0080]
[0081] u k It represents the mean of the data values in the k-th data class.
[0082] If a certain data class C k When the number of samples in the middle grows rapidly and reaches a certain level, this data class will split into two subclasses C. k1 C k2 Class splitting judgment process:
[0083] Figure 3 In the flowchart, α is a hyperparameter, and its value is between 1.1 and 1.2 according to the parameter tuning results.
[0084] Therefore, the program implementation flow of the data outlier detection method is as follows: Given a depth space, let the number of samples in it be n. These samples are adaptively clustered, resulting in at most K data classes. The mean of each data class k is... The intra-class divergence is S k , k∈K; each input sample x i Calculate the distance d from it to the center of each data class. k , Select the data class C with the smallest distance. min If the distance d kIf the sample x is not within 3 times the within-class divergence, then... i If a data point is identified as an outlier, it should be marked as such for use in the subsequent second step; otherwise, sample x should be discarded. i Clustering to data class C min In the middle. After each data class k changes, its mean is updated. Intraclass divergence S k To control the rapid growth of the number of samples in a certain data class, it is necessary to determine whether to split the class into two categories. Figure 3 The judgment process is given.
[0085] The first step, outlier detection, has two features.
[0086] (1) Based on the application characteristics, the conditions for judging data outliers are proposed. That is, when a sample point x i Distance d to the nearest data class k k >3 times the intraclass divergence S k When, then x i This is a data outlier.
[0087] (2) To control the rapid growth of the number of samples in a certain data class, it is necessary to determine whether to split a data class into two data categories. For example... Figure 2 The judgment condition is given, namely S0≤a*(S1+S2), where α is a range determined by parameter tuning and can be used as the range of empirical values of α in this field.
[0088] The second step is to correct data outliers.
[0089] The data outliers used in the first step are the data outliers that were marked. The marked points are data outliers.
[0090] When correcting data outliers, the total number of samples before and after a data outlier depth is considered. This number of samples is called the correction window.
[0091] The basic idea behind correcting outliers is to use the gradient descent fitting algorithm from machine learning, employing an adaptive method to determine the degree of the fitting polynomial. Let the fitting polynomial within the local range win be y = θ. T x i ,i=0,1,2,...N, θ=<θ0,θ1,...,θ N > T θ is a vector representing the parameters to be solved. To prevent overfitting, the polynomial degree is set to a maximum of 6. As is customary, 80% of the data within the range win is sampled at intervals as training data, and the remaining 20% is used as validation test data. For each order polynomial, gradient descent is used for training, with the loss function designed for training being... The learning rate was set to 0.005 after parameter tuning. When the current training error err... train and test error err test The difference |err train -err test When certain conditions are met, the gradient descent algorithm stops its iterative process. At this point, the polynomial order i and the polynomial parameter θ are remembered, and the algorithm exits.
[0092] Among numerous polynomials, the one with test error err test The smallest polynomial is the fitting polynomial. Using depth as the independent variable and evaluating this polynomial yields the correction value for data outliers.
[0093] The flowchart for correcting data anomalies is as follows: Figure 4 :
[0094] The second step, data outlier correction, has two characteristics.
[0095] (1) gives Figure 4 The termination condition in the code. When |err| in the current iteration... train -err test | Greater than 1 / (2.7*n)∑ i |err i train-err i test When |, the iterative gradient descent fitting algorithm is terminated.
[0096] (2) An adaptive parameter adjustment method, Win, is proposed. Conventional machine learning methods are used to determine overfitting; if overfitting occurs, more data is needed to simulate the fitted function. At this point, the win value should be increased. The adaptive adjustment method for the win parameter is designed as follows: win = (1 + β / r) * win, where win is a hyperparameter. In actual use, the win value is given. The larger the win value, the more accurate the correction of outliers, but the fitting time increases; where r is the win value at the time of the last fitting.
[0097] The present invention provides a method for detecting and correcting abnormal data in drilling pressure parameter calculation, which achieves data optimization and provides a theoretical basis for real-time production guidance during the drilling process.
[0098] Example
[0099] The original well logging data contained 14,755 data points, each including well name, depth (m), well diameter (in), neutrons, and density (g / cm³). 3 Natural gamma, natural potential, deep lateral resistivity, shallow lateral resistivity, longitudinal wave time difference (µs / ft), transverse wave time difference (µs / ft).
[0100] Assuming that the overlying strata pressure has been calculated based on the original well logging data, the subsequent calculation module will calculate the rock mechanics parameters.
[0101] Based on mechanical formulas, and using the calculated results of the overlying strata pressure as input, the rock mechanical parameters were calculated. The calculated rock mechanical parameters consist of six data points: Poisson's ratio, elastic modulus, cohesion, angle of internal friction, compressive strength, and tensile strength. These six data points are referred to as the raw data. Without any outlier detection or correction, the raw data curves are as follows: Figure 5 As shown, the vertical axis represents the well depth in meters (m).
[0102] In the first step of the outlier detection algorithm, n is set to total data / 4. A smaller n value indicates faster forgetting of earlier data. The outlier detection results are: 1072 Poisson's ratio outliers, 1339 elastic modulus outliers, 836 cohesion outliers, 1146 internal friction angle outliers, 728 compressive strength outliers, and 911 tensile strength outliers. The second step, the outlier correction function, is then used, and the corrected results are shown below. Figure 6 As shown.
[0103] and Figure 5 In comparison, Figure 6 The outliers in Poisson's ratio, elastic modulus, cohesion, compressive strength and tensile strength were significantly reduced. Although there were 1146 outliers in the internal friction angle data, the corrected structure was not obvious because the data did not show a significant pattern.
[0104] Set n = all data / 8, and perform outlier detection on the original data. The outlier detection results are as follows: 1048 outliers for Poisson's ratio, 1107 outliers for elastic modulus, 844 outliers for cohesion, 1010 outliers for internal friction angle, 707 outliers for compressive strength, and 853 outliers for tensile strength. Then, use the outlier correction function from step two. The corrected results are shown below. Figure 7 As shown.
[0105] and Figure 5 In comparison, Figure 7 The outliers in Poisson's ratio, elastic modulus, cohesion, compressive strength, and tensile strength were significantly reduced. Figure 6 In comparison, because the value of n decreased, the number of data outliers also decreased significantly.
[0106] This invention overcomes the anomalies present in the original drilling data, and also overcomes... Figure 1Errors in the intermediate calculation modules lead to low accuracy in subsequent modules. This study aims to accurately identify and correct well depths with data anomalies, providing a basis for scientifically and rationally guiding drilling operations. An attempt was made to apply the gradient descent fitting algorithm from machine learning to calculate parameters such as pressure during the drilling process. This detected data anomalies in the input data and calculation results of each module, providing optimal calculation results for various pressures and parameters.
[0107] In summary, the content of this invention is not limited to the above-described embodiments. Those skilled in the art can easily propose other embodiments within the technical guiding principles of this invention, but such embodiments are all included within the scope of this invention.
Claims
1. A method for detecting and correcting data anomalies in drilling pressure parameter calculation, characterized in that, Includes the following steps: A. For data requiring outlier detection and correction, let's assume the input to each computation module is called a sample sequence. The sample sequence is represented as Each sample in use" "In binary form, well depth" The unit is meters, and it is a floating-point data type with decimal places. The value v represents the input data of the calculation module or the calculation result of the module. Its unit is uniform. The number of samples in the sample sequence D is n, and the samples are arranged in order of increasing well depth. B. Outlier Detection: Define an initial sample space and classify the sample sequences using clustering methods. When a new sample arrives, select the data class closest to it. If the sample deviates from the data class by more than 3 times the intra-class divergence of the data class, then the new sample is a data outlier and is marked as such. C. Outlier Correction: A gradient descent fitting algorithm from machine learning is used, with an adaptive method to determine the degree of the fitting polynomial, based on the current training error. and test error The difference When certain conditions are met, the gradient descent algorithm is stopped, and the depth of the data outlier is used as the independent variable to calculate the value according to the fitting polynomial. This value is the correction value of the data outlier. Step B, outlier detection, includes: given a depth space, with n samples, the samples are adaptively clustered, resulting in at most K data classes, where the mean of each data class k is [value missing]. The intra-class divergence is , Each input sample Calculate its distance to the center of each data class. Select the data class with the smallest distance. If the distance If the sample is not within 3 times the within-class divergence, then the sample Identify data outliers and mark them as outliers for use by C; otherwise, the sample... Clustering to data class In the process, after each data class k changes, its mean is updated. Intra-class divergence ; Formula for calculating the mean of each data category: Where M is the number of samples in the k-th class; sample Distance to each data class center Calculation formula: Formula for calculating the within-class divergence of data classes: in, The mean of the k-th class of samples; To determine if overfitting has occurred using conventional machine learning methods, more data is needed to simulate the fitted function when overfitting is detected. At this point, it should be increased Values; adaptive adjustment parameters of the design The method is as follows: ,in These are hyperparameters; they are given in actual use. value, A larger value results in more accurate outlier correction, but increases the fitting time; where r is the value at the time of the previous fitting. value.
2. The method for detecting and correcting data anomalies in drilling pressure parameter calculation according to claim 1, characterized in that, If a certain data class When the number of samples in the middle grows rapidly and reaches a certain level, this data class will split into two subclasses C. k1 C k2 To control the rapid growth of a certain type of sample size, it is necessary to determine whether to split a data class into two data classes; the conditions for determining whether to split the data class are as follows: ,in These are hyperparameters; their values are determined based on the tuning results. between.
3. The method for detecting and correcting data anomalies in drilling pressure parameter calculation according to claim 1, characterized in that, In step C, when correcting data outliers, the total values before and after a given depth of an outlier are considered. One sample, this The value is called the correction window; C1. Define the local range The fitting polynomial within is , , It is a vector, which represents the parameters that need to be solved; C2. Let the loss function during training be... ; C3. Use 80% of the data within the range win as training data at intervals, and use the remaining 20% of the data as test data; C4. Iterative calculation using the gradient descent fitting algorithm; where the learning rate is set to 0.005 after parameter tuning; during the iteration process, when the current training error... and test error The difference When certain conditions are met, the gradient descent algorithm stops iterating, and the polynomial order is saved. and polynomial parameters The value is determined, and the iteration process is stopped; the depth is used as the independent variable to fit the polynomial. The evaluation is the correction value for the data outliers.
4. The method for detecting and correcting data anomalies in drilling pressure parameter calculation according to claim 1, characterized in that, The termination condition of the gradient descent fitting algorithm is that when the current iteration reaches the set value... Greater than When the gradient descent fitting algorithm stops iterating.
5. The method for detecting and correcting data anomalies in drilling pressure parameter calculation according to claim 3, characterized in that, In step C1, to prevent overfitting, the polynomial degree is set to a maximum of 6.