Defect size prediction method and device, storage medium and electronic equipment

By training a random forest regression network using feature sorting and re-enhancing sample methods, the problem of low efficiency in traditional manual regression methods is solved, and high-precision and stable prediction of the defect size of magnetic leakage signal is achieved.

CN121786778APending Publication Date: 2026-04-03CNOOC PIPELINE ENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, the defect size modeling of leakage magnetic signals mainly adopts the traditional manual regression method, which is inefficient, has insufficient fitting ability for complex model relationships, and is difficult to accurately invert the defect size of pipelines.

Method used

A pre-defined random forest regression network was trained using a feature-based ranking and sample enhancement method. Through feature contribution analysis and sample set enhancement, a target defect size prediction model was obtained, which improved the model's sensitivity to core physical features.

Benefits of technology

It improves the accuracy and stability of defect size prediction, enhances the model's sensitivity to core physical features, and improves inversion accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786778A_ABST
    Figure CN121786778A_ABST
Patent Text Reader

Abstract

The invention discloses a defect size prediction method and device, a storage medium and electronic equipment. The method relates to the technical field of pipeline defect detection, and comprises the following steps: training a preset random forest regression network based on historical magnetic flux leakage detection data of a target pipeline by adopting a feature sorting and sample re-enhancement method to obtain target defect size prediction models corresponding to different defect dimensions; performing feature extraction on the current magnetic flux leakage detection data of the target pipeline to obtain feature data; and predicting the feature data by adopting each target defect size prediction model to obtain a defect size prediction value corresponding to each defect dimension. According to the method, the defect size prediction accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline defect detection technology, and in particular to a defect size prediction method, device, storage medium, and electronic device. Background Technology

[0002] Pipeline transportation systems possess significant advantages such as high efficiency, low cost, and stable operation, making them a crucial infrastructure for modern energy transmission. However, due to their long-term operation in complex environments, pipelines are susceptible to various defects, including corrosion pits, cracks, and wall thinning, caused by factors such as internal pressure, corrosion, and fatigue. These defects are complex in form and ambiguous in characterization, posing a significant challenge to the accurate inversion of defect dimensions in magnetic flux leakage (MFL) detection. Currently, defect size modeling of MFL signals primarily employs traditional manual regression methods. These methods rely on manual experience to select certain features and use traditional linear and polynomial models for modeling and prediction, requiring extensive manual parameter tuning and exhibiting insufficient fitting ability for complex relationships. Summary of the Invention

[0003] In view of this, the present invention provides a defect size prediction method, device, storage medium and electronic device, the main purpose of which is to solve the problem that the current defect size modeling for leakage magnetic signals mainly adopts the traditional manual regression method, which is inefficient.

[0004] To address the above problems, this application provides a defect size prediction method, comprising:

[0005] Based on historical magnetic flux leakage detection data of the target pipeline, a pre-set random forest regression network was trained using a feature-based sorting and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions.

[0006] Feature data is obtained by extracting features from the current magnetic flux leakage detection data of the target pipeline;

[0007] The feature data are predicted using the target defect size prediction models described above to obtain the defect size prediction values ​​corresponding to each defect dimension.

[0008] Optionally, the historical magnetic flux leakage detection data of the target pipeline is used to train a preset random forest regression network using a feature ranking and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions, specifically including:

[0009] Feature extraction is performed on the historical magnetic flux leakage detection data to obtain a historical feature dataset;

[0010] The preset random forest regression network is trained based on the historical feature dataset to obtain an initial defect size prediction model;

[0011] The historical feature dataset was augmented using a feature contribution analysis method based on Shapley values ​​to obtain an augmented dataset.

[0012] The initial defect size prediction model is trained using the augmented dataset to obtain the target defect size prediction model.

[0013] Optionally, training the preset random forest regression network based on the historical feature dataset to obtain the initial defect size prediction model specifically includes:

[0014] The historical feature data in the historical feature dataset is labeled based on the historical defect size corresponding to different defect dimensions to obtain a labeled dataset.

