Magnetic imaging identification method based on deep learning and magnetometer

Through the magnetic imaging recognition method based on deep learning, combined with magnetic gradient tensor and improved R-CNN model, the problem of insufficient accuracy and flexibility of pipeline defect detection in the prior art is solved, and efficient and automated pipeline defect detection is achieved.

CN119762480AActive Publication Date: 2025-04-04WEIZHUO PETROTECH (BEIJING) LTD

Patent Information

Application Number
CN202510237923.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-04-04
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient accuracy in pipeline defect detection, difficulty in data analysis to make full use of magnetic field data, limited real-time processing capabilities, and lack of flexibility and adaptability.

Method used

The magnetic field anomaly information is identified by using a deep learning-based magnetic imaging recognition method, through pre-processing of magnetic field data, calculation of magnetic gradient tensor components and extraction of magnetic field gradient characteristics, and pipeline defect detection is performed using the improved R-CNN model.

Benefits of technology

It significantly improves the accuracy and efficiency of pipeline defect detection, enhances the visualization effect of data, provides richer training data for deep learning models, and realizes the full process automation from data acquisition to defect recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762480A_ABST
    Figure CN119762480A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetic imaging identification method based on deep learning and a magnetometer, and the method comprises the steps: carrying out the preprocessing of collected magnetic field data, and obtaining encrypted and reconstructed magnetic image data; calculating magnetic gradient tensor components based on the encrypted and reconstructed magnetic image data, and extracting magnetic field gradient features by using different combination methods of the magnetic gradient tensor components; magnetic field abnormal information is recognized by analyzing magnetic field gradient features, a magnetic source boundary and encrypted and reconstructed magnetic image data are combined, pseudo-color coding is carried out, and a magnetic image data set is established; the magnetic image data set is used for training an improved R-CNN pipeline defect detection model, the input of the pipeline defect detection model is a magnetic image, and the output of the pipeline defect detection model is the position and type of the pipeline defect; and performing pipeline defect identification on a newly input magnetic image by using the trained pipeline defect detection model. Through an advanced data processing technology and an artificial intelligence algorithm, the precision, efficiency and adaptability of pipeline defect detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of pipeline detection, and in particular to a magnetic imaging recognition method and a magnetometer based on deep learning. Background Art

[0002] At present and for a long time to come, the demand and competition for fossil energy, mainly oil, natural gas and coal, will remain the main theme of social development. Buried pipelines and submarine pipelines are important carriers for transporting oil and natural gas, and are important links in energy transportation and supply. Due to the geological environment, mechanical damage and transport medium load of pipeline laying, which have an impact on pipeline materials day and night, the pipe body is prone to metal loss, corrosion, perforation and other defects. Therefore, regular monitoring of the safety status of oil and gas pipelines and ensuring the safe operation of pipelines are the top priorities of energy transportation and environmental protection.

[0003] There are many methods for detecting various types of safety problems in pipelines, which can be mainly divided into two categories: internal detection and external detection. The traditional internal detection method of oil and gas pipelines is to screen out the pipe sections that may have corrosion, defects and other problems from the measurement data, and investigate the problem areas by combining excavation with other non-destructive testing methods. In-pipeline detection refers to using the conveying medium in the pipe as the power to drive the detector to move in the pipeline, check the pipeline status and record the detection data in real time, and extract and identify the defect information of the pipeline. This form is considered to be an effective way to detect pipeline defects.

[0004] The pipeline internal inspection method can identify and judge many types of pipeline problems. However, before implementing internal inspection on the pipeline, the pipeline structure needs to be modified to meet the working conditions of the internal inspection equipment, and the pipeline to be tested needs to be cleaned multiple times to ensure that the detector can move smoothly and has a high detection accuracy. It can be seen that the preliminary preparation work for pipeline internal inspection is relatively cumbersome. If stress corrosion cracking defects (SCC) exist on the pipeline that cannot be cleaned, it is impossible or inappropriate to use the internal inspection method, and the pipeline operation has additional risks; in addition, due to the influence of pipeline structures such as variable pipe diameters, non-diameter valves, and bend curvature, the internal inspection equipment cannot pass, or the equipment cannot transmit and receive, making it difficult to implement pipeline internal inspection. Therefore, the relevant research on external detection of pipeline defects has important engineering significance in improving the level of pipeline inspection, increasing the service life of pipelines, and ensuring pipeline safety.

[0005] At present, the main trenchless detection technologies used for detection and identification of submarine pipeline defects or corrosion are transient electromagnetic method (TEM) and magnetic tomography method (MTM).

[0006] Although existing trenchless external detection technologies such as transient electromagnetic testing (TEM) and magnetic tomography (MTM) have played an important role in pipeline defect detection, these methods still have some limitations. First, these methods are often not accurate enough when processing data in complex environments, especially in the presence of multiple interference factors. Second, traditional data analysis methods are difficult to fully utilize all the useful information in magnetic field data and may miss some small but important defect features. In addition, the existing technology has limited ability to process large amounts of data in real time and quickly identify defects, which may lead to low detection efficiency in practical applications. Finally, traditional methods lack flexibility and adaptability in dealing with pipeline defects of different types and degrees. In view of these shortcomings, the present invention proposes a magnetic imaging recognition method and a magnetometer based on deep learning, which aims to improve the accuracy, efficiency and adaptability of pipeline defect detection through advanced data processing technology and artificial intelligence algorithms, so as to better meet the needs of modern pipeline detection. Summary of the invention

[0007] In view of this, an embodiment of the present invention provides a magnetic imaging recognition method and a magnetometer based on deep learning to solve the above technical problems.

[0008] To achieve the above objectives, in a first aspect, a magnetic imaging recognition method based on deep learning is provided, which comprises the following steps: S10: preprocessing the collected magnetic field data to obtain encrypted and reconstructed magnetic map data; S20: Based on the encrypted and reconstructed magnetic map data, a magnetic gradient tensor component is calculated, and a magnetic field gradient feature is extracted using different combination methods of the magnetic gradient tensor component; magnetic field anomaly information is identified by analyzing the magnetic field gradient feature, wherein the magnetic field anomaly information indicates a change area of ​​magnetic field intensity or gradient; a magnetic source boundary is extracted from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information; the magnetic field anomaly information indicates a location of a potential pipeline defect, and the location of the potential pipeline defect has a spatial correspondence with the location of the magnetic source boundary; S30: combining the magnetic source boundary with the encrypted and reconstructed magnetic map data, performing pseudo-color coding, and establishing a magnetic image data set; wherein the pseudo-color coding uses different colors to represent changes in magnetic field intensity and magnetic field anomaly information; S40: using the magnetic image data set to train an improved region-based convolutional neural network R-CNN pipeline defect detection model, wherein the input of the pipeline defect detection model is the magnetic image, and the output is the location and type of the pipeline defect; S50: Using the trained pipeline defect detection model to perform pipeline defect recognition on the newly input magnetic image.

[0009] In a second aspect, a magnetometer is provided, comprising: a magnetic gradient tensor sensor array for collecting magnetic field data; the magnetic gradient tensor sensor array comprises a plurality of three-component magnetic sensors for measuring three orthogonal components of a magnetic field; A non-magnetic XY axis slide rail, used for supporting and moving the magnetic gradient tensor sensor array; the non-magnetic XY axis slide rail comprises: The frame constitutes the main structure of the slide; A fixing member for connecting and fixing the parts of the frame; An X-axis sliding mechanism and a Y-axis sliding mechanism are used to realize two-dimensional movement of the magnetic gradient tensor sensor array in a horizontal plane; A control unit, electrically connected to the magnetic gradient tensor sensor array and the non-magnetic XY-axis slide rail, for controlling the movement and data acquisition of the magnetic gradient tensor sensor array; A data processing unit is electrically connected to the magnetic gradient tensor sensor array, and is used to receive and process the collected magnetic field data, and execute the deep learning-based magnetic imaging recognition method described in the first aspect.

[0010] The above technical solution has the following beneficial technical effects: This method significantly improves the accuracy and efficiency of magnetic imaging recognition through a series of innovative steps. First, the preprocessing and encrypted reconstruction of magnetic field data ensure the quality and security of the data. Secondly, by calculating the magnetic gradient tensor components and extracting the magnetic field gradient features, the method can accurately identify magnetic field anomaly information, which is crucial for locating potential pipeline defects. Combining the magnetic source boundary with the magnetic map data and performing pseudo-color encoding not only enhances the visualization of the data, but also provides richer training data for the deep learning model. The use of the improved R-CNN model for pipeline defect detection fully utilizes the latest advances in deep learning in the field of image recognition and significantly improves the accuracy and efficiency of defect detection. The innovation of this method lies in that it combines traditional magnetic field analysis technology with modern deep learning algorithms to provide a new and efficient solution for pipeline defect detection.

