Pipeline defect magnetic flux leakage detection method and device based on multi-scale data driving deep learning

By using a multi-scale data-driven deep learning method, a multi-scale magnetic flux leakage signal dataset is generated and features are extracted and fused. This solves the shortcomings of traditional methods in taking into account both global and local features, and enables accurate detection of pipeline defects, improving detection accuracy and robustness.

CN120992737AActive Publication Date: 2025-11-21NORTHEASTERN UNIV CHINA

Patent Information

Application Number
CN202511517203.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2025-11-21
Estimated Expiration
2045-10-23

AI Technical Summary

Technical Problem

In existing technologies, artificial signal analysis methods are difficult to fully capture the features of complex defects and have poor generalization ability. Deep learning analysis methods are difficult to learn both global and local features of defects at the same time, resulting in insufficient detection accuracy and generalization ability.

Method used

A multi-scale data-driven deep learning approach is adopted. By collecting pipeline leakage magnetic field signal data, spatial domain transformation and multi-scale representation processing are performed to generate a multi-scale leakage magnetic field signal dataset. Convolutional neural networks are used for feature extraction and enhancement. Feature fusion is performed by combining multi-scale convolutional branches and attention mechanisms. Multi-task prediction is performed through a feature pyramid module and a task decoupling module to output pipeline defect detection results.

Benefits of technology

It enables precise detection of pipeline defects, improves the accuracy and completeness of detection in complex scenarios, solves the shortcomings of traditional methods in taking into account both global and local features, and improves detection accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120992737A_ABST
    Figure CN120992737A_ABST
Patent Text Reader

Abstract

The invention discloses a pipeline defect magnetic flux leakage detection method and device based on multi-scale data driving deep learning, and relates to the technical field of pipeline defect detection. A multi-scale magnetic flux leakage signal data set containing defect global distribution and local details is generated, and multi-level primary features are automatically extracted by using a convolutional neural network; and the defects of poor generalization and easy key information omission of a manual method are overcome. And then dynamically enhancing and performing weighted fusion on multi-scale features by means of a multi-scale convolution branch and an attention mechanism, so that the model can learn global and local features of the defect at the same time, the problem that the global and local features of the defect are difficult to consider in traditional deep learning is solved, and through transverse connection and up-sampling fusion of a feature pyramid, a multi-scale feature is obtained. And the features have high semantic information and high spatial details. And finally, independently carrying out multi-task prediction by virtue of a task decoupling module, and calibrating result consistency by virtue of a task alignment module, so that the detection accuracy in a complex scene is improved, and more accurate and robust pipeline defect magnetic flux leakage detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of pipeline defect detection, in particular to a pipeline defect magnetic flux leakage detection method and device based on multi-scale data-driven deep learning. BACKGROUND

[0002] Pipeline is the core carrier of fluid transportation, but as the service time increases, cracks, holes and other defects are prone to occur on the inner wall of the pipeline. As a non-destructive testing method for ferromagnetic material pipeline, the magnetic flux leakage detection technology has become one of the mainstream technologies for pipeline defect detection.

[0003] In related technologies, the pipeline defect magnetic flux leakage detection method usually adopts an artificial signal analysis method and a deep learning analysis method. The artificial signal analysis method is to describe the defect features by relying on artificial design features (such as signal peak value, amplitude change rate, signal width, etc.) after filtering, noise reduction and other pretreatments on the magnetic flux leakage signal, and then to realize defect recognition by combining threshold judgment or a simple classification model (such as support vector machine). The deep learning analysis method uses a deep learning model such as convolutional neural network (CNN) to directly learn the original magnetic flux leakage signal or its one-dimensional sequence or two-dimensional imaging result after pretreatment. The model realizes classification, positioning or quantization of defects through automatic feature extraction of multiple layers of neurons.

[0004] In the process of implementing the present application, the applicant found that the related technology at least has the following problems: The artificial signal analysis method relies on artificial design features, which is difficult to fully capture the features of complex defects, is easy to miss key information, has poor generalization ability, and cannot simultaneously consider the global distribution and local details of defects, so the recognition accuracy of subtle defects is low. The model of the deep learning analysis method is also difficult to simultaneously learn the global features and local features of defects based on single-scale signal input, which affects the accuracy and generalization ability of defect recognition, and the detection accuracy in complex scenes is not high. SUMMARY

[0005] Therefore, the present application provides a pipeline defect magnetic flux leakage detection method and device based on multi-scale data-driven deep learning, which mainly aims to solve the problem that the artificial signal analysis method and the deep learning analysis method are difficult to simultaneously consider the global distribution and local details of pipeline defects, and have defects in detection accuracy and other aspects.

[0006] According to a first aspect of the present application, a pipeline defect magnetic flux leakage detection method based on multi-scale data-driven deep learning is provided, which comprises: The pipeline magnetic leakage signal data is collected, spatial domain conversion and multi-scale representation processing are performed on the pipeline magnetic leakage signal data, a multi-scale magnetic leakage signal dataset with global distribution of defects and local details is generated, and the multi-scale magnetic leakage signal dataset is used as input data of a pipeline defect magnetic leakage detection model; The convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic leakage detection model is used to perform feature extraction and enhancement processing on the multi-scale magnetic leakage signal dataset, and a multi-level primary feature map set is obtained. The multi-scale convolution branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic leakage detection model are used to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set, and a deep feature map with fused multi-scale context is obtained. Based on the feature pyramid module of the pipeline defect magnetic leakage detection model, the deep feature map is subjected to horizontal connection and up-sampling fusion operation, and a multi-scale target feature map is obtained. Through the task decoupling module and the task alignment module of the pipeline defect magnetic leakage detection model, multi-task branch prediction and cross-task feature alignment operation are performed on the multi-scale target feature map, and the pipeline defect magnetic leakage detection result output by the pipeline defect magnetic leakage detection model is obtained.

[0007] According to the second aspect of the present application, a multi-scale data-driven deep learning pipeline defect magnetic leakage detection device is provided, which comprises: The data acquisition and processing module is used to collect pipeline magnetic leakage signal data, perform spatial domain conversion and multi-scale representation processing on the pipeline magnetic leakage signal data, generate a multi-scale magnetic leakage signal dataset with global distribution of defects and local details, and use the multi-scale magnetic leakage signal dataset as input data of a pipeline defect magnetic leakage detection model. The hierarchical feature learning module is used to use the convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic leakage detection model to perform feature extraction and enhancement processing on the multi-scale magnetic leakage signal dataset, and obtain a multi-level primary feature map set. The adaptive multi-context feature synthesis module is used to use the multi-scale convolution branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic leakage detection model to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set, and obtain a deep feature map with fused multi-scale context. The multi-resolution semantic enhancement module is used to use the feature pyramid module of the pipeline defect magnetic leakage detection model to perform horizontal connection and up-sampling fusion operation on the deep feature map, and obtain a multi-scale target feature map. The cooperative task optimization and output module is configured to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map through the task decoupling module and the task alignment module of the pipeline defect magnetic flux leakage detection model, so as to obtain a pipeline defect magnetic flux leakage detection result output by the pipeline defect magnetic flux leakage detection model.

[0008] By means of the technical solutions provided in the embodiments of the present application, at least the following advantages are achieved: The multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection method and device provided in the present application first collects pipeline magnetic flux leakage signal data, performs spatial domain conversion and multi-scale representation processing on the pipeline magnetic flux leakage signal data, and generates a multi-scale magnetic flux leakage signal data set with global defect distribution and local details, which can solve the problems of incomplete capture of complex defects caused by artificial features and inability of traditional deep learning single-scale input to simultaneously cover global and local features, and provide comprehensive data support for accurate detection. Then, the convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model is used to perform feature extraction and enhancement processing on the multi-scale magnetic flux leakage signal data set, so as to obtain a multi-level primary feature map set, which can efficiently extract multi-level primary features from low level to high level and overcome the defects of poor generalization ability and easy omission of key information of artificial methods. Subsequently, the multi-scale convolution branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model are used to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set, so as to obtain a deep feature map with fused multi-scale context, which can simultaneously learn global and local features, solve the problem that traditional deep learning is difficult to balance global and local features, and strengthen the representation of complex and multi-scale defects. Then, the feature pyramid module of the pipeline defect magnetic flux leakage detection model is used to perform horizontal connection and up-sampling fusion operations on the deep feature map, so as to obtain a multi-scale target feature map, which enables efficient fusion of deep high semantic features and shallow high spatial detail features, and the obtained multi-scale target feature map has high semantic information of global understanding and high spatial detail of local precision, thereby further improving the balancing capability of global and local features. Finally, the task decoupling module and the task alignment module of the pipeline defect magnetic flux leakage detection model are used to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map, so as to obtain a pipeline defect magnetic flux leakage detection result output by the pipeline defect magnetic flux leakage detection model, thereby improving the accuracy and integrity of defect detection in complex scenarios.

[0009] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the specific embodiments of the present application can be implemented in accordance with the content of the description, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS

[0010] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a better understanding of the preferred embodiments, and are not intended to constrain the application. Moreover, like reference numerals denote same or similar components throughout the attached drawings. In the drawings: Figure 1 A method flow diagram of a multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection is shown according to an embodiment of the application; Figure 2 Another method flow diagram of a multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection is shown according to an embodiment of the application; Figure 3 A structural diagram of a multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection is shown according to an embodiment of the application. DETAILED DESCRIPTION

[0011] In the description of the application, it should be understood that the terms "first", "second", etc. are used only for descriptive purposes and are not to be construed as indicating or implying relative importance or an indicated number of technical features. Therefore, the features defined as "first", "second" can explicitly or implicitly include one or more of the features. In the description of the application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.

[0012] Exemplary embodiments of the present application will be described in greater detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present application can be more thoroughly understood and so that the scope of the present application can be completely conveyed to those skilled in the art.

