Supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fused with Bi-LSTM

By applying a deep learning model based on attention mechanism fusion Bi-LSTM in pipeline detection, the problems of low efficiency and indetailed analysis of traditional detection methods are solved, and efficient, accurate detection and detailed analysis of pipeline damage are achieved.

CN119850571APending Publication Date: 2025-04-18LIAONING UNIVERSITY OF PETROLEUM AND CHEMICAL TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411955489.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

Traditional pipeline inspection relies on manual inspection, which is inefficient and costly; image processing technology is difficult to deal with the problems of poor image quality and uneven lighting, and it is difficult to achieve accurate detection and detailed analysis of pipeline damage.

Method used

A deep learning model based on attention mechanism is adopted to integrate Bi-LSTM, and by collecting pipeline image data, establishing a Bi-LSTM model equipped with attention module, image preprocessing and feature extraction are carried out to realize automated detection and detailed analysis of pipeline damage.

Benefits of technology

It improves the accuracy and efficiency of pipeline damage detection, reduces labor costs and safety risks, and can analyze information such as damage location, type, and size in detail, supporting more accurate pipeline maintenance and repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850571A_ABST
    Figure CN119850571A_ABST
Patent Text Reader

Abstract

The invention relates to the field of pipeline inspection, in particular to a supercritical carbon dioxide pipeline inspection method based on attention mechanism fusion Bi-LSTM. The method comprises the following steps: collecting pipeline image data, and establishing a Bi-LSTM deep learning model carrying an attention module; establishing an original data set according to the pipeline image data, preprocessing the original data set to obtain standardized data, taking the standardized data as input data, and obtaining spliced data based on a Bi-LSTM deep learning model; taking the spliced data as input data, and obtaining weighted data based on an attention module; on the basis of an Adam optimizer, the Bi-LSTM deep learning model carrying the attention module is optimized; and inputting pipeline image data to the optimized Bi-LSTM deep learning model carrying the attention module to carry out supercritical carbon dioxide pipeline damage inspection. Compared with the prior art, the problem of dependence on manual inspection and inspection is solved; the image processing technology is poor; and the analysis of the detection method is not detailed enough.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of pipeline damage inspection, and in particular to a supercritical carbon dioxide pipeline damage inspection method based on an attention mechanism fused with Bi-LSTM. Background Art

[0002] In the process of CO2 pipeline inspection and maintenance, traditional pipeline inspection usually relies on manual inspection or visual inspection, which is inefficient, costly, and has safety risks. Secondly, traditional image processing technology has limited processing capabilities for problems such as poor image quality and uneven lighting, making it difficult to accurately detect and analyze pipeline damage. In addition, traditional pipeline damage detection methods can often only provide simple information on the location and size of damage, lacking more detailed analysis of damage type and degree, which affects the accuracy and efficiency of pipeline maintenance and repair. Summary of the invention

[0003] In order to solve the above-mentioned technical problems of "dependence on manual inspection and examination", "poor image processing technology" and "insufficient detailed analysis of detection methods", the present invention provides a supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM, and its technical solution is as follows:

[0004] The first aspect of the present invention provides a supercritical carbon dioxide pipeline damage detection method based on an attention mechanism fused with Bi-LSTM, comprising the following steps:

[0005] 1) Collect pipeline image data and build a Bi-LSTM deep learning model equipped with an attention module;

[0006] 2) Establishing an original data set based on the pipeline image data, and preprocessing the original data set to obtain standardized data;

[0007] 3) Using the standardized data as input data, the spliced ​​data is obtained based on the Bi-LSTM deep learning model;

[0008] 4) Taking the spliced ​​data as input data, weighted data is obtained based on the attention module;

[0009] 5) Based on the Adam optimizer, the Bi-LSTM deep learning model equipped with the attention module is optimized;

[0010] 6) Input pipeline image data into the optimized Bi-LSTM deep learning model equipped with an attention module to perform supercritical carbon dioxide pipeline damage inspection.

[0011] Optionally, collecting pipeline image data in step 1) refers to converting the pipeline image into matrix data.

[0012] Optionally, the preprocessing in step 2) refers to first cleaning the data and then standardizing the data;

[0013] The data cleaning refers to first processing the outliers in the original data set, and then processing the missing values ​​in the processed data set;