[0011] The design of the magnetometer integrates advanced hardware and software technologies to form an efficient and accurate pipeline defect detection system. The design of the magnetic gradient tensor sensor array, especially its cross-shaped or ring-shaped arrangement, greatly improves the accuracy and anti-interference ability of data acquisition. The use of non-magnetic XY-axis slides ensures stability and consistency during data acquisition while minimizing external magnetic interference. The integration of the control unit and the data processing unit enables the entire system to operate automatically, and the entire process from data acquisition to defect identification can be completed efficiently. This integrated design not only improves the practicality and operability of the system, but also makes it suitable for a variety of practical engineering environments. The modular design and scalability of the magnetometer enable it to adapt to different types of detection tasks, such as pipeline and submarine cable detection, which greatly expands its scope of application. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Figure 1 It is the location diagram of the inspection pipeline instruments; Figure 2 This is a schematic diagram of MTM pipeline defect detection; Figure 3 It is a schematic diagram of the magnetic guidance system based on the magnetic gradient tensor; Figure 4 It is a flow chart of the recognition of magnetic anomaly pattern of cable corrosion based on neural network; Figure 5 This is a schematic diagram of cable defect identification based on magnetic imaging; Figure 6 This is a flowchart of a magnetic imaging recognition method based on deep learning in this embodiment. Figure 7 is a cross-shaped magnetic gradient tensor sensor array of this embodiment; Figure 8 is the annular magnetic gradient tensor sensor array of this embodiment; Fig. 9 It is the non-magnetic XY axis slide rail of this embodiment; Fig.10 It is a schematic diagram of the structure of a computer system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0013] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0014] As for the theory of non-contact magnetic memory detection, as early as 1999, the Technical Research and Development Center of the Russian Power Diagnostics Company conducted relevant research on non-contact magnetic detection technology for pipelines. In 2014, Russian scholar Dobov proposed a non-contact magnetic memory detection method that can detect stress concentration areas of pipelines within 3 meters of the buried area, and the engineering application effect is remarkable. Many Russian companies use non-contact magnetic diagnostic technology in the diagnosis of natural gas and oil pipelines. Among them, Energodiagnostics Co., Ltd., LLC RDC "Transkor-K" and CJSC NPC "Molniya" have their own combination of detection and analysis instruments and detection guidance documents approved by the Russian Technical Supervision Agency (Rostekhnadzor). The Pipeline Safety Problem Diagnosis Company used this technology and combined instruments to conduct on-site inspections of hundreds of kilometers of Moscow heat distribution system lines. Moscow Energy Diagnostics Company conducted a non-contact metal magnetic memory detection on a 24-kilometer buried pipeline in Poland, and the measurement signal at the circumferential weld showed an area of ​​uneven magnetic field gradient distribution. Zhao Guoquan and others conducted non-contact magnetic detection and submersible exploration verification on a 40km long pipeline under the Bohai Oilfield, and graded the defects of the detected magnetic anomalies. A large number of engineering applications have proved that this method can effectively detect pipeline defects.

[0015] Non-contact weak magnetic detection is mainly a metal magnetic memory signal detection method for ferromagnetic pipelines that are a certain distance away from the detection instrument (for example: detection of the magnetic field of buried pipelines on the ground, remote detection of the magnetic field of submarine pipelines, etc.). The main magnetic signal characteristics currently used to identify the local stress concentration area and deformation area of ​​the pipeline are: the tangential component of the magnetic field intensity of the leakage magnetic field passes through the zero point; the gradient of the normal component of the magnetic field intensity has a maximum value.

[0016] Liao Kexi et al. used magnetic sensors to measure the three components of magnetic field intensity and gradient modulus of pipelines in non-contact manner along the x direction, and analyzed the gradient change area and extreme value of the actual pipeline detection data. By measuring the pipeline at 360°, the change characteristics of the magnetic field intensity in the stress concentration area of ​​the circumferential weld were analyzed. Li et al. predicted the distribution characteristics of the geomagnetic leakage magnetic field (GMLF) based on the magnetic dipole theoretical model, and conducted non-contact detection experiments on buried pipelines. The results showed that the location of the leakage magnetic field can be determined by the change of the gradient modulus of the magnetic field signal. Jarvis et al. modified Li's GML model, introduced factors such as pipeline materials as model correction factors, and improved the accuracy of model prediction.

[0017] Regarding the magnetic tomography detection theory, in recent years, magnetic tomography detection has been widely used in the safety assessment of underground or underwater, long-distance submarine oil and gas pipelines, thermal and tap water pipelines, etc., due to its advantages such as no need for pretreatment of the pipeline to be detected, simple operation, and low requirements for pipeline structure. The feasibility and effectiveness of the magnetic tomography pipeline detection method have been verified by a large number of industries. Since it was put into commercial application in 2002, it has been successfully applied to the survey of more than 20,000 kilometers of underground and underwater pipelines in more than 10 countries including the Russian Federation, China, the United Kingdom, and the United States, with a detection efficiency and reliability level of no less than 87%.

[0018] SSKamaeva et al. applied magnetic tomography technology to remote detection of non-pigable pipelines on the seabed in the Arctic region. The results showed that the application of this method to detect pipelines can not only remotely identify abnormal areas of metal defects, but also record mechanical stress levels under the consideration of actual loads. Shi Weiguo et al. used a magnetometer to collect magnetic field strength data of buried pipelines on the ground, and an underwater robot carrying a magnetic tomography detection probe to measure the magnetic field signal of underwater pipelines, and detected 15 magnetic anomaly areas of level II and III. Guo Shoushuai et al. used magnetic tomography detection methods to detect multiple oil pipelines in oil production plants. After on-site excavation and comparison and verification of the detection results, the detected defect types were all metal corrosion defects, and the defect locations met the accuracy index requirements. Zhang Shaochun et al. used magnetic tomography detection technology to detect defects in small-diameter buried natural gas pipelines in mountainous areas, identified magnetic anomaly areas through quantitative and qualitative analysis, and verified the engineering effectiveness of this method through on-site excavation. Zhu Hongdong et al. applied magnetic tomography detection technology to the stress concentration area detection of landslide pipelines in mountainous areas, and analyzed the gradient changes of the collected magnetic signals to identify the magnetic anomaly areas of pipelines. Sun Changbao and others from COSL conducted magnetic tomography testing on the high-risk pipeline section of CNOOC Yacheng submarine. The magnetometer detection data was transmitted to the remote control system through the underwater data acquisition unit, and the defect rating of the magnetic anomaly part was carried out, which can effectively detect the high-risk area of ​​the pipeline. The horizontal offset distance between the magnetometer and the pipeline is less than 1.5 times the pipe diameter, and the distance from the ROV to the seabed is controlled at 2~3 m. ASME B31G specification, ASME-MTMCorrelation software (MTMCS 2.0).

[0019] At the same time, domestic and foreign researchers have conducted relevant theoretical and experimental research on magnetic tomography pipeline detection. Liao et al. explored the principle of magnetic tomography detection based on the magnetostrictive effect of metals and pipeline magnetic field stress detection, and analyzed the application scope and technical characteristics of the technology in combination with the measurement process and results, providing a reference for the safety level assessment of pipeline detection. Wan Qiang studied the phenomenological relationship between stress and magnetization intensity, established a force-magnetic coupling model of pipeline stress concentration zone based on the ZL model, and verified the model's effect on the determination of defect location and depth through experiments. Han Ye studied the basic principles of pipeline magnetic detection under trenchless conditions, simulated the buried pipeline environment for on-site detection, and verified the reliability of the technology in a pipeline on-site excavation. Chen Guangming studied the defect level evaluation and analysis algorithm of magnetic tomography detection data. The algorithm can evaluate the maximum allowable operating pressure and remaining life of the pipeline according to the initial conditions and detection conditions of the pipeline, and was verified by excavation in a domestic oil field. The results show that this aspect can detect various types of defects with an accuracy of more than 85%. Based on the inverse magnetostrictive effect, magnetic tomography testing defines the stress characteristics of a pipe section by recording changes in the pipeline magnetic field, but its accuracy is low when detecting pipeline features (such as pitting) with stress levels less than 5% of the specified minimum yield strength (SMYS). Jabbar Mirzoev described the methodology for developing an effective pipeline integrity management plan based on the DCVG / CIPS / MTM survey results of Gazprom pipelines.

[0020] Magnetic tomography pipeline detection signals are weak magnetic field signals, which are easily disturbed by the surrounding ferromagnetic environment, thus affecting the detection effect. In order to reduce the impact of the surrounding magnetic medium on the magnetic tomography pipeline detection results, Zhichao Li et al. from the University of Warwick in the UK evaluated the magnetic field disturbance around the pipeline caused by defects and ferromagnetic objects, designed an anisotropic magnetoresistive (AMR) sensor array to detect defects, reduced the impact of magnetic field interference signals, and gave the relationship between defect detection rate and detection distance.

[0021] like Figure 1 and Figure 2 As shown in the figure, the principle of magnetic tomography (MTM) detection is based on the Villari effect. The pipeline is naturally magnetized by the earth's magnetic field, and the magnetization curve will be distorted in stress concentration areas or corrosion locations. The magnetic tomography detection equipment remotely records the magnetic field from the pipeline while moving along the pipeline route. The staff analyzes the detection data to identify the type, location and direction of the stress concentration area or defect, classify the degree of danger, and evaluate the safety status of the pipeline.

[0022] The requirements of MTM detection technology are as follows: the wall thickness of the metal pipe to be tested must be at least 3mm, the inner diameter must be in the range of 56~1420mm, there is no restriction on the length of the pipe to be tested and the detection environment, and the magnetic field information detection of metal pipes at a depth of 200~300mm below the surface can be realized.

[0023] Pipeline defects are mainly divided into cracks and stress-strain, among which the magnetic memory signal has a nonlinear relationship with the crack depth. As the depth increases, the growth rate of the characteristic value gradually decreases; but it has a linear relationship with the crack width, and the characteristic value increases linearly with the width. The signal is positively correlated with stress: compared with welds, cracks are more sensitive to stress changes.

[0024] The data acquisition system based on magnetic gradient tensor should include a main control unit and peripheral circuits, an AD acquisition unit and two magnetic sensors. The system block diagram is as follows: Figure 3 shown.

[0025] The hardware design of the data acquisition system based on magnetic gradient tensor should ensure the real-time and resolution of each channel of the AD chip, which will greatly affect the accuracy of the magnetic gradient tensor. The power supply unit should be able to provide ±12v voltage and the voltage required by the main control unit. The storage unit is used to store the magnetic data obtained during the operation to facilitate subsequent data processing. The communication unit adopts RS-232 level to improve anti-interference and transmission distance.

[0026] The software of the magnetic guidance system based on magnetic gradient tensor should provide instructions for changing the sampling rate to meet the needs of different tasks. At the same time, the storage unit should support the file system to facilitate the export of data in the PC.