[0013] The existing pipeline defect analysis methods based on magnetic flux leakage signals mainly include two categories: manual signal analysis method and deep learning-based analysis method. The manual signal analysis method processes the magnetic flux leakage signals through filtering, noise reduction and other preprocessing methods, and then describes the defect characteristics by relying on artificial design features (such as signal peak value, amplitude change rate, signal width, etc.), and finally realizes defect recognition by combining threshold judgment or simple classification model (such as support vector machine). The deep learning-based analysis method uses deep learning models such as convolutional neural network (CNN) and recurrent neural network (RNN) to directly learn the original magnetic flux leakage signals or their preprocessed one-dimensional sequences and two-dimensional imaging results. The model realizes the classification, positioning or quantification of defects through automatic feature extraction of multiple layers of neurons. However, the manual signal analysis method relies on artificial design features, which is difficult to fully capture the characteristics of complex defects (such as multiple defects superimposed and irregular shape defects) and is prone to miss key information. Moreover, the correlation between the features and the physical properties of the defects needs to rely on a large amount of experience, and the generalization ability is poor. When the pipe material and working conditions change, the effectiveness of the features decreases significantly. At the same time, the traditional method cannot simultaneously consider the global distribution of defects (such as the position relationship of defects in the circumferential direction of the pipe) and the local details (such as the signal fluctuation of a small crack), and the recognition accuracy of subtle defects is low. The deep learning model of the deep learning-based analysis method is based on single-scale signal input, which is difficult to learn the global features (such as the overall signal distribution of large corrosion areas) and local features (such as the weak signal change of crack tips) of defects simultaneously. When the defect scales differ greatly (such as the existence of millimeter-level cracks and centimeter-level corrosion pits in the same pipe), single-scale input will lead to insufficient learning of the detailed features of small-scale defects or incomplete capture of the global morphology of large-scale defects, thereby affecting the accuracy and generalization ability of defect recognition. In addition, the existing models do not specifically design for the feature differences of magnetic flux leakage signals at different spatial scales, and the pertinence of feature extraction is insufficient, which limits the detection accuracy in complex scenarios.

[0014] To solve this problem, the application provides a pipeline defect magnetic flux leakage detection method based on multi-scale data-driven deep learning. By collecting pipeline magnetic flux leakage signals, a multi-scale data set containing global distribution and local details of defects is generated through spatial domain conversion and multi-scale representation processing. A hierarchical feature extraction module is used to automatically extract multi-level primary features from low to high levels. Dynamic receptive field feature enhancement and weighted fusion are realized by combining multi-scale convolution branch and attention mechanism, and deep features that fuse global and local information are obtained. Then, through the horizontal connection and up-sampling fusion of the feature pyramid module, multi-scale target features with high semantic information and high spatial details are generated. Finally, the task decoupling module independently completes the multi-task prediction of defect positioning and classification, and the task alignment module calibrates the consistency of the results, and outputs accurate detection results. The multi-scale data set provides comprehensive data support for detection, solves the limitations of traditional single-scale input, and overcomes the poor generalization problem of manual methods. Dynamic receptive field fusion and feature pyramid enhance the global and local feature consideration ability, breaking through the bottleneck of traditional deep learning. Multi-task decoupling and alignment improve the accuracy and consistency of detection in complex scenes, and realize more accurate and robust pipeline defect detection. The execution subject of the application can be a pipeline defect magnetic flux leakage detection system. The pipeline defect magnetic flux leakage detection system relies on the computing power of a server to provide services for users. The server can be a standalone server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, as well as basic cloud computing servers.

[0015] The embodiment of the application provides a pipeline defect magnetic flux leakage detection method based on multi-scale data-driven deep learning, as shown in Figure 1 The method comprises the following steps: 101, collect pipeline magnetic flux leakage signal data, perform spatial domain conversion and multi-scale representation processing on the pipeline magnetic flux leakage signal data, generate multi-scale magnetic flux leakage signal data set with global distribution and local details of defects, and take the multi-scale magnetic flux leakage signal data set as input data of the pipeline defect magnetic flux leakage detection model.

[0016] In the embodiments of the present application, by collecting the pipeline magnetic flux leakage signal and mapping the signal with the spatial position (such as the axial and circumferential coordinates) of the pipeline, a multi-scale magnetic flux leakage signal dataset capable of reflecting the global distribution and local details of defects is generated through multi-scale cropping and other operations, serving as the input data of the detection model. The traditional manual analysis method relies on manual design of features, which is difficult to fully cover complex defects; and the traditional deep learning usually takes single-scale signal as input, which cannot learn the global and local features of defects at the same time. In contrast, the multi-scale dataset generated by the present application provides complete information containing global distribution and local details to the model from the input layer, effectively solving the poor generalization of manual methods and the shortcomings of traditional single-scale methods in considering global and local features. This lays a solid data foundation for subsequent models to accurately learn multi-scale defect features, improve detection accuracy and generalization ability.

[0017] 102. The convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model is used to perform feature extraction and enhancement processing on the multi-scale magnetic flux leakage signal dataset to obtain a multi-level primary feature map set.

[0018] In the embodiments of the present application, the convolutional neural network contained in the hierarchical feature extraction module in the pipeline defect magnetic flux leakage detection model is used to process the multi-scale magnetic flux leakage signal dataset: on the one hand, the features are extracted, that is, the key information capable of representing defects is identified from the magnetic flux leakage signal, such as the edge, texture and intensity change pattern of the signal; on the other hand, the features are enhanced, so that the useful defect features are more prominent, while effectively suppressing noise interference. Finally, a multi-level primary feature map set is obtained, in which the feature maps of different levels capture the shallow details and deep abstract patterns of defects, respectively, so as to ensure that the details and overall patterns of defects are fully covered, and a more complete description of complex defects is realized.

[0019] 103. The multi-scale convolution branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model are used to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set to obtain a deep feature map fused with multi-scale context.

[0020] In the embodiments of the present application, the multi-scale convolution branch can simultaneously process features of different scales such as the overall distribution trend of large area defects and the fine details of small area defects, effectively avoiding the missing detection of defects of various sizes caused by single scale. In addition, the introduction of the attention mechanism enables the model to automatically focus on more critical defect-related feature regions, effectively filtering irrelevant noise and significantly improving the effectiveness of the features. Furthermore, the dynamic receptive field can flexibly adjust the perception range according to the actual shape of the defect, further enhancing the feature expression ability for complex shape defects, thereby effectively improving the detection accuracy and robustness.

[0021] 104. The feature pyramid module based on the pipeline defect magnetic flux leakage detection model performs lateral connection and up-sampling fusion operation on the deep feature map to obtain a multi-scale target feature map.

[0022] In the embodiments of the present application, the feature pyramid module performs two key operations on the deep feature map: one is lateral connection, which facilitates the exchange of information between different levels of features; the second is up-sampling fusion, that is, the low-resolution but rich global semantic information features are enlarged in size and fused with high-resolution and detailed features, so as to more accurately locate the defect boundary, and finally generate a target feature map containing multi-scale information. The present application can not only capture large-size defects, but also effectively identify small-size defects, effectively avoiding the missed detection problem caused by the size difference of defects.

[0023] 105. The task decoupling module and the task alignment module of the pipeline defect magnetic flux leakage detection model perform multi-task branch prediction and cross-task feature alignment operation on the multi-scale target feature map to obtain the pipeline defect magnetic flux leakage detection result output by the pipeline defect magnetic flux leakage detection model.

[0024] In the embodiments of the present application, the task decoupling module separates the defect classification and defect positioning tasks to make each task focus on extracting the features required by itself, thereby avoiding the target conflict between tasks and improving the accuracy of single task. The task alignment module ensures that the features extracted by different tasks are coordinated and supplemented with each other, maintains the consistency of the features, and can output multi-dimensional information such as defect type, location, size, etc. In addition, the task results are mutually calibrated through feature alignment, which greatly reduces the misjudgment and omission, making the detection result more reliable.

[0025] This application provides a multi-scale data-driven deep learning method for detecting magnetic flux leakage (MFL) defects in pipelines. Compared with existing technologies, this application first collects MFL signal data from pipelines, performs spatial domain transformation and multi-scale representation processing on the MFL signal data, and generates a multi-scale MFL signal dataset with global defect distribution and local details. This solves the problems of incomplete capture of complex defects due to reliance on manual features in manual methods and the inability of traditional deep learning to simultaneously cover both global and local defects with a single-scale input, providing comprehensive data support for accurate detection. Then, the convolutional neural network in the hierarchical feature extraction module of the pipeline defect MFL detection model is used to extract and enhance features from the multi-scale MFL signal dataset, obtaining a multi-level primary feature map set. This efficiently extracts multi-level primary features from low to high levels, overcoming the shortcomings of manual methods such as poor generalization ability and easy omission of key information. Subsequently, utilizing the multi-scale convolutional branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model, dynamic receptive field feature enhancement and weighted fusion processing are performed on the multi-level primary feature map set to obtain a deep feature map that integrates multi-scale context. This allows for the simultaneous learning of global and local defect features, addressing the challenge of traditional deep learning in simultaneously considering both global and local characteristics, and enhancing the representation of complex, multi-scale defects. Then, based on the feature pyramid module of the pipeline defect magnetic flux leakage detection model, lateral connections and upsampling fusion operations are performed on the deep feature maps to obtain multi-scale target feature maps. This efficiently fuses deep, high-semantic features with shallow, high-spatial-detail features, resulting in multi-scale target feature maps that possess both high-semantic information for global understanding and high-spatial-detail accuracy, further improving the ability to consider both global and local features. Finally, through the task decoupling and task alignment modules of the pipeline defect magnetic flux leakage detection model, multi-task branch prediction and cross-task feature alignment operations are performed on the multi-scale target feature maps to obtain the pipeline defect magnetic flux leakage detection results output by the model, improving the accuracy and completeness of defect detection in complex scenarios.

[0026] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, this application provides another multi-scale data-driven deep learning method for detecting magnetic flux leakage of pipeline defects, such as... Figure 2 As shown, the method includes: 201. Collect pipeline magnetic flux leakage signal data, perform spatial domain transformation and multi-scale characterization processing on the pipeline magnetic flux leakage signal data, generate a multi-scale magnetic flux leakage signal dataset with global defect distribution and local details, and use the multi-scale magnetic flux leakage signal dataset as input data for pipeline defect magnetic flux leakage detection model.

