Oil and gas pipeline defect detection method based on deep denoising and multi-scale learning
By employing deep denoising and multi-scale learning methods, the problems of noise and multi-scale feature extraction in oil and gas pipeline inspection were solved, achieving higher detection accuracy and robustness, especially in the identification of a minority of defects.
Patent Information
- Application Number
- CN202310346544.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-04-03
AI Technical Summary
Existing technologies are insufficient to effectively handle environmental noise and multi-scale defect characteristics in oil and gas pipelines, resulting in inadequate accuracy and robustness in pipeline defect detection.
A method based on deep denoising and multi-scale learning is adopted. A deep denoising network is constructed by a convolutional autoencoder. The network is combined with a hierarchical attention module, a multi-scale feature extraction module and a fully connected module to extract and fuse multi-layer denoising features and multi-scale features of pipeline magnetic leakage images. The Adam optimization algorithm is used to train the network to improve detection accuracy.
It effectively eliminates the influence of noise, enriches the receptive field, improves the ability to capture defect features of different scales, and enhances the accuracy and robustness of oil and gas pipeline defect detection, especially the ability to detect a few types of defects.
Smart Images

Figure CN116385392B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline nondestructive testing technology, specifically to a method for detecting defects in oil and gas pipelines based on deep denoising and multi-scale learning. Background Technology
[0002] Oil and gas pipelines, as the main arteries of energy transportation in my country, are an important component of the modern energy system and the modern integrated transportation system. Due to various reasons such as internal corrosion and mechanical damage, oil and gas pipelines may develop various defects such as deformation, cracks, and perforations during long-term use, leading to energy leaks and posing a significant threat to people's lives and property, social stability, and industrial production. Therefore, it is necessary to conduct regular defect inspections of oil and gas pipelines to prevent the reuse of severely damaged pipelines, thereby avoiding pipeline leaks or ruptures and ensuring the normal operation of energy transportation.
[0003] Magnetic flux leakage (MF) detection technology for pipelines is currently the most widely used non-destructive testing (NDT) technology for pipelines. It primarily involves acquiring MF signal data from pipelines and processing the radial and axial components of the MF field to identify pipeline defects based on the MF curve image features. Traditional methods for pipeline MF image recognition mainly include multivariate statistical analysis, wavelet neural networks, backpropagation (BP) neural networks, and support vector machine (SVM) signal classification. However, these methods have limited feature extraction capabilities and struggle to handle large-scale MF curve images with diverse feature types. In recent years, with the development of deep learning in image recognition, deep learning models, especially convolutional neural networks, have become effective methods for identifying pipeline MF data. However, environmental noise in oil and gas pipelines and noise introduced during the MF signal acquisition process can interfere with the model's defect judgment. Furthermore, oil and gas pipelines are characterized by defects with varying shapes and scales; existing methods mostly employ a single receptive field, making it difficult to capture defect features at different scales. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a method for detecting oil and gas pipeline defects based on deep denoising and multi-scale learning. This method aims to overcome the influence of pipeline magnetic flux leakage noise data and extract defect features at different scales, thereby enabling accurate identification of oil and gas pipeline defects.
[0005] To achieve the above objectives, the following technical solution is adopted:
[0006] The present invention provides a method for detecting defects in oil and gas pipelines based on deep denoising and multi-scale learning, characterized by the following steps:
[0007] Step 1, Data Acquisition and Preprocessing;
[0008] Step 1.1: Acquire magnetic flux leakage curve images of oil and gas pipelines using a high-precision magnetic flux leakage detector, and construct an oil and gas pipeline magnetic flux leakage image dataset D={(X1,y1),(X2,y2),…,(X n ,y n ),…,(X N ,y N )}, where, (X n ,y n Let X be the nth data sample. n Let X represent the nth magnetic flux leakage image of an oil and gas pipeline, and X... n ∈R h×w h and w are the height and width of the image, respectively, and y n The unique thermal encoding representing the category of oil and gas pipeline defects in the nth image;
[0009] Step 1.2, analyze the nth magnetic flux leakage image X of the oil and gas pipeline. n Normalization is performed to obtain the normalized image.
[0010] Step 2: A deep denoising network is built using a P-layer stacked convolutional autoencoder to denoise the magnetic flux leakage image of oil and gas pipelines, resulting in... Denoising feature sequences
[0011] Step 3: Construct a multi-scale feature learning network, including: a hierarchical attention module, a multi-scale feature extraction module, a scale-level attention module, and a fully connected module.
[0012] Step 3.1: Define the current iteration number as q, initialize q = 1, and define the iteration threshold as Q;
[0013] Initialize the parameters in the multi-scale learning network;
[0014] Step 3.2, denoise the feature sequence The input is processed by the hierarchical attention module, and the weighted image denoising features are output accordingly.
[0015] Step 3.3, denoise the image features The input is processed in the multi-scale feature extraction module to obtain a multi-scale pipeline defect feature sequence.
[0016] Step 3.4: Sequence of multi-scale pipeline defects The input is processed by a scale-level attention module, and the weighted multi-scale fusion features are output accordingly.
[0017] Step 3.5, the fully connected module uses equation (10) to output the normalized image at the q-th iteration. Predictive unique thermal coding of oil and gas pipeline defect categories
[0018]
[0019] In equation (10), and These are the parameter matrix and bias of the fully connected module at the q-th iteration, respectively, and I is the number of oil and gas pipeline defect categories;
[0020] Step 3.6: Construct the loss function of the multi-scale feature learning network using equation (11).
[0021]
[0022] In equation (13), γ is an adjustable factor, and θ is the frequency distribution of each oil and gas pipeline defect category in the oil and gas pipeline magnetic flux leakage image dataset.
[0023] Step 3.7, to minimize the loss function With the goal of training a multi-scale feature learning network using the Adam optimization algorithm and updating its network parameters until q > Q, the training ends, thus obtaining a trained multi-scale feature learning network model. The trained deep denoising network and multi-scale feature learning network are then used to detect the defect categories of oil and gas pipelines.
[0024] The oil and gas pipeline defect detection method based on deep denoising and multi-scale learning described in this invention is also characterized in that step 2 includes:
[0025] Step 2.1, define the current number of layers of the convolutional autoencoder as p, and let the total number of layers of the convolutional autoencoder be P;
[0026] Initialize the convolutional parameters in the deep denoising network; initialize p = 1;
[0027] Step 2.2, the p-th layer convolutional autoencoder uses equation (1) to process the hidden feature matrix of the (p-1)-th layer. Encode the hidden feature matrix of the p-th layer.
[0028]
[0029] In equation (1), · represents the convolution operation. These are the encoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively; sigmoid represents the activation function; a is a random number that follows a normal distribution (μ, σ), where μ and σ are the mean and variance of the normal distribution, respectively; when p = 1, let...
[0030] Step 2.3, the p-th layer convolutional autoencoder uses equation (2) to... Perform decoding to obtain the reconstructed hidden features of the p-th layer convolutional autoencoder.
[0031]
[0032] In equation (2), These are the decoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively;
[0033] Step 2.4: Construct the loss function of the p-th layer convolutional autoencoder using equation (3).
[0034]
[0035] Step 2.5, to minimize the loss function To achieve this, the p-th layer convolutional autoencoder is trained using the Adam optimization algorithm, and its parameters are updated until the loss function is reached. The training continues until convergence, thus obtaining the p-th layer convolutional autoencoder after training.
[0036] Step 2.6: After assigning p+1 to p, return to step 2.2 and execute sequentially until p > P, thus completing the training of the deep denoising network and obtaining... Denoising feature sequences
[0037] Step 3.2 includes the following steps:
[0038] Step 3.2.1: Use equation (4) to obtain the global interpretation vector v of the denoised feature sequence. n :
[0039]
[0040] In equation (4), GAP is the global average pooling operation;
[0041] Step 3.2.2: Use equation (5) to obtain the attention weight vector of the denoised feature sequence at the qth iteration.
[0042]
[0043] In equation (5), This indicates that the hidden feature matrix is at the q-th iteration. The assigned weights, and These are the two parameter matrices of the hierarchical attention module at the q-th iteration, where ReLU is the rectified linear activation function and softmax is the normalized activation function;
[0044] Step 3.2.3: Use equation (6) to obtain the weighted image denoising features at the qth iteration.
[0045]
[0046] Step 3.3.1: Use equation (7) to obtain the feature map on the convolution kernel at the s-th convolution scale during the q-th iteration. This yields a sequence of feature maps on S convolutional kernels of different convolutional scales.
[0047]
[0048] In equation (7), and These are the kernel parameters and biases for the s-th convolutional scale, respectively, where S is the number of scales;
[0049] Step 3.3.2: Apply global max pooling to the feature map sequence. Perform global pooling to obtain the compressed multi-scale pipeline defect feature sequence. Let represent the compression feature at the s-th scale during the q-th iteration. J is the dimension of the feature vector.
[0050] Step 3.4 includes the following steps:
[0051] Step 3.4.1, will Projecting onto K different attention heads, we obtain... Projection feature sequence in, Let K represent the features projected into the k-th attention head at the q-th iteration, where K is the number of attention heads.
[0052] Step 3.4.2: Use equation (8) to obtain the multi-scale attention weight vector in the k-th attention head at the q-th iteration.
[0053]
[0054] In equation (8), and These are the two parameter matrices in the k-th attention head during the q-th iteration; T denotes transpose;
[0055] Step 3.4.3: Use equation (9) to obtain the weighted multi-scale feature vector in the k-th attention head at the q-th iteration.
[0056]
[0057] In equation (9), It is the parameter matrix in the k-th attention head during the q-th iteration;
[0058] Step 3.4.4: Concatenate the weighted multi-scale feature vectors from each attention head to obtain the multi-scale fused feature at the q-th iteration.
[0059] The present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor in executing any of the oil and gas pipeline defect detection methods, and the processor is configured to execute the program stored in the memory.
[0060] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of any of the oil and gas pipeline defect detection methods.
[0061] Compared with existing technologies, the beneficial effects of this invention are reflected in:
[0062] 1. This invention utilizes a convolutional autoencoder to build a deep denoising network, which can extract and fuse multi-layer denoising features of pipeline magnetic flux leakage image data and effectively remove the influence of noise in the data. This overcomes the shortcomings of existing methods that are affected by noise and improves the accuracy and robustness of oil and gas pipeline defect detection.
[0063] 2. This invention utilizes multiple convolutional kernels of different scales to extract abstract features from pipeline magnetic flux leakage image data, enriching the receptive field of pipeline magnetic flux leakage images. It can capture pipeline defect features of different scales and adaptively fuses multi-scale features through scale attention, thereby improving the feature learning ability of ordinary convolutional neural networks and thus improving the accuracy of oil and gas pipeline defect detection.
[0064] 3. This invention utilizes the loss function of network training to focus on samples with fewer defect categories in a cost-sensitive manner during training, thereby improving the method's learning ability for minority classes and overcoming the problem of imbalanced defect categories in pipeline magnetic flux leakage image data, thus improving the accuracy of oil and gas pipeline defect detection. Attached Figure Description
[0065] Figure 1 This is a schematic flowchart of the method of the present invention;
[0066] Figure 2 This is a structural diagram of the deep denoising network of the present invention;
[0067] Figure 3 This is a structural diagram of the multi-scale feature learning network of the present invention. Detailed Implementation
[0068] In this embodiment, as Figure 1 As shown, the process of a defect detection method for oil and gas pipelines based on deep denoising and multi-scale learning includes the following steps:
[0069] Step 1, Data Acquisition and Preprocessing;
[0070] Step 1.1: Acquire magnetic flux leakage curve images of oil and gas pipelines using a high-precision magnetic flux leakage detector, and construct an oil and gas pipeline magnetic flux leakage image dataset D={(X1,y1),(X2,y2),…,(X n ,y n ),…,(X N ,y N )}, where, (X n ,y n Let X be the nth data sample. n Let X represent the nth magnetic flux leakage image of an oil and gas pipeline, and X... n ∈R h×w h and w are the height and width of the image, respectively, and y n The unique thermal encoding representing the category of oil and gas pipeline defects in the nth image;
[0071] Step 1.2, analyze the nth magnetic flux leakage image X of the oil and gas pipeline. n Normalization is performed to obtain the normalized image.
[0072] Step 2: A deep denoising network is constructed using a P-layer stacked convolutional autoencoder to denoise the magnetic flux leakage images of oil and gas pipelines; the deep denoising network is as follows: Figure 2 As shown, the image is composed of P layers of stacked convolutional autoencoders (CAPEs). These CAPEs employ unsupervised training to recover the original image from noisy images, thereby obtaining robust hidden features. Specifically, a certain amount of noise is added to the input data, followed by a convolution operation to obtain hidden features. This is then followed by another convolution operation to obtain reconstructed data. The loss between the reconstructed data and the input data is calculated for training. The input to the first CAPE layer is a normalized magnetic flux leakage image of the oil and gas pipeline. The hidden feature matrix of each CAPE layer is then used as the input to the next CAPE layer, resulting in the parameters and hidden features of multiple CAPE layers. That is, the hidden features of the first CAPE layer are used as the input to the second CAPE layer, the second CAPE layer is used as the input to the third CAPE layer, and so on.
[0073] The specific training steps for a deep denoising network are as follows:
[0074] Step 2.1, define the current number of layers of the convolutional autoencoder as p, and let the total number of layers of the convolutional autoencoder be P;
[0075] Initialize the convolutional parameters in the deep denoising network; initialize p = 1;
[0076] Step 2.2, the p-th layer convolutional autoencoder uses equation (1) to process the hidden feature matrix of the (p-1)-th layer. Encode the hidden feature matrix of the p-th layer.
[0077]
[0078] In equation (1), · represents the convolution operation. These are the encoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively; Sigmoid represents the activation function; a is a random number, i.e., added Gaussian noise, and it follows a normal distribution (μ, σ), where μ and σ are the mean and variance of the normal distribution, respectively; when p = 1, let...
[0079] Step 2.3, the p-th layer convolutional autoencoder uses equation (2) to... Perform decoding to obtain the reconstructed hidden features of the p-th layer convolutional autoencoder.
[0080]
[0081] In equation (2), These are the decoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively;
[0082] Step 2.4: Construct the loss function of the p-th layer convolutional autoencoder using equation (3).
[0083]
[0084] Step 2.5, to minimize the loss function To achieve this, the p-th layer convolutional autoencoder is trained using the Adam optimization algorithm, and its parameters are updated until the loss function is reached. The training continues until convergence, thus obtaining the p-th layer convolutional autoencoder after training.
[0085] Step 2.6: After assigning p+1 to p, return to step 2.2 and execute sequentially until p > P, thus completing the training of the deep denoising network and obtaining... Denoising feature sequences Among them, the feature representations obtained by different convolutional autoencoders denoise the input pipeline magnetic leakage image at different levels;
[0086] Step 3, build a multi-scale feature learning network, such as Figure 3 As shown, it includes: a hierarchical attention module, a multi-scale feature extraction module, a scale-level attention module, and a fully connected module.
[0087] Step 3.1: Define the current iteration number as q, initialize q = 1, and define the iteration threshold as Q;
[0088] Initialize the parameters in the multi-scale learning network;
[0089] Step 3.2, denoise the feature sequence The input-level attention module adaptively fuses denoising features from different levels and outputs weighted image denoising features accordingly.
[0090] Step 3.2.1: Use equation (4) to obtain the global interpretation vector v of the denoised feature sequence. n :
[0091]
[0092] In equation (4), GAP is the global average pooling operation;
[0093] Step 3.2.2: Use equation (5) to obtain the attention weight vector of the denoised feature sequence at the qth iteration.
[0094]
[0095] In equation (5), This indicates that the hidden feature matrix is at the q-th iteration. The assigned weights, and These are the two parameter matrices of the hierarchical attention module at the q-th iteration, where ReLU is the rectified linear activation function and softmax is the normalized activation function;
[0096] Step 3.2.3: Use equation (6) to obtain the weighted image denoising features at the qth iteration.
[0097]
[0098] Step 3.3, denoise the image features The input is processed in the multi-scale feature extraction module to obtain a multi-scale pipeline defect feature sequence, such as... Figure 3As shown, the multi-scale feature extraction module contains multiple parallel branches that perform convolution and pooling operations respectively. Each branch uses a convolution kernel of a different size, obtaining pipeline defect features at multiple scales through receptive fields of multiple scales, thereby extracting richer feature information.
[0099] Step 3.3.1: Use equation (7) to obtain the feature map on the convolution kernel at the s-th convolution scale during the q-th iteration. This yields a sequence of feature maps on S convolutional kernels of different convolutional scales.
[0100]
[0101] In equation (7), and These are the kernel parameters and biases for the s-th convolutional scale, respectively, where S is the number of scales;
[0102] Each scale of convolution uses J convolution kernels to generate multi-channel feature maps;
[0103] Step 3.3.2: Apply global max pooling to the feature map sequence. Perform global pooling on each channel to obtain the compressed multi-scale pipeline defect feature sequence. Let represent the compression feature at the s-th scale during the q-th iteration. J is the dimension of the feature vector;
[0104] Step 3.4: Sequence of multi-scale pipeline defects The input scale-level attention module adaptively fuses features at different scales and outputs weighted multi-scale fused features accordingly:
[0105] Step 3.4.1, will Projecting onto K different attention heads, we obtain... Projection feature sequence in, Let K represent the features projected into the k-th attention head at the q-th iteration, where K is the number of attention heads.
[0106] Step 3.4.2: Use equation (8) to obtain the multi-scale attention weight vector in the k-th attention head at the q-th iteration.
[0107]
[0108] In equation (8), and These are the two parameter matrices in the k-th attention head during the q-th iteration; T denotes transpose;
[0109] Step 3.4.3: Use equation (9) to obtain the weighted multi-scale feature vector in the k-th attention head at the q-th iteration.
[0110]
[0111] In equation (9), It is the parameter matrix in the k-th attention head during the q-th iteration;
[0112] Step 3.4.4: Concatenate the weighted multi-scale feature vectors from each attention head to obtain the multi-scale fused feature at the q-th iteration.
[0113] Step 3.5, the fully connected module uses equation (10) to output the normalized image at the q-th iteration. Predictive unique thermal coding of oil and gas pipeline defect categories
[0114]
[0115] In equation (10), and These are the parameter matrix and bias of the fully connected module at the q-th iteration, respectively, and I is the number of oil and gas pipeline defect categories;
[0116] Step 3.6: Construct the loss function of the multi-scale feature learning network using equation (11).
[0117]
[0118] In equation (13), γ is an adjustable factor, θ is the frequency distribution of each oil and gas pipeline defect category in the oil and gas pipeline magnetic flux leakage image dataset; loss function By reducing the weight of easily classified samples (with a large number of samples) and increasing the weight of difficult-to-classify samples (with a small number of samples), the model training focuses more on difficult-to-classify samples. A cost-sensitive method is used to solve the problem of pipeline defect class imbalance, thereby improving the detection accuracy of the method for the minority class while maintaining the detection accuracy for the majority class.
[0119] Step 3.7, to minimize the loss function With the goal of training a multi-scale feature learning network using the Adam optimization algorithm and updating its network parameters until q > Q, the training ends, thus obtaining a trained multi-scale feature learning network model. The trained deep denoising network and multi-scale feature learning network are then used to detect the defect categories of oil and gas pipelines.
[0120] When performing defect detection using a trained deep denoising network, the input to the convolutional autoencoder is data without added noise, i.e., equation (1) in step 2.2 changes to
[0121] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.
[0122] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.
Claims
1. A method for detecting defects in oil and gas pipelines based on deep denoising and multi-scale learning, characterized in that, Includes the following steps: Step 1, Data Acquisition and Preprocessing; Step 1.1: Acquire magnetic flux leakage curve images of oil and gas pipelines using a high-precision magnetic flux leakage detector, and construct an oil and gas pipeline magnetic flux leakage image dataset D={(X1,y1),(X2,y2),…,(X n ,y n ),…,(X N ,y N )}, where (X n ,y n Let X be the nth data sample. n Let X represent the nth magnetic flux leakage image of an oil and gas pipeline, and X... n ∈R h×w h and w are the height and width of the image, respectively, and y n The unique thermal encoding representing the category of oil and gas pipeline defects in the nth image; Step 1.2, analyze the nth magnetic flux leakage image X of the oil and gas pipeline. n Normalization is performed to obtain the normalized image. Step 2: A deep denoising network is built using a P-layer stacked convolutional autoencoder to denoise the magnetic flux leakage image of oil and gas pipelines, resulting in... Denoising feature sequences Step 3: Construct a multi-scale feature learning network, including: a hierarchical attention module, a multi-scale feature extraction module, a scale-level attention module, and a fully connected module. Step 3.1: Define the current iteration number as q, initialize q = 1, and define the iteration threshold as Q; Initialize the parameters in the multi-scale learning network; Step 3.2, denoise the feature sequence The input is processed by the hierarchical attention module, and the weighted image denoising features are output accordingly. Step 3.3, denoise the image features The input is processed in the multi-scale feature extraction module to obtain a multi-scale pipeline defect feature sequence. Step 3.4: Sequence of multi-scale pipeline defects The input is processed by a scale-level attention module, and the weighted multi-scale fusion features are output accordingly. Step 3.5, the fully connected module uses equation (10) to output the normalized image at the q-th iteration. Predictive unique thermal coding of oil and gas pipeline defect categories In equation (10), and These are the parameter matrix and bias of the fully connected module at the q-th iteration, respectively, and I is the number of oil and gas pipeline defect categories; Step 3.6: Construct the loss function of the multi-scale feature learning network using equation (11). In equation (13), γ is an adjustable factor, and θ is the frequency distribution of each oil and gas pipeline defect category in the oil and gas pipeline magnetic flux leakage image dataset. Step 3.7, to minimize the loss function With the goal of training a multi-scale feature learning network using the Adam optimization algorithm and updating its network parameters until q > Q, the training ends, thus obtaining a trained multi-scale feature learning network model. The trained deep denoising network and multi-scale feature learning network are then used to detect the defect categories of oil and gas pipelines.
2. The oil and gas pipeline defect detection method based on deep denoising and multi-scale learning according to claim 1, characterized in that, The step 2 includes: Step 2.1, define the current number of layers of the convolutional autoencoder as p, and let the total number of layers of the convolutional autoencoder be P; Initialize the convolutional parameters in the deep denoising network; initialize p = 1; Step 2.2, the p-th layer convolutional autoencoder uses equation (1) to process the hidden feature matrix of the (p-1)-th layer. Encode the hidden feature matrix of the p-th layer. In equation (1), · represents the convolution operation. These are the encoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively; sigmoid represents the activation function; a is a random number that follows a normal distribution (μ, σ), where μ and σ are the mean and variance of the normal distribution, respectively; when p = 1, let... Step 2.3, the p-th layer convolutional autoencoder uses equation (2) to... Perform decoding to obtain the reconstructed hidden features of the p-th layer convolutional autoencoder. In equation (2), These are the decoding convolution kernel parameters and bias of the p-th layer convolutional autoencoder, respectively; Step 2.4: Construct the loss function of the p-th layer convolutional autoencoder using equation (3). Step 2.5, to minimize the loss function To achieve this, the p-th layer convolutional autoencoder is trained using the Adam optimization algorithm, and its parameters are updated until the loss function is reached. The training continues until convergence, thus obtaining the p-th layer convolutional autoencoder after training. Step 2.6: After assigning p+1 to p, return to step 2.2 and execute sequentially until p > P, thus completing the training of the deep denoising network and obtaining... Denoising feature sequences 3. The oil and gas pipeline defect detection method based on deep denoising and multi-scale learning according to claim 2, characterized in that, Step 3.2 includes the following steps: Step 3.2.1: Use equation (4) to obtain the global interpretation vector v of the denoised feature sequence. n : In equation (4), GAP is the global average pooling operation; Step 3.2.2: Use equation (5) to obtain the attention weight vector of the denoised feature sequence at the qth iteration. In equation (5), This indicates that the hidden feature matrix is at the q-th iteration. The assigned weights, and These are the two parameter matrices of the hierarchical attention module at the q-th iteration, where ReLU is the rectified linear activation function and softmax is the normalized activation function; Step 3.2.3: Use equation (6) to obtain the weighted image denoising features at the qth iteration. Step 3.3.1: Use equation (7) to obtain the feature map on the convolution kernel at the s-th convolution scale during the q-th iteration. This yields a sequence of feature maps on S convolutional kernels of different convolutional scales. In equation (7), and These are the kernel parameters and biases for the s-th convolutional scale, respectively, where S is the number of scales; Step 3.3.2: Apply global max pooling to the feature map sequence. Perform global pooling to obtain the compressed multi-scale pipeline defect feature sequence. Let represent the compression feature at the s-th scale during the q-th iteration. J is the dimension of the feature vector.
4. The oil and gas pipeline defect detection method based on deep denoising and multi-scale learning according to claim 3, characterized in that, Step 3.4 includes the following steps: Step 3.4.1, will Projecting onto K different attention heads, we obtain... Projection feature sequence in, Let K represent the features projected into the k-th attention head at the q-th iteration, where K is the number of attention heads. Step 3.4.2: Use equation (8) to obtain the multi-scale attention weight vector in the k-th attention head at the q-th iteration. In equation (8), and These are the two parameter matrices in the k-th attention head during the q-th iteration; T denotes transpose; Step 3.4.3: Use equation (9) to obtain the weighted multi-scale feature vector in the k-th attention head at the q-th iteration. In formula (9), It is the parameter matrix in the k-th attention head during the q-th iteration; Step 3.4.4: Concatenate the weighted multi-scale feature vectors from each attention head to obtain the multi-scale fused feature at the q-th iteration.
5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing any of the oil and gas pipeline defect detection methods according to claims 1-4, and the processor is configured to execute the programs stored in the memory.
6. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is run by the processor, it performs the steps of the oil and gas pipeline defect detection method according to any one of claims 1-4.
Citation Information
Patent Citations
SAR image denoising method based on multi-scale residual attention network
CN112233026A
Defect detection method and system for pipeline magnetic flux leakage signal
CN115713486A