[0027] In addition, the measurement accuracy of the magnetic gradient tensor system is seriously affected by the system error of a single magnetic sensor and the misalignment error between sensor arrays. Therefore, in order to obtain accurate tensor measurement output, it is necessary to establish an integrated mathematical model of system errors such as single magnetic sensor zero drift, scale factor and non-orthogonal angle and misalignment error between multi-sensor axis systems. Specifically, the correction idea of ​​the magnetic gradient tensor system can be divided into two steps: the first step is to correct the system error of a single magnetic sensor; the second step is to correct the misalignment error of the sensor array and the geomagnetic steering difference. Then the meta-heuristic algorithm is used to solve the coefficient matrix in the model to finally complete the system correction.

[0028] Magnetic tomography is a pipeline inspection method based on the theory of metal magnetic memory. Under the action of the geomagnetic field, when the pipeline is subjected to external loads, stress concentration areas will be formed at the corrosion and defects, and magnetic anomalies will be shown in the magnetic memory signal. By analyzing the abnormal parts of the magnetic signal, the location and type of stress concentration area can be judged and determined. This method is a passive detection method that uses the geomagnetic field to naturally magnetize the pipeline. It does not require complicated preparations and artificial excitation before detection. It is easy to operate and can detect stress concentration areas such as damage, welds, and defects within a range of 15 times the inner diameter of the pipe body. If the accuracy of the detection instrument is improved and the interference signal of the surrounding magnetic field is reduced, more types of defects and even the initial formation area of ​​stress concentration can be detected. Compared with other external pipeline detection methods, magnetic tomography can detect more types of defects, is more convenient to apply, and has a broader development space.

[0029] Magnetic tomography (MTM) pipeline external detection is based on the inverse magnetostrictive effect of metal pipelines under the natural magnetization of the geomagnetic field, which makes the magnetic field signal of the stress concentration area abnormal than the magnetic signal of the normal area. The detector is used to measure, process and analyze the magnetic signal at a certain distance outside the pipeline to realize the identification and analysis of the stress concentration area of ​​the pipe fittings. This method makes up for the shortcomings of internal detection to a certain extent and can be used as an important supplementary means for internal pipeline detection. The principle of magnetic tomography detection is based on the Villari effect. The pipeline is "naturally magnetized" by the geomagnetic field, and the magnetization curve will be distorted in the stress concentration area or corrosion position. The magnetic tomography detection equipment remotely records the magnetic field from the pipeline while moving along the pipeline route. The staff analyzes the detection data to identify the type, location and direction of the stress concentration area or defect, classify the degree of danger, and evaluate the safety status of the pipeline.

[0030] The principle of magnetic tomography (MTM) detection is based on the Villari effect. The pipeline is naturally magnetized by the earth's magnetic field, and the magnetization curve will be distorted in stress concentration areas or corrosion locations. The magnetic tomography detection equipment remotely records the magnetic field from the pipeline while moving along the pipeline route. The staff analyzes the detection data to identify the type, location and direction of the stress concentration area or defect, classify the degree of danger, and evaluate the safety status of the pipeline.

[0031] This embodiment provides a magnetic imaging recognition method and a magnetometer based on deep learning.

[0032] Solution 1: Magnetic signal feature recognition based on neural network In order to study the spatial distribution characteristics and transmission laws of the magnetic memory signal in the stress concentration area of ​​the pipeline, it is necessary to perform finite element analysis on the magnetic field spatial distribution model. The finite element analysis method is an approximate solution method for complex mathematical problems based on differential and variational numerical analysis methods. For engineering electromagnetic field problems, the region can be discretized into multiple small units to infinitely approximate the original region. After that, the material parameters of each part are set, and the magnetic field equation of each unit is iteratively obtained according to formulas such as the Laplace equation. Since the leakage magnetic field generated in the stress concentration area and the crack area can be equivalently regarded as the magnetic field generated by magnetic dipoles of different sizes, the finite element simulation current-carrying coil model can be used as the physical model of the magnetic dipole, and the spatial magnetic field distribution characteristics and change trends of the equivalent magnetic field in the stress concentration area can be analyzed in combination with the pipeline.

[0033] After finite element analysis and real data collection, filtering, calculation, extraction and analysis are performed on the characteristic quantities of the magnetic gradient tensor and the data features of the magnetic signal curve of the corrosion site to establish a characteristic data set of the corrosion site of the submarine cable pipeline. The data set is divided into a training set and a test set, and imported into the machine learning model. In recent years, the kernel extreme learning machine has abandoned the original ELM random feature mapping, and further improved the stability and accuracy of the ELM by introducing the kernel function, which has received widespread attention. Before training the data set, the kernel parameters and regularization coefficients need to be initialized and then input into the model for training. And according to the global optimal fitness value updated by the meta-heuristic algorithm, it is judged whether the termination condition is reached, and finally the optimal kernel parameters and regularization coefficients are obtained, so as to realize the target pattern recognition. The specific process is as follows: Figure 4 As shown, Figure 4 This is a flowchart of the neural network-based magnetic anomaly pattern recognition of pipe and cable corrosion in this embodiment.

[0034] Solution 2: Magnetic imaging recognition based on deep learning The magnetic gradient tensor data obtained by magnetic vector calculation contains the spatial position information and differential changes of magnetic targets, which can better suppress noise and have a higher information dimension. Deep learning can mine multiple deep-level features of data, and combined with the magnetic gradient tensor, it can autonomously identify magnetic targets, reduce human intervention, and greatly improve efficiency.

[0035] First, the collected data is filtered and spatial data interpolated to compensate for the sparseness of the measured data and realize the encrypted reconstruction of the magnetic map. Then, different combinations of magnetic gradient tensor components are used to enhance information and extract the magnetic source boundary, including the horizontal gradient method (Total Horizontal Derivative, THDR), the total gradient modulus method (Analytic Signal Magnitude, ASM, this term is sometimes also called "Total Gradient Magnitude" in the field of geophysics), and the Theta method. The preprocessed data is pseudo-color encoded to establish a magnetic image data set, where the image color represents the intensity. Finally, the improved R-CNN network is trained to identify pipeline or cable defects. Figure 5 This is a schematic diagram of cable defect identification based on magnetic imaging. Figure 5 As shown in the figure, this flow describes a process of data processing and image detection: first, starting from the original data, the interpolated data is generated by the Kriging interpolation method. Then the data is edge enhanced. Then the edge-enhanced data is converted into a 640x640 pixel, 3-channel pseudo-color coded image. Finally, the YOLO v5 model with a coordinate attention mechanism is used for detection. This process combines geostatistical methods (Kriging interpolation), image processing techniques (edge ​​enhancement and pseudo-color coding), and advanced deep learning models (YOLO v5) to identify specific targets or features in images in detection tasks.

[0036] Figure 6 FIG. 1 is a flow chart of a magnetic imaging recognition method based on deep learning in this embodiment. Figure 6 As shown, the magnetic imaging recognition method based on deep learning includes the following steps: S10: preprocessing the collected magnetic field data to obtain encrypted and reconstructed magnetic map data; Specifically, the collected magnetic field data is preprocessed and encrypted and reconstructed, which is conducive to improving data quality and ensuring data security. Preprocessing can include operations such as denoising and standardization, while encryption and reconstruction involve secure storage and transmission of data.

[0037] S20: Based on the encrypted and reconstructed magnetic map data, a magnetic gradient tensor component is calculated, and a magnetic field gradient feature is extracted using different combination methods of the magnetic gradient tensor component; magnetic field anomaly information is identified by analyzing the magnetic field gradient feature, wherein the magnetic field anomaly information indicates a change area of ​​magnetic field intensity or gradient; a magnetic source boundary is extracted from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information; the magnetic field anomaly information indicates a location of a potential pipeline defect, and the location of the potential pipeline defect has a spatial correspondence with the location of the magnetic source boundary; Specifically, the magnetic gradient tensor components are calculated based on the reconstructed magnetic map data, which is a key step because the magnetic gradient tensor contains detailed information about the magnetic field changes. The magnetic gradient tensor usually includes multiple components, such as , Etc., where B represents magnetic induction intensity, and x, y, and z represent spatial coordinates. By analyzing different combinations of these components, rich magnetic field gradient features can be extracted to identify magnetic field anomaly information. Magnetic field anomaly information is usually manifested as local changes in magnetic field intensity or gradient, which often correspond to the location of pipeline defects.

[0038] After identifying the magnetic field anomaly information, this method uses this information to extract the magnetic source boundary from the encrypted reconstructed magnetic map data. The magnetic source boundary refers to the edge of the magnetic field anomaly area, which has a spatial correspondence with the potential pipeline defect location. The importance of this step is that it can accurately locate the area where defects may exist.

[0039] S30: combining the magnetic source boundary with the encrypted and reconstructed magnetic map data, performing pseudo-color coding, and establishing a magnetic image data set; wherein the pseudo-color coding uses different colors to represent changes in magnetic field intensity and magnetic field anomaly information; Specifically, pseudo color coding is a visualization technique that uses different colors to represent changes in magnetic field intensity and magnetic field anomaly information. For example, red can be used to represent high-intensity areas, blue to represent low-intensity areas, and yellow or green to mark abnormal areas. This coding method not only enhances the visualization of the data, but also provides richer feature information for subsequent deep learning models.

[0040] S40: using the magnetic image data set to train an improved region-based convolutional neural network R-CNN pipeline defect detection model, wherein the input of the pipeline defect detection model is the magnetic image, and the output is the location and type of the pipeline defect; S50: Using the trained pipeline defect detection model to perform pipeline defect recognition on the newly input magnetic image.

[0041] This method uses an improved R-CNN (Region-based Convolutional Neural Network) model for pipeline defect detection. R-CNN is an advanced target detection algorithm, which is improved in this invention to adapt to the characteristics of magnetic images. The training data set consists of magnetic images generated by the above steps. The input of the model is the magnetic image, and the output is the location and type of pipeline defects. Through training with a large amount of data, the model can learn the complex relationship between magnetic field anomalies and pipeline defects. Finally, the trained model is used to identify defects in new magnetic images, realizing automated and efficient pipeline defect detection.