[0027] In the embodiments of the present application, based on the pipeline robot collected pipeline magnetic flux leakage signal data, first of all, a series of preprocessing operations need to be carried out on the collected magnetic flux leakage signal data. The main steps of preprocessing include but are not limited to filtering processing and amplitude calibration. Specifically, the pipeline magnetic flux leakage signal data is composed of multiple magnetic flux leakage signals, and each magnetic flux leakage signal is accompanied by detailed spatial positioning data. These spatial positioning data cover the axial position information of the pipeline and the circumferential angle information of the pipeline, providing important reference for subsequent signal analysis and defect positioning.

[0028] In the preprocessing process, the original magnetic flux leakage signal collected is first filtered. The purpose of filtering is to remove the noise components introduced by the roughness of the inner wall of the pipeline, the jitter of the sensor during operation, or external electromagnetic interference and other factors. Through this step, the effective magnetic signal components directly related to the pipeline defects can be effectively retained, thereby improving the quality and reliability of the signal.

[0029] In addition, it is also necessary to calibrate the amplitude of the magnetic flux leakage signal according to the sensitivity parameters of the sensor and the magnetic permeability characteristics of the pipeline material. The purpose of amplitude calibration is to eliminate the differences between different sensor individuals and the possible influence of environmental temperature changes on signal strength. Through this calibration process, the physical consistency of the amplitude of each magnetic flux leakage signal can be ensured, so that the subsequent data analysis and defect identification work is more accurate and efficient. In this way, not only the precision of signal processing is improved, but also a solid foundation is laid for accurate detection and evaluation of pipeline defects.

[0030] Then, taking the axial position of the pipeline as the first-dimensional coordinate, the circumferential angle of the pipeline as the second-dimensional coordinate, and the strength of the magnetic flux leakage signal as the gray value, a two-dimensional spatial grid is constructed, and multiple magnetic flux leakage signals and the spatial positioning data of each magnetic flux leakage signal are mapped into this two-dimensional spatial grid, thereby obtaining a distribution heat map of the magnetic flux leakage signal strength. Subsequently, the magnetic flux leakage signal strength distribution heat map is adjusted and converted into a tensor format suitable for neural network input. Specifically, by combining the built-in odometer, gyroscope, or electromagnetic positioning module of the robot, the axial position and circumferential angle corresponding to each magnetic flux leakage signal collection time are accurately recorded, and a mapping relationship between the signal and the spatial coordinates is established. Then, the discrete magnetic flux leakage signals are interpolated according to the spatial coordinates to construct a uniformly distributed grid in the three-dimensional space of the pipeline, ensuring that each grid point corresponds to a unique magnetic flux leakage signal strength value. On this basis, a spatial magnetic flux leakage signal strength distribution map is generated, with the axial position and circumferential angle as the horizontal and vertical axes, respectively, and the strength of the magnetic flux leakage signal as the gray value or color value, to generate a magnetic flux leakage signal strength heat map on the pipeline expansion plane. This heat map can intuitively show the abnormal distribution of magnetic signals in the defect area. Finally, the generated spatial magnetic flux leakage signal strength distribution map is converted into a tensor format that can be recognized and input by the neural network, laying a solid foundation for subsequent multi-scale signal processing and feature extraction.

[0031] Finally, the pre-set cropping rules are obtained, which are designed to accurately crop the adjusted magnetic flux leakage signal strength distribution heat map. Specifically, these pre-set cropping rules are used to finely crop the heat map, and finally a data set containing multi-scale magnetic flux leakage signals is obtained. These pre-set cropping rules not only cover multiple different cropping size specifications, but also specify the application priority of each cropping size specification to ensure the order and efficiency of the cropping process. For example, according to the pre-set rules, large-size images and small-size images are cropped respectively. The large-size images usually cover a larger area of the pipeline and can clearly show the distribution trend of macroscopic defects, which is helpful for understanding the overall health of the pipeline. The small-size images focus on the local area of the pipeline and can show the details of microscopic defects in detail, which is convenient for in-depth analysis of specific defect features. Through this multi-scale cropping method, multiple groups of magnetic flux leakage signal images with different sizes are obtained, which together form a rich multi-scale magnetic flux leakage signal data set, providing a solid data foundation for subsequent research work. Specifically, researchers can analyze the magnetic flux leakage signals from different scales to extract more comprehensive defect features, thereby improving the accuracy and reliability of defect detection.

[0032] 202. Using the convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model, feature extraction and enhancement processing are performed on the multi-scale magnetic flux leakage signal dataset to obtain a multi-level primary feature map set.

[0033] In this embodiment, a hierarchical feature extraction module is used to obtain multiple feature maps from the multi-scale magnetic flux leakage signal dataset. The convolutional layers of a convolutional neural network are then used to sequentially calculate the multiple feature maps, resulting in multiple first feature maps. The calculation formula is as follows: Formula 1: Formula 1:

[0034] in, Represents the first feature map Pixel value at that location, This represents the number of input channels of the feature map. The feature map represents the first time. One channel, Pixel value at that location, Indicates the convolution kernel at the th... One channel, The weight of the position, This represents the height of the convolution kernel. This represents the width of the convolution kernel. This represents the bias term of the convolution kernel. Indicates the height index of the convolution kernel. Indicates the width index of the convolution kernel. This represents the height index of the first feature map. This represents the width index of the first feature map. Indicates the height index of the feature map. This represents the width index of the feature map. The convolutional layer calculation typically uses... A convolutional kernel of size is used, with a stride of 2, to ensure that computation is reduced while extracting features, thus improving processing efficiency. This method effectively extracts rich feature information from multi-scale magnetic flux leakage signal datasets, providing a solid foundation for further analysis and processing.

[0035] Next, the normalization layer of the convolutional neural network is used to normalize the features of multiple first feature maps. Then, the ReLU activation function of the convolutional neural network is used to perform non-linear activation on the normalized first feature maps to obtain multiple non-linear feature maps. The calculation formula is shown in Formula 2 below: Formula 2:

[0036] in, Representing the nonlinear characteristic graph Pixel value at that location, Represents multiple first feature maps after normalization Pixel value at that location, This indicates element-wise operation. This represents the height index of the nonlinear feature map. The width index represents the non-linear feature map. This represents the height index of multiple normalized first feature maps. This represents the width index of the multiple first feature maps after normalization.

[0037] Subsequently, the max pooling layer of the convolutional neural network is used to perform max pooling on the multiple nonlinear feature maps to obtain multiple second feature maps. The calculation formula is shown in Formula 3 below: Formula 3:

[0038] in, Indicates the second feature map in Pixel value at that location, Indicating nonlinear feature maps in Pixel value at that location, Represents the nonlinear feature map and the output position The corresponding pooling region, This represents the height index of the second feature map. This represents the width index of the second feature map. This represents the height index of the nonlinear feature map. This represents the width index of the non-linear feature map. For example, the pooling window size is... If the step size is 2, then each It's just one Small pieces.

[0039] Finally, the backbone network of the convolutional neural network is used to process each of the multiple second feature maps using residual network layers to obtain multiple initial feature maps. These initial feature maps are then used to generate a multi-level primary feature map set. The backbone network consists of multiple residual layers, and the calculation formula is shown in Formula 4 below. Formula 4:

[0040] in, Represents the initial feature map. This represents the second feature map. This represents the first residual layer of the backbone network. This represents the second residual layer of the backbone network. This represents the third residual layer of the backbone network. This represents the fourth residual layer of the backbone network. This represents the input features of the first residual layer of the backbone network. This represents the input features of the second residual layer of the backbone network. This represents the input features of the third residual layer of the backbone network. This represents the input features of the fourth residual layer of the backbone network. Through the progressive processing of four residual layers, rich semantic information from low-level details to high-level abstractions in the image is captured. Each residual structure further extracts and integrates image features based on the previous layer, thus gradually constructing a semantic information pyramid with distinct layers from shallow to deep. This hierarchical processing method not only ensures the complete preservation of image details but also achieves accurate capture of deep semantics in the image, providing a solid foundation for subsequent image analysis and understanding.

[0041] 203. Using the multi-scale convolution branch in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model, parallel multi-scale feature extraction is performed on the multi-level primary feature map set to obtain the output feature map of the first-scale convolution branch, the output feature map of the second-scale convolution branch, the output feature map of the third-scale convolution branch, and the output feature map of the fourth-scale convolution branch.

[0042] In this embodiment, dynamic receptive field feature enhancement overcomes the limitations of a fixed receptive field by dynamically adjusting the receptive field and weighted fusing multi-scale features, significantly improving the model's ability to capture various defects and the robustness of feature representation. Specifically, based on the multi-scale fusion module, multiple initial feature maps are obtained from a multi-level primary feature map set. For the first-scale convolutional branch, a regular convolutional layer, a batch normalization layer, and a ReLU activation function are used to sequentially perform convolution calculations on the multiple initial feature maps to obtain the output feature map of the first-scale convolutional branch. The batch normalization layer is defined by the following formula 5: Formula 5:

[0043] in, Indicates the first The first batch of normalized layers in the convolutional branch of each scale One output value, Indicates the first Scaling parameters of batch normalized layers in each scale convolution branch This represents a preset constant. Indicates the first Translation parameters of batch normalized layers in each scale convolution branch Indicates the first The first batch of normalized layers in the convolutional branch of each scale One input value, Indicates the first The mean of multiple input values ​​of the batch normalized layer in each scale convolution branch. Indicates the first The variance of multiple input values ​​in the batch normalized layer of each scale convolution branch.

[0044] For the second-scale convolution branch, multiple initial feature maps are sequentially convolved using a dilated convolution layer with a first dilation coefficient, a batch normalization layer, and a ReLU activation function to obtain the output feature map of the second-scale convolution branch. The dilated convolution layer is defined by the following formula: (Formula 6) Formula 6:

[0045] in, Represents the feature map of dilated convolution Pixel value at that location, Represents the initial feature map Pixel value at that location, Indicates that the dilated convolution kernel is in The weight of the position, This represents the height of the dilated convolution kernel. This represents the width of the dilated convolution kernel. This represents the height index of the dilated convolution kernel. Indicates the width index of the dilated convolution kernel. Indicates the first padding values ​​for scale convolution branches This represents the height index of the initial feature map. Indicates the width index of the initial feature map. This represents the height index of the dilated convolutional feature map. Indicates the width index of the dilated convolutional feature map. , Indicates the first coefficient of thermal expansion. This represents the second coefficient of thermal expansion. This represents the third expansion coefficient.

[0046] For the third-scale convolution branch, multiple initial feature maps are sequentially convolved using a dilated convolution layer with a second dilation coefficient, a batch normalization layer, and a ReLU activation function to obtain the output feature map of the third-scale convolution branch.

[0047] For the fourth-scale convolution branch, multiple initial feature maps are sequentially convolved using a dilated convolution layer with a third dilation coefficient, a batch normalization layer, and a ReLU activation function to obtain the output feature map of the fourth-scale convolution branch.

[0048] The first-scale convolutional branch includes regular convolutional layers, batch normalized layers, and the ReLU activation function. The regular convolutional layer uses... The first convolutional layer has a kernel size and padding of 1. The second-scale convolutional branch includes a dilated convolutional layer with a first dilation coefficient, a batch normalized layer, and a ReLU activation function. The dilated convolutional layer uses... The convolutional layer has a kernel size of 2, padding of 2, and a first dilation factor of 2. The third-scale convolutional branch includes a dilated convolutional layer with a second dilation factor, a batch normalized layer, and a ReLU activation function. The dilated convolutional layer uses... The convolutional layer has a kernel size, padding of 3, and a second dilation factor of 3; the fourth-scale convolutional branch includes a dilated convolutional layer with a third dilation factor, a batch normalized layer, and a ReLU activation function. The dilated convolutional layer uses... The convolutional layer has a kernel size of 4, padding of 4, and a third dilation factor of 4; the second dilation factor is greater than the first dilation factor, and the third dilation factor is greater than the second dilation factor. Each scale of the convolutional branch, through different convolution methods and parameter settings, achieves multi-scale feature extraction from the input feature map. The regular convolutional layer can capture local details, providing a foundation for feature extraction; while the dilated convolutional layer with different dilation factors can expand the receptive field without increasing computational cost, thereby capturing a wider range of contextual information. This multi-scale convolutional branch design allows the model to simultaneously focus on local and global features, thus improving the richness and accuracy of feature representation and providing more comprehensive and effective feature input for subsequent task processing.

[0049] 204. Using the attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model, the attention weight vectors of the multi-level primary feature map set are calculated to obtain the attention weight vectors of the first-scale convolution branch, the second-scale convolution branch, the third-scale convolution branch, and the fourth-scale convolution branch.

[0050] In this embodiment, the attention mechanism in the multi-scale fusion module is used to perform global average pooling on multiple initial feature maps, compressing the spatial dimension to... To obtain global context information of the input features, multiple global feature maps are obtained, and the calculation formula is shown in Formula 7 below: Formula 7:

[0051] in, The global feature map is represented in the th... Pixel values ​​at each channel Indicates the height of the initial feature map. This represents the width of the initial feature map. This represents the number of input channels in the initial feature map. The initial feature map is represented at the th... One channel, Pixel value at that location, This represents the height index of the initial feature map. The width index of the initial feature map is represented. By compressing each channel of the initial feature map into a global feature, the global distribution trend of the pipeline defect is captured, avoiding focusing only on local details and ignoring the overall scene, and providing a complete global information basis for subsequent defect judgment.

[0052] Then, the attention mechanism in the multi-scale fusion module is used to calculate each global feature map through a full connection layer and a ReLU activation function in turn, to obtain a plurality of third feature maps, and to expand the channel number of each third feature map to 4 to obtain a plurality of fourth feature maps. The data of the 4 channels of the plurality of fourth feature maps are reshaped into attention weight tensors through view transformation to obtain a feature vector of the first scale convolution branch, a feature vector of the second scale convolution branch, a feature vector of the third scale convolution branch, and a feature vector of the fourth scale convolution branch. The full connection layer is composed of two convolution layers.

[0053] Subsequently, the feature vectors of the first scale convolution branch, the second scale convolution branch, the third scale convolution branch, and the fourth scale convolution branch are normalized by using the Softmax function of the attention mechanism to obtain the attention weight vector of the first scale convolution branch, the attention weight vector of the second scale convolution branch, the attention weight vector of the third scale convolution branch, and the attention weight vector of the fourth scale convolution branch. The calculation formula is as follows: Formula 8:

[0054] Among them, the attention weight vector of the i-th scale convolution branch, the feature vector of the i-th scale convolution branch, the feature vector of the i-th scale convolution branch, the feature vector of the i-th scale convolution branch, the feature vector of the i-th scale convolution branch, the feature vector of the i-th scale convolution branch, the Softmax function makes the effective features of the key scale in the multi-scale feature more prominent and the noise suppressed, and can also adjust the dynamic weight to enhance the adaptability to the pipeline defect scene with multiple scales and complex morphology, greatly improving the detection accuracy and reducing the missed detection and false detection.

[0055] 205、Based on the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model, the output feature maps and attention weight vectors of the first scale convolution branch, the second scale convolution branch, the third scale convolution branch, and the fourth scale convolution branch are weighted and fused to obtain a deep feature map.

[0056] ​In the embodiment of the present application, based on the multi-scale fusion module, the output feature maps and attention weight vectors of the first, second, third and fourth scale convolution branches are weighted and fused to obtain a deep feature map fused with multi-scale contexts, which can more comprehensively and accurately depict the pipeline defects, thereby improving the accuracy of subsequent defect detection. The calculation formula is as follows: Formula 9:

[0057] wherein, represents a deep feature map, represents an attention weight vector of the i-th scale convolution branch, represents an output feature map of the i-th scale convolution branch. 206、Based on the feature pyramid module of the pipeline defect magnetic flux leakage detection model, the deep feature map is subjected to horizontal connection and up-sampling fusion operation to obtain a multi-scale target feature map.

[0058] In the embodiment of the present application, the channel of the deep feature map is adjusted to 256 by using the horizontal connection unit of the feature pyramid module to obtain a channel standardized feature map, and the calculation formula is as follows: Formula 10:

[0059]

[0060] wherein, represents a channel standardized feature map, represents a convolution operation, represents a deep feature map.

[0061] Then, the channel standardized feature map is subjected to 2 times bilinear up-sampling processing by the up-sampling unit of the feature pyramid module to match the spatial size of the next layer feature to obtain a high layer feature map.

[0062] Subsequently, the feature fusion unit of the feature pyramid module is used to add and fuse the high layer feature map and the channel standardized feature map element by element to effectively integrate the high layer semantic information into the relatively low resolution feature to obtain a fused feature map, and the calculation formula is as follows: Formula 11:

[0063] wherein, represents a fused feature map, represents a high layer feature map, represents a channel standardized feature map. ​​​

[0064] Finally, the convolutional smoothing unit of the feature pyramid module is used to smooth and enhance the fused feature map, generating a multi-scale target feature map. This ensures that the model can obtain a powerful feature representation that takes into account both high-level semantics and low-level details, laying the foundation for high-precision detection.

[0065] 207. Through the task decoupling module of the pipeline defect magnetic flux leakage detection model, multi-task branch prediction operation is performed on the multi-scale target feature map to obtain preliminary classification prediction results and preliminary localization prediction results.

[0066] In this embodiment, the multi-scale target feature map is input into the semantic enhancer of the task decoupling module. The spatial information of the multi-scale target feature map is compressed into a 1×1 fifth feature map through adaptive average pooling operation. The fifth feature map is flattened into a classification feature vector through a view operation. The classification feature vector is then calculated by passing it through two linear layers and the ReLU activation function to generate a preliminary classification prediction result.

[0067] Subsequently, the multi-scale target feature map is input into the spatial perceptron of the task decoupling module. The spatial perceptron performs adaptive average pooling and adaptive max pooling operations to capture spatial location information in the feature map, obtaining average pooling and max pooling results. These results are then concatenated along the channel dimension to obtain a pooled concatenation result. This pooled concatenation result is then processed through two convolutional layers and a view operation to generate a preliminary localization prediction result containing the four coordinates of the bounding box. By explicitly separating the classification and localization tasks, interference between tasks is effectively reduced, improving the independent accuracy of defect type identification and bounding box localization.

[0068] 208. Through the task alignment module of the pipeline defect magnetic flux leakage detection model, perform cross-task feature alignment operation on the preliminary classification prediction results and the preliminary location prediction results to obtain the pipeline defect magnetic flux leakage detection results output by the pipeline defect magnetic flux leakage detection model.

[0069] In this embodiment, the classification-guided localization adjustment branch of the task alignment module is used to calculate the multi-scale target feature map to obtain the localization prediction adjustment feature map. The calculation formula is as follows: Formula 12: Formula 12:

[0070] in, This represents the feature map of the location prediction adjustment amount. This indicates that the number of output channels is 4. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. convolution operation, representing a multi-scale target feature map.

[0071] Then, the positioning guide classification adjustment branch of the task alignment module is used to calculate the multi-scale target feature map to obtain a classification feature adjustment amount feature map, and the calculation formula is as follows formula 13: Formula 13:

[0072] wherein, representing a classification feature adjustment amount feature map, representing a convolution operation, representing a ReLU activation function, representing a batch normalization operation, representing a convolution operation, representing a multi-scale target feature map.

[0073] Subsequently, the task alignment module is used to perform view transformation on the positioning prediction adjustment amount feature map and calculate a spatial dimension average value, and the spatial dimension average value is added to the preliminary positioning prediction result element by element to correct the boundary box prediction, so that the classification information is fused to obtain a positioning prediction correction result, wherein the calculation formula of the spatial dimension average value is as follows formula 14: Formula 14:

[0074] wherein, representing a spatial dimension average value, representing a height value of the positioning prediction adjustment amount feature map, representing a width value of the positioning prediction adjustment amount feature map, representing all channel feature values of the positioning prediction adjustment amount feature map at a height of and a width of