[0015] The preset random forest regression network is trained using the labeled dataset to obtain the initial defect size prediction model corresponding to different defect dimensions;

[0016] Among them, the different leakage magnetic field detection dimensions include axial signal feature dimension, radial signal feature dimension and circumferential signal feature dimension;

[0017] The different defect dimensions mentioned include length defect dimension, width defect dimension and depth defect dimension.

[0018] Optionally, the step of using a feature contribution analysis method based on Shapley values ​​to perform sample set augmentation processing on the historical feature dataset to obtain an augmented dataset specifically includes:

[0019] The historical feature data were sorted by contribution rate using a feature contribution analysis method based on Shapley value to obtain a historical feature queue.

[0020] The historical feature data in the historical feature queue is filtered to obtain a predetermined number of target historical feature data with the highest contribution ranking;

[0021] Based on the target historical feature data, the historical feature dataset is subjected to sample set augmentation processing to obtain an augmented dataset.

[0022] Optionally, the step of using a feature contribution analysis method based on Shapley values ​​to sort the historical feature data by contribution to obtain a historical feature queue specifically includes:

[0023] The initial defect size prediction model is used to predict the historical feature data, including the target dimension, to obtain the first historical defect size prediction value.

[0024] The initial defect size prediction model is used to predict the historical feature data that does not include the target dimension, to obtain the second historical defect size prediction value.

[0025] Based on the first historical defect size prediction value and the second historical defect size prediction value, a subtraction operation is performed to obtain the boundary contribution corresponding to the historical feature data of the target dimension;

[0026] Subsets are constructed for the historical feature data of different dimensions to obtain multiple subsets of the historical feature data that do not contain the target dimension;

[0027] Calculate the weight value corresponding to each of the subsets;

[0028] Multiplication is performed based on each weight value and the boundary contribution to obtain contribution sub-scores corresponding to each subset.

[0029] The contribution sub-scores are summed to obtain the contribution corresponding to the historical feature data of the target dimension, so as to obtain the contribution corresponding to the historical feature data of different dimensions respectively.

[0030] The historical feature data are sorted in descending order of contribution to obtain the historical feature queue.

[0031] Optionally, the step of performing sample set augmentation processing on the historical feature dataset based on the target historical feature data to obtain an augmented dataset specifically includes:

[0032] The target historical feature data is copied at a predetermined multiple to obtain multiple copied data corresponding to the target historical feature data.

[0033] The copied data is horizontally concatenated to the historical feature dataset to obtain the enhanced dataset.

[0034] Optionally, the step of using each of the target defect size prediction models to predict the feature data and obtain the defect size prediction value corresponding to each defect dimension specifically includes:

[0035] The target defect size prediction model is used to predict the feature data to obtain the first predicted value corresponding to each subtree of the target defect size prediction model.

[0036] The defect size prediction value is obtained by averaging each of the first predicted values.

[0037] To address the aforementioned problems, this application provides a defect size prediction device, comprising:

[0038] The training module is used to train a preset random forest regression network based on historical magnetic flux leakage detection data of the target pipeline using a feature-based sorting and re-enhanced sample method, so as to obtain a target defect size prediction model corresponding to different defect dimensions.

[0039] The feature extraction module is used to extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0040] The prediction module is used to predict the feature data using the target defect size prediction model to obtain the defect size prediction value corresponding to each defect dimension.

[0041] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the defect size prediction method described above.

[0042] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the defect size prediction method described above.

[0043] The beneficial effects of this application are as follows: This application trains a preset random forest regression network using a feature-based ranking and re-enhanced sample method to obtain target defect size prediction models corresponding to different defect dimensions. It enhances the relative weights of these models in the input feature set, improving the model's sensitivity to core physical features, thereby increasing inversion accuracy and stability. Feature data is extracted from the current magnetic flux leakage detection data of the target pipeline. The target defect size prediction models are then used to predict the feature data, obtaining predicted defect size values ​​corresponding to each defect dimension, thus improving the accuracy of defect size prediction.

