Pipeline magnetic flux leakage signal detection method and system, and electronic equipment
By using pre-trained models and image processing technology in the detection of pipeline magnetic leakage signal, the detection problem of traditional methods under complex defects and multiple defects coupled magnetic fields is solved, and high-precision and real-time pipeline defect detection is achieved.
Patent Information
- Application Number
- CN202510757585.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-09
AI Technical Summary
When traditional pipeline leakage signal analysis methods face complex defects and multiple defects coupled magnetic fields, the generalization performance is insufficient and the misjudgment rate is high, making it difficult to meet the needs of real-time detection of long-distance pipelines.
By obtaining the signal detection value of the pipeline magnetic leakage signal in multiple preset directions, using the pretrained defect detection model, combining the excess ratio and pixel value conversion to form the image to be detected, determining the position and category of the pipe defect part, and using the pipeline segmentation parameters to locate the target position.
It improves the detection accuracy and generalization ability of various types of defects, reduces the probability of misjudgment and missed detection, and meets the timeliness of real-time detection of long-distance pipelines.
Smart Images

Figure CN120275490A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of signal processing, and in particular, to a method, a system, and an electronic device for detecting magnetic flux leakage signals in pipelines. Background Art
[0002] As the core infrastructure for oil and gas transportation, the structural integrity of pipelines is directly related to energy security and environmental risks. Magnetic Flux Leakage (MFL) testing technology realizes non-destructive detection of pipeline damage by capturing magnetic field distortion at defects, and has become the mainstream method in the industrial field due to its high efficiency and applicability. However, with the increasing complexity of pipeline networks and the upgrading of detection accuracy requirements, traditional signal analysis methods face significant bottlenecks, and there is an urgent need for technological innovation to achieve higher-precision and more efficient defect diagnosis.
[0003] Traditional MFL signal analysis methods mainly rely on manually designed feature extraction and pattern recognition processes. For example, wavelet transform or empirical mode decomposition is used for noise reduction, features such as time-domain amplitude and frequency-domain energy are extracted, and classifiers such as support vector machines or random forests are combined for defect determination. Although such methods have achieved certain results in early applications, their limitations have gradually emerged: First, manual feature engineering relies on expert experience and has insufficient representation ability for complex defects (such as micro-cracks and irregular shapes), resulting in limited generalization performance; in addition, in the face of the superposition effect of multi-defect coupled magnetic fields, traditional methods are difficult to adaptively analyze, and the misjudgment rate increases significantly. At the same time, the segmented data processing flow is inefficient and difficult to meet the requirements of real-time detection of long-distance pipelines. Summary of the Invention
[0004] Based on this, it is necessary to provide a high-precision method, a system, an electronic device, a computer-readable storage medium, and a computer program product for detecting magnetic flux leakage signals in pipelines that can adapt to various types of defects to meet the requirements of real-time detection of long-distance pipelines.
[0005] In a first aspect, the present application provides a method for detecting magnetic flux leakage signals in pipelines, including:
[0006] Obtaining signal detection values of magnetic flux leakage signals in pipelines in multiple preset directions in multiple preset channels;
[0007] Using the signal detection values in each preset direction in each preset channel and the signal reference values corresponding to the signal detection values to determine the exceeding ratio corresponding to each preset channel;
[0008] Converting the signal detection values into corresponding pixel values according to the exceeding ratio to obtain a to-be-detected image corresponding to each preset direction;
[0009] Input the image to be detected into a pre-trained defect detection model, and determine the local position information of the pipeline defect part in the image to be detected and the defect category information to which the pipeline defect part belongs through the defect detection model;
[0010] Use the defect detection model to determine the target pipeline position corresponding to the local position information according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and output the target pipeline position and the defect category information.
[0011] In one embodiment, the converting the signal detection value into a corresponding pixel value according to the exceeding ratio to obtain the image to be detected corresponding to each preset direction includes:
[0012] Determine the target pixel value corresponding to the signal detection value according to the reference pixel value corresponding to the signal reference value and the product of the reference pixel value and the exceeding ratio;
[0013] Use the target pixel values corresponding to the signal detection values in each preset direction to determine the grayscale image corresponding to each preset direction;
[0014] Determine the image to be detected according to the grayscale image corresponding to each preset direction.
[0015] In one embodiment, the determining the image to be detected according to the grayscale image corresponding to each preset direction includes:
[0016] Use the grayscale image corresponding to each preset direction as the image to be detected corresponding to each preset direction, or,
[0017] Perform splicing processing on the grayscale images corresponding to each preset direction to obtain a corresponding color image, and use the color image as the image to be detected corresponding to each preset direction.
[0018] In one embodiment, the determining the exceeding ratio corresponding to each preset channel by using the signal detection values in each preset direction in each preset channel and the signal reference value corresponding to the signal detection value includes:
[0019] Perform reference correction on the signal detection values in each preset direction in each preset channel to obtain the signal reference value corresponding to each preset channel;
[0020] Use the difference between the signal detection value and the signal reference value and the signal reference value to determine the exceeding ratio corresponding to each preset channel.
[0021] In one embodiment, obtaining the signal detection values of the magnetic flux leakage signals in a plurality of preset channels in a plurality of preset directions includes:
[0022] Preprocessing the magnetic flux leakage signal of the pipeline by using a preset filter, and taking the magnetic flux leakage signal intensity values of the preprocessed magnetic flux leakage signal of the pipeline in a plurality of preset directions as the signal detection values.
[0023] In one embodiment, the pre-training method of the defect detection model includes:
[0024] Obtaining a magnetic flux leakage signal dataset of the pipeline;
[0025] Preprocessing the magnetic flux leakage signal dataset of the pipeline, and constructing a sample image dataset by using the preprocessed magnetic flux leakage signal dataset and the corresponding defect label file;
[0026] Dividing the sample image dataset into a training image set, a validation image set and a test image set according to a preset data ratio;
[0027] Training a detection framework by using the training image set to obtain a trained detection framework;
[0028] Validating the trained detection framework by using the validation image set and the test image set to obtain a validation result corresponding to the trained detection framework;
[0029] When the validation result meets a preset validation condition, constructing a pre-trained defect detection model by using the trained detection framework.
[0030] In a second aspect, the present application further provides a magnetic flux leakage signal detection system for a pipeline, including:
[0031] A preprocessing module, configured to obtain signal detection values of magnetic flux leakage signals in a plurality of preset channels in a plurality of preset directions;
[0032] An image conversion module, configured to determine an exceedance ratio corresponding to each preset channel by using the signal detection value in each preset direction in each preset channel and the signal reference value corresponding to the signal detection value; converting the signal detection value into a corresponding pixel value according to the exceedance ratio to obtain a to-be-detected image corresponding to each preset direction;
[0033] A detection module, configured to input the to-be-detected image into a pre-trained defect detection model, and determine local position information of a pipeline defect part in the to-be-detected image and defect category information to which the pipeline defect part belongs through the defect detection model;
[0034] A target positioning module, configured to use the defect detection model to determine a target pipeline position corresponding to the local position information according to a preset pipeline length, a preset number of channels in a target direction, and preset pipeline segmentation parameters, and output the target pipeline position and the defect category information.
[0035] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the pipeline magnetic flux leakage signal detection method according to any one of the embodiments in the first aspect above.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, it implements the pipeline magnetic flux leakage signal detection method according to any one of the embodiments in the first aspect above.
[0037] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the pipeline magnetic flux leakage signal detection method according to any one of the embodiments in the first aspect above.
[0038] For the above-mentioned pipeline magnetic flux leakage signal detection method, system, electronic device, computer-readable storage medium, and computer program product, by obtaining the signal detection values of the pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions, calculating the exceeding ratio corresponding to each preset channel by using the signal detection value and the signal reference value of each preset channel in each preset direction, converting the signal detection value into a corresponding pixel value according to the exceeding ratio of each preset channel to form a to-be-detected image corresponding to each preset direction, using a pre-trained defect detection model to predict the local position information of the pipeline defect part in the to-be-detected image, and according to the preset pipeline length of the entire pipeline, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, converting the local position information in the image into the target pipeline position in the entire pipeline, and finally outputting the target pipeline position and the defect category information, it can not only improve the generalization ability of detecting various types of pipeline defects by using the pre-trained defect detection model, reduce the probability of misjudgment and missed detection of pipeline defects, and improve the detection accuracy, but also quickly detect the local position information of the pipeline defect part in the to-be-detected image by using the to-be-detected image, and then use the local position information to locate the target pipeline position of the pipeline defect part in the entire pipeline, so as to meet the timeliness requirements of real-time detection of long-distance pipelines. Description of the Drawings
[0039] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0040] Figure 1 It is an application environment diagram of the magnetic flux leakage signal detection method for pipelines in an embodiment;
[0041] Figure 2 It is a schematic flowchart of the magnetic flux leakage signal detection method for pipelines in an embodiment;
[0042] Figure 3 It is a schematic flowchart of the step for determining the image to be detected in an embodiment;
[0043] Figure 4 It is a schematic flowchart of the pre-training step of the defect detection model in an embodiment;
[0044] Figure 5 It is a schematic flowchart of the magnetic flux leakage signal detection method for pipelines in another embodiment;
[0045] Figure 6 It is a schematic diagram of the image to be detected in an embodiment;
[0046] Figure 7 It is a structural block diagram of the defect detection model in an embodiment;
[0047] Figure 8 It is a structural block diagram of the pipeline magnetic flux leakage signal detection system 800 in an embodiment;
[0048] Figure 9 It is an internal structure diagram of an electronic device in an embodiment. Specific Embodiments
[0049] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0050] It should be noted that the illustrations provided in the following embodiments only schematically illustrate the basic concept of the present application. Therefore, only the components related to the present application are shown in the drawings, rather than being drawn according to the number, shape, and size of the components in actual implementation. The form, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the layout form of its components may also be more complex.
[0051] In addition, in the present application, descriptions such as "first" and "second" are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0052] In order to make the purpose, technical solution, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] It should be noted that the user information (including but not limited to user device 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 fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0054] The magnetic flux leakage signal detection method for pipelines provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the electronic device 102 can communicate with multiple Hall sensors 104 deployed inside the pipeline 10 through a wired input / output interface or wireless Bluetooth, local area network Wi-Fi, long-range wireless communication LoRa, etc. Each Hall sensor 104 corresponds to each preset channel, and the number of Hall sensors 104 is usually fixed, such as 64, 128, or 256. Optionally, in some embodiments, the Hall sensors 104 can be deployed inside the pipeline magnetic flux leakage detector. The pipeline magnetic flux leakage detector can move along the extension direction of the pipeline 10 and release equal amounts of electromagnetic signals in all directions during the movement. Each Hall sensor 104 can receive electromagnetic signals in multiple preset directions (such as the axial direction, radial direction, and circumferential direction) reflected from the pipe wall of the pipeline 10. When there are defects on the pipe wall, the detected values of the signals received by the Hall sensor 104 will fluctuate to a certain extent.
[0055] Exemplarily, the electronic device 102 may obtain signal detection values of the magnetic flux leakage signals in a plurality of preset directions in a plurality of preset channels from a plurality of Hall sensors 104. A magnetic flux leakage signal detection program may be run in the electronic device 102. During the execution of the magnetic flux leakage signal detection program by the electronic device 102, the exceeding ratio corresponding to each preset channel may be determined by using the signal detection values in each preset direction in each preset channel and the signal reference values corresponding to the signal detection values. The signal detection values are converted into corresponding pixel values according to the exceeding ratio to obtain a to-be-detected image corresponding to each preset direction. The to-be-detected image is input into a pre-trained defect detection model, and the local position information of the pipeline defect part in the to-be-detected image and the defect category information to which the pipeline defect part belongs are determined through the defect detection model. The defect detection model determines the target pipeline position corresponding to the local position information according to the preset pipeline length, the number of preset channels in the target direction, and the preset pipeline segmentation parameters, and outputs the target pipeline position and the defect category information.
[0056] Among them, the electronic device 102 may be, but is not limited to, various terminal devices such as personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices (such as intelligent in-vehicle devices, projection devices, etc.) and portable wearable devices (such as smart watches, smart bracelets, virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.), server devices such as independent physical servers, server clusters or distributed systems composed of multiple physical servers, cloud servers providing cloud computing services, or clusters composed of terminal devices and server devices.
[0057] In an exemplary embodiment, as Figure 2 shown, a magnetic flux leakage signal detection method for pipelines is provided. Taking the method applied to the Figure 1 electronic device 102 as an example, the method includes the following steps S202 to step S210. Among them:
[0058] Step S202, obtaining signal detection values of the magnetic flux leakage signals in a plurality of preset directions in a plurality of preset channels.
[0059] Among them, the preset channels may be used to refer to the Hall sensors that receive the magnetic flux leakage signals of the pipeline.
[0060] The magnetic flux leakage signal of the pipeline may be used to represent the electromagnetic signal reflected from the pipe wall of the pipeline to the Hall sensor.
[0061] The preset directions may include but are not limited to the axial direction, the radial direction, the circumferential direction, etc.
[0062] The signal detection value can be used to represent the magnetic flux leakage signal intensity value.
[0063] Exemplarily, the electronic device can read the magnetic flux leakage signals of the pipeline in the corresponding preset channels received by multiple Hall sensors in real time or periodically. Among them, the pipeline magnetic flux leakage signals usually appear in the form of vector data. Based on the direction information of the vector data, the signal detection values in each preset direction can be read from the pipeline magnetic flux leakage signals.
[0064] Step S204: Use the signal detection value in each preset direction in each preset channel and the signal reference value corresponding to the signal detection value to determine the exceeding ratio corresponding to each preset channel.
[0065] Among them, the signal reference value can be the mean, median, mode, etc. of the signal detection value, or it can also be a value custom-selected by the tester.
[0066] The exceeding ratio can be used to represent the difference degree between the signal detection value and the signal reference value.
[0067] Exemplarily, the electronic device can receive the value input by the tester as the signal reference value corresponding to the signal detection value, or it can also obtain the corresponding signal reference value by performing arithmetic processing on the signal detection values in each preset direction on each preset channel. According to the preset exceeding ratio calculation logic, perform arithmetic processing on the signal detection value and the signal reference value to obtain the exceeding ratio corresponding to each preset channel.
[0068] Step S206: Convert the signal detection value into the corresponding pixel value according to the exceeding ratio to obtain the image to be detected corresponding to each preset direction.
[0069] Among them, the value range of the pixel value is from 0 to 255.
[0070] Optionally, in some embodiments, the electronic device can store the exceeding ratio threshold and the pixel mapping relationship corresponding to the exceeding ratio threshold. According to the comparison result between the exceeding ratio of each preset channel and the exceeding ratio threshold, read the pixel value corresponding to the signal detection value from the pixel mapping relationship corresponding to the exceeding ratio threshold. Or, in some other embodiments, the electronic device can also store the pixel value conversion logic. Perform arithmetic processing on the exceeding ratio calculated by the signal detection value according to the pixel value conversion logic, and use the processed value as the pixel value corresponding to the signal detection value. Input the pixel values corresponding to the signal detection values in the same preset direction into the image processing library (such as the image standard library opencv, Pillow, matplotlib, etc.) to obtain the image to be detected corresponding to each preset direction.
[0071] Step S208: Input the image to be detected into the pre-trained defect detection model, and determine the local position information of the pipeline defect part in the image to be detected and the defect category information to which the pipeline defect part belongs through the defect detection model.
[0072] Among them, the defect detection model can be used to represent a neural network model trained using a pipeline magnetic flux leakage signal dataset. Optionally, in some embodiments, the defect detection module can be a detection model established based on an object detection algorithm (such as the YOLOv7 detection box).
[0073] Exemplarily, the electronic device can be deployed with a pre-trained defect detection model. Input the image to be detected into the pre-trained defect detection model, extract the features of the image to be detected through the defect detection model, perform multi-scale feature fusion on the extracted features, predict the detection box position of the pipeline defect part in the image to be detected as the local position information, and identify the defect category information to which the pipeline defect part belongs.
[0074] Step S210: Use the defect detection model to determine the target pipeline position corresponding to the local position information according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and output the target pipeline position and the defect category information.
[0075] Among them, the pipeline segmentation parameters can be used to divide the long-distance pipeline magnetic flux leakage detection task into multiple short-distance pipeline magnetic flux leakage detection subtasks.
[0076] The target pipeline position can be used to represent the relative position of the pipeline defect part in the entire pipeline.
[0077] Exemplarily, the electronic device can store the preset pipeline length corresponding to the pipeline, the preset number of channels in the target direction (such as the circumferential direction), and the preset pipeline segmentation parameters. The electronic device can store a preset defect positioning logic. According to the defect positioning logic, perform arithmetic processing on the local position information of the pipeline defect part in the image to be detected using the preset pipeline length, the preset number of channels in the target direction, and the pipeline segmentation parameters to obtain the target pipeline position of the pipeline defect part in the entire pipeline. Output the target pipeline position corresponding to the pipeline defect part and its defect category information as the pipeline magnetic flux leakage signal detection result through the defect detection model.
[0078] In the above magnetic flux leakage signal detection method for pipelines, by obtaining the signal detection values of the magnetic flux leakage signals in multiple preset channels in multiple preset directions, calculating the exceedance ratio corresponding to each preset channel by using the signal detection value of each preset direction and each preset channel and the signal reference value, converting the signal detection value into the corresponding pixel value according to the exceedance ratio of each preset channel, forming a to-be-detected image corresponding to each preset direction, using a pre-trained defect detection model to predict the local position information of the pipeline defect part in the to-be-detected image, and according to the preset pipeline length of the entire pipeline, the number of preset channels in the target direction, and the preset pipeline segmentation parameters, converting the local position information in the image into the target pipeline position in the entire pipeline, and finally outputting the target pipeline position and the defect category information, not only can improve the generalization ability of detecting various types of pipeline defects by using the pre-trained defect detection model, reduce the probability of misjudgment and missed detection of pipeline defects, improve the detection accuracy, at the same time, can also quickly detect the local position information of the pipeline defect part in the to-be-detected image by using the defect detection model, locate the target pipeline position of the local position information in the entire pipeline, more effectively locate the position information of the weld and the defect, so as to more accurately capture the target of the region of interest, reduce the computational overhead of the model, ensure the real-time detection effect, thus meeting the timeliness requirements of long-distance pipeline real-time detection and further improving the detection accuracy.
[0079] In an exemplary embodiment, as Figure 3 shown, step S206 includes steps S302 to S306. Among them:
[0080] Step S302, determine the target pixel value corresponding to the signal detection value according to the reference pixel value corresponding to the signal reference value and the product of the reference pixel value and the exceedance ratio.
[0081] Exemplarily, the electronic device may store the reference pixel value corresponding to the signal reference value. Multiply the reference pixel value by the exceedance ratio corresponding to each preset channel respectively to obtain the product of the reference pixel value and the exceedance ratio corresponding to each preset channel. Perform arithmetic processing on the reference pixel value and the product of the reference pixel value and the exceedance ratio corresponding to each preset channel to obtain the target pixel value corresponding to the signal detection value.
[0082] Optionally, in some embodiments, when the reference pixel value is 128, the electronic device may determine the target pixel value with reference to the following formula:
[0083] ,
[0084] Among them, is the target pixel value. is the exceedance ratio calculated by using the signal detection value, and is set to 1 when the absolute value of the exceedance ratio exceeds 1. is the signal reference value.
[0085] Step S304: Determine the grayscale image corresponding to each preset direction by using the target pixel values corresponding to the signal detection values in each preset direction.
[0086] Step S306: Determine the image to be detected according to the grayscale image corresponding to each preset direction.
[0087] Exemplarily, the electronic device can input the target pixel values corresponding to the signal detection values in each preset direction into the image processing library respectively to generate the grayscale image corresponding to each preset direction. Optionally, in some embodiments, the electronic device can randomly select the grayscale image corresponding to a preset direction as the image to be detected and input it into the defect detection model for detection. Or, in some other embodiments, the electronic device can also select a high-quality grayscale image as the image to be detected according to quality parameters such as the clarity, contrast, noise level, and uniformity of the grayscale image and input it into the defect detection model for detection. Or, in some other embodiments, the electronic device can also perform a fusion and superposition process on the grayscale images corresponding to multiple preset directions and use the processed image result as the image to be detected.
[0088] In this embodiment, by setting the reference pixel value corresponding to the signal reference value, performing arithmetic processing on the exceeding ratio corresponding to each preset channel and the reference pixel value to obtain the target pixel value corresponding to the signal detection value, and using the target pixel value to draw the grayscale image to obtain the image to be detected corresponding to the magnetic flux leakage signal of the pipeline, the characteristics of the magnetic flux leakage signal of the pipeline can be better retained in the image, thus helping to improve the detection accuracy.
[0089] In an exemplary embodiment, the above step S306 may further include: using the grayscale image corresponding to each preset direction as the image to be detected corresponding to each preset direction, or splicing the grayscale images corresponding to each preset direction to obtain the corresponding color image and using the color image as the image to be detected corresponding to each preset direction.
[0090] Optionally, in some embodiments, the electronic device can directly use the grayscale image corresponding to each preset direction as the image to be detected corresponding to each preset direction. Correspondingly, the defect detection model applicable to the grayscale image can be trained by using the grayscale image set corresponding to the magnetic flux leakage signal dataset of the pipeline.
[0091] Optionally, in some embodiments, the grayscale image corresponding to each preset direction generated by the electronic device can generally be represented in the form of [H, W, 1]. Where H is the image height of the grayscale image and W is the image width of the grayscale image. The electronic device stitches the grayscale images corresponding to each preset direction to obtain a color image mathematically represented as [H, W, 3]. The electronic device can use the stitched color image as the image to be detected corresponding to each preset direction.
[0092] Optionally, in some embodiments, the inspector can select the grayscale images in each preset direction as the images to be detected based on the actual pipeline situation, or select the color image obtained by stitching the grayscale images in each preset direction as the image to be detected, or use both the grayscale image and the color image as the images to be detected.
[0093] In this embodiment, by using the grayscale images in each preset direction or the color image obtained by stitching the grayscale images as the images to be detected, the personalized magnetic flux leakage signal detection requirements of the pipeline can be met, which helps to improve the detection flexibility.
[0094] In an exemplary embodiment, step S204 may include: performing a reference correction on the signal detection values in each preset direction in each preset channel to obtain the signal reference value corresponding to each preset channel; using the difference between the signal detection value and the signal reference value and the signal reference value to determine the exceeding ratio corresponding to each preset channel.
[0095] Exemplarily, the electronic device can calculate the mean value of the signal detection values corresponding to each preset direction in each preset channel as the signal reference value of each preset channel in each preset direction. Calculate the difference between the signal detection value and the signal reference value. Determine the ratio of the difference between the signal detection value and the signal reference value to the signal reference value as the exceeding ratio of each preset channel in each preset direction.
[0096] Optionally, in some embodiments, the electronic device can determine the exceeding ratio with reference to the following formula:
[0097] ,
[0098] Where is the exceeding ratio. is the signal detection value. is the signal reference value, and the mean value of the signal detection values can be selected.
[0099] In this embodiment, by performing a reference correction on the magnetic flux leakage signal of the pipeline and using the difference between the signal detection value and the signal reference value and the signal reference value to determine the exceeding ratio corresponding to each preset channel, errors can be eliminated and the calculation accuracy of the exceeding ratio can be improved.
[0100] In an exemplary embodiment, step S202 may include: preprocessing the magnetic flux leakage signal of the pipeline by using a preset filter, and taking the magnetic flux leakage signal intensity values in a plurality of preset directions of the preprocessed magnetic flux leakage signal of the pipeline as signal detection values.
[0101] Exemplarily, the electronic device may input the magnetic flux leakage signal of the pipeline into a preset filter for preprocessing operations such as denoising and signal enhancement. Read the magnetic flux leakage signal intensity values in a plurality of preset directions of the preprocessed magnetic flux leakage signal of the pipeline as signal detection values. Among them, the preset filter may include, but is not limited to, any one or a combination of multiple filters such as Gaussian filter, median filter, bilateral filter, histogram equalization, and wavelet filter.
[0102] In this embodiment, by preprocessing the magnetic flux leakage signal of the pipeline by using a preset filter, not only can the quality of the magnetic flux leakage signal of the pipeline be improved, but also by using different preset filters for preprocessing, different defect features can be extracted from the magnetic flux leakage signal of the pipeline, which is applicable to various types of defects, optimizes the input of the subsequent defect detection model, and thus greatly improves the detection efficiency.
[0103] In an exemplary embodiment, as Figure 4 shown, a pre-training method for a defect detection model is also provided, including the following steps S402 to step S412. Among them:
[0104] Step S402, obtain a magnetic flux leakage signal dataset of the pipeline.
[0105] Step S404, preprocess the magnetic flux leakage signal dataset of the pipeline, and construct a sample image dataset by using the preprocessed magnetic flux leakage signal dataset and the corresponding defect label file.
[0106] Exemplarily, the electronic device may refer to the preprocessing method provided in the above embodiment, and use a preset filter to preprocess the magnetic flux leakage signal dataset of the pipeline, such as denoising and signal enhancement, to obtain a preprocessed magnetic flux leakage signal dataset of the pipeline. Perform baseline correction on the signal detection values of each preset channel in each preset direction in the preprocessed magnetic flux leakage signal dataset, calculate the corresponding excess ratio, and convert the signal detection values into corresponding target pixel values by using the excess ratio to form sample image data corresponding to the preprocessed magnetic flux leakage signal dataset. Use the local position information of the pipeline defect part corresponding to the sample image dataset and the defect category information to which the pipeline defect part belongs to construct a defect label file. Use the sample image data and the corresponding defect label file to construct a sample image dataset for model training.
[0107] Optionally, in some embodiments, the image format of the sample image dataset may be an image compression format (Joint Photographic Experts Group, abbreviated as JPEG format). And each frame of sample image data is stored in a corresponding folder according to the corresponding defect label. The format of the defect label file may be a plain text file format (Text, abbreviated as txt format).
[0108] Step S406, divide the sample image dataset into a training image set, a validation image set, and a test image set according to a preset data ratio.
[0109] Optionally, in some embodiments, the preset data ratio may be training image set: test image set: validation image set = 8:1:1.
[0110] Step S408, use the training image set to train the detection framework to obtain a trained detection framework.
[0111] Step S410, use the validation image set and the test image set to verify the trained detection framework to obtain a verification result corresponding to the trained detection framework.
[0112] Exemplarily, an electronic device may use an object detection framework (such as the YOLOv7 framework) as the detection framework. Use the training image set to iteratively train the detection framework to obtain a trained detection framework. Input the validation image set and the test image set into the trained detection framework to obtain a defect detection result output by the trained detection framework. Verify the defect detection result predicted by the trained detection framework according to the corresponding defect label file of the validation image set and the test image set to obtain a corresponding verification result.
[0113] Step S412, in the case that the verification result meets the preset verification condition, use the trained detection framework to construct a pre-trained defect detection model.
[0114] Exemplarily, an electronic device may store a preset verification condition, for example, the loss value of the defect detection result is lower than a preset loss threshold, or the precision of the defect detection result (Precision) reaches a preset accuracy threshold, or the recall rate (Recall) of the trained detection framework reaches a preset recall threshold, or the frames per second (Frames Per Second, abbreviated as FPS) of the trained detection framework reaches a preset rate threshold, etc. In the case that the verification result of the trained defect detection model meets the preset verification condition, use the trained detection framework and the positioning module to be spliced to form a pre-trained defect detection model. The positioning module can, in the application stage, convert the local position information output by the prediction head of the detection framework into the target pipeline position in the entire pipeline.
[0115] In this embodiment, by training a detection framework using a pipeline magnetic flux leakage signal dataset, and constructing a pre-trained defect detection model using the trained detection framework when the trained detection framework meets the preset verification conditions, the detection accuracy of the defect detection model can be improved.
[0116] In an exemplary embodiment, as Figure 5 shown, a pipeline magnetic flux leakage signal detection method is also provided, including the following steps S502 to step S512. Among them:
[0117] Step S502, obtain the pipeline magnetic flux leakage signals in multiple preset channels, preprocess the pipeline magnetic flux leakage signals using a preset filter, and use the magnetic flux leakage signal intensity values in multiple preset directions of the preprocessed pipeline magnetic flux leakage signals as signal detection values.
[0118] Exemplarily, an electronic device can obtain the pipeline magnetic flux leakage signals in multiple preset channels received by multiple Hall sensors, and read the magnetic flux leakage signal intensity values in the axial direction, radial direction, and circumferential direction of the pipeline. Select a corresponding preset filter according to the actual detection results to perform preprocessing such as denoising and signal enhancement on the magnetic flux leakage signal intensity values read from the pipeline magnetic flux leakage signals, and use the preprocessed magnetic flux leakage signal intensity values as the signal detection values in the axial direction, radial direction, and circumferential direction.
[0119] Step S504, perform baseline correction on the signal detection values in each preset direction of each preset channel, and use the corrected signal baseline value and the difference between the signal detection value and the signal baseline value to determine the exceedance ratio corresponding to each preset channel.
[0120] Exemplarily, an electronic device can perform baseline correction on the signal detection values in the axial direction, radial direction, and circumferential direction received in the preset channels of each Hall sensor, and calculate the mean value of the signal detection values as the signal baseline value. Determine the exceedance ratio corresponding to each preset channel with reference to the above calculation formula of the exceedance ratio.
[0121] Step S506, determine the target pixel value corresponding to the signal detection value according to the reference pixel value corresponding to the signal baseline value and the product of the reference pixel value and the exceedance ratio.
[0122] Step S508, use the target pixel values corresponding to the signal detection values in each preset direction to determine the grayscale image corresponding to each preset direction, and determine the image to be detected according to the grayscale image corresponding to each preset direction.
[0123] Exemplarily, the electronic device may perform an operation process on the reference pixel value and the product of the reference pixel value and the exceeding ratio with reference to the calculation formula of the target pixel value provided in the above embodiments to obtain the target pixel value corresponding to the signal detection value. The target pixel values corresponding to the signal detection values in each preset direction are used to draw and generate a grayscale image corresponding to each preset direction. Optionally, in some embodiments, such as Figure 6 shown, the electronic device may use the grayscale image or the color image obtained by stitching grayscale images as the image to be detected for subsequent pipeline defect detection.
[0124] Step S510: Input the image to be detected into a pre-trained defect detection model, and determine the local position information of the pipeline defect part in the image to be detected and the defect category information to which the pipeline defect part belongs through the defect detection model.
[0125] Optionally, in some embodiments, the electronic device may construct a defect detection model as shown in 7. Among them, Figure 7 the backbone network 720 (Backbone) of the defect detection model in includes multiple backbone convolutional layers 722 (Convolution, abbreviated as Conv), multiple backbone layer aggregation network structures 724 (Efficient Layer Aggregation Networks, abbreviated as ELAN), and a spatial pyramid pooling-convolutional layer 726 (Spatial Pyramid Pooling - Convolutional, abbreviated as SPPC). Figure 7 the neck network 740 (Neck) of the defect detection model in includes a neck layer aggregation network structure 746 (EfficientLayer Aggregation Networks, abbreviated as ELAN), a concatenation layer 744 (Concatenate, abbreviated as Concat), a multi-scale pooling module 742 (Multi-scale Pooling, abbreviated as MP), and a neck convolutional layer 748 (Convolution, abbreviated as Conv). Figure 7 the head network 760 (Head) of the defect detection model in includes multiple detection heads 762 (Detect), and the output of each detection head 762 is connected to the positioning module 780.
[0126] In this embodiment, the Figure 7The shown deep learning-based defect detection model combines the end-to-end feature learning ability of the convolutional neural network (CNN). The model can directly mine deep spatio-temporal features from the original signal, avoid artificial design biases, and significantly improve the recognition rate of tiny defects. It utilizes the recurrent neural network (RNN) and the deep learning model architecture based on the self-attention mechanism (Transformer model) to effectively resolve the problem of multi-defect coupling interference by modeling the signal temporal dependence, while the generative adversarial network (GAN) generates diverse defect samples to alleviate the challenge of data scarcity. The introduction of the attention mechanism further enhances the robustness of the defect detection model in a strong noise environment. The lightweight network (such as MobileNet) combined with model compression technology can achieve real-time analysis on embedded devices to meet the requirements of on-site detection. Experiments show that the deep learning method performs outstandingly in terms of defect classification accuracy (10% - 20% higher than traditional methods) and detection efficiency (3 - 5 times faster).
[0127] Optionally, in some embodiments, the magnetic flux leakage signal dataset of the pipeline can adopt the traction experiment dataset. The pipeline for traction delay is 43 meters in total, including 108 defects of different sizes and 26 welds. By preprocessing and image conversion of the traction experiment dataset, 860 magnetic flux leakage signal detection images of the pipeline to be detected can be obtained. The 860 magnetic flux leakage signal detection images of the pipeline to be detected are divided into a training image set, a test image set, and a validation image set according to 8:1:1.
[0128] The electronic device can be trained using the detection framework YOLOv7-tiny and the detection framework YOLOv7. Precision, Recall, Mean Average Precision (abbreviated as mAP), and Frames Per Second (FPS) are used as evaluation metrics during the training process of the detection framework.
[0129] Through experiments, the following comparison results of the detection framework YOLOv7-tiny and the detection framework YOLOv7 on the test image set can be obtained as shown in Table 1 below:
[0130]
[0131] Table 1
[0132] It can be seen from this that the defect detection model based on the detection framework YOLOv7 not only has high detection accuracy but also good detection speed in the magnetic flux leakage signal detection task of the pipeline.
[0133] Exemplarily, in the pre-training stage, the electronic device may train the detection framework in the manner of steps S402 to S412 provided in the above embodiments, and connect a positioning module to the output end of the prediction head of the detection framework to construct a pre-trained defect detection model. In the model application stage, the electronic device may input the image to be detected into the pre-trained defect detection model, and use Figure 7 the backbone network 720 therein to perform feature extraction on the image to be detected, then perform multi-scale feature fusion through the neck network 740, and finally output a red box as shown in Figure 6 by the head network 760, that is, the detection box of the pipeline defect part in the image to be detected. The position of the detection box in the image to be detected is used as local position information and output to the positioning module 780 together with the defect category information of the pipeline defect part within the detection box.
[0134] Step S512: Use the defect detection model to determine the target pipeline position corresponding to the local position information according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and output the target pipeline position and the defect category information.
[0135] Optionally, in some embodiments, the electronic device may use the positioning module 780 of the defect detection model to perform the following operations: use the preset pipeline length L (unit: millimeter mm) as the height of the image to be detected, and use the number of Hall sensors in the circumferential direction as the preset number of channels N in the target direction, and use the preset number of channels N as the width of the image to be detected. It can be seen that the grayscale image in a single preset direction can be mathematically represented as [L, N, 1]. Since the actual pipeline length is very long, even reaching the ten-thousand-meter level, to improve the detection efficiency, the preset pipeline segmentation parameter K may be used to divide the entire pipeline into K segments, and the grayscale image of each segment can be represented as [L / K, N, 1]. The local position information output by the head network 760 is determined based on the image coordinates of the grayscale image itself (the lower left corner of the grayscale image is used as the origin (0, 0)). When the local position information is (a, b), the values of a and b range from 0 to 1. By performing arithmetic processing on the local position information of the pipeline defect part in the grayscale image of the i-th segment of the pipeline, the corresponding target pipeline position of the pipeline defect part in the entire pipeline can be obtained as (L / K × (i - a), b × N). That is, the pipeline defect part is located at L / K × (i - a) millimeters in the pipeline and at the position of the b × N-th Hall sensor in the circumferential direction.
[0136] In this embodiment, by removing noise and performing reference correction on the magnetic flux leakage signals of the pipeline, the signal quality can be improved. By using different feature extraction methods of different filters, the defect features can be highlighted, and at the same time, it can adapt to various types of defects, optimize the output of the subsequent defect detection model, greatly improve the detection efficiency, and more effectively locate the position information of pipeline defects such as welds and defects by using the defect detection model, so as to more accurately capture the targets in the region of interest, reduce the probability of missed detection, and at the same time reduce the computational overhead of the model, ensure the real-time detection effect, and further improve the detection accuracy.
[0137] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages, and these steps or stages do not necessarily have to be executed at the same time, but can be executed at different times, and the execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or alternately with at least some of the steps or stages in other steps or other steps.
[0138] Based on the same inventive concept, the embodiments of the present application also provide a pipeline magnetic flux leakage signal detection system for implementing the pipeline magnetic flux leakage signal detection method described above. The implementation solutions provided by this system to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the pipeline magnetic flux leakage signal detection system provided below can refer to the limitations on the pipeline magnetic flux leakage signal detection method in the above text, and will not be repeated here.
[0139] In an exemplary embodiment, as Figure 8 shown, a pipeline magnetic flux leakage signal detection system 800 is provided, including: a preprocessing module 802, an image conversion module 804, a detection module 806, and a target positioning module 808, where:
[0140] The preprocessing module 802 is configured to obtain signal detection values of the magnetic flux leakage signals of the pipeline in multiple preset directions in multiple preset channels.
[0141] The image conversion module 804 is configured to determine the exceedance ratio corresponding to each preset channel by using the signal detection values in each preset direction in each preset channel and the signal reference value corresponding to the signal detection value. Convert the signal detection value into a corresponding pixel value according to the exceedance ratio to obtain a to-be-detected image corresponding to each preset direction.
[0142] The detection module 806 is configured to input the image to be detected into a pre-trained defect detection model, and determine the local position information of the pipeline defect part in the image to be detected and the defect category information to which the pipeline defect part belongs through the defect detection model.
[0143] The target positioning module 808 is configured to use the defect detection model to determine the target pipeline position corresponding to the local position information according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and output the target pipeline position and the defect category information.
[0144] In an exemplary embodiment, the image conversion module 804 is further configured to determine the target pixel value corresponding to the signal detection value according to the reference pixel value corresponding to the signal reference value and the product of the reference pixel value and the excess ratio; use the target pixel values corresponding to the signal detection values in each preset direction to determine the grayscale image corresponding to each preset direction; determine the image to be detected according to the grayscale image corresponding to each preset direction.
[0145] In an exemplary embodiment, the image conversion module 804 is further configured to use the grayscale image corresponding to each preset direction as the image to be detected corresponding to each preset direction, or splice the grayscale images corresponding to each preset direction to obtain a corresponding color image, and use the color image as the image to be detected corresponding to each preset direction.
[0146] In an exemplary embodiment, the image conversion module 804 is further configured to perform reference correction on the signal detection values in each preset direction in each preset channel to obtain the signal reference value corresponding to each preset channel; use the difference between the signal detection value and the signal reference value and the signal reference value to determine the excess ratio corresponding to each preset channel.
[0147] In an exemplary embodiment, the preprocessing module 802 is further configured to preprocess the magnetic flux leakage signal of the pipeline by using a preset filter, and use the magnetic flux leakage signal intensity values of the preprocessed magnetic flux leakage signal of the pipeline in multiple preset directions as the signal detection values.
[0148] In an exemplary embodiment, the magnetic flux leakage signal detection system 800 for pipelines further includes a training module, which is configured to obtain a magnetic flux leakage signal data set for pipelines; preprocess the magnetic flux leakage signal data set for pipelines, and construct a sample image data set by using the preprocessed magnetic flux leakage signal data set for pipelines and the corresponding defect label file; divide the sample image data set into a training image set, a validation image set, and a test image set according to a preset data ratio; train a detection framework by using the training image set to obtain a trained detection framework; verify the trained detection framework by using the validation image set and the test image set to obtain a verification result corresponding to the trained detection framework; and, when the verification result meets a preset verification condition, construct a pre-trained defect detection model by using the trained detection framework.
[0149] Each module in the above-mentioned magnetic flux leakage signal detection system 800 for pipelines can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0150] It should be noted that it should be understood that the above-mentioned division of each module is only a logical function division. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the x module can be a separately established processing element, or can be integrated in a certain chip of the above-mentioned device. In addition, it can also be stored in the memory of the above-mentioned device in the form of program code, and called and executed by a certain processing element of the above-mentioned device to perform the functions of the above-mentioned x module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together or independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or the above-mentioned modules can be completed by the integrated logic circuit of the hardware in the processor element or the instructions in the form of software.
[0151] For example, the above-mentioned modules can be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or, one or more Digital Signal Processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. Again, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0152] In an exemplary embodiment, as Figure 9 shown, the electronic device of the present invention is presented in the form of a general-purpose computing device. The components of the electronic device may include but are not limited to: one or more processors or processing units 91, a memory 92, and a bus 93 connecting different system components (including the memory 92 and the processing unit 91).
[0153] The bus 93 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0154] An electronic device typically includes a variety of computer system-readable media. These media can be any available media accessible by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0155] The memory 92 may include computer system-readable media in the form of volatile memory, such as Random Access Memory (RAM) 921 and / or cache memory 922. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 923 can be used to read and write non-removable, non-volatile magnetic media ( Figure 9 not shown, commonly referred to as a "hard disk drive"). Although Figure 8Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) can be provided. In these cases, each drive can be connected to the bus 93 through one or more data medium interfaces. The memory 92 can include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0156] A program / utility 924 having a set (at least one) of program modules 9251 can be stored in, for example, the memory 92. Such program modules 9251 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 9251 generally perform the pipeline magnetic flux leakage signal detection function and / or the pipeline magnetic flux leakage signal detection method in the embodiments described in the present invention.
[0157] The electronic device can also communicate with one or more external devices (such as a keyboard, a pointing device, a display, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device, and / or communicate with any device that enables the electronic device to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 94. And, the electronic device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 95. As Figure 9 shown, the network adapter 95 communicates with other modules of the electronic device through the bus 93. It should be understood that although Figure 9 not shown in the figure, other hardware and / or software modules can be combined with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0158] Those skilled in the art can understand that Figure 9 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0159] In an exemplary embodiment, an electronic device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0160] Specifically, the memory is used to store computer programs; the memory includes various media that can store program codes, such as ROM, RAM, magnetic disks, USB flash drives, memory cards, or optical discs.
[0161] The processor is used to execute the computer program stored in the memory, so that the electronic device executes the above-mentioned method for detecting the illegal behavior of standing people under the crane boom.
[0162] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0163] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented. Those of ordinary skill in the art can understand that all or part of the steps in the method of implementing the above embodiments can be completed by instructing the processor through a program. The program can be stored in a computer-readable storage medium. The storage medium is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrating one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid-state drive (SSD)), etc.
[0164] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0165] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0166] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in the present application.
[0167] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for detecting magnetic flux leakage signals of pipelines, characterized in that, The method includes: Obtaining signal detection values of magnetic flux leakage signals in a pipeline in multiple preset channels in multiple preset directions; Using the signal detection values in each of the preset directions in each of the preset channels and the signal reference values corresponding to the signal detection values to determine the exceeding ratio corresponding to each of the preset channels; Converting the signal detection values into corresponding pixel values according to the exceeding ratio to obtain a to-be-detected image corresponding to each of the preset directions; Inputting the to-be-detected image into a pre-trained defect detection model, and determining local position information of a pipeline defect part in the to-be-detected image and defect category information to which the pipeline defect part belongs through the defect detection model; Using the defect detection model to determine a target pipeline position corresponding to the local position information according to a preset pipeline length, the number of preset channels in a target direction, and preset pipeline segmentation parameters, and outputting the target pipeline position and the defect category information.
2. The method according to claim 1, wherein The converting the signal detection values into corresponding pixel values according to the exceeding ratio to obtain a to-be-detected image corresponding to each of the preset directions includes: Determining a target pixel value corresponding to the signal detection value according to a reference pixel value corresponding to the signal reference value and a product of the reference pixel value and the exceeding ratio; Using the target pixel values corresponding to the signal detection values in each of the preset directions to determine a grayscale image corresponding to each of the preset directions; Determining the to-be-detected image according to the grayscale image corresponding to each of the preset directions.
3. The method according to claim 2, wherein The determining the to-be-detected image according to the grayscale image corresponding to each of the preset directions includes: Taking the grayscale image corresponding to each of the preset directions as the to-be-detected image corresponding to each of the preset directions, or Performing splicing processing on the grayscale images corresponding to each of the preset directions to obtain a corresponding color image, and taking the color image as the to-be-detected image corresponding to each of the preset directions.
4. The method according to claim 1, characterized in that The using the signal detection values in each of the preset directions in each of the preset channels and the signal reference values corresponding to the signal detection values to determine the exceeding ratio corresponding to each of the preset channels includes: Performing reference correction on the signal detection values in each of the preset directions in each of the preset channels to obtain a signal reference value corresponding to each of the preset channels; Using a difference between the signal detection value and the signal reference value and the signal reference value to determine the exceeding ratio corresponding to each of the preset channels.
5. The method according to claim 1, wherein The obtaining signal detection values of magnetic flux leakage signals in a pipeline in multiple preset channels in multiple preset directions includes: Preprocessing the magnetic flux leakage signal of the pipeline by using a preset filter, and taking the magnetic flux leakage signal intensity values in multiple preset directions of the preprocessed magnetic flux leakage signal of the pipeline as the signal detection values.
6. The method according to any one of claims 1 to 5, characterized in that, The pre-training method of the defect detection model includes: Obtaining a magnetic flux leakage signal data set of a pipeline; Preprocessing the magnetic flux leakage signal data set of the pipeline, and constructing a sample image data set by using the preprocessed magnetic flux leakage signal data set of the pipeline and a corresponding defect label file; Dividing the sample image data set into a training image set, a validation image set, and a test image set according to a preset data ratio; Use the training image set to train the detection framework to obtain a trained detection framework; Use the validation image set and the test image set to validate the trained detection framework to obtain the validation result corresponding to the trained detection framework; When the validation result meets the preset validation conditions, use the trained detection framework to construct a pre-trained defect detection model.
7. A magnetic flux leakage signal detection system for pipelines, characterized in that, The system includes: A preprocessing module for obtaining signal detection values of the magnetic flux leakage signals of the pipeline in multiple preset directions in multiple preset channels; An image conversion module for using the signal detection values in each preset direction in each preset channel and the signal reference value corresponding to the signal detection value to determine the exceedance ratio corresponding to each preset channel; converting the signal detection value into a corresponding pixel value according to the exceedance ratio to obtain a to-be-detected image corresponding to each preset direction; A detection module for inputting the to-be-detected image into the pre-trained defect detection model, and determining the local position information of the pipeline defect part in the to-be-detected image and the defect category information to which the pipeline defect part belongs through the defect detection model; A target positioning module for using the defect detection model to determine the target pipeline position corresponding to the local position information according to the preset pipeline length, the number of preset channels in the target direction, and the preset pipeline segmentation parameters, and outputting the target pipeline position and the defect category information.
8. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Pipeline defect identification method, processor and pipeline defect identification device
CN114926707A
Pipeline circumferential weld defect identification method and device
CN118088943A
Pipeline leakage detection method and system based on multi-sensor feature fusion
CN118346932A
Method and system for detecting magnetic flux leakage defect of long-distance pipeline based on improved YOLOv8
CN119625283A
Intelligent analysis system for magnetic flux leakage detection data in pipeline
WO2020133639A1
Cited By
Image-based steel pipe inner and outer wall defect detection method and system
CN121010579A