A fast method for detecting small magnetic flux leakage defects

By combining COMSOL data enhancement with SPD-Conv and G-GhostNet networks, the accuracy and speed of small magnetic flux leakage defect detection in pipelines are improved, solving the problems of slow detection speed and large computational load, and realizing efficient detection of small magnetic flux leakage defects.

CN115760833BActive Publication Date: 2026-05-29LIAONING UNIVERSITY OF PETROLEUM AND CHEMICAL TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LIAONING UNIVERSITY OF PETROLEUM AND CHEMICAL TECHNOLOGY
Filing Date
2022-11-30
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing deep learning algorithms are slow in detecting small defects in pipeline magnetic flux leakage, and their improvement effect is not significant on small targets. At the same time, they require a large amount of computation, which affects the detection efficiency.

Method used

High-resolution images are acquired using the COMSOL data augmentation method, and feature extraction is performed by combining SPD-Conv and the lightweight G-GhostNet network. A small target detection head is added to improve detection accuracy and speed.

Benefits of technology

It achieves high-precision and high-speed detection of small magnetic flux leakage defects, solving the problems of slow detection speed and large computational load, and meeting practical detection needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115760833B_ABST
    Figure CN115760833B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of pipeline magnetic flux leakage detection, in particular to a rapid magnetic flux leakage small defect detection method, which comprises the following steps: S1, collecting an actual pipeline magnetic flux leakage defect image, using a comsol data enhancement method to obtain a high-resolution pipeline magnetic flux leakage defect image, and obtaining a first feature map with a size of 640*640*3; S2, using an SPD-Conv method to down-sample the first feature map obtained in S1, so as to obtain multiple feature maps with different sizes; while down-sampling, a G-GhostNet light network is used to improve the detection speed; S3, combining the multiple feature maps with different sizes obtained through down-sampling in S2 with feature maps with the same size in up-sampling, so as to obtain different detection heads which are sent into a detection head network for detection; and S4, labeling the defect image obtained after detection in S3. The comsol data enhancement method is used to improve the robustness of the model, the SPD-Conv method is used to identify and position small targets, the G-GhostNet light network is used, and the detection speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline magnetic flux leakage detection technology, and in particular to a rapid method for detecting small magnetic flux leakage defects. Background Technology

[0002] Pipelines have long served as the primary carriers of energy resources such as oil and natural gas due to their advantages of large capacity and low cost. However, prolonged operation can easily lead to damage from corrosion, human-caused disruptions, and other factors. Pipeline leaks can endanger the economy, the environment, and the safety of people's lives and property. Therefore, regular pipeline inspections are crucial. Magnetic flux leakage (MFL) testing, unaffected by environmental factors and media, is currently the most commonly used pipeline inspection method.

[0003] Magnetic flux leakage (MFL) detection has long been used by many scholars in pipeline defect detection, playing a crucial role in preventing pipeline leaks. Long-distance oil and gas pipelines generate a large number of MFL images, posing a significant challenge for manual identification. Therefore, a fast and efficient identification method is urgently needed. Deep learning algorithms perfectly meet this need, leading to their widespread application in MFL detection and significantly reducing the cost of defect detection. Among current deep learning algorithms, H. Dong et al. applied a contextual attention network to the enhanced features of the feature pyramid, allowing effective information to propagate to the final fused feature map. Finally, a boundary refinement block was added to refine the defect boundaries, improving detection efficiency. L. Yang et al. introduced dilated convolution and residual attention networks into SSD to increase the model's receptive field and make the model more focused on the target. Finally, high semantic features were fused with high-resolution features to enhance the detail features of small targets. B. Su et al. introduced a complementary attention network, cleverly fusing channel features and spatial features to adaptively suppress noise and highlight defect features. The methods mentioned above have achieved good results in defect detection, but the improvement is not significant for small targets. At the same time, they introduce too many parameters into the model, which greatly increases the amount of computation and thus affects the detection speed. Summary of the Invention

[0004] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a rapid method for detecting small magnetic flux leakage defects, which solves the problems of difficult detection and slow detection speed of small magnetic flux leakage defects in pipelines.

[0005] To achieve the above objectives, the main technical solutions adopted by the present invention include:

[0006] This invention provides a rapid method for detecting small magnetic flux leakage defects, the method comprising the following steps:

[0007] S1. Acquire actual pipeline magnetic flux leakage defect images, use COMSOL data augmentation method to obtain high-resolution pipeline magnetic flux leakage defect images, and obtain a first feature map with a size of 640×640×3.

[0008] S2. The SPD-Conv method is used to downsample the first feature map with a size of 640×640×3 obtained in S1 to obtain multiple feature maps of different sizes; while downsampling, the lightweight G-GhostNet network is used to improve the detection speed.

