Pipeline defect prediction method and device based on scalar feature enhancement

By constructing a multi-level knowledge-guided neural network, combining the leakage magnetic field mechanism and expert experience, and extracting scalar and vector features of the leakage magnetic field signal, the problem of low prediction accuracy under complex defect morphologies in existing technologies is solved, and high-precision quantification of pipeline defect size is achieved.

CN122310088BActive Publication Date: 2026-07-24NORTHEASTERN UNIV CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHEASTERN UNIV CHINA
Filing Date
2026-06-01
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing methods for quantifying pipeline defects have low prediction accuracy under complex defect morphologies, resulting in the inability to accurately quantify defect size and posing safety hazards.

Method used

A pipeline defect prediction method based on scalar feature enhancement is adopted. By constructing a multi-level knowledge-guided neural network and combining the leakage magnetic field mechanism and expert experience, scalar and vector features of the leakage magnetic field signal are extracted to predict the defect size.

Benefits of technology

It improves the accuracy of defect size prediction under complex defect morphology, reduces the problem of insufficient feature extraction caused by uneven gradient distribution, and ensures the accuracy and robustness of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122310088B_ABST
    Figure CN122310088B_ABST
Patent Text Reader

Abstract

The application discloses a pipeline defect prediction method and device based on scalar feature enhancement, relates to the technical field of electromagnetic measurement and detection, and can be applied to the field of pipeline defect detection. The main purpose is to solve the problem of low measurement precision of defect size. Mainly includes the following steps: constructing a multi-level knowledge guided neural network based on the mechanism of a magnetic flux leakage field, guiding the training of a pipeline defect prediction model based on the multi-level knowledge guided neural network, and obtaining a trained pipeline defect prediction model; in response to a defect prediction instruction of a target pipeline, acquiring real-time magnetic flux leakage signal data of the target pipeline; extracting magnetic field strength components of different sampling points from the real-time magnetic flux leakage signal data to obtain a component matrix, extracting scalars based on the component matrix, and obtaining a scalar matrix of the real-time magnetic flux leakage signal data; and performing prediction processing on the component matrix and the scalar matrix through the pipeline defect prediction model to obtain a defect size prediction value. The application is mainly used for measuring pipeline defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electromagnetic metrology and testing technology, and can be applied to the field of pipeline defect detection. In particular, it relates to a pipeline defect prediction method and device based on scalar feature enhancement. Background Technology

[0002] Pipeline transportation is the primary method for transporting energy sources such as oil and natural gas. During long-term service, the inner walls of pipelines are susceptible to corrosion, leading to defects. If these defects are not detected and quantified in a timely manner, they can cause leaks, resulting in serious safety hazards and economic losses. Magnetic flux leakage (MFL) testing is the mainstream technology for pipeline defect detection, and the accurate quantification of defect size is a crucial step in achieving pipeline integrity assessment.

[0003] Existing methods for quantifying pipeline defects primarily use the vector features of the magnetic field as input to a neural network. The network implicitly learns pipeline defect features from these vector features to predict the defect size. However, when the defect morphology is complex, the implicit learning may result in insufficient feature extraction due to uneven gradient distribution, thus affecting the accuracy of defect size prediction. Summary of the Invention

[0004] In view of this, the present invention provides a pipeline defect prediction method and device based on scalar feature enhancement, the main purpose of which is to solve the problem of low accuracy in existing defect size measurement.

[0005] According to one aspect of the present invention, a pipeline defect prediction method based on scalar feature enhancement is provided, comprising: A multi-level knowledge-guided neural network is constructed based on the leakage magnetic field mechanism, and the pipeline defect prediction model is trained based on the multi-level knowledge-guided neural network to obtain a trained pipeline defect prediction model. In response to the defect prediction command of the target pipeline, the real-time leakage magnetic flux signal data of the target pipeline is acquired; The magnetic field strength components at different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The component matrix and the scalar matrix are predicted using the pipeline defect prediction model to obtain the predicted defect size.

[0006] According to another aspect of the present invention, a pipeline defect prediction device based on scalar feature enhancement is provided, comprising: The training module is used to construct a multi-level knowledge-guided neural network based on the leakage magnetic field mechanism, and to guide the training of the pipeline defect prediction model based on the multi-level knowledge-guided neural network, so as to obtain the pipeline defect prediction model after training. The acquisition module is used to acquire real-time magnetic flux leakage signal data of the target pipeline in response to the defect prediction command of the target pipeline. The extraction module is used to extract the magnetic field strength components of different sampling points from the real-time magnetic flux leakage signal data, obtain the component matrix, and perform scalar extraction based on the component matrix to obtain the scalar matrix of the real-time magnetic flux leakage signal data. The prediction module is used to perform prediction processing on the component matrix and the scalar matrix through the pipeline defect prediction model to obtain the predicted value of the defect size.

[0007] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform operations corresponding to the above-described pipeline defect prediction method based on scalar feature enhancement.

[0008] According to another aspect of the present invention, a terminal is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the pipeline defect prediction method based on scalar feature enhancement described above.

[0009] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages: This invention provides a pipeline defect prediction method and apparatus based on scalar feature enhancement. In this embodiment, in response to a defect prediction command for a target pipeline, real-time magnetic flux leakage signal data of the target pipeline is acquired. Magnetic field strength components at different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The pipeline defect prediction model performs prediction processing on the component matrix and the scalar matrix to obtain a predicted defect size. Furthermore, the training of the pipeline defect prediction model is guided by a multi-level knowledge-guided neural network, significantly reducing the problem of insufficient feature extraction due to uneven gradient distribution when the defect morphology is complex. This reduces the prediction bias risk of relying solely on vector implicit learning in complex defect scenarios. Simultaneously, it ensures that the model can simultaneously utilize vector direction information and scalar intensity information for complementary perception, thereby significantly improving the accuracy of defect size prediction under complex defect morphologies.