[0075] Then, the task alignment module is used to perform 2 times upsampling processing on the classification feature adjustment amount feature map to match the spatial size of the classification feature, and perform element by element addition operation with the multi-scale target feature map to integrate the positioning information into the classification feature to obtain a classification feature enhancement result.

[0076] Again, the task alignment module is used to perform adaptive average pooling processing on the classification feature enhancement result, and use the view operation to flatten it into a target classification feature vector. The target classification feature vector is spliced with the preliminary classification prediction result in the channel dimension to obtain a target classification splicing feature. The target classification splicing feature is input into a linear classifier layer to obtain a defect class prediction result, and the calculation formula is as follows formula 15:​ Formula 15:

[0077] wherein, denotes the defect category prediction result, denotes the output channel number of 4 convolution operation, denotes the ReLU activation function, denotes the batch normalization operation, denotes the output channel number of 128 convolution operation, denotes the target classification splicing feature.

[0078] The task alignment module performs adaptive average pooling on the preliminary positioning prediction result, and adopts the view operation to flatten into a target positioning feature vector. The target positioning feature vector and the positioning prediction correction result are spliced in the channel dimension to obtain a target positioning splicing feature. The target positioning splicing feature is input into a linear regressor layer to obtain a defect boundary box prediction result. The calculation formula is as follows Formula 16: Formula 16:

[0079] wherein, denotes the defect boundary box prediction result, denotes the linear transformation operation, denotes the target positioning splicing feature.

[0080] Finally, the defect category prediction result and the defect boundary box prediction result are taken as the pipeline defect magnetic flux leakage detection result. The execution task alignment realizes mutual calibration and enhancement of information through bidirectional feature adjustment between classification and positioning tasks, further improves the overall prediction accuracy and consistency of the model.

[0081] In summary, the present application can efficiently process magnetic flux leakage signal data, maintain stable performance in signal transmission and analysis process, and quickly complete feature extraction and defect judgment even in the face of a large amount of continuously generated magnetic flux leakage signals. The detection result of whether the pipeline has defects is quickly output, meeting the demand of real-time detection. Moreover, the present application can accurately detect defects of different sizes in complex scenes. Whether it is a complex defect scene of multiple defects superimposed, irregular shape, or a defect situation of large size difference such as millimeter-level cracks and centimeter-level corrosion pits existing in the same pipeline, the present application can accurately identify the position, shape and size of various defects, ensuring the accuracy of the detection result. In addition, the present application has strong generalization ability. No matter what metal material the pipeline is made of, or whether the pipeline is in high temperature and high pressure, humid and dusty or other complex environments, the present application can stably play a detection role without the need for a large number of parameter adjustments or retraining for different pipelines, easily adapting to various pipeline detection scenes.

[0082] The embodiment of the present application provides a kind of multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection method, compared with prior art, the embodiment of the present application is by first collecting pipeline magnetic flux leakage signal data, pipeline magnetic flux leakage signal data is converted in space domain and is handled with multi-scale representation, generates multi-scale magnetic flux leakage signal data set with defect global distribution and local details, can solve the problem that complex defect capture is not complete caused by artificial method dependence artificial feature, traditional deep learning single scale input cannot cover global and local simultaneously, provide comprehensive data support for accurate detection.Then using the convolutional neural network in the hierarchical feature extraction module of pipeline defect magnetic flux leakage detection model, multi-scale magnetic flux leakage signal data set is handled with feature extraction and enhancement, and a multi-level primary feature map set is obtained, which can efficiently extract multi-level primary features from low to high, overcome the defects of poor generalization ability and easy to miss key information of artificial method.Subsequently, using the multi-scale convolution branch and attention mechanism in the multi-scale fusion module of pipeline defect magnetic flux leakage detection model, the multi-level primary feature map set is handled with dynamic receptive field feature enhancement and weighted fusion, and a deep feature map with fused multi-scale context is obtained, which can simultaneously learn defect global features and local features, solve the problem that traditional deep learning is difficult to consider global and local, and strengthen the representation of complex and multi-scale defects.Then, based on the feature pyramid module of pipeline defect magnetic flux leakage detection model, the deep feature map is operated with horizontal connection and up-sampling fusion, and a multi-scale target feature map is obtained, so that deep high semantic features and shallow high spatial detail features are efficiently fused, and the obtained multi-scale target feature map has high semantic information of global understanding and high spatial detail of local precision, further improving the consideration ability of global and local features.Finally, through the task decoupling module and task alignment module of pipeline defect magnetic flux leakage detection model, multi-scale target feature map is executed with multi-task branch prediction and cross-task feature alignment operation, and pipeline defect magnetic flux leakage detection result output by pipeline defect magnetic flux leakage detection model is obtained, to improve the accuracy and integrity of defect detection in complex scene.

[0083] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a kind of multi-scale data-driven deep learning pipeline defect magnetic flux leakage detection device, as Figure 3 As shown in the figure, the device includes: data acquisition and processing module 301, hierarchical feature learning module 302, adaptive multi-context feature synthesis module 303, multi-resolution semantic enhancement module 304 and collaborative task optimization and output module 305.

[0084] The data acquisition and processing module 301 is configured to acquire pipeline magnetic flux leakage signal data, perform spatial domain conversion and multi-scale characterization processing on the pipeline magnetic flux leakage signal data, generate a multi-scale magnetic flux leakage signal data set with global distribution and local details of defects, and use the multi-scale magnetic flux leakage signal data set as input data of a pipeline defect magnetic flux leakage detection model. The hierarchical feature learning module 302 is configured to use a convolutional neural network in a hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model to perform feature extraction and enhancement processing on the multi-scale magnetic flux leakage signal data set to obtain a multi-level primary feature map set. The adaptive multi-context feature synthesis module 303 is configured to use a multi-scale convolution branch and an attention mechanism in a multi-scale fusion module of the pipeline defect magnetic flux leakage detection model to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set to obtain a deep feature map with fused multi-scale context. The multi-resolution semantic enhancement module 304 is configured to use a feature pyramid module of the pipeline defect magnetic flux leakage detection model to perform horizontal connection and up-sampling fusion operations on the deep feature map to obtain a multi-scale target feature map. The collaborative task optimization and output module 305 is configured to use a task decoupling module and a task alignment module of the pipeline defect magnetic flux leakage detection model to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map to obtain a pipeline defect magnetic flux leakage detection result output by the pipeline defect magnetic flux leakage detection model.

[0085] In a specific application scenario, the data acquisition and processing module 301 is configured to acquire the pipeline magnetic flux leakage signal data based on a pipeline robot, and perform preprocessing on the pipeline magnetic flux leakage signal data, the preprocessing including filtering and amplitude calibration. The pipeline magnetic flux leakage signal data includes a plurality of magnetic flux leakage signals, and spatial positioning data of each magnetic flux leakage signal, the spatial positioning data including a pipeline axial position and a pipeline circumferential angle. A two-dimensional spatial grid is constructed with the pipeline axial position as a first-dimensional coordinate, the pipeline circumferential angle as a second-dimensional coordinate, and the magnetic flux leakage signal intensity as a gray value. The plurality of magnetic flux leakage signals and the spatial positioning data of each magnetic flux leakage signal are mapped into the two-dimensional spatial grid to obtain a magnetic flux leakage signal intensity distribution heat map. The magnetic flux leakage signal intensity distribution heat map is adjusted to a tensor format. A preset cropping rule is obtained, and the adjusted magnetic flux leakage signal intensity distribution heat map is cropped using the preset cropping rule to obtain the multi-scale magnetic flux leakage signal data set. The preset cropping rule includes a plurality of cropping size specifications and an application priority corresponding to each cropping size specification.

[0086] In specific application scenarios, the hierarchical feature learning module 302 is used to obtain multiple feature maps included in the multi-scale magnetic flux leakage signal dataset based on the hierarchical feature extraction module, and to sequentially calculate the multiple feature maps using the convolutional layers of the convolutional neural network to obtain multiple first feature maps.

[0087] in, In the first feature map Pixel value at that location, This represents the number of input channels in the feature map. The feature map is in the first... One channel, Pixel value at that location, Indicates the convolution kernel at the th... One channel, The weight of the position, This represents the height of the convolution kernel. This represents the width of the convolution kernel. This represents the bias term of the convolution kernel. Indicates the height index of the convolution kernel. Indicates the width index of the convolution kernel. This represents the height index of the first feature map. This represents the width index of the first feature map. This represents the height index of the feature map. The width index of the feature map is used; the multiple first feature maps are normalized using the normalization layer of the convolutional neural network, and the ReLU activation function of the convolutional neural network is used to perform nonlinear activation processing on the normalized multiple first feature maps to obtain multiple nonlinear feature maps.

[0088] in, The nonlinear feature map represents Pixel value at that location, The normalized first feature maps represent the... Pixel value at that location, This indicates element-wise operation. This represents the height index of the nonlinear feature map. The width index represents the nonlinear feature map. This represents the height index of the multiple first feature maps after normalization. The index represents the width of the normalized plurality of first feature maps; the plurality of nonlinear feature maps are max-pooled using the max-pooling layer of the convolutional neural network to obtain a plurality of second feature maps.

[0089] in, This indicates that the second feature map is in Pixel value at that location, This indicates that the nonlinear feature map is in Pixel value at that location, The nonlinear feature map is related to the output position. The corresponding pooling region, This represents the height index of the second feature map. This represents the width index of the second feature map. This represents the height index of the nonlinear feature map. The width index represents the nonlinear feature map; the backbone network of the convolutional neural network is used to process each of the plurality of second feature maps using residual network layers to obtain a plurality of initial feature maps; the plurality of initial feature maps are used to generate the multi-level primary feature map set, wherein the backbone network consists of a plurality of residual layers.

[0090] in, This represents the initial feature map. This represents the second feature map. This represents the first residual layer of the backbone network. This represents the second residual layer of the backbone network. This represents the third residual layer of the backbone network. This represents the fourth residual layer of the backbone network. This represents the input features of the first residual layer of the backbone network. This represents the input features of the second residual layer of the backbone network. This represents the input features of the third residual layer of the backbone network. This represents the input features of the fourth residual layer of the backbone network.

