A magnetic flux leakage detection method for oil and gas pipelines based on dual attention network

By adaptively fusing multi-scale and temporal features through a dual attention network, the problems of low efficiency and insufficient precision in traditional pipeline magnetic leakage detection methods are solved, and efficient and accurate detection of oil and gas pipeline defects is achieved.

CN116309521BActive Publication Date: 2025-09-30HEFEI UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310346527.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2025-09-30
Estimated Expiration
2043-04-03

AI Technical Summary

Technical Problem

Traditional pipeline magnetic flux leakage detection methods have problems in low efficiency, difficult feature extraction and insufficient accuracy in oil and gas pipeline defect identification, especially when processing large-scale and diverse magnetic flux leakage curve images.

Method used

A detection method based on a dual attention network is adopted, including a multi-scale convolutional neural network module, a scale attention module, a bidirectional gated recurrent unit module, a temporal attention module and a fully connected network prediction module. The detection accuracy is improved by adaptively fusing multi-scale and temporal features.

Benefits of technology

It achieves efficient and accurate detection of oil and gas pipeline defects and can perform end-to-end prediction without prior knowledge. It has the advantages of simple operation and strong generalization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309521B_ABST
    Figure CN116309521B_ABST
Patent Text Reader

Abstract

This invention discloses a magnetic flux leakage detection method for oil and gas pipelines based on a dual-attention network, belonging to the field of pipeline maintenance technology. The method comprises the following steps: 1. Using a magnetic flux leakage detector to collect magnetic flux leakage curve images of the oil and gas pipelines and construct a magnetic flux leakage image dataset for the oil and gas pipelines; 2. Building a dual-attention network, the network structure comprising a multi-scale convolutional neural network module, a scale attention module, a bidirectional gated recurrent unit module, a temporal attention module, and a fully connected network prediction module; 3. Training the dual-attention network model and optimizing the model parameters; and 4. Predicting pipeline defects using the trained dual-attention model. This method can adaptively fuse defect features at multiple scales and differentially utilize features at different times, thereby improving the effectiveness of magnetic flux leakage detection for oil and gas pipelines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a magnetic flux leakage detection method for oil and gas pipelines based on a dual attention network, belonging to the technical field of pipeline maintenance. Background Art

[0002] Magnetic flux leakage (MFL) internal inspection is currently one of the most effective pipeline inspection methods. The relatively lightweight inspection equipment used, with high throughput and efficiency, and its operation without disrupting pipeline transportation, has made this method popular in the industry. This method utilizes Hall effect elements within the detector to detect defects by measuring changes in magnetic flux. It can effectively detect defects such as gouging, pitting, missing metal, and porosity, enabling timely prediction of defects such as thinning, perforation, or rupture in oil and gas pipelines, enabling appropriate remedial measures.

[0003] Traditional pipeline magnetic flux leakage (MFL) signal recognition methods primarily rely on template matching and manual feature extraction. Template matching uses artificially created standard defect samples to detect MFL magnetic fields and extract defect signal features. However, this method requires a large number of defect samples, resulting in a long processing time and low efficiency. Manual feature extraction uses feature extraction algorithms to predict defect types and characteristic parameters. However, this extraction process introduces noise, which can affect defect signal identification and parameter analysis and evaluation. The selection and extraction of features remains challenging. Image recognition is also a common method for defect detection based on pipeline MFL images. However, traditional image recognition methods have limited feature extraction capabilities and struggle to process large-scale MFL images with diverse feature types. With the recent advancements in deep learning in image recognition, deep neural networks have been used to process MFL image data, enabling more efficient identification of pipeline defects. However, oil and gas pipeline defects exhibit significant scale variation and dynamic characteristics, resulting in low accuracy for MFL detection using MFL images. Summary of the Invention

[0004] To solve the above problems, the present invention provides an oil and gas pipeline magnetic flux leakage detection method based on a dual attention network, in order to adaptively fuse defect features at multiple scales and realize differential utilization of features at different times, thereby improving the oil and gas pipeline magnetic flux leakage detection effect.

[0005] In order to achieve the above-mentioned object, the present invention adopts the following technical solutions:

[0006] The invention provides a method for detecting magnetic flux leakage in oil and gas pipelines based on a dual attention network, which comprises the following steps:

[0007] Step 1: collect the magnetic flux leakage curve image of the oil and gas pipeline through the magnetic flux leakage detector, and construct the oil and gas pipeline magnetic flux leakage image dataset D = {D i |i=1,2,3,...,I}, where D i is the i-th image sample, and D i =(X i ,y i ), represents the magnetic leakage image of the i-th oil and gas pipeline, y i Represents X i One-hot encoding corresponding to the oil and gas pipeline defect category, where L and W are the image length and width respectively;

[0008] Step 2: Build a dual attention network, which includes: a multi-scale convolutional neural network module, a scale attention module, a bidirectional gated recurrent unit module, a temporal attention module, and a fully connected network prediction module;

[0009] Step 2.1, define the number of iterations as z, initialize z=1, and the iteration threshold as Z; initialize the parameters in the dual attention network;

[0010] Step 2.2: The i-th oil and gas pipeline magnetic leakage image X in the sample set is i Input the dual attention network for processing and output the prediction vector of the oil and gas pipeline defect category at the zth iteration accordingly

[0011] Step 2.3, use formula (9) to calculate the improved focal loss function FL at the zth iteration (z) :

[0012]

[0013] In formula (9), δ is the manually set adjustment factor;

[0014] In step 2.4, based on the sample set D of the magnetic flux leakage curve image of the oil and gas pipeline, the focal loss function is minimized, and the parameters in the dual attention network are optimized and updated through the time backpropagation algorithm and the adaptive moment estimation optimization algorithm until z>Z. The training is terminated to obtain a trained dual attention network model for predicting defects in the oil and gas pipeline.

[0015] The oil and gas pipeline magnetic flux leakage detection method based on the dual attention network described in the present invention is also characterized in that the step 2.2 includes the following steps:

[0016] Step 2.2.1, the oil and gas pipeline magnetic leakage image X iInput the multi-scale convolutional neural network module, and then use formula (1) to obtain the l-th scale feature matrix of the z-th iteration Thus, the multi-scale feature matrix of the zth iteration is obtained

[0017]

[0018] In formula (1), is the convolution kernel used at the lth scale in the zth iteration, is the bias of the lth scale at the zth iteration, l = 1, 2, ..., L, L represents the total number of scales, represents the convolution operation, T represents the matrix transpose, represents the hyperbolic tangent activation function;

[0019] Step 2.2.2, the scale attention module takes the multi-scale feature matrix of the z-th iteration Project it onto different attention heads to get the input matrix of all attention heads in, represents the input matrix of the h-th attention head at the z-th iteration, h∈{1,2,...,H}, where H is the total number of attention heads;

[0020] In step 2.2.3, the scale attention module calculates the attention weight corresponding to the hth attention head of the zth iteration using formula (2)

[0021]

[0022] In formula (2), and They represent the query matrix and key matrix corresponding to the h-th attention head at the z-th iteration, respectively, and Softmax represents the activation function;

[0023] In step 2.2.4, the scale attention module uses formula (3) to calculate the initial multi-scale fusion feature matrix corresponding to the h-th attention head of the z-th iteration

[0024]

[0025] In formula (3), represents the value matrix corresponding to the h-th attention head at the z-th iteration;

[0026] Step 2.2.5: The scale attention module uses formula (4) to calculate the multi-scale fusion feature matrix s of the zth iteration (z) :

[0027]

[0028] In formula (4), “;” represents the splicing operation;

