Pipeline magnetic flux leakage defect detection method and device, storage medium and computer equipment
By acquiring pipeline component attribute information to generate component condition features, using a baseline reconstruction model to construct baseline background signals and extract residual signals, the problem of separating pipeline component signals from defect signals is solved, improving the accuracy and robustness of magnetic flux leakage defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV CHINA
- Filing Date
- 2026-05-19
- Publication Date
- 2026-07-21
Smart Images

Figure CN122218080B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pipeline inspection technology, and in particular to a method, apparatus, storage medium and computer equipment for detecting pipeline magnetic flux leakage defects. Background Technology
[0002] Pipelines are an important mode of transportation. With increasing service life, factors such as metal aging, corrosion from external media, and damage to the internal mechanical structure of the metal can lead to various types of defects in oil and gas pipelines. Magnetic flux leakage (MFL) internal detection technology identifies defects by collecting the magnetic lines of force leaking from the magnetized pipe wall. Due to its high detection efficiency and suitability for long-distance online inspection, it is widely used in the field of internal defect detection for long-distance oil and gas pipelines.
[0003] Currently, with the development of deep learning technology, existing magnetic flux leakage defect detection schemes typically convert magnetic flux leakage signals into images or tensor representations, and then use models such as convolutional neural networks for defect identification. However, pipelines contain numerous components such as welds, flanges, and tees, which themselves generate strong magnetic flux leakage responses, and their signal characteristics are highly similar to defect signals. Existing detection methods fail to explicitly model and separate the component responses at the signal level, leading to false positives, false negatives, and incomplete detection box boundaries in scenarios where component signals and defect signals are superimposed or have similar shapes. In particular, real defects in the component's neighborhood are easily treated as background and ignored, affecting the accuracy and robustness of the detection results. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, storage medium, and computer device for detecting pipeline magnetic flux leakage defects, which realizes explicit modeling and decoupling of component response at the signal level, thereby improving the accuracy of defect detection.
[0005] According to a first aspect of this application, a method for detecting magnetic flux leakage defects in pipelines is provided, the method comprising: Obtain the original magnetic flux leakage signal of the pipeline to be inspected, including the pipeline component and its attribute information; Based on the attribute information of the pipeline component, component conditional features are generated to characterize the pipeline component's interference characteristics with leakage magnetic field signals. The original magnetic flux leakage signal and the component condition characteristics are input into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions; The residual signal is calculated by comparing the original leakage magnetic field signal with the baseline background signal, and the residual signal is extracted. Defect detection is performed based on the residual signal, and the defect detection result is output.
[0006] Optionally, the method further includes: Feature extraction is performed on the original magnetic flux leakage signal to obtain time-domain and / or frequency-domain features; Input the time-domain features and / or the frequency-domain features into the component classification model to obtain the category of the pipeline component; The categories of the pipe components include at least one of the following: welds, tees, elbows, flanges, and straight pipe sections.
[0007] Optionally, the component condition features include at least one of the following: the spatial distribution area of the pipeline component in the original magnetic flux leakage signal, the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipeline component, the semantic features of the component category, and the interference intensity of the pipeline component on defect detection at different spatial locations.
[0008] Optionally, the component condition features include the spatial distribution region of the pipeline component in the original magnetic flux leakage signal, and the generation of component condition features based on the attribute information of the pipeline component to characterize the interference characteristics of the pipeline component on the magnetic flux leakage signal includes: Obtain the boundary information of the pipe assembly; wherein, the boundary information includes the start and end coordinates of the pipe assembly in the axial and circumferential directions of the pipe; Create a blank mask matrix of the same size as the original magnetic leakage signal; In the blank mask matrix, the pixel positions corresponding to the boundary information are assigned values to form a pixel matrix; The pixel matrix is subjected to morphological dilation to assign values to the boundary information by extending it outward by a predetermined number of pixels, thereby forming the spatial distribution region.
[0009] Optionally, the component condition features include the target distance between each pixel in the original magnetic leakage signal and the boundary of the pipeline component. The generation of component condition features based on the attribute information of the pipeline component to characterize the interference characteristics of the pipeline component on the magnetic leakage signal includes: The contour coordinates of the pipeline assembly are extracted based on the spatial distribution area; The shortest distance between the current pixel in the original magnetic leakage signal and the contour coordinates of different pipe components is calculated and used as the target distance of the current pixel.
[0010] Optionally, the interference intensity of the pipeline assembly on defect detection at different spatial locations is expressed as follows: ; In the formula, Indicates the interference intensity of a pixel; Indicates component category The corresponding interference coefficient; This represents the target distance between a pixel and the boundary of the pipeline component; This represents the distance attenuation parameter.
[0011] Optionally, the step of performing residual calculation on the original leakage magnetic signal and the baseline background signal, and extracting the residual signal, includes: The original leakage magnetic field signal is subtracted from the baseline background signal to obtain the difference signal; The difference signal is used as the residual signal; or, the difference signal is weighted based on the component condition characteristics to obtain the residual signal.
[0012] Optionally, the method further includes: Construct a defect-free sample signal set containing different pipeline components; The baseline reconstruction model is obtained by iteratively training the system with the optimization objective of minimizing the reconstruction loss function between the reconstructed signal and the defect-free sample signal. The reconstruction loss function includes mean squared error loss and structural similarity loss.
[0013] Optionally, the defect detection based on the residual signal includes: Determine the local noise estimate of the residual signal; Based on the component conditional features and the local noise estimate, a dynamic threshold that varies with spatial location is generated; The local region in the residual signal where the signal intensity is greater than the dynamic threshold is defined as the defect region; Feature extraction is performed on the defective region to obtain defect features; The defect detection result is generated based on the defect characteristics.
[0014] Optionally, the method further includes: Obtain the mileage position of the pipeline assembly and the defect detection result along the axial direction of the pipeline to be inspected; Construct a pipeline topology sequence based on the mileage location; If the distribution of the defect detection results in the pipeline topology sequence does not conform to the arrangement order or distance constraints of each pipeline component, the confidence level of the defect detection results will be reduced.
[0015] Optionally, the method further includes: Extract the peak and valley information within the defect region corresponding to the defect detection result; Based on the relative positions of the peak and valley information, the boundary of the defect region is expanded to obtain a candidate region. Calculate the leakage magnetic flux morphology characteristics corresponding to the candidate region; wherein, the leakage magnetic flux morphology characteristics include at least one of peak-to-valley difference, valley spacing, and local energy; The defect detection results are screened out based on the leakage magnetic field morphology characteristics.
[0016] According to a second aspect of this application, a pipeline magnetic flux leakage defect detection device is provided, the device comprising: The structure identification module is used to obtain the pipe component and its attribute information to which the original magnetic flux leakage signal of the pipe to be detected belongs; The feature generation module is used to generate component condition features that characterize the characteristics of the pipeline component to interfere with leakage magnetic signals based on the attribute information of the pipeline component. The baseline reconstruction module is used to input the original magnetic flux leakage signal and the component condition characteristics into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions. The defect detection module is used to perform residual calculation on the original magnetic leakage signal and the baseline background signal, extract the residual signal, and perform defect detection based on the residual signal, and output the defect detection result.
[0017] Optionally, the structure recognition module is specifically used to extract features from the original magnetic flux leakage signal to obtain time-domain features and / or frequency-domain features; input the time-domain features and / or the frequency-domain features into the component classification model to obtain the category of the pipe component; wherein, the category of the pipe component includes at least one of: weld, tee, elbow, flange and straight pipe section.
[0018] Optionally, the component condition features include at least one of the following: the spatial distribution area of the pipeline component in the original magnetic flux leakage signal, the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipeline component, the semantic features of the component category, and the interference intensity of the pipeline component on defect detection at different spatial locations.
[0019] Optionally, the component condition features include the spatial distribution region of the pipe component in the original magnetic flux leakage signal. The feature generation module is specifically used to obtain the boundary information of the pipe component; wherein, the boundary information includes the start and end coordinates of the pipe component in the axial and circumferential directions of the pipe; create a blank mask matrix of the same size as the original magnetic flux leakage signal; assign values to the pixel positions corresponding to the boundary information in the blank mask matrix to form a pixel matrix; and perform morphological dilation processing on the pixel matrix to assign values to the boundary information by extending it outward by a preset number of pixels to form the spatial distribution region.
[0020] Optionally, the component condition features include the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipe component. The feature generation module is specifically used to extract the contour coordinates of the pipe component based on the spatial distribution area; calculate the shortest distance between the current pixel in the original magnetic flux leakage signal and the contour coordinates of different pipe components as the target distance of the current pixel.
[0021] Optionally, the interference intensity of the pipeline assembly on defect detection at different spatial locations is expressed as follows: ; In the formula, Indicates the interference intensity of a pixel; Indicates component category The corresponding interference coefficient; This represents the target distance between a pixel and the boundary of the pipeline component; This represents the distance attenuation parameter.
[0022] Optionally, the defect detection module is specifically used to subtract the original magnetic flux leakage signal from the baseline background signal to obtain a difference signal; use the difference signal as the residual signal; or, perform weighted processing on the difference signal based on the component condition characteristics to obtain the residual signal.
[0023] Optionally, the device further includes: The training module is used to construct a set of defect-free sample signals containing different pipeline components; iterative training is performed with the optimization objective of minimizing the reconstruction loss function between the reconstructed signal and the defect-free sample signal to obtain the baseline reconstruction model; wherein, the reconstruction loss function includes mean squared error loss and structural similarity loss.
[0024] Optionally, the defect detection module is specifically used to determine the local noise estimate of the residual signal; generate a dynamic threshold that varies with spatial location based on the component condition features and the local noise estimate; designate local regions in the residual signal where the signal intensity is greater than the dynamic threshold as defect regions; extract features from the defect regions to obtain defect features; and generate the defect detection result based on the defect features.
[0025] Optionally, the device further includes: The first verification module is used to obtain the mileage position of the pipeline component and the defect detection result along the axial direction of the pipeline to be inspected; construct a pipeline topology sequence based on the mileage position; if the distribution of the defect detection result in the pipeline topology sequence does not conform to the arrangement order or distance constraints of each pipeline component, the confidence level of the defect detection result is reduced.
[0026] Optionally, the device further includes: The second verification module is used to extract peak and valley information within the defect region corresponding to the defect detection result; expand the boundary of the defect region based on the relative position of the peak and valley information to obtain candidate regions; calculate the magnetic flux leakage morphology features corresponding to the candidate regions; wherein the magnetic flux leakage morphology features include at least one of peak-valley difference, valley spacing, and local energy; and screen out false detections of the defect detection result based on the magnetic flux leakage morphology features.
[0027] According to a third aspect of this application, a readable storage medium is provided on which a program or instructions are stored, which, when executed by a processor, implement the steps of the above-described method for detecting pipeline magnetic flux leakage defects.
[0028] According to a fourth aspect of this application, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described pipeline magnetic flux leakage defect detection method.
[0029] By employing the aforementioned technical solution, pipe components are identified, and their attribute information is used to construct component conditional features that characterize the degree of interference of the pipe components themselves with magnetic flux leakage signals. A baseline reconstruction model is used to predict the baseline background signal of the pipe component under defect-free conditions, and this baseline background signal is subtracted from the original magnetic flux leakage signal to obtain the residual signal. This residual signal is then used for defect detection. Thus, pipe components that may generate magnetic flux leakage signal interference are treated as modelable objects. The standard magnetic flux leakage response that the pipe component should have under current conditions is reconstructed through explicit modeling at the signal level. The component response is then separated from the original magnetic flux leakage signal, making the residual signal closer to the actual defect response, rather than simply masking the background or avoiding the component area at the result level. This not only reduces the detection interference caused by pipe components and effectively reduces the false alarm and false negative rates caused by structural interference, but also avoids the problem of missing real defects in the component's neighborhood due to directly masking the component area, improving the signal-to-noise ratio, recognition accuracy, and algorithm generalization ability for detecting minute defects in complex pipe component environments.
[0030] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0031] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic flowchart of the pipeline magnetic flux leakage defect detection method provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of the structure identification and component condition feature generation logic provided in an embodiment of this application; Figure 3 A structural block diagram of the pipeline magnetic flux leakage defect detection device provided in an embodiment of this application is shown; Figure 4 A schematic diagram of the electronic structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0032] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0033] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0034] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “attached” to another element, it can be directly connected or attached to the other element, or there may be intermediate elements present. Furthermore, the term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0035] Exemplary embodiments according to this application will now be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments may be implemented in many different forms and should not be construed as being limited to the embodiments set forth herein. It should be understood that these embodiments are provided so that the disclosure of this application is thorough and complete, and that the concept of these exemplary embodiments is fully conveyed to those skilled in the art.
[0036] This embodiment provides a method for detecting magnetic flux leakage defects in pipelines, such as... Figure 1 As shown, the method includes: Step 101: Obtain the pipe component to which the original magnetic leakage signal of the pipe to be tested belongs and its attribute information.
[0037] Among them, magnetic flux leakage signal is a signal obtained by magnetizing the pipeline and measuring the distribution of the magnetic flux leakage field in pipeline defect detection. Pipeline components are components in the pipeline to be inspected that may interfere with the magnetic flux leakage signal, such as welds, tees, elbows, flanges, straight pipe sections, and other pipeline components.
[0038] In this embodiment, by identifying the type of pipe component corresponding to the original magnetic flux leakage signal, the source of interference can be clearly identified, laying the foundation for subsequent targeted removal of background noise. Simultaneously, through pre-classification of the structure, structural signals can be avoided from being misidentified as defect signals, reducing the false detection rate from the source.
[0039] Specifically, the attribute information of the pipe assembly includes the pipe assembly type, geometric dimensions, material permeability, spatial location, and boundary shape. The original magnetic flux leakage signal can be input into a pre-trained assembly detection model, which can then automatically identify the pipe assembly attribute information contained within the signal.
[0040] In practical applications, step 101, obtaining the attribute information of the pipe component to which the original leakage magnetic signal of the pipe to be tested belongs, specifically includes the following steps: Step 101-1: Extract features from the original magnetic leakage signal to obtain time-domain and / or frequency-domain features.
[0041] Specifically, the original magnetic leakage signal contains rich structural information. In the time domain, weld signals typically exhibit high-amplitude peaks of a specific width, while tees or elbows show a large-scale rise in the background magnetic field. Therefore, statistical quantities such as the signal's mean, variance, peak-to-peak value, skewness, and kurtosis can be extracted as time-domain features. In the frequency domain, the texture features of different components have different energy distributions in the spectrum; for example, a spiral weld may exhibit a specific stripe distribution in the spectrum. Frequency domain features such as the dominant frequency and the proportion of spectral energy can be extracted using Fast Fourier Transform (FFT) or wavelet transform.
[0042] Step 101-2: Input the time-domain features and / or frequency-domain features into the component classification model to obtain the attribute information of the pipeline component.
[0043] In this embodiment, by extracting the time-domain and / or frequency-domain features of the leakage magnetic field signal and inputting them into the classification model, the model captures the local morphological differences of the signal through the time-domain features and the overall texture pattern of the signal through the frequency-domain features, ultimately identifying the type of pipeline component and its attribute information. This achieves automated and accurate identification of complex pipeline components, solving the problem of low recognition rate of single features under complex operating conditions.
[0044] Understandably, the component classification model uses time-domain and frequency-domain features extracted from a large number of magnetic flux leakage signal samples labeled with pipe component types as training data, and then trains a classifier using support vector machines, random forests, or lightweight neural networks.
[0045] Step 102: Based on the attribute information of the pipeline component, generate component condition features to characterize the interference characteristics of the pipeline component on leakage magnetic signals.
[0046] Among them, the component condition features are used to reflect the distortion patterns of magnetic flux leakage signals caused by different types of pipe components. These features may include at least one of the following: the spatial distribution area of the pipe component in the original magnetic flux leakage signal, the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipe component, the semantic features of the component category, and the interference intensity of the pipe component on defect detection at different spatial locations.
[0047] In this embodiment, the interference degree of different pipe components on defect detection at different spatial locations is quantified by converting the attribute information of the pipe components into component condition features. This provides clear physical constraints for baseline reconstruction, enabling magnetic flux leakage detection under different operating conditions to create a relatively stable and consistent benchmark background environment. This avoids fluctuations or false alarms in detection results caused by nonlinear interference from pipe components, and helps to achieve accurate monitoring of the true state of complex pipe fitting areas.
[0048] For example, the spatial distribution region of the pipe assembly in the original magnetic flux leakage signal is used to define the exact location and coverage of the assembly signal in the two-dimensional magnetic flux leakage unfolded map. This allows for focused fitting of the assembly's baseline response within this region during baseline reconstruction, avoiding misinterpreting noise from non-assembly areas as assembly signals. For instance, for welds, the spatial distribution region typically appears as an elongated strip extending along the axial direction of the pipe to be inspected.
[0049] The target distance between each pixel in the original magnetic leakage signal and the boundary of the pipe component is used to reflect the gradient of the influence of the component boundary on the surrounding signal. Physically, the magnetic leakage field generated by the pipe component is not confined to its geometric boundary but diffuses outward, forming a gradually changing interference field. Pixels closer to the component boundary are more affected by the component interference; the interference decreases with distance. By calculating the shortest distance from each pixel to the component outline, the model can quantify this spatial attenuation effect. Therefore, when reconstructing the baseline, it can not only reconstruct the signal in the core region of the component but also accurately predict the gradually changing interference in its neighborhood, effectively solving the problem of spurious defect signals easily generated in the component edge region in traditional methods.
[0050] The semantic features of component categories are vectorized codes for component categories, enabling the baseline reconstruction model to identify components of different categories, whose magnetic flux leakage response patterns are distinctly different. For example, welds typically produce bimodal or unimodal signals, while flanges generate a wide range of magnetic field distortions. By introducing semantic features, the model can automatically retrieve corresponding prior knowledge based on category information to generate baseline signals that conform to the physical laws of that type of component, thereby improving the accuracy and specificity of the reconstruction.
[0051] The interference intensity of pipeline components at different spatial locations on defect detection is a comprehensive quantification of the aforementioned spatial distribution and target distance, directly characterizing the severity of signal interference at a particular point. In subsequent residual calculations or defect detection stages, regions with high interference intensity imply greater signal uncertainty. The model can accordingly reduce the trust weight of signals in these regions or increase the detection threshold, thereby significantly reducing the false alarm rate while maintaining the detection rate.
[0052] In one embodiment, for the spatial distribution region of the pipe assembly in the original magnetic flux leakage signal, step 102 specifically includes: acquiring the boundary information of the pipe assembly; creating a blank mask matrix of the same size as the original magnetic flux leakage signal; assigning values to the pixel positions corresponding to the boundary information in the blank mask matrix to form a pixel matrix; and performing morphological dilation processing on the pixel matrix to assign values to the boundary information by extending it outward by a predetermined number of pixels to form a spatial distribution region.
[0053] The boundary information includes the starting and ending coordinates of the pipe assembly in the axial and circumferential directions of the pipe.
[0054] In this embodiment, the boundary contour of the pipeline component is copied by a mask matrix, and further morphological dilation is applied to ensure that the spatial distribution area can cover the edge magnetic field diffusion area caused by the pipeline component. This ensures that the spatial distribution area completely includes the signal range affected by structural interference, avoids the omission of interference features due to slight differences in boundary positioning, and improves the completeness of subsequent feature extraction.
[0055] It is understandable that the length and width of this blank mask matrix are the same as the two-dimensional unfolded original magnetic flux leakage data. Figure 1 Initially, the value is usually set to 0, representing the background area. After assignment, the value at that pixel location changes to the specified value, while unassigned areas remain at 0, thus obtaining a binary pixel matrix used to mark the precise geometric location of the component.
[0056] In one embodiment, the target distance between each pixel in the original magnetic leakage signal and the boundary of the pipe assembly is defined as follows: Step 102 specifically includes: extracting the contour coordinates of the pipe assembly based on the spatial distribution region; calculating the shortest distance between the current pixel in the original magnetic leakage signal and the contour coordinates of different pipe assemblies, which is used as the target distance of the current pixel.
[0057] In this embodiment, by calculating the shortest distance from each pixel to the contours of different pipe components, a quantitative characterization of the interference signal's spatial variation is achieved. This allows pixels farther from the pipe components to receive larger distance values, while pixels closer to the boundaries receive smaller distance values. This quantifies the gradient of the pipe components' influence on the surrounding area, providing a distance metric for differentiated modeling of interference intensity.
[0058] In one embodiment, for the semantic features of component categories, step 102 specifically includes: performing one-hot encoding or embedding vector mapping on the component categories in the pipeline component attribute information to obtain semantic features.
[0059] In this embodiment, semantic features can transform discrete category labels into high-dimensional numerical vectors that the model can process, enabling the model to distinguish interference patterns of different component categories and share similar interference patterns among categories, thus greatly improving the generalization ability of features.
[0060] In one embodiment, the interference intensity of the pipeline assembly at different spatial locations for defect detection is determined. Step 102 specifically includes: weighting the interference coefficient corresponding to the component category and the exponential decay distance from the pixel to the boundary to obtain the interference intensity of each pixel.
[0061] Specifically, the interference intensity of pipeline components on defect detection at different spatial locations is expressed as follows: ; In the formula, Indicates the interference intensity of a pixel; Indicates component category The corresponding interference coefficient; This represents the target distance between a pixel and the boundary of the pipeline component; This represents the distance attenuation parameter. The smaller the value, the faster the interference intensity decreases with increasing distance, indicating that the leakage magnetic field of this type of component is more concentrated; The larger the value, the wider the interference range.
[0062] In this embodiment, the distribution of interference intensity of different pipeline components on leakage magnetic field signals is defined by an exponential decay function. This enables precise quantification of the interference field intensity of the pipeline components, allowing the generated component conditional features to simultaneously possess class discrimination capability and spatial continuity, significantly improving the fitting accuracy of the baseline reconstruction model for complex background signals.
[0063] Step 103: Input the original leakage magnetic field signal and component condition characteristics into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions.
[0064] The baseline background signal refers to the standard magnetic flux leakage response signal that the sensor should collect under the current pipe assembly conditions, assuming that there are no defects in the pipe wall.
[0065] In this embodiment, by fusing the original magnetic flux leakage signal with component condition features, the baseline reconstruction model focuses on the background signal generated by the pipeline component itself. This achieves automated fitting and unified reconstruction of the magnetic flux leakage signal corresponding to the pipeline component in a defect-free state. This provides a relatively stable and consistent benchmark reference for pipe fittings with different geometric configurations and physical properties, avoiding interference from signal distortion caused by the complexity of the pipeline component in defect identification. This makes the defect features obtained from subsequent residual calculations more reliable and repeatable, facilitating accurate monitoring of the condition of key pipeline components and improving the detection rate of minor defects. Furthermore, because the baseline reconstruction model incorporates component condition features as prior information, it is more adaptable to different types of pipeline components. Even when a certain type of pipeline component appears less frequently in the training samples, it can still generate a reasonable background signal based on its features, improving the model's generalization ability and reconstruction stability.
[0066] Understandably, the baseline reconstruction model is trained using supervised learning methods with the leakage magnetic field signal and corresponding component condition features of pipe samples containing pipe components but without defects as training data.
[0067] In one embodiment, training the baseline reconstruction model specifically includes: constructing a set of defect-free sample signals containing different pipeline components; and iteratively training the model with the optimization objective of minimizing the reconstruction loss function between the reconstructed signal and the defect-free sample signal to obtain the baseline reconstruction model.
[0068] The reconstruction loss function includes mean squared error loss and structural similarity loss.
[0069] In this embodiment, on the one hand, by constructing a defect-free sample set containing various components and performing iterative training, the model can deeply learn and master the electromagnetic response laws of different pipeline components under standard conditions, achieving automated and high-precision modeling of complex background signals. On the other hand, through the synergistic constraint of mean squared error loss (MSE) and structural similarity loss (SSIM), the reconstruction baseline is ensured to maintain both numerical accuracy and waveform structural characteristics, avoiding excessive smoothing or waveform distortion of the baseline signal at complex structures, which helps to improve the system's sensitivity to identifying minute defects and the reliability of the results.
[0070] Step 104: Perform residual calculation on the original leakage magnetic signal and the baseline background signal, and extract the residual signal.
[0071] In this embodiment, by subtracting the baseline background signal from the original signal, deep decoupling of defect features from the background signal of complex structures is achieved. This eliminates the need for tedious feature engineering or manual filtering of interference signals from different pipe fitting locations based on human experience, thus suppressing background noise from pipe assemblies and highlighting signal residuals caused solely by defects. Furthermore, this residual calculation eliminates nonlinear magnetic field fluctuations caused by differences in pipe fitting geometry, avoiding excessive smoothing of signal edges and weak defects by traditional filtering methods. It preserves the original amplitude and morphological characteristics of defects, making the extracted residual signal more objective and accurate, thus facilitating precise detection of minute internal pipe damage.
[0072] In practical application scenarios, the specific implementation methods of step 104 include: Method 1 involves subtracting the original leakage magnetic signal from the baseline background signal to obtain the difference signal, which is then used directly as the residual signal.
[0073] Specifically, the portion of the original magnetic leakage flux representation that can be explained by the component is stripped away, leaving the residual signal that more closely approximates the actual defect response, thus achieving signal-level decoupling of component interference. Moreover, this method is computationally simple, requires low equipment computing power, and is suitable for scenarios with clear component boundaries and high baseline reconstruction accuracy.
[0074] Method 2 involves subtracting the original leakage magnetic signal from the baseline background signal to obtain a difference signal, and then weighting the difference signal based on the component condition characteristics to obtain a residual signal.
[0075] Specifically, near component boundaries, due to complex signal mixing, baseline reconstruction may contain slight deviations, and direct subtraction may introduce spurious noise. In this case, the aforementioned generated interference weights can be used to weight the difference signal. For example, for areas with high interference intensity, i.e., near component boundaries, the weight of the residual signal in that area can be reduced, thereby suppressing interference caused by baseline reconstruction uncertainty. This preserves the real defect signals that may exist in the component's neighborhood while reducing the confidence level of the signal in that area. Thus, while maintaining the detection rate, the false alarm rate is effectively reduced, achieving a better detection effect than traditional hard-shielding methods.
[0076] The formula for calculating the residual signal is as follows: ; In the formula, Represents the residual signal; This represents the original leakage magnetic field signal; Indicates the baseline background signal; This represents element-wise multiplication. The interference intensity of the pipeline assembly.
[0077] Step 105: Perform defect detection based on the residual signal and output the defect detection results.
[0078] The defect detection results include: defect bounding box, defect category, defect segmentation mask, defect size regression value, etc.
[0079] The pipeline magnetic flux leakage defect detection method provided in this application identifies pipeline components and utilizes their attribute information to construct component condition features that characterize the degree of interference of the pipeline components themselves with magnetic flux leakage signals. A baseline reconstruction model is used to predict the baseline background signal of the pipeline component under defect-free conditions, and this baseline background signal is subtracted from the original magnetic flux leakage signal to obtain a residual signal. This residual signal is then used to complete defect detection. Thus, pipe fittings that may generate magnetic flux leakage signal interference are treated as modelable objects. The standard magnetic flux leakage response that the pipe fitting should have under current conditions is reconstructed through explicit modeling at the signal level, and then the component response is separated from the original magnetic flux leakage signal, making the residual signal closer to the true defect response, rather than simply shielding the background or avoiding the component area at the result level. This not only reduces the detection interference caused by pipeline components and effectively reduces the false alarm and false negative rates caused by structural interference, but also avoids the problem of missing real defects in the component's neighborhood caused by directly shielding the component area, improving the signal-to-noise ratio, recognition accuracy, and algorithm generalization ability for detecting small defects in complex pipe fitting environments.
[0080] In practical applications, step 105 specifically includes the following steps: Step 105-1: Determine the local noise estimate of the residual signal.
[0081] The local noise estimate is a measure of noise intensity calculated based on the signal standard deviation, absolute median, or local variance within a sliding window of the residual signal. It reflects the fluctuation level of background noise within that window. Examples include local standard deviation or background energy.
[0082] Understandably, the sliding window can be set according to the spacing of the sensor array or the expected minimum defect width. This avoids smoothing out tiny defects due to an excessively large window, or being affected by single-point jumps in the sensor due to an excessively small window.
[0083] Step 105-2: Based on component conditional features and local noise estimates, generate a dynamic threshold that varies with spatial location.
[0084] Specifically, the formula for calculating the dynamic threshold is: ; In the formula, Based on the threshold, The interference intensity of the pipeline assembly. For component confidence, For local noise estimation, , , This is the adjustment coefficient.
[0085] Step 105-3: The local area in the residual signal where the signal intensity is greater than the dynamic threshold is taken as the defect area.
[0086] Step 105-4: Extract features from the defect area to obtain defect features.
[0087] Step 105-5: Generate defect detection results based on defect features.
[0088] In this embodiment, by calculating the local noise estimate and combining it with the aforementioned generated component interference intensity characteristics, a threshold that varies with spatial location is jointly generated, thereby adaptively compensating for the interference intensity of different pipe fitting locations. Thus, in the component's neighborhood or in areas with high noise, the dynamic threshold automatically increases to suppress false alarms. In straight pipe sections with high signal-to-noise ratios, the threshold is appropriately decreased to improve sensitivity to minor defects. This effectively solves the problem of false alarms or missed alarms caused by uneven residual fluctuations in complex structures, significantly improving the accuracy of defect region segmentation and the robustness of detection results while maintaining detection sensitivity, thus balancing the detection rate and false alarm rate.
[0089] In one embodiment, after step 105, the pipeline magnetic flux leakage defect detection method further includes: obtaining the mileage position of the pipeline components and defect detection results along the axial direction of the pipeline to be detected; constructing a pipeline topology sequence based on the mileage position; if the distribution of defect detection results in the pipeline topology sequence does not conform to the arrangement order or distance constraints of each pipeline component, then reducing the confidence level of the defect detection results.
[0090] The mileage position refers to the cumulative distance along the pipeline axis from the reference starting point to the target position, used to calibrate the spatial coordinates of different pipeline structures and inspection results. Distance constraints include component spacing statistical constraints and component neighborhood detection strategy constraints. The arrangement order is used to determine whether the arrangement of components such as welds, flanges, tees, and branch pipes along the axial mileage conforms to a normal pipeline structure; the component spacing statistical constraints are used to determine whether the spacing between adjacent welds, flange combination relationships, or the occurrence position of certain components are within a reasonable range; the component neighborhood detection strategy constraints are used to correct the confidence level and threshold of defect candidates when they are located in the neighborhood of a specific component, based on the component type.
[0091] In this embodiment, by using the pipeline topology sequence to perform spatial consistency verification on the defect detection results, defect results that are physically impossible to exist due to signal crosstalk or false detection can be eliminated. This reduces the output of false defects caused by local misjudgments.
[0092] For example, there is usually a minimum spacing between two circumferential welds, and the locations of tees or valves are often marked with specific mileage markers. By constructing a pipeline topology sequence, the system can verify whether the detected defect locations conform to these physical constraints. If multiple welds are detected consecutively within a very short mileage range, this does not comply with pipeline design specifications and is highly likely a false detection.
[0093] In one embodiment, after step 105, the pipeline magnetic flux leakage defect detection method further includes: extracting peak and valley information within the defect area corresponding to the defect detection result; expanding the boundary of the defect area based on the relative position of the peak and valley information to obtain candidate areas; calculating the magnetic flux leakage morphology features corresponding to the candidate areas; and filtering out false detections of the defect detection result based on the magnetic flux leakage morphology features.
[0094] Among them, the leakage magnetic flux morphology characteristics include at least one of peak-to-valley difference, valley spacing, and local energy. The leakage magnetic flux morphology characteristics include the waveform morphology quantization parameters of the leakage magnetic flux signal in the defect region, the peak-to-valley difference characterizes the amplitude intensity of the defect signal, the valley spacing reflects the axial extension length of the defect, and the local energy reflects the overall activity level of the signal in the defect region.
[0095] In this embodiment, by extracting the peak and valley morphological features of the leakage magnetic field signal and expanding the candidate region for secondary verification, it is possible to distinguish between genuine defects and false defects caused by noise or residual interference from pipe components, and to eliminate false defects with inconsistent waveform characteristics. This allows for fine-tuning of the preliminary detection results from a signal morphology perspective, further improving detection accuracy and ensuring the accuracy of defect identification.
[0096] In one specific embodiment, a two-stage pipeline magnetic flux leakage defect detection method based on component-conditional baseline reconstruction and residual separation is provided. Specifically, it includes: (1) Preprocessing of the multi-channel magnetic flux leakage signals collected by the magnetic flux leakage detector mainly includes: detrending processing, normalization processing, interpolation expansion, multi-scale bilateral filtering noise reduction, and peak-valley feature enhancement based on the magnetic dipole model.
[0097] (2) After preprocessing, the multi-channel magnetic flux leakage signal is mapped into a two-dimensional unfolded image, a pseudo-color image, or a multi-channel tensor representation to obtain the original magnetic flux leakage signal. .
[0098] (3) The original leakage magnetic signal Input the component detection model to detect at least one of the following: weld, flange, tee, branch pipe, elbow, and reducer. Output the component category, component location, and component confidence level.
[0099] (4) such as Figure 2 As shown, based on the component detection results, component prior information (component conditional features) is generated. Through the structured encoding described above, component information is no longer just category labels, but is transformed into conditional variables that can be directly used for subsequent reconstruction and detection. Specifically, this prior component information includes at least: a component mask image. Component distance transformation diagram Component category embedding vector and component interference weight diagram .
[0100] (5) such as Figure 2 As shown, the original leakage magnetic signal With component prior information Input the component-conditional baseline reconstruction model together The baseline leakage magnetic response (baseline background signal) of the component is obtained. , can be represented as: .
[0101] The component-conditional baseline reconstruction model can be implemented using conditional autoencoders, conditional U-Nets, conditional generative networks, template matching reconstructors, or rule modelers. Its essence is not to shield the components, but rather to first understand the components and then interpret them, modeling the magnetic leakage response that the components should produce.
[0102] (6) Convert the original leakage magnetic signal Compared with the reconstructed component baseline leakage magnetic response By subtracting, we obtain the residual signal. The above processing removes the portion of the original leakage flux representation that can be interpreted by the component, leaving a residual signal that is closer to the actual defect response. This achieves signal-level decoupling of component interference and yields a residual signal that is closer to the actual defect response.
[0103] It should be understood that when it is necessary to further suppress uncertain responses near component boundaries, weighted residuals can also be used.
[0104] (7) Transfer the residual signal With component prior information Input defect detection model Defect detection results were obtained. , can be represented as: .
[0105] In this step, prior information about components, such as component category, location, distance, and interference intensity, is transformed into conditions for generating dynamic thresholds and dynamic candidate regions. These conditions can be further used to generate dynamic thresholds and dynamic candidate regions, so as to achieve adaptive defect detection in the neighborhood of different components.
[0106] (8) Defect detection results The component defect relationship constraint verification includes: component topological order constraints, component spacing statistical constraints, and component neighborhood detection strategy constraints. This allows for the combination of results that appear to be defects with those that are structurally plausible, reducing false defect outputs caused by local misjudgments. Consequently, the detection logic can be adaptively adjusted under different component types, background noise levels, and local operating conditions, improving stability in complex scenarios.
[0107] (9) In the defect detection results Based on this, peak and valley information of the magnetic flux leakage signal within each defect detection box (defect region) is extracted. First, the maximum peak value is located within the defect detection box, then the nearest valley value is searched to the left and right. The defect detection box is expanded based on the positions of the peak and valley values to obtain a more complete defect response coverage. Simultaneously, physical characteristics such as peak-valley difference, valley spacing, and local energy corresponding to candidate boxes are calculated, and defect detection boxes that do not conform to the physical laws of defects are filtered out according to preset thresholds or a lightweight classifier. This improves the reliability of subsequent defect length, width, and depth estimations and reduces background false detections and component pseudo-defects.
[0108] In this embodiment, by explicitly stripping the component response through component baseline reconstruction and residual separation, defect detection is built upon a cleaner residual signal, significantly reducing the probability of components such as welds, flanges, tees, and branch pipes being misidentified as defects. Compared to schemes that directly shield the component area, removing the component baseline still retains the real abnormal signals that may exist in the component's neighborhood, thus making it more advantageous for detecting defects near welds, corrosion in the flange neighborhood, and defects in complex connection areas.
[0109] The pipeline magnetic flux leakage defect detection method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0110] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0111] Furthermore, such as Figure 3As shown, as a specific implementation of the above-mentioned pipeline magnetic flux leakage defect detection method, this application provides a pipeline magnetic flux leakage defect detection device 300, which includes: a structure recognition module 301, a feature generation module 302, a baseline reconstruction module 303, and a defect detection module 304.
[0112] Among them, the structure recognition module 301 is used to obtain the pipeline component to which the original leakage magnetic signal of the pipeline to be detected belongs and its attribute information; The feature generation module 302 is used to generate component condition features that characterize the characteristics of the pipeline component to interfere with leakage magnetic signals based on the attribute information of the pipeline component. The baseline reconstruction module 303 is used to input the original leakage magnetic field signal and component condition characteristics into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions. The defect detection module 304 is used to perform residual calculation on the original leakage magnetic signal and the baseline background signal, extract the residual signal, and perform defect detection based on the residual signal, and output the defect detection result.
[0113] Furthermore, the structure recognition module 301 is specifically used to extract features from the original magnetic flux leakage signal to obtain time-domain features and / or frequency-domain features; input the time-domain features and / or frequency-domain features into the component classification model to obtain the category of the pipe component; wherein, the category of the pipe component includes at least one of: weld, tee, elbow, flange and straight pipe section.
[0114] Furthermore, the component condition features include at least one of the following: the spatial distribution area of the pipeline component in the original magnetic flux leakage signal, the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipeline component, the semantic features of the component category, and the interference intensity of the pipeline component on defect detection at different spatial locations.
[0115] Furthermore, the component condition features include the spatial distribution region of the pipeline component in the original magnetic flux leakage signal. The feature generation module 302 is specifically used to obtain the boundary information of the pipeline component. The boundary information includes the start and end coordinates of the pipeline component in the axial and circumferential directions of the pipeline. A blank mask matrix with the same size as the original magnetic flux leakage signal is created. The pixel positions corresponding to the boundary information are assigned values in the blank mask matrix to form a pixel matrix. The pixel matrix is subjected to morphological dilation processing to assign values to the boundary information by extending it outward by a preset number of pixels to form a spatial distribution region.
[0116] Furthermore, the component condition features include the target distance between each pixel in the original magnetic leakage signal and the boundary of the pipe component. The feature generation module 302 is specifically used to extract the contour coordinates of the pipe component based on the spatial distribution area; and to calculate the shortest distance between the current pixel in the original magnetic leakage signal and the contour coordinates of different pipe components as the target distance of the current pixel.
[0117] Furthermore, the interference intensity of pipeline components on defect detection at different spatial locations is expressed as follows: ; In the formula, Indicates the interference intensity of a pixel; Indicates component category The corresponding interference coefficient; This represents the target distance between a pixel and the boundary of the pipeline component; This represents the distance attenuation parameter.
[0118] Furthermore, the defect detection module 304 is specifically used to perform a subtraction operation between the original leakage magnetic signal and the baseline background signal to obtain a difference signal; use the difference signal as a residual signal; or, perform weighted processing on the difference signal based on the component condition characteristics to obtain a residual signal.
[0119] Furthermore, the pipeline magnetic flux leakage defect detection device 300 also includes: The training module (not shown in the figure) is used to construct a set of defect-free sample signals containing different pipeline components; iterative training is performed with the optimization objective of minimizing the reconstruction loss function between the reconstructed signal and the defect-free sample signal to obtain the baseline reconstruction model; wherein, the reconstruction loss function includes mean squared error loss and structural similarity loss.
[0120] Furthermore, the defect detection module 304 is specifically used to determine the local noise estimate of the residual signal; generate a dynamic threshold that varies with spatial location based on the component condition features and the local noise estimate; designate the local region in the residual signal where the signal intensity is greater than the dynamic threshold as the defect region; extract features from the defect region to obtain defect features; and generate defect detection results based on the defect features.
[0121] Furthermore, the pipeline magnetic flux leakage defect detection device 300 also includes: The first verification module (not shown in the figure) is used to obtain the mileage position of the pipeline components and defect detection results along the axial direction of the pipeline to be inspected; construct a pipeline topology sequence based on the mileage position; if the distribution of defect detection results in the pipeline topology sequence does not conform to the arrangement order or distance constraints of each pipeline component, the confidence of the defect detection results is reduced.
[0122] Furthermore, the pipeline magnetic flux leakage defect detection device 300 also includes: The second verification module (not shown in the figure) is used to extract peak and valley information in the defect area corresponding to the defect detection result; based on the relative position of the peak and valley information, the boundary of the defect area is expanded to obtain candidate areas; the leakage magnetic field morphology features corresponding to the candidate areas are calculated; wherein, the leakage magnetic field morphology features include at least one of peak-valley difference, valley spacing and local energy; and the defect detection results are screened out based on the leakage magnetic field morphology features.
[0123] Specific limitations regarding the pipeline magnetic flux leakage defect detection device can be found in the limitations of the pipeline magnetic flux leakage defect detection method described above, and will not be repeated here. Each module in the aforementioned pipeline magnetic flux leakage defect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independently of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0124] Based on the above, Figure 1 Accordingly, embodiments of this application also provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figure 1 The method for detecting magnetic flux leakage defects in pipelines is shown.
[0125] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.
[0126] Based on the above, Figure 1 The method shown, and Figure 3 The virtual device embodiment shown is designed to achieve the above objectives, such as... Figure 4 As shown in the figure, this application embodiment also provides a computer device 400, which includes a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the above-mentioned... Figure 1 The method for detecting magnetic flux leakage defects in pipelines is shown.
[0127] The memory 402 can be used to store software programs and various data. The memory 402 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 402 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 402 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0128] Processor 401 may include one or more processing units; optionally, processor 401 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 401.
[0129] Computer equipment can specifically include personal computers, servers, network devices, etc.
[0130] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB ports, card reader ports, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.
[0131] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platform, or it can be implemented by hardware.
[0133] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0134] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A method for detecting magnetic flux leakage defects in pipelines, characterized in that, The method includes: Obtain the original magnetic flux leakage signal of the pipeline to be inspected, including the pipeline component and its attribute information; Based on the attribute information of the pipeline component, component conditional features are generated to characterize the pipeline component's interference characteristics with leakage magnetic field signals. The original magnetic flux leakage signal and the component condition characteristics are input into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions; The residual signal is calculated by comparing the original leakage magnetic field signal with the baseline background signal, and the residual signal is extracted. Determine the local noise estimate of the residual signal; Based on the component conditional features and the local noise estimate, a dynamic threshold that varies with spatial location is generated; The local region in the residual signal where the signal intensity is greater than the dynamic threshold is defined as the defect region; Feature extraction is performed on the defective region to obtain defect features; Defect detection results are generated and output based on the defect features.
2. The pipeline magnetic flux leakage defect detection method according to claim 1, characterized in that, Obtain the attribute information of the pipe component to which the original magnetic flux leakage signal of the pipe to be tested belongs, including: Feature extraction is performed on the original magnetic flux leakage signal to obtain time-domain and / or frequency-domain features; The time-domain features and / or the frequency-domain features are input into the component classification model to obtain the attribute information of the pipeline component.
3. The pipeline magnetic flux leakage defect detection method according to claim 1, characterized in that, The component condition features include at least one of the following: the spatial distribution area of the pipeline component in the original magnetic flux leakage signal, the target distance between each pixel in the original magnetic flux leakage signal and the boundary of the pipeline component, the semantic features of the component category, and the interference intensity of the pipeline component on defect detection at different spatial locations.
4. The pipeline magnetic flux leakage defect detection method according to claim 3, characterized in that, The generation of component conditional features based on the attribute information of the pipeline component to characterize the pipeline component's interference characteristics with leakage magnetic field signals includes: Obtain the boundary information of the pipe assembly; wherein, the boundary information includes the start and end coordinates of the pipe assembly in the axial and circumferential directions of the pipe; Create a blank mask matrix of the same size as the original magnetic leakage signal; In the blank mask matrix, the pixel positions corresponding to the boundary information are assigned values to form a pixel matrix; The pixel matrix is subjected to morphological dilation to assign values to the boundary information by extending it outward by a predetermined number of pixels, thereby forming the spatial distribution region. And / or, The contour coordinates of the pipeline assembly are extracted based on the spatial distribution area; Calculate the shortest distance between the current pixel in the original magnetic leakage signal and the contour coordinates of different pipe components, and use it as the target distance of the current pixel; And / or, The interference intensity of the pipeline assembly on defect detection at different spatial locations is expressed as follows: ; In the formula, Indicates the interference intensity of a pixel; Indicates component category The corresponding interference coefficient; This represents the target distance between a pixel and the boundary of the pipeline component; This represents the distance attenuation parameter.
5. The pipeline magnetic flux leakage defect detection method according to claim 1, characterized in that, The step of calculating the residual between the original magnetic flux leakage signal and the baseline background signal, and extracting the residual signal, includes: The original leakage magnetic field signal is subtracted from the baseline background signal to obtain the difference signal; Use the difference signal as the residual signal; or... The difference signal is weighted based on the component condition characteristics to obtain the residual signal.
6. The pipeline magnetic flux leakage defect detection method according to claim 1, characterized in that, The method further includes: Obtain the mileage position of the pipeline assembly and the defect detection result along the axial direction of the pipeline to be inspected; Construct a pipeline topology sequence based on the mileage location; If the distribution of the defect detection results in the pipeline topology sequence does not conform to the arrangement order or distance constraints of each pipeline component, the confidence level of the defect detection results will be reduced.
7. The pipeline magnetic flux leakage defect detection method according to claim 1, characterized in that, The method further includes: Extract the peak and valley information within the defect region corresponding to the defect detection result; Based on the relative positions of the peak and valley information, the boundary of the defect region is expanded to obtain a candidate region. Calculate the leakage magnetic flux morphology characteristics corresponding to the candidate region; wherein, the leakage magnetic flux morphology characteristics include at least one of peak-to-valley difference, valley spacing, and local energy; The defect detection results are screened out based on the leakage magnetic field morphology characteristics.
8. A pipe magnetic flux leakage defect detection device that performs the method according to any one of claims 1 to 7, characterized in that, The device includes: The structure identification module is used to obtain the pipe component and its attribute information to which the original magnetic flux leakage signal of the pipe to be detected belongs; The feature generation module is used to generate component condition features that characterize the characteristics of the pipeline component to interfere with leakage magnetic signals based on the attribute information of the pipeline component. The baseline reconstruction module is used to input the original magnetic flux leakage signal and the component condition characteristics into the baseline reconstruction model to obtain the baseline background signal of the pipeline component under defect-free conditions. The defect detection module is used to perform residual calculation on the original magnetic flux leakage signal and the baseline background signal, and extract the residual signal; and, Determine the local noise estimate of the residual signal; and, Based on the component conditional features and the local noise estimate, a dynamic threshold that varies with spatial location is generated; and, The local regions in the residual signal where the signal intensity is greater than the dynamic threshold are defined as defect regions; and... Feature extraction is performed on the defective region to obtain defect features; and, Defect detection results are generated and output based on the defect features.
9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the pipeline magnetic flux leakage defect detection method as described in any one of claims 1 to 7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the pipeline magnetic flux leakage defect detection method as described in any one of claims 1 to 7.