[0091] In specific application scenarios, the adaptive multi-context feature synthesis module 303 is used to obtain multiple initial feature maps included in the multi-level primary feature map set based on the multi-scale fusion module; and to perform parallel multi-scale feature extraction on the multiple initial feature maps using the multi-scale convolution branches in the multi-scale fusion module, thereby obtaining the output feature maps of the first-scale convolution branch, the second-scale convolution branch, the third-scale convolution branch, and the fourth-scale convolution branch. The first-scale convolution branch includes a regular convolutional layer, a batch normalization layer, and a ReLU activation function, and the second-scale convolution branch... The system includes a dilated convolutional layer with a first dilation coefficient, a batch normalized layer, and a ReLU activation function. The third-scale convolutional branch includes a dilated convolutional layer with a second dilation coefficient, the batch normalized layer, and the ReLU activation function. The fourth-scale convolutional branch includes a dilated convolutional layer with a third dilation coefficient, the batch normalized layer, and the ReLU activation function. The second dilation coefficient is greater than the first dilation coefficient, and the third dilation coefficient is greater than the second dilation coefficient. Using the attention mechanism in the multi-scale fusion module, global average pooling is performed on the multiple initial feature maps to obtain multiple global feature maps.

[0092] in, The global feature map is represented in the th... Pixel values ​​at each channel This represents the height of the initial feature map. This represents the width of the initial feature map. This represents the number of input channels in the initial feature map. The initial feature map is represented in the first... One channel, Pixel value at that location, This represents the height index of the initial feature map. The width index of the initial feature map is represented by this value. Using the attention mechanism in the multi-scale fusion module, each global feature map is sequentially processed through a fully connected layer and the ReLU activation function to obtain multiple third feature maps. The number of channels in each third feature map is then expanded to four to obtain multiple fourth feature maps. View transformations are performed on the data of the four channels of each of the multiple fourth feature maps to obtain the feature vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch. The fully connected layer consists of two... The convolutional layers are constructed; the Softmax function of the attention mechanism is used to normalize the feature vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch, resulting in the attention weight vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch.

[0093] in, Indicates the first Attention weight vectors for each scale convolutional branch. Indicates the first Feature vectors of each scale convolution branch Indicates the first Feature vectors of each scale convolution branch The Softmax function is represented by this module. Based on the multi-scale fusion module, the output feature maps and attention weight vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch are weighted and fused to obtain the deep feature map.

[0094] in, This represents the deep feature map. Indicates the first Attention weight vectors for each scale convolutional branch. Indicates the first Output feature maps of each scale convolutional branch.

[0095] In specific application scenarios, the adaptive multi-context feature synthesis module 303 is used to perform convolution calculations on the multiple initial feature maps sequentially using the regular convolutional layer, the batch normalization layer, and the ReLU activation function for the first-scale convolutional branch to obtain the output feature map of the first-scale convolutional branch, wherein the batch normalization layer is:

[0096] in, Indicates the first The first batch of normalized layers in the convolutional branch of each scale One output value, Indicates the first Scaling parameters of batch normalized layers in each scale convolution branch This represents a preset constant. Indicates the first Translation parameters of batch normalized layers in each scale convolution branch Indicates the first The first batch of normalized layers in the convolutional branch of each scale One input value, Indicates the first The mean of multiple input values ​​of the batch normalized layer in each scale convolution branch. Indicates the first The variance of multiple input values ​​in the batch normalized layer of the first-scale convolutional branch; for the second-scale convolutional branch, the multiple initial feature maps are sequentially convolved using the dilated convolutional layer with the first dilation coefficient, the batch normalized layer, and the ReLU activation function to obtain the output feature map of the second-scale convolutional branch, wherein the dilated convolutional layer is:

[0097] in, Represents the feature map of dilated convolution Pixel value at that location, The initial feature map represents Pixel value at that location, Indicates that the dilated convolution kernel is in The weight of the position, This represents the height of the dilated convolution kernel. This represents the width of the dilated convolution kernel. This represents the height index of the dilated convolution kernel. Indicates the width index of the dilated convolution kernel. Indicates the first padding values ​​for scale convolution branches This represents the height index of the initial feature map. This represents the width index of the initial feature map. This represents the height index of the dilated convolutional feature map. This represents the width index of the dilated convolutional feature map. , This represents the first coefficient of thermal expansion. This represents the second coefficient of thermal expansion. indicates the third expansion coefficient; for the third scale convolution branch, the plurality of initial feature maps are sequentially subjected to convolution calculation by using the dilated convolution layer with the second expansion coefficient, the batch normalization layer and the ReLU activation function in sequence, to obtain output feature maps of the third scale convolution branch; for the fourth scale convolution branch, the plurality of initial feature maps are sequentially subjected to convolution calculation by using the dilated convolution layer with the third expansion coefficient, the batch normalization layer and the ReLU activation function in sequence, to obtain output feature maps of the fourth scale convolution branch.

[0098] In a specific application scenario, the multi-resolution semantic enhancement module 304 is configured to perform channel adjustment on the deep feature map by using the transverse connection unit of the feature pyramid module, to obtain a channel standardized feature map,

[0099] wherein, indicates the channel standardized feature map, indicates convolution operation, indicates the deep feature map; the channel standardized feature map is subjected to 2 times bilinear up-sampling processing by using the up-sampling unit of the feature pyramid module, to obtain a high-level feature map; the high-level feature map and the channel standardized feature map are subjected to element-by-element addition fusion by using the feature fusion unit of the feature pyramid module, to obtain a fusion feature map,

[0100] wherein, indicates the fusion feature map, indicates the high-level feature map, indicates the channel standardized feature map; the fusion feature map is subjected to feature smoothing and enhancement processing by using the convolution smoothing unit of the feature pyramid module, to generate the multi-scale target feature map.

[0101] In a specific application scenario, the collaborative task optimization and output module 305 is used to input the multi-scale target feature map into the semantic enhancer of the task decoupling module, compress the spatial information of the multi-scale target feature map into a 1×1 fifth feature map through adaptive average pooling, and flatten the fifth feature map into a classification feature vector using a view operation; the classification feature vector is then processed sequentially through two linear layers and a ReLU activation function to generate a preliminary classification prediction result; the multi-scale target feature map is input into the spatial perceptron of the task decoupling module, and adaptive average pooling and adaptive max pooling operations are performed on the spatial perceptron to obtain average pooling and max pooling results, respectively, and the average pooling and max pooling results are concatenated in the channel dimension to obtain a pooling concatenation result; the pooling concatenation result is then processed sequentially through two convolutional layers and a view operation to generate a preliminary localization prediction result; and the task alignment module of the pipeline defect magnetic flux leakage detection model performs a cross-task feature alignment operation on the preliminary classification prediction result and the preliminary localization prediction result to obtain the pipeline defect magnetic flux leakage detection result.

[0102] In specific application scenarios, the collaborative task optimization and output module 305 is used to calculate the multi-scale target feature map by utilizing the classification-guided localization adjustment branch of the task alignment module, thereby obtaining a localization prediction adjustment feature map.

[0103] in, This represents the feature map of the positioning prediction adjustment amount. This indicates that the number of output channels is 4. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. Convolution operation, The multi-scale target feature map is represented; using the localization-guided classification adjustment branch of the task alignment module, the multi-scale target feature map is calculated to obtain the classification feature adjustment amount feature map.

[0104] in, This represents the feature map representing the adjustment amount of the classification features. This indicates that the number of output channels is 256. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. convolution operation, denotes the multi-scale target feature map; based on the task alignment module, the spatial dimension average value is calculated and the spatial dimension average value is added to the preliminary positioning prediction result element by element to obtain a positioning prediction correction result, wherein the calculation formula of the spatial dimension average value is:

[0105] wherein, denotes the spatial dimension average value, denotes the height value of the positioning prediction adjustment amount feature map, denotes the width value of the positioning prediction adjustment amount feature map, denotes all channel feature values of the positioning prediction adjustment amount feature map at a height of and a width of Based on the task alignment module, the classification feature adjustment amount feature map is processed by 2 times of upsampling, and an element by element addition operation is performed with the multi-scale target feature map to obtain a classification feature enhancement result; through the task alignment module of the pipeline defect magnetic flux leakage detection model, the preliminary classification prediction result, the preliminary positioning prediction result, the positioning prediction correction result and the classification feature enhancement result are predicted to obtain a defect category prediction result and a defect bounding box prediction result, and the defect category prediction result and the defect bounding box prediction result are taken as the pipeline defect magnetic flux leakage detection result.

[0106] In a specific application scenario, the cooperative task optimization and output module 305 is configured to perform adaptive average pooling processing on the classification feature enhancement result based on the task alignment module, and use a view operation to flatten the target classification feature vector. The target classification feature vector is spliced with the preliminary classification prediction result in the channel dimension to obtain a target classification splicing feature. The target classification splicing feature is input into a linear classifier layer to obtain the defect category prediction result.

[0107] wherein, denotes the defect category prediction result, denotes a batch normalization operation, convolution operation, denotes a ReLU activation function, denotes a batch normalization operation, denotes a convolution operation, convolution operation, representing the target classification concatenation feature; performing adaptive average pooling on the preliminary positioning prediction result based on the task alignment module, and using a view operation to flatten into a target positioning feature vector, concatenating the target positioning feature vector and the positioning prediction correction result in a channel dimension to obtain a target positioning concatenation feature, inputting the target positioning concatenation feature into a linear regression layer to obtain the defect bounding box prediction result,

[0108] wherein, representing the defect bounding box prediction result, representing a linear transformation operation, representing the target positioning concatenation feature.