[0009] S3. Combine the multiple feature maps of different sizes obtained by downsampling in S2 with the feature maps of the same size obtained by upsampling to obtain different detection heads, which are then sent into the detection head network for detection.

[0010] S4. Label the defect images obtained after detection in S3.

[0011] Further, step S1 specifically includes: using COMSOL simulation software to simulate a high-resolution magnetic flux leakage defect image, and mixing it with the actual acquired pipeline magnetic flux leakage image, then obtaining a dataset through data augmentation methods, and setting the image size in the dataset to 640×640×3.

[0012] Further, step S2 specifically includes: feeding the first feature map with a size of 640×640×3 into the SPD-Conv model for downsampling; after each convolution, dividing the feature map of the corresponding size into units of 2×2 pixels; extracting pixels at the same position in each divided pixel block to form four new feature maps; and merging the four new feature maps together.

[0013] Furthermore, the SPD-Conv model includes a Space-to-depth layer and a non-strided convolution layer; the Space-to-depth layer is used to downsample the first feature map, and the non-strided convolution layer is used to change the number of channels in the first feature map so that the number of output channels is consistent with the number of channels before inputting into SPD-Conv.

[0014] Furthermore, the lightweight G-GhostNet network in step S2 includes a complicated branch and a Ghost branch. The complicated branch extracts features from the input feature map through a stacked residual module, and the Ghost branch performs a Cheap operation on the input feature map and fuses mix information. Finally, the information from the complicated branch and the Ghost branch is fused to form the G-GhostNet network.

[0015] Furthermore, in step S3, a small target detection head with a feature map size of 160×160×128 is added to the detection head network to improve the accuracy of detecting small defects in pipeline magnetic flux leakage.

[0016] Further, step S3 specifically includes: the detection head network has three detection heads, the feature map size of the large target is 20×20×1024, the feature map size of the medium target is 40×40×512, and the feature map size of the small target is 80×80×256. The feature maps of the three detection heads and the feature map size of the small target detection head are input into the detection head network, and regression prediction is used to predict the center point and width and height of the prior box respectively. Finally, the prediction results are marked on the feature map.

[0017] The beneficial effects of this invention are as follows: This invention provides a rapid method for detecting small magnetic flux leakage defects. It employs the COMSOL data augmentation method to obtain more fine-grained information from the network, solving the problem of insufficient magnetic flux leakage defect data and improving the robustness of the model. The SPD-Conv method is used, which does not lose a large amount of fine-grained information for small targets, facilitating the identification and localization of small targets. The lightweight G-GhostNet network is used, improving the model's feature extraction capability and increasing detection speed due to reduced computational cost. With these improvements, this method can simultaneously achieve high accuracy and high detection speed in detecting small magnetic flux leakage defects, meeting practical detection requirements. Attached Figure Description

[0018] Figure 1 This is a flowchart of a rapid method for detecting small magnetic flux leakage defects according to the present invention;

[0019] Figure 2 This is a flowchart of the COMSOL data augmentation method in this invention;

[0020] Figure 3 This is a structural diagram of SPD-Conv in this invention;

[0021] Figure 4 This is a flowchart of FSDDNet in this invention;

[0022] Figure 5 This is a diagram of the detection structure of the present invention. Detailed Implementation

[0023] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] Example 1:

[0025] like Figure 1 As shown, this invention provides a rapid method for detecting small magnetic flux leakage defects. The method includes the following steps:

[0026] 101. Acquire actual pipeline magnetic flux leakage defect images, use COMSOL data augmentation method to obtain high-resolution pipeline magnetic flux leakage defect images, and obtain a first feature map with a size of 640×640×3.

[0027] In this embodiment, high-resolution images of pipeline magnetic flux leakage defects, actually collected by an oil company, are simulated using COMSOL simulation software. The principle applied is the finite element method, based on Maxwell's equations:

[0028]

[0029] in, Here, H is the Laplace operator, B is the magnetic field strength, J is the current density, and μ is the permeability.

[0030] Introducing magnetic vector position The magnetic flux density is:

[0031]

[0032] According to (1), the governing equation can be obtained as follows:

[0033]

[0034] Because the pipe under study is geometrically symmetrical, the magnetic field is also geometrically symmetrical, resulting in magnetic misalignment. There is only one component, the Coulomb specification. Automatic fulfillment.

[0035] Using vector identities The governing equation (3) can be written as:

[0036]

[0037] Using a cylindrical coordinate system (r, θ, z), (4) can be written as:

[0038]

[0039] In the formula, the magnetic vector potential and excitation current density It has only a circumferential (θ) component, so it can be regarded as a scalar.

[0040] From (2), the magnetic induction intensity can be obtained. for:

[0041]

