Oil and gas pipeline defect three-dimensional imaging method and system based on magnetic flux leakage detection
By using data processing and magnetic charge models based on magnetic flux leakage detection, the problems of insufficient signal stability and poor imaging effect in traditional oil and gas pipeline detection systems have been solved, enabling accurate identification and quantification of pipeline defects and improving the accuracy and reliability of detection.
Patent Information
- Application Number
- CN202511127046.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-11-28
AI Technical Summary
Traditional oil and gas pipeline inspection systems suffer from insufficient signal stability, poor imaging of complex defects, and difficulty in fully reflecting the true state of defects, leading to assessment bias.
By reading leakage magnetic field detection data, preprocessing is performed to calculate physical coordinates, setting high and low thresholds to identify abnormal signal areas, merging adjacent or overlapping areas to form independent defects, using a magnetic charge model to predict the magnetic field and normalize it, and receiving defect parameters input by the user to perform three-dimensional inversion quantification of defect features.
It enables accurate identification and quantification of defects in oil and gas pipelines, provides intuitive 3D views and thermal maps, improves the accuracy and completeness of detection, and provides a reliable basis for pipeline maintenance.
Smart Images

Figure CN121029048A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of oil and gas pipeline inspection, and specifically to a three-dimensional imaging method and system for oil and gas pipeline defects based on magnetic flux leakage detection. Background Technology
[0002] In the oil and gas industry, the safe operation of pipelines is of paramount importance. Traditional pipeline inspection methods have long suffered from low accuracy, low efficiency, and complex operation, making it difficult to meet the high safety monitoring requirements of the modern oil and gas industry. With the development of magnetic flux leakage (MFL) detection technology and its integration with 3D imaging technology, 3D imaging systems for oil and gas pipeline defects based on MFL detection are gradually becoming mainstream. According to relevant standards and practical data, this system has a 100% reliability rate in detecting the length and width of pipeline defects and a 75% reliability rate in depth detection. Its application in the domestic oil and gas pipeline inspection field has gradually become widespread.
[0003] Early pipeline magnetic flux leakage (MFL) detection relied heavily on foreign technology, resulting in limited data processing and imaging accuracy. With advancements in domestic technology, combined with innovative methods such as composite telescopic flexible acquisition technology and unique iterative methods, the system's imaging accuracy and resolution have significantly improved. Its 3D visualization capabilities have broken through the limitations of traditional 2D imaging, allowing for the intuitive presentation of three-dimensional defect information, making it a primary technical solution for pipeline inspection. By optimizing data processing algorithms and sensor configurations, the system's ability to identify complex defects has been continuously enhanced, further improving the reliability of pipeline safety assessments. The development of oil and gas pipeline defect detection technology has also driven in-depth research into the performance of its detection systems. Performance evaluation of MFL detection systems not only determines key indicators such as detection accuracy and efficiency but also analyzes the correlation between environmental factors and defect types affecting detection effectiveness, providing a theoretical basis for system optimization and pipeline maintenance. During pipeline inspection, 3D imaging is essential to clearly display the location, shape, and size of defects, providing operators with accurate judgment criteria.
[0004] However, traditional detection systems suffer from problems such as insufficient signal stability and poor imaging of complex defects, making it difficult to fully reflect the true state of defects and potentially leading to assessment bias. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention provides a three-dimensional imaging method and system for oil and gas pipeline defects based on magnetic flux leakage detection, in order to solve the technical problems of insufficient signal stability, poor imaging effect of complex defects, and difficulty in fully reflecting the true state of defects in existing traditional detection systems, which may lead to evaluation bias.
[0006] This invention provides a three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection, comprising:
[0007] S1. Read the magnetic flux leakage detection data, preprocess the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and use the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline.
[0008] S2. Generate a three-dimensional graphic by statistically analyzing the features in the sensor readings, set high and low thresholds to identify abnormal signal regions, identify abnormal points in the three-dimensional graphic, and integrate the identified abnormal points to form connected component labels.
[0009] S3. Merge adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, count the number of defects and mark them with bounding boxes;
[0010] S4. Use the magnetic charge model to predict the field points within the bounding box and output the predicted magnetic field.
[0011] S5. Normalize the predicted magnetic field and the measured magnetic field, receive the defect parameters input by the user, and use three-dimensional defect inversion to quantify the defect features.
[0012] Optionally, the step of preprocessing the sensor readings in the magnetic flux leakage detection data and using the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline includes:
[0013] S101. Convert the sensor readings into a measured magnetic field in Tesla units;
[0014] S102. Calculate the axial coordinates along the direction of the oil and gas pipeline, and express the axial resolution as:
[0015]
[0016] Where v is the pulling speed, f is the sampling frequency, and the axial coordinate vector is calculated based on the axial resolution, expressed as:
[0017] x i =i×ΔX
[0018] Where i is the index of the axial data point, and ΔX is the distance between adjacent data points along the axial direction;
[0019] S103. Calculate the circumferential coordinates along the circumference of the oil and gas pipeline, expressed as:
[0020]
[0021] Where, d k s represents the distance between the k-th sensor and the previous sensor, and s represents the sensor number.
[0022] Optionally, the step of generating a three-dimensional graphic from the statistical features of the sensor readings, setting high and low thresholds to identify abnormal signal regions, and marking connected components includes:
[0023] S201. Define the mean magnetic field strength as follows:
[0024]
[0025] And define the standard deviation of the magnetic field strength:
[0026]
[0027] Where B(i,j) is the magnetic field strength at point (i,j) in the data matrix, and M and N are the axial coordinates and axial coordinates, respectively.
[0028] The number of rows and columns of the transformed data matrix;
[0029] S202. Set a high threshold to identify abnormally high regions, as follows:
[0030] B high =max(μ+k×σ,percentile(B,p high ))
[0031] Where k is the standard deviation multiplier, B high High percentile;
[0032] Setting a low threshold to identify abnormally high regions is represented as follows:
[0033] B low =m(μ-k×σ,percentile(B,p low ))
[0034] Where, p low Lower percentile;
[0035] S203. Perform regional integration on outliers that meet the conditions, as shown below:
[0036] Anomalies B(i,j)>B high Or B(i,j) low
[0037] And remove regions with an area smaller than the minimum threshold, represented as:
[0038] Area(R)≥S min
[0039] Where Area(R) is the number of pixels contained in the connected region R, and S min This is the minimum area threshold.
[0040] Optionally, merging adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, counting and marking the number of defects, is represented as follows:
[0041] S301, Define the first bounding box of the defect region R1 = [r1 min c1 min r1 max c1 max ] and the second bounding box R2 = [r2 min c2 min r2 max c2 max The merging condition for defective regions is expressed as follows:
[0042] Axial overlap is represented as:
[0043] c1 max +d≥c2 min And c2 max +d≥c1 min
[0044] Circumferential overlap is represented as:
[0045] r1 max +d≥r2 min And r2 max +d≥r1 min
[0046] Where d is the merging threshold;
[0047] S302. Calculate the merged boundary box R. merge , is represented as:
[0048] R merge =[min(r1) min r2 min ),min(c1 min c2 min ),max(r1 min r2 min ),max(c1 min c2 min )).
[0049] Optionally, the prediction of field points within the bounding box using a magnetic charge model includes:
[0050] S401. Calculate the magnetic field strength B produced by a single magnetic charge q at the spatial point (x,y,z). z , is represented as:
[0051]
[0052] in, (x q ,y q ,z q (x, y, z) represents the position coordinates of the magnetic charge, and (x, y, z) represents the field point coordinates.
[0053] S402. Calculate the total magnetic field strength at each observation point within the bounding box, expressed as:
[0054]
[0055] Where n is the total number of magnetic charges, B z (k) The magnetic field contribution for the k-th magnetic charge.
[0056] Optionally, the step of normalizing the predicted magnetic field and the measured magnetic field, receiving defect parameters input by the user, and employing three-dimensional defect inversion includes:
[0057] S501. Normalize the predicted magnetic field, as follows:
[0058]
[0059] Where, μ B σ is the mean magnetic field value. B The standard deviation of the magnetic field is ∈ = 1e-8;
[0060] S502. Construct the loss function for the three-dimensional inversion of defects, and express the normalized mean square error of the predicted magnetic field and the measured magnetic field as follows:
[0061]
[0062] in, The normalized predicted magnetic field, The measured magnetic field is normalized, and N is the number of data points.
[0063] S503. Receive the defect parameters input by the user, quantize the parameters, calculate their gradient, and express it as follows:
[0064]
[0065] Where θ is the parameter to be optimized (l, w, h), Δ θ For small perturbations, l represents length, w represents width, and h represents depth.
[0066] This invention also provides a three-dimensional imaging system for oil and gas pipeline defects based on magnetic flux leakage detection, comprising:
[0067] The data reading module preprocesses the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and uses the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline.
[0068] The defect analysis module statistically analyzes the features in the sensor readings to generate a three-dimensional image, sets high and low thresholds to identify abnormal signal regions, identifies abnormal points in the three-dimensional image, and integrates the identified abnormal points to form connected component labels.
[0069] The defect marking module merges adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, counts the number of defects, and marks them with bounding boxes.
[0070] The magnetic field prediction module uses a magnetic charge model to predict the field points within the bounding box and outputs the predicted magnetic field.
[0071] The defect inversion module normalizes the predicted magnetic field and the measured magnetic field, receives defect parameters input by the user, and uses three-dimensional defect inversion to quantify defect features.
[0072] Compared with the prior art, the present invention:
[0073] This invention first converts raw data into physically meaningful magnetic field strength units and calculates physical coordinates. It also features an automatic defect detection and merging algorithm, enabling precise identification of abnormal areas and the creation of independent defect markers. During the detection process, the location, shape, and magnetic field signal characteristics of defects are visually displayed through an overall 3D view, defect heat map, and 3D imaging of specific defect areas. Combined with the 3D defect inversion function, defect size can be further quantified, providing a reliable basis for the accurate assessment and maintenance of oil and gas pipeline defects. Attached Figure Description
[0074] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0075] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0076] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0077] Figure 2 This is a schematic diagram of the data reading module and the defect analysis module of the system of the present invention;
[0078] Figure 3 This is a schematic diagram of the defect marking module and the predicted magnetic field module of the system of the present invention;
[0079] Figure 4This is a schematic diagram of any defect in the defect inversion module of the system of the present invention;
[0080] Figure 5 This is a schematic diagram of another defect in the defect inversion module of the system of the present invention. Detailed Implementation
[0081] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other implementation cases obtained by those skilled in the art without creative effort are within the scope of protection of this application. Functional units with the same reference numerals in the examples of this invention have the same and similar structures and functions.
[0082] See Figure 1 This invention provides a three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection, comprising:
[0083] S1. Read the magnetic flux leakage detection data, preprocess the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and use the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline.
[0084] S2. Generate a three-dimensional graphic by statistically analyzing the features in the sensor readings, set high and low thresholds to identify abnormal signal regions, identify abnormal points in the three-dimensional graphic, and integrate the identified abnormal points to form connected component labels.
[0085] S3. Merge adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, count the number of defects and mark them with bounding boxes;
[0086] S4. Use the magnetic charge model to predict the field points within the bounding box and output the predicted magnetic field.
[0087] S5. Normalize the predicted magnetic field and the measured magnetic field, receive the defect parameters input by the user, and use three-dimensional defect inversion to quantify the defect features.
[0088] See Figure 1 and Figure 2 In this embodiment, S1, read the magnetic flux leakage detection data, preprocess the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and use the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline.
[0089] First, various types of magnetic flux leakage detection data from the sensors are collected. This data is then preprocessed to convert it into a measured magnetic field in Tesla units (T). Finally, the axial and circumferential physical coordinates (in meters) of the data points on the pipe are calculated based on parameters such as probe spacing and detection speed.
[0090] Calculate the axial coordinates along the direction of the oil and gas pipeline, and express the axial resolution (in meters) as follows:
[0091]
[0092] Where v is the pulling speed (unit: m / s), and f is the sampling frequency (unit: Hz), the units have been converted to Hz in the above formula, that is, the sampling frequency f is simply represented as the value 1 in 1kHz, and the axial coordinate vector is calculated based on the axial resolution, expressed as:
[0093] x i =i×ΔX
[0094] Where i is the axial data point index (0,1,...,N-1), and ΔC is the distance between adjacent axial data points;
[0095] The circumferential coordinates along the circumference of the oil and gas pipeline are calculated as follows:
[0096]
[0097] Where, d k s represents the distance between the k-th sensor and the previous sensor, and s represents the sensor number.
[0098] S2. Generate a three-dimensional graphic by statistically analyzing the features in the sensor readings, set high and low thresholds to identify abnormal signal regions, identify abnormal points in the three-dimensional graphic, and integrate the identified abnormal points to form connected component labels.
[0099] The mean magnetic field strength (unit: T) is defined as follows:
[0100]
[0101] And define the standard deviation of the magnetic field strength:
[0102]
[0103] Where B(i,j) is the magnetic field strength at point (i,j) in the data matrix, and M and N are the number of rows and columns of the data matrix for axial coordinates and axial coordinate transformation, respectively;
[0104] Setting a high threshold to identify abnormally high regions is represented as follows:
[0105] B high=max(μ+k×σ,percentile(B,p high ))
[0106] Where k is the standard deviation multiplier, B high High percentile;
[0107] Setting a low threshold to identify abnormally high regions is represented as follows:
[0108] B low =m(μ-k×σ,percentile(B,p low ))
[0109] Where, p low It is the lower percentile.
[0110] Outliers that meet the criteria are integrated into regions, represented as follows:
[0111] Anomalies B(i,j)>B high Or B(i,j) low
[0112] And remove regions with an area smaller than the minimum threshold, represented as:
[0113] Area(R)≥S min
[0114] Where Area(R) is the number of pixels contained in the connected region R, and S min This is the minimum area threshold.
[0115] S3. Merge adjacent or overlapping areas in the high and low threshold abnormal signal regions to form independent defects, count the number of defects and mark them with bounding boxes.
[0116] The first bounding box defining the defect region is R1 = [r1] min c1 min r1 max c1 max ] and the second bounding box R2 = [r2 min c2 min r2 max c2 max The merging condition for defective regions is expressed as follows:
[0117] Axial overlap is represented as:
[0118] c1 max +d≥c2 min And c2 max +d≥c1 min
[0119] Circumferential overlap is represented as:
[0120] r1 max +d≥r2 min And r2 max +d≥r1 min
[0121] Where d is the merging threshold;
[0122] Calculate the merged bounding box R. merge , is represented as:
[0123] R merge =[min(r1) min r2 min ),min(c1 min c2 min ),max(r1 min r2 min ),max(c1 min c2 min )).
[0124] S4. Use the magnetic charge model to predict the field points within the bounding box and output the predicted magnetic field.
[0125] S401. Calculate the magnetic field strength B produced by a single magnetic charge q at the spatial point (x,y,z). z , is represented as:
[0126]
[0127] in, (x q ,y q ,z q (x, y, z) represents the position coordinates of the magnetic charge, and (x, y, z) represents the field point coordinates.
[0128] S402. Calculate the total magnetic field strength at each observation point within the bounding box, expressed as:
[0129]
[0130] Where n is the total number of magnetic charges, B z (k) The magnetic field contribution for the k-th magnetic charge.
[0131] S5. Normalize the predicted magnetic field and the measured magnetic field, receive the defect parameters input by the user, and use three-dimensional defect inversion to quantify the defect features.
[0132] The predicted magnetic field is normalized and expressed as:
[0133]
[0134] Where, μ B σ is the mean magnetic field value. B The standard deviation of the magnetic field is ∈ = 1e-8;
[0135] A loss function for the three-dimensional inversion of defects is constructed, and the normalized mean square error of the predicted magnetic field and the measured magnetic field is expressed as:
[0136]
[0137] in, The normalized predicted magnetic field, The measured magnetic field is normalized, and N is the number of data points.
[0138] Receive defect parameters input by the user, quantize the parameters and calculate their gradients, represented as:
[0139]
[0140] Where θ is the parameter to be optimized (l, w, h), Δ θ For small perturbations (in this invention, small perturbations refer to errors that may approach zero when the predicted and measured values are very close, causing the update step size to be too small or even stall during gradient descent. Adding a perturbation term ensures that the denominator in the gradient formula does not become zero. To avoid singularities: to prevent the division by zero problem caused by r→0 when the magnetic charge coincides with the field point), l represents length, w represents width, and h represents depth.
[0141] This invention first features data preprocessing capabilities, converting raw sensor readings into magnetic field strength in Tesla (T) units and calculating physical coordinates to ensure the physical meaning and accuracy of the data, laying the foundation for subsequent analysis. Secondly, it supports switching between physical and indexed coordinate displays. Physical coordinates facilitate understanding the actual location and size of defects, while indexed coordinates aid in algorithm debugging and pure data-driven analysis, meeting the needs of different scenarios. Furthermore, it can generate an overall 3D view, a defect heatmap, and 3D images of specific defect areas, intuitively displaying the distribution of magnetic field signals and defect characteristics from a macroscopic to a local perspective, aiding in accurate defect identification. Thirdly, by setting high and low thresholds, it automatically finds defects and merges adjacent or overlapping areas, reducing false positives and improving the accuracy and completeness of defect detection. Fourthly, the defect 3D inversion module can receive initial size parameters and initiate inversion, further quantifying defect characteristics and providing more detailed evidence for defect assessment. Finally, after loading data, the invention clears historical results and updates the status, ensuring the independence and accuracy of the analysis, while enabling subsequent operation buttons to improve the smoothness of system operation.
[0142] This invention also provides a three-dimensional imaging system for oil and gas pipeline defects based on magnetic flux leakage detection, comprising:
[0143] The data reading module preprocesses the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and uses the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline.
[0144] The defect analysis module statistically analyzes the features in the sensor readings to generate a three-dimensional image, sets high and low thresholds to identify abnormal signal regions, identifies abnormal points in the three-dimensional image, and integrates the identified abnormal points to form connected component labels.
[0145] The defect marking module merges adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, counts the number of defects, and marks them with bounding boxes.
[0146] The magnetic field prediction module uses a magnetic charge model to predict the field points within the bounding box and outputs the predicted magnetic field.
[0147] The defect inversion module normalizes the predicted magnetic field and the measured magnetic field, receives defect parameters input by the user, and uses three-dimensional defect inversion to quantify defect features.
[0148] In another embodiment, see Figure 2 The following operations can be performed in the data reading module:
[0149] 1. Select File: The user needs to select a file (.txt) containing magnetic flux leakage detection data.
[0150] 2. Data Loading and Preprocessing: The program reads the values from the file and performs a series of pre-unit conversions: converting the raw, unitless sensor readings into physically meaningful units of magnetic field strength. Tesla (T)
[0151] 3. Coordinate Calculation: Call the function to calculate the actual physical coordinates (axial and circumferential, in meters) of each point on the pipeline for each point in the data matrix based on the parameters such as probe spacing, sensor spacing, and detection speed defined in the configuration file.
[0152] 4. Status Update: After successful loading, the program will clear all previous analysis results (such as found defects) and enable buttons for subsequent operations (such as "Show Overall 3D Image" and "Find Defects"). The status label will display the filename of the successfully loaded file.
[0153] Display using index coordinates (using index coordinates);
[0154] Function: This checkbox is used to switch the coordinate axis display method for all subsequent images.
[0155] Function: Unchecked (default): The X and Y axes of all 3D and 2D plots will be displayed (in millimeters, physical coordinates, millimeters), which is very useful for understanding the actual location and size of defects.
[0156] Check the box: The axes of all images will be displayed (i.e., row and column numbers). This is useful for indexing data matrices when debugging algorithms or analyzing problems from a purely data-driven perspective.
[0157] See Figure 2 The defect analysis module is used to visualize the data after loading the preceding data. Specifically:
[0158] 1. Image generation: The program will draw the entire magnetic flux leakage data matrix as a three-dimensional surface plot in the "Overall 3D View" tab on the right.
[0159] 2. Coordinate system: The X and Y axes of the surface display physical coordinates according to the status of the checkboxes mentioned above.
[0160] 3. Purpose: This diagram allows users to have a macroscopic and intuitive understanding of the magnetic field signal distribution throughout the detection area. It can usually give a general idea of the location of abnormal signals (i.e., possible defects).
[0161] See Figure 3 The defect marking module is used to automatically search for and mark all potential defect areas in the loaded data, specifically:
[0162] 1. Algorithm Detection: The program will run a defect detection algorithm. This algorithm identifies areas with abnormal signals (signals significantly higher or lower than the average value) by setting two thresholds: high and low.
[0163] 2. Region labeling: All identified outliers are grouped into independent regions (“connected regions”).
[0164] 3. Defect merging: To avoid misclassifying a complex defect as multiple smaller defects, the algorithm merges closely spaced or overlapping abnormal regions into a larger defect box (bounding box).
[0165] See Figure 3 The magnetic field prediction module is as follows:
[0166] 1. The results include:
[0167] Quantity Update: Displays the total number of defects found in the "Defect Count" text box.
[0168] Create a heatmap: In the "Defect Heatmap" tab on the right, display the entire data in a two-dimensional color map (heatmap) and mark each identified defect with a numbered red rectangle.
[0169] 2. Activate subsequent buttons: After a defect is found, buttons for analyzing individual defects (such as "Show Defect", "Defect Site Prediction", etc.) will be activated.
[0170] See Figure 4 and Figure 5 The defect inversion module is used to view the original signal of a specific defect in detail, specifically:
[0171] 1. Select Defect: Users need to enter a number (corresponding to the number in the red box on the heat map) in the "Select Defect Number" text box next to it.
[0172] 2. Data Extraction: The program will accurately extract the signal data of the defect and its surrounding area from the total data based on the input sequence number.
[0173] 3. 3D visualization: In the "Defect Area" tab on the right, this local data can be plotted as a detailed 3D surface map.
[0174] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0175] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection, characterized in that, include: S1. Read the magnetic flux leakage detection data, preprocess the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and use the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline. S2. Generate a three-dimensional graphic by statistically analyzing the features in the sensor readings, set high and low thresholds to identify abnormal signal regions, identify abnormal points in the three-dimensional graphic, and integrate the identified abnormal points to form connected component labels. S3. Merge adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, count the number of defects and mark them with bounding boxes; S4. Use the magnetic charge model to predict the field points within the bounding box and output the predicted magnetic field. S5. Normalize the predicted magnetic field and the measured magnetic field, receive the defect parameters input by the user, and use three-dimensional defect inversion to quantify the defect features.
2. The three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection as described in claim 1, characterized in that, The step of preprocessing the sensor readings in the magnetic flux leakage detection data and calculating the physical coordinates of the oil and gas pipeline using the processed sensor readings includes: S101. Convert the sensor readings into a measured magnetic field in Tesla units; S102. Calculate the axial coordinates along the direction of the oil and gas pipeline, and express the axial resolution as: Where v is the pulling speed, f is the sampling frequency, and the axial coordinate vector is calculated based on the axial resolution, expressed as: x i =i×ΔX Where i is the index of the axial data point, and ΔX is the distance between adjacent data points along the axial direction; S103. Calculate the circumferential coordinates along the circumference of the oil and gas pipeline, expressed as: Where, d k s represents the distance between the k-th sensor and the previous sensor, and s represents the sensor number.
3. The three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection as described in claim 2, characterized in that, The process of generating a three-dimensional graphic from the features in the sensor readings, setting high and low thresholds to identify abnormal signal regions, and marking connected components includes: S201. Define the mean magnetic field strength as follows: And define the standard deviation of the magnetic field strength: Where B(i,j) is the magnetic field strength at point (i,j) in the data matrix, and M and N are the number of rows and columns of the data matrix for axial coordinates and axial coordinate transformation, respectively; S202. Set a high threshold to identify abnormally high regions, as follows: B high =max(μ+k×σ,percentile(B,p high )) Where k is the standard deviation multiplier, B high High percentile; Setting a low threshold to identify abnormally high regions is represented as follows: B low =m(μ-k×σ,percentile(B,p low )) Where, p low Lower percentile; S203. Perform regional integration on outliers that meet the conditions, as shown below: Or B(i,j) low And remove regions with an area smaller than the minimum threshold, represented as: Area(R)≥S min Where Area(R) is the number of pixels contained in the connected region R, and S min This is the minimum area threshold.
4. The three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection as described in claim 3, characterized in that, The process of merging adjacent or overlapping regions within the high and low threshold abnormal signal regions to form independent defects, counting and marking the number of these defects, is represented as follows: S301, Define the first bounding box of the defect region R1 = [r1 min c1 min r1 max c1 max ] and the second bounding box R2 = [r2 min c2 min r2 max c2 max The merging condition for defective regions is expressed as follows: Axial overlap is represented as: c1 max +d≥c2 min And c2 max +d≥c1 min Circumferential overlap is represented as: r1 max +d≥r2 min And r2 max +d≥r1 min Where d is the merging threshold; S302. Calculate the merged boundary box R. merge , is represented as: R merge =[min(r1 min ,r2 min ),min(c1 min ,c2 min ),max(r1 min ,r2 min ),max(c1 min ,c2 min )]。 5. The three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection as described in claim 4, characterized in that, The prediction of field points within the bounding box using a magnetic charge model includes: S401. Calculate the magnetic field strength B produced by a single magnetic charge q at the spatial point (x,y,z). z , is represented as: in, (x q ,y q ,z q (x, y, z) represents the position coordinates of the magnetic charge, and (x, y, z) represents the field point coordinates. S402. Calculate the total magnetic field strength at each observation point within the bounding box, expressed as: Where n is the total number of magnetic charges, B z (k) The magnetic field contribution for the k-th magnetic charge.
6. The three-dimensional imaging method for oil and gas pipeline defects based on magnetic flux leakage detection as described in claim 5, characterized in that, The process of normalizing the predicted magnetic field and the measured magnetic field, receiving defect parameters input by the user, and employing three-dimensional defect inversion includes: S501. Normalize the predicted magnetic field, as follows: Where, μ B σ is the mean magnetic field value. B The standard deviation of the magnetic field is ∈ = 1e-8; S502. Construct the loss function for the three-dimensional inversion of defects, and express the normalized mean square error of the predicted magnetic field and the measured magnetic field as follows: in, The normalized predicted magnetic field, The measured magnetic field is normalized, and N is the number of data points. S503. Receive the defect parameters input by the user, quantize the parameters, calculate their gradient, and express it as follows: Where θ is the parameter to be optimized (l, w, h), Δ θ For small perturbations, l represents length, w represents width, and h represents depth.
7. A three-dimensional imaging system for oil and gas pipeline defects based on magnetic flux leakage detection, characterized in that, include: The data reading module preprocesses the sensor readings in the magnetic flux leakage detection data to obtain the measured magnetic field, and uses the processed sensor readings to calculate the physical coordinates of the oil and gas pipeline. The defect analysis module statistically analyzes the features in the sensor readings to generate a three-dimensional image, sets high and low thresholds to identify abnormal signal regions, identifies abnormal points in the three-dimensional image, and integrates the identified abnormal points to form connected component labels. The defect marking module merges adjacent or overlapping regions in the high and low threshold abnormal signal regions to form independent defects, counts the number of defects, and marks them with bounding boxes. The magnetic field prediction module uses a magnetic charge model to predict the field points within the bounding box and outputs the predicted magnetic field. The defect inversion module normalizes the predicted magnetic field and the measured magnetic field, receives defect parameters input by the user, and uses three-dimensional defect inversion to quantify defect features.
Citation Information
Cited By
Track defect three-dimensional reconstruction method and system based on magneto-optical sensing imaging
CN122336152A