[0010] 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, it can be implemented according to the contents of the specification. Furthermore, in order 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

[0011] 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: Figure 1 A flowchart of a pipeline defect prediction method based on scalar feature enhancement provided by an embodiment of the present invention is shown; Figure 2 A flowchart illustrating a method for constructing a multi-level knowledge-guided neural network according to an embodiment of the present invention is shown. Figure 3 This diagram illustrates a pipe defect prediction model structure provided by an embodiment of the present invention. Figure 4 This diagram illustrates the internal composition of a component branch network and a scalar branch network provided in an embodiment of the present invention. Figure 5 This diagram illustrates the internal composition of a feature fusion network according to an embodiment of the present invention. Figure 6 A block diagram of a pipeline defect prediction device based on scalar feature enhancement provided by an embodiment of the present invention is shown. Figure 7 A schematic diagram of the structure of a terminal provided in an embodiment of the present invention is shown. Detailed Implementation

[0012] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0013] To address the issue of low accuracy in existing defect size measurement methods, this invention provides a pipeline defect prediction method based on scalar feature enhancement. This method can be applied to pipeline magnetic flux leakage (MFL) detection scenarios, utilizing a hardware system consisting of a pipeline inspection robot and a server. This hardware system uses a pipeline inspection robot equipped with an MFL sensor array to sample MFL signals at different sampling points within the pipeline under inspection in real time, and transmits the sampled data to the server. On the server side, a pre-deployed, trained pipeline defect prediction model extracts features and predicts the collected data to achieve quantitative size identification of defects in the pipeline under inspection. The server can be a local server or a cloud server, and data communication between the pipeline inspection robot and the server can be via a local area network (LAN) or a wide area network (WAN), without specific limitations.

[0014] like Figure 1 As shown, the method includes steps 101-104: 101. Construct a multi-level knowledge-guided neural network based on the leakage magnetic field mechanism, and use the multi-level knowledge-guided neural network to guide the training of the pipeline defect prediction model, thereby obtaining a trained pipeline defect prediction model.

[0015] In this embodiment of the invention, before identifying pipeline defects, a pipeline defect prediction model needs to be pre-built and trained, and then deployed on a server to predict the defect size. This model is trained based on a multi-level knowledge-guided neural network, which includes the pipeline defect prediction model to be trained and other guiding networks used to guide the model's training. Training samples are input into the multi-level knowledge-guided neural network, and the model is guided to learn the relationship between defect size and leakage magnetic field signal through the training sample labels and the processing results of each guiding network. Since the multi-level knowledge-guided neural network is built based on the leakage magnetic field mechanism, compared to a purely data-driven model, it is better able to capture the intrinsic physical correlation between magnetic flux leakage and defects from the principle of the leakage magnetic field. This mechanistic constraint makes the network more robust to input noise and sample sparsity.

[0016] In one embodiment of the present invention, for further illustration and limitation, such as Figure 2 As shown, the steps involve constructing a multi-layered knowledge-guided neural network based on the leakage magnetic field mechanism, including: 1011. Based on the leakage magnetic field mechanism, simulated leakage magnetic field signal training samples are constructed, and based on the simulated leakage magnetic field signal training samples, a mechanism feature guidance network for injecting mechanism features is trained.

[0017] 1012. Construct and train an experience-aided subnetwork for outputting experience distribution based on expert experience.

[0018] 1013. Construct a cascaded representation subnetwork based on two-point representation to generate the sample prediction distribution and align it with the empirical distribution.

[0019] 1014. Based on the pipeline defect prediction model to be trained, the mechanism feature guidance network, the experience auxiliary sub-network, and the cascaded expression sub-network, a multi-level knowledge-guided neural network is constructed.

[0020] In this embodiment of the invention, the multi-level knowledge-guided neural network uses a pipeline defect prediction model to be trained as the backbone network, and introduces a mechanism feature guidance network, an experience-assisted sub-network, and a cascaded expression sub-network as knowledge sources. This network constrains the physical consistency of predictions based on the physical laws of leakage magnetic fields; the experience-assisted sub-network, based on expert experience, constrains the empirical distribution of defects output by the backbone network; and a two-point representation method is used to design the cascaded expression sub-network to learn the distribution characteristics of sample defect prediction values. These three sub-networks are trained collaboratively with the backbone network to form a complete multi-level knowledge-guided neural network, thereby improving the accuracy and robustness of defect prediction at three levels: physical mechanism, expert knowledge, and data distribution.

[0021] The mechanism-guided network is a pre-trained model that completes training and locks model parameters. It is trained using simulated magnetic leakage signal training samples constructed based on the leakage magnetic field mechanism. These simulated magnetic leakage signal training samples are not the leakage magnetic field signals themselves, but rather feature quantities used to characterize the leakage magnetic field signals, namely component features and scalar feature vectors. These features are derived based on the magnetic dipole model. The magnetic dipole model is a simplified physical model that approximates the magnetic charge distribution on a defect wall as a pair of positive and negative magnetic charges. Based on this model, the expression for the leakage magnetic field corresponding to a specific defect size can be derived, i.e., the orthogonal components of the leakage magnetic field under different defect size parameters are used to simulate the leakage magnetic field. Then, simulated magnetic leakage signal training samples containing component features and scalar feature vectors are constructed based on these orthogonal components.