[0014] The outlier value processing is performed by setting it as a missing value;

[0015] The missing value processing adopts the nearest neighbor algorithm, and the formula is as follows:

[0016]

[0017]

[0018] Where: (x1, y1) and (x2, y2) are a set of corresponding coordinate points in the two-dimensional space data; ρ is the Euclidean distance of the coordinate points; d(x, y) is the sum of the Euclidean distances of the n data coordinate points;

[0019] The data standardization is processed by a normalization method, and the formula is as follows:

[0020]

[0021] In the formula: x is the initial value of the data, x′ represents the standardized data, and x max is the maximum value of each column of data samples; x min is the minimum value of each column of data samples.

[0022] Optionally, the step 3) includes the following steps:

[0023] 3.1) The previous sequence of the current inspection point is used as data input to the LSTM unit to calculate the forward output hidden state vector

[0024] 3.2) The next segment of the sequence of the current inspection point is used as data input to the LSTM unit to calculate the backward output hidden state vector

[0025] 3.3) Concatenate the forward output hidden state vector and the backward output hidden state vector of the current inspection point to obtain the concatenated data The formula is as follows:

[0026]

[0027] Where: t is the time constant.

[0028] Optionally, the LSTM unit is shown in the following formula:

[0029] f t =σ(w f ×[h t-1 , E t ]+b f ) (5);

[0030] i t =σ(w i ×[h t-1 , E t ]+b i ) (6);

[0031] o t =σ(w o ×[h t-1 , E t ]+b o ) (7);

[0032]

[0033] c t =f t ×c t-1 +i t ×c t (9);

[0034] h t =o t ×tanh(c t ) (10);

[0035] Where: f t 、i t , o t They are the forget gate, input gate, and output gate at time t respectively; is the cell state at time t; c t is the memory cell at time t; h t is the hidden state vector at time t; σ is the sigmoid function; tanh() is the hyperbolic tangent function; w f 、w i 、w o are the weight matrices corresponding to the forget gate, input gate, and output gate respectively; w c for The weight matrix of f , b i , b o are the bias vectors corresponding to the forget gate, input gate, and output gate respectively; b c for The bias vector of E t is the input vector at time t.

[0036] Optionally, the step 4) includes the following steps:

[0037] 4.1) Take the spliced ​​data as input data and perform global average pooling. The formula is as follows:

[0038]

[0039] Where: F(i, j) is the input data, H and W are the height and width of the input data respectively;

[0040] 4.2) Take the data after global average pooling as input data, perform full connection layer, and obtain the corresponding weight data. The formula is as follows:

[0041] y=wx+b(12);

[0042] Where: y is the weight data, w is the weight matrix, x is the input data, and b is the bias vector;

[0043] 4.3) Take the concatenated data as input data, perform feature re-labeling based on the weight data obtained by the fully connected layer, and obtain weighted data. The formula is as follows:

[0044]

[0045] Where: is the weighted data, x is the input data, and g(x) is the weight data.

[0046] Optionally, the optimization termination condition in step 5) is the convergence of the loss function, and the loss function formula is as follows:

[0047]

[0048] Where: N is the length of the input sequence, is the predicted value of the model, y i is the true value.

[0049] A second aspect of the present invention provides a storage medium for storing the above-mentioned supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM.

[0050] The third aspect of the present invention provides a computer device for executing the above-mentioned supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM.

[0051] Compared with the prior art, the technical solution of the present invention has the following beneficial effects: by utilizing advanced deep learning algorithms and combining image processing technology, efficient and accurate detection and analysis of supercritical carbon dioxide pipelines can be achieved. The algorithm can realize automated detection and analysis of pipeline damage, improve the accuracy and efficiency of detection, and reduce labor costs and safety risks. At the same time, the algorithm can also realize detailed analysis of pipeline damage, including information such as damage location, type, and size, providing a more accurate reference for pipeline maintenance and repair. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic diagram of the overall process of an embodiment of the present invention;

[0053] Figure 2 1 is a schematic diagram of the LSTM unit structure of an embodiment of the present invention;

[0054] Figure 3 Schematic diagram of the SE attention mechanism structure of an embodiment of the present invention. DETAILED DESCRIPTION

[0055] Example 1

[0056] like Figure 1 As shown, this embodiment provides a supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM, including the following steps:

[0057] 1) Collect pipeline image data and build a Bi-LSTM deep learning model equipped with an attention module;

[0058] 2) Establishing an original data set based on the pipeline image data, and preprocessing the original data set to obtain standardized data;

[0059] 3) Using the standardized data as input data, the spliced ​​data is obtained based on the Bi-LSTM deep learning model;

[0060] 4) Taking the spliced ​​data as input data, weighted data is obtained based on the attention module;

[0061] 5) Based on the Adam optimizer, the Bi-LSTM deep learning model equipped with the attention module is optimized;

[0062] 6) Input pipeline image data into the optimized Bi-LSTM deep learning model equipped with an attention module to perform supercritical carbon dioxide pipeline damage inspection.

[0063] In some embodiments, acquiring pipeline image data in step 1) refers to converting the pipeline image into matrix data.

[0064] In some embodiments, the preprocessing in step 2) refers to first cleaning the data and then standardizing the data;

[0065] The data cleaning refers to first processing the outliers in the original data set, and then processing the missing values ​​in the processed data set;

[0066] The outlier value processing is performed by setting it as a missing value;

[0067] The missing value processing adopts the nearest neighbor algorithm, and the formula is as follows:

[0068]

[0069]

[0070] Where: (x1, y1) and (x2, y2) are a set of corresponding coordinate points in the two-dimensional space data; ρ is the Euclidean distance of the coordinate points; d(x, y) is the sum of the Euclidean distances of the n data coordinate points;

[0071] The data standardization is processed by a normalization method, and the formula is as follows:

[0072]

[0073] In the formula: x is the initial value of the data, x′ represents the standardized data, and x max is the maximum value of each column of data samples; x min is the minimum value of each column of data samples.

[0074] Among them, the original data set is established and the data is preprocessed. That is, the original data set of the pipeline is established and preprocessed.

[0075] Data standardization is a key preprocessing process, which aims to convert variables of different dimensions and ranges to the same magnitude, so as to ensure that the model can evaluate each feature equally and will not have a disproportionate impact on the results due to certain features with large numerical ranges. This helps to improve the convergence speed of the algorithm and ensure that the feature information is effectively used.

[0076] We use min-max normalization, which is also called normalization, which works by scaling the data to the range of [0, 1].

[0077] In some embodiments, step 3) comprises the following steps:

[0078] 3.1) The previous sequence of the current inspection point is used as data input to the LSTM unit to calculate the forward output hidden state vector

[0079] 3.2) The next segment of the sequence of the current inspection point is used as data input to the LSTM unit to calculate the backward output hidden state vector

[0080] 3.3) Concatenate the forward output hidden state vector and the backward output hidden state vector of the current inspection point to obtain the concatenated data The formula is as follows:

[0081]

[0082] Where: t is the time constant.

[0083] In some embodiments, Figure 2 As shown, the LSTM unit is shown in the following formula:

[0084] f t =σ(w f ×[h t-1 , E t ]+b f ) (5);

[0085] it=σ(w i ×[h t-1 , E t ]+b i ) (6);

[0086] o t =σ(w o ×[h t-1 , E t ]+b o ) (7);

[0087]

[0088] c t =f t ×c t-1 +i t ×c t (9);

[0089] h t =o t ×tanh(c t ) (10);

[0090] Where: f t 、i t , o t They are the forget gate, input gate, and output gate at time t respectively; is the cell state at time t; c t is the memory cell at time t; h tis the hidden state vector at time t; σ is the sigmoid function; tanh() is the hyperbolic tangent function; w f 、w i 、w o are the weight matrices corresponding to the forget gate, input gate, and output gate respectively; w c for The weight matrix of f , b i , b o are the bias vectors corresponding to the forget gate, input gate, and output gate respectively; b c for The bias vector of E t is the input vector at time t.

[0091] Among them, Figure 2 As shown, the basic architecture of LSTM consists of five parts: input x t 、output h t , Update gate i t 、Forget gate t , output gate o t . Its core part uses a special gating unit. Figure 2 The c in is the cell state, which will be updated after passing through the update gate and output after passing through the output gate. Figure 2 It can be seen that the entire LSTM unit structure has traces of the cell state. Therefore, it has a memory capacity that exceeds that of RNN, and it can still effectively retain data that is far away.

