Pipeline crack detection method, device, equipment and medium
By introducing a dual-branch time domain feature extraction group, multi-head self-attention mechanism and dynamic feature enhancement module in pipeline detection, the problem of difficulty in extracting high-dimensional feature in the existing technology is solved, and high-precision detection and positioning of pipeline cracks is achieved.
Patent Information
- Application Number
- CN202510896632.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-01
AI Technical Summary
When using deep learning algorithms for pipeline detection in the prior art, it is difficult to effectively extract high-dimensional features, resulting in low pipeline inspection accuracy, especially thermal pipelines operating in high temperature and high humidity environments are prone to deformation and cracking.
A pipeline crack detection method is adopted, and the pipeline crack detection model of the dual-branch time domain feature extraction group, multi-head self-attention mechanism and dynamic feature enhancement module is used to obtain time series signals, high-frequency local defect characteristics and low-frequency global structural characteristics are extracted, and multi-scale features are calculated using the dynamic feature enhancement module, and the classification and regression tasks are performed in combination with an improved residual regressor.
It improves the accuracy and positioning accuracy of pipeline crack detection, can effectively capture local detailed characteristics and global characteristics of time series signals, and enhances the accuracy and reliability of detection.
Smart Images

Figure CN120404937A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of pipeline detection, and particularly to a pipeline crack detection method, device, equipment and medium. Background Art
[0002] Due to its high transportation efficiency and low economic cost, pipelines have been widely used in the field of long-distance energy transportation, which is crucial for economic construction and infrastructure development. Especially in the thermal energy industry, as a common pipeline for transmitting thermal energy, thermal pipelines play a key role in modern urban heating systems. Helical welded pipelines have been widely used in thermal pipeline systems due to their low cost and high production efficiency. However, as high-temperature and pressurized equipment, thermal pipelines are prone to problems such as pipeline deformation and cracking under the influence of various factors such as the nature of the medium during long-term operation in a high-temperature and high-humidity environment, which will directly affect the performance and quality of thermal pipelines. Therefore, it is particularly important to research and develop scientific and reasonable pipeline detection methods. At present, during the pipeline detection process using deep learning algorithms, there is a problem that high-dimensional features cannot be effectively extracted, which in turn affects the accuracy of pipeline inspection. Summary of the Invention
[0003] The purpose of the present application is to provide a pipeline crack detection method, device, equipment and medium, which can improve the accuracy of pipeline crack detection.
[0004] To achieve the above purpose, the present application provides the following solutions: In a first aspect, the present application provides a pipeline crack detection method, including: Obtaining a time series signal for detecting a target pipeline; the time series signal includes a plurality of signal samples, each signal sample corresponds to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point is an ultrasonic guided wave signal transmitted from one end of the target pipeline and received at the other end; Inputting the time series signal into a pipeline crack detection model to output a crack detection result; the pipeline crack detection model includes a double-branch time-domain feature extraction group, a multi-head self-attention mechanism and a dynamic feature enhancement module. The double-branch time-domain feature extraction group is used to extract time-domain features from each signal sample. The time-domain features include high-frequency local defect features and low-frequency global structure features. The output of the double-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the double-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors. The plurality of sample feature vectors are input into the dynamic feature enhancement module. The dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes. One signal sample corresponds to one sample feature vector.
[0005] Optionally, the dual-branch time-domain feature extraction group includes a first feature extraction branch and a second feature extraction branch; The first feature extraction branch includes a first convolutional layer, a ReLU activation function, and a first max pooling layer connected in sequence; the second feature extraction branch includes a second convolutional layer, a LeakyReLU activation function, and a second max pooling layer connected in sequence; The first feature extraction branch is used to extract high-frequency local defect features from each signal sample, and the second feature extraction branch is used to extract low-frequency global structure features from each signal sample.
[0006] Optionally, the multi-head self-attention mechanism is an enhanced multi-head self-attention mechanism, and the attention calculation formula of the enhanced multi-head self-attention mechanism is expressed as: ; ; where is the attention, Q represents the query matrix, K represents the key matrix, V represents the value matrix, the superscript T represents the transpose, is the dimension of the key vector, P represents the temporal position information, is the time-domain feature output by the dual-branch time-domain feature, is the learned query weight matrix, is the learned key weight matrix, is the learned value weight matrix.
[0007] Optionally, the dynamic feature enhancement module includes a forward feedback network and two dynamically feature-aware convolutional units connected in sequence with the same structure. The output of the first dynamically feature-aware convolutional unit is connected to the output of the first dynamically feature-aware convolutional unit through the forward feedback network and then input into the second dynamically feature-aware convolutional unit. The input of the first dynamically feature-aware convolutional unit is the input of the dynamic feature enhancement module, and the output of the second dynamically feature-aware convolutional unit is the output of the dynamic feature enhancement module; Each dynamically feature-aware convolutional unit includes a formula for calculating the convolutional kernel size, and the formula for calculating the convolutional kernel size is expressed as: ; where is the convolutional kernel size calculated according to the i-th sample feature vector, is the i-th sample feature vector, is the mean of the i-th sample feature vector, is the standard deviation of the i-th sample feature vector, and are both adjustment parameters, Indicates a rounding operation, The () function is used to limit the convolutional kernel size between 3 and 25.
[0008] Optionally, each dynamic feature perception convolutional unit includes a parallel dynamic single-scale branch, a fixed multi-scale branch, and a non-linear enhancement branch; The calculation formula of the dynamic single-scale branch is: ; Among them, ,…, ; ,…, ; ,…, ; ; ; Among them, is the convolutional kernel size calculated based on the i-th sample feature vector, indicates that the j-th feature in the i-th sample feature vector uses of the convolutional kernel for the step convolutional operation output; m is the number of features; is a constant, ; indicates the t-th data point of the convolutional window in the th sliding when performing the convolutional operation on the i-th sample; t is the relative position index in the convolutional kernel window; represents the convolutional weight coefficient of the j-th convolutional kernel at the t-th data point position, represents the bias term, and k represents the number of convolutional kernels; is the feature mean of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch, represents the standard deviation of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch; The calculation formula of the fixed multi-scale branch is: ; ; ; ; Among them, is the s-th preset convolutional kernel size, indicates that the j-th feature in the i-th sample feature vector uses of the convolutional kernel for the step convolutional operation output, () represents a splicing function, is the splicing result of convolution outputs with different preset convolution kernel sizes, is the feature mean of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, 、 and are the first, second, and third preset convolution kernel sizes respectively; 、 and are the outputs of the j-th feature in the i-th sample feature vector using the preset convolution kernel sizes of 、 and for the th step of convolution operation respectively; The calculation formula of the non-linear enhancement branch is: ; ; ; wherein, is a non-linear activation function, is the feature mean of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch, is the convolution sum output by the dynamic single-scale branch, () is layer normalization, is the feature after layer normalization enhancement; The outputs of each dynamic feature perception convolution unit are expressed as: , wherein, is the convolution sum output by the fixed multi-scale branch.
[0009] Optionally, the pipeline crack detection model further includes a classifier, the input of the classifier is connected to the output of the dynamic feature enhancement module, the classifier uses an improved residual regressor, and the improved residual regressor includes six parts connected in sequence. The first part includes a convolution operation, normalization, ReLU activation function, and max pooling connected in sequence; the second part includes 3 residual blocks connected in sequence, the third part includes 4 residual blocks connected in sequence, the fourth part includes 6 residual blocks connected in sequence, the fifth part includes 3 residual blocks connected in sequence, and the sixth part includes average pooling, fully connected layer, and Softmax function connected in sequence.
[0010] Optionally, the pipeline crack detection model is obtained by training a target neural network using a training set; Each sample data in the training set includes input data and label data. The input data is a time series signal sample, and the label data includes a classification result. The classification result includes having cracks and no cracks. When there are cracks, the label data further includes the crack position; The sample data in the training set is obtained by simulating actual cracks on a spiral welded pipe test piece.
[0011] In a third aspect, the present application provides a pipeline crack detection device. The pipeline crack detection device applies the pipeline crack detection method described in any one of the above. The pipeline crack detection device includes: A time series signal acquisition module, configured to acquire a time series signal for detecting a target pipeline; the time series signal includes a plurality of signal samples, each signal sample corresponds to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point is an ultrasonic guided wave signal received from one end after being emitted from the other end of the target pipeline; A crack detection module, configured to input the time series signal into the pipeline crack detection model and output a crack detection result; the pipeline crack detection model includes a double-branch time-domain feature extraction group, a multi-head self-attention mechanism, and a dynamic feature enhancement module. The double-branch time-domain feature extraction group is used to extract time-domain features from each signal sample. The time-domain features include high-frequency local defect features and low-frequency global structure features. The output of the double-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the double-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors. The plurality of sample feature vectors are input into the dynamic feature enhancement module. The dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes; one signal sample corresponds to one sample feature vector.
[0012] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor executes the computer program to implement the steps of the pipeline crack detection method described in any one of the above.
[0013] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the pipeline crack detection method described in any one of the above are implemented.
[0014] According to the specific embodiments provided in the present application, the following technical effects are disclosed in the present application: The present application provides a pipeline crack detection method, device, equipment and medium. The dynamic feature enhancement module of the present application is used to calculate a convolution kernel size according to each input sample feature vector, and output multi-scale features according to different convolution kernel sizes, which can capture the local detail features and global features of time series signals, so as to effectively extract high-dimensional features and improve the accuracy of pipeline crack detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0016] Figure 1 It is a schematic flowchart of a pipeline crack detection method provided by an embodiment of the present application.
[0017] Figure 2 It is a schematic structural diagram of a double-branch time-domain feature extraction group provided by an embodiment of the present application.
[0018] Figure 3 It is a schematic principle diagram of a multi-head attention mechanism provided by an embodiment of the present application.
[0019] Figure 4 It is a schematic principle diagram of a dynamic feature perception convolution unit provided by an embodiment of the present application.
[0020] Figure 5 It is a schematic structural diagram of a ResNet-Lite network provided by an embodiment of the present application.
[0021] Figure 6 It is a schematic structural diagram of a pipeline crack detection model provided by an embodiment of the present application.
[0022] Figure 7 It is a schematic functional module diagram of a pipeline crack detection device provided by an embodiment of the present application.
[0023] Figure 8 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0025] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0026] In an exemplary embodiment, the present application provides a pipeline crack detection method, as Figure 1 shown, the pipeline crack detection method includes Step 101 - Step 102.
[0027] Step 101: Obtain a time series signal for detecting a target pipeline; the time series signal includes a plurality of signal samples, each signal sample corresponding to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point is an ultrasonic guided wave signal received at the other end after being transmitted from one end of the target pipeline.
[0028] Step 102: Input the time series signal into a pipeline crack detection model to output a crack detection result; the pipeline crack detection model includes a double-branch time-domain feature extraction group, a multi-head self-attention mechanism, and a dynamic feature enhancement module. The double-branch time-domain feature extraction group is used to extract time-domain features from each signal sample, and the time-domain features include high-frequency local defect features and low-frequency global structure features. The output of the double-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the double-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors. The plurality of sample feature vectors are input into the dynamic feature enhancement module, and the dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes; one signal sample corresponds to one sample feature vector.
[0029] In an exemplary embodiment, Step 101 specifically includes: obtaining a spatio-temporal mixed signal of pipeline ultrasonic guided waves through a sensor to generate a time series signal with position labels, that is, a time series matrix where n is the number of sampling points and m is the feature dimension.
[0030] The position tag binds the time - series signal of the ultrasonic guided wave to the spatial position information of the pipeline through spatio - temporal domain feature fusion. It not only provides a supervision signal with clear physical meaning (supporting crack location) for the pipeline crack detection model, but also enhances the scene adaptability of signal features (such as distinguishing interference and compensating for attenuation). It is the key prior information for realizing the "classification + regression" multi - task detection.
[0031] In an exemplary embodiment, the target pipeline is a spiral - welded pipeline. The sensor includes a transmitting sensor and a receiving sensor. The transmitting sensor is arranged at one end of the target pipeline, and the receiving sensor is arranged at the other end. The transmitting sensor uses the MsSR3030R sensor, and the parameters of the MsSR3030R sensor are shown in Table 1. The receiving sensor uses the NI PXIe - 5160 data acquisition card. A 32 kHz Hanning - window - modulated ultrasonic guided - wave pulse signal is generated using a function generator (Agilent 33220A). The NI PXIe - 5160 data acquisition card is used for data acquisition. In order to pre - process the collected signal, the direct - current (DC) component is removed, and the signal amplitude is normalized to the range of [-1, 1].
[0032] Table 1 Parameters of the MsSR3030R sensor
[0033] A signal sample refers to a sample collected at a sampling frequency of 250KHz. Each signal sample has 2068 time points.
[0034] In an exemplary embodiment, the present application inputs the time - series matrix into a multi - scale feature fusion network, which includes a two - branch time - domain feature extraction group and a dynamic feature enhancement module.
[0035] As Figure 2 shown, the two - branch time - domain feature extraction group includes a first feature extraction branch and a second feature extraction branch. The first feature extraction branch is used to extract high - frequency local defect features , and the second feature extraction branch is used to extract low - frequency global structure features .
[0036] Both the first feature extraction branch and the second feature extraction branch are one - dimensional convolution groups.
[0037] The two - branch time - domain feature extraction group extracts high - frequency local defect features and low - frequency global structure features through parallel one - dimensional convolution groups with dilation rates of 1 and 5 respectively.
[0038] The first feature extraction branch includes a first convolutional layer, a ReLU activation function, and a first max pooling layer connected in sequence; the second feature extraction branch includes a second convolutional layer, a LeakyReLU activation function, and a second max pooling layer connected in sequence.
[0039] The convolutional layer of the first feature extraction branch has a kernel size of , a dilation rate of 1, and 32 output channels. The second feature extraction branch extracts low-frequency features, and the convolutional layer has a kernel size of , a dilation rate of 5, and 64 output channels.
[0040] In the multi-scale feature fusion network, a multi-head attention mechanism is used to achieve cross-domain dependence, and the multi-head self-attention mechanism is an enhanced multi-head self-attention mechanism. The enhanced multi-head self-attention mechanism establishes long-range dependence relationships between cross-interval feature points in the time series, solving the problem of loss of feature correlation caused by the attenuation of ultrasonic guided wave signals after long-distance propagation.
[0041] Calculate the dependence weights between feature points using the enhanced multi-head attention mechanism , and the formula is: .
[0042] Where and are both weight matrices, is the dimension of the feature vector, is the dimension of the key vector, is the time position encoding vector, is a data set with a dimension of .
[0043] The input of the enhanced multi-head self-attention mechanism is the output features of the dual-branch time-domain feature extraction group , is the sequence length, D = 96 is the feature dimension, is a data set with a dimension of, N is the number of sampling points, which is 2068 in the data set. The enhanced multi-head self-attention mechanism specifically includes the following.
[0044] (1) Inject time position encoding: , where is the time position encoding at the j-th position of the time step i, and each constitutes the time position encoding vector .
[0045] Generate temporal position information through the sine function to avoid the recursive calculation of the recurrent neural network.
[0046] (2) Generate Query, Key, and Value by passing the input features through three different linear transformations: .
[0047] Among them, , , , and the dimension of each attention head = 64.
[0048] (3) Calculate the scaled dot-product attention: ; .
[0049] Among them, is the i-th attention head, is the dimension of the key vector, and is scaled to prevent the dot-product result from being too large.
[0050] (4) Multi-head concatenation and fusion: .
[0051] Among them, represents the output of multi-head concatenation and fusion, represents the linear transformation matrix of the output, , is a data set of dimension.
[0052] In an exemplary embodiment, as Figure 6 shown, the pipeline crack detection model further includes a classifier, the input of the classifier is connected to the output of the dynamic feature enhancement module, and the classifier adopts an improved residual regressor (ResNet-Lite). The improved residual regressor outputs the probability of the existence of cracks and the position coordinates , supporting multi-task output of classification and regression.
[0053] During the training process of the pipeline crack detection model, the loss function is .
[0054] Among them, L is the total loss value, is the cross-entropy loss, is the mean squared error loss.
[0055] The improved residual regressor consists of 33 convolutional layers and 1 fully connected layer. Specifically, the ResNet-Lite network includes six parts connected in sequence, as Figure 5As shown in the figure, the first part to the sixth part (corresponding to the first step to the sixth step). The first part (convolution layer 1) includes a convolution operation (kernel size 7×7, stride 2), normalization, ReLU activation function, and max pooling (stride 2) connected in sequence; the second part (convolution layer 2) includes 3 residual blocks connected in sequence, the third part (convolution layer 3) includes 4 residual blocks connected in sequence, the fourth part (convolution layer 4) includes 6 residual blocks connected in sequence, the fifth part (convolution layer 5) includes 3 residual blocks connected in sequence, and the sixth part includes average pooling, fully connected layer, and Softmax function connected in sequence. Each residual block contains two 3×3 convolution layers, and the skip connection is used to avoid gradient vanishing.
[0056] The sixth part converts the feature map (7×7×2048) output by the fifth part into a feature vector through global average pooling, and the fully connected layer outputs the classification or regression result. Taking an image with a size of 224×224×3 as the input data of the ResNet-Lite network, after the convolution processing of the first five parts, the output is a feature map with a dimension of 7×7×2048.
[0057] This application uses a pre-trained ResNet-Lite network for feature extraction and classification, and the linear layer outputs the prediction result. In the classification task, the output is the probability distribution of each category; in the regression task, it is the corresponding target value.
[0058] (1) Input adaptation layer: 。
[0059] Among them, represents the dimension adjustment function, is the feature after dimension adjustment, represents the feature before dimension adjustment, represents the index of dimension expansion, which is used to construct the pseudo-image format (single channel) so that the one-dimensional time series signal can be input into ResNet.
[0060] Expand the one-dimensional feature into the pseudo-image format, is a constant, Adapt the ResNet input size through interpolation.
[0061] (2) Backbone network: Improved based on ResNet34, including: Convolution layer 1: Convolution (stride 2), normalization, ReLU, and max pooling (stride 2); Residual block configuration: [3,4,6,3] blocks; Global average pooling layer: The output feature vector dimension is 2048.
[0062] (3) Multi-task head: Classification branch: fully connected layer + Softmax, output dimension (with crack / without crack); Regression branch: fully connected layer, output dimension 1 (coordinates of defect location, unit: meter); Loss function: , = 0.5.
[0063] During the training process of the ResNet-Lite network, the Adam optimizer is adopted (learning rate 1×10 −4 , weight decay 5×10 −5 ), batch size 32, and number of training epochs 50.
[0064] The local features extracted by the dual-branch time-domain feature extraction group of this application and the global dependence relationship established by the multi-head attention module are fused by an adaptive convolution kernel to form a high-dimensional feature matrix . Further extract deep abstract features through the ResNet-Lite network, and finally achieve classification (defect existence) and regression (defect location) tasks.
[0065] The attention mechanism determines the importance of certain elements by calculating the relationships between elements within a time series. The core is to use the calculated attention weights as input features to obtain a weighted output. As Figure 4 shown, the multi-head attention mechanism distributes attention to different representation subspaces, enabling the pipeline crack detection model to learn the internal relationships of the input data from multiple perspectives.
[0066] The multi-head attention module adopts the multi-head attention mechanism and uses a custom multi-head attention mechanism to establish a global dependence relationship between features at different positions in the sequence, enabling the pipeline crack detection model to identify key features in the time series and solve the long-distance dependence problem.
[0067] Convert the time series signal into a high-dimensional feature vector through the embedding layer. The embedding layer is connected to the output end of the one-dimensional convolution kernel module.
[0068] Figure 3 In [mask(opt.)], mask is an optional masking operation, mask is the mask, and opt. is the abbreviation of optional. In the pipeline detection task, when dealing with variable-length signals or when it is necessary to limit the context dependence range, mask(opt.) can be enabled here. Scale represents a scaling operation, which normalizes the dot product attention result. This prevents the dot product result from being too large, causing the gradient of the softmax function to vanish and ensuring the numerical stability of the attention weights. MatMul represents matrix multiplication.
[0069] The dynamic feature enhancement module includes a forward feedback network and two dynamically feature-aware convolutional units with the same structure connected in sequence. The output of the first dynamically feature-aware convolutional unit is connected to the input of the second dynamically feature-aware convolutional unit after passing through the forward feedback network and being connected to the output of the first dynamically feature-aware convolutional unit. The input of the first dynamically feature-aware convolutional unit is the input of the dynamic feature enhancement module, and the output of the second dynamically feature-aware convolutional unit is the output of the dynamic feature enhancement module.
[0070] The dynamically feature-aware convolutional unit in this application combines the architecture of the multi-head attention mechanism and the feed-forward network. By means of residual connection, the input features are combined with the attention output, enhancing the influence of global features while retaining the original features. Then, through the output of the feed-forward network and another residual connection, the representation ability of the time series is strengthened, enabling the pipeline crack detection model to better understand complex sequence features. The dynamically feature-aware convolutional unit includes two cascaded dynamically feature-aware convolutional units, and the structure of the dynamically feature-aware convolutional unit is as Figure 4 shown.
[0071] The input features of the dynamically feature-aware convolutional unit are the output of the multi-head attention module, with a dimension of , where represents the feature dimension of each attention head in the multi-head attention module.
[0072] In an exemplary embodiment, a dynamic adjustment strategy is adopted, that is, in a data-driven manner, the size of the convolutional kernel is adjusted as part of the data features to adapt the convolutional kernel size to the original collected data set.
[0073] Each dynamically feature-aware convolutional unit includes a formula for calculating the convolutional kernel size, and the formula for calculating the convolutional kernel size is expressed as: .
[0074] Where is the convolutional kernel size calculated according to the i-th sample feature vector, is the i-th sample feature vector, is the mean of the i-th sample feature vector, is the standard deviation of the i-th sample feature vector, and are both adjustment parameters, represents the rounding operation, The () function is used to limit the convolutional kernel size between 3 and 25.
[0075] This application adopts a dynamic adjustment strategy, that is, in a data-driven manner, the size of the convolutional kernel is adjusted as part of the data features to adapt the convolutional kernel size to the original collected data set.
[0076] Calculate the convolution kernel size through the convolution kernel size calculation formula, where , , to ensure that the kernel size adapts to the data features.
[0077] In an exemplary embodiment, each dynamic feature-aware convolution unit includes a parallel dynamic single-scale branch, a fixed multi-scale branch, and a non-linear enhancement branch.
[0078] Calculate the data features of the original data set and determine the dynamic convolution kernel size. In the dynamic single-scale branch, multiple convolution kernels of different sizes are adaptively generated according to the data features of the original data set , and .
[0079] The calculation formula of the dynamic single-scale branch is: ; where ,…, ; ,…, ; ,…, ; ; ; where is the convolution kernel size calculated according to the i-th sample feature vector, represents the output of the j-th feature in the i-th sample feature vector using a convolution kernel of for the th convolution operation; is the number of features; is a constant, ; represents the t-th data point of the convolution window in the rd sliding when performing a convolution operation on the i-th sample; t is the relative position index in the convolution kernel window; represents the convolution weight coefficient of the j-th convolution kernel at the t-th data point position, represents the bias term, and k represents the number of convolution kernels; is the feature mean of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch, represents the standard deviation of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch; The dynamic feature-aware convolution unit is expressed as: , where M is the set of , and S is the set of .
[0080] The calculation formula of the fixed multi-scale branch is as follows: ; By operating on convolution kernels of different sizes with this formula, the dynamic feature perception convolution unit can capture the local detail features and global features of the original data set. For the output result of each convolution, a new convolution output matrix is calculated.
[0081] ; The outputs of multiple convolution kernels of different sizes are concatenated through this formula.
[0082] ; .
[0083] Among them, is the s-th preset convolution kernel size, represents the output of the j-th feature in the i-th sample feature vector using the convolution kernel of for the -th convolution operation, () represents the concatenation function, is the concatenation result of the convolution outputs of different preset convolution kernel sizes, is the feature mean of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, , and are the 1st, 2nd, and 3rd preset convolution kernel sizes respectively; , and are the outputs of the j-th feature in the i-th sample feature vector using the preset convolution kernel sizes of , and for the -th convolution operation respectively, () represents the concatenation function.
[0084] For example, the fixed multi-scale branch uses a predefined kernel size set for parallel convolution to generate cross-scale features and concatenates them to generate a cross-scale feature representation , .
[0085] Among them, represent predefined kernel sizes of 5, 11, and 19 respectively.
[0086] The non-linear enhancement branch adds a learnable non-linear activation function.
[0087] Function , where x is the input variable.
[0088] Enhance the discriminability of features through layer normalization, which can be expressed as: .
[0089] Among them, is the convolution sum of the output of the dynamic single-scale branch, () represents layer normalization, is the feature after layer normalization enhancement. Through "activation + layer normalization", feature standardization, discriminability enhancement and training stability are achieved, providing high-quality non-linear defect features for subsequent modules and supporting the high-precision performance of this application in industrial ultrasonic testing.
[0090] The calculation formula of the non-linear enhancement branch is: ; .
[0091] Among them, is the non-linear activation function, is the feature mean of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch.
[0092] The generation of multi-scale convolution kernels includes: generating convolution kernels of 3 predefined sizes (such as =7, =15, =21), calculating the output at each scale through the formula and concatenating them into multi-scale features .
[0093] The output of each dynamic feature perception convolution unit is expressed as , where is the convolution sum of the output of the fixed multi-scale branch.
[0094] This application defines the collected time - series signals (a data set of ultrasonic guided - wave signals) as a convolution kernel, and adopts a dynamic adjustment strategy. The size of the convolution kernel is adjusted as part of the data features to adapt the convolution kernel size to the original data set collected, that is, the time - series signals. Calculate the data features of the original data set to determine the adaptive convolution kernel size. The dynamic feature - aware convolution unit can capture the local detailed features and global features of the original data set. The dual - branch time - domain feature extraction group captures local features, and EXCHANGE captures global features. EXCHANGE is the output of the dynamic feature - aware convolution unit, and the multi - head attention mechanism captures the long - range dependencies at different positions.
[0095] The method for multi - scale feature extraction driven by a dynamic kernel in this application uses the feature vector statistics (mean / standard deviation) to dynamically generate the convolution kernel size, and combines three - branch fusion to achieve multi - scale feature enhancement.
[0096] In an exemplary embodiment, the pipeline crack detection model is obtained by training a target neural network using a training set.
[0097] Each sample data in the training set includes input data and label data. The input data is a time - series signal sample, and the label data includes a classification result. The classification result includes having cracks and no cracks. When there are cracks, the label data also includes the crack position.
[0098] The sample data in the training set is obtained by simulating actual cracks on a spiral - welded pipe test piece.
[0099] The data set in this application is obtained by simulating actual cracks on a real spiral - welded pipe test piece, and collects the changes in the ultrasonic guided - wave time - series of the pipeline. It makes up for the spiral - welded pipe defect detection technology in pipeline defect detection. The data set is divided into a training set and a test set.
[0100] Compare the spiral - welded pipe with the non - spiral - welded pipe, perform a classification task on the two sets of data, and extract the signal region caused by the spiral weld in the ultrasonic guided - wave signal to avoid the influence caused by the spiral weld during detection.
[0101] Given that the current failure rate of pipelines is low and on - site detection is difficult, it is quite challenging to obtain accurate defect data. Therefore, the experimental object, that is, the time - series signal sample, is obtained by simulating actual cracks on a real spiral - welded pipe test piece. The time - series signal sample represents the changes in the ultrasonic guided - wave time - series of the pipeline, making up for the spiral - welded pipe defect detection technology in pipeline defect detection. The parameters of the spiral - welded pipe are shown in Table 2 below.
[0102] Table 2 Parameters of the spiral - welded pipe
[0103] A sensor with a frequency of 32 kHz is installed at one end of the pipeline and defined as the origin. Defects at different positions are simulated at 0.5 m, 1.5 m, 3 m, 4.6 m, 6 m, 7.4 m, 9 m, 10.5 m, and 12 m away from the origin. The dataset is shown in Table 3 and contains 1652 signal samples, and each signal sample contains 2068 time points. The dataset synthesizes various situations that may be encountered in the actual signal acquisition process to ensure the authenticity of the experimental results. The dataset information is shown in Table 3. Due to factors such as pipeline supports, wrapping layers, slight deformation of pipe segments, and the performance of detection equipment, there is zero noise in some signals. Classification tasks (defect detection) and regression tasks (defect localization) are performed on data with a high signal-to-noise ratio (≥1.2), and regression tasks are performed on data with a low signal-to-noise ratio (<1.2) and zero noise.
[0104] Table 3 Dataset Information
[0105] The spiral welded pipeline is compared with the non-spiral welded pipeline, and classification tasks are performed on the two sets of data. The signal regions caused by the spiral welds in the ultrasonic guided wave signals are extracted to avoid the influence of the spiral welds during detection.
[0106] The dynamic feature perception convolution unit proposed in this application can effectively extract the high-level features in the time series and effectively improve the accuracy of pipeline crack detection and the positioning accuracy. During the propagation of ultrasonic guided waves in spiral welds, signal attenuation and signal reflection will occur in the weld area, making the signals in this area complex. The method of this application can effectively extract the signal regions of spiral welds and defect signal regions and avoid the influence of spiral welds on detection. This application can process a large number of data samples, accurately identify pipeline defects, and locate the defect positions.
[0107] Based on the same inventive concept, the embodiment of this application also provides a pipeline crack detection device for implementing the pipeline crack detection method involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more pipeline crack detection device embodiments provided below can refer to the limitations on the pipeline crack detection method in the above text and will not be elaborated here.
[0108] In an exemplary embodiment, as Figure 7 shown, a pipeline crack detection device is provided, and a pipeline crack detection device includes the following modules.
[0109] A time series signal acquisition module for acquiring time series signals for detecting a target pipeline; the time series signals include a plurality of signal samples, each signal sample corresponding to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point being an ultrasonic guided wave signal transmitted from one end of the target pipeline and received at the other end.
[0110] A crack detection module for inputting the time series signals into a pipeline crack detection model and outputting a crack detection result; the pipeline crack detection model includes a double-branch time-domain feature extraction group, a multi-head self-attention mechanism, and a dynamic feature enhancement module. The double-branch time-domain feature extraction group is used to extract time-domain features from each signal sample. The time-domain features include high-frequency local defect features and low-frequency global structure features. The output of the double-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the double-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors. The plurality of sample feature vectors are input into the dynamic feature enhancement module. The dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes. One signal sample corresponds to one sample feature vector.
[0111] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pipeline crack detection data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a pipeline crack detection method.
[0112] Those skilled in the art can understand, Figure 8The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. Specifically, the computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0113] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0114] It should be noted that the collection, use, and processing of the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application need to comply with relevant regulations.
[0115] Those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0116] In each of the embodiments provided in this application, the databases involved may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., without limitation. In each of the embodiments provided in this application, the processor may be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a data processing logic unit of a programmable logic device, etc., without limitation.
[0117] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0118] Specific examples are used herein to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A pipeline crack detection method, characterized in that, The pipeline crack detection method includes: Obtaining a time series signal for detecting a target pipeline; the time series signal includes a plurality of signal samples, each signal sample corresponding to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point being an ultrasonic guided wave signal received from the other end after being emitted from one end of the target pipeline; Inputting the time series signal into a pipeline crack detection model to output a crack detection result; the pipeline crack detection model includes a dual-branch time-domain feature extraction group, a multi-head self-attention mechanism, and a dynamic feature enhancement module. The dual-branch time-domain feature extraction group is used to extract time-domain features from each signal sample, the time-domain features including high-frequency local defect features and low-frequency global structure features. The output of the dual-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the dual-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors, and the plurality of sample feature vectors are input into the dynamic feature enhancement module. The dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes. One signal sample corresponds to one sample feature vector.
2. The pipeline crack detection method according to claim 1, characterized in that, The dual-branch time-domain feature extraction group includes a first feature extraction branch and a second feature extraction branch; The first feature extraction branch includes a first convolutional layer, a ReLU activation function, and a first max pooling layer connected in sequence; the second feature extraction branch includes a second convolutional layer, a LeakyReLU activation function, and a second max pooling layer connected in sequence; The first feature extraction branch is used to extract high-frequency local defect features from each signal sample, and the second feature extraction branch is used to extract low-frequency global structure features from each signal sample.
3. The pipeline crack detection method according to claim 1, characterized in that The multi-head self-attention mechanism is an enhanced multi-head self-attention mechanism, and the attention calculation formula of the enhanced multi-head self-attention mechanism is expressed as: ; ; Among them, is the attention, Q represents the query matrix, K represents the key matrix, V represents the value matrix, and the superscript T represents the transpose. is the dimension of the key vector, and P represents the temporal position information. is the temporal feature of the output of the double-branch temporal domain feature. is the learned query weight matrix. is the learned key weight matrix. is the learned value weight matrix.
4. The pipeline crack detection method according to claim 1, characterized in that, The dynamic feature enhancement module includes a forward feedback network and two dynamically feature-aware convolutional units with the same structure connected in sequence. The output of the first dynamically feature-aware convolutional unit is connected to the input of the second dynamically feature-aware convolutional unit after passing through the forward feedback network. The input of the first dynamically feature-aware convolutional unit is the input of the dynamic feature enhancement module, and the output of the second dynamically feature-aware convolutional unit is the output of the dynamic feature enhancement module; Each dynamically feature-aware convolutional unit includes a formula for calculating the convolution kernel size, and the formula for calculating the convolution kernel size is expressed as: ; Among them, is the convolution kernel size calculated according to the i-th sample feature vector, is the i-th sample feature vector, is the mean of the i-th sample feature vector, is the standard deviation of the i-th sample feature vector, and are both adjustment parameters, represents the rounding operation, The () function is used to limit the convolution kernel size between 3 and 25.
5. The pipeline crack detection method according to claim 1, wherein, Each dynamically feature-aware convolutional unit includes a parallel dynamic single-scale branch, a fixed multi-scale branch, and a non-linear enhancement branch; The calculation formula of the dynamic single-scale branch is: ; Among them, ,…, ; ,…, ; ,…, ; ; ; Among them, is the convolution kernel size calculated according to the i-th sample feature vector, represents that the j-th feature in the i-th sample feature vector uses the convolution kernel for the output of the s-th convolution operation; m is the number of features; is a constant, ; represents the t-th data point of the convolution window in the s-th sliding when performing the convolution operation on the i-th sample; t is the relative position index in the convolution kernel window; represents the convolution weight coefficient of the j-th convolution kernel at the t-th data point position, represents the bias term, and k represents the number of convolution kernels; is the feature mean of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch, represents the standard deviation of the j-th feature in the i-th sample feature vector in the dynamic single-scale branch; The calculation formula of the fixed multi-scale branch is: ; ; ; ; Among them, is the s-th preset convolution kernel size, represents the output of the j-th feature in the i-th sample feature vector using the convolution kernel for the -th step of convolution operation, () represents the concatenation function, is the concatenation result of the convolution outputs of different preset convolution kernel sizes, is the feature mean of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the fixed multi-scale branch, and and are the 1st, 2nd, and 3rd preset convolution kernel sizes respectively; and and are the outputs of the j-th feature in the i-th sample feature vector using the and and preset convolution kernel sizes for the -th step of convolution operation respectively; The calculation formula of the non-linear enhancement branch is: ; ; ; Among them, is a non-linear activation function, is the feature mean of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch, is the standard deviation of the j-th feature in the i-th sample feature vector in the non-linear enhancement branch, is the convolution sum output by the dynamic single-scale branch, () is layer normalization, is the feature after layer normalization enhancement; The output of each dynamic feature perception convolutional unit is expressed as: , where is the convolution sum of the fixed multi-scale branch output.
6. The pipeline crack detection method according to claim 1, wherein The pipeline crack detection model further includes a classifier. The input of the classifier is connected to the output of the dynamic feature enhancement module. The classifier uses an improved residual regressor, and the improved residual regressor includes six sequentially connected parts. The first part includes a convolution operation, normalization, ReLU activation function, and max pooling connected in sequence; the second part includes 3 residual blocks connected in sequence, the third part includes 4 residual blocks connected in sequence, the fourth part includes 6 residual blocks connected in sequence, the fifth part includes 3 residual blocks connected in sequence, and the sixth part includes average pooling, a fully connected layer, and a Softmax function connected in sequence.
7. The pipeline crack detection method according to claim 1, characterized in that The pipeline crack detection model is obtained by training a target neural network using a training set; Each sample data in the training set includes input data and label data. The input data is a time series signal sample, and the label data includes a classification result. The classification result includes having cracks and no cracks. When there are cracks, the label data further includes the crack position; The sample data in the training set is obtained by simulating actual cracks on a spiral welded pipe test piece.
8. A pipeline crack detection device, characterized in that, The pipeline crack detection device applies the pipeline crack detection method according to any one of claims 1-7. The pipeline crack detection device includes: A time series signal acquisition module for acquiring a time series signal for detecting a target pipeline; the time series signal includes a plurality of signal samples, each signal sample corresponds to an ultrasonic guided wave signal at a time point, and the ultrasonic guided wave signal at each time point is the ultrasonic guided wave signal received at the other end after being emitted from one end of the target pipeline; A crack detection module for inputting the time series signal into the pipeline crack detection model and outputting a crack detection result; the pipeline crack detection model includes a double-branch time-domain feature extraction group, a multi-head self-attention mechanism, and a dynamic feature enhancement module. The double-branch time-domain feature extraction group is used to extract time-domain features from each signal sample. The time-domain features include high-frequency local defect features and low-frequency global structure features. The output of the double-branch time-domain feature extraction group is connected to the input of the multi-head self-attention mechanism. The output of the multi-head self-attention mechanism and the output of the double-branch time-domain feature extraction group are added together to form a plurality of sample feature vectors. The plurality of sample feature vectors are input into the dynamic feature enhancement module. The dynamic feature enhancement module is used to calculate a convolution kernel size according to each input sample feature vector and output multi-scale features according to different convolution kernel sizes; one signal sample corresponds to one sample feature vector.
9. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the pipeline crack detection method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the pipeline crack detection method according to any one of claims 1-7.
Citation Information
Patent Citations
Pipeline crack evaluating and positioning method based on nonlinear ultrasonic guided waves and deep learning
CN116609442A
Pipeline buried microcrack positioning method based on fusion feature matrix and deep learning
CN119881106A
Pipeline defect identification method and device, storage medium and equipment
CN119901821A
Cited By
Pipeline crack detection method, device, equipment and medium under condition of few sample data
CN121388406A
A method, apparatus, equipment and medium for detecting pipeline cracks using limited sample data.
CN121388406B