[0042] in, for radial component, for The axial component.

[0043] The COMSOL data augmentation method process is as follows: Figure 2 As shown, the pipeline magnetic flux leakage defect image is first composed of two parts: one part is the actual detected image, and the other part is the simulated image. After the first data augmentation, the actual pipeline magnetic flux leakage defect image is pasted into the simulated image to obtain the third part image. Finally, in order to improve the robustness of the model, a second data augmentation is performed, which improves the brightness, randomly rotates, and enhances the contrast of the third part image to obtain the final high-resolution pipeline magnetic flux leakage image. This image is then set as the first feature map with a size of 640×640×3 as the input of the backbone network.

[0044] 102. The SPD-Conv method is used to downsample the first feature map with a size of 640×640×3, and the lightweight G-GhostNet network is used to improve the detection speed.

[0045] In this embodiment, the first feature map with a size of 640×640×3 obtained in step 101 is input into FSDDNet (Fast Magnetic Leakage Small Defect Detection Network). FSDDNet is a modification of YOLOv5 (a single-stage target detection algorithm). An SPD-Conv module is added to the backbone network of YOLOv5. The first feature map with a size of 640×640×3 is passed through the first layer of SPD-Conv and a 3×3 convolution with padding=1 to output a feature map with a size of 320×320×64. After the same combination, a feature map with a size of 160×160×128 is output. After four G-GhostNet feature extractions, a feature map with a size of 20×20×1024 is output. Finally, it passes through the SPPF structure, which passes through multiple 5×5 MaxPool layers in sequence and then performs further fusion.

[0046] Specifically, the SPD-Conv module mainly consists of a Space-to-depth (SPD) layer and a non-strided convolution layer. The SPD layer downsamples all feature maps, and its main process is as follows: Figure 3 As shown. When the size of the intermediate feature map X is S×S×C1, a series of sub-feature maps are cut out:

[0047]

[0048] Each sub-map downsamples the feature map by a scaling factor. Figure 3 The image shows the four subgraphs f obtained when scale=2. 0,0 f 1,0 f 0,1 f 1,1 Each sub-image has a size of (S / 2, S / 2, C1). These four sub-features are then concatenated to obtain a new feature X′ with a size of (S / 2, S / 2, scale). 2 C1).

[0049] After the SPD layer, a filter with stride=1 is introduced. In this embodiment of the invention, a 1×1 convolution is used, and the number of channels of X′ is changed to C2.

[0050] Specifically, G-GhostNet is divided into two parts: "complicated" and "ghost". The former requires a large number of block operations to obtain, and is represented as... The latter can be obtained with simple linear operations, represented as They are generated in the following ways respectively:

[0051]

[0052]

[0053] Where L′2, L′3…L′ n This represents n convolutional layers, where C represents the Cheap operation, which can be a 1×1 or 3×3 convolution. Finally, the features from the two parts are concatenated to output the following features:

[0054]

[0055] The above method can greatly reduce the computational complexity of the model, but Lacking in-depth information, a mix operation is introduced in G-GhostNet to compensate for this. Information is missing. From Figure 4 It can be seen that the features collected from the complicated branch are These features compensate for Information is missing.

[0056] from Figure 4 It can be seen that the fused feature Z is first transformed to Within the same domain, feature fusion is then performed, expressed as:

[0057]

[0058] Here, τ represents the transformation function. In order to reduce the amount of computation, we first perform global average pooling on Z to obtain aggregated features, and then use a fully connected layer to transform it to the same domain.

[0059] τ(Z)=WPooling(Z)+b

[0060] Where Pooling represents global average pooling, and W and b represent weight and bias, respectively.

[0061] G-GhostNet's block module uses a standard residual module, from Figure 4 As can be seen, the backbone of the residual module consists of three convolutional layers with 1×1, 3×3 and 1×1 kernels respectively. By stacking the residual modules, feature extraction is performed to form a complicated branch. Then, the Cheap operation is performed and the mix information is fused to form a Ghost branch. Finally, the information from the two branches is fused to form the G-GhostNet lightweight network.

[0062] 103. The feature map after feature extraction is fed into the detection head network for detection, and a small target detection head is added to the detection head network to improve the accuracy of small defects in pipeline magnetic flux leakage.

[0063] In this embodiment, as Figure 4 As shown, three feature maps of sizes 80×80×256, 40×40×512, and 20×20×1024 are selected in FSDDNet. An FPN (Feature Map Pyramid Network) structure is used to fuse these three feature maps, giving FSDDNet information at different scales. To improve the performance of small object detection, a fourth detection head is added. The three feature maps of sizes 80×80×256, 40×40×512, and 20×20×1024 are extracted using G-Ghost, then subjected to 1×1 convolution to change the number of channels and upsampled before being fused with a feature map of size 160×160×128 in FSDDNet to obtain a fourth detection head.