[0042] The beneficial technical effects of the method of the present invention are mainly reflected in the following aspects: First, through the in-depth analysis and processing of magnetic field data, especially the calculation of magnetic gradient tensor components and the extraction of magnetic field gradient features, the accuracy and sensitivity of defect detection are greatly improved. Secondly, the application of pseudo-color coding technology not only enhances the visualization of data, but also provides richer feature information for deep learning models, which helps to improve the recognition ability of the model. Thirdly, the improved R-CNN model is used for defect detection, which makes full use of the latest progress of deep learning in the field of image recognition and significantly improves the accuracy and efficiency of defect detection. Finally, this method realizes the automation of the entire process from data acquisition to defect identification, greatly reduces manual intervention, improves detection efficiency, and reduces the possibility of human error.

[0043] In some embodiments, step S10 may specifically include the following sub-steps: S11: performing coordinate conversion on the collected magnetic field data, converting the collected coordinate system into a unified geographic coordinate system, and obtaining magnetic field data in the unified geographic coordinate system, which is used as the magnetic field data after coordinate conversion; In this step, magnetic field data collected from different sources or at different times are unified into a standard geographic coordinate system. This is crucial for data integration and subsequent analysis. For example, some data may be collected based on a local coordinate system, while others may use GPS coordinates. By converting all data to a unified geographic coordinate system (such as WGS84), spatial consistency and comparability of all data points can be ensured.

[0044] S12: performing normalization processing on the magnetic field data after the coordinate transformation to obtain normalized magnetic field data; Normalization maps data to a fixed range, usually [0, 1] or [-1, 1]. This step helps eliminate the effects of different measurement units or scales, making data from different sources directly comparable. For example, you can use the min-max normalization method: (x - min(x)) / (max(x) - min(x)), where x is the original data value. Normalized data is convenient for subsequent processing and analysis, especially when applying machine learning algorithms.

[0045] S13: performing detrending processing on the normalized magnetic field data to obtain detrended magnetic field data; Detrending can remove long-term trends or systematic changes in the data and highlight local anomalies or fluctuations. This is particularly important for identifying pipeline defects, as defects often appear as local magnetic field anomalies. Detrending can be achieved through methods such as polynomial fitting or moving average. For example, a quadratic polynomial can be used to fit the overall trend, which can then be subtracted from the original data, and the remaining residual is the detrended data.

[0046] S14: filtering the detrended magnetic field data to obtain filtered magnetic field data; Filtering is used to remove noise from the data and improve signal quality. Depending on the specific situation, different types of filters can be selected, such as low-pass filters, high-pass filters, or band-pass filters. For example, a Butterworth low-pass filter can be used to remove high-frequency noise and retain low-frequency signals. The selection of filtering parameters requires a balance between signal preservation and noise removal to ensure that important defect information is not lost.

[0047] S15: using a Kriging interpolation algorithm or an inverse distance weighted interpolation algorithm to perform spatial data interpolation on the filtered magnetic field data to obtain an interpolation result; Spatial data interpolation is to estimate the value of unknown points between known data points to generate a continuous spatial distribution. Kriging interpolation is a geostatistical method that takes into account spatial autocorrelation and is suitable for irregularly distributed data points. Inverse distance weighted interpolation is based on the inverse relationship of distance, assuming that closer points have greater influence. The choice of which method depends on the characteristics and distribution of the data. For example, for data with obvious spatial structure, Kriging interpolation may be more appropriate.

[0048] S16: Based on the interpolation result, the spatial resolution of the original magnetic field data is improved to obtain encrypted and reconstructed magnetic map data.

[0049] This step uses the interpolation results to increase the density of data points and improve spatial resolution. For example, if the original data is collected on a grid with a spacing of 10 meters, high-resolution grid data with a spacing of 1 meter can be generated through interpolation. This encrypted and reconstructed magnetic map data can not only provide more detailed magnetic field distribution information, but also provide richer input for subsequent image processing and deep learning models. High-resolution data helps to capture small-scale magnetic field changes, thereby improving the accuracy of defect detection.

[0050] In some embodiments, step S16 specifically includes the following sub-steps: S161: Determine the spatial resolution and data point density of the original magnetic field data; S162: Setting the target spatial resolution to be at least twice the original resolution; S163: Based on the target spatial resolution, the number of data points that need to be added is calculated to ensure that the number of data points per unit area is increased by at least 4 times; S164: Using the interpolation result, create new data points between the original data points, where the values ​​of the new data points are calculated according to the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm; S165: adding the newly created data points to the original magnetic field data to form encrypted reconstructed magnetic map data; S166: Verify whether the spatial resolution of the encrypted and reconstructed magnetic map data reaches the expected target. If not, return to step S163 for adjustment; S167: Output the final encrypted and reconstructed magnetic map data.

[0051] In some embodiments, step S20 specifically includes the following sub-steps: S21: Based on the encrypted and reconstructed magnetic map data, a magnetic gradient tensor component is calculated, wherein the magnetic gradient tensor component includes a horizontal gradient, a vertical gradient and a total gradient; wherein the horizontal gradient includes an x-direction gradient and a y-direction gradient, the vertical gradient is a z-direction gradient, and the total gradient is a vector sum of the three directional gradients; S22: extracting magnetic field gradient features by using different combination methods of the magnetic gradient tensor components, the combination methods including horizontal gradient method THDR, total gradient modulus method ASM and Theta method; wherein the horizontal gradient method THDR is used to calculate the amplitude of the horizontal gradient, the total gradient modulus method ASM is used to calculate the modulus of the total gradient in three-dimensional space, and the Theta method is used to calculate the angle between the total gradient and the horizontal gradient; The horizontal gradient method (THDR) is a method for calculating the horizontal gradient amplitude of the magnetic field. This method mainly considers the rate of change of the magnetic field in the horizontal plane, that is, the gradient in the x and y directions. The calculation formula of THDR is: , where T represents the total magnetic field strength, and Represent the partial derivatives of the magnetic field in the x and y directions respectively. This method is particularly suitable for highlighting the edge features of magnetic anomalies and helps to determine the horizontal position and boundary of magnetic bodies.

[0052] The total gradient modulus method (ASM) is a method for calculating the total gradient modulus in three-dimensional space, also known as the analytical signal amplitude method. ASM takes into account the changes in the magnetic field in the x, y and z directions, and its calculation formula is: ,in Represents the partial derivative of the magnetic field in the vertical direction. The main advantage of this method is that it is insensitive to the magnetization direction and can effectively handle complex magnetization situations. The ASM method is particularly suitable for enhancing the edge features of magnetic anomalies, accurately locating the boundaries of magnetic bodies, and detecting deeply buried or weakly magnetic targets.

[0053] Theta method is a method used to calculate the angle between the total gradient and the horizontal gradient, which is usually called the tilt angle. The calculation formula is Theta = arctan( / THDR), where Theta is the vertical gradient and THDR is the horizontal gradient. Theta method combines horizontal and vertical gradient information to provide spatial positioning information of magnetic bodies. This method is particularly helpful in determining the depth and inclination of magnetic bodies and performs well in dealing with complex geological structures and multiple magnetic source superposition.

[0054] S23: identifying magnetic field anomaly information by analyzing the magnetic field gradient feature, wherein the magnetic field anomaly information indicates a change area of ​​magnetic field intensity or gradient; S24: Utilizing the magnetic field anomaly information, extracting the magnetic source boundary from the encrypted and reconstructed magnetic map data.

[0055] In some embodiments, step S23 specifically includes the following sub-steps: S231: setting thresholds corresponding to the horizontal gradient amplitude, the total gradient modulus, and the angle between the total gradient and the horizontal gradient respectively; This step involves setting thresholds for three key magnetic field gradient features. The horizontal gradient amplitude reflects the rate of change of the magnetic field in the horizontal direction, the total gradient modulus represents the overall rate of change of the magnetic field in three-dimensional space, and the angle between the total gradient and the horizontal gradient reflects the spatial direction of the magnetic field change. The setting of thresholds is usually based on empirical values ​​or statistical analysis. For example, the threshold for the horizontal gradient amplitude can be set to the mean plus two standard deviations, the threshold for the total gradient modulus can be 1.5 times the background value, and the angle threshold can be set to 45 degrees. The selection of these thresholds requires a trade-off between detection sensitivity and false alarm rate.

[0056] S232: Mark the magnetic field gradient features that exceed the corresponding threshold as magnetic field anomaly areas; specifically, this step compares the magnetic field gradient features of each data point with the threshold set in step S231. If any feature exceeds its corresponding threshold, the point is marked as a potential magnetic field anomaly area. This process can be achieved by creating a Boolean mask, in which points exceeding the threshold are marked as 1 and other points are marked as 0. For example, if the horizontal gradient amplitude of a point is 10 nT / m and the threshold is set to 8 nT / m, the point will be marked as an anomaly. This method can quickly identify areas where pipeline defects may exist.

[0057] S233: performing cluster analysis on the marked magnetic field anomaly regions to obtain clustered magnetic field anomaly regions; The purpose of cluster analysis is to group spatially adjacent anomalies into larger anomaly areas. This can be achieved using algorithms such as DBSCAN (density-based spatial clustering with applied noise) or K-means. For example, when using the DBSCAN algorithm, the minimum number of points can be set to 5 and the neighborhood radius can be set to 2 meters, so that anomalies with a distance of less than 2 meters and a number of at least 5 can be clustered into one category. Cluster analysis helps to distinguish between large-scale anomalies caused by a single defect and scattered anomalies caused by multiple small defects.

