Pipeline magnetic leakage signal detection method, system, and electronic equipment
By obtaining the signal detection value of the pipeline leakage magnetic signal in multiple directions, forming an image and using a pre-trained model for defect detection, the high error rate and low efficiency of pipeline defect diagnosis in traditional methods are solved, and high-precision and efficient long-distance pipeline detection are achieved.
Patent Information
- Application Number
- CN202510757585.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-09
AI Technical Summary
When traditional leakage magnetic signal analysis methods face the superposition of complex defects and multiple defect coupling magnetic fields, it is difficult to achieve high-precision and high-efficiency pipeline defect diagnosis, especially in long-distance pipeline detection and high misjudgment rate.
By obtaining the signal detection value of the pipeline magnetic leakage signal in multiple preset directions, the excess ratio is calculated using the signal reference value, and the image to be detected is formed by converting it into pixel values. The pre-trained defect detection model is used to determine the pipe defect location and category, and the target positioning is performed based on the pipe length and number of channels.
It improves the generalization ability of the pipeline's multiple types of defect detection, reduces the probability of misjudgment and missed detection, realizes the real-time detection requirements of long-distance pipelines, and improves detection accuracy and efficiency.
Smart Images

Figure CN120275490B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to a pipeline magnetic leakage signal detection method, system, and electronic equipment. Background Art
[0002] As core infrastructure for oil and gas transportation, the structural integrity of pipelines directly impacts energy security and environmental risks. Magnetic Flux Leakage (MFL) technology, which captures magnetic field distortion at defects to detect pipeline damage non-destructively, has become a mainstream method in the industry due to its efficiency and applicability. However, with the increasing complexity of pipeline networks and the demand for higher detection accuracy, traditional signal analysis methods are facing significant bottlenecks, necessitating technological innovation to achieve higher accuracy and efficiency in defect diagnosis.
[0003] Traditional MFL signal analysis methods primarily rely on manually designed feature extraction and pattern recognition processes. For example, these methods use wavelet transforms or empirical mode decomposition for noise reduction, extract features such as time-domain amplitude and frequency-domain energy, and combine them with classifiers such as support vector machines or random forests for defect detection. Although these methods have achieved some success in early applications, their limitations have become increasingly apparent. First, manual feature engineering relies on expert experience and is insufficient for characterizing complex defects (such as microcracks and irregular shapes), resulting in limited generalization performance. Furthermore, traditional methods struggle to adaptively analyze the superposition effects of coupled magnetic fields from multiple defects, significantly increasing the error rate. Furthermore, the segmented data processing process is inefficient and cannot meet the needs of real-time inspection of long-distance pipelines. Summary of the Invention
[0004] Based on this, it is necessary to address the above technical problems and provide a high-precision pipeline magnetic leakage signal detection method, system, electronic equipment, computer-readable storage medium and computer program product that can adapt to various types of defects to meet the needs of real-time detection of long-distance pipelines.
[0005] In a first aspect, the present application provides a pipeline magnetic leakage signal detection method, comprising:
[0006] Obtaining signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions;
[0007] Determine the excess 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;
[0008] Converting the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected corresponding to each of the preset directions;
[0009] Inputting the image to be inspected into a pre-trained defect detection model, and determining the local position information of the pipeline defect portion in the image to be inspected and the defect category information to which the pipeline defect portion belongs through the defect detection model;
[0010] The defect detection model is used to determine the 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 the target pipeline position and the defect category information are output.
[0011] In one embodiment, converting the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected corresponding to each of the preset directions includes:
[0012] 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 excess ratio;
[0013] Determine a grayscale image corresponding to each of the preset directions using a target pixel value corresponding to the signal detection value in each of the preset directions;
[0014] The image to be detected is determined according to the grayscale image corresponding to each of the preset directions.
[0015] In one embodiment, determining the image to be detected according to the grayscale image corresponding to each of the preset directions includes:
[0016] The grayscale image corresponding to each preset direction is used as the image to be detected corresponding to each preset direction, or,
[0017] The grayscale images corresponding to each of the preset directions are spliced to obtain corresponding color images, and the color images are used as the images to be detected corresponding to each of the preset directions.
[0018] In one embodiment, determining the excess 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 includes:
[0019] Performing a reference correction on the signal detection value 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;
[0020] The excess ratio corresponding to each of the preset channels is determined by using the difference between the signal detection value and the signal reference value and the signal reference value.
[0021] In one embodiment, obtaining signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions includes:
[0022] The pipeline magnetic flux leakage signal is preprocessed by using a preset filter, and the magnetic flux leakage signal strength values of the preprocessed pipeline magnetic flux leakage signal in multiple preset directions are used as the signal detection values.
[0023] In one embodiment, the pre-training method of the defect detection model includes:
[0024] Obtain pipeline magnetic flux leakage signal dataset;
[0025] Preprocessing the pipeline magnetic flux leakage signal dataset, and constructing a sample image dataset using the preprocessed pipeline magnetic flux leakage signal dataset and a corresponding defect label file;
[0026] Dividing the sample image data set into a training image set, a verification image set, and a test image set according to a preset data ratio;
[0027] Using the training image set to train the detection framework to obtain a trained detection framework;
[0028] Verifying the trained detection framework using the verification image set and the test image set to obtain a verification result corresponding to the trained detection framework;
[0029] When the verification result satisfies the preset verification condition, a pre-trained defect detection model is constructed using the trained detection framework.
[0030] In a second aspect, the present application also provides a pipeline magnetic leakage signal detection system, comprising:
[0031] A preprocessing module, used to obtain signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions;
[0032] an image conversion module, configured to determine an excess ratio corresponding to each preset channel by using the signal detection value in each preset direction in each preset channel and a signal reference value corresponding to the signal detection value; and convert the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected corresponding to each preset direction;
[0033] a detection module, configured to input the image to be detected into a pre-trained defect detection model, and determine, through the defect detection model, local position information of the pipeline defect portion in the image to be detected and defect category information to which the pipeline defect portion belongs;
[0034] a target positioning module, configured to determine the target pipeline position corresponding to the local position information using the defect detection model according to a preset pipeline length, a preset number of channels in the 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 comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the pipeline magnetic flux leakage signal detection method described in any embodiment of the first aspect.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the pipeline magnetic flux leakage signal detection method described in any embodiment of the first aspect.
[0037] In a fifth aspect, the present application further provides a computer program product, comprising a computer program that, when executed by a processor, implements the pipeline magnetic flux leakage signal detection method described in any one of the embodiments of the first aspect.
[0038] The pipeline magnetic flux leakage signal detection method, system, electronic device, computer-readable storage medium, and computer program product described above obtain signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions, calculate the excess ratio corresponding to each preset channel using the signal detection value of each preset channel in each preset direction and a signal reference value, convert the signal detection value into a corresponding pixel value based on the excess ratio of each preset channel, and form an image to be detected corresponding to each preset direction. A pre-trained defect detection model is used to predict the local position information of the pipeline defect in the image to be detected. Based on the preset pipeline length of the entire pipeline, the preset number of channels in the target direction, and preset pipeline segmentation parameters, the local position information in the image is converted into the target pipeline position in the entire pipeline. The target pipeline position and defect category information are ultimately output. This not only utilizes the pre-trained defect detection model to improve the generalization capability of pipeline defect detection for multiple types, reduces the probability of misjudgment or missed detection of pipeline defects, and improves detection accuracy, but also rapidly detects the local position information of the pipeline defect in the image to be detected using the image to be detected, and then uses the local position information to locate the target pipeline position of the pipeline defect in the entire pipeline, thereby meeting the timeliness requirements of long-distance real-time pipeline detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A diagram showing an application environment of a pipeline magnetic flux leakage signal detection method according to an embodiment;
[0041] Figure 2 Schematic diagram of a pipeline magnetic flux leakage signal detection method according to one embodiment;
[0042] Figure 3 Schematic diagram of a flow chart of a step of determining an image to be detected in one embodiment;
[0043] Figure 4 Schematic diagram of the process of pre-training a defect detection model in one embodiment;
[0044] Figure 5 A schematic flow chart of a pipeline magnetic flux leakage signal detection method according to another embodiment;
[0045] Figure 6 is a schematic diagram of an image to be detected in one embodiment;
[0046] Figure 7 is a structural block diagram of a defect detection model in one embodiment;
[0047] Figure 8 is a structural block diagram of a pipeline magnetic flux leakage signal detection system 800 in one embodiment;
[0048] Figure 9 FIG. 1 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0049] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the 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 embodiments. The 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 the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0050] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Therefore, the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the shape, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0051] In addition, the descriptions of "first" and "second" in this application are for descriptive purposes only and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0052] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this 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 used for analysis, stored data, displayed data, etc.) involved in this 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 must comply with relevant regulations.
[0054] The pipeline magnetic leakage signal detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the electronic device 102 can communicate with multiple Hall sensors 104 deployed within the pipeline 10 via wired input / output interfaces or wirelessly via Bluetooth, Wi-Fi, LoRa, or other wireless communication methods. Each Hall sensor 104 corresponds to a preset channel, and the number of Hall sensors 104 is typically fixed, such as 64, 128, or 256. Alternatively, in some embodiments, the Hall sensors 104 can be deployed within a pipeline magnetic flux leakage detector (MFLD). The MFLD can move along the extension of the pipeline 10, releasing equal amounts of electromagnetic signals in all directions during movement. Each Hall sensor 104 can receive electromagnetic signals reflected from the pipeline wall 10 in multiple preset directions (e.g., axial, radial, and circumferential). When defects are present in the pipeline wall, the signal detection value received by the Hall sensor 104 will fluctuate to a certain extent.
[0055] For example, the electronic device 102 can obtain signal detection values of pipeline magnetic flux leakage signals in multiple preset channels and multiple preset directions from multiple Hall sensors 104. A pipeline magnetic flux leakage signal detection program can be run on the electronic device 102. During execution of the pipeline magnetic flux leakage signal detection program, the electronic device 102 can use the signal detection values in each preset direction in each preset channel and the corresponding signal reference values to determine the corresponding excess ratio for each preset channel. Based on the excess ratios, the signal detection values are converted into corresponding pixel values to obtain an image to be detected corresponding to each preset direction. The image to be detected is input into a pretrained defect detection model, which determines the local location information of the pipeline defect in the image to be detected and the defect category information to which the pipeline defect belongs. The defect detection model determines the target pipeline position corresponding to the local location information based on the preset pipeline length, the preset number of channels in the target direction, and preset pipeline segmentation parameters, and outputs the target pipeline position and defect category information.
[0056] Among them, the electronic device 102 can be, but is not limited to, various terminal devices such as personal computers, laptops, smart phones, tablets, Internet of Things devices (such as smart car-mounted 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.), independent physical servers, server clusters or distributed systems composed of multiple physical servers, cloud servers providing cloud computing services, and other server devices, or clusters composed of terminal devices and server devices.
[0057] In an exemplary embodiment, Figure 2 As shown, a pipeline magnetic leakage signal detection method is provided, which is applied to Figure 1 Taking the electronic device 102 in FIG. 1 as an example, the method includes the following steps S202 to S210. In which:
[0058] Step S202 : acquiring signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions.
[0059] The preset channel may be used to refer to a Hall sensor that receives a pipeline magnetic leakage signal.
[0060] The pipeline magnetic flux leakage signal can be used to represent the electromagnetic signal reflected from the pipe wall to the Hall sensor.
[0061] The preset direction may include but is not limited to an axial direction, a radial direction, a circumferential direction, etc.
[0062] The signal detection value can be used to represent the magnetic flux leakage signal strength value.
[0063] For example, the electronic device can read pipeline magnetic flux leakage signals received by multiple Hall sensors in corresponding preset channels in real time or periodically. The pipeline magnetic flux leakage signals are typically expressed as vector data. Based on the directional information in the vector data, signal detection values in each preset direction can be obtained from the pipeline magnetic flux leakage signals.
[0064] Step S204 : determining the excess 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.
[0065] The signal reference value may be the mean, median, mode, etc. of the signal detection value, or may be a value customized by the detection personnel.
[0066] The excess ratio can be used to indicate the degree of difference between the signal detection value and the signal reference value.
[0067] For example, the electronic device may receive a numerical value input by a tester as a signal reference value corresponding to the signal detection value, or may obtain the corresponding signal reference value by performing computational processing on the signal detection value in each preset direction on each preset channel. The signal detection value and the signal reference value are then computationally processed according to a preset excess ratio calculation logic to obtain the excess ratio corresponding to each preset channel.
[0068] Step S206 : converting the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected corresponding to each preset direction.
[0069] The pixel value ranges from 0 to 255.
[0070] Optionally, in some embodiments, the electronic device may store an excess ratio threshold and a pixel mapping relationship corresponding to the excess ratio threshold. Based on the comparison result of the excess ratio of each preset channel with the excess ratio threshold, the pixel value corresponding to the signal detection value is read from the pixel mapping relationship corresponding to the excess ratio threshold. Alternatively, in other embodiments, the electronic device may also store pixel value conversion logic. The excess ratio calculated by the signal detection value is processed according to the pixel value conversion logic, and the numerical value obtained after the processing is used as the pixel value corresponding to the signal detection value. The pixel value corresponding to the signal detection value of the same preset direction is input into an image processing library (such as an image standard library opencv, Pillow, matplotlib, etc.) to obtain an image to be detected corresponding to each preset direction.
[0071] In step S208 , the image to be inspected is input into a pre-trained defect detection model, and the defect detection model is used to determine the local position information of the pipeline defect portion in the image to be inspected and the defect category information to which the pipeline defect portion belongs.
[0072] 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 a YOLOv7 detection frame).
[0073] For example, the electronic device may be deployed with a pre-trained defect detection model. An image to be inspected is input into the pre-trained defect detection model, which extracts features from the image. Multi-scale feature fusion is performed on the extracted features to predict the location of a detection frame of the pipeline defect in the image to be inspected as local location information. The defect category information of the pipeline defect is then identified.
[0074] In step S210 , the target pipeline position corresponding to the local position information is determined using the defect detection model according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and the target pipeline position and defect category information are output.
[0075] Among them, the pipeline segmentation parameter can be used to split 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 characterize the relative position of the pipeline defect in the entire pipeline.
[0077] For example, the electronic device may store a preset pipeline length, a preset number of channels in a target direction (e.g., circumferential direction), and preset pipeline segmentation parameters. The electronic device may also store preset defect location logic. Based on the defect location logic, the preset pipeline length, the preset number of channels in the target direction, and the pipeline segmentation parameters are used to perform computational processing on the local position information of the pipeline defect in the image to be inspected, thereby determining the target pipeline position of the pipeline defect within the entire pipeline. The target pipeline position corresponding to the pipeline defect and the defect category to which it belongs are then output as pipeline magnetic flux leakage signal detection results using the defect detection model.
[0078] In the above pipeline magnetic flux leakage signal detection method, by obtaining the signal detection values of the pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions, the signal detection value of each preset channel in each preset direction and the signal reference value are used to calculate the excess ratio corresponding to each preset channel, and the signal detection value is converted into a corresponding pixel value according to the excess ratio of each preset channel to form an image to be detected corresponding to each preset direction, and the pre-trained defect detection model is used to predict the local position information of the pipeline defect part in the image to be detected, 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, the local position information in the image is converted into the entire pipeline. The target pipeline position is finally output as the target pipeline position and defect category information. It can not only use the pre-trained defect detection model to improve the generalization ability of pipeline defect detection of various types, reduce the probability of misjudgment and missed detection of pipeline defects, and improve detection accuracy, but also use the defect detection model to quickly detect the local position information of the pipeline defect in the image to be detected, locate the target pipeline position of the local position information in the entire pipeline, and more effectively locate the position information of the weld and defect to more accurately capture the target in the area of interest, reduce the computational overhead of the model, and ensure real-time detection effect, thereby meeting the timeliness requirements of long-distance pipeline real-time detection and further improving the detection accuracy.
[0079] In an exemplary embodiment, Figure 3 As shown, step S206 includes steps S302 to S306.
[0080] Step S302 : 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 excess ratio.
[0081] For example, the electronic device may store a reference pixel value corresponding to the signal reference value. The reference pixel value is multiplied by the excess ratio corresponding to each preset channel to obtain the product of the reference pixel value corresponding to each preset channel and the excess ratio. The reference pixel value and the product of the reference pixel value corresponding to each preset channel and the excess ratio are processed to obtain a target pixel value corresponding to the signal detection value.
[0082] Optionally, in some implementations, when the reference pixel value is 128, the electronic device may determine the target pixel value by referring to the following formula:
[0083] ,
[0084] in, is the target pixel value. The excess ratio is calculated using the signal detection value. When the absolute value of the excess ratio exceeds 1, it is set to 1. is the signal reference value.
[0085] Step S304 : Determine a grayscale image corresponding to each preset direction by using the target pixel value corresponding to the signal detection value in each preset direction.
[0086] Step S306: determining an image to be detected according to the grayscale image corresponding to each preset direction.
[0087] Exemplarily, the electronic device can input the target pixel value corresponding to the signal detection value in each preset direction into the image processing library to generate a grayscale image corresponding to each preset direction. Optionally, in some embodiments, the electronic device can randomly select a grayscale image corresponding to a preset direction as the image to be detected and input it into the defect detection model for detection. Alternatively, in other embodiments, the electronic device can also select a high-quality grayscale image as the image to be detected based on quality parameters such as clarity, contrast, noise level, uniformity, etc. of the grayscale image and input it into the defect detection model for detection. Alternatively, in other embodiments, the electronic device can also perform fusion and superposition processing 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 a reference pixel value corresponding to the signal reference value, the excess ratio corresponding to each preset channel is used to perform calculation processing on the reference pixel value to obtain a target pixel value corresponding to the signal detection value. The target pixel value is used to draw a grayscale image to obtain an image to be detected corresponding to the pipeline magnetic flux leakage signal. This can better preserve the characteristics of the pipeline magnetic flux leakage signal in the image, thereby helping to improve detection accuracy.
[0089] In an exemplary embodiment, the above-mentioned step S306 may also 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 image corresponding to each preset direction to obtain a 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. Accordingly, a defect detection model applicable to grayscale images can be trained using the grayscale image set corresponding to the pipeline magnetic flux leakage signal dataset.
[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]. H is the image height of the grayscale image, and W is the image width of the grayscale image. The electronic device concatenates 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 concatenated color image as the image to be detected corresponding to each preset direction.
[0092] Optionally, in some embodiments, the inspector can select the grayscale image in each preset direction as the image to be inspected based on the actual pipeline situation, or select the color image obtained by splicing the grayscale images in each preset direction as the image to be inspected, or use both the grayscale image and the color image as the image to be inspected.
[0093] In this embodiment, by using grayscale images in various preset directions or color images obtained by splicing grayscale images as the image to be detected, it is possible to meet personalized pipeline magnetic flux leakage signal detection requirements and help improve detection flexibility.
[0094] In an exemplary embodiment, step S204 may include: performing a baseline correction on the signal detection value in each preset direction in each preset channel to obtain a signal baseline value corresponding to each preset channel; and determining the excess ratio corresponding to each preset channel using the difference between the signal detection value and the signal baseline value and the signal baseline value.
[0095] For example, the electronic device may calculate the average of the signal detection values corresponding to each preset direction in each preset channel as the signal reference value for each preset channel in each preset direction. The difference between the signal detection value and the signal reference value is calculated. A ratio of the difference between the signal detection value and the signal reference value to the signal reference value is determined as the excess ratio for each preset channel in each preset direction.
[0096] Optionally, in some implementations, the electronic device may determine the excess ratio by referring to the following formula:
[0097] ,
[0098] in, To exceed the ratio. is the signal detection value. As the signal reference value, the mean of the signal detection values can be selected.
[0099] In this embodiment, by performing a baseline correction on the pipeline magnetic flux leakage signal, the difference between the signal detection value and the signal baseline value and the signal baseline value are used to determine the excess ratio corresponding to each preset channel, which can eliminate errors and improve the calculation accuracy of the excess ratio.
[0100] In an exemplary embodiment, step S202 may include: preprocessing the pipeline magnetic flux leakage signal using a preset filter, and using the magnetic flux leakage signal strength values of the preprocessed pipeline magnetic flux leakage signal in multiple preset directions as signal detection values.
[0101] For example, the electronic device may input the pipeline magnetic flux leakage signal into a preset filter for preprocessing operations such as noise removal and signal enhancement. The preprocessed magnetic flux leakage signal strength values in multiple preset directions are read as signal detection values. The preset filter may include, but is not limited to, any one or more combinations of filters such as Gaussian filters, median filters, bilateral filters, histogram equalization, and wavelet filters.
[0102] In this embodiment, by using a preset filter to preprocess the pipeline magnetic flux leakage signal, not only can the quality of the pipeline magnetic flux leakage signal be improved, but also, by using different preset filters for preprocessing, different defect features can be extracted from the pipeline magnetic flux leakage signal. This is applicable to various types of defects and optimizes the input of subsequent defect detection models, thereby significantly improving detection efficiency.
[0103] In an exemplary embodiment, Figure 4 As shown, a pre-training method for a defect detection model is also provided, including the following steps S402 to S412.
[0104] Step S402: Acquire a pipeline magnetic flux leakage signal dataset.
[0105] Step S404 : preprocessing the pipeline magnetic flux leakage signal dataset, and constructing a sample image dataset using the preprocessed pipeline magnetic flux leakage signal dataset and the corresponding defect label file.
[0106] For example, the electronic device can refer to the preprocessing methods provided in the above embodiments and use a preset filter to perform preprocessing such as denoising and signal enhancement on the pipeline magnetic flux leakage signal dataset, thereby obtaining a preprocessed pipeline magnetic flux leakage signal dataset. A baseline correction is performed on the signal detection values of each preset channel in each preset direction in the preprocessed pipeline magnetic flux leakage signal dataset, and the corresponding exceedance ratio is calculated. The signal detection values are then converted into corresponding target pixel values using the exceedance ratio, thereby forming sample image data corresponding to the preprocessed pipeline magnetic flux leakage signal dataset. A defect label file is constructed using the local location information of the pipeline defect corresponding to the sample image dataset and the defect category information to which the pipeline defect belongs. The sample image data and the corresponding defect label file are used to construct a sample image dataset for model training.
[0107] Optionally, in some embodiments, the sample image dataset may be in a compressed image format (Joint Photographic Experts Group, JPEG). Each frame of sample image data is stored in a corresponding folder according to the corresponding defect label. The defect label file may be in a plain text file format (txt).
[0108] Step S406 : dividing the sample image data set into a training image set, a verification image set, and a test image set according to a preset data ratio.
[0109] Optionally, in some implementations, the preset data ratio may be training image set:test image set:validation image set=8:1:1.
[0110] Step S408: training the detection framework using the training image set to obtain a trained detection framework.
[0111] Step S410 , using the verification image set and the test image set to verify the trained detection framework, and obtaining a verification result corresponding to the trained detection framework.
[0112] For example, the electronic device can use an object detection framework (such as the YOLOv7 framework) as the detection framework. The detection framework is iteratively trained using a training image set to obtain a trained detection framework. A validation image set and a test image set are input into the trained detection framework to obtain defect detection results output by the trained detection framework. The defect detection results predicted by the trained detection framework are verified using the defect label files corresponding to the validation image set and the test image set to obtain corresponding verification results.
[0113] Step S412: When the verification result satisfies the preset verification conditions, a pre-trained defect detection model is constructed using the trained detection framework.
[0114] For example, the electronic device can store preset verification conditions, such as the loss value of the defect detection result being lower than a preset loss threshold, the precision of the defect detection result reaching a preset accuracy threshold, the recall of the trained detection framework reaching a preset recall threshold, or the frames per second (FPS) of the trained detection framework reaching a preset rate threshold. If the verification result of the trained defect detection model meets the preset verification conditions, the trained detection framework is combined with the positioning module to form a pre-trained defect detection model. During the application phase, the positioning module can convert the local position information output by the prediction head of the detection framework into the target pipeline position within the entire pipeline.
[0115] In this embodiment, by using the pipeline magnetic leakage signal dataset to train the detection framework, when the trained detection framework meets the preset verification conditions, the trained detection framework is used to construct a pre-trained defect detection model, which can improve the detection accuracy of the defect detection model.
[0116] In an exemplary embodiment, Figure 5 As shown, a pipeline magnetic leakage signal detection method is also provided, including the following steps S502 to S512.
[0117] Step S502 : acquiring pipeline magnetic flux leakage signals in a plurality of preset channels, preprocessing the pipeline magnetic flux leakage signals using a preset filter, and using the magnetic flux leakage signal strength values of the preprocessed pipeline magnetic flux leakage signals in a plurality of preset directions as signal detection values.
[0118] For example, the electronic device can obtain pipeline magnetic flux leakage signals from multiple preset channels received by multiple Hall sensors and read the magnetic flux leakage signal strength values in the axial, radial, and circumferential directions of the pipeline. Based on actual detection results, a corresponding preset filter is selected to perform preprocessing on the magnetic flux leakage signal strength values, such as denoising and signal enhancement, and the preprocessed magnetic flux leakage signal strength values are used as signal detection values in the axial, radial, and circumferential directions.
[0119] Step S504 , performing a reference correction on the signal detection value in each preset direction in each preset channel, and determining the excess ratio corresponding to each preset channel using the corrected signal reference value and the difference between the signal detection value and the signal reference value.
[0120] For example, the electronic device may perform baseline calibration on the signal detection values received in the axial, radial, and circumferential directions in a preset channel of each Hall sensor, and calculate an average of the signal detection values as the signal baseline value. The excess ratio corresponding to each preset channel is determined by referring to the above-mentioned excess ratio calculation formula.
[0121] Step S506 : determining a 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.
[0122] Step S508 , determining a grayscale image corresponding to each preset direction using the target pixel value corresponding to the signal detection value in each preset direction, and determining an image to be detected according to the grayscale image corresponding to each preset direction.
[0123] For example, the electronic device can refer to the calculation formula of the target pixel value provided in the above embodiment, and perform processing on the reference pixel value and the product of the reference pixel value and the excess ratio to obtain the target pixel value corresponding to the signal detection value. The target pixel value corresponding to the signal detection value in each preset direction is used to draw and generate a grayscale image corresponding to each preset direction. Optionally, in some embodiments, such as Figure 6 As shown, the electronic device can use the grayscale image or the color image obtained by splicing the grayscale images as the image to be detected for subsequent pipeline defect detection.
[0124] In step S510 , the image to be inspected is input into a pre-trained defect detection model, and the defect detection model is used to determine the local position information of the pipeline defect portion in the image to be inspected and the defect category information to which the pipeline defect portion belongs.
[0125] Optionally, in some embodiments, the electronic device may construct a defect detection model as shown in FIG7 . Figure 7 The backbone network 720 (Backbone) of the defect detection model 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 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 includes a neck layer aggregation network structure 746 (EfficientLayer Aggregation Networks, referred to as ELAN), a concatenation layer 744 (Concatenate, referred to as Concat), a multi-scale pooling module 742 (Multi-scale Pooling, referred to as MP), and a neck convolution layer 748 (Convolution, referred to as Conv). Figure 7 The head network 760 (Head) of the defect detection model 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 deep learning-based defect detection model shown here combines the end-to-end feature learning capabilities of a convolutional neural network (CNN). This model can directly mine deep spatiotemporal features from raw signals, avoiding artifacts from design bias and significantly improving the recognition rate of subtle defects. It utilizes a recurrent neural network (RNN) and a deep learning model architecture (Transformer model) based on a self-attention mechanism to effectively address the problem of multiple defect coupling interference by modeling signal temporal dependencies. A generative adversarial network (GAN) generates diverse defect samples, alleviating the challenge of data scarcity. The introduction of the attention mechanism further enhances the robustness of the defect detection model in noisy environments. Lightweight networks (such as MobileNet) combined with model compression technology enable real-time analysis on embedded devices, meeting the needs of on-site inspections. Experiments demonstrate that deep learning methods demonstrate outstanding defect classification accuracy (10%-20% higher than traditional methods) and detection efficiency (3-5 times faster).
[0127] Optionally, in some embodiments, the pipeline magnetic flux leakage signal dataset can be a pull test dataset. The pipeline used for the pull delay is 43 meters long and contains 108 defects of varying sizes and 26 welds. By preprocessing and image conversion the pull test dataset, 860 pipeline magnetic flux leakage signal detection images to be inspected are obtained. These 860 pipeline magnetic flux leakage signal detection images to be inspected are divided into a training image set, a test image set, and a validation image set in an 8:1:1 ratio.
[0128] Electronic devices can be trained using the YOLOv7-tiny and YOLOv7 detection frameworks. Precision, recall, mean average precision (mAP), and frames per second (FPS) are used as evaluation metrics during detection framework training.
[0129] After experiments, we can obtain the comparison results of the detection framework YOLOv7-tiny and the detection framework YOLOv7 on the test image set as shown in Table 1 below:
[0130]
[0131] Table 1
[0132] It can be seen that the defect detection model based on the detection framework YOLOv7 not only has high detection accuracy in the pipeline magnetic leakage signal detection task, but also has good detection speed.
[0133] For example, in the pre-training stage, the electronic device can train the detection framework by referring to the steps S402 to S412 provided in the above embodiment, and connect a positioning module to the output end of the prediction head of the detection framework to build a pre-trained defect detection model. In the model application stage, the electronic device can input the image to be detected into the pre-trained defect detection model, and use Figure 7 The backbone network 720 extracts features from the image to be detected, and then the neck network 740 performs multi-scale feature fusion, and finally the head network 760 outputs the following Figure 6 The red frame shown in FIG is the detection frame of the pipeline defect portion in the image to be detected. The position of the detection frame in the image to be detected is output to the positioning module 780 as local position information together with the defect category information of the pipeline defect portion within the detection frame.
[0134] In step S512, the target pipeline position corresponding to the local position information is determined using the defect detection model according to the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters, and the target pipeline position and defect category information are output.
[0135] Optionally, in some embodiments, the electronic device can utilize the positioning module 780 of the defect detection model to perform the following operations: using the preset pipeline length L (in millimeters) as the height of the image to be inspected, the number of Hall sensors in the circumferential direction as the preset number of channels N in the target direction, and the preset number of channels N as the width of the image to be inspected. Therefore, the grayscale image in a single preset direction can be mathematically represented as [L, N, 1]. Because actual pipeline lengths are very long, even reaching tens of thousands of meters, to improve inspection efficiency, a preset pipeline segmentation parameter K can be used to divide the entire pipeline into K segments. The grayscale image of each segment can then 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 (with the lower left corner of the grayscale image as the origin (0, 0)). When the local position information is (a, b), the values of a and b are between 0 and 1. By calculating and processing the local position information of the pipeline defect in the grayscale image of the i-th section of the pipeline, we can obtain the corresponding target pipeline position of the pipeline defect as (L / K×(ia), b×N). In other words, the pipeline defect is located at a distance of L / K×(ia) millimeters in the pipeline, below the position of the Hall effect sensor in the b×Nth circumferential direction.
[0136] In this embodiment, by removing noise and performing baseline correction on the pipeline magnetic flux leakage signal, the signal quality can be improved. Different feature extraction methods using different filters can highlight defect characteristics, and the system can adapt to various types of defects, optimize the output of subsequent defect detection models, and significantly improve detection efficiency. By using the defect detection model, the position information of pipeline defects such as welds and defects can be more effectively located to more accurately capture targets in the area of interest, reduce the probability of missed detection, and reduce the computational overhead of the model, thereby ensuring real-time detection results and further improving detection accuracy.
[0137] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0138] Based on the same inventive concept, embodiments of the present application also provide a pipeline magnetic flux leakage signal detection system for implementing the aforementioned pipeline magnetic flux leakage signal detection method. The solution provided by this system is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more pipeline magnetic flux leakage signal detection system embodiments provided below can be found in the aforementioned limitations of the pipeline magnetic flux leakage signal detection method and will not be further elaborated here.
[0139] In an exemplary embodiment, Figure 8 As shown, a pipeline magnetic flux leakage signal detection system 800 is provided, comprising: a pre-processing module 802, an image conversion module 804, a detection module 806 and a target positioning module 808, wherein:
[0140] The pre-processing module 802 is used to obtain signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions.
[0141] Image conversion module 804 is configured to determine an excess ratio corresponding to each preset channel using the signal detection values in each preset direction within each preset channel and the corresponding signal reference values. The signal detection values are converted into corresponding pixel values based on the excess ratios to obtain an image to be detected corresponding to each preset direction.
[0142] The detection module 806 is used to 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.
[0143] The target positioning module 808 is used to determine the target pipeline position corresponding to the local position information based on the preset pipeline length, the preset number of channels in the target direction, and the preset pipeline segmentation parameters using the defect detection model, and output the target pipeline position and defect category information.
[0144] In an exemplary embodiment, the image conversion module 804 is also used to determine the target pixel value corresponding to the signal detection value based on 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 value corresponding to the signal detection value in each preset direction to determine the grayscale image corresponding to each preset direction; and determine the image to be detected based on the grayscale image corresponding to each preset direction.
[0145] In an exemplary embodiment, the image conversion module 804 is also used to use the grayscale image corresponding to each preset direction as the image to be detected corresponding to each preset direction, or to splice the grayscale image 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 also used to perform a baseline correction on the signal detection value in each preset direction in each preset channel to obtain a signal baseline value corresponding to each preset channel; and to determine the excess ratio corresponding to each preset channel using the difference between the signal detection value and the signal baseline value and the signal baseline value.
[0147] In an exemplary embodiment, the preprocessing module 802 is further configured to preprocess the pipeline magnetic flux leakage signal using a preset filter, and use the magnetic flux leakage signal strength values of the preprocessed pipeline magnetic flux leakage signal in multiple preset directions as signal detection values.
[0148] In an exemplary embodiment, the pipeline magnetic flux leakage signal detection system 800 also includes a training module for obtaining a pipeline magnetic flux leakage signal dataset; preprocessing the pipeline magnetic flux leakage signal dataset, and constructing a sample image dataset using the preprocessed pipeline magnetic flux leakage signal dataset and a corresponding defect label file; dividing the sample image dataset into a training image set, a verification image set, and a test image set according to a preset data ratio; using the training image set to train the detection framework to obtain a trained detection framework; using the verification image set and the test image set to verify the trained detection framework to obtain a verification result corresponding to the trained detection framework; and when the verification result satisfies the preset verification conditions, using the trained detection framework to construct a pre-trained defect detection model.
[0149] Each module in the pipeline magnetic flux leakage signal detection system 800 can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in hardware form, or stored in a memory in the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0150] It should be understood that the division of the modules described above is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into a single physical entity or physically separated. Furthermore, these modules can be implemented entirely as software invoked by a processing element, or entirely as hardware. Alternatively, some modules can be implemented as software invoked by a processing element, while others can be implemented as hardware. For example, module x can be a separate processing element, or integrated into a chip of the aforementioned device. Furthermore, it can be stored in the form of program code in the memory of the aforementioned device, invoked by a processing element of the aforementioned device to perform the functions of module x. The implementation of other modules is similar. Furthermore, these modules can be fully or partially integrated or implemented independently. The processing element described herein can be an integrated circuit with signal processing capabilities. During implementation, the steps of the above method or the modules described above can be performed by hardware integrated logic circuits within the processor element or by software instructions.
[0151] For example, the above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors (DSPs), or one or more field-programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0152] In an exemplary embodiment, Figure 9 As shown, the electronic device of the present invention is implemented as a general-purpose computing device. 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 various system components (including the memory 92 and the processing unit 91).
[0153] Bus 93 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0154] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed 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, the storage system 923 may be used to read and write non-removable, non-volatile magnetic media ( Figure 9 Not shown, usually called a "hard drive"). Although Figure 8Although not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 93 via one or more data media interfaces. Memory 92 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0156] A program / utility 924 having a set (at least one) of program modules 9251 may be stored, for example, in 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 an implementation of a network environment. Program modules 9251 generally implement the pipeline magnetic flux leakage signal detection functionality and / or pipeline magnetic flux leakage signal detection method described in the embodiments of the present invention.
[0157] The electronic device may also communicate with one or more external devices (e.g., a keyboard, a pointing device, a display, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 94. Furthermore, the electronic device may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 95. Figure 9 As shown, the network adapter 95 communicates with other modules of the electronic device via the bus 93. Figure 9 Not shown, other hardware and / or software modules may be used in conjunction 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.
[0158] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure 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 shown in the figure, or combine certain components, or have a different component arrangement.
[0159] In an exemplary embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0160] Specifically, the memory is used to store computer programs; the memory includes: ROM, RAM, disk, USB flash drive, memory card or optical disk and other media that can store program codes.
[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 illegal behavior of people standing under the boom.
[0162] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0163] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When executed by a processor, the computer program implements the steps of each of the above-described method embodiments. Persons skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be performed by instructing the processor to perform the program. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, a hard disk, a solid-state drive, magnetic tape, a floppy disk, an optical disc, or any combination thereof. The storage medium can be any available medium accessible by a computer or a data storage device, such as a server or data center, that integrates one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, hard disk, or magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[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 method embodiments are implemented.
[0165] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the 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 above-mentioned embodiments. In particular, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of a non-volatile memory and a 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), magnetic 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 take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0166] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, 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, they should be considered to be within the scope of this application.
[0167] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A pipeline magnetic leakage signal detection method, characterized in that: The method comprises: Obtaining signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions; Determine the excess 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 excess ratio to obtain an image to be detected corresponding to each of the preset directions; Inputting the image to be inspected into a pre-trained defect detection model, and determining the local position information of the pipeline defect portion in the image to be inspected and the defect category information to which the pipeline defect portion belongs through the defect detection model; Determine the target pipeline position corresponding to the local position information using the defect detection model 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; The pre-training method of the defect detection model includes: Obtain pipeline magnetic leakage signal dataset; Preprocessing the pipeline magnetic flux leakage signal dataset, and constructing a sample image dataset using the preprocessed pipeline magnetic flux leakage signal dataset and a corresponding defect label file; Dividing the sample image data set into a training image set, a verification image set, and a test image set according to a preset data ratio; Using the training image set to train the detection framework to obtain a trained detection framework; Verifying the trained detection framework using the verification image set and the test image set to obtain a verification result corresponding to the trained detection framework; When the verification result satisfies the preset verification condition, a pre-trained defect detection model is constructed using the trained detection framework.
2. The method according to claim 1, characterized in that The converting the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected 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 excess ratio; Determine a grayscale image corresponding to each of the preset directions using a target pixel value corresponding to the signal detection value in each of the preset directions; The image to be detected is determined according to the grayscale image corresponding to each of the preset directions.
3. The method according to claim 2, characterized in that The step of determining the image to be detected according to the grayscale image corresponding to each preset direction includes: The grayscale image corresponding to each preset direction is used as the image to be detected corresponding to each preset direction, or, The grayscale images corresponding to each of the preset directions are spliced to obtain corresponding color images, and the color images are used as the images to be detected corresponding to each of the preset directions.
4. The method according to claim 1, wherein Determining the excess 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 includes: Performing a reference correction on the signal detection value 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; The excess ratio corresponding to each of the preset channels is determined by using the difference between the signal detection value and the signal reference value and the signal reference value.
5. The method according to claim 1, wherein The obtaining of signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions includes: The pipeline magnetic flux leakage signal is preprocessed by using a preset filter, and the magnetic flux leakage signal strength values of the preprocessed pipeline magnetic flux leakage signal in multiple preset directions are used as the signal detection values.
6. A pipeline magnetic leakage signal detection system, characterized in that: The system comprises: A preprocessing module, used to obtain signal detection values of pipeline magnetic flux leakage signals in multiple preset channels in multiple preset directions; an image conversion module, configured to determine an excess ratio corresponding to each preset channel by using the signal detection value in each preset direction in each preset channel and a signal reference value corresponding to the signal detection value; and convert the signal detection value into a corresponding pixel value according to the excess ratio to obtain an image to be detected corresponding to each preset direction; a detection module, configured to input the image to be detected into a pre-trained defect detection model, and determine, through the defect detection model, local position information of the pipeline defect portion in the image to be detected and defect category information to which the pipeline defect portion belongs; a target positioning module, configured to determine the target pipeline position corresponding to the local position information using the defect detection model 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; Wherein, the system further includes: A training module is used to obtain a pipeline magnetic flux leakage signal dataset; preprocess the pipeline magnetic flux leakage signal dataset, and use the preprocessed pipeline magnetic flux leakage signal dataset and the corresponding defect label file to construct a sample image dataset; divide the sample image dataset into a training image set, a verification image set, and a test image set according to a preset data ratio; use the training image set to train a detection framework to obtain a trained detection framework; use the verification image set and the test image set to verify the trained detection framework to obtain a verification result corresponding to the trained detection framework; and when the verification result satisfies a preset verification condition, use the trained detection framework to construct a pretrained defect detection model.
7. The pipeline magnetic flux leakage signal detection system according to claim 6, characterized in that: The image conversion module is further configured to determine a target pixel value corresponding to the signal detection value based on a reference pixel value corresponding to the signal reference value and a product of the reference pixel value and the excess ratio; The target pixel value corresponding to the signal detection value in each of the preset directions is used to determine the grayscale image corresponding to each of the preset directions; and the image to be detected is determined according to the grayscale image corresponding to each of the preset directions.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
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