[0044] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0045] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0046] Figure 1 A flowchart illustrating a defect size prediction method provided in an embodiment of this application is shown.

[0047] Figure 2 A flowchart illustrating a defect size prediction method provided in an embodiment of this application is shown.

[0048] Figure 3 A structural block diagram of a defect size prediction device provided in an embodiment of this application is shown. Detailed Implementation

[0049] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0050] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0051] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0052] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0053] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0054] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0055] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0056] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0057] This application provides a defect size prediction method, such as... Figure 1As shown, it includes:

[0058] Step S101: Based on the historical magnetic flux leakage detection data of the target pipeline, a preset random forest regression network is trained using a feature-based ranking and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions;

[0059] In this step, features are extracted from the historical magnetic flux leakage detection data to obtain a historical feature dataset. Based on this historical feature dataset, a preset random forest regression network is trained to obtain an initial defect size prediction model. A feature contribution analysis method based on Shapley values ​​is used to perform sample set augmentation on the historical feature dataset to obtain an augmented dataset. The augmented dataset is then used to train the initial defect size prediction model to obtain a target defect size prediction model. The target defect size prediction model includes a target length defect prediction model, a target width defect prediction model, and a target depth defect prediction model.

[0060] Step S102: Extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0061] In this step, multiple characteristic parameters describing the morphology and distribution of defects are extracted from the signals in three directions, such as peak and valley positions, valley-peak spacing, energy characteristics, and percentage positional characteristics. Axial signal characteristics include left valley magnetic intensity, right valley magnetic intensity, peak-valley difference, surface energy, feature length, and feature width; radial signal characteristics include valley magnetic intensity, peak-valley difference, and volume energy; circumferential signal characteristics include valley clock, peak-valley difference, surface energy, and feature width.

[0062] Step S103: Use the target defect size prediction model to predict the feature data to obtain the defect size prediction value corresponding to each defect dimension.

[0063] In this step, a target length defect prediction model is used to predict the feature data to obtain a length defect prediction value; a target width defect prediction model is used to predict the feature data to obtain a width defect prediction value; and a target depth defect prediction model is used to predict the feature data to obtain a depth defect prediction value.

[0064] This application trains a pre-defined random forest regression network using a feature-based ranking and enhanced sample method to obtain target defect size prediction models corresponding to different defect dimensions. It enhances the relative weights of these models in the input feature set, improving the model's sensitivity to core physical features and thus increasing inversion accuracy and stability. Feature data is extracted from the current magnetic flux leakage detection data of the target pipeline. The target defect size prediction models are then used to predict the feature data, obtaining predicted defect size values ​​corresponding to each defect dimension, thereby improving the accuracy of defect size prediction.

[0065] Another embodiment of this application provides another method for predicting defect size, such as... Figure 2 As shown, it includes:

[0066] Step S201: Extract features from historical magnetic flux leakage detection data to obtain a historical feature dataset;

[0067] In this step, the historical magnetic flux leakage (MF) detection data can be collected using a pipeline inspection robot. This historical MF detection data includes multi-dimensional signal characteristics generated in different areas of the pipeline during the inspection process, covering magnetic field changes in the axial, radial, and circumferential directions. The historical MF detection data is preprocessed to obtain preprocessed detection data; specifically, the historical MF detection data is standardized to obtain standardized detection data; outlier removal is performed on the standardized detection data to obtain the preprocessed detection data; feature extraction is performed on the preprocessed detection data to obtain the historical feature dataset; specifically, multiple feature parameters describing defect morphology and distribution are extracted from different MF detection dimensions, such as peak-valley positions, valley-peak spacing, energy characteristics, and percentage positional characteristics. The different dimensions of magnetic flux leakage detection include axial signal feature dimensions, radial signal feature dimensions, and circumferential signal feature dimensions. Axial signal features include left valley magnetic intensity Y1, right valley magnetic intensity Y2, peak-valley difference Z1, surface energy M, feature length, and feature width. Radial signal features include valley magnetic intensity, peak-valley difference, and volume energy. Circumferential signal features include valley clock, peak-valley difference, surface energy, and feature width. A historical feature dataset is constructed based on the feature parameters of different magnetic flux leakage detection dimensions. Where n is the number of samples and d is the feature dimension.