[0058] S234: Determine the range and distribution information of each clustered magnetic field anomaly area; Specifically, this step involves quantitative description of each clustered abnormal area. Range information may include the area, perimeter, center coordinates, etc. of the abnormal area. Distribution information may include shape characteristics (such as the ratio of major axis to minor axis), directionality, density, etc. of the abnormal area. For example, for an elliptical magnetic field anomaly area, the major axis of the abnormal area is 5 meters, the minor axis is 2 meters, and the center coordinates are (X, Y) (longitude, latitude). The main axis direction is 30 degrees north-east. The maximum magnetic field intensity in the area is 500 nanoteslas (nT), and the background magnetic field intensity is 45,000 nanoteslas (nT). The maximum horizontal gradient is 20 nanoteslas / meter (nT / m), which appears at the edge of the ellipse. The area of ​​the abnormal area is about 7.85 square meters. According to the magnetic field characteristics, the possible anomaly source is buried at a depth of about 1.5 meters.

[0059] S235: generating magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly areas; Finally, this step integrates all the information obtained in the previous steps into a comprehensive magnetic field anomaly information report. The magnetic field anomaly information report usually contains several key fields to fully describe the detected anomaly area. These fields include: anomaly ID as a unique identifier; central coordinates (longitude and latitude) indicate the specific location of the anomaly area; area represents the coverage of the anomaly area (in square meters); maximum magnetic field intensity and background magnetic field intensity (both in nanotesla nT) reflect the peak value in the anomaly area and the average magnetic field intensity in the surrounding normal area respectively; maximum horizontal gradient and maximum total gradient (in nanotesla / meter, nT / m) describe the severity of magnetic field changes; gradient direction (in degrees, relative to the north direction) indicates the spatial direction of the main magnetic field changes; anomaly shape description (such as "linear", "circular", "irregular", etc.) provides the geometric characteristics of the anomaly area; finally, estimated burial depth (in meters) infers the possible depth of the anomaly source based on the magnetic field characteristics. This comprehensive information provides pipeline inspection personnel with a detailed overview of magnetic field anomalies, which is helpful for further analysis and decision-making.

[0060] Step S24 may specifically include the following sub-steps: S241: selecting an edge detection algorithm based on the magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly area; Specifically, in step S241, according to the range and distribution information of the magnetic field anomaly area obtained previously, an appropriate edge detection algorithm is selected. For example, if the anomaly area presents a relatively regular shape (such as an ellipse or a circle), the Canny edge detection algorithm can be selected; if the anomaly area has an irregular shape or noise, the Sobel operator or the Laplacian of Gaussian (LoG) algorithm can be considered. When selecting an algorithm, the characteristics of the magnetic field gradient must also be considered to ensure that the boundaries of the magnetic field changes can be accurately captured.

[0061] S242: applying the edge detection algorithm to the magnetic field anomaly region in the encrypted and reconstructed magnetic map data to obtain the magnetic field anomaly region with enhanced edge features; Specifically, in step S242, the selected edge detection algorithm is applied to the encrypted and reconstructed magnetic map data in the previous step. This process will highlight the edge features of the magnetic field anomaly area. For example, if the Canny algorithm is used, it will first perform Gaussian smoothing on the image, then calculate the gradient amplitude and direction, and then perform non-maximum suppression and double threshold detection to finally obtain a clear edge. For magnetic field data, this means that areas where the magnetic field intensity changes sharply can be more clearly identified, which usually corresponds to the boundary of the magnetic source.

[0062] S243: extracting the contour of the magnetic field abnormal region based on the magnetic field abnormal region with enhanced edge features; Specifically, step S243 involves extracting a specific contour from the magnetic field anomaly region with enhanced edge features. This can be achieved through contour tracking algorithms, such as the Moore-Neighbor or Suzuki algorithms. These algorithms move along edge pixels, record continuous edge points, and eventually form a closed contour. For the magnetic field anomaly region, this means that a contour line that accurately describes the shape of the anomaly region can be obtained.

[0063] S244: Optimizing the contour of the abnormal magnetic field region to obtain an optimized contour; Specifically, this step optimizes the extracted contour, which may include smoothing to remove noise and small irregularities, or using polygonal approximation to simplify the contour. For example, the Douglas-Peucker algorithm can be applied to reduce the number of contour points while maintaining the overall shape of the contour. For areas with magnetic field anomalies, this step helps to eliminate contour irregularities caused by measurement errors or environmental interference, and obtain a smoother and more accurate boundary description.

[0064] S245: Determine the optimized contour as the magnetic source boundary.

[0065] Specifically, this step uses the processed contour as the final magnetic source boundary definition. For example, for a buried metal pipeline, this optimized contour may appear as an elongated ellipse, with its major axis direction consistent with the direction of the pipeline. This boundary not only provides a planar projection of the pipeline location, but also may provide a basis for estimating the buried depth and diameter of the pipeline through its shape and size.

[0066] In some embodiments, step S30 specifically includes the following sub-steps: S301: Determine the magnetic field intensity range in the encrypted and reconstructed magnetic map data; Specifically, in step S301, the encrypted and reconstructed magnetic map data is analyzed to determine the minimum and maximum values ​​of the magnetic field strength in the entire data set, thereby obtaining the range of the magnetic field strength. For example, assume that the analysis results show that the magnetic field strength ranges from 20,000 nT to 60,000 nT (nanotelasma). This range information is crucial for subsequent color mapping because it determines how to map the numerical value to the color space.

[0067] S302: Determine a first color mapping scheme for representing a change in magnetic field intensity according to the magnetic field intensity range; Specifically, in step S302, based on the magnetic field intensity range determined in S301, a suitable color mapping scheme is selected to represent the change in magnetic field intensity. For example, a gradient color scheme from blue (representing low intensity) to red (representing high intensity) can be selected. Specifically, 20,000 nT can be mapped to dark blue, 60,000 nT can be mapped to dark red, and the intermediate values ​​can be linearly interpolated to obtain corresponding colors. This mapping scheme can intuitively display the spatial distribution of magnetic field intensity.

[0068] S303: Determine a second color mapping scheme for indicating the degree of magnetic field anomaly according to the magnetic field anomaly information; Specifically, step S303 involves designing another color mapping scheme for the degree of magnetic field anomaly. This scheme uses a color system different from the first scheme so that it can be clearly distinguished in the final image. For example, a grayscale gradient from white (indicating no anomaly) to black (indicating high anomaly) can be used. Alternatively, a gradient from transparent to opaque can be selected, where transparency represents the degree of anomaly. In this way, when superimposed on the base layer, the abnormal area will be more prominent.

[0069] S304: converting the magnetic source boundary into a magnetic source boundary vector layer; Specifically, in step S304, the magnetic source boundary determined in the previous step is converted into a vector format. This can convert a sequence of boundary points into a vector polygon or curve. For example, if the magnetic source is a buried metal pipe, its boundary can be represented as a series of connected straight line segments or Bezier curves to form a closed polygon. This vector format allows the boundary to remain clear at different scales and can be easily scaled and edited.

[0070] S305: Applying the first color mapping scheme to the encrypted and reconstructed magnetic map data to generate a basic pseudo-color magnetic map; Specifically, step S305 applies the color mapping scheme determined in S302 to the encrypted reconstructed magnetic map data to generate a basic pseudo-color magnetic map. For example, using the blue-to-red gradient color scheme mentioned above, low-intensity areas (such as 20,000 nT) will appear blue, high-intensity areas (such as 60,000 nT) will appear red, and intermediate intensities will be displayed as corresponding transition colors. The image generated in this way can intuitively show the magnetic field intensity distribution of the entire area.

[0071] S306: superimposing the second color mapping scheme on the basic pseudo-color magnetic map to obtain a comprehensive pseudo-color magnetic map highlighting the magnetic field anomaly area; Specifically, in step S306, the second color mapping scheme designed in S303 is superimposed on the basic pseudo-color magnetic map generated in S305. If a transparency gradient scheme is used, areas with high abnormalities will be displayed on the basic layer with darker colors or higher opacity. For example, a strong magnetic field anomaly area may appear as a dark gray or black area on a red background, while a slightly abnormal area may appear as light gray. This superposition effect can effectively highlight the magnetic field anomaly area while retaining the basic magnetic field strength information.

[0072] S307: superimposing the magnetic source boundary vector map layer onto the comprehensive pseudo-color magnetic map to form an integrated magnetic map including magnetic field intensity, magnetic field anomaly and magnetic source boundary information; Specifically, step S307 overlays the magnetic source boundary vector map layer created in step S304 onto the integrated pseudo-color magnetic map generated in step S306. For example, a distinct contrasting color (such as bright yellow) can be used to draw the magnetic source boundary line so that it is clearly visible against the background. In this way, the final integrated magnetic map simultaneously contains three key information: magnetic field intensity (represented by the base color), magnetic field anomaly (represented by the superimposed transparency or color), and magnetic source boundary (represented by a clear contour line).

[0073] S308: adding auxiliary information including a legend, a scale and a direction indication to the integrated magnetic map to obtain a complete magnetic map; Specifically, in step S308, necessary auxiliary information is added to the integrated magnetic map to make it a complete and interpretable magnetic map. Specifically, the following elements can be added: a legend, which explains the correspondence between color and magnetic field strength, and the method of expressing the degree of anomaly; a scale, which indicates the relationship between the distance in the image and the actual geographical distance; a direction indicator, which is a north arrow to help determine the direction of the magnetic map; a title and description, which includes key information such as the measurement date and location. The addition of these auxiliary information makes the magnetic map easier to understand and interpret, especially for non-professionals.

[0074] S309: performing standardization processing on the resolution and format of the complete magnetic map, and saving it in a standard format to form a single standardized magnetic image; Specifically, step S309 involves converting the complete magnetic map to a standardized format and resolution. For example, the images can be uniformly converted to a resolution of 300 DPI and saved in a lossless compressed TIFF format. This standardized process ensures that all generated magnetic maps have consistent quality and compatibility. Standardization may also include ensuring that all images have the same size ratio, such as being unified to A3 size. The processed magnetic images are thus convenient for storage, comparison, and subsequent analysis.

[0075] S310: Arrange and annotate the generated multiple standardized magnetic images to obtain a structured magnetic image data set.

