A method, apparatus, equipment and medium for detecting pipeline cracks using limited sample data.
By combining dataset construction, preprocessing, semantic feature extraction, and causal cross-attention mechanism, the accuracy and reliability issues of pipeline crack detection in scenarios with few samples are solved, achieving high-precision pipeline crack detection and localization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-03
AI Technical Summary
Existing pipeline crack detection technologies suffer from insufficient feature learning in scenarios with few samples, lack of semantic knowledge utilization, disconnect between classification and regression tasks, unreasonable data augmentation strategies, increased detection difficulty due to interference from spiral welds, low detection accuracy, and poor generalization.
A dataset is constructed, and after preprocessing, a large language model is used to extract semantic features. A one-dimensional convolutional neural network is combined to extract local temporal features. Feature fusion is performed through a causal cross-attention mechanism. A joint framework of classification sub-model and regression sub-model is constructed to achieve high-precision crack detection and localization with few samples.
High-precision pipeline crack detection and location were achieved under conditions of few samples, effectively suppressing interference from spiral welds and improving the accuracy and reliability of detection.
Smart Images

Figure CN121388406B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pipeline crack detection, and in particular to a method, apparatus, equipment and medium for pipeline crack detection with limited sample data. Background Technology
[0002] Pipelines are indispensable as core infrastructure for energy transportation in fields such as heating and oil and gas. Spiral welded pipes are widely used in heating systems due to their low cost and high efficiency. However, long-term operation in high-temperature and high-humidity environments can easily lead to cracks due to medium corrosion and stress fatigue, seriously threatening transportation safety.
[0003] Ultrasonic guided wave detection technology has become a mainstream method for pipeline defect detection due to its long-distance propagation and wide coverage. Existing technologies disclose pipeline defect detection methods and devices that involve testing or analyzing materials by measuring their chemical or physical properties. One method, based on sonar image fitting circle analysis, identifies defects in water-filled pipelines. This method acquires sonar images of the pipeline and analyzes the corresponding fitted circles by superimposing them. Another existing technology discloses a method for detecting and classifying rupture defects in drainage pipelines. This method identifies structural defects in drainage pipelines based on image or video detection, constructs a structural defect Mask R-CNN model, identifies structural defects in the drainage pipeline, and classifies the severity of the rupture defects.
[0004] However, the existing pipeline crack detection technologies mentioned above have the following problems:
[0005] (1) Insufficient feature learning in scenarios with few samples: Industrial defect samples are scarce, and traditional models rely on a large amount of labeled data, resulting in low detection accuracy and poor generalization.
[0006] (2) Lack of semantic knowledge utilization: It does not combine professional semantic descriptions such as "normal signal stable period" and "crack signal high frequency oscillation", and the feature expression ability is limited.
[0007] (3) Separation of classification and regression tasks: The two tasks are designed independently, and the correlation between "classification results guiding the screening of regression samples" is not utilized, which easily introduces invalid noise samples.
[0008] (4) Unreasonable data augmentation strategies: Failure to distinguish the characteristics of classification / regression tasks, and aggressive augmentation (such as time warping) will destroy the location characteristics of regression tasks.
[0009] (5) Interference of spiral weld: Signal attenuation and reflection in the weld area lead to complex characteristics, and existing methods are difficult to effectively distinguish between weld and defect signals.
[0010] Therefore, based on the above problems, there is an urgent need to provide a pipeline reliability analysis method or system that can achieve high-precision crack detection and location with a small number of samples. Summary of the Invention
[0011] The purpose of this application is to provide a method, apparatus, equipment, and medium for detecting pipeline cracks with limited sample data, which can achieve high-precision crack detection and location with limited sample data.
[0012] To achieve the above objectives, this application provides the following solution:
[0013] Firstly, this application provides a method for detecting pipe cracks using limited sample data, the method comprising:
[0014] Construct a dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation.
[0015] The dataset is preprocessed to obtain a preprocessed dataset; the preprocessing includes: standardization, classification task enhancement, and regression task enhancement.
[0016] Based on the preprocessed dataset, a knowledge enhancement module is constructed using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset.
[0017] Based on the preprocessed dataset, a one-dimensional convolutional neural network is used to extract local temporal features;
[0018] Based on the semantic features and the corresponding local temporal features, a causal cross-attention mechanism is used to fuse features to obtain fused features; the causal cross-attention mechanism is based on the cross-attention mechanism and combines the physical propagation law of ultrasonic guided waves and the structural characteristics of spiral welded pipes.
[0019] Based on the fusion features, a joint framework combining a classification sub-model and a regression sub-model is constructed; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location based on the current fusion features.
[0020] Pipeline crack prediction is performed using a combined framework that integrates categorical and regressive sub-models.
[0021] Optionally, the preprocessing of the dataset to obtain a preprocessed dataset specifically includes:
[0022] The ultrasonic guided wave time series signal is subjected to time series signal normalization and Z-score normalization to obtain the normalized time series signal.
[0023] When performing a classification task, the standardized time-series signal is augmented for the classification task; the augmentation includes adding Gaussian noise with a mean of 0 and a standard deviation of 0.03 with a 30% probability, time warping, and amplitude scaling.
[0024] When performing a regression task, the standardized time-series signal is augmented; the regression task augmentation includes adding noise with a mean of 0 and a standard deviation of 0.01 with a 30% probability.
[0025] Optionally, the knowledge enhancement module, constructed based on the preprocessed dataset and employing a large language model, specifically includes:
[0026] Obtain a large language model;
[0027] Fine-tuning of the large language model using annotation text from the field of pipeline ultrasonic guided waves;
[0028] Input the pre-defined descriptive texts of normal signals, crack signals, and spiral weld interference signals into the fine-tuned large language model, and extract the mean of the last hidden state as the initial semantic embedding.
[0029] The initial semantic embedding dimension is projected to a fusion dimension consistent with the local temporal features by a linear transformation matrix, and then processed by activation function and layer normalization to obtain semantic features.
[0030] Optionally, the large language model is a pre-trained BERT model.
[0031] Optionally, a one-dimensional convolutional neural network includes: an input layer, a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
[0032] Optionally, the step of fusing features based on the semantic features and the corresponding local temporal features using a causal cross-attention mechanism to obtain fused features specifically includes:
[0033] Using formula Determine the degree of attention paid to semantic features by local temporal features ;
[0034] in, h For attention head index, For each head dimension, the query value Key values are used to characterize the projection of local temporal features. Used to characterize semantic feature projection The time positions before the current time position t. , For local temporal features, This is the batch index, used to distinguish different batches of input data. The superscript T indicates transpose.
[0035] Optionally, the processing procedure of the classification sub-model is as follows:
[0036] Use the mean of the fused features as the data prototype;
[0037] Use the semantic features output by the knowledge enhancement module as semantic prototypes;
[0038] The data prototype and the semantic prototype are weighted and fused according to preset weights to obtain a fused prototype.
[0039] Calculate the negative cosine distance between the fusion features of the query sample and the fusion prototypes of each category, and convert it into classification probability using the softmax function.
[0040] Secondly, this application provides a pipeline crack detection device under limited sample data, the pipeline crack detection device under limited sample data includes:
[0041] The dataset construction module is used to construct the dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation.
[0042] The dataset preprocessing module is used to preprocess the dataset to obtain a preprocessed dataset; the preprocessing includes: standardization, classification task enhancement, and regression task enhancement;
[0043] A knowledge enhancement module construction module is used to construct a knowledge enhancement module based on the preprocessed dataset and using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset.
[0044] The local temporal feature extraction module is used to extract local temporal features based on the preprocessed dataset using a one-dimensional convolutional neural network.
[0045] The feature fusion determination module is used to perform feature fusion based on the semantic features and the corresponding local temporal features, using a causal cross-attention mechanism to obtain fused features; the causal cross-attention mechanism is based on the cross-attention mechanism and combines the physical propagation law of ultrasonic guided waves and the structural characteristics of spiral welded pipes.
[0046] The joint framework determination module is used to construct a joint framework combining a classification sub-model and a regression sub-model based on the fusion features; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location of the current fusion features.
[0047] The pipeline crack prediction module is used to predict pipeline cracks using a joint framework that combines classification sub-models and regression sub-models.
[0048] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the pipeline crack detection method under few sample data.
[0049] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method for detecting pipe cracks using few sample data.
[0050] According to the specific embodiments provided in this application, this application has the following technical effects:
[0051] This application provides a method, apparatus, device, and medium for pipeline crack detection using limited sample data. The method involves preprocessing the dataset to obtain a preprocessed dataset. This preprocessing includes standardization, classification task enhancement, and regression task enhancement, i.e., a task-adaptive enhancement strategy, which can handle limited sample data, accurately identify pipeline defects, and locate defect locations. Semantic embeddings and temporal features are extracted through a knowledge enhancement module and a one-dimensional convolutional neural network, and fused using a causal cross-attention mechanism to improve the expression of limited sample features. The causal cross-attention mechanism also strengthens the focus on key features (such as high-frequency oscillations) and suppresses weld interference. Addressing the issue that ultrasonic guided waves attenuate and reflect signals in the weld area during propagation in spiral welds, resulting in signal complexity in this region, this application effectively extracts the signal regions of the spiral weld and defects, avoiding the influence of the spiral weld on detection. The knowledge-enhanced classification-regression joint learning method based on Large Language Models (LLM) provided in this application achieves high-precision crack detection and location using limited sample data, offering a new solution for pipeline reliability analysis. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a schematic diagram of a pipeline crack detection method with limited sample data in one embodiment of this application;
[0054] Figure 2 This is a schematic diagram illustrating the principle of a pipeline crack detection method with limited sample data in one embodiment of this application;
[0055] Figure 3This is a schematic diagram of a one-dimensional convolutional neural network structure. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] In one exemplary embodiment, such as Figure 1 and Figure 2 As shown, a method for detecting pipe cracks using limited sample data is provided. This method includes the following steps S101 to S107. Wherein:
[0059] S101, Construct a dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation.
[0060] Specifically, a real spiral welded pipe specimen was used to simulate crack defects in actual operation. The pipe parameters conformed to the industrial thermal pipe standard, as shown in Table 1. A 32kHz sensor was installed at one end of the pipe as the origin. Crack defects at different locations were simulated at distances of 0.5m, 1.5m, 3m, 4.6m, 6m, 7.4m, 9m, 10.5m, and 12m from the origin, and ultrasonic guided wave time series signals were collected. As shown in Table 2, the dataset contains 1652 samples, each containing 2068 time points, comprehensively covering various scenarios in actual signal acquisition. The dataset integrates various situations that may be encountered during actual signal acquisition to ensure the authenticity of the experimental results. Due to factors such as pipe supports, cladding, slight deformation of pipe sections, and the performance of detection equipment, some signals contain zero noise. The experiment performed classification tasks (defect detection) and regression tasks (defect localization) on data with high signal-to-noise ratio (≥1.2), and regression tasks on data with low signal-to-noise ratio (<1.2) and zero noise.
[0061] Table 1
[0062]
[0063] Table 2
[0064]
[0065] S102, preprocess the dataset to obtain the preprocessed dataset; the preprocessing includes: standardization, classification task enhancement and regression task enhancement.
[0066] S102 specifically includes:
[0067] S21, perform time-series signal normalization and Z-score normalization on the ultrasonic guided wave time-series signal to obtain the normalized time-series signal. This eliminates data interference and standardizes the format;
[0068] ;
[0069] in, It is the first in the original signal The value of a time, = The mean of the signal. The standard deviation of the signal is T, where T=2068 represents the number of time points. To avoid small constants that divide by zero;
[0070] Map the location to For intervals, position labels are normalized to facilitate regression training. The formula can be expressed as:
[0071] ;
[0072] in, For the original location label, For the set of locations of all samples, The location labels are the normalized location labels.
[0073] S22, When performing a classification task, the standardized time-series signal is augmented for the classification task; the classification task augmentation (normal / crack signal) includes:
[0074] (1) Noise injection: Select "Gaussian noise with mean 0 and standard deviation 0.03" (based on experimental verification that the classification accuracy is the highest at this intensity, which is 5%-8% higher than that of 0.02 / 0.04 noise), with a probability of 30% (to avoid excessive noise causing feature distortion).
[0075] (2) Time warp: 0.8-1.2 times length scaling (based on the fact that the period of an ultrasonic guided wave signal is about 0.3ms, and this range does not destroy the "high-frequency oscillation" characteristic), probability 50%;
[0076] (3) Amplitude scaling: 0.9-1.1 random factor (to match the amplitude fluctuation range of the field signal, such as the signal amplitude deviation caused by the pressure change of the thermal pipeline ≤10%).
[0077] S23, During regression tasks, regression task enhancement (crack signals only) is performed on the standardized time-series signal; the regression task enhancement includes adding noise with a mean of 0 and a standard deviation of 0.01 with a 30% probability. Regression task enhancement can avoid destroying location features;
[0078] This application proposes a task-adaptive enhancement strategy, which uses aggressive enhancement for classification and low-noise injection only for regression to preserve location features.
[0079] S103, Based on the preprocessed dataset, a knowledge enhancement module is constructed using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset; the large language model is a pre-trained BERT model;
[0080] S103 specifically includes:
[0081] S31, Obtain the large language model;
[0082] To clearly define the characteristic differences between the three types of signals—"normal / crack / weld interference"—the following text description method is used:
[0083] (1) Normal signal: Normal vibration signals with stable patterns, showing periodic characteristics and low noise levels, that is, normal ultrasonic guided wave signals of thermal pipelines, showing periodic low-frequency fluctuations (200-500Hz), without sudden high-frequency components, and the signal amplitude fluctuation is ≤5% when interfered with by pipeline supports;
[0084] (2) Crack signals: Abnormal signals containing crack defects, characterized by high-frequency oscillations and non-stationary components, i.e., ultrasonic guided wave signals containing crack defects, exhibiting high-frequency oscillations of 1-3kHz at the defect location, with an oscillation duration ≥0.5ms. The signal attenuation rate in the spiral weld area is 15%-20% higher than that in the normal area.
[0085] (3) Interference signal of spiral weld: The reflected signal caused by spiral weld has the same period as the spacing of pipe weld and has no high-frequency oscillation component.
[0086] S32, fine-tuning the large language model using annotation text from the field of pipeline ultrasonic guided waves;
[0087] To enable the BERT model to understand pipeline inspection terminology such as "high-frequency oscillation" and "signal attenuation," and to avoid general semantic bias, the large language model was fine-tuned. Specifically:
[0088] Adding 1000 additional text annotations for ultrasonic guided wave signals (e.g., "The signal exhibits a 3kHz high-frequency oscillation at 1.5m, which is determined to be a crack") resulted in a 40% improvement in the matching accuracy between semantic embedding and temporal features after fine-tuning.
[0089] S33, input the pre-defined descriptive text of normal signal, crack signal and spiral weld interference signal into the fine-tuned large language model, and extract the mean of the last hidden state as the initial semantic embedding.
[0090] S34, the dimension of the initial semantic embedding is projected to a fusion dimension consistent with the local temporal features through a linear transformation matrix, and then processed by activation function and layer normalization to obtain semantic features.
[0091] Specifically, the weights of the linear transformation matrix (768 to 512 dimensions) are initialized using the "feature distribution of ultrasonic guided wave signals".
[0092] A pre-trained BERT model (bert-base-uncased) is used to extract semantic features from the text. The input class describes the text, and the mean of the last hidden state is taken as the semantic embedding (768 dimensions). The formula is as follows:
[0093] ;
[0094] in, For category Description text ( This indicates that it is normal. (Indicates a crack) for The last layer of the model indivual quantity, It is a semantic embedding vector (768 dimensions).
[0095] The semantic embeddings are projected onto a fusion dimension (512 dimensions) consistent with the temporal features.
[0096] ;
[0097] in, The linear transformation matrix (dimension 768) 512), Let Gaussian error be the activation function of the linear unit. For layer normalization.
[0098] S104, based on the preprocessed dataset, employs a one-dimensional convolutional neural network (1D-CNN) to extract local temporal features. The 1D-CNN includes an input layer, convolutional layers, activation functions, pooling layers, and a fully connected layer. The input layer feeds data into the network, the convolutional and pooling layers extract features, and the fully connected layer establishes the mapping between the extracted features and the output. A three-layer 1D-CNN is used to extract features from ultrasonic signals and identify local features. The structure of a 1D-CNN is as follows... Figure 3 As shown.
[0099] S105, based on the semantic features and corresponding local temporal features, a causal cross-attention mechanism is used to fuse features to obtain fused features, thereby strengthening the attention of key features (such as the high-frequency oscillation of cracks) and suppressing interfering features such as spiral welds; the causal cross-attention mechanism is based on the cross-attention mechanism and combines the physical propagation law of ultrasonic guided waves (temporal causal mask) and the structural characteristics of spiral welded pipes (weld region mask); the temporal causal mask only allows the current temporal position (t) to pay attention to the previous temporal position (t'≤t), and prohibits reverse attention (ultrasonic guided waves propagate unidirectionally along the pipe, and the signal is only transmitted from the origin to the far end, and reverse attention will introduce false features); the weld region mask is to pre-mark the pipe weld positions (such as 0.5m, 1.5m), and the attention weight at these positions is reduced by 50%.
[0100] S105 specifically includes:
[0101] Using formula Determine the degree of attention paid to semantic features by local temporal features ;
[0102] in, h For attention head index (8 heads in total). For each head dimension, the query value Key values are used to characterize the projection of local temporal features. Used to characterize semantic feature projection The time positions before the current time position t. , For local temporal features, This is a batch index used to distinguish different batches of input data.
[0103] The result of fusing multi-head attention for:
[0104] ;
[0105] in, , This indicates the concatenation of multiple results. This is for outputting the projection matrix.
[0106] When the number of attention heads is 8, 4 heads focus on "high-frequency oscillation characteristics" (crack identification), 2 heads focus on "signal attenuation characteristics" (weld differentiation), and 2 heads focus on "time-location correlation" (regression localization). The multi-head results are stitched together and the dimensions are optimized by outputting a projection matrix (512→256 dimensions).
[0107] S106, Based on the fusion features, a joint framework combining a classification sub-model and a regression sub-model is constructed; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location of the current fusion features.
[0108] The classification sub-model is the prototype network of the knowledge enhancement module; the processing procedure of the classification sub-model is as follows:
[0109] S1, the mean of the fused features As a data prototype; that is, the mean of the fusion features of similar (normal / cracked) samples in a small sample "support set" is used as the data prototype;
[0110] ;
[0111] in, The number of samples of class c in the few-sample "support set". The fusion feature of the i-th sample is obtained by fusing one-dimensional convolutional temporal features and semantic features. For classification probability, c =0 indicates the normal data prototype. c =1 represents the prototype of crack data.
[0112] S2, using the semantic features output by the knowledge enhancement module as semantic prototypes;
[0113] S3, The data prototype and the semantic prototype are weighted according to a preset weight. A weighted fusion process is performed (60% data prototype, 40% semantic prototype) to obtain the fused prototype. ;
[0114] ;
[0115] S4 calculates the negative cosine distance between the fusion features of the query sample and the fusion prototypes of each category (the smaller the distance, the higher the similarity), and converts it into classification probability through the softmax function, that is, outputting a binary label of "normal" or "crack", and outputting the classification probability (used for sample selection of subsequent regression sub-models).
[0116] ;
[0117] ;
[0118] ;
[0119] in, To query the cosine distance between sample b and the prototype of category c, Let T be the classification probability, and the superscript T is the transpose.
[0120] Only for classification prediction of cracks The sample is used to predict its actual location.
[0121] The regression sub-model specifically includes the following structure:
[0122] The regression sub-model is specifically designed for "crack location prediction," and its core is "continuous value regression based on selected samples," which avoids destroying location characteristics. Specific details are as follows:
[0123] (1) Input layer: Sample selection and feature input
[0124] Sample screening: Only accept samples whose output is "crack" from the classification sub-model, and exclude normal samples and noise samples;
[0125] Feature input: "Causal cross-attention fusion features" (256 dimensions) that are homologous to the classification sub-model, ensuring feature consistency.
[0126] (2) Core computing layer: Fully connected network regression
[0127] A lightweight, fully connected network is used to avoid compromising location-related features due to complex structures (the document emphasizes that "aggressive augmentation is not suitable for regression tasks; location features must be preserved"). The structure is as follows:
[0128] First layer: 256-dimensional fused features → 128-dimensional fully connected layer (activation function: GELU, to avoid gradient vanishing);
[0129] Second layer: 128-dimensional → 64-dimensional fully connected layer (add Dropout layer, dropoutrate=0.2 to prevent overfitting);
[0130] Output layer: 64-dimensional → 1-dimensional fully connected layer (outputs normalized position values, range [0,1]).
[0131] (3) Output layer: Position denormalization
[0132] Convert the output normalized position values into actual positions.
[0133] S107 utilizes a combined framework that integrates categorical and regressive sub-models for pipeline crack prediction.
[0134] In one exemplary embodiment, a pipe crack detection device based on few sample data is provided, the pipe crack detection device based on few sample data includes:
[0135] The dataset construction module is used to construct the dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation.
[0136] The dataset preprocessing module is used to preprocess the dataset to obtain a preprocessed dataset; the preprocessing includes: standardization, classification task enhancement, and regression task enhancement;
[0137] A knowledge enhancement module construction module is used to construct a knowledge enhancement module based on the preprocessed dataset and using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset.
[0138] The local temporal feature extraction module is used to extract local temporal features based on the preprocessed dataset using a one-dimensional convolutional neural network.
[0139] The feature fusion determination module is used to perform feature fusion based on the semantic features and the corresponding local temporal features, using a causal cross-attention mechanism to obtain fused features; the causal cross-attention mechanism is based on the cross-attention mechanism and combines the physical propagation law of ultrasonic guided waves and the structural characteristics of spiral welded pipes.
[0140] The joint framework determination module is used to construct a joint framework combining a classification sub-model and a regression sub-model based on the fusion features; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location of the current fusion features.
[0141] The pipeline crack prediction module is used to predict pipeline cracks using a joint framework that combines classification sub-models and regression sub-models.
[0142] In an exemplary embodiment, a computer device is provided, which may be a server or a terminal. The computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for detecting pipe cracks using limited sample data.
[0143] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0144] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0145] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0146] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. 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), magnetic 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 take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0147] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0148] In this application, all actions to acquire signals, information, or data are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with the authorization granted by the owner of the relevant device.
[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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, they should be considered to be within the scope of this specification.
[0150] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting pipe cracks using limited sample data, characterized in that, The method for detecting pipe cracks using limited sample data includes: Construct a dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation. The dataset is preprocessed to obtain a preprocessed dataset; the preprocessing includes: standardization, classification task enhancement, and regression task enhancement. Based on the preprocessed dataset, a knowledge enhancement module is constructed using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset. Based on the preprocessed dataset, a one-dimensional convolutional neural network is used to extract local temporal features; Based on the semantic features and corresponding local temporal features, a causal cross-attention mechanism is used for feature fusion to obtain fused features. The causal cross-attention mechanism combines the physical propagation law of ultrasonic guided waves and the structural characteristics of spiral welded pipes on the basis of the cross-attention mechanism. The physical propagation law of ultrasonic guided waves is a temporal causal mask; the structural characteristics of spiral welded pipes are a weld area mask. The temporal causal mask only allows the current temporal position to pay attention to the previous temporal position and prohibits reverse attention. The weld area mask is a pre-marked pipe weld position with the attention weight reduced by 50% at the pipe weld position. When the number of attention heads is 8, 4 heads are focused on characterizing the high-frequency oscillation features of crack identification, 2 heads are focused on characterizing the signal attenuation features of weld differentiation, and 2 heads are focused on characterizing the time-position correlation features of regression localization. The multi-head results are spliced and the dimensionality is optimized by outputting a projection matrix. Based on the fusion features, a joint framework combining a classification sub-model and a regression sub-model is constructed; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location based on the current fusion features. Pipeline crack prediction is performed using a joint framework that combines classification and regression sub-models. The processing procedure for the classification sub-model is as follows: Use the mean of the fused features as the data prototype; Use the semantic features output by the knowledge enhancement module as semantic prototypes; The data prototype and the semantic prototype are weighted and fused according to preset weights to obtain a fused prototype. Calculate the negative cosine distance between the fusion features of the query sample and the fusion prototypes of each category, and convert it into classification probability using the softmax function.
2. The method for detecting pipe cracks using limited sample data according to claim 1, characterized in that, The preprocessing of the dataset to obtain the preprocessed dataset specifically includes: The ultrasonic guided wave time series signal is subjected to time series signal normalization and Z-score normalization to obtain the normalized time series signal. When performing a classification task, the standardized time-series signal is augmented for the classification task; the augmentation includes adding Gaussian noise with a mean of 0 and a standard deviation of 0.03 with a 30% probability, time warping, and amplitude scaling. When performing a regression task, the standardized time-series signal is augmented; the regression task augmentation includes adding noise with a mean of 0 and a standard deviation of 0.01 with a 30% probability.
3. The method for detecting pipe cracks using limited sample data according to claim 1, characterized in that, Based on the preprocessed dataset, a large language model is used to construct a knowledge enhancement module, which specifically includes: Obtain a large language model; Fine-tuning of the large language model using annotation text from the field of pipeline ultrasonic guided waves; Input the pre-defined descriptive texts of normal signals, crack signals, and spiral weld interference signals into the fine-tuned large language model, and extract the mean of the last hidden state as the initial semantic embedding. The initial semantic embedding dimension is projected to a fusion dimension consistent with the local temporal features by a linear transformation matrix, and then processed by activation function and layer normalization to obtain semantic features.
4. The method for detecting pipe cracks with limited sample data according to claim 1 or claim 3, characterized in that, The large language model is a pre-trained BERT model.
5. The method for detecting pipe cracks using limited sample data according to claim 1, characterized in that, A one-dimensional convolutional neural network includes: an input layer, a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
6. The method for detecting pipe cracks using limited sample data according to claim 1, characterized in that, Based on the semantic features and the corresponding local temporal features, a causal cross-attention mechanism is used to fuse features to obtain fused features, specifically including: Using formula Determine the degree of attention paid to semantic features by local temporal features ; in, h For attention head index, For each head dimension, the query value Used to characterize local temporal feature projections, key values Used to characterize semantic feature projection The time positions before the current time position t. , For local temporal features, This is the batch index, used to distinguish different batches of input data. The superscript T indicates transpose.
7. A pipe crack detection device under limited sample data, used to implement the pipe crack detection method under limited sample data as described in any one of claims 1-6, characterized in that, The pipeline crack detection device under limited sample data includes: The dataset construction module is used to construct the dataset; the dataset consists of ultrasonic guided wave time series signals and test specimens of spiral welded pipes used to simulate crack defects at different locations during actual operation. The dataset preprocessing module is used to preprocess the dataset to obtain a preprocessed dataset; the preprocessing includes: standardization, classification task enhancement, and regression task enhancement; A knowledge enhancement module construction module is used to construct a knowledge enhancement module based on the preprocessed dataset and using a large language model; the knowledge enhancement module is used to extract semantic features from the preprocessed dataset. The local temporal feature extraction module is used to extract local temporal features based on the preprocessed dataset using a one-dimensional convolutional neural network. The feature fusion determination module is used to perform feature fusion based on the semantic features and the corresponding local temporal features, using a causal cross-attention mechanism to obtain fused features; the causal cross-attention mechanism is based on the cross-attention mechanism and combines the physical propagation law of ultrasonic guided waves and the structural characteristics of spiral welded pipes. The joint framework determination module is used to construct a joint framework combining a classification sub-model and a regression sub-model based on the fusion features; the classification sub-model is used to determine whether there is a crack in the signal to be tested, and when the determination result is that there is a crack, the regression sub-model is used to predict the defect location of the current fusion features. The pipeline crack prediction module is used to predict pipeline cracks using a joint framework that combines classification sub-models and regression sub-models.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the pipeline crack detection method with few sample data as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the pipeline crack detection method with few sample data as described in any one of claims 1-6.
Citation Information
Patent Citations
Pipeline crack detection method, device, equipment and medium
CN120404937A
Object surface defect segmentation method based on small samples
CN120689623A