[0022] The experience-assisted subnetwork also serves as a pre-trained model to complete training and lock model parameters. This model includes a feature extractor and a random forest regressor. During training, empirical features are first extracted from the theoretical distribution based on the feature extractor, forming a defect feature set composed of expert experience. This feature set includes the components of the magnetic field in the X, Y, and Z spatial directions. , , Relevant characteristics. For the axial component and its spatial derivative ′, calculate respectively The horizontal distance between the positive and negative peaks of ′ and The horizontal distance between the positive and negative peaks, and the peak-to-peak value; and the combination relationship between the derivative peak position and the original peak position. For the circumferential component and radial component The horizontal distance between the positive and negative peaks and the peak-to-peak value are extracted separately. Furthermore, for the synthetic modulus... Calculate its peak-to-peak value and the horizontal distance between the positive and negative peak values; for angular features The amplitude of its variation and the horizontal distance between extreme points are extracted. These features collectively describe the spatial broadening, amplitude intensity, and gradient of the leakage magnetic field waveform. These features are then input into a random forest regressor to output empirical predicted values. These empirical predicted values ​​are then transformed into an empirical distribution using a distribution mapping function, serving as a supervisory signal for the sample prediction distribution of the backbone network. The distribution mapping function can be based on a fixed residual variance or a random forest prediction variance. During the subsequent training of the backbone network, the model parameters of this empirical auxiliary sub-network do not participate in backpropagation.

[0023] The cascaded representation subnetwork is constructed based on the two-point representation method to convert the predicted values ​​output during the training process of the backbone network into sample prediction distributions, thereby aligning with the empirical distribution output by the empirical auxiliary subnetwork. This allows the empirical auxiliary subnetwork to guide the backbone network to learn statistical laws at the distribution level, integrating empirical knowledge into the prediction process in the form of uncertainty constraints, rather than simply fitting a single defect size value.

[0024] In one embodiment of the present invention, for further explanation and definition, the training process of the pipeline defect prediction model includes: The same training sample is input into the pipeline defect prediction model and the mechanism feature guidance network respectively; the mechanism features of the training sample are extracted by the pipeline defect prediction model, and the predicted value of the sample defect size is generated based on the mechanism features; the mechanism guidance features are extracted by the mechanism feature guidance network. The empirical features carried by the training samples are input into the empirical auxiliary sub-network to generate an empirical distribution; and the predicted value of the sample defect size is converted into a sample prediction distribution through the cascaded expression sub-network. Based on the loss between the mechanism-guided features and the mechanism features, a mechanism feature loss function is constructed; based on the loss between the sample predicted distribution and the empirical distribution, a distribution loss function is constructed; based on the loss between the sample defect size prediction value and the actual defect size carried by the training samples, a prediction value loss function is constructed. The parameters of the pipeline defect prediction model are trained by jointly using the mechanistic feature loss function, the distribution loss function, and the prediction value loss function, resulting in a fully trained pipeline defect prediction model.

[0025] In this embodiment of the invention, a pipeline defect prediction model is trained collaboratively by three branches: the backbone network extracts mechanistic features from the input samples and outputs predicted defect size points; the mechanism-guided network extracts mechanism-guided features as a reference for the mechanistic features extracted by the backbone network; and the empirical auxiliary sub-network generates an empirical distribution based on empirical features. These empirical features are numerical indicators extracted from the theoretical distribution of the original leakage magnetic field signal based on expert knowledge and physical mechanisms. Unlike the original signal itself, they explicitly quantify key morphological features related to defects in the signal waveform, such as peak and valley positions, amplitude differences, and gradient changes, corresponding to the defect feature set used to train the empirical auxiliary sub-network. Simultaneously, the cascaded representation sub-network converts the point prediction values ​​of the backbone network into a sample prediction distribution using a two-point representation method, thereby aligning the sample prediction distribution with the empirical distribution, using the empirical distribution as a supervisory signal for the sample prediction distribution. Furthermore, based on the aforementioned reference features and supervisory signal, and the output of the backbone network, a corresponding loss function is constructed. This multi-dimensional loss function is then used to train the backbone network, i.e., the parameters of the pipeline defect prediction model.

[0026] The mechanistic features include mechanistic features from multiple feature extraction stages, each stage corresponding to a feature extraction network layer in the pipeline defect prediction model. Correspondingly, the mechanistic guidance network, which has the same feature extraction network structure as the pipeline defect prediction model, also extracts mechanistic guidance features from the corresponding stages. Therefore, with minimizing the feature residual constraints at each stage as the optimization objective, a mechanistic feature loss function is constructed, expressed as: ; in, This represents the mechanistic characteristics of the i-th stage. This represents the mechanistic characteristics of the (i-1)th stage. This represents the mechanism-guided characteristics of the (i-1)th stage. Represents feature loss, This indicates the feature of aligning the two sides of a comma. This represents the square of the L2 norm.

[0027] The distribution loss function is constructed based on the KL (Kullback-Leibler Divergence) divergence between the sample predicted distribution and the empirical distribution to measure the difference between the two distributions. This function is expressed as: ; in, Represents the distributed loss function. Indicates from arrive KL divergence of the distribution Indicates the sample prediction distribution. Let j represent the empirical distribution, and j represent the interval index after discretization of the defect size. This represents the probability that the empirical distribution of the output of the empirical auxiliary subnetwork lies in the j-th interval. This represents the probability that the sample predictions output by the cascaded expression subnetworks are distributed in the j-th interval.

[0028] The predicted loss function is constructed based on the mean squared error between the predicted value and the true label of the sample, and is expressed as: ;in, Let represent the loss function for prediction, where n represents the predicted value corresponding to the nth training sample. This represents the true label corresponding to the nth training sample, and N represents the total number of training samples in a batch.

[0029] In the process of joint training with multiple loss functions, since the feature loss function is designed for the feature extraction network, while the prediction loss function and the distribution loss function are trained from different dimensions for the final output of the backbone network, the prediction loss function and the distribution loss function can be weighted and combined to construct a joint loss function. : ; in, The weight represents the weight of the distributed loss function, which can be 0.3. Backpropagation is performed based on the joint loss and feature loss, updating only the parameters of the pipeline defect prediction model and the cascaded representation subnetwork, and iterating repeatedly until the loss converges or the preset number of training rounds is reached.