[0076] Specifically, this step organizes all generated standardized magnetic images into a structured dataset. This can include creating a metadata file that records key information about each image, such as measurement date, geographic location, equipment used, anomaly characteristics, etc. For example, a CSV file can be created with each row corresponding to a magnetic map, and columns including information such as file name, measurement date, latitude and longitude coordinates, and main anomaly types. This structured organization makes subsequent data retrieval, analysis, and machine learning applications more convenient.

[0077] In some embodiments, step S40 specifically includes the following sub-steps: S401: preparing a training data set, which includes dividing the magnetic image data set into a training set, a validation set, and a test set; S402: annotating the magnetic images in the training set, where the annotated content includes the location and type of the pipeline defect; S403: Design the structure of pipeline defect detection model based on improved R-CNN; S404: Initializing the parameters of the pipeline defect detection model and selecting pre-trained weights; S405: training the pipeline defect detection model using the training set, using the pre-trained weights selected in step S404 during the training process; and also using a predetermined learning rate adjustment strategy and optimizer during the training process; S406: After each training cycle, the performance of the pipeline defect detection model is evaluated using the validation set to obtain performance evaluation results corresponding to multiple performance evaluation indicators, where the multiple performance evaluation indicators include calculation accuracy, recall rate, and average precision; S407: According to the performance evaluation result of the validation set, adjusting the hyper parameters of the pipeline defect detection model, wherein the hyper parameters include a learning rate, a batch size, and a training cycle; S408: Repeat steps S405 to S407 until the performance of the pipeline defect detection model converges or reaches a preset training cycle; S409: Performing a final test on the trained pipeline defect detection model using the test set to obtain performance indicators of the model on unseen data; S410: If the test result does not meet the predetermined standard, take one or more of the following measures: Return to step S403 to adjust the structure of the pipeline defect detection model; Return to step S404 to adjust the initialization parameters of the pipeline defect detection model; Adjusting the training strategy includes: changing the learning rate adjustment strategy or using a different optimizer in step S405; adding or changing the performance evaluation index in step S406; adjusting the range of the hyperparameter in step S407; and then repeating steps S405 to S409; Specifically, changing the learning rate adjustment strategy in step S405 refers to using different methods to dynamically adjust the learning rate during model training. The learning rate is a key hyperparameter that determines the step size of the model parameter update. Learning rate adjustment strategies include step decay, exponential decay, cosine annealing, and cyclic learning rates. For example, you can switch from a fixed learning rate strategy to a step decay strategy to reduce the learning rate by a certain proportion every certain training cycle. Alternatively, you can try using a cosine annealing strategy to change the learning rate periodically during training, which may help the model jump out of the local optimal solution. The purpose of changing the learning rate adjustment strategy is to find a way to change the learning rate that enables the model to converge faster and achieve better performance.

[0078] Specifically, using different optimizers in step S405 means replacing the optimization algorithm used to update the model parameters. Optimizers include stochastic gradient descent (SGD), Adam, RMSprop, AdaGrad, etc. Each optimizer has its own unique characteristics and applicable scenarios. For example, you can switch from the most basic SGD to the Adam optimizer with adaptive learning rate. Adam is usually able to converge faster and is less sensitive to the choice of initial learning rate. Alternatively, you can try using the AdamW optimizer, which is a variant of Adam that adds weight decay to improve the generalization ability of the model. Choosing different optimizers may affect the convergence speed, final performance, and sensitivity to hyperparameters of the model. By trying different optimizers, you can find the optimization method that best suits the current problem and data set, thereby improving the training effect of the model.

[0079] S411: If the test result meets the predetermined standard, confirm that the trained pipeline defect detection model is obtained.

[0080] In some embodiments, the improved R-CNN pipeline defect detection model includes a feature extraction network, a region proposal network, a classification network, and a bounding box regression network; Improved R-CNN (Region-based Convolutional Neural Network) is a deep learning model for object detection, which is improved on the basis of the original R-CNN to improve detection efficiency and accuracy. In the application of pipeline defect detection, this model structure is adjusted to adapt to the characteristics of magnetic images and the characteristics of pipeline defects. The model consists of four main components, each of which has its specific function and role.

[0081] A feature extraction network, used to extract useful feature representations from the input magnetic image; The feature extraction network is the basic part of the model, using a pre-trained convolutional neural network (ResNet, VGG or EfficientNet) as the backbone network. This network receives the original magnetic image as input and extracts the features of the image layer by layer through a series of convolutional layers, pooling layers and activation functions. For pipeline defect detection, the feature extraction network can be fine-tuned to adapt to the special properties of magnetic images. For example, additional convolutional layers can be added to capture subtle changes in magnetic field anomalies, or the size of the convolution kernel can be adjusted to match the scale of typical defects. The output feature map contains rich spatial and semantic information, providing a basis for subsequent detection tasks.

[0082] The region proposal network (RPN) is used to slide the window on the feature map output by the feature extraction network to generate candidate regions that may contain pipeline defects; The region proposal network (RPN) is a key innovation of the improved R-CNN. It slides a small window (3x3) on the feature map and generates multiple anchor boxes with different sizes and aspect ratios for each location. RPN uses two parallel fully connected layers, one for judging whether the anchor box contains the target (in this case, the pipeline defect), and the other for adjusting the position and size of the anchor box. For pipeline defect detection, RPN can adjust the size and scale of the anchor box to match the shape of typical defects. For example, for long and thin cracks, more rectangular anchor boxes may be needed; for corrosion points, more square anchor boxes may be needed. The output of RPN is a series of candidate regions that may contain pipeline defects, which will be fed into subsequent classification and regression networks for further processing.

[0083] A classification network is used to classify the candidate regions generated by the RPN to determine whether the candidate regions contain pipeline defects and the specific defect types; The classification network receives the candidate regions generated by the RPN and classifies each region. In the scenario of pipeline defect detection, the classification network not only needs to distinguish between background and defects, but also needs to identify specific defect types, such as cracks, corrosion, deformation, etc. This is achieved through a series of fully connected layers, and the last layer uses a softmax activation function to output the probability of each category. In order to improve the classification accuracy, an attention mechanism can be introduced in this network to make the model pay more attention to the key features of the defects. For example, for crack detection, a spatial attention module can be designed to make the model pay more attention to linear structures; for corrosion detection, a channel attention mechanism can be used to emphasize specific color or texture features.

[0084] The bounding box regression network is used to adjust the position and size of the candidate region according to the feature map and the initial candidate region to more accurately locate the defect type and position of the pipeline defect.

[0085] The purpose of the bounding box regression network is to fine-tune the candidate regions generated by the RPN so that they more accurately frame the actual defect area. This network shares some layers with the classification network, but in the end it outputs four values, corresponding to the center coordinates (x, y) of the bounding box and the adjustment amounts of the width and height. In pipeline defect detection, the traditional rectangular bounding box may not be accurate enough because the shape of the defect may be very irregular. Therefore, more complex shape representations, such as rotated bounding boxes or polygons, can be considered. For example, for curved cracks, a rotated bounding box can be used to better fit the defect shape; for irregular corrosion areas, a series of point coordinates can be output to define a polygonal outline. This improvement can significantly improve the accuracy of defect location and provide more accurate information for subsequent defect assessment and repair.

[0086] In some embodiments, step S50 specifically includes the following sub-steps: S51: preprocessing the newly input magnetic image to make it meet the input requirements of the pipeline defect detection model; Specifically, in this step, the newly input magnetic field data needs to go through a series of preprocessing operations to ensure that they meet the input specifications of the trained pipeline defect detection model. The preprocessing includes the following aspects: First, coordinate conversion is performed to convert the acquisition coordinate system into a unified geographic coordinate system to obtain magnetic field data in the unified geographic coordinate system. This step ensures that data collected from different sources or at different times can be compared and analyzed in the same coordinate system.

[0087] Secondly, the magnetic field data after coordinate transformation is normalized. Normalization can scale the data to a uniform range, which helps to eliminate the numerical differences caused by different acquisition equipment or environmental conditions and improve the generalization ability of the model.

[0088] Thirdly, the normalized magnetic field data is detrended. This step can remove the long-term trend in the data, highlight the local abnormal changes, and is conducive to the detection of local pipeline defects.

[0089] Then, the detrended magnetic field data is filtered. Filtering can reduce the noise in the data, improve the signal-to-noise ratio, and make potential defect signals more obvious.

[0090] Then, the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm is used to perform spatial data interpolation on the filtered magnetic field data. This step can fill in the gaps in the data collection process and provide a more continuous and complete magnetic field distribution image.

[0091] Finally, based on the interpolation results, the spatial resolution of the original magnetic field data is improved to obtain encrypted and reconstructed magnetic map data. This step can increase the detail information of the data and help detect smaller or finer pipeline defects.

[0092] Through the above preprocessing steps, the original magnetic field data is converted into high-quality, standardized magnetic map data, which is more suitable for input into the pipeline defect detection model for analysis and defect identification.

[0093] S52: inputting the preprocessed magnetic image into a trained pipeline defect detection model; Specifically, this step is to input the preprocessed magnetic image into the previously trained pipeline defect detection model. Specific operations include converting the image data into a format acceptable to the model, such as converting the image into a tensor form, and ensuring that the data type and dimension match the input layer of the model. If batch processing is used to improve efficiency, multiple images may need to be combined into a batch. In addition, if the model supports multi-scale detection, it may be necessary to generate an image pyramid, that is, multiple versions of the same image in different sizes, to detect defects of different sizes.

[0094] S53: Obtaining the output result of the pipeline defect detection model, which includes the predicted pipeline defect location and type; Specifically, after the model processes the input magnetic image, it outputs the prediction results. These results typically contain the following information: the bounding box coordinates of each defect detected (x, y coordinates of the upper left and lower right corners), the prediction of the defect type (crack, corrosion, deformation, etc.), and the confidence score of each prediction. For more complex models, the output may also include the precise outline of the defect (polygon or mask). These raw outputs need to be further parsed and processed, for example, converting the bounding box coordinates from relative coordinates to absolute pixel coordinates on the image, and mapping the category index to the actual defect type name. For each detected defect, the model may output multiple possible categories and their probabilities, and the category with the highest confidence needs to be selected as the final prediction.