[0068] Step S202: Train the preset random forest regression network based on the historical feature dataset to obtain an initial defect size prediction model;

[0069] In the specific implementation process, the historical feature data in the historical feature dataset is labeled based on the historical defect sizes corresponding to different defect dimensions to obtain a label dataset; the preset random forest regression network is trained using the label dataset to obtain the initial defect size prediction model corresponding to different defect dimensions; wherein, the different magnetic flux leakage detection dimensions include axial signal feature dimensions, radial signal feature dimensions, and circumferential signal feature dimensions; the different defect dimensions include length defect dimension, width defect dimension, and depth defect dimension. Specifically, the feature matrix X and the corresponding defect dimensions (length, width, depth) form a label matrix to obtain the label dataset; the label dataset is divided into a training set and a validation set. The preset random forest regression network is trained separately for length defects, width defects, and depth defects to obtain the initial defect size prediction model corresponding to different defect dimensions, namely the initial length defect size prediction model f. L (·), Initial width defect size prediction model f W (·) and the initial depth defect size prediction model f D (·). The mathematical expression for the predicted output can be represented by the following formula (1):

[0070]

[0071] in, Represents the predicted defect size; X i represents the i-th label data; n represents the number of label data.

[0072] Step S203: Use the feature contribution analysis method based on Shapley value to perform sample set augmentation processing on the historical feature dataset to obtain an augmented dataset;

[0073] In the specific implementation process, the historical feature data is sorted by contribution using a feature contribution analysis method based on Shapley value to obtain a historical feature queue. Specifically, the initial defect size prediction model is used to predict the historical feature data including the target dimension to obtain a first historical defect size prediction value. The historical feature data of the target dimension is input into the trained initial defect size prediction model to obtain the first historical defect size prediction value. The initial defect size prediction model is used to predict the historical feature data not including the target dimension to obtain a second historical defect size prediction value. The initial defect size prediction model is used to predict the historical feature data not including the target dimension to obtain a second historical defect size prediction value. The historical feature data of the target dimension are predicted to obtain the second historical defect size prediction value; the first historical defect size prediction value and the second historical defect size prediction value are subtracted to obtain the boundary contribution corresponding to the historical feature data of the target dimension; subsets are constructed for the historical feature data of different dimensions to obtain multiple subsets that do not contain the historical feature data of the target dimension; the weight value corresponding to each subset is calculated; the weight value and the boundary contribution are multiplied to obtain the contribution degree sub-score corresponding to each subset; the mathematical expression of the contribution degree sub-score can be shown by the following formula (2):

[0074]

[0075] Where N represents the set of all participants, representing the entire historical feature dataset; S is a subset excluding participant i, representing a portion of the historical feature dataset that does not contain the target feature data i; v(S) represents the profit of the subset, φ i (v) represents the contribution sub-score of participant i. The contribution sub-scores are summed to obtain the contribution corresponding to the historical feature data of the target dimension, thus obtaining the contribution corresponding to the historical feature data of different dimensions respectively; the mathematical formula for calculating the contribution can be shown in the following formula (3):

[0076]