[0109] The embodiment of the present application provides a kind of device, compared with prior art, the embodiment of the present application is first collected pipeline magnetic flux leakage signal data, pipeline magnetic flux leakage signal data is converted in space domain and is processed with multi-scale representation, generate multi-scale magnetic flux leakage signal data set with defect global distribution and local detail, it can solve the problem that complex defect capture is not complete caused by artificial method dependence artificial feature, traditional deep learning single scale input cannot cover global and local simultaneously, provide comprehensive data support for accurate detection. Then using the convolutional neural network in the hierarchical feature extraction module of pipeline defect magnetic flux leakage detection model, multi-scale magnetic flux leakage signal data set is extracted and enhanced, and a multi-level primary feature map set is obtained, which can efficiently extract multi-level primary features from low to high, and overcome the defects of poor generalization ability and easy to miss key information of artificial method. Subsequently, using the multi-scale convolution branch and attention mechanism in the multi-scale fusion module of pipeline defect magnetic flux leakage detection model, the multi-level primary feature map set is dynamically enhanced and weighted fused with receptive field feature, to obtain a deep feature map fused with multi-scale context, which can simultaneously learn defect global features and local features, solve the problem that traditional deep learning cannot balance global and local, and strengthen the representation of complex and multi-scale defects. Then, based on the feature pyramid module of pipeline defect magnetic flux leakage detection model, the deep feature map is transversely connected and up-sampled and fused to obtain a multi-scale target feature map, so that deep high semantic features and shallow high spatial detail features are efficiently fused, and the obtained multi-scale target feature map has high semantic information of global understanding and high spatial detail of local precision, further improving the balance capability of global and local features. Finally, through the task decoupling module and the task alignment module of pipeline defect magnetic flux leakage detection model, multi-task branch prediction and cross-task feature alignment operations are performed on the multi-scale target feature map to obtain pipeline defect magnetic flux leakage detection results output by the pipeline defect magnetic flux leakage detection model, to improve the accuracy and integrity of defect detection in complex scenarios.

[0110] It should be noted that other corresponding descriptions of the various functional units involved in the pipeline defect magnetic flux leakage detection device provided by the embodiments of the present application can be referred to the corresponding descriptions in Figure 1 and Figure 2 , which will not be repeated here.

[0111] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.

[0112] The technical features of the above embodiments can be combined in any way. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0113] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be noted that for ordinary skilled persons in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

[0114] Those skilled in the art can understand that the accompanying drawings are only a schematic diagram of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily required for implementing the present application.

[0115] Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed and located in one or more devices different from the implementation scenario. The modules of the above-described implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0116] The above-mentioned serial numbers of the present application are only for description, not representing the advantages and disadvantages of the implementation scenario.

[0117] The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the present application.

Claims

1. A multi-scale data-driven deep learning method for detecting magnetic flux leakage in pipeline defects, characterized in that, include: Collect pipeline magnetic flux leakage signal data, perform spatial domain transformation and multi-scale characterization processing on the pipeline magnetic flux leakage signal data to generate a multi-scale magnetic flux leakage signal dataset with global defect distribution and local details, and use the multi-scale magnetic flux leakage signal dataset as input data for pipeline defect magnetic flux leakage detection model; Using the convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model, feature extraction and enhancement processing are performed on the multi-scale magnetic flux leakage signal dataset to obtain a multi-level primary feature map set. By utilizing the multi-scale convolutional branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model, dynamic receptive field feature enhancement and weighted fusion processing are performed on the multi-level primary feature map set to obtain a deep feature map that fuses multi-scale context. Based on the feature pyramid module of the pipeline defect magnetic flux leakage detection model, the deep feature map is horizontally connected and upsampled to obtain a multi-scale target feature map. The pipeline defect magnetic flux leakage detection model uses a task decoupling module and a task alignment module to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map to obtain the pipeline defect magnetic flux leakage detection results output by the pipeline defect magnetic flux leakage detection model.

2. The method according to claim 1, characterized in that, The collected pipeline magnetic flux leakage signal data undergoes spatial domain transformation and multi-scale characterization processing to generate a multi-scale magnetic flux leakage signal dataset with global defect distribution and local details, including: Based on the pipeline robot collecting the pipeline magnetic flux leakage signal data, the pipeline magnetic flux leakage signal data is preprocessed. The preprocessing includes filtering and amplitude calibration. The pipeline magnetic flux leakage signal data includes multiple magnetic flux leakage signals and spatial positioning data of each magnetic flux leakage signal. The spatial positioning data includes the axial position of the pipeline and the circumferential angle of the pipeline. Using the axial position of the pipe as the first dimension coordinate, the circumferential angle of the pipe as the second dimension coordinate, and the leakage magnetic signal intensity as the gray value, a two-dimensional spatial grid is constructed. The multiple leakage magnetic signals and the spatial positioning data of each leakage magnetic signal are mapped to the two-dimensional spatial grid to obtain a heat map of leakage magnetic signal intensity distribution. The heatmap of the leakage magnetic field intensity distribution is adjusted to a tensor format; Obtain preset clipping rules, and use the preset clipping rules to clip the adjusted magnetic flux leakage signal intensity distribution heatmap to obtain the multi-scale magnetic flux leakage signal dataset. The preset clipping rules include multiple clipping size specifications and the application priority corresponding to each clipping size specification.

3. The method according to claim 1, characterized in that, The convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model is used to perform feature extraction and enhancement processing on the multi-scale magnetic flux leakage signal dataset, resulting in a multi-level primary feature map set, including: Based on the hierarchical feature extraction module, multiple feature maps are obtained from the multi-scale magnetic flux leakage signal dataset. The convolutional layers of the convolutional neural network are then used to sequentially calculate these multiple feature maps, resulting in multiple first feature maps. in, In the first feature map Pixel value at that location, This represents the number of input channels in the feature map. The feature map is in the first... One channel, Pixel value at that location, Indicates the convolution kernel at the th... One channel, The weight of the position, This represents the height of the convolution kernel. This represents the width of the convolution kernel. This represents the bias term of the convolution kernel. Indicates the height index of the convolution kernel. Indicates the width index of the convolution kernel. This represents the height index of the first feature map. This represents the width index of the first feature map. This represents the height index of the feature map. The width index of the feature map is indicated; The multiple first feature maps are normalized using the normalization layer of the convolutional neural network, and then nonlinear activation is performed on the normalized multiple first feature maps using the ReLU activation function of the convolutional neural network to obtain multiple nonlinear feature maps. in, The nonlinear feature map represents Pixel value at that location, The normalized first feature maps represent the... Pixel value at that location, This indicates element-wise operation. This represents the height index of the nonlinear feature map. The width index represents the nonlinear feature map. This represents the height index of the multiple first feature maps after normalization. The width index represents the normalized width of the plurality of first feature maps; The multiple nonlinear feature maps are subjected to max pooling processing using the max pooling layer of the convolutional neural network to obtain multiple second feature maps. in, This indicates that the second feature map is in Pixel value at that location, This indicates that the nonlinear feature map is in Pixel value at that location, This indicates the position relative to the output in the nonlinear feature map. The corresponding pooling region, This represents the height index of the second feature map. This represents the width index of the second feature map. This represents the height index of the nonlinear feature map. The width index represents the nonlinear feature map; The backbone network of the convolutional neural network is used to process each of the plurality of second feature maps using residual network layers to obtain multiple initial feature maps. These initial feature maps are then used to generate the multi-level primary feature map set. The backbone network consists of multiple residual layers. in, This represents the initial feature map. This represents the second feature map. This represents the first residual layer of the backbone network. This represents the second residual layer of the backbone network. This represents the third residual layer of the backbone network. This represents the fourth residual layer of the backbone network. This represents the input features of the first residual layer of the backbone network. This represents the input features of the second residual layer of the backbone network. This represents the input features of the third residual layer of the backbone network. This represents the input features of the fourth residual layer of the backbone network.

4. The method according to claim 1, characterized in that, The method utilizes the multi-scale convolutional branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set, resulting in a deep feature map that fuses multi-scale context, including: The multi-scale fusion module is used to obtain multiple initial feature maps included in the multi-level primary feature map set; Using the multi-scale convolutional branches in the multi-scale fusion module, parallel multi-scale feature extraction is performed on the multiple initial feature maps to obtain the output feature maps of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch. The first-scale convolutional branch includes a regular convolutional layer, a batch normalization layer, and a ReLU activation function. The second-scale convolutional branch includes a dilated convolutional layer with a first dilation coefficient, the batch normalization layer, and the ReLU activation function. The third-scale convolutional branch includes a dilated convolutional layer with a second dilation coefficient, the batch normalization layer, and the ReLU activation function. The fourth-scale convolutional branch includes a dilated convolutional layer with a third dilation coefficient, the batch normalization layer, and the ReLU activation function. The second dilation coefficient is greater than the first dilation coefficient, and the third dilation coefficient is greater than the second dilation coefficient. Using the attention mechanism in the multi-scale fusion module, global average pooling is performed on the multiple initial feature maps to obtain multiple global feature maps. in, The global feature map is represented in the th... Pixel values ​​at each channel This represents the height of the initial feature map. This represents the width of the initial feature map. This represents the number of input channels in the initial feature map. The initial feature map is represented in the first... One channel, Pixel value at that location, This represents the height index of the initial feature map. Indicates the width index of the initial feature map; Utilizing the attention mechanism in the multi-scale fusion module, each global feature map is sequentially processed through a fully connected layer and the ReLU activation function to obtain multiple third feature maps. The number of channels in each third feature map is then expanded to four to obtain multiple fourth feature maps. View transformations are performed on the four channels of each of the multiple fourth feature maps to obtain the feature vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch. The fully connected layer consists of two... It consists of convolutional layers; The feature vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch are normalized using the Softmax function of the attention mechanism to obtain the attention weight vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch. in, Indicates the first Attention weight vectors for each scale convolutional branch. Indicates the first Feature vectors of each scale convolution branch Indicates the first Feature vectors of each scale convolution branch This represents the Softmax function; Based on the multi-scale fusion module, the output feature maps and attention weight vectors of the first-scale convolutional branch, the second-scale convolutional branch, the third-scale convolutional branch, and the fourth-scale convolutional branch are weighted and fused to obtain the deep feature map. in, This represents the deep feature map. Indicates the first Attention weight vectors for each scale convolutional branch. Indicates the first Output feature maps of each scale convolutional branch.