[0095] S54: performing post-processing on the output result of the pipeline defect detection model, which includes non-maximum suppression and / or threshold filtering, to obtain a final pipeline defect detection result; Specifically, the post-processing step is conducive to refining the original output of the model and removing redundant and low-confidence detection results. Non-maximum suppression (NMS) is used to solve the problem of multiple detections of the same defect. The working principle of NMS is: for overlapping detection boxes, the one with the highest confidence is retained, and other detection boxes with overlaps above a certain threshold (such as IoU>0.5) are deleted. This is particularly useful when dealing with densely distributed small defects. Threshold filtering removes detection results with confidence lower than a preset value (such as 0.5) to reduce false positives. For pipeline defect detection, the parameters of NMS and threshold filtering can be adjusted according to the characteristics of different types of defects. For example, for cracks that are usually linear, a looser NMS standard is required; while for point-like corrosion, a stricter standard is required. In addition, rule-based post-processing can be introduced, such as merging adjacent small defects, or filtering out impossible defect combinations based on prior knowledge.

[0096] S55: Visualizing and outputting the final pipeline defect detection result, which includes marking the location and type of the detected pipeline defect on the original magnetic image.

[0097] Specifically, the last step is to present the processed detection results in an intuitive way. This involves drawing annotations on the original magnetic image. Specifically, rectangular boxes of different colors can be used to represent different types of defects, and the thickness of the box can be used to indicate the confidence of the detection. Next to each detection box, a text label can be added to display the defect type and confidence score. For more precise defect outlines, polygons or contour lines can be used to depict them. To enhance readability, semi-transparent color fills can be used to highlight defective areas. In addition, legends can be added to the image to explain the meaning of different colors and markers. For large-sized pipeline images, an interactive visualization interface can be implemented, allowing users to zoom in on specific areas to view detailed information. Finally, a detailed report can be generated containing statistical information on the location, type, size, and severity of each detected defect, as well as an assessment of the overall pipeline health status.

[0098] Figure 7 The cross-shaped magnetic gradient tensor sensor array of this embodiment, the magnetic tomography detection MTM system is designed as follows, the sensor adopts a cross-shaped geomagnetic three-component sensor array, so as to obtain magnetic gradient tensor data. The magnetic gradient tensor, that is, the second-order derivative of the total magnetic field intensity, can reflect the change of the magnetic anomaly boundary. Compared with the three-component magnetic sensor arrangement methods such as triangle and regular tetrahedron, the cross shape has the characteristics of higher accuracy and stronger anti-interference.

[0099] Figure 8This is the annular magnetic gradient tensor sensor array of this embodiment. In order to better fit the pipeline and submarine cable to be inspected and thus identify subtle defects, three-component magnetic sensors can also be arranged in an annular manner to construct a magnetic gradient tensor array. Figure 7 The cylinder below is a simulated pipe, and the black rectangle is a three-component magnetic sensor.

[0100] Fig. 9 It is the non-magnetic XY axis slide rail of this embodiment. Regardless of which of the above arrays is used to collect data, the electromagnetic characteristics of the submarine cable must be measured first, and the test should be kept at the same height level as much as possible. Therefore, it is planned to build a non-magnetic slide rail test platform, in which the structural parts are made of aluminum alloy frame, and the fixing parts such as bolts are made of copper to ensure that the non-magnetic slide rail test platform minimizes the magnetic interference of the test piece. Finally, the XY axis is scanned at a fixed height to collect data.

[0101] This embodiment also provides a magnetometer, which includes: A magnetic gradient tensor sensor array, used to collect magnetic field data; the magnetic gradient tensor sensor array includes a plurality of three-component magnetic sensors, used to measure three orthogonal components of the magnetic field; A non-magnetic XY axis slide rail, used for supporting and moving the magnetic gradient tensor sensor array; the non-magnetic XY axis slide rail comprises: The frame constitutes the main structure of the slide; A fixing member for connecting and fixing the parts of the frame; An X-axis sliding mechanism and a Y-axis sliding mechanism are used to realize two-dimensional movement of the magnetic gradient tensor sensor array in a horizontal plane; A control unit, electrically connected to the magnetic gradient tensor sensor array and the non-magnetic XY-axis slide rail, for controlling the movement and data acquisition of the magnetic gradient tensor sensor array; A data processing unit is electrically connected to the magnetic gradient tensor sensor array, and is used to receive and process the collected magnetic field data and execute the magnetic imaging recognition method based on deep learning.

[0102] In some embodiments, the magnetic gradient tensor sensor array is a cross array or a ring array. This design can provide more comprehensive magnetic field gradient measurements. The cross array can simultaneously measure magnetic field gradients in two orthogonal directions, providing richer spatial information. The ring array can perform 360-degree all-round measurements around the pipeline or submarine cable to ensure that defect information at any angle is not missed. Both configurations can significantly improve the accuracy and comprehensiveness of detection, allowing the system to capture defects of various directions and types, thereby improving the reliability of detection.

[0103] In some embodiments, when the magnetic gradient tensor sensor array is an annular array, its shape is adapted to the shape of the pipeline or submarine cable to be detected. This design takes into account the needs of actual application scenarios. By matching the shape of the array with the shape of the object to be detected, it is possible to ensure that the sensor maintains an optimal distance and angle with the detected surface, thereby obtaining the best signal quality. For example, for a large-diameter pipeline, a larger annular array can be used, while for a small-diameter submarine cable, a smaller annular array can be used. This adaptability design not only improves the detection accuracy, but also enhances the versatility of the system, enabling it to adapt to detection objects of different sizes and shapes.

[0104] In some embodiments, the non-magnetic XY-axis slide also includes a height adjustment mechanism for adjusting the height of the magnetic gradient tensor sensor array relative to the object to be measured. This function greatly enhances the flexibility and adaptability of the system. The height adjustment mechanism allows the operator to accurately adjust the distance between the sensor array and the surface to be detected according to different detection objects and environmental conditions. This is crucial for optimizing signal strength and spatial resolution. For example, for pipes with uneven surfaces, the height can be adjusted to maintain a consistent distance between the sensor and the pipe surface to ensure the consistency of the measurement data. In addition, height adjustment can also help avoid accidental contact between the sensor and the detection object and protect the safety of the equipment.

[0105] In some embodiments, the magnetometer further includes a display unit for displaying magnetic images and test results. This design greatly improves the practicality and user-friendliness of the system. The display unit can display the magnetic field distribution image and defect detection results in real time, so that the operator can intuitively understand the detection process and results. This not only helps to quickly identify potential problem areas, but also helps the operator adjust the detection strategy based on real-time feedback. For example, if an abnormal signal is found in a certain area, the operator can immediately decide whether a more detailed scan or other measures are needed. In addition, the display unit can also be used to display advanced functions such as historical data comparison and trend analysis, providing strong support for long-term monitoring and maintenance.

[0106] In some embodiments, the frame includes an aluminum alloy frame, and the fixing includes a copper fixing. This material selection fully considers the special requirements of magnetic field detection. The aluminum alloy frame is lightweight, high-strength, and corrosion-resistant, and is very suitable as a structural material for portable devices. More importantly, aluminum alloy is a non-magnetic material that will not interfere with magnetic field measurement, ensuring the accuracy of the measurement results. The copper fixing is also non-magnetic and has good electrical conductivity and heat dissipation. These properties enable the copper fixing to effectively reduce electromagnetic interference and help maintain a stable operating temperature of the sensor, thereby improving the accuracy and reliability of the measurement. This material combination not only optimizes the performance of the device, but also extends its service life, and is particularly suitable for long-term and stable magnetic field detection work in various harsh environments.

[0107] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any one of the above methods is implemented.

[0108] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. Of course, there are other forms of readable storage media, such as quantum memory, graphene memory, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.

[0109] The present invention also provides an electronic device. The electronic device of an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the present invention.

[0110] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 800 of an electronic device suitable for implementing an embodiment of the present invention. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0111] like Fig.10 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the computer system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0112] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0113] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit 801, the above functions defined in the system of the present invention are executed.

[0114] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, and the names of these units do not constitute limitations on the units themselves in some cases.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A magnetic imaging recognition method based on deep learning, characterized in that: The following steps are involved: S10: preprocessing the collected magnetic field data to obtain encrypted and reconstructed magnetic map data; S20: Based on the encrypted and reconstructed magnetic map data, a magnetic gradient tensor component is calculated, and a magnetic field gradient feature is extracted using different combination methods of the magnetic gradient tensor component; magnetic field anomaly information is identified by analyzing the magnetic field gradient feature, wherein the magnetic field anomaly information indicates a change area of ​​magnetic field intensity or gradient; a magnetic source boundary is extracted from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information; the magnetic field anomaly information indicates a location of a potential pipeline defect, and the location of the potential pipeline defect has a spatial correspondence with the location of the magnetic source boundary; S30: combining the magnetic source boundary with the encrypted and reconstructed magnetic map data, performing pseudo-color coding, and establishing a magnetic image data set; wherein the pseudo-color coding uses different colors to represent changes in magnetic field intensity and magnetic field anomaly information; S40: using the magnetic image data set to train an improved region-based convolutional neural network R-CNN pipeline defect detection model, wherein the input of the pipeline defect detection model is the magnetic image, and the output is the location and type of the pipeline defect; S50: Using the trained pipeline defect detection model to perform pipeline defect recognition on the newly input magnetic image.