[0077] Among them, Imprtance(x j ) represents historical feature data x jThe contribution of each historical feature data point is determined. The historical feature data are sorted in descending order of contribution to obtain the historical feature queue. The historical feature data in the historical feature queue are then filtered to obtain a predetermined number of target historical feature data points ranked highest in contribution. First, a first predetermined number of historical feature data points ranked highest in contribution are selected. The initial defect size prediction model is repeatedly updated using this first predetermined number of historical feature data points until the prediction result of the current training round meets the prediction result of the previous training round, satisfying a preset condition. This yields the optimal number of feature data points that minimizes the error between the prediction result of the current training round and the prediction result of the previous training round, thus obtaining the target historical feature data points with the optimal number of feature data points ranked highest in contribution. The target historical feature data constitutes an enhancement set ψ. top ={x j1 ,x j2 ,…,x jk}; where x j1 -x jk The target historical feature data is represented by k; k represents the number of target historical feature data. Based on the target historical feature data, the historical feature dataset is subjected to sample set enhancement processing to obtain an enhanced dataset. Specifically, the target historical feature data is copied at a predetermined multiple to obtain multiple copied data corresponding to the target historical feature data; the target historical feature data in the historical feature dataset is copied a predetermined multiple r times, where the value of r can be 3 to 5, and the value of r can be set according to actual needs, and then horizontally concatenated to the original historical feature dataset. The mathematical expression can be shown in the following formula (4):

[0078]

[0079] in, The original historical feature dataset, To obtain the enhanced dataset, the copied data is horizontally concatenated to the historical feature dataset.

[0080] Step S204: Use the augmented dataset to train the initial defect size prediction model to obtain the target defect size prediction model;

[0081] In the specific implementation process, the enhanced dataset is input into a new round of random forest regression model for training. The model will use high-value features more frequently in the feature space to construct decision boundaries, thereby achieving the purpose of data-driven structural weighting.

[0082] Step S205: Extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0083] In the specific implementation process, multiple characteristic parameters describing the morphology and distribution of defects are extracted from the three directional signals, such as peak and valley positions, valley-peak spacing, energy characteristics, and percentage positional characteristics. Axial signal characteristics include left valley magnetic intensity, right valley magnetic intensity, peak-valley difference, surface energy, feature length, and feature width; radial signal characteristics include valley magnetic intensity, peak-valley difference, and volume energy; circumferential signal characteristics include valley clock, peak-valley difference, surface energy, and feature width.

[0084] Step S206: Use the target defect size prediction model to predict the feature data to obtain the defect size prediction value corresponding to each defect dimension.

[0085] In the specific implementation process, the target defect size prediction model is used to predict the feature data to obtain the first predicted value corresponding to each subtree of the target defect size prediction model; the mean of each first predicted value is calculated to obtain the defect size prediction value. The target length defect prediction model is used to predict the feature data to obtain the length defect prediction value; the target width defect prediction model is used to predict the feature data to obtain the width defect prediction value; the target depth defect prediction model is used to predict the feature data to obtain the depth defect prediction value. In order to improve the model prediction credibility and uncertainty modeling ability, the prediction results of all subtrees in the random forest for each sample are statistically analyzed, and the Gaussian distribution of the prediction output is constructed as shown in the following formula (5):

[0086]

[0087] Where μ is the average output of each subtree; σ 2 To predict the variance, representing uncertainty; the mathematical expression for the average value of the outputs of each subtree can be shown in the following formula (6):

[0088]

[0089] σ 2 The mathematical expression for predicting variance can be shown in the following formula (7):

[0090]

[0091] The probability distribution function of the prediction results for each defect dimension is shown in the following formula (8):

[0092]

[0093] This distribution model, known as "soft labeling," can be used for supervised training and regularization in end-to-end deep learning models. Utilizing the visualization capabilities provided by the SHAP interpretation method, the internal mechanisms of the models before and after enhancement are analyzed visually, further validating the effectiveness of feature ranking and enhancement strategies. The contribution of each feature across all samples is displayed, i.e., the average absolute SHAP value, reflecting the importance ranking of features during global modeling. After feature enhancement, key features show higher contributions in the graph, verifying that the enhancement strategy indeed improves their representational weights during model training. The SHAP value distribution of each feature in each sample is displayed in scatter plot form, combined with color mapping to reflect the original feature values. The horizontal axis represents the SHAP value, and the color from low to high represents the change in the original feature value, thus intuitively revealing the positive or negative impact of a feature at high or low values ​​on the prediction results. Enhanced features exhibit a denser and more concentrated influence trajectory in the summary graph.

