A magnetic imaging recognition method and magnetometer based on deep learning
Through deep learning processing of magnetic field data and improved R-CNN model, the accuracy and efficiency problems of pipeline defect detection in the prior art are solved, and efficient and automated pipeline defect recognition is achieved.
Patent Information
- Application Number
- CN202510237923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-03-03
AI Technical Summary
The existing non-excavation external detection technology lacks data accuracy in processing complex environments, makes it difficult to make full use of all useful information in magnetic field data, and has limited ability to process large amounts of data in real time and quickly identify defects, and lacks flexibility and adaptability.
The magnetic imaging recognition method based on deep learning is adopted, and the magnetic field data is preprocessed and encrypted and reconstructed, the magnetic gradient tensor components are calculated, the magnetic field gradient characteristics are extracted, and the magnetic image data set is established in combination with pseudo-color encoding, and the pipeline defect detection is used using the improved R-CNN model.
It significantly improves the accuracy and efficiency of pipeline defect detection, realizes full process automation, enhances data visualization effect, and improves detection flexibility and adaptability.
Smart Images

Figure CN119762480B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field, 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 for and competition of fossil energy mainly composed of oil, natural gas, and coal among countries remain the main theme of social development. Buried pipelines, submarine pipelines, etc. are important carriers for transporting oil and natural gas and are important links for energy transportation and maintaining supply. Due to the day-and-night influence of the geological environment of pipeline laying, mechanical damage, and load of transportation media on pipeline materials, the pipe body is prone to defects such as metal loss, corrosion, and perforation. Therefore, regularly monitoring 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 various methods for detecting various types of safety problems of pipelines, which can be mainly divided into two categories: internal detection and external detection. The traditional internal detection method for oil and gas pipelines is to screen out pipe sections that may have problems such as corrosion and defects from the measurement data, and conduct investigations on the problem areas by combining excavation and other non-destructive testing methods. Pipeline internal detection refers to driving a detector to travel inside the pipeline with the medium transported inside the pipe as the power, real-time checking the pipeline status and recording the detection data, and extracting and identifying the defect information of the pipeline. This form is considered an effective way for pipeline defect detection.
[0004] The pipeline internal detection method can identify and evaluate various types of pipeline problems. However, before implementing internal detection on the pipeline, it is necessary to transform the pipeline structure to meet the working conditions of the internal detection equipment, and it is also necessary to clean the pipeline to be tested multiple times to ensure that the detector can travel smoothly and has high detection accuracy. It can be seen that the preliminary preparation work for pipeline internal detection is rather cumbersome. If there are stress corrosion cracking defects (SCC) on non-pigable pipelines, it is impossible or not suitable to use the internal detection method, and the pipeline operation has additional risks; in addition, due to the influence of pipeline structures such as variable pipe diameters, non-full-bore valves, and elbow curvatures, the internal detection equipment cannot pass, or the equipment cannot transmit and receive, making it difficult to implement pipeline internal detection. Therefore, the research on pipeline defect external detection has important engineering significance in aspects such as improving the pipeline detection level, extending the in-service life of pipelines, and ensuring pipeline safety.
[0005] At present, the non-excavation external detection technologies used for detecting and identifying defects or corrosion of submarine pipelines mainly include the transient electromagnetic detection method (TEM) and the magnetic tomography method (MTM).
[0006] Although existing non-excavation external detection techniques such as transient electromagnetic detection method (TEM) and magnetic tomography imaging detection method (MTM) have played an important role in pipeline defect detection, these methods still have some limitations. First, these methods often lack accuracy when dealing with 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 in real-time processing of large amounts of data and rapid identification of defects, which may lead to low detection efficiency in practical applications. Finally, traditional methods lack flexibility and adaptability when dealing with different types and degrees of pipeline defects. In view of these deficiencies, the present invention proposes a magnetic imaging recognition method and a magnetometer based on deep learning, aiming to improve the accuracy, efficiency and adaptability of pipeline defect detection through advanced data processing techniques 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 object, in a first aspect, a magnetic imaging recognition method based on deep learning is provided, which includes the following steps:
[0009] S10: Preprocess the collected magnetic field data to obtain encrypted and reconstructed magnetic map data;
[0010] S20: Based on the encrypted and reconstructed magnetic map data, calculate the components of the magnetic gradient tensor, and extract magnetic field gradient features by using different combination methods of the magnetic gradient tensor components; identify magnetic field anomaly information by analyzing the magnetic field gradient features, where the magnetic field anomaly information represents the change region of the magnetic field intensity or gradient; extract the magnetic source boundary from the encrypted and reconstructed magnetic map data by using the magnetic field anomaly information; the position of the magnetic field anomaly information indicates the position of potential pipeline defects, and the position of the potential pipeline defects has a spatial correspondence relationship with the position of the magnetic source boundary;
[0011] S30: Combine the magnetic source boundary with the encrypted and reconstructed magnetic map data, perform pseudo-color coding, and establish a magnetic image data set; wherein, the pseudo-color coding uses different colors to represent the changes in the magnetic field intensity and the magnetic field anomaly information;
[0012] S40: Use the magnetic image data set to train an improved region-based convolutional neural network R-CNN pipeline defect detection model, where the input of the pipeline defect detection model is a magnetic image, and the output is the position and type of pipeline defects;
[0013] S50: Use the trained pipeline defect detection model to identify pipeline defects in newly input magnetic images.
[0014] In a second aspect, a magnetometer is provided, which includes:
[0015] 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 the magnetic field;
[0016] A non-magnetic XY-axis slide rail for supporting and moving the magnetic gradient tensor sensor array; the non-magnetic XY-axis slide rail includes:
[0017] A frame that constitutes the main structure of the slide rail;
[0018] Fixing parts for connecting and fixing each part of the frame;
[0019] An X-axis sliding mechanism and a Y-axis sliding mechanism for realizing two-dimensional movement of the magnetic gradient tensor sensor array in the horizontal plane;
[0020] 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 collection of the magnetic gradient tensor sensor array;
[0021] A data processing unit electrically connected to the magnetic gradient tensor sensor array for receiving and processing the collected magnetic field data and performing the magnetic imaging recognition method based on deep learning described in the first aspect.
[0022] The above technical solution has the following beneficial technical effects:
[0023] 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. Second, by calculating the magnetic gradient tensor components and extracting 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 coding not only enhances the visualization effect of the data but also provides richer training data for the deep learning model. Using the improved R-CNN model for pipeline defect detection 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. The innovation of this method lies in its combination of traditional magnetic field analysis techniques with modern deep learning algorithms, providing a new and efficient solution for pipeline defect detection.
[0024] The design of this magnetometer integrates advanced hardware and software technologies, forming an efficient and accurate pipeline defect detection system. The design of the magnetic gradient tensor sensor array, especially its cross-shaped or annular arrangement, greatly improves the accuracy of data acquisition and the anti-interference ability. The use of a non-magnetic XY-axis slide rail ensures the 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 whole process from data acquisition to defect identification can be efficiently completed. This integrated design not only improves the practicality and operability of the system, but also makes it applicable to various actual engineering environments. The modular design and scalability of the magnetometer enable it to adapt to different types of detection tasks, such as the detection of pipelines and submarine cables, which greatly expands its application scope. Description of the Drawings
[0025] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:
[0026] Figure 1 is the position diagram of the pipeline detection instrument;
[0027] Figure 2 is the schematic diagram of MTM pipeline defect detection;
[0028] Figure 3 is the schematic diagram of the magnetic guidance system based on the magnetic gradient tensor;
[0029] Figure 4 is the flow chart of the magnetic anomaly pattern recognition of cable corrosion based on the neural network;
[0030] Figure 5 is the schematic diagram of cable defect identification based on magnetic imaging;
[0031] Figure 6 is the flow chart of a magnetic imaging recognition method based on deep learning in this embodiment
[0032] Figure 7 is the cross-shaped magnetic gradient tensor sensor array of this embodiment;
[0033] Figure 8 is the annular magnetic gradient tensor sensor array of this embodiment;
[0034] Figure 9 is the non-magnetic XY-axis slide rail of this embodiment;
[0035] Figure 10 is the schematic diagram of the structure of the computer system of the embodiment of the present invention. Detailed Embodiment
[0036] The following describes exemplary embodiments of the present invention in conjunction with the accompanying drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, descriptions of well-known functions and structures are omitted in the following description for clarity and conciseness.
[0037] Regarding the non-contact magnetic memory detection theory, as early as 1999, the Technical Research and Development Center of the Russian Power Diagnosis Company carried out relevant research on pipeline non-contact magnetic detection technology. In 2014, Russian scholar Dobov proposed a non-contact magnetic memory detection method that can detect stress concentration areas of pipelines within a range of up to 3 meters underground, and the engineering application effect is remarkable. Many Russian companies have used non-contact magnetic force diagnosis technology in the process of diagnosing natural gas and oil pipelines. Among them, Energodiagnostics Limited, LLC RDC "Transkor-K", and CJSC NPC "Molniya" have their own sets of detection and analysis instruments and detection guidance documents approved by the Russian Technical Supervision Agency (Rostekhnadzor). Pipeline safety problem diagnosis companies have used this technology and combined instruments to conduct on-site inspections on hundreds of kilometers of the Moscow heat distribution system lines. Moscow Energy Diagnosis Company carried out non-contact metal magnetic memory detection on 24 kilometers of buried pipelines in Poland, and measured uneven magnetic field gradient distribution areas of signals at the girth welds. Zhao Guoquan et al. carried out non-contact magnetic force detection and diving exploration verification on a 40-kilometer-long submarine pipeline in the Bohai Oilfield, and classified the defects of the detected magnetic anomaly sites. A large number of engineering applications have proved that this method can effectively detect pipeline defects.
[0038] Non-contact weak magnetic detection mainly conducts metal magnetic memory signal detection on ferromagnetic pipelines at a certain distance from the detection instrument (for example: detecting 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 local stress concentration areas and deformation areas of pipelines are: the zero-crossing of the tangential component of the magnetic field intensity of the leakage magnetic field; the maximum value of the gradient of the normal component of the magnetic field intensity.
[0039] Liao Kexi et al. used magnetic sensors to non - contact measure the three - component magnetic field intensity and gradient modulus along the x - direction of the pipeline, analyzed the gradient change region and extreme value of the actual pipeline detection data, and analyzed the variation characteristics of the magnetic field intensity in the stress - concentration area of the girth weld by measuring the pipeline at 360°. Li et al. predicted the distribution characteristics of the geomagnetic leakage magnetic field (GMLF) based on the magnetic dipole theory model and conducted non - contact detection experiments on buried pipelines. The results showed that the leakage magnetic field position could be identified 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.
[0040] Regarding the theory of magnetic tomography detection, in recent years, magnetic tomography detection has been widely applied to the safety assessment of pipelines such as underground or underwater, long - distance oil and gas pipelines, thermal and water supply pipe networks, etc. due to its advantages of not requiring 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 industrial applications. Since it was put into commercial use 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 such as the Russian Federation, China, the United Kingdom, and the United States. The detection efficiency and reliability level are not less than 87%.
[0041] S.S. Kamaeva et al. applied magnetic tomography technology to the remote detection of unpiggable pipelines on the seabed in the Arctic region. The results showed that applying this method to detect pipelines could not only remotely identify abnormal areas of metal defects but also record the mechanical stress level considering the actual load. Shi Weiguo et al. collected magnetic field intensity data of buried pipelines on the ground with magnetometers respectively, and an underwater robot carrying a magnetic tomography detection probe measured the magnetic field signals of underwater pipelines, detecting 15 magnetic anomaly areas of grade II and III. Guo Shoufuai et al. used magnetic tomography detection method to detect multiple oil pipelines in an oil production plant. After comparing and verifying with the results of on-site excavation, the detected defect types were all metal corrosion and loss, and the defect positions 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. The magnetic anomaly areas were identified through quantitative and qualitative analysis, and the engineering effectiveness of this method was verified through on-site excavation. Zhu Hongdong et al. applied magnetic tomography detection technology to detect stress concentration areas of pipelines in mountain landslides, and analyzed the gradient changes of the collected magnetic signals to identify the magnetic anomaly areas of pipelines. Sun Changbao et al. from China Oilfield Services Limited carried out magnetic tomography detection on high-risk submarine pipeline sections in Yacheng, CNOOC. The detection data of the magnetometer was transmitted to the remote control system through the underwater data acquisition unit, and the magnetic anomaly parts were defect-rated, and the high-risk areas of the pipeline could be effectively detected. The horizontal offset distance between the magnetometer and the pipeline was less than 1.5 times the pipe diameter, and the distance from the ROV to the seabed was controlled at 2 - 3 m. ASME B31G specification, ASME-MTMCorrelation software (MTMCS 2.0).
[0042] Meanwhile, researchers at home and abroad have conducted relevant theoretical and experimental studies on magnetic tomography pipeline detection. Liao et al. explored the detection principle of magnetic tomography based on the magnetostrictive effect of metals and pipeline magnetic field stress detection, and analyzed the application scope and technical characteristics of this technology in combination with the measurement process and results, providing a reference basis 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 for the stress concentration area of the pipeline based on the Z-L model, and verified the determination effect of the model on the defect position and depth through experiments. Han Ye studied the basic principle of pipeline magnetic detection under non-excavation conditions, conducted on-site detection by simulating the buried pipeline environment, and verified the reliability of this technology by excavating a certain pipeline site. Chen Guangming studied the defect level evaluation and analysis algorithm for magnetic tomography detection data. This algorithm can evaluate the maximum allowable operating pressure and remaining life of the pipeline according to the initial conditions and detection status of the pipeline, and was verified by excavation in an oilfield in China. The results show that this method can detect various types of defects with an accuracy of over 85%. Based on the inverse magnetostrictive effect, magnetic tomography detection defines the stress characteristics of pipe segments by recording the magnetic field changes of the pipeline. However, when detecting pipeline characteristics (such as pitting) with a stress level less than 5% of the specified minimum yield strength (SMYS), the accuracy is relatively low. Jabbar Mirzoev described the methodology for formulating an effective pipeline integrity management plan based on the DCVG / CIPS / MTM survey results of Gazprom pipelines.
[0043] The magnetic tomography pipeline detection signal is a weak magnetic field signal, which is more vulnerable to interference from the surrounding ferromagnetic environment, thus affecting the detection effect. To reduce the influence 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 disturbances around the pipeline caused by defects and ferromagnetic objects, designed an anisotropic magnetoresistive (AMR) sensor array to detect defects, reduced the influence of magnetic field interference signals, and gave the relationship between the defect detection rate and the detection distance.
[0044] As Figure 1 and Figure 2 shown, the detection principle of magnetic tomography (MTM) is based on the Villari effect. The pipeline is naturally magnetized by the geomagnetic field, and the magnetization curve will be distorted at stress concentration areas or corrosion locations. When the magnetic tomography detection equipment moves along the pipeline route, it remotely records the magnetic field from the pipeline. The staff analyzes the detection data to identify the type, position, and direction of stress concentration areas or defects, grade the degree of danger, and evaluate the safety status of the pipeline.
[0045] The requirements for MTM detection technology are as follows: The metal pipe to be detected should have a wall thickness of at least 3 mm and an inner diameter in the range of 56 - 1420 mm. There are no restrictions on the length of the pipe to be detected and the detection environment, and it can detect the magnetic field information of metal pipes at a depth of 200 - 300 mm below the ground surface.
[0046] Pipe defects are mainly divided into cracks and stress strains. Among them, the magnetic memory signal has a non-linear 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 increase of the width. The signal is positively correlated with stress: compared with the weld, the crack is more sensitive to stress changes.
[0047] The data acquisition system based on the 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 Figure 3 shown.
[0048] The hardware design of the data acquisition system based on the magnetic gradient tensor should ensure the real-time performance and resolution of each channel acquisition 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 for subsequent data processing. The communication unit adopts RS-232 level to improve the anti-interference ability and transmission distance.
[0049] In terms of software, the magnetic guidance system based on the magnetic gradient tensor should provide instructions to change the sampling rate to meet the requirements of different operation tasks. At the same time, the storage unit should support the file system to facilitate the export of data to the PC.
[0050] 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 zero drift, scale factor and non-orthogonal angle of a single magnetic sensor and the misalignment error between multi-sensor axes. Specifically, the calibration idea of the magnetic gradient tensor system can be divided into two steps: The first step is to calibrate the system error of a single magnetic sensor; the second step is to calibrate the misalignment error of the sensor array and the geomagnetic steering difference. Then use the meta-heuristic algorithm to solve the coefficient matrix in the model, and finally complete the system calibration.
[0051] Magnetic tomography imaging detection is a pipeline detection method based on the metal magnetic memory theory. Under the action of the geomagnetic field, when the pipeline bears external loads, stress concentration areas will be formed at corrosion and defect locations, showing magnetic anomaly patterns in the magnetic memory signals. By analyzing the abnormal parts of the magnetic signals, the location and type of the stress concentration areas can be judged and determined. This method is a passive detection method that uses the geomagnetic field to naturally magnetize the pipeline. No complex preparation work and artificial magnetization are required before detection, and it is easy to operate. It can detect stress concentration areas of types such as damage, welds, and defects within a range of 15 times the inner diameter from the pipe body. If the accuracy of the detection instrument is improved and the surrounding magnetic field interference signals are reduced, more types of defects and even the initial formation area of stress concentration can be detected. Compared with other pipeline external detection methods, the magnetic tomography imaging method can detect more types of defects and is more convenient to apply, having a broader development space.
[0052] The external detection of magnetic tomography imaging (MTM) pipeline is based on the inverse magnetostrictive effect of the metal pipeline under the natural magnetization of the geomagnetic field, making the magnetic field signals in the stress concentration areas abnormal compared with the magnetic signals in the normal areas. The detector is used to measure, process, and analyze the magnetic signals at a certain distance outside the pipeline to achieve the identification and analysis of the stress concentration areas of the pipe fittings. This method makes up for the deficiencies of internal detection to a certain extent and can be used as an important supplementary means for pipeline internal detection. The magnetic tomography imaging detection principle is based on the Villari effect. The pipeline is "naturally magnetized" by the geomagnetic field, and the magnetization curve will be distorted at stress concentration areas or corrosion locations. When the magnetic tomography imaging detection equipment moves along the pipeline route, it remotely records the magnetic field from the pipeline. The staff analyzes the detection data to identify the type, location, and direction of the stress concentration areas or defects, grade the degree of danger, and evaluate the safety status of the pipeline.
[0053] The magnetic tomography imaging (MTM) detection principle is based on the Villari effect. The pipeline is naturally magnetized by the geomagnetic field, and the magnetization curve will be distorted at stress concentration areas or corrosion locations. When the magnetic tomography imaging detection equipment moves along the pipeline route, it remotely records the magnetic field from the pipeline. The staff analyzes the detection data to identify the type, location, and direction of the stress concentration areas or defects, grade the degree of danger, and evaluate the safety status of the pipeline.
[0054] This embodiment provides a magnetic imaging recognition method and a magnetometer based on deep learning.
[0055] Solution 1: Magnetic signal feature recognition based on neural network
[0056] 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 by 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.
[0057] 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 obtained by the meta-heuristic algorithm update, it is judged whether the termination condition is met, and finally the optimal kernel parameters and regularization coefficients are obtained to achieve 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 duct and cable corrosion in this embodiment.
[0058] Solution 2: Magnetic imaging recognition based on deep learning
[0059] The magnetic gradient tensor data obtained through magnetic vector calculations contains the spatial position information and differential changes of magnetic targets, effectively suppressing noise and providing a higher information dimension. Deep learning can tap into the multiple, deep features of the data. Combined with the magnetic gradient tensor, it can autonomously identify magnetic targets, reducing the need for human intervention and significantly improving efficiency.
[0060] First, the collected data is filtered and spatially interpolated to make up for the sparse measured data and achieve 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 Total Horizontal Derivative (THDR), Analytic Signal Magnitude (ASM, which is sometimes also referred to as "Total Gradient Magnitude" in the field of geophysics), Theta method, etc. The preprocessed data is pseudo-color coded to establish a magnetic image dataset, where the image color represents the intensity. Finally, an improved R-CNN network is used for training to identify pipeline or cable defects. Figure 5 is a schematic diagram of cable defect identification based on magnetic imaging. As Figure 5 shown, this process describes a data processing and image detection process: starting from the original data, interpolation data is generated through the Kriging interpolation method. Then, edge enhancement processing is performed on the data. Next, the data after edge enhancement processing is converted into a pseudo-color coded image with 640x640 pixels and 3 channels. 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 the image in the detection task.
[0061] Figure 6 is a flowchart of a magnetic imaging recognition method based on deep learning in this embodiment. As Figure 6 shown, the magnetic imaging recognition method based on deep learning includes the following steps:
[0062] S10: Preprocess the collected magnetic field data to obtain encrypted reconstructed magnetic map data;
[0063] Specifically, preprocessing and encrypted reconstruction of the collected magnetic field data are beneficial to improving data quality and ensuring data security. Preprocessing can include operations such as denoising and standardization, while encrypted reconstruction involves the secure storage and transmission of data.
[0064] S20: Calculate the components of the magnetic gradient tensor based on the encrypted and reconstructed magnetic map data, and extract magnetic field gradient features using different combination methods of the magnetic gradient tensor components; identify magnetic field anomaly information by analyzing the magnetic field gradient features, where the magnetic field anomaly information represents the area of change in magnetic field strength or gradient; extract the magnetic source boundary from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information; the magnetic field anomaly information indicates the location of potential pipeline defects, and the location of the potential pipeline defects has a spatial correspondence with the location of the magnetic source boundary;
[0065] Specifically, calculating the components of the magnetic gradient tensor based on the reconstructed magnetic map data is a crucial step because the magnetic gradient tensor contains detailed information about the magnetic field changes. The magnetic gradient tensor usually includes multiple components, such as ∂Bx / ∂x, ∂By / ∂y, etc., where B represents the magnetic induction intensity, and x, y, z represent spatial coordinates. By analyzing different combinations of these components, rich magnetic field gradient features can be extracted, and then magnetic field anomaly information can be identified. The magnetic field anomaly information usually shows local changes in magnetic field strength or gradient, and these changes often correspond to the location of pipeline defects.
[0066] After identifying the magnetic field anomaly information, this method uses this information to extract the magnetic source boundary from the encrypted and reconstructed magnetic map data. The magnetic source boundary refers to the edge of the magnetic field anomaly region, and it has a spatial correspondence with the location of potential pipeline defects. The importance of this step lies in that it can accurately locate the area where defects may exist.
[0067] S30: Combine the magnetic source boundary with the encrypted and reconstructed magnetic map data, perform pseudo-color coding, and establish a magnetic image dataset; wherein, the pseudo-color coding uses different colors to represent the changes in magnetic field strength and magnetic field anomaly information;
[0068] Specifically, pseudo-color coding is a visualization technique that uses different colors to represent the changes in magnetic field strength and magnetic field anomaly information. For example, red can be used to represent high-intensity regions, blue for low-intensity regions, and yellow or green can be used to mark anomaly regions. This coding method not only enhances the visualization effect of the data but also provides richer feature information for subsequent deep learning models.
[0069] S40: Use the magnetic image dataset to train an improved region-based convolutional neural network (R-CNN) pipeline defect detection model, where the input of the pipeline defect detection model is a magnetic image, and the output is the location and type of pipeline defects;
[0070] S50: Use the trained pipeline defect detection model to identify pipeline defects in newly input magnetic images.
[0071] This method uses an improved R-CNN (Region-based Convolutional Neural Network) model for pipeline defect detection. R-CNN is an advanced object detection algorithm, which has been improved in the present invention to adapt to the characteristics of magnetic images. The training dataset consists of the magnetic images generated in the previous steps. The input of the model is the magnetic image, and the output is the position and type of pipeline defects. Through the training of 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.
[0072] The beneficial technical effects of the method of the present invention are mainly reflected in the following aspects: First, through 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. Second, the application of pseudo-color coding technology not only enhances the visualization effect of the data, but also provides richer feature information for the deep learning model, which helps to improve the recognition ability of the model. Third, using the improved R-CNN model for defect detection makes full use of the latest progress in the field of image recognition by deep learning, significantly improving the accuracy and efficiency of defect detection. Finally, this method realizes the full-process automation from data acquisition to defect recognition, greatly reducing manual intervention, improving the detection efficiency, and at the same time reducing the possibility of human error.
[0073] In some embodiments, step S10 may specifically include the following sub-steps:
[0074] S11: Perform coordinate transformation on the collected magnetic field data to convert the acquisition coordinate system into a unified geographic coordinate system, and obtain the magnetic field data in the unified geographic coordinate system as the magnetic field data after coordinate transformation;
[0075] In this step, the 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 into a unified geographic coordinate system (such as the WGS84 coordinate system), the spatial consistency and comparability of all data points can be ensured.
[0076] S12: Perform normalization processing on the magnetic field data after coordinate transformation to obtain the normalized magnetic field data;
[0077] Normalization is to map the data into a fixed range, usually [0, 1] or [-1, 1]. This step helps to eliminate the influence of different measurement units or scales, enabling direct comparison of data from different sources. For example, the min-max normalization method can be used: (x - min(x)) / (max(x) - min(x)), where x is the original data value. The normalized data is convenient for subsequent processing and analysis, especially when applying machine learning algorithms.
[0078] S13: Perform detrending on the normalized magnetic field data to obtain the detrended magnetic field data;
[0079] Detrending can remove the long-term trends or systematic variations in the data, highlighting local anomalies or fluctuations. This is particularly important for identifying pipeline defects as defects usually manifest 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, and then this trend is subtracted from the original data, and the remaining residuals are the detrended data.
[0080] S14: Perform filtering on the detrended magnetic field data to obtain the filtered magnetic field data;
[0081] Filtering is used to remove noise in the data and improve the 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 retention and noise removal to ensure that important defect information is not lost.
[0082] S15: Use the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm to perform spatial data interpolation on the filtered magnetic field data to obtain an interpolation result;
[0083] Spatial data interpolation is to estimate the values 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 points closer have a greater influence. The choice of which method depends on the characteristics and distribution of the data. For example, for data with an obvious spatial structure, Kriging interpolation may be more appropriate.
[0084] S16: Based on the interpolation result, improve the spatial resolution of the original magnetic field data to obtain the encrypted and reconstructed magnetic map data.
[0085] This step utilizes the interpolation results to increase the density of data points and improve the spatial resolution. For example, if the original data is collected on a grid with a 10-meter interval, high-resolution grid data with a 1-meter interval can be generated through interpolation. Such encrypted and reconstructed magnetic map data can not only provide more detailed magnetic field distribution information but also offer richer inputs for subsequent image processing and deep learning models. High-resolution data helps capture small-scale magnetic field changes, thereby improving the accuracy of defect detection.
[0086] In some embodiments, step S16 specifically includes the following sub-steps:
[0087] S161: Determine the spatial resolution and data point density of the original magnetic field data;
[0088] S162: Set the target spatial resolution to be at least twice the original resolution;
[0089] S163: Based on the target spatial resolution, calculate the number of data points that need to be added to ensure that the number of data points per unit area increases by at least 4 times;
[0090] S164: Utilize the interpolation results to create new data points between the original data points, and the values of the new data points are calculated according to the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm;
[0091] S165: Add the newly created data points to the original magnetic field data to form encrypted and reconstructed magnetic map data;
[0092] 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;
[0093] S167: Output the final encrypted and reconstructed magnetic map data.
[0094] In some embodiments, step S20 specifically includes the following sub-steps:
[0095] S21: Based on the encrypted and reconstructed magnetic map data, calculate the magnetic gradient tensor components, which include the horizontal gradient, vertical gradient, and total gradient; among them, the horizontal gradient includes the x-direction gradient and y-direction gradient, the vertical gradient is the z-direction gradient, and the total gradient is the vector sum of the three direction gradients;
[0096] S22: Extract magnetic field gradient features using different combination methods of the magnetic gradient tensor components. The combination methods include the horizontal gradient method THDR, the total gradient magnitude method ASM, and the Theta method. Among them, the horizontal gradient method THDR is used to calculate the magnitude of the horizontal gradient, the total gradient magnitude method ASM is used to calculate the magnitude 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.
[0097] The horizontal gradient method (THDR) is a method for calculating the magnitude of the magnetic field horizontal gradient. This method mainly considers the rate of change of the magnetic field in the horizontal plane, that is, the gradients in the x and y directions. The calculation formula of THDR is:
[0098] , where T represents the total magnetic field intensity, and ∂T / ∂x and ∂T / ∂y 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 anomaly bodies and helps to determine the horizontal position and boundary of magnetic bodies.
[0099] The total gradient magnitude method (ASM) is a method for calculating the magnitude of the total gradient in three-dimensional space, also known as the analytical signal magnitude method. ASM takes into account the changes in the magnetic field in the x, y, and z directions. Its calculation formula is:
[0100] , where ∂T / ∂z 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.
[0101] The Theta method is a method for calculating the angle between the total gradient and the horizontal gradient. This angle is usually called the tilt angle. Its calculation formula is Theta = arctan(∂T / ∂z / THDR), where ∂T / ∂z is the vertical gradient and THDR is the horizontal gradient. The Theta method combines horizontal and vertical gradient information and can provide spatial positioning information of magnetic bodies. This method is particularly helpful for determining the depth and tilt degree of magnetic bodies and performs well in dealing with complex geological structures and the superposition of multiple magnetic sources.
[0102] S23: Identify magnetic field anomaly information by analyzing the magnetic field gradient features. The magnetic field anomaly information represents the change region of the magnetic field intensity or gradient.
[0103] S24: Extract the magnetic source boundary from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information.
[0104] In some embodiments, step S23 specifically includes the following sub-steps:
[0105] S231: Set the thresholds corresponding to the horizontal gradient amplitude, total gradient magnitude, and the angle between the total gradient and the horizontal gradient respectively;
[0106] 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 magnitude 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 the thresholds is usually based on empirical values or statistical analysis. For example, the threshold for the horizontal gradient amplitude can be set as the average value plus twice the standard deviation, the threshold for the total gradient magnitude can be 1.5 times the background value, and the angle threshold can be set as 45 degrees. The selection of these thresholds requires a trade-off between detection sensitivity and false alarm rate.
[0107] S232: Mark the magnetic field gradient features exceeding the corresponding thresholds as magnetic field anomaly regions;
[0108] Specifically, this step compares the magnetic field gradient features of each data point with the thresholds set in step S231. If any feature exceeds its corresponding threshold, that point is marked as a potential magnetic field anomaly region. This process can be achieved by creating a boolean mask, where the points exceeding the threshold are marked as 1 and the other points are marked as 0. For example, if the horizontal gradient amplitude of a certain point is 10 nT / m and the threshold is set as 8 nT / m, then this point will be marked as an anomaly. This method can quickly identify the regions where pipeline defects may exist.
[0109] S233: Conduct clustering analysis on the marked magnetic field anomaly regions to obtain the clustered magnetic field anomaly regions;
[0110] The purpose of clustering analysis is to combine spatially adjacent anomaly points into larger anomaly regions. This can be achieved through algorithms such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise) or K-means. For example, when using the DBSCAN algorithm, the minimum number of points can be set as 5 and the neighborhood radius as 2 meters, so that the anomaly points with a distance less than 2 meters and a quantity not less than 5 can be clustered into one class. Clustering analysis helps to distinguish the large-scale anomalies caused by a single defect and the scattered anomalies caused by multiple small defects.
[0111] S234: Determine the range and distribution information of each of the clustered magnetic field anomaly regions;
[0112] Specifically, this step involves quantitatively describing each clustered abnormal area. The range information may include the area, perimeter, central coordinates, etc. of the abnormal area. The distribution information may include the shape characteristics (such as the major axis to minor axis ratio) of the abnormal area, directivity, density, etc. For example, for an elliptical magnetic field abnormal area, the major axis of the abnormal area is 5 meters, the minor axis is 2 meters, and the central coordinates are (X, Y) (longitude, latitude). The main axis direction is 30 degrees east of north. The maximum magnetic field intensity in this area is 500 nanotesla (nT), and the background magnetic field intensity is 45000 nanotesla (nT). The maximum horizontal gradient is 20 nanotesla per meter (nT / m), which appears at the edge of the ellipse. The area of the abnormal area is approximately 7.85 square meters. Based on the magnetic field characteristics estimation, the possible burial depth of the abnormal source is about 1.5 meters.
[0113] S235: Generate magnetic field anomaly information including the range and distribution information of the clustered magnetic field abnormal areas;
[0114] 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 multiple key fields to comprehensively describe the detected abnormal areas. These fields include: the anomaly ID as a unique identifier; the central coordinates (longitude and latitude) indicating the specific location of the abnormal area; the area representing the coverage of the abnormal area (in square meters); the maximum magnetic field intensity and the background magnetic field intensity (both in nanotesla nT) respectively reflecting the peak value in the abnormal area and the average magnetic field intensity of the surrounding normal area; the maximum horizontal gradient and the maximum total gradient (in nanotesla per meter, nT / m) describing the severity of the magnetic field change; the gradient direction (in degrees, relative to the due north direction) indicating the spatial direction of the main magnetic field change; the abnormal shape description (such as "linear", "circular", "irregular", etc.) providing the geometric characteristics of the abnormal area; finally, the estimated burial depth (in meters) speculating the possible depth of the abnormal source based on the magnetic field characteristics. These comprehensive information provide a detailed magnetic field anomaly overview for pipeline inspectors, which helps for further analysis and decision-making.
[0115] Step S24 may specifically include the following sub-steps:
[0116] S241: Based on the magnetic field anomaly information including the range and distribution information of the clustered magnetic field abnormal areas, select an edge detection algorithm;
[0117] Specifically, in step S241, according to the previously obtained range and distribution information of the magnetic field anomaly region, an appropriate edge detection algorithm is selected. For example, if the anomaly region presents a relatively regular shape (such as an ellipse or a circle), the Canny edge detection algorithm can be selected; if the anomaly region has an irregular shape or contains noise, the Sobel operator or the Laplacian of Gaussian (LoG) algorithm can be considered. When selecting the algorithm, the characteristics of the magnetic field gradient also need to be considered to ensure that the boundary of the magnetic field change can be accurately captured.
[0118] S242: Apply the edge detection algorithm to the magnetic field anomaly region in the encrypted reconstructed magnetic map data to obtain a magnetic field anomaly region with enhanced edge features;
[0119] Specifically, in step S242, the selected edge detection algorithm is applied to the encrypted reconstructed magnetic map data in the previous step. This process will highlight the edge features of the magnetic field anomaly region. For example, if the Canny algorithm is used, it will first perform Gaussian smoothing on the image, then calculate the gradient magnitude and direction, followed by non-maximum suppression and double-threshold detection, and finally obtain clear edges. For magnetic field data, this means that the region where the magnetic field strength changes sharply can be more clearly identified, which usually corresponds to the boundary of the magnetic source.
[0120] S243: Based on the magnetic field anomaly region with enhanced edge features, extract the contour of the magnetic field anomaly region;
[0121] Specifically, step S243 involves extracting the 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 tracking algorithm or the Suzuki algorithm. These algorithms will move along the edge pixels, record the continuous edge points, and finally 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.
[0122] S244: Perform optimization processing on the contour of the magnetic field anomaly region to obtain an optimized contour;
[0123] Specifically, this step performs optimization processing on the extracted contour, which can include smoothing processing to remove noise and small irregularities, or using polygon 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 the magnetic field anomaly region, this step helps to eliminate the contour irregularities caused by measurement errors or environmental disturbances and obtain a smoother and more accurate boundary description.
[0124] S245: Determine the optimized contour as the magnetic source boundary.
[0125] Specifically, in this step, the processed contour is defined as the final magnetic source boundary. For example, for a buried metal pipeline, this optimized contour may appear as an elongated ellipse, with the major axis direction consistent with the pipeline's orientation. This boundary not only provides a planar projection of the pipeline's location but may also provide a basis for estimating the pipeline's burial depth and diameter based on its shape and size.
[0126] In some embodiments, step S30 specifically includes the following sub-steps:
[0127] S301: Determine the magnetic field strength range in the encrypted reconstructed magnetic map data;
[0128] Specifically, in step S301, the encrypted reconstructed magnetic map data is analyzed to determine the minimum and maximum magnetic field strengths in the entire dataset, thereby obtaining the magnetic field strength range. For example, assume the analysis result shows that the magnetic field strength range is from 20,000 nT to 60,000 nT (nanotesla). This range information is crucial for subsequent color mapping as it determines how the numerical values are mapped to the color space.
[0129] S302: Determine a first color mapping scheme for representing the change in magnetic field strength according to the magnetic field strength range;
[0130] Specifically, in step S302, based on the magnetic field strength range determined in S301, a suitable color mapping scheme is selected to represent the change in magnetic field strength. For example, a gradient color scheme from blue (representing low intensity) to red (representing high intensity) can be chosen. Specifically, 20,000 nT can be mapped to dark blue, 60,000 nT can be mapped to dark red, and the intermediate values are interpolated linearly to obtain the corresponding colors. This mapping scheme can visually display the spatial distribution of the magnetic field strength.
[0131] S303: Determine a second color mapping scheme for representing the degree of magnetic field anomaly according to the magnetic field anomaly information;
[0132] 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 one to clearly distinguish in the final image. For example, a gray-scale gradient from white (indicating no anomaly) to black (indicating high anomaly) can be used. Or, a gradient from transparent to opaque can be selected, where the transparency represents the degree of anomaly. In this way, when superimposed on the base layer, the anomaly areas will be more prominent.
[0133] S304: Convert the magnetic source boundary into a magnetic source boundary vector layer;
[0134] Specifically, in step S304, the magnetic source boundary determined in the previous steps is converted into a vector format. This can transform the 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, forming a closed polygon. This vector format allows the boundary to remain clear at different scales and can be easily scaled and edited.
[0135] S305: Apply the first color mapping scheme to the encrypted and reconstructed magnetic map data to generate a basic pseudo-color magnetic map;
[0136] Specifically, in step S305, the color mapping scheme determined in S302 is applied to the encrypted and reconstructed magnetic map data to generate a basic pseudo-color magnetic map. For example, using the previously mentioned blue-to-red gradient color scheme, low-intensity regions (e.g., 20,000 nT) will appear blue, high-intensity regions (e.g., 60,000 nT) will appear red, and intermediate intensities will be shown as corresponding transitional colors. The image generated in this way can intuitively display the magnetic field strength distribution of the entire region.
[0137] S306: Superimpose 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 regions;
[0138] 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, regions with a higher degree of anomaly will be displayed on top of the basic layer with a darker color or higher opacity. For example, a strong magnetic field anomaly region may appear as a dark gray or black area on a red background, while a slightly anomalous region may appear as a light gray. This superimposed effect can effectively highlight the magnetic field anomaly regions while retaining the basic magnetic field strength information.
[0139] S307: Superimpose the magnetic source boundary vector layer on the comprehensive pseudo-color magnetic map to form an integrated magnetic map containing magnetic field strength, magnetic field anomaly, and magnetic source boundary information;
[0140] Specifically, in step S307, the magnetic source boundary vector layer created in step S304 is superimposed on the comprehensive pseudo-color magnetic map generated in step S306. For example, a distinct contrast color (e.g., bright yellow) can be used to draw the magnetic source boundary line to make it clearly visible in the background. In this way, the final integrated magnetic map simultaneously contains three key pieces of information: magnetic field strength (represented by the basic color), magnetic field anomaly (represented by the superimposed transparency or color), and magnetic source boundary (represented by a clear contour line).
[0141] S308: Add auxiliary information including a legend, a scale, and a direction indicator to the integrated magnetic map to obtain a complete magnetic map;
[0142] 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 that explains the correspondence between colors and magnetic field intensity, as well as the method of representing the degree of anomaly; a scale that indicates the relationship between distances in the image and actual geographical distances; a direction indicator, which is a north arrow to help determine the direction of the magnetic map; a title and description that include key information such as the measurement date, location, etc. The addition of this auxiliary information makes the magnetic map easier to understand and interpret, especially for non-professionals.
[0143] S309: Standardize the resolution and format of the complete magnetic map and save it in a standard format to form a single standardized magnetic image;
[0144] Specifically, step S309 involves converting the complete magnetic map into 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 standardization 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 uniformly A3 size. The processed magnetic images are convenient for storage, comparison, and subsequent analysis.
[0145] S310: Organize and label the generated multiple standardized magnetic images to obtain a structured magnetic image dataset.
[0146] Specifically, this step organizes all the generated standardized magnetic images into a structured dataset. This can include creating a metadata file to record the key information of each image, such as the measurement date, geographical location, device used, anomaly characteristics, etc. For example, a CSV file can be created, with each row corresponding to a magnetic map, and the columns including information such as the file name, measurement date, latitude and longitude coordinates, main anomaly type, etc. This structured organization makes subsequent data retrieval, analysis, and machine learning applications more convenient.
[0147] In some embodiments, step S40 specifically includes the following sub-steps:
[0148] S401: Prepare a training dataset, which includes dividing the magnetic image dataset into a training set, a validation set, and a test set;
[0149] S402: Label the magnetic images in the training set, and the labeling content includes the location and type of pipeline defects;
[0150] S403: Design the structure of the pipeline defect detection model based on the improved R-CNN;
[0151] S404: Initialize the parameters of the pipeline defect detection model and select the pre-trained weights;
[0152] S405: Use the training set to train the pipeline defect detection model, and utilize the pre-trained weights selected in step S404 during the training process; also adopt a predetermined learning rate adjustment strategy and optimizer during the training process;
[0153] S406: After each training epoch, evaluate the performance of the pipeline defect detection model using the validation set to obtain the performance evaluation results corresponding to multiple performance evaluation metrics, where the multiple performance evaluation metrics include calculated accuracy, recall rate, and mean average precision;
[0154] S407: Adjust the hyperparameters of the pipeline defect detection model according to the performance evaluation results of the validation set, where the hyperparameters include learning rate, batch size, and number of training epochs;
[0155] S408: Repeat steps S405 to S407 until the performance of the pipeline defect detection model converges or reaches the preset number of training epochs;
[0156] S409: Use the test set to perform a final test on the trained pipeline defect detection model to obtain the performance metrics of the model on the test set;
[0157] S410: If the test results do not meet the predetermined criteria, take one or more of the following measures:
[0158] Return to step S403 and adjust the structure of the pipeline defect detection model;
[0159] Return to step S404 and adjust the initialization parameters of the pipeline defect detection model;
[0160] Adjust the training strategy, which includes: changing the learning rate adjustment strategy or using a different optimizer in step S405; adding or changing the performance evaluation metrics in S406; adjusting the range of hyperparameters in step S407; and then repeating steps S405 to S409;
[0161] Specifically, changing the learning rate adjustment strategy in step S405 means adopting different methods to dynamically adjust the learning rate during model training. The learning rate is a crucial hyperparameter that determines the step size for updating model parameters. Learning rate adjustment strategies include Step Decay, Exponential Decay, CosineAnnealing, and Cyclical Learning Rates, etc. For example, one can switch from a fixed learning rate strategy to a step decay strategy, reducing the learning rate by a certain percentage every certain number of training epochs. Or, one can try using the cosine annealing strategy, which allows the learning rate to vary periodically during training, and this may help the model to escape from local optima. The purpose of changing the learning rate adjustment strategy is to find a way of changing the learning rate that can enable the model to converge faster and achieve better performance.
[0162] Specifically, using different optimizers in step S405 means replacing the optimization algorithm used to update model parameters. Optimizers include Stochastic Gradient Descent (SGD), Adam, RMSprop, AdaGrad, etc. Each optimizer has its unique characteristics and applicable scenarios. For example, one can switch from the most basic SGD to the Adam optimizer with adaptive learning rate. Adam usually converges faster and is less sensitive to the choice of the initial learning rate. Or, one can try using the AdamW optimizer, which is a variant of Adam and adds Weight Decay to improve the generalization ability of the model. Selecting different optimizers may affect the convergence speed of the model, the final performance, and the sensitivity to hyperparameters. By trying different optimizers, one can find the optimization method that is most suitable for the current problem and dataset, thereby improving the training effect of the model.
[0163] S411: If the test results meet the predetermined criteria, confirm that the trained pipeline defect detection model is obtained.
[0164] 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;
[0165] The improved Region-based Convolutional Neural Network (R-CNN) is a deep learning model for object detection. It is improved based on 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 properties of pipeline defects. The model consists of four main components, each with its specific function and role.
[0166] A feature extraction network for extracting useful feature maps from the input magnetic images;
[0167] The feature extraction network is the basic part of the model and uses a pre-trained convolutional neural network (ResNet, VGG, or EfficientNet) as the backbone network. This network receives the original magnetic images as input and extracts the features of the images 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 the subtle changes in magnetic field anomalies, or the size of the convolutional kernels can be adjusted to match the scale of typical defects. The output feature maps contain rich spatial and semantic information, providing a basis for subsequent detection tasks.
[0168] A Region Proposal Network (RPN) for sliding windows on the feature maps output by the feature extraction network to generate candidate regions that may contain pipeline defects;
[0169] 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 at each position. The RPN uses two parallel fully connected layers, one for judging whether the anchor box contains the target (here, pipeline defects), and the other for adjusting the position and size of the anchor box. For pipeline defect detection, the RPN can adjust the size and proportion of the anchor boxes to match the shape of typical defects. For example, for slender cracks, more rectangular anchor boxes may be needed; for corrosion points, more square anchor boxes may be required. The output of the RPN is a series of candidate regions that may contain pipeline defects, and these regions will be fed into the subsequent classification and regression networks for further processing.
[0170] A classification network for classifying the candidate regions generated by the RPN to determine whether the candidate regions contain pipeline defects and the specific defect types;
[0171] 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 the 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 the softmax activation function to output the probability of each class. To improve the classification accuracy, an attention mechanism can be introduced into 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.
[0172] A bounding box regression network is used to adjust the position and size of the candidate regions according to the feature map and the candidate regions, so as to more accurately locate the defect type and position of the pipeline defect.
[0173] The purpose of the bounding box regression network is to finely adjust the candidate regions generated by the RPN so that they can more accurately frame the actual defect regions. This network shares some layers with the classification network, but finally outputs four values, corresponding to the center coordinates (x, y) of the bounding box and the adjustment amounts of the width and height respectively. In pipeline defect detection, due to the irregular shape of the defects, traditional rectangular bounding boxes may not be precise enough. Therefore, more complex shape representations can be considered, such as rotated bounding boxes or polygons. For example, for curved cracks, rotated bounding boxes can be used to better fit the defect shape; for irregular corrosion areas, a series of point coordinates can be output to define a polygon contour. This improvement can significantly improve the accuracy of defect location and provide more accurate information for subsequent defect assessment and repair.
[0174] In some embodiments, step S50 specifically includes the following sub-steps:
[0175] S51: Preprocess the newly input magnetic image to make it meet the input requirements of the pipeline defect detection model;
[0176] 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:
[0177] First, perform coordinate transformation to convert the acquisition coordinate system to a unified geographic coordinate system, and obtain the 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.
[0178] Secondly, perform normalization processing on the magnetic field data after coordinate transformation. Normalization processing can scale the data to a unified range, which helps to eliminate numerical differences caused by different acquisition devices or environmental conditions and improve the generalization ability of the model.
[0179] Thirdly, perform detrending processing on the normalized magnetic field data. This step can remove the long-term change trend in the data and highlight local abnormal changes, which is beneficial to detecting local pipeline defects.
[0180] Then, perform filtering processing on the magnetic field data after detrending processing. Filtering can reduce the noise in the data, improve the signal-to-noise ratio, and make potential defect signals more obvious.
[0181] Next, 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 the gaps in the data acquisition process and provide a more continuous and complete magnetic field distribution image.
[0182] 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 detailed information of the data and help detect smaller-scale or finer pipeline defects.
[0183] Through the above preprocessing steps, the original magnetic field data is converted into high-quality and standardized magnetic map data, which are more suitable for input into the pipeline defect detection model for analysis and defect identification.
[0184] S52: Input the preprocessed magnetic image into the trained pipeline defect detection model;
[0185] Specifically, in this step, the preprocessed magnetic image is input into the previously trained pipeline defect detection model. The specific operations include converting the image data into a format acceptable to the model, such as converting the image into tensor form, and ensuring that the data type and dimensions 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, an image pyramid may need to be generated, that is, multiple different-sized versions of the same image, to detect defects of different sizes.
[0186] S53: Obtain the output results of the pipeline defect detection model, which include the predicted pipeline defect positions and types;
[0187] Specifically, after the model processes the input magnetic image, it will output the prediction results. These results usually contain the following information: the bounding box coordinates (x and y coordinates of the upper left and lower right corners) of each detected defect, the prediction of the defect type (cracks, corrosion, deformation, etc.), and the confidence score for each prediction. For more complex models, the output may also include the exact contour of the defect (polygon or mask). These original outputs need to be further parsed and processed. For example, the bounding box coordinates need to be converted from relative coordinates to absolute pixel coordinates on the image, and the class index needs to be mapped to the actual defect type name. For each detected defect, the model may output multiple possible classes and their probabilities, and the class with the highest confidence needs to be selected as the final prediction.
[0188] S54: Post-process the output results of the pipeline defect detection model, which includes non-maximum suppression and / or threshold filtering, to obtain the final pipeline defect detection results;
[0189] Specifically, the post - processing steps are beneficial for refining the original output of the model and removing redundant and low - confidence detection results. Non - maximum suppression (NMS) is used to address the issue of a same defect being detected multiple times. The working principle of NMS is as follows: for overlapping detection boxes, the one with the highest confidence is retained, and other detection boxes with an overlap degree higher than a certain threshold (e.g., IoU > 0.5) are deleted. This is particularly useful when dealing with small defects distributed densely. Threshold filtering is to delete detection results with a confidence lower than a certain 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 more relaxed NMS standard is required; while for dot - shaped corrosion, a more stringent standard is needed. 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.
[0190] S55: Visualize and output the final pipeline defect detection results, which includes annotating the positions and types of the detected pipeline defects on the original magnetic image.
[0191] 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, different - colored rectangular boxes can be used to represent different types of defects, and the thickness of the boxes can be used to represent the confidence of the detection. Next to each detection box, text labels can be added to show the defect type and confidence score. For a more precise defect contour, polygons or contour lines can be used to depict it. To enhance readability, semi - transparent color filling can be used to highlight the defect area. In addition, a legend can be added to the image to explain the meaning of different colors and markings. 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 positions, types, sizes, and severities of each detected defect, as well as an assessment of the overall pipeline health status.
[0192] Figure 7 This is the cross - shaped magnetic gradient tensor sensor array of this embodiment. The design of the magnetic tomography detection MTM system is as follows: The sensor uses a cross - shaped geomagnetic three - component sensor array to obtain magnetic gradient tensor data. The magnetic gradient tensor, which is the second - order derivative of the total magnetic field intensity, can reflect the change of the magnetic anomaly boundary. Compared with the arrangement methods of three - component magnetic sensors such as triangles and regular tetrahedrons, the cross - shaped one has the characteristics of higher accuracy and stronger anti - interference ability.
[0193] Figure 8It is the annular magnetic gradient tensor sensor array of this embodiment. In order to better fit the pipeline and submarine cable to be detected and thus identify subtle defects, a three-component magnetic sensor can also be arranged in an annular manner to construct a magnetic gradient tensor array. Among them Figure 7 The lower cylinder is an analog pipeline, and the black cuboid is a three-component magnetic sensor.
[0194] Figure 9 It is the non-magnetic XY-axis slide rail of this embodiment. No matter which array above collects data, the electromagnetic characteristics of the submarine pipeline and cable must be measured first, and the experiment should try to keep the measurement at the same horizontal plane. Therefore, it is planned to build a non-magnetic slide rail experimental platform. Among them, the structural parts are made of aluminum alloy frames, and the fixing parts such as bolts are all made of copper to ensure that the magnetic interference of the non-magnetic slide rail experimental platform to the measured parts is minimized. Finally, at a certain fixed height, scanning data acquisition is carried out on the XY axis.
[0195] This embodiment also provides a magnetometer, which includes:
[0196] 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 the magnetic field;
[0197] A non-magnetic XY-axis slide rail for supporting and moving the magnetic gradient tensor sensor array; the non-magnetic XY-axis slide rail includes:
[0198] A frame that constitutes the main structure of the slide rail;
[0199] Fixing parts for connecting and fixing each part of the frame;
[0200] An X-axis sliding mechanism and a Y-axis sliding mechanism for realizing the two-dimensional movement of the magnetic gradient tensor sensor array in the horizontal plane;
[0201] 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;
[0202] A data processing unit electrically connected to the magnetic gradient tensor sensor array for receiving and processing the collected magnetic field data and performing the magnetic imaging recognition method based on deep learning described above.
[0203] In some embodiments, the magnetic gradient tensor sensor array is a cross-shaped array or a circular array. This design can provide more comprehensive magnetic field gradient measurements. The cross-shaped array can simultaneously measure the magnetic field gradients in two orthogonal directions, providing richer spatial information. The circular array can perform 360-degree omnidirectional measurements around the pipeline or submarine cable, ensuring that no defect information at any angle is missed. Both of these configurations can significantly improve the accuracy and comprehensiveness of detection, enabling the system to capture various directions and types of defects, thereby enhancing the reliability of detection.
[0204] In some embodiments, when the magnetic gradient tensor sensor array is a circular array, its shape is adapted to the outer shape of the pipeline or submarine cable to be detected. This design takes into account the requirements of the actual application scenario. By making the array shape match the outer shape of the object to be detected, it can ensure that the sensor maintains the optimal distance and angle from the detected surface, thereby obtaining the best signal quality. For example, for large-diameter pipelines, a larger circular array can be used; while for small-diameter submarine cables, a smaller circular 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.
[0205] In some embodiments, the non-magnetic XY-axis slide rail further 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 precisely adjust the distance between the sensor array and the detected surface according to different detection objects and environmental conditions. This is crucial for optimizing the signal intensity and spatial resolution. For example, for a pipeline with an uneven surface, the height can be adjusted to maintain a consistent distance between the sensor and the pipeline surface, ensuring the consistency of measurement data. In addition, height adjustment can also help avoid accidental contact between the sensor and the detection object, protecting the safety of the equipment.
[0206] In some embodiments, the magnetometer further includes a display unit for displaying the magnetic image and detection 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, enabling the operator to intuitively understand the detection process and results. This not only helps to quickly identify potential problem areas but also enables the operator to adjust the detection strategy according to the real-time feedback. For example, if an abnormal signal is found in a certain area, the operator can immediately decide whether more detailed scanning 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.
[0207] In some embodiments, the frame includes an aluminum alloy frame, and the fixing member includes a copper fixing member. This material selection fully considers the special requirements of magnetic field detection. The aluminum alloy frame has the characteristics of light weight, high strength, and corrosion resistance, and is very suitable as the structural material of portable devices. More importantly, the 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 member is also non-magnetic and has good electrical conductivity and heat dissipation. These characteristics enable the copper fixing member to effectively reduce electromagnetic interference and help maintain the stable operating temperature of the sensor, thereby improving the measurement accuracy and reliability. 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.
[0208] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements any one of the above methods.
[0209] 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 such an understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. Of course, there are other ways of readable storage media, such as quantum memory, graphene memory, etc. It should be noted that the content included 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, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0210] The present invention also provides an electronic device. The electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and 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.
[0211] Refer to the following Figure 10 , which shows a schematic structural diagram of a computer system 800 of an electronic device suitable for implementing the embodiments of the present invention. Figure 10 The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.
[0212] As Figure 10 shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage section 808 into the 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, ROM 802, and RAM 803 are connected to each other via a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0213] 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, for example, 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 required. 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 required so that the computer program read from it is installed into the storage section 808 as required.
[0214] Specifically, according to the embodiments disclosed in the present invention, the process described in the above main step diagram can be implemented as a computer software program. For example, the embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for executing the method shown in the main step diagram. In the above embodiments, the computer program can be downloaded and installed from the network through the communication section 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.
[0215] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having 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, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can 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 can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0216] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0217] The units involved in the embodiments of the present invention can be implemented in software or in hardware. The described units can also be provided in a processor, and the names of these units do not, in some cases, constitute a limitation on the units themselves.
[0218] The above specific embodiments do not limit the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A magnetic imaging recognition method based on deep learning, characterized in that, It includes the following steps: S10: Preprocess the collected magnetic field data to obtain encrypted and reconstructed magnetic map data; S20: Based on the encrypted and reconstructed magnetic map data, calculate the magnetic gradient tensor components, and extract magnetic field gradient features using different combination methods of the magnetic gradient tensor components; identify magnetic field anomaly information by analyzing the magnetic field gradient features, where the magnetic field anomaly information represents the changing area of the magnetic field intensity or gradient; extract the magnetic source boundary from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information; the magnetic field anomaly information indicates the location of potential pipeline defects, and the location of the potential pipeline defects has a spatial correspondence with the location of the magnetic source boundary; S30: Combine the magnetic source boundary with the encrypted and reconstructed magnetic map data, perform pseudo-color coding, and establish a magnetic image data set; wherein, the pseudo-color coding uses different colors to represent the changes in the magnetic field intensity and magnetic field anomaly information; S40: Use the magnetic image data set to train an improved region-based convolutional neural network (R-CNN) pipeline defect detection model, where the input of the pipeline defect detection model is a magnetic image, and the output is the location and type of pipeline defects; S50: Use the trained pipeline defect detection model to identify pipeline defects in newly input magnetic images.
2. The method according to claim 1, wherein Step S10 specifically includes the following sub-steps: S11: Perform coordinate transformation on the collected magnetic field data, convert the acquisition coordinate system to a unified geographic coordinate system, and obtain the magnetic field data in the unified geographic coordinate system as the magnetic field data after coordinate transformation; S12: Perform normalization processing on the magnetic field data after coordinate transformation to obtain the normalized magnetic field data; S13: Perform detrending processing on the normalized magnetic field data to obtain the detrended magnetic field data; S14: Perform filtering processing on the detrended magnetic field data to obtain the filtered magnetic field data; S15: Use the Kriging interpolation algorithm or the 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, improve the spatial resolution of the original magnetic field data 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: Set the target spatial resolution to be at least twice the original resolution; S163: Based on the target spatial resolution, calculate the number of data points that need to be added to ensure that the number of data points per unit area increases by at least 4 times; S164: Use the interpolation result to create new data points between the original data points, and the values of the new data points are calculated according to the Kriging interpolation algorithm or the inverse distance weighted interpolation algorithm; S165: Add the newly created data points to the original magnetic field data to form encrypted and 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: Calculate the magnetic gradient tensor components based on the encrypted and reconstructed magnetic map data. The magnetic gradient tensor components include horizontal gradients, vertical gradients, and total gradients. Among them, the horizontal gradients include the x-direction gradient and the y-direction gradient, the vertical gradient is the z-direction gradient, and the total gradient is the vector sum of the three-direction gradients; S22: Extract magnetic field gradient features using different combination methods of the magnetic gradient tensor components. The combination methods include the THDR (Total Horizontal Derivative of the magnetic field), ASM (Analytical Signal Method), and Theta method. Among them, the THDR method is used to calculate the amplitude of the horizontal gradient, the ASM method 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: Identify magnetic field anomaly information by analyzing the magnetic field gradient features. The magnetic field anomaly information represents the area where the magnetic field intensity or gradient changes; S24: Extract the magnetic source boundary from the encrypted and reconstructed magnetic map data using the magnetic field anomaly information.
5. The method according to claim 4, wherein Step S23 specifically includes the following sub-steps: S231: Set thresholds corresponding to the horizontal gradient amplitude, total gradient modulus, and the angle between the total gradient and the horizontal gradient, respectively; S232: Mark the magnetic field gradient features exceeding the corresponding thresholds as magnetic field anomaly regions; S233: Perform clustering analysis on the marked magnetic field anomaly regions to obtain the clustered magnetic field anomaly regions; S234: Determine the range and distribution information of each clustered magnetic field anomaly region; S235: Generate magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly regions; Step S24 specifically includes the following sub-steps: S241: Select an edge detection algorithm based on the magnetic field anomaly information including the range and distribution information of the clustered magnetic field anomaly regions; S242: Apply the edge detection algorithm to the magnetic field anomaly regions in the encrypted and reconstructed magnetic map data to obtain magnetic field anomaly regions with enhanced edge features; S243: Extract the contour of the magnetic field anomaly region based on the magnetic field anomaly region with enhanced edge features; S244: Perform optimization processing on the contour of the magnetic field anomaly region to obtain an optimized contour; S245: Determine the optimized contour as the magnetic source boundary.
6. The method according to claim 1, wherein 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 the first color mapping scheme for representing the magnetic field intensity change according to the magnetic field intensity range; S303: Determine the second color mapping scheme for representing the degree of magnetic field anomaly according to the magnetic field anomaly information; S304: Convert the magnetic source boundary into a magnetic source boundary vector layer; S305: Apply the first color mapping scheme to the encrypted and reconstructed magnetic map data to generate a basic pseudo-color magnetic map; S306: Overlay 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 regions; S307: Superimpose the magnetic source boundary vector layer on the comprehensive pseudo-color magnetic map to form an integrated magnetic map containing magnetic field strength, magnetic anomalies, and magnetic source boundary information; S308: Add auxiliary information including a legend, scale, and direction indication to the integrated magnetic map to obtain a complete magnetic map; S309: Perform standardization processing on the resolution and format of the complete magnetic map and save it in a standard format to form a single standardized magnetic image; S310: Organize and annotate the generated multiple standardized magnetic images to obtain a structured magnetic image dataset.
7. The method according to claim 1, characterized in that, Step S40 specifically includes the following sub-steps: S401: Prepare a training dataset, which includes dividing the magnetic image dataset into a training set, a validation set, and a test set; S402: Annotate the magnetic images in the training set, and the annotation content includes the location and type of pipeline defects; S403: Design the structure of a pipeline defect detection model based on the improved R-CNN; S404: Initialize the parameters of the pipeline defect detection model and select pre-trained weights; S405: Use the training set to train the pipeline defect detection model, and utilize the pre-trained weights selected in step S404 during the training process; A predetermined learning rate adjustment strategy and optimizer are also adopted during the training process; S406: After each training epoch ends, use the validation set to evaluate the performance of the pipeline defect detection model to obtain performance evaluation results corresponding to multiple performance evaluation metrics, and the multiple performance evaluation metrics include calculated accuracy, recall rate, and average precision; S407: According to the performance evaluation results of the validation set, adjust the hyperparameters of the pipeline defect detection model, and the hyperparameters include learning rate, batch size, and number of training epochs; S408: Repeat steps S405 to S407 until the performance of the pipeline defect detection model converges or reaches a preset number of training epochs; S409: Use the test set to perform a final test on the trained pipeline defect detection model to obtain the performance metrics of the model on the test set; S410: If the test results do not meet the predetermined standards, take one or more of the following measures: Return to step S403 and adjust the structure of the pipeline defect detection model; Return to step S404 and adjust the initialization parameters of the pipeline defect detection model; Adjust the training strategy, which includes: changing the learning rate adjustment strategy or using a different optimizer in step S405; adding or changing performance evaluation metrics in S406; adjusting the range of hyperparameters in step S407; and then repeating steps S405 to S409; S411: If the test results meet the predetermined standards, confirm that the trained pipeline defect detection model is obtained.
8. The method according to claim 7, wherein 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; The feature extraction network is used to extract useful feature maps from the input magnetic images; The region proposal network RPN is used to slide a window on the feature map output by the feature extraction network to generate candidate regions that may contain pipeline defects; A classification network, which is used to classify the candidate regions generated by the RPN and determine whether the candidate regions contain pipeline defects and the specific defect types; A bounding box regression network, which is used to adjust the position and size of the candidate regions according to the feature map and the candidate regions, so as to more accurately locate the defect types and positions of the pipeline defects.
9. The method according to claim 7, characterized in that, Step S50 specifically includes the following sub-steps: S51: Preprocess the newly input magnetic image to make it meet the input requirements of the pipeline defect detection model; S52: Input the preprocessed magnetic image into the trained pipeline defect detection model; S53: Obtain the output results of the pipeline defect detection model, which include the predicted pipeline defect positions and types; S54: Post-process the output results of the pipeline defect detection model, which includes non-maximum suppression and / or threshold filtering, to obtain the final pipeline defect detection results; S55: Visualize and output the final pipeline defect detection results, which includes annotating the positions and types of the detected pipeline defects on the original magnetic image.
10. A magnetometer, characterized in that, It includes: A magnetic gradient tensor sensor array, which is used to collect magnetic field data; The magnetic gradient tensor sensor array includes a plurality of three-component magnetic sensors, which are used to measure three orthogonal components of the magnetic field; A non-magnetic XY-axis slide rail, which is used to support and move the magnetic gradient tensor sensor array; The non-magnetic XY-axis slide rail includes: A frame, which constitutes the main structure of the slide rail; Fixing parts, which are used to connect and fix each part of the frame; An X-axis sliding mechanism and a Y-axis sliding mechanism, which are used to realize the two-dimensional movement of the magnetic gradient tensor sensor array in the horizontal plane; A control unit, which is electrically connected to the magnetic gradient tensor sensor array and the non-magnetic XY-axis slide rail, and is used to control the movement and data collection of the magnetic gradient tensor sensor array; A data processing unit, which 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 according to any one of claims 1-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