5. The method according to claim 4, characterized in that, The method of using the multi-scale convolution branches in the multi-scale fusion module to perform parallel multi-scale feature extraction on the multiple initial feature maps to obtain the output feature maps of the first-scale convolution branch, the second-scale convolution branch, the third-scale convolution branch, and the fourth-scale convolution branch includes: For the first-scale convolutional branch, the regular convolutional layer, the batch normalization layer, and the ReLU activation function are used to sequentially perform convolution calculations on the multiple initial feature maps to obtain the output feature map of the first-scale convolutional branch, wherein the batch normalization layer is: in, Indicates the first The first batch of normalized layers in the convolutional branch of each scale One output value, Indicates the first Scaling parameters of batch normalized layers in each scale convolution branch This represents a preset constant. Indicates the first Translation parameters of batch normalized layers in each scale convolution branch Indicates the first The first batch of normalized layers in the convolutional branch of each scale One input value, Indicates the first The mean of multiple input values ​​of the batch normalized layer in each scale convolution branch. Indicates the first The variance of multiple input values ​​in the batch normalized layer of each scale convolution branch; For the second-scale convolutional branch, the dilated convolutional layer with the first dilation coefficient, the batch normalization layer, and the ReLU activation function are sequentially used to perform convolution calculations on the multiple initial feature maps to obtain the output feature map of the second-scale convolutional branch, wherein the dilated convolutional layer is: in, Represents the feature map of dilated convolution Pixel value at that location, The initial feature map represents Pixel value at that location, Indicates that the dilated convolution kernel is in The weight of the position, This represents the height of the dilated convolution kernel. This represents the width of the dilated convolution kernel. This represents the height index of the dilated convolution kernel. Indicates the width index of the dilated convolution kernel. Indicates the first padding values ​​for scale convolution branches This represents the height index of the initial feature map. This represents the width index of the initial feature map. This represents the height index of the dilated convolutional feature map. This represents the width index of the dilated convolutional feature map. , This represents the first coefficient of thermal expansion. This represents the second coefficient of thermal expansion. This represents the third expansion coefficient; For the third-scale convolution branch, the dilated convolution layer with the second dilation coefficient, the batch normalization layer, and the ReLU activation function are used to sequentially perform convolution calculations on the multiple initial feature maps to obtain the output feature map of the third-scale convolution branch; For the fourth-scale convolution branch, the dilated convolution layer with the third dilation coefficient, the batch normalization layer, and the ReLU activation function are used to sequentially perform convolution calculations on the multiple initial feature maps to obtain the output feature map of the fourth-scale convolution branch.

6. The method according to claim 1, characterized in that, The feature pyramid module based on the pipeline defect magnetic flux leakage detection model performs lateral connection and upsampling fusion operations on the deep feature map to obtain a multi-scale target feature map, including: Using the lateral connection units of the feature pyramid module, channel adjustment is performed on the deep feature map to obtain a channel-normalized feature map. in, This represents the channel normalization feature map. express Convolution operation, This represents the deep feature map; The channel-normalized feature map is subjected to a 2x bilinear upsampling process by the upsampling unit of the feature pyramid module to obtain a high-level feature map; Using the feature fusion unit of the feature pyramid module, the high-level feature map and the channel-normalized feature map are fused element-by-element to obtain a fused feature map. in, This represents the fused feature map. This represents the high-level feature map. This represents the standardized feature map of the channel; The fused feature map is smoothed and enhanced by the convolutional smoothing unit of the feature pyramid module to generate the multi-scale target feature map.

7. The method according to claim 1, characterized in that, The process involves using the task decoupling module and task alignment module of the pipeline defect magnetic flux leakage detection model to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map, thereby obtaining the pipeline defect magnetic flux leakage detection results output by the pipeline defect magnetic flux leakage detection model, including: The multi-scale target feature map is input into the semantic enhancer of the task decoupling module. The spatial information of the multi-scale target feature map is compressed into a 1×1 fifth feature map through an adaptive average pooling operation. The fifth feature map is then flattened into a classification feature vector using a view operation. The classification feature vector is sequentially processed through two linear layers and a ReLU activation function to generate preliminary classification prediction results; The multi-scale target feature map is input into the spatial perceptron of the task decoupling module. The spatial perceptron is used to perform adaptive average pooling and adaptive max pooling operations respectively to obtain average pooling results and max pooling results. The average pooling results and max pooling results are then concatenated in the channel dimension to obtain a pooling concatenation result. The pooling and stitching results are sequentially processed through two convolutional layers and a view operation to generate preliminary localization prediction results; The pipeline defect magnetic flux leakage detection model uses a task alignment module to perform cross-task feature alignment on the preliminary classification prediction results and the preliminary location prediction results to obtain the pipeline defect magnetic flux leakage detection results.

8. The method according to claim 7, characterized in that, The task alignment module of the pipeline defect magnetic flux leakage detection model performs a cross-task feature alignment operation on the preliminary classification prediction results and the preliminary location prediction results to obtain the pipeline defect magnetic flux leakage detection results, including: Using the classification-guided localization adjustment branch of the task alignment module, the multi-scale target feature map is calculated to obtain the localization prediction adjustment feature map. in, This represents the feature map of the positioning prediction adjustment amount. This indicates that the number of output channels is 4. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. Convolution operation, This represents the multi-scale target feature map; Using the localization-guided classification adjustment branch of the task alignment module, the multi-scale target feature map is calculated to obtain the classification feature adjustment value feature map. in, This represents the feature map representing the adjustment amount of the classification features. This indicates that the number of output channels is 256. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. Convolution operation, This represents the multi-scale target feature map; Based on the task alignment module, the feature map of the positioning prediction adjustment is transformed by view and the average spatial dimension is calculated. The average spatial dimension is then added element-wise to the preliminary positioning prediction result to obtain the positioning prediction correction result. The formula for calculating the average spatial dimension is as follows: in, This represents the average value of the spatial dimension. This represents the height value of the feature map indicating the positioning prediction adjustment amount. This represents the width value of the feature map for the positioning prediction adjustment amount. The feature map representing the positioning prediction adjustment amount is located at a height of Width is All channel feature values ​​at; The classification feature adjustment feature map is upsampled by 2 times based on the task alignment module, and then added element-by-element to the multi-scale target feature map to obtain the classification feature enhancement result. The task alignment module of the pipeline defect magnetic flux leakage detection model predicts the preliminary classification prediction result, the preliminary location prediction result, the location prediction correction result, and the classification feature enhancement result to obtain the defect category prediction result and the defect bounding box prediction result. The defect category prediction result and the defect bounding box prediction result are used as the pipeline defect magnetic flux leakage detection result.

9. The method according to claim 8, characterized in that, The task alignment module of the pipeline defect magnetic flux leakage detection model predicts the preliminary classification prediction result, the preliminary location prediction result, the location prediction correction result, and the classification feature enhancement result to obtain defect category prediction results and defect bounding box prediction results, including: The task alignment module performs adaptive average pooling on the enhanced classification features, and flattens them into a target classification feature vector using a view operation. This target classification feature vector is then concatenated with the preliminary classification prediction result along the channel dimension to obtain the target classification concatenated feature. This target classification concatenated feature is then input into a linear classifier layer to obtain the defect category prediction result. in, This indicates the result of the defect category prediction. This indicates that the number of output channels is 4. Convolution operation, Represents the ReLU activation function. This indicates a batch normalization operation. This indicates that the number of output channels is 128. Convolution operation, This represents the target classification splicing features; The task alignment module performs adaptive average pooling on the preliminary localization prediction result and flattens it into a target localization feature vector using a view operation. This target localization feature vector is then concatenated with the corrected localization prediction result along the channel dimension to obtain the concatenated target localization feature. This concatenated target localization feature is then input into a linear regressor layer to obtain the defect bounding box prediction result. in, This indicates the predicted result of the defect bounding box. This represents a linear transformation operation. This represents the target location splicing feature.

10. A multi-scale data-driven deep learning-based magnetic flux leakage detection device for pipeline defects, characterized in that, include: The data acquisition and processing module is used to acquire pipeline magnetic flux leakage signal data, perform spatial domain transformation and multi-scale characterization processing on the pipeline magnetic flux leakage signal data, generate a multi-scale magnetic flux leakage signal dataset with global defect distribution and local details, and use the multi-scale magnetic flux leakage signal dataset as input data for the pipeline defect magnetic flux leakage detection model. The hierarchical feature learning module is used to extract and enhance features from the multi-scale magnetic flux leakage signal dataset by utilizing the convolutional neural network in the hierarchical feature extraction module of the pipeline defect magnetic flux leakage detection model, and obtain a multi-level primary feature map set. An adaptive multi-context feature synthesis module is used to utilize the multi-scale convolutional branch and attention mechanism in the multi-scale fusion module of the pipeline defect magnetic flux leakage detection model to perform dynamic receptive field feature enhancement and weighted fusion processing on the multi-level primary feature map set, so as to obtain a deep feature map fused with multi-scale context. The multi-resolution semantic enhancement module is used to perform lateral connection and upsampling fusion operations on the deep feature map based on the feature pyramid module of the pipeline defect magnetic flux leakage detection model to obtain a multi-scale target feature map. The collaborative task optimization and output module is used to perform multi-task branch prediction and cross-task feature alignment operations on the multi-scale target feature map through the task decoupling module and task alignment module of the pipeline defect magnetic flux leakage detection model, so as to obtain the pipeline defect magnetic flux leakage detection result output by the pipeline defect magnetic flux leakage detection model.

Citation Information

Patent Citations

  • Oil and gas pipeline defect detection method based on deep denoising and multi-scale learning

    CN116385392A

  • Pipeline magnetic flux leakage defect detection method based on improved YOLOv5

    CN117274192A

  • Oil and gas pipeline magnetic flux leakage defect identification method based on multi-mode and multi-layer attention network

    CN118797556A

  • Pipeline magnetic flux leakage image segmentation method based on multi-scale SegFormer network

    CN119251500A

  • Industrial product surface defect detection system based on segmentation all-in-one model

    CN120707491A

Cited By

  • Characteristic decoupling and task alignment industrial weld defect detection method and system

    CN121258972A

  • Pipeline magnetic flux leakage defect detection method and system

    CN122109290A

  • Pipeline magnetic flux leakage defect detection method and system

    CN122109290B