2. The method according to claim 1, characterized in that Step S10 specifically includes the following sub-steps: S11: performing coordinate conversion on the collected magnetic field data, converting the collected coordinate system into a unified geographic coordinate system, and obtaining magnetic field data in the unified geographic coordinate system as the magnetic field data after coordinate conversion; S12: performing normalization processing on the magnetic field data after the coordinate transformation to obtain normalized magnetic field data; S13: performing detrending processing on the normalized magnetic field data to obtain detrended magnetic field data; S14: filtering the detrended magnetic field data to obtain filtered magnetic field data; S15: using a Kriging interpolation algorithm or an inverse distance weighted interpolation algorithm to perform spatial data interpolation on the filtered magnetic field data to obtain an interpolation result; S16: Based on the interpolation result, the spatial resolution of the original magnetic field data is improved to obtain encrypted and reconstructed magnetic map data.

3. The method according to claim 2, characterized in that Step S16 specifically includes the following sub-steps: S161: Determine the spatial resolution and data point density of the original magnetic field data; S162: Setting the target spatial resolution to be at least twice the original resolution; S163: Based on the target spatial resolution, the number of data points that need to be added is calculated to ensure that the number of data points per unit area is increased by at least 4 times; S164: Using the interpolation result, create new data points between the original data points, where the values ​​of the new data points are calculated according to the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm; S165: adding the newly created data points to the original magnetic field data to form encrypted reconstructed magnetic map data; S166: Verify whether the spatial resolution of the encrypted and reconstructed magnetic map data reaches the expected target. If not, return to step S163 for adjustment; S167: Output the final encrypted and reconstructed magnetic map data.

4. The method according to claim 1, characterized in that: Step S20 specifically includes the following sub-steps: S21: Based on the encrypted and reconstructed magnetic map data, a magnetic gradient tensor component is calculated, wherein the magnetic gradient tensor component includes a horizontal gradient, a vertical gradient and a total gradient; wherein the horizontal gradient includes an x-direction gradient and a y-direction gradient, the vertical gradient is a z-direction gradient, and the total gradient is a vector sum of the three directional gradients; S22: extracting magnetic field gradient features by using different combination methods of the magnetic gradient tensor components, the combination methods including horizontal gradient method THDR, total gradient modulus method ASM and Theta method; wherein the horizontal gradient method THDR is used to calculate the amplitude of the horizontal gradient, the total gradient modulus method ASM is used to calculate the modulus of the total gradient in three-dimensional space, and the Theta method is used to calculate the angle between the total gradient and the horizontal gradient; S23: identifying magnetic field anomaly information by analyzing the magnetic field gradient feature, wherein the magnetic field anomaly information indicates a change area of ​​magnetic field intensity or gradient; S24: Utilizing the magnetic field anomaly information, extracting the magnetic source boundary from the encrypted and reconstructed magnetic map data.

5. The method according to claim 4, characterized in that Step S23 specifically includes the following sub-steps: S231: setting thresholds corresponding to the horizontal gradient amplitude, the total gradient modulus, and the angle between the total gradient and the horizontal gradient respectively; S232: marking the magnetic field gradient features exceeding the corresponding threshold as magnetic field anomaly areas; S233: performing cluster analysis on the marked magnetic field anomaly regions to obtain clustered magnetic field anomaly regions; S234: Determine the range and distribution information of each clustered magnetic field anomaly area; S235: generating magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly areas; Step S24 specifically includes the following sub-steps: S241: selecting an edge detection algorithm based on the magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly area; S242: applying the edge detection algorithm to the magnetic field anomaly region in the encrypted and reconstructed magnetic map data to obtain the magnetic field anomaly region with enhanced edge features; S243: extracting the contour of the magnetic field abnormal region based on the magnetic field abnormal region with enhanced edge features; S244: Optimizing the contour of the abnormal magnetic field region to obtain an optimized contour; S245: Determine the optimized contour as the magnetic source boundary.

6. The method according to claim 1, characterized in that Step S30 specifically includes the following sub-steps: S301: Determine the magnetic field intensity range in the encrypted and reconstructed magnetic map data; S302: Determine a first color mapping scheme for representing a change in magnetic field intensity according to the magnetic field intensity range; S303: Determine a second color mapping scheme for indicating the degree of magnetic field anomaly according to the magnetic field anomaly information; S304: converting the magnetic source boundary into a magnetic source boundary vector layer; S305: Applying the first color mapping scheme to the encrypted and reconstructed magnetic map data to generate a basic pseudo-color magnetic map; S306: superimposing the second color mapping scheme on the basic pseudo-color magnetic map to obtain a comprehensive pseudo-color magnetic map highlighting the magnetic field anomaly area; S307: superimposing the magnetic source boundary vector map layer onto the comprehensive pseudo-color magnetic map to form an integrated magnetic map including magnetic field intensity, magnetic field anomaly and magnetic source boundary information; S308: adding auxiliary information including a legend, a scale and a direction indication to the integrated magnetic map to obtain a complete magnetic map; S309: performing standardization processing on the resolution and format of the complete magnetic map, and saving it in a standard format to form a single standardized magnetic image; S310: Arrange and annotate the generated multiple standardized magnetic images to obtain a structured magnetic image data set.

7. The method according to claim 1, characterized in that Step S40 specifically includes the following sub-steps: S401: preparing a training data set, which includes dividing the magnetic image data set into a training set, a validation set, and a test set; S402: annotating the magnetic images in the training set, where the annotated content includes the location and type of the pipeline defect; S403: Design the structure of pipeline defect detection model based on improved R-CNN; S404: Initializing the parameters of the pipeline defect detection model and selecting pre-trained weights; S405: training the pipeline defect detection model using the training set, and using the pre-trained weights selected in step S404 during the training process; A predetermined learning rate adjustment strategy and optimizer are also used during the training process; S406: After each training cycle, the performance of the pipeline defect detection model is evaluated using the validation set to obtain performance evaluation results corresponding to multiple performance evaluation indicators, where the multiple performance evaluation indicators include calculation accuracy, recall rate, and average precision; S407: According to the performance evaluation result of the validation set, adjusting the hyper parameters of the pipeline defect detection model, wherein the hyper parameters include a learning rate, a batch size, and a training cycle; S408: Repeat steps S405 to S407 until the performance of the pipeline defect detection model converges or reaches a preset training cycle; S409: Performing a final test on the trained pipeline defect detection model using the test set to obtain performance indicators of the model on unseen data; S410: If the test result does not meet the predetermined standard, take one or more of the following measures: Return to step S403 to adjust the structure of the pipeline defect detection model; Return to step S404 to adjust the initialization parameters of the pipeline defect detection model; Adjusting the training strategy, which includes: changing the learning rate adjustment strategy or using a different optimizer in step S405; In step S406, the performance evaluation index is added or changed; in step S407, the range of the hyperparameter is adjusted; and then steps S405 to S409 are repeated; S411: If the test result meets the predetermined standard, confirm that the trained pipeline defect detection model is obtained.

8. The method according to claim 7, characterized in that The improved R-CNN pipeline defect detection model includes a feature extraction network, a region proposal network, a classification network and a bounding box regression network; A feature extraction network, used to extract useful feature representations from the input magnetic image; The region proposal network (RPN) is used to slide the window on the feature map output by the feature extraction network to generate candidate regions that may contain pipeline defects; A classification network is used to classify the candidate regions generated by the RPN to determine whether the candidate regions contain pipeline defects and the specific defect types; The bounding box regression network is used to adjust the position and size of the candidate region according to the feature map and the initial candidate region to more accurately locate the defect type and position of the pipeline defect.

9. The method according to claim 7, characterized in that: Step S50 specifically includes the following sub-steps: S51: preprocessing the newly input magnetic image to make it meet the input requirements of the pipeline defect detection model; S52: inputting the preprocessed magnetic image into a trained pipeline defect detection model; S53: Obtaining the output result of the pipeline defect detection model, which includes the predicted pipeline defect location and type; S54: performing post-processing on the output result of the pipeline defect detection model, which includes non-maximum suppression and / or threshold filtering, to obtain a final pipeline defect detection result; S55: Visualizing and outputting the final pipeline defect detection result, which includes marking the location and type of the detected pipeline defect on the original magnetic image.

10. A magnetometer, characterized in that: include: A magnetic gradient tensor sensor array for collecting magnetic field data; The magnetic gradient tensor sensor array includes a plurality of three-component magnetic sensors for measuring three orthogonal components of a magnetic field; A non-magnetic XY-axis slide rail for supporting and moving the magnetic gradient tensor sensor array; The non-magnetic XY axis slide rail comprises: The frame constitutes the main structure of the slide; A fixing member for connecting and fixing the parts of the frame; An X-axis sliding mechanism and a Y-axis sliding mechanism are used to realize two-dimensional movement of the magnetic gradient tensor sensor array in a horizontal plane; A control unit, electrically connected to the magnetic gradient tensor sensor array and the non-magnetic XY-axis slide rail, for controlling the movement and data acquisition of the magnetic gradient tensor sensor array; A data processing unit is electrically connected to the magnetic gradient tensor sensor array, and is used to receive and process the collected magnetic field data, and execute the deep learning-based magnetic imaging recognition method described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Magnetic detection system and method for magnetic nano material

    CN113687282A

  • Pipeline magnetic flux leakage internal detection defect identification method based on weak supervised learning

    CN116012317A

  • Pipeline defect identifying and positioning method based on target detection and weak magnetic detection

    CN117420196A

  • Intelligent analysis system for magnetic flux leakage detection data in pipeline

    WO2020133639A1

  • Weld seam internal defect intelligent detection device and method, and medium

    WO2022053001A1

Cited By

  • Magnetic ring detection device and detection method

    CN120314845A

  • Equipment and method for detecting content and orientation of steel fibers in steel fiber reinforced concrete

    CN120334341A

  • Method for acquiring accurate aviation magnetic measurement data based on total horizontal gradient method

    CN120447079A

  • Workpiece defect detection method based on target detection model and related device

    CN120451051A

  • Method for evaluating surface flatness of autoclaved aerated concrete plate

    CN120747042A