[0092] The forget gate determines whether information is retained or discarded. This gate reads h t-1 and x t , a numerical output will be made, the range of which is 0-1. The actual function of the output value is the amount of information that passes through the forget gate. If no information passes, then the output is 0, and if all information passes, then the output is 1. σ is the sigmoid function, W f is the unit weight matrix, b f is the bias matrix of the unit.

[0093] The update gate determines what value to update, c′ t will also be added to c, which is a vector.

[0094] Then the cell state is updated, and the old cell state is the same as f t Multiply, discard the information that is decided to be discarded, i t *c′ t is the new candidate value.

[0095] Finally, the output value of the unit is determined, and the output gate calculates h tThe sigmoid layer determines which part of the cell state is output, and the tanh layer processes it to obtain a value between -1 and 1, and finally determines the output.

[0096] This unit can only process information before the current moment. In contrast, RNN and its variants (such as bidirectional LSTM) have a bidirectional structure that can process forward and backward information at the same time, providing a more comprehensive understanding and analysis of data, so that each moment can determine the final output based on the previous and subsequent information. This bidirectional structure greatly improves model performance because they can process information at two moments at the same time. It can capture information from both the previous and the next moments, thereby more accurately solving the problems of "poor image processing technology" and "insufficiently detailed analysis of detection methods".

[0097] In some embodiments, Figure 3 As shown, the step 4) comprises the following steps:

[0098] 4.1) Take the spliced ​​data as input data and perform global average pooling. The formula is as follows:

[0099]

[0100] Where: F(i, j) is the input data, H and W are the height and width of the input data respectively;

[0101] 4.2) Take the data after global average pooling as input data, perform full connection layer, and obtain the corresponding weight data. The formula is as follows:

[0102] y=wx+b(12);

[0103] Where: y is the weight data, w is the weight matrix, x is the input data, and b is the bias vector;

[0104] 4.3) Take the concatenated data as input data, perform feature re-labeling based on the weight data obtained by the fully connected layer, and obtain weighted data. The formula is as follows:

[0105]

[0106] Where: is the weighted data, x is the input data, and g(x) is the weight data.

[0107] Among them, global average pooling is a method for compressing two-dimensional features in order to obtain global features.

[0108] The process of generating different weight values ​​in the fully connected layer aims to build correlations between channels, which is mainly achieved through the fully connected layer. The number of output weights in this process is equal to the number of input channels. By learning the relationship between each channel, the model can assign appropriate weights to different channels, thereby highlighting the role of important channels and reducing the impact of irrelevant channels.

[0109] Feature relabeling assigns previously calculated weights to each channel so that its features can be effectively evaluated.

[0110] In some embodiments, the optimization termination condition in step 5) is the convergence of the loss function, and the loss function formula is as follows:

[0111]

[0112] Where: N is the length of the input sequence, is the predicted value of the model, y i is the true value.

[0113] Among them, optimization includes two key steps

[0114] First, the initialization of parameters;

[0115] Second, the loss function is established and the stopping condition is set. The details are as follows:

[0116] 1. Parameters such as weights and learning rates need to be set before they can be correctly applied to the model.

[0117] 2. The loss function is an important learning criterion that can be used to measure the performance of a network and is often related to the optimization amount. It involves using the mean square error loss function to calculate the mean square error between them, so as to better describe the performance of a network and more accurately predict future results to achieve better results.

[0118] By applying the Adam optimizer, the weight parameters and bias parameters in the model can be effectively optimized to minimize the loss. The Adam optimizer can automatically adjust the learning rate.

[0119] By carefully adjusting the parameters and functions, an effective network training process can be achieved, that is, according to the pre-set number of training times, the parameters of the model are continuously adjusted until a certain threshold is reached, so that even if the expected number of training times is not reached, the model can stop running when the threshold is met. After 3 epochs, if the loss function has not been significantly improved, the deep learning model will be terminated. By training the model, an effective model can be obtained, and these models can be used to evaluate their capabilities for comparison with other models.

[0120] Example 2

[0121] A storage medium is used to store the above-mentioned supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM.

[0122] Example 3

[0123] A computer device is used to execute the above-mentioned supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM.

Claims