[0029] Step 2.2.6, the bidirectional gated recurrent unit network module performs the multi-scale fusion feature matrix of the z-th iteration Extract the forward information and backward information of each time step, and obtain the forward hidden state vector h at time step t. i,t (z,1) and the backward hidden state vector h i,t (z,-1) After splicing, the deep dynamic feature h at the time step t of the zth iteration is obtained i,t (z) =[h i,t (z,1) ;h i,t (z,-1) ], thus obtaining the deep dynamic features H at all time steps of the z-th iteration i (z) =[h i,1 (z) ;h i,2 (z) ;...;h i,t (z) ;...;h i,T' (z) ], T' is the total time step;

[0030] Step 2.2.7, the temporal attention module is used to calculate the deep dynamic feature data H of the zth iteration. i (z) Process and output the weighted depth feature data M (z) :

[0031] Step 2.2.8, the fully connected network prediction module uses formula (8) to calculate the i-th image sample D at the z-th iteration i The prediction vector of the oil and gas pipeline defect category

[0032]

[0033] In formula (8), W (z) is the linear transformation matrix of the fully connected network prediction module at the zth iteration, b (z) is the bias of the fully connected network prediction module at the z-th iteration.

[0034] The step 2.2.7 includes the following steps:

[0035] Step a, use formula (5) to calculate the global maximum pooling vector v of the deep dynamic feature at the zth iteration i(z) :

[0036] v i (z) =GMP(H i (z) )=[max(h i,1 (z) ); max(h i,2 (z) );...;max(h i,T' (z) )] (5)

[0037] In formula (5), GMP represents the global maximum pooling operation, and max represents the maximum value operation;

[0038] Step b: Use formula (6) to calculate the attention value tα corresponding to the deep dynamic feature at the zth iteration i (z) :

[0039]

[0040] In formula (6), Represents two linear mapping matrices, χ is the attenuation factor;

[0041] Step c, use formula (7) to calculate the weighted depth feature M at the zth iteration (z) :

[0042] M i (z) =tα i (z) H i (z) (7).

[0043] The electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute any of the oil and gas pipeline magnetic leakage detection methods, and the processor is configured to execute the program stored in the memory.

[0044] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program executes any step of the oil and gas pipeline magnetic flux leakage detection method when the computer program is executed by a processor.

[0045] Compared with the prior art, the beneficial effects of the present invention are embodied in:

[0046] 1. The oil and gas pipeline magnetic flux leakage detection method of the present invention uses a dual attention network, which enables the established deep neural network model to have the ability to adaptively focus on and predict useful information, overcoming the shortcomings of complex data processing and feature extraction in existing methods. Without the need for any prior knowledge of the system, it realizes end-to-end prediction from raw oil and gas pipeline magnetic flux leakage curve image data to pipeline defect conditions, with the advantages of simple operation and strong generalization.

[0047] 2. The present invention utilizes the scale attention mechanism to fully explore the magnetic flux leakage state characteristics of oil and gas pipelines at different scales, automatically assigning different importance weights to the magnetic flux leakage characteristics of oil and gas pipelines at different scales, so that multi-scale features can be adaptively integrated in the network, thereby improving the performance of oil and gas pipeline magnetic flux leakage detection.

[0048] 3. The present invention uses the temporal attention mechanism to distinguish the differences in dynamic features at different time steps for oil and gas pipeline magnetic flux leakage detection, so that the model pays more attention to predicting useful features, thereby improving the accuracy of oil and gas pipeline magnetic flux leakage detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Schematic diagram of the process of the present invention;

[0050] Figure 2 This is a structural diagram of the dual attention network of the present invention;

[0051] Figure 3 This is a model framework diagram of the dual attention network of the present invention;

[0052] Figure 4 This is a structural diagram of the scale attention module of the present invention;

[0053] Figure 5 This is a structural diagram of the temporal attention module of the present invention. DETAILED DESCRIPTION

[0054] In this embodiment, Figure 1 As shown, the process of a magnetic flux leakage detection method for oil and gas pipelines based on a dual attention network includes the following steps:

[0055] Step 1: collect the magnetic flux leakage curve image of the oil and gas pipeline through the magnetic flux leakage detector, and construct the oil and gas pipeline magnetic flux leakage image dataset D = {D i |i=1,2,3,...,I}, where D i is the i-th image sample, and D i =(X i ,y i ), represents the magnetic leakage image of the i-th oil and gas pipeline, y i Represents X iOne-hot encoding corresponding to the oil and gas pipeline defect category, where L and W are the image length and width respectively;

[0056] Step 2: Build a dual attention network, such as Figure 2 As shown, it includes: multi-scale convolutional neural network module, scale attention module, bidirectional gated recurrent unit module, temporal attention module and fully connected network prediction module;

[0057] The dual attention network structure is as follows Figure 3 As shown in the figure; specifically, the multi-scale convolutional neural network module uses multiple parallel convolutional neural network branches to perform convolution operations separately. Each branch adopts convolution kernels of different sizes, and obtains oil and gas pipeline defect features of multiple scales through receptive fields of multiple scales, thereby extracting richer feature information; the scale attention module projects multi-scale oil and gas pipeline defects onto different attention heads, which can adaptively fuse the above multi-scale features; the bidirectional gated recurrent unit module uses the gating mechanism to fully extract deep dynamic features; the time attention module enables the method to distinguish the differences in dynamic features of different time steps for oil and gas pipeline leakage magnetic flux detection, so that the model pays more attention to predicting useful features; the fully connected network prediction module outputs the final oil and gas pipeline leakage magnetic flux detection results through a single-layer artificial neural network;

[0058] Step 2.1, define the number of iterations as z, initialize z = 1, and the iteration threshold as Z; initialize the parameters in the dual attention network;

[0059] Step 2.2: The i-th oil and gas pipeline magnetic leakage image X in the sample set is i Input the dual attention network for processing and output the prediction vector of the oil and gas pipeline defect category at the zth iteration accordingly

[0060] Step 2.2.1, the oil and gas pipeline magnetic leakage image X i Input the multi-scale convolutional neural network module, and then use formula (1) to obtain the l-th scale feature matrix of the z-th iteration Thus, the multi-scale feature matrix of the zth iteration is obtained

[0061]

[0062] In formula (1), is the convolution kernel used at the lth scale in the zth iteration, is the bias of the lth scale at the zth iteration, l = 1, 2, ..., L, L represents the total number of scales, represents the convolution operation, T represents the matrix transpose, represents the hyperbolic tangent activation function;

[0063] Step 2.2.2, as Figure 4 As shown, the scale attention module converts the multi-scale feature matrix of the z-th iteration into Project it onto different attention heads to get the input matrix of all attention heads in, represents the input matrix of the h-th attention head at the z-th iteration, h∈{1,2,...,H}, where H is the total number of attention heads;

[0064] Step 2.2.3: The scale attention module uses formula (2) to calculate the attention weight corresponding to the h-th attention head in the z-th iteration.

[0065]

[0066] In formula (2), and They represent the query matrix and key matrix corresponding to the h-th attention head at the z-th iteration, respectively, and Softmax represents the activation function;

[0067] In step 2.2.4, the scale attention module uses formula (3) to calculate the initial multi-scale fusion feature matrix corresponding to the h-th attention head of the z-th iteration

[0068]

[0069] In formula (3), represents the value matrix corresponding to the h-th attention head at the z-th iteration;

[0070] Step 2.2.5: The scale attention module uses formula (4) to calculate the multi-scale fusion feature matrix s of the zth iteration (z) :

[0071]

[0072] In formula (4), “;” represents the splicing operation;

[0073] Step 2.2.6, the bidirectional gated recurrent unit network module performs multi-scale fusion feature matrix of the zth iteration Extract the forward information and backward information of each time step, and obtain the forward hidden state vector at time step t accordingly and the backward hidden state vector h i,t (z,-1) After splicing, the deep dynamic feature h at the time step t of the zth iteration is obtained i,t (z) =[h i,t (z,1) ;hi,t (z,-1) ], thus obtaining the deep dynamic features H at all time steps of the z-th iteration i (z) =[h i,1 (z) ;h i,2 (z) ;...;h i,t (z) ;...;h i,T' (z) ], T' is the total time step;

[0074] The final multi-scale fusion feature data after the z-th iteration weighting The time slice data of the zth iteration is obtained by slicing along the horizontal axis of the coordinate axis In this embodiment, the total time step Represents the t-th time slice data of the z-th iteration;

[0075] The bidirectional gated recurrent unit module extracts forward and backward information from the time slice data, and in the long short-term memory module of the last layer, the forward hidden state vector at time step t is converted to and the backward hidden state vector After splicing, the deep temporal features at the time step t of the zth iteration are obtained Thus, the deep temporal features of all time steps of the zth iteration are obtained, which is recorded as H i (z) =[h i,1 (z) ;h i,2 (z) ;...;h i,T' (z) ]; without loss of generality, omitting the forward symbol →, the forward hidden state vector at time step t is calculated as follows:

[0076]

[0077] In formula (5), represents the reset gate at time step t of the z-th iteration, represents the update gate at time step t of the z-th iteration, represents the information to be updated at time step t of the z-th iteration, is the input at time step t of the z-th iteration, the other variables are the parameters of the bidirectional gated recurrent unit module of the z-th iteration, and σ represents the Sigmoid activation function.

[0078] Step 2.2.7, as Figure 5 As shown, the time attention module is concerned with the deep dynamic feature data H of the zth iterationi (z) Process and output weighted depth feature data:

[0079] Step a, use formula (6) to calculate the global maximum pooling vector v of the deep dynamic feature at the zth iteration i (z) :

[0080] v i (z) =GMP(H i (z) )=[max(h i,1 (z) ); max(h i,2 (z) );...;max(h i,T' (z) )] (6)

[0081] In formula (6), GMP represents the global maximum pooling operation, and max represents the maximum value operation;

[0082] Step b: Use formula (7) to calculate the attention value tα corresponding to the deep dynamic feature at the zth iteration i (z) :

[0083]

[0084] In formula (7), Represents two linear mapping matrices, χ is the attenuation factor;

[0085] Step c, use formula (8) to calculate the weighted depth feature M at the zth iteration (z) :

[0086] M i (z) =tα i (z) H i (z) (8)

[0087] Step 2.2.8: The fully connected network prediction module uses formula (9) to calculate the i-th image sample D at the z-th iteration. i The prediction vector of the oil and gas pipeline defect category

[0088]

[0089] In formula (9), W (z) is the linear transformation matrix of the fully connected network prediction module at the zth iteration, b (z) is the bias of the fully connected network prediction module at the z-th iteration;

[0090] Step 2.3, use formula (10) to calculate the improved focalloss loss function FL at the zth iteration (z) :

[0091]

[0092] In formula (10), δ is the manually set adjustment factor;

[0093] In step 2.4, based on the sample set D of the magnetic flux leakage curve images of the oil and gas pipeline, the goal is to minimize the focal loss function, and the parameters in the dual attention network are optimized and updated through the time backpropagation algorithm and the adaptive moment estimation optimization algorithm until z>Z. The training is terminated to obtain a trained dual attention network model for predicting defects in oil and gas pipelines.

[0094] In this embodiment, an electronic device includes a memory and a processor. The memory is used to store a program that supports the processor to execute the above-mentioned oil and gas pipeline magnetic leakage detection method. The processor is configured to execute the program stored in the memory.

[0095] In this embodiment, a computer-readable storage medium stores a computer program, which executes the steps of the above-mentioned oil and gas pipeline magnetic flux leakage detection method when executed by a processor.

Claims

1. A magnetic flux leakage detection method for oil and gas pipelines based on a dual attention network, characterized in that: The following steps are involved: Step 1: collect the magnetic flux leakage curve image of the oil and gas pipeline through the magnetic flux leakage detector, and construct the oil and gas pipeline magnetic flux leakage image dataset D = {D i |i=1,2,3,...,I}, where D i is the i-th image sample, and D i =(X i ,y i ), represents the magnetic leakage image of the i-th oil and gas pipeline, y i Represents X i One-hot encoding corresponding to the oil and gas pipeline defect category, where L and W are the image length and width respectively; Step 2: Build a dual attention network, which includes: a multi-scale convolutional neural network module, a scale attention module, a bidirectional gated recurrent unit module, a temporal attention module, and a fully connected network prediction module; Step 2.1, define the number of iterations as z, initialize z=1, and the iteration threshold as Z; initialize the parameters in the dual attention network; Step 2.2: The i-th oil and gas pipeline magnetic leakage image X in the sample set is i Input the dual attention network for processing and output the prediction vector of the oil and gas pipeline defect category at the zth iteration accordingly Step 2.3, use formula (9) to calculate the improved focal loss function FL at the zth iteration (z) : In formula (9), δ is the manually set adjustment factor; In step 2.4, based on the sample set D of the magnetic flux leakage curve image of the oil and gas pipeline, the goal is to minimize the focal loss function, and the parameters in the dual attention network are optimized and updated through the time backpropagation algorithm and the adaptive moment estimation optimization algorithm until z>Z. The training is terminated to obtain a trained dual attention network model for predicting defects in the oil and gas pipeline.

2. The oil and gas pipeline magnetic flux leakage detection method based on dual attention network according to claim 1 is characterized in that: The step 2.2 includes the following steps: Step 2.2.1, the oil and gas pipeline magnetic leakage image X i Input the multi-scale convolutional neural network module, and then use formula (1) to obtain the l-th scale feature matrix of the z-th iteration Thus, the multi-scale feature matrix of the zth iteration is obtained In formula (1), is the convolution kernel used at the lth scale in the zth iteration, is the bias of the lth scale at the zth iteration, l = 1, 2, ..., L, L represents the total number of scales, represents the convolution operation, T represents the matrix transpose, represents the hyperbolic tangent activation function; Step 2.2.2, the scale attention module takes the multi-scale feature matrix of the z-th iteration Project it onto different attention heads to get the input matrix of all attention heads in, represents the input matrix of the hth attention head at the zth iteration, h∈{1,2,…,H}, where H is the total number of attention heads; In step 2.2.3, the scale attention module calculates the attention weight corresponding to the hth attention head of the zth iteration using formula (2) In formula (2), and They represent the query matrix and key matrix corresponding to the h-th attention head at the z-th iteration, respectively, and Softmax represents the activation function; In step 2.2.4, the scale attention module uses formula (3) to calculate the initial multi-scale fusion feature matrix corresponding to the h-th attention head of the z-th iteration In formula (3), represents the value matrix corresponding to the h-th attention head at the z-th iteration; Step 2.2.5: The scale attention module uses formula (4) to calculate the multi-scale fusion feature matrix s of the zth iteration (z) : In formula (4), ";" represents the splicing operation; Step 2.2.6, the bidirectional gated recurrent unit network module performs the multi-scale fusion feature matrix of the z-th iteration Extract the forward information and backward information of each time step, and obtain the forward hidden state vector h at time step t. i,t (z,1) and the backward hidden state vector h i,t (z,-1) After splicing, the deep dynamic feature h at the time step t of the zth iteration is obtained i,t (z) =[h i,t (z,1) ;h i,t (z,-1) ], thus obtaining the deep dynamic features H at all time steps of the z-th iteration i (z) =[h i,1 (z) ;h i,2 (z) ;…;h i,t (z) ;…;h i,T' (z) ], T' is the total time step; Step 2.2.7, the temporal attention module is used to calculate the deep dynamic feature data H of the zth iteration. i (z) Process and output the weighted depth feature data M (z ): Step 2.2.8, the fully connected network prediction module uses formula (8) to calculate the i-th image sample D at the z-th iteration i The prediction vector of the oil and gas pipeline defect category In formula (8), W (z) is the linear transformation matrix of the fully connected network prediction module at the zth iteration, b (z) is the bias of the fully connected network prediction module at the z-th iteration.

3. The oil and gas pipeline magnetic flux leakage detection method based on dual attention network according to claim 2 is characterized in that: The step 2.2.7 includes the following steps: Step a, use formula (5) to calculate the global maximum pooling vector v of the deep dynamic feature at the zth iteration i (z) : v i (z) =GMP(H i (z) )=[max(h i,1 (z) );max(h i,2 (z) );...;max(h i,T' (z) )] (5) In formula (5), GMP represents the global maximum pooling operation, and max represents the maximum value operation; Step b: Use formula (6) to calculate the attention value tα corresponding to the deep dynamic feature at the zth iteration i (z) : In formula (6), Represents two linear mapping matrices, χ is the attenuation factor; Step c, use formula (7) to calculate the weighted depth feature M at the zth iteration (z) : M i (z) =the i (z) H i (z) (7)。 4. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the oil and gas pipeline magnetic leakage detection method according to any one of claims 1 to 3, and the processor is configured to execute the program stored in the memory.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the oil and gas pipeline magnetic flux leakage detection method according to any one of claims 1 to 3 are executed.