[0030] It should be noted that the specific process by which the cascaded representation subnetwork converts the defect size prediction value into a sample prediction distribution includes: converting each sample defect prediction value, such as the defect depth prediction value, into a prediction value distribution vector using a two-point representation. This vector has non-zero probability values ​​only at two adjacent discrete positions, and the magnitude of these two probability values ​​depends on the distance of the true label value from these two positions. Then, the cascaded representation subnetwork is trained so that its output sample prediction distribution continuously approximates this empirical distribution. In the two-point representation, a parameter K is first set to discretize the range of defect size values ​​into several equally spaced intervals. For a given prediction value y, its two adjacent discrete positions are found: the left boundary s and the right boundary t. ;in, This indicates rounding down. This indicates rounding up. Then, the two distribution weights are calculated: This represents the probability of assigning the predicted value y to the left boundary s. This represents the probability that the predicted value y is assigned to the right boundary t. Ultimately, the distribution vector corresponding to the predicted value y is constructed as a vector of length K, where the values ​​are taken only at positions s and t. and With all other positions set to 0, the sample predicted distribution is obtained. .

[0031] In one embodiment of the present invention, for further explanation and limitation, the training process of the mechanism feature-guided network includes: For different defect sizes, leakage magnetic field signals were simulated based on the leakage magnetic field mechanism, and the axial, circumferential, and radial components, as well as the magnitude and angular characteristics of the simulated leakage magnetic field signals, were analyzed. A mechanism feature vector is constructed by combining the modulus feature, the angle feature, the axial component, the circumferential component, and the radial component. The mechanism feature vector is used as sample data, and the defect size corresponding to the mechanism feature vector is used as the sample label to construct training samples for simulated magnetic flux leakage signals. The simulation signal prediction model is trained using the simulated magnetic flux leakage signal training samples. After training is completed, the feature extraction layer in the simulation signal prediction model is extracted as the mechanism feature-guided network.

[0032] In this embodiment of the invention, the mechanistic feature guidance network in the multi-level knowledge-guided neural network is a feature extraction layer based on a pre-trained simulation signal prediction model with locked model parameters. The structure of this simulation signal prediction model is the same as that of the pipeline defect prediction model, both including a feature extraction layer and a prediction layer. In the multi-level knowledge-guided neural network, only the pre-trained feature extraction layer is extracted as the mechanistic feature guidance network used to inject guiding features during the training process of the pipeline defect prediction model. During the training process of the simulation signal prediction model, an analytical expression for analyzing the leakage magnetic field generated by the simulated leakage magnetic field signal is first established based on the magnetic dipole model. This expression represents the axial, circumferential, and radial components of the simulated leakage magnetic field signal. The expression is then used to analyze the axial, circumferential, and radial components of the simulated leakage magnetic field signal, centered on the defect center (…). , , In a Cartesian coordinate system established with the origin as the origin, the axial direction as the x-axis, the circumferential direction as the y-axis, and the radial direction as the z-axis, any field point ( , , The parsing expression of ) includes: ; ; ; in, Indicates the axial component. Indicates the circumferential component. Represents the radial component. This represents the equivalent magnetic surface charge density on the defect surface. Represents the permeability of free space. This represents the integral of the magnetic charge distribution with respect to the axis of the defect. This represents the integral over the magnetic charge distribution along the circumference of the defect. This represents the integral of the magnetic charge distribution over the radial direction of the defect. , , In order, the defects are represented in the corresponding , , The length in the direction. After obtaining the axial, circumferential, and radial components analytically, the modulus and angular characteristics are further calculated. The calculation formula is expressed as: ; ; in, Indicates the modulus characteristic. The angular features are represented. The calculated modulus and angular features are used as supplementary features, and together with the axial components of the three directions, a mechanistic feature vector is constructed. This mechanistic feature vector is then used as sample data, and the defect size of the leakage magnetic field signal corresponding to the aforementioned components and features is used as the sample label to construct simulated leakage magnetic field signal training samples. By training the model using these training samples—that is, by training the model with simulated leakage magnetic field signals—the model can extract pure mechanistic features containing spatial geometric information. These mechanistic features are then used as guiding features in the subsequent training process of the pipeline defect prediction model. This allows the model to focus more on the spatial distribution pattern of the magnetic field that conforms to physical laws during the feature extraction stage, suppressing noise interference unrelated to defects, thereby improving the pipeline defect prediction network's generalization ability for complex defect morphologies and the quantitative accuracy of size inversion.

[0033] 102. In response to the defect prediction command of the target pipeline, acquire the real-time leakage magnetic flux signal data of the target pipeline.

[0034] In this embodiment of the invention, the target pipeline is the pipeline currently undergoing pipeline defect monitoring, including but not limited to long-distance oil and gas pipelines, urban gas pipeline networks, petrochemical process pipelines, and subsea transportation pipelines. The real-time magnetic flux leakage signal data is a sequence of raw time-series signals continuously sampled along the pipeline axis at fixed spatial steps. This data contains multiple discrete sampling points, each corresponding to a spatial position along the pipeline axis, recording the mixed magnetic field strength value directly measured by the sensor array at that position, including magnetic field strength components in the axial, circumferential, and radial dimensions. The sensor array can be mounted on a pipeline inspection robot, which moves at a constant speed along the pipeline axis and controls the sensor to acquire signals at a fixed sampling frequency via its onboard data acquisition card. In specific application scenarios, the data acquisition card can collect 5000 sampling points as a data packet, which is then sent to a server (the current execution entity) via a gigabit Ethernet module for subsequent data processing.

[0035] 103. Extract the magnetic field strength components of different sampling points from the real-time magnetic flux leakage signal data to obtain the component matrix, and perform scalar extraction based on the component matrix to obtain the scalar matrix of the real-time magnetic flux leakage signal data.