[0094] This application introduces the SHAP interpretation mechanism, quantifying the marginal contribution of each feature to the defect size prediction result from a game theory perspective. This achieves both global feature importance ranking and supports visual interpretation of local decision paths for single samples, effectively solving the interpretability deficiency problem of traditional "black box" models in engineering applications. Based on SHAP values, feature importance is evaluated, redundant and interfering features are eliminated, and high-contribution core features are retained. A feature enhancement mechanism is designed, which enhances the relative weight of key features in the input feature set by copying and superimposing them (e.g., copying important features into four copies), thereby improving the model's sensitivity to core physical features and thus increasing inversion accuracy and stability. A Gaussian distribution is used to model the output results of the random forest model, obtaining not only the prediction mean but also the standard deviation, realizing a quantitative expression of the uncertainty in defect size prediction and providing a probabilistic-level decision-making basis for risk-controlled engineering deployment. The SHAP-guided feature selection and enhancement mechanism significantly reduces the dimensionality of the model input, improves model training efficiency, and mitigates the risk of overfitting. At the same time, the Gaussian distribution "soft label" of the output enhances the deep model's tolerance to abnormal data and noise, and improves the model's generalization ability in complex industrial scenarios.

[0095] Another embodiment of this application provides a defect size prediction device, such as... Figure 3 As shown, it includes:

[0096] Training module 1 is used to train a preset random forest regression network based on the historical magnetic flux leakage detection data of the target pipeline using a feature-based sorting and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions.

[0097] Feature extraction module 2 is used to extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0098] The prediction module 3 is used to predict the feature data using the target defect size prediction model to obtain the defect size prediction value corresponding to each defect dimension.

[0099] In the specific implementation process, the training module 1 is specifically used for: extracting features from the historical magnetic flux leakage detection data to obtain a historical feature dataset; training the preset random forest regression network based on the historical feature dataset to obtain an initial defect size prediction model; performing sample set augmentation processing on the historical feature dataset using a feature contribution analysis method based on Shapley value to obtain an augmented dataset; and using the augmented dataset to train the initial defect size prediction model to obtain a target defect size prediction model.

[0100] In the specific implementation process, the training module 1 is also used to: label the historical feature data in the historical feature dataset based on the historical defect size corresponding to different defect dimensions to obtain a label dataset; train the preset random forest regression network using the label dataset to obtain the initial defect size prediction model corresponding to different defect dimensions; wherein, the different magnetic flux leakage detection dimensions include axial signal feature dimension, radial signal feature dimension and circumferential signal feature dimension; the different defect dimensions include length defect dimension, width defect dimension and depth defect dimension.

[0101] In the specific implementation process, the training module 1 is also used to: sort the historical feature data by contribution using the feature contribution analysis method based on Shapley value to obtain a historical feature queue; filter the historical feature data in the historical feature queue to obtain a predetermined number of target historical feature data with the highest contribution ranking; and perform sample set augmentation processing on the historical feature dataset based on the target historical feature data to obtain an augmented dataset.

[0102] In the specific implementation process, the training module 1 is further used to: predict the historical feature data including the target dimension using the initial defect size prediction model to obtain a first historical defect size prediction value; predict the historical feature data not including the target dimension using the initial defect size prediction model to obtain a second historical defect size prediction value; perform a subtraction operation based on the first historical defect size prediction value and the second historical defect size prediction value to obtain the boundary contribution corresponding to the historical feature data of the target dimension; construct subsets for the historical feature data of different dimensions to obtain multiple subsets of the historical feature data not including the target dimension; calculate the weight value corresponding to each subset; perform a multiplication operation based on each weight value and the boundary contribution to obtain the contribution degree sub-score corresponding to each subset; perform a summation operation on each contribution degree sub-score to obtain the contribution degree corresponding to the historical feature data of the target dimension, so as to obtain the contribution degree corresponding to the historical feature data of different dimensions; sort the historical feature data in descending order of contribution degree to obtain the historical feature queue.

[0103] In the specific implementation process, the training module 1 is also used to: copy the target historical feature data according to a predetermined multiple to obtain multiple copied data corresponding to the target historical feature data; and horizontally splice the copied data to the historical feature dataset to obtain the enhanced dataset.