1. A supercritical carbon dioxide pipeline damage inspection method based on attention mechanism fusion Bi-LSTM is characterized by: The steps include: 1) Collect pipeline image data and build a Bi-LSTM deep learning model equipped with an attention module; 2) Establishing an original data set based on the pipeline image data, and preprocessing the original data set to obtain standardized data; 3) Using the standardized data as input data, the spliced ​​data is obtained based on the Bi-LSTM deep learning model; 4) Taking the spliced ​​data as input data, weighted data is obtained based on the attention module; 5) Based on the Adam optimizer, the Bi-LSTM deep learning model equipped with the attention module is optimized; 6) Input pipeline image data into the optimized Bi-LSTM deep learning model equipped with an attention module to perform supercritical carbon dioxide pipeline damage inspection.

2. According to claim 1, the supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM is characterized in that: Acquiring pipeline image data in step 1) refers to converting the pipeline image into matrix data.

3. According to claim 1, the supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM is characterized in that: The preprocessing in step 2) refers to first cleaning the data and then standardizing the data; The data cleaning refers to first processing the outliers in the original data set, and then processing the missing values ​​in the processed data set; The outlier value processing is performed by setting it as a missing value; The missing value processing adopts the nearest neighbor algorithm, and the formula is as follows: Where: (x1, y1) and (x2, y2) are a set of corresponding coordinate points in the two-dimensional space data; ρ is the Euclidean distance of the coordinate points; d(x, y) is the sum of the Euclidean distances of the n data coordinate points; The data standardization is processed by a normalization method, and the formula is as follows: In the formula: x is the initial value of the data, x′ represents the standardized data, and x max is the maximum value of each column of data samples; x min is the minimum value of each column of data samples.

4. According to claim 1, the supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM is characterized in that: The step 3) comprises the following steps: 3.1) The previous sequence of the current inspection point is used as data input to the LSTM unit to calculate the forward output hidden state vector 3.2) The next segment of the sequence of the current inspection point is used as data input to the LSTM unit to calculate the backward output hidden state vector 3.3) Concatenate the forward output hidden state vector and the backward output hidden state vector of the current inspection point to obtain the concatenated data The formula is as follows: Where: t is the time constant.

5. According to claim 4, the supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM is characterized in that: The LSTM unit is shown as follows: f t =σ(w f ×[h t-1 ,E t ]+b f ) (5); I t =σ(w i ×[h t-1 ,E t ]+b i ) (6); the t =σ(w o ×[h t-1 ,E t ]+b o ) (7); c t =f t ×c t-1 +i t ×c t (9); h t =o t ×tanh(c t ) (10); Where: f t 、i t , o t They are the forget gate, input gate, and output gate at time t respectively; is the cell state at time t; c t is the memory cell at time t; h t is the hidden state vector at time t; σ is the sigmoid function; tanh() is the hyperbolic tangent function; w f 、w i 、w o are the weight matrices corresponding to the forget gate, input gate, and output gate respectively; w c for The weight matrix of f 、b i 、b o are the bias vectors corresponding to the forget gate, input gate, and output gate respectively; b c for The bias vector of t is the input vector at time t.

6. According to claim 4, the supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM is characterized in that: The step 4) comprises the following steps: 4.1) Take the spliced ​​data as input data and perform global average pooling. The formula is as follows: Where: F(i, j) is the input data, H and W are the height and width of the input data respectively; 4.2) Take the data after global average pooling as input data, perform full connection layer, and obtain the corresponding weight data. The formula is as follows: y=wx+b(12); Where: y is the weight data, w is the weight matrix, x is the input data, and b is the bias vector; 4.3) Take the concatenated data as input data, perform feature re-labeling based on the weight data obtained by the fully connected layer, and obtain weighted data. The formula is as follows: Where: is the weighted data, x is the input data, and g(x) is the weight data.

7. The supercritical carbon dioxide pipeline damage detection method based on attention mechanism fusion Bi-LSTM according to claim 1 is characterized in that: The optimization termination condition in step 5) is that the loss function converges, and the loss function formula is as follows: Where: N is the length of the input sequence, is the predicted value of the model, y i is the true value.

8. A storage medium, characterized in that: Used to store the supercritical carbon dioxide pipeline damage inspection method based on the attention mechanism fusion Bi-LSTM described in claims 1 to 7.

9. A computer device, characterized in that: Used to execute the supercritical carbon dioxide pipeline damage inspection method based on the attention mechanism fused Bi-LSTM as described in claims 1 to 7.