[0036] In this embodiment of the invention, to ensure the accuracy of defect identification, in addition to introducing the magnetic field strength component describing the leakage magnetic field from a vector dimension, scalar data describing the leakage magnetic field from a scalar dimension is also introduced during the defect identification process. To facilitate subsequent feature extraction, the magnetic field strength components corresponding to different sampling points are extracted from the real-time leakage magnetic field signal data, and these components are constructed into a standardized matrix, i.e., a component matrix. Then, based on the magnetic field strength of each sampling point in the component matrix, the magnetic field scalar of the sampling point is calculated, and a scalar matrix is ​​constructed.

[0037] Vector components retain complete directional information of the magnetic field in three orthogonal directions in space, ensuring accurate characterization of the defect geometry; while scalar features such as magnitude and angle are stripped of directional dependence, providing clear intensity and shape descriptions. By introducing scalar matrices, accurate explicit features are directly provided for the subsequent model prediction process, enabling the model to focus more on learning higher-order implicit features, thereby improving model learning efficiency and ensuring the rationality and accuracy of predictions.

[0038] In one embodiment of the present invention, for further explanation and limitation, the component matrix extraction process includes: For each sampling point, the magnetic field intensity components of the sampling point are extracted from the axial, circumferential and radial directions, and a component matrix is ​​constructed based on the magnetic field intensity component extraction results of all sampling points. The extraction process of the scalar matrix includes: For each sampling point, the magnitude feature of the magnetic field at the sampling point is calculated based on the extracted magnetic field intensity component of the sampling point, and the angular feature of the magnetic field at the sampling point is calculated based on the magnitude feature and the radial magnetic field intensity component. Based on the modulus and angle characteristics of all sampling points, a scalar matrix is ​​constructed.

[0039] In this embodiment of the invention, since the raw data collected includes data collected by sensors at different sampling points, the raw data is preprocessed and normalized to facilitate calculation. Specifically, the data packets sent by the hardware are frame structure verified and validity filtered to remove damaged or lost data packets, and valid data is indexed by channel and time. Subsequently, the axial, circumferential, and radial components of each sampling point are extracted and organized into a three-dimensional raw data matrix to complete the format alignment of heterogeneous data collection. On this basis, the 3σ criterion is used to detect and linearly interpolate to complete abnormal sampling points to eliminate invalid data caused by environmental noise and interference. Then, the normalized three components are normalized by min-max to map the data to the [0,1] interval. The normalization formula is: ,in, This represents the normalization result, where x represents the original component. Represents the smallest component. This represents the maximum component. Finally, by performing fixed-length block partitioning on the normalized three-channel matrix and discarding the scattered data at the tail that are not of fixed length, the standardized component matrix is ​​obtained. The dimension of the component matrix can be decomposed by the number of sensors. For example, when the detection robot is equipped with a magnetic flux leakage sensor array, the resulting component matrix is ​​represented as follows: Where 3 corresponds to the number of components, L is the number of sampling points, and W is the number of channels in the sensor array. That is, the component matrix includes the axial, circumferential, and radial components corresponding to each sensor channel at each sampling point.

[0040] After obtaining the component matrix, the scalar of the leakage magnetic signal is further calculated. The scalar includes magnitude and angle features. Specifically, based on any set of three components in the component matrix, a magnitude feature and an angle feature can be calculated. The final scalar matrix includes the magnitude and angle features corresponding to each sampling point and each sensor channel. The calculation formula for the magnitude feature is the same as that for the magnitude feature of the simulated leakage magnetic signal, and the calculation formula for the angle feature is the same as that for the angle feature of the simulated leakage magnetic signal, so it will not be repeated here.

[0041] 104. The component matrix and the scalar matrix are predicted using the pipeline defect prediction model to obtain the predicted defect size.

[0042] In this embodiment of the invention, after obtaining the component matrix and the scalar matrix, both matrices are used together as input features of the model. The defect size is then predicted using a pipeline defect prediction model to obtain the predicted defect size value of the target pipeline. The predicted defect size value can include the predicted size values ​​of multiple defects individually. These predicted size values ​​include the predicted location, depth, length, and width of each defect. When the real-time magnetic flux leakage signal data corresponding to the component matrix covers multiple defects, the model can simultaneously output the independent size prediction results of each defect through instance segmentation or dense regression, achieving joint prediction of multiple defects in a single forward propagation.

[0043] The component matrix retains the original vector information of the magnetic field in the three orthogonal directions of axial, circumferential and radial directions, providing the model with fine spatial orientation characteristics of the magnetic field near the defect; the scalar matrix is ​​explicitly calculated from the component matrix through physical formulas, including scalar features with clear physical meaning such as the composite magnitude of the magnetic field and the azimuth angle. Based on the joint prediction of the two, the accuracy of the size prediction can be effectively ensured.

[0044] In one embodiment of the present invention, for further explanation and limitation, the component matrix and the scalar matrix are predicted using the pipeline defect prediction model to obtain a predicted defect size value, including: The component matrix is ​​used to extract features through the component branch network to obtain component feature vectors; The scalar matrix is ​​used to extract features through the scalar branch network to obtain scalar feature vectors; The component feature vector and the scalar feature vector are weighted and fused through the feature fusion network to obtain the fused feature. The predicted layer performs prediction processing on the fused features to obtain the predicted defect size value.

[0045] In embodiments of the present invention, such as Figure 3 As shown, the pipeline defect prediction model includes a feature extraction layer and a prediction layer. The feature extraction layer comprises component branch networks, scalar branch networks, and feature fusion networks. Figure 4 The diagram shows the internal structure of the component branch network and the scalar branch network. The component branch network is used for feature extraction from the component matrix. This network uses a multi-layer convolutional neural network, including a first layer with a 7×7 kernel, a stride of 2, 3 input channels, and 64 output channels, followed by BatchNorm batch normalization and ReLU (Rectified Linear Unit) modules; layers 2-5 include residual modules, with input channels of 64, 128, 256, and 512 respectively for each layer; the sixth layer is a global average pooling layer, and the output feature vector is... The scalar branch network is used for feature extraction from the scalar matrix. The network structure employs a lightweight convolutional network, including: Layer 1 is a 5×5 convolution with a stride of 2, 2 input channels, and 32 output channels, followed by BatchNorm and ReLU; Layers 2 and 3 incorporate residual modules, with 64 and 128 input channels respectively for each layer; Layer 4 is a global average pooling layer, outputting a feature vector. The feature fusion network dynamically fuses features extracted from the dual branches, achieving feature-level knowledge interaction. The prediction layer takes the fused features as input and performs nonlinear dimensionality reduction and regression mapping through a multi-level fully connected network, ultimately outputting a numerical prediction of the defect size. The prediction layer consists of three independent networks, each responsible for outputting predicted values ​​for length, width, and depth; that is, the predicted defect size includes the length, width, and depth of the defect.

[0046] In one embodiment of the present invention, for further explanation and limitation, the component feature vector and the scalar feature vector are weighted and fused through the feature fusion network to obtain fused features, including: The component feature vector and the scalar feature vector are dimensionally aligned and concatenated to obtain the concatenated feature; Based on the attention mechanism, the morphological features of the defects represented by the splicing features are captured, and the fusion weights corresponding to the component feature vector and the scalar feature vector are adaptively generated according to the dependency relationship between the component feature vector, the scalar feature vector and the morphological features. The component feature vector and the scalar feature vector are weighted and fused based on the fusion weight to obtain the fused feature.

[0047] In embodiments of the present invention, such as Figure 5 The diagram shown illustrates the internal structure of the feature fusion network, where the feature fusion network receives component feature vectors. and scalar eigenvectors .Will and Dimension alignment is performed using a fully connected layer. Mapping to Same dimensions: ; Furthermore, and By concatenating along the channel dimension, we obtain the concatenated features: .

[0048] Furthermore, on Global average pooling is performed, and a weight vector is generated through two fully connected layers. Among them, GAP ( ) indicates global average pooling. and These are the ReLU (Modified Linear Unit) and Sigmoid (Sigmoid) activation functions, respectively. This represents the weight matrix of the first fully connected layer. This represents the weight matrix of the second fully connected layer. u is the weight matrix including... and A two-dimensional vector, processed using Softmax (normalized exponential function) and Perform weight normalization to obtain The weighted fusion process of the component feature vectors and the scalar feature vectors is expressed as follows: + The attention mechanism enables the network to adaptively adjust its dependence on component feature vectors and scalar feature vectors based on the morphological characteristics of the input defect. For shallow defects, scalar features may be more discriminative, and the network automatically increases the weight of scalar features; for defects with clear boundaries, component feature vectors may be more important, and the network automatically increases the weight of component feature vectors.

[0049] This invention provides a pipeline defect prediction method based on scalar feature enhancement. In this embodiment, in response to a defect prediction command for a target pipeline, real-time magnetic flux leakage signal data of the target pipeline is acquired. Magnetic field strength components at different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The pipeline defect prediction model performs prediction processing on the component matrix and the scalar matrix to obtain a predicted defect size. Furthermore, the training of the pipeline defect prediction model is guided by a multi-level knowledge-guided neural network, significantly reducing the problem of insufficient feature extraction due to uneven gradient distribution when the defect morphology is complex. This reduces the prediction bias risk of relying solely on vector implicit learning in complex defect scenarios. Simultaneously, it ensures that the model can simultaneously utilize vector direction information and scalar intensity information for complementary perception, thereby significantly improving the accuracy of defect size prediction under complex defect morphologies.

[0050] Furthermore, as a response to the above Figure 1 The implementation of the method shown in this invention provides a pipeline defect prediction device based on scalar feature enhancement, such as... Figure 6 As shown, the device includes: Training module 31 is used to construct a multi-level knowledge-guided neural network based on the leakage magnetic field mechanism, and to guide the training of the pipeline defect prediction model based on the multi-level knowledge-guided neural network, so as to obtain the pipeline defect prediction model after training. The acquisition module 32 is used to acquire real-time magnetic flux leakage signal data of the target pipeline in response to the defect prediction command of the target pipeline; Extraction module 33 is used to extract magnetic field intensity components at different sampling points from the real-time magnetic flux leakage signal data to obtain a component matrix, and to perform scalar extraction based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The prediction module 34 is used to perform prediction processing on the component matrix and the scalar matrix through the pipeline defect prediction model to obtain the defect size prediction value.

[0051] Furthermore, the training module 31 includes: The first building unit is used to construct simulated magnetic leakage signal training samples based on the magnetic leakage field mechanism, and to train a mechanism feature guidance network for injecting mechanism features based on the simulated magnetic leakage signal training samples. The second building unit is used to build and train an experience-aided subnetwork for outputting experience distributions based on expert experience. The third building unit is used to construct a cascaded representation subnetwork based on the two-point representation method to generate the sample prediction distribution and align it with the empirical distribution; The fourth construction unit is used to construct a multi-level knowledge-guided neural network based on the pipeline defect prediction model to be trained, the mechanism feature guidance network, the experience auxiliary sub-network, and the cascaded expression sub-network.

[0052] Furthermore, the training module 31 also includes: The first training unit is used to input the same training sample into the pipeline defect prediction model and the mechanism feature guidance network respectively; extract the mechanism features of the training sample through the pipeline defect prediction model, and generate the sample defect size prediction value based on the mechanism features; and extract the mechanism guidance features through the mechanism feature guidance network. The second training unit is used to input the empirical features carried by the training samples into the empirical auxiliary sub-network to generate an empirical distribution through the empirical auxiliary sub-network; and to convert the predicted value of the sample defect size into a sample prediction distribution through the cascaded expression sub-network. The loss construction unit is used to construct a mechanism feature loss function based on the loss between the mechanism-guided feature and the mechanism feature; to construct a distribution loss function based on the loss between the sample prediction distribution and the empirical distribution; and to construct a prediction value loss function based on the loss between the predicted sample defect size and the actual defect size carried by the training sample. The third training unit is used to train the parameters of the pipeline defect prediction model by jointly using the mechanism feature loss function, the distribution loss function, and the prediction value loss function, so as to obtain the pipeline defect prediction model after training.

[0053] Furthermore, the training module 31 also includes: The simulation unit is used to simulate the leakage magnetic field signal based on the leakage magnetic field mechanism for different defect sizes, and to analyze the axial, circumferential, and radial components of the simulated leakage magnetic field signal, as well as the magnitude and angular characteristics. The fifth construction unit is used to construct a mechanism feature vector by using the modulus feature, the angle feature, the axial component, the circumferential component and the radial component, and to construct a simulation magnetic flux leakage signal training sample by using the mechanism feature vector as sample data and the defect size corresponding to the mechanism feature vector as the sample label. The fourth training unit is used to train the simulation signal prediction model using the simulation leakage magnetic signal training samples. The structure of the simulation signal prediction model is the same as that of the pipeline defect prediction model, including a feature extraction layer and a prediction layer. The extraction unit is used to extract the feature extraction layer in the simulation signal prediction model as a mechanism feature-guided network after training is completed.

[0054] Furthermore, the pipeline defect prediction model includes a feature extraction layer and a prediction layer, wherein the feature extraction layer includes a component branch network, a scalar branch network, and a feature fusion network; the prediction module 34 includes: The first extraction unit is used to extract features from the component matrix through the component branch network to obtain component feature vectors. The second extraction unit is used to extract features from the scalar matrix through the scalar branch network to obtain a scalar feature vector. The fusion unit is used to perform weighted fusion of the component feature vector and the scalar feature vector through the feature fusion network to obtain fused features; The prediction unit is used to perform prediction processing on the fused features through the prediction layer to obtain a defect size prediction value, wherein the defect size prediction value includes the length, width and depth of the defect.

[0055] Furthermore, in specific application scenarios, the fusion unit is used to perform dimensional alignment and concatenation of the component feature vector and the scalar feature vector to obtain concatenated features; Based on the attention mechanism, the morphological features of the defects represented by the splicing features are captured, and the fusion weights corresponding to the component feature vector and the scalar feature vector are adaptively generated according to the dependency relationship between the component feature vector, the scalar feature vector and the morphological features. The component feature vector and the scalar feature vector are weighted and fused based on the fusion weight to obtain the fused feature.

[0056] This invention provides a pipeline defect prediction device based on scalar feature enhancement. In this embodiment, in response to a defect prediction command for a target pipeline, real-time magnetic flux leakage signal data of the target pipeline is acquired. Magnetic field strength components at different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The pipeline defect prediction model performs prediction processing on the component matrix and the scalar matrix to obtain a predicted defect size. Furthermore, the training of the pipeline defect prediction model is guided by a multi-level knowledge-guided neural network, significantly reducing the problem of insufficient feature extraction due to uneven gradient distribution when the defect morphology is complex. This reduces the prediction bias risk of relying solely on vector implicit learning in complex defect scenarios. Simultaneously, it ensures that the model can simultaneously utilize vector direction information and scalar intensity information for complementary perception, thereby significantly improving the accuracy of defect size prediction under complex defect morphologies.

[0057] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction that can execute the pipeline defect prediction method based on scalar feature enhancement in any of the above method embodiments.

[0058] Figure 7 The diagram shows a structural schematic of a terminal according to an embodiment of the present invention. The specific implementation of the present invention is not limited to the specific implementation of the terminal.

[0059] like Figure 7 As shown, the terminal may include: a processor 402, a communication interface 404, a memory 406, and a communication bus 408.

[0060] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.

[0061] Communication interface 404 is used for network communication with other devices such as clients or other servers.

[0062] The processor 402 is used to execute program 410, which can specifically execute the relevant steps in the above embodiment of the pipeline defect prediction method based on scalar feature enhancement.

[0063] Specifically, program 410 may include program code that includes computer operation instructions.

[0064] Processor 402 may be a central processing unit (CPU), a specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The terminal may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0065] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0066] Specifically, program 410 can be used to cause processor 402 to perform the following operations: A multi-level knowledge-guided neural network is constructed based on the leakage magnetic field mechanism, and the pipeline defect prediction model is trained based on the multi-level knowledge-guided neural network to obtain a trained pipeline defect prediction model. In response to the defect prediction command of the target pipeline, the real-time leakage magnetic flux signal data of the target pipeline is acquired; The magnetic field strength components at different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The component matrix and the scalar matrix are predicted using the pipeline defect prediction model to obtain the predicted defect size.

[0067] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0068] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A pipeline defect prediction method based on scalar feature enhancement, characterized in that, include: A multi-level knowledge-guided neural network is constructed based on the leakage magnetic field mechanism, and the pipeline defect prediction model is trained based on the multi-level knowledge-guided neural network to obtain a trained pipeline defect prediction model. The pipeline defect prediction model includes a feature extraction layer and a prediction layer. The feature extraction layer includes a component branch network, a scalar branch network, and a feature fusion network. In response to the defect prediction command of the target pipeline, the real-time leakage magnetic flux signal data of the target pipeline is acquired; The magnetic field strength components of different sampling points are extracted from the real-time magnetic flux leakage signal data to obtain a component matrix. Scalar extraction is then performed based on the component matrix to obtain a scalar matrix of the real-time magnetic flux leakage signal data. The extraction process of the component matrix includes: for each sampling point, the magnetic field strength components of the sampling point are extracted from the axial, circumferential, and radial directions, and a component matrix is ​​constructed based on the magnetic field strength component extraction results of all sampling points. The extraction process of the scalar matrix includes: for each sampling point, calculating the magnitude feature of the magnetic field where the sampling point is located based on the extraction result of the magnetic field intensity component of the sampling point, and calculating the angle feature of the magnetic field where the sampling point is located based on the magnitude feature and the radial magnetic field intensity component; and constructing a scalar matrix based on the magnitude feature and angle feature of all sampling points. The pipeline defect prediction model performs prediction processing on the component matrix and the scalar matrix to obtain a defect size prediction value, including: extracting features from the component matrix through the component branch network to obtain component feature vectors; extracting features from the scalar matrix through the scalar branch network to obtain scalar feature vectors; weighting and fusing the component feature vectors and scalar feature vectors through the feature fusion network to obtain fused features; and performing prediction processing on the fused features through the prediction layer to obtain a defect size prediction value, wherein the defect size prediction value includes the length, width, and depth of the defect.

2. The pipeline defect prediction method based on scalar feature enhancement according to claim 1, characterized in that, The multi-level knowledge-guided neural network constructed based on the leakage magnetic field mechanism includes: Based on the leakage magnetic field mechanism, simulated leakage magnetic field signal training samples are constructed, and based on the simulated leakage magnetic field signal training samples, a mechanism feature guidance network for injecting mechanism features is trained. An experience-aided subnetwork for outputting experience distributions is constructed and trained based on expert experience. A cascaded representation subnetwork is constructed based on the two-point representation method to generate the sample prediction distribution and align it with the empirical distribution; Based on the pipeline defect prediction model to be trained, the mechanism feature guidance network, the experience auxiliary sub-network, and the cascaded expression sub-network, a multi-level knowledge-guided neural network is constructed.

3. The pipeline defect prediction method based on scalar feature enhancement according to claim 2, characterized in that, The training process of the pipeline defect prediction model includes: The same training sample is input into the pipeline defect prediction model and the mechanism feature guidance network respectively; the mechanism features of the training sample are extracted by the pipeline defect prediction model, and the predicted value of the sample defect size is generated based on the mechanism features; the mechanism guidance features are extracted by the mechanism feature guidance network. The empirical features carried by the training samples are input into the empirical auxiliary sub-network to generate an empirical distribution, and the predicted value of the sample defect size is converted into a sample prediction distribution through the cascaded expression sub-network. Based on the loss between the mechanism-guided features and the mechanism features, a mechanism feature loss function is constructed; based on the loss between the sample predicted distribution and the empirical distribution, a distribution loss function is constructed; based on the loss between the sample defect size prediction value and the actual defect size carried by the training samples, a prediction value loss function is constructed. The parameters of the pipeline defect prediction model are trained by jointly using the mechanistic feature loss function, the distribution loss function, and the prediction value loss function, resulting in a fully trained pipeline defect prediction model.

4. The pipeline defect prediction method based on scalar feature enhancement according to claim 2, characterized in that, The training process of the mechanism-guided network includes: For different defect sizes, leakage magnetic field signals were simulated based on the leakage magnetic field mechanism, and the axial, circumferential, and radial components, as well as the magnitude and angular characteristics of the simulated leakage magnetic field signals, were analyzed. A mechanism feature vector is constructed by combining the modulus feature, the angle feature, the axial component, the circumferential component, and the radial component. The mechanism feature vector is used as sample data, and the defect size corresponding to the mechanism feature vector is used as the sample label to construct training samples for simulated magnetic flux leakage signals. The simulation signal prediction model is trained using the simulation leakage magnetic field signal training samples. The structure of the simulation signal prediction model is the same as that of the pipeline defect prediction model, including a feature extraction layer and a prediction layer. After training is completed, the feature extraction layer in the simulation signal prediction model is extracted as the mechanism feature-guided network.

5. The pipeline defect prediction method based on scalar feature enhancement according to claim 1, characterized in that, The component feature vector and the scalar feature vector are weighted and fused through the feature fusion network to obtain fused features, including: The component feature vector and the scalar feature vector are dimensionally aligned and concatenated to obtain the concatenated feature; Based on the attention mechanism, the morphological features of the defects represented by the splicing features are captured, and the fusion weights corresponding to the component feature vector and the scalar feature vector are adaptively generated according to the dependency relationship between the component feature vector, the scalar feature vector and the morphological features. The component feature vector and the scalar feature vector are weighted and fused based on the fusion weight to obtain the fused feature.

6. A pipeline defect prediction device based on scalar feature enhancement, characterized in that, The device is used to perform the operations corresponding to the pipeline defect prediction method based on scalar feature enhancement as described in claim 1, including: The training module is used to construct a multi-level knowledge-guided neural network based on the leakage magnetic field mechanism, and to guide the training of the pipeline defect prediction model based on the multi-level knowledge-guided neural network, so as to obtain the pipeline defect prediction model after training. The acquisition module is used to acquire real-time magnetic flux leakage signal data of the target pipeline in response to the defect prediction command of the target pipeline. The extraction module is used to extract the magnetic field strength components of different sampling points from the real-time magnetic flux leakage signal data, obtain the component matrix, and perform scalar extraction based on the component matrix to obtain the scalar matrix of the real-time magnetic flux leakage signal data. The prediction module is used to perform prediction processing on the component matrix and the scalar matrix through the pipeline defect prediction model to obtain the predicted value of the defect size.

7. A storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the pipeline defect prediction method based on scalar feature enhancement as described in any one of claims 1-5.

8. A terminal, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the pipeline defect prediction method based on scalar feature enhancement as described in any one of claims 1-5.