[0104] In the specific implementation process, the prediction module 3 is specifically used to: use the target defect size prediction model to predict the feature data, and obtain the first predicted value corresponding to each subtree of the target defect size prediction model; perform mean calculation on each of the first predicted values ​​to obtain the defect size prediction value.

[0105] This application trains a pre-defined random forest regression network using a feature-based ranking and enhanced sample method to obtain target defect size prediction models corresponding to different defect dimensions. It enhances the relative weights of these models in the input feature set, improving the model's sensitivity to core physical features and thus increasing inversion accuracy and stability. Feature data is extracted from the current magnetic flux leakage detection data of the target pipeline. The target defect size prediction models are then used to predict the feature data, obtaining predicted defect size values ​​corresponding to each defect dimension, thereby improving the accuracy of defect size prediction.

[0106] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps:

[0107] Step 1: Based on the historical magnetic flux leakage detection data of the target pipeline, a pre-set random forest regression network is trained using a feature-based ranking and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions.

[0108] Step 2: Extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0109] Step 3: Use the target defect size prediction model to predict the feature data to obtain the defect size prediction value corresponding to each defect dimension.

[0110] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0112] The specific implementation process of the above method steps can be found in the embodiments of the above arbitrary defect size prediction method, which will not be repeated here.

[0113] This application trains a pre-defined random forest regression network using a feature-based ranking and enhanced sample method to obtain target defect size prediction models corresponding to different defect dimensions. It enhances the relative weights of these models in the input feature set, improving the model's sensitivity to core physical features and thus increasing inversion accuracy and stability. Feature data is extracted from the current magnetic flux leakage detection data of the target pipeline. The target defect size prediction models are then used to predict the feature data, obtaining predicted defect size values ​​corresponding to each defect dimension, thereby improving the accuracy of defect size prediction.

[0114] Another embodiment of this application provides an electronic device, which can be a server. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. The program of the electronic device, executed by the processor, can implement the functions or steps of a defect size prediction method on the server side.

[0115] In one embodiment, an electronic device is provided, which can be a client. The electronic device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. The program of the electronic device, executed by the processor, can implement the functions or steps of a defect size prediction method on the client side.

[0116] Another embodiment of this application provides an electronic device, including at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, performs the following method steps:

[0117] Step 1: Based on the historical magnetic flux leakage detection data of the target pipeline, a pre-set random forest regression network is trained using a feature-based ranking and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions.

[0118] Step 2: Extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data;

[0119] Step 3: Use the target defect size prediction model to predict the feature data to obtain the defect size prediction value corresponding to each defect dimension.

[0120] The specific implementation process of the above method steps can be found in the embodiments of the above arbitrary defect size prediction method, which will not be repeated here.

[0121] This application trains a pre-defined random forest regression network using a feature-based ranking and enhanced sample method to obtain target defect size prediction models corresponding to different defect dimensions. It enhances the relative weights of these models in the input feature set, improving the model's sensitivity to core physical features and thus increasing inversion accuracy and stability. Feature data is extracted from the current magnetic flux leakage detection data of the target pipeline. The target defect size prediction models are then used to predict the feature data, obtaining predicted defect size values ​​corresponding to each defect dimension, thereby improving the accuracy of defect size prediction.

[0122] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. A method for predicting defect size, characterized in that, include: Based on historical magnetic flux leakage detection data of the target pipeline, a pre-set random forest regression network was trained using a feature-based sorting and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions. Feature data is obtained by extracting features from the current magnetic flux leakage detection data of the target pipeline; The feature data are predicted using the target defect size prediction models described above to obtain the defect size prediction values ​​corresponding to each defect dimension.

2. The method as described in claim 1, characterized in that, The historical magnetic flux leakage detection data based on the target pipeline is used to train a preset random forest regression network using a feature ranking and re-enhanced sample method to obtain a target defect size prediction model corresponding to different defect dimensions, specifically including: Feature extraction is performed on the historical magnetic flux leakage detection data to obtain a historical feature dataset; The preset random forest regression network is trained based on the historical feature dataset to obtain an initial defect size prediction model; The historical feature dataset was augmented using a feature contribution analysis method based on Shapley values ​​to obtain an augmented dataset. The initial defect size prediction model is trained using the augmented dataset to obtain the target defect size prediction model.

3. The method as described in claim 2, characterized in that, The step of training the preset random forest regression network based on the historical feature dataset to obtain the initial defect size prediction model specifically includes: The historical feature data in the historical feature dataset is labeled based on the historical defect size corresponding to different defect dimensions to obtain a labeled dataset. The preset random forest regression network is trained using the labeled dataset to obtain the initial defect size prediction model corresponding to different defect dimensions; Among them, the different leakage magnetic field detection dimensions include axial signal feature dimension, radial signal feature dimension and circumferential signal feature dimension; The different defect dimensions mentioned include length defect dimension, width defect dimension and depth defect dimension.

4. The method as described in claim 2, characterized in that, The process of using a feature contribution analysis method based on Shapley values ​​to perform sample set augmentation on the historical feature dataset to obtain an augmented dataset specifically includes: The historical feature data were sorted by contribution rate using a feature contribution analysis method based on Shapley value to obtain a historical feature queue. The historical feature data in the historical feature queue is filtered to obtain a predetermined number of target historical feature data with the highest contribution ranking; Based on the target historical feature data, the historical feature dataset is subjected to sample set augmentation processing to obtain an augmented dataset.

5. The method as described in claim 4, characterized in that, The step of using a feature contribution analysis method based on Shapley values ​​to sort the historical feature data by contribution to obtain a historical feature queue specifically includes: The initial defect size prediction model is used to predict the historical feature data, including the target dimension, to obtain the first historical defect size prediction value. The initial defect size prediction model is used to predict the historical feature data that does not include the target dimension, to obtain the second historical defect size prediction value. Based on the first historical defect size prediction value and the second historical defect size prediction value, a subtraction operation is performed to obtain the boundary contribution corresponding to the historical feature data of the target dimension; Subsets are constructed for the historical feature data of different dimensions to obtain multiple subsets of the historical feature data that do not contain the target dimension; Calculate the weight value corresponding to each of the subsets; Multiplication is performed based on each weight value and the boundary contribution to obtain contribution sub-scores corresponding to each subset. The contribution sub-scores are summed to obtain the contribution corresponding to the historical feature data of the target dimension, so as to obtain the contribution corresponding to the historical feature data of different dimensions respectively. The historical feature data are sorted in descending order of contribution to obtain the historical feature queue.

6. The method as described in claim 4, characterized in that, The step of performing sample set enhancement processing on the historical feature dataset based on the target historical feature data to obtain the enhanced dataset specifically includes: The target historical feature data is copied at a predetermined multiple to obtain multiple copied data corresponding to the target historical feature data. The copied data is horizontally concatenated to the historical feature dataset to obtain the enhanced dataset.

7. The method as described in claim 1, characterized in that, The step of using the target defect size prediction model to predict the feature data to obtain the defect size prediction value corresponding to each defect dimension specifically includes: The target defect size prediction model is used to predict the feature data to obtain the first predicted value corresponding to each subtree of the target defect size prediction model. The defect size prediction value is obtained by averaging each of the first predicted values.

8. A defect size prediction device, characterized in that, include: The training module is used to train a preset random forest regression network based on historical magnetic flux leakage detection data of the target pipeline using a feature-based sorting and re-enhanced sample method, so as to obtain a target defect size prediction model corresponding to different defect dimensions. The feature extraction module is used to extract features from the current magnetic flux leakage detection data of the target pipeline to obtain feature data; The prediction module is used to predict the feature data using the target defect size prediction model to obtain the defect size prediction value corresponding to each defect dimension.

9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the defect size prediction method according to any one of claims 1-7.

10. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the defect size prediction method according to any one of claims 1-7.