[0064] Specifically, the industrial production environment used a computer with an i5-12500H CPU, an RTX 3060 GPU, 6GB of memory, and Python 3.7 as the programming language. The deep learning framework used was PyTorch 1.8. Feature maps of size 640×640×3 were input into FSDDNet for downsampling, using a total of 24,633 images, of which 22,170 were used as the training set and 2,463 as the validation set. The parameters of FSDDNet were set as follows: the optimizer was stochastic gradient descent (SGD), the impulse was 0.9, the initial learning rate was 1e-2, the weight decay was set to 5e-4, and the learning rate descent method was cosine. The specific parameters of FSDDNet are shown in Table 1.

[0065] Table 1

[0066]

[0067] In Table 1, "Block" represents a traditional residual network, "Input" represents the size of the input image, and "Output" represents the size of the output image. After feature extraction via FSDDNet and enhanced feature extraction via FPN, the detection head can annotate the detection results onto the image, such as... Figure 5 As shown, small defects in the pipeline can be accurately marked on the image, indicating the probability that the target is a defect, with an accuracy of over 80%.

[0068] This invention provides a fast method for detecting small magnetic flux leakage defects. It employs COMSOL data augmentation to provide the network with more fine-grained information, addressing the problem of insufficient magnetic flux leakage defect data and improving model robustness. The SPD-Conv method is used to avoid losing significant fine-grained information for small targets, facilitating their identification and localization. The lightweight G-GhostNet network enhances the model's feature extraction capabilities and increases detection speed due to reduced computational cost. These improvements enable this method to achieve both high accuracy and high detection speed for small magnetic flux leakage defects, meeting practical detection requirements.

[0069] Obviously, the embodiments described above are merely some embodiments of the present invention, and not all embodiments. The above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.

Claims

1. A rapid method for detecting small magnetic flux leakage defects, characterized in that, The method includes the following steps: S1. Acquire actual pipeline magnetic flux leakage defect images, use COMSOL data augmentation method to obtain high-resolution pipeline magnetic flux leakage defect images, and obtain a first feature map with a size of 640×640×3. Step S1 specifically includes: using COMSOL simulation software to simulate high-resolution magnetic flux leakage defect images, mixing them with actual collected pipeline magnetic flux leakage images, then obtaining a dataset through data augmentation methods, and setting the image size in the dataset to 640×640×3. S2. The SPD-Conv method is used to downsample the first feature map with a size of 640×640×3 obtained in S1 to obtain multiple feature maps of different sizes; while downsampling, the lightweight G-GhostNet network is used to improve the detection speed. The specific steps of step S2 include: feeding the first feature map with a size of 640×640×3 into the SPD-Conv model for downsampling; after each convolution, dividing the feature map of the corresponding size into units of 2×2 pixels; extracting pixels at the same position in each divided pixel block to form four new feature maps; and merging the four new feature maps together. S3. Combine the multiple feature maps of different sizes obtained by downsampling in S2 with the feature maps of the same size obtained by upsampling to obtain different detection heads, which are then sent into the detection head network for detection. S4. Label the defect images obtained after detection in S3.

2. The rapid method for detecting small magnetic flux leakage defects according to claim 1, characterized in that, The SPD-Conv model includes a Space-to-depth layer and a non-strided convolution layer; the Space-to-depth layer is used to downsample the first feature map, and the non-strided convolution layer is used to change the number of channels in the first feature map so that the number of output channels is consistent with the number of channels before inputting into SPD-Conv.

3. The rapid method for detecting small magnetic flux leakage defects according to claim 1, characterized in that, The lightweight G-GhostNet network in step S2 includes a complicated branch and a Ghost branch. The complicated branch extracts features from the input feature map by stacking residual modules. The Ghost branch performs a Cheap operation on the input feature map and fuses mix information. Finally, the information from the complicated branch and the Ghost branch is fused to form the G-GhostNet network.

4. The rapid method for detecting small magnetic flux leakage defects according to claim 1, characterized in that, In step S3, a small target detection head with a feature map size of 160×160×128 is added to the detection head network to improve the accuracy of detecting small defects in pipeline magnetic flux leakage.

5. The rapid method for detecting small magnetic flux leakage defects according to claim 4, characterized in that, Step S3 specifically includes: the detection head network has three detection heads, the feature map size of the large target is 20×20×1024, the feature map size of the medium target is 40×40×512, and the feature map size of the small target is 80×80×256. The feature maps of the three detection heads and the feature map size of the small target detection head are input into the detection head network. Regression prediction is used to predict the center point and width and height of the prior box respectively. Finally, the prediction results are marked on the feature map.