Search

CN-122020300-A - Pipeline leakage detection method, system, equipment and medium

CN122020300ACN 122020300 ACN122020300 ACN 122020300ACN-122020300-A

Abstract

The invention provides a pipeline leakage detection method, a system, equipment and a medium, which belong to the technical field of pipeline safety monitoring and intelligent leakage detection, wherein the method comprises the steps of utilizing an acoustic sensor to collect pipeline signals of normal working conditions and various leakage states to construct a training sample; the method comprises the steps of constructing a KD-HMSA model comprising a teacher model and a student model pair, inputting a training sample into the model, generating softening probability distribution through Softmax with the temperature being more than 1 to achieve knowledge migration between a teacher and students, simultaneously introducing a supervision and comparison prototype learning mechanism into the student model to optimize intra-class compactness and inter-class separation degree, inputting a pipeline pressure signal to be tested into the optimized student model to obtain prediction probability distribution of pipeline states, and determining leakage detection results of the pipeline to be tested according to the prediction probability distribution. The method solves the problems of poor leak detection accuracy and poor generalization performance of the model under the condition of unbalanced data.

Inventors

  • SUN TONG
  • DONG HONGLI
  • WANG CHUANG
  • CHEN SHUANGQING
  • GUAN XUEZHONG
  • ZHAO XUEFENG
  • FENG QINGSHAN
  • Shang Rou

Assignees

  • 东北石油大学

Dates

Publication Date
20260512
Application Date
20260128

Claims (10)

  1. 1. A method of detecting a pipe leak, the method comprising the steps of: Acquiring a training sample set, wherein the training sample set comprises a plurality of types of pipeline pressure signal samples, and the types of the samples are distributed in an unbalanced manner; The method comprises the steps of constructing a teacher model and a student model, wherein the student model comprises a multi-scale feature extraction module, a layering splitting module, a convolution block attention module and an output module, wherein the multi-scale feature extraction module is used for carrying out parallel processing on pipeline pressure signals through a plurality of expansion convolution layers with different expansion rates to obtain multi-scale fusion features, the layering splitting module is used for carrying out step-by-step splitting and group-crossing interaction on the multi-scale fusion features to obtain interaction features, the convolution block attention module is used for carrying out attention weighting on the interaction features in a channel and space dimension to obtain strengthening features, and the output module is used for carrying out prediction based on the strengthening features to obtain prediction probability distribution of pipeline states; The training samples are respectively input into the teacher model and the student model to generate corresponding softening probability distribution, knowledge distillation loss is calculated based on the softening probability distribution corresponding to the student model and the teacher model, and supervised comparison prototype learning loss is calculated based on the similarity between the reinforced features output in the student model and the prototype features of the corresponding class, wherein the prototype features are the average value of the reinforced features of all samples in the same class; Inputting the pressure signal of the pipeline to be detected into the optimized student model to obtain the predicted probability distribution of the pipeline state, and detecting the leakage of the pipeline to be detected according to the predicted probability distribution.
  2. 2. The method of claim 1, wherein the interactive features are obtained by grouping, splitting and cross-group stitching operations, comprising the steps of: after the number of channels is adjusted by the multi-scale fusion features through the convolution layer, the multi-scale fusion features are equally divided into a plurality of groups in the channel dimension; Performing convolution operation on each group of features, and splitting the output features into a first retention feature and a second interaction feature; Splicing the second interaction feature with the next set of input features; And splicing and convolution integration are carried out on the first retention features of all groups in the channel dimension, residual connection is carried out on the first retention features and the initial input features, and the interaction features are obtained.
  3. 3. The method of claim 1, wherein the convolution block attention module comprises a channel attention sub-module and a space attention sub-module which are sequentially connected, wherein the channel attention sub-module is used for carrying out global average pooling and global maximum pooling on the interaction features to generate channel attention weights, carrying out channel-by-channel weighting on the interaction features according to the channel attention weights to generate channel enhancement features, and the space attention sub-module is used for carrying out average pooling and maximum pooling on the channel enhancement features in channel dimensions to generate space attention weights, carrying out space position-by-space position weighting on the channel enhancement features according to the space attention weights and outputting the enhancement features.
  4. 4. The method of claim 1, wherein the output module comprises a fully connected layer for mapping and integrating feature dimensions of the enhanced features to obtain a final classification representation, and a Softmax classification layer for probability normalizing the classification representation to generate a predicted probability distribution of pipeline states.
  5. 5. The method according to claim 1, wherein the supervised contrast prototype learning penalty is calculated based on the similarity between the reinforced features output in the student model and the prototype features of the corresponding class, specifically, a prototype feature vector is calculated for each class, the prototype feature vector being the mean of the reinforced features extracted from all the samples of the class by the student model, the cosine similarity between the reinforced features of each sample and the prototype feature vector of the class to which it belongs is calculated, and a penalty function is constructed based on the cosine similarity to aggregate the reinforced features of the samples of the same class in a feature space, and the reinforced features of the samples of different classes are separated from each other.
  6. 6. The method according to claim 1, wherein the calculation of the knowledge distillation loss between the softening probability distribution of the student model output and the softening probability distribution of the teacher model, in particular, the calculation of the softening probability distribution of the student model and the teacher model output, respectively, under the condition that the temperature parameter is greater than 1, and the calculation of the difference between the two softening probability distributions as the knowledge distillation loss.
  7. 7. The method according to claim 1, wherein the constructing the joint loss function performs parameter optimization on the student model, in particular, iteratively optimizing parameters of the student model by back propagation, expressed as: Wherein, the For the sake of knowledge of the distillation loss, For supervising and comparing the learning loss of the prototype, N is the number of samples, alpha, beta and lambda are balance parameters, Is the true label of the i-th sample, And Respectively the temperature parameters of the student model And Output of time; Is a teacher model The output of the time period is output, Strengthening features representing the ith sample And prototype of the kth class Is used for the cosine similarity of the (c), ζ is a scaling factor.
  8. 8. A pipe leak detection system, comprising: The acquisition module is used for acquiring a training sample set, wherein the training sample set comprises a plurality of types of pipeline pressure signal samples, and the types of the samples are distributed in an unbalanced manner; The building module is used for building a teacher model and a student model; the student model comprises a multi-scale feature extraction module, a layering splitting module, a convolution block attention module and an output module, wherein the multi-scale feature extraction module is used for carrying out parallel processing on pipeline pressure signals through a plurality of expansion convolution layers with different expansion rates to obtain multi-scale fusion features, the layering splitting module is used for carrying out step-by-step splitting and group-crossing interaction on the multi-scale fusion features to obtain interaction features, the convolution block attention module is used for carrying out attention weighting on the interaction features in channel and space dimensions to obtain strengthening features, and the output module is used for carrying out prediction based on the strengthening features to obtain prediction probability distribution of pipeline states; The training module is used for respectively inputting the training samples into the teacher model and the student model to generate corresponding softening probability distribution, calculating knowledge distillation loss based on the softening probability distribution corresponding to the student model and the teacher model, and calculating supervision comparison prototype learning loss based on the similarity between the reinforced features output in the student model and the prototype features of the corresponding class, wherein the prototype features are the average value of the reinforced features of all samples in the same class; the detection module is used for inputting the pressure signal of the pipeline to be detected into the optimized student model to obtain the predicted probability distribution of the pipeline state, and detecting the leakage of the pipeline to be detected according to the predicted probability distribution.
  9. 9. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
  10. 10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, the processor implementing the method of any of the preceding claims 1 to 7 when executing the program.

Description

Pipeline leakage detection method, system, equipment and medium Technical Field The invention belongs to the technical field of pipeline safety monitoring and intelligent leakage detection, and particularly relates to a pipeline leakage detection method, a system, equipment and a medium. Background With the increasing demand for energy, the oil and gas industry continues to develop. Natural gas has become an important component in modern energy systems due to its clean and efficient properties, and plays a key role in guaranteeing energy safety and environmental protection. The long-distance conveying pipeline is used as a main carrier for natural gas transmission, has higher safety and conveying efficiency, and has relatively lower construction cost, so that the long-distance conveying pipeline is widely adopted. However, pipe leakage has become a potential threat due to corrosion of the transmission medium and prolonged exposure to harsh environments, which can lead to wasted resources, environmental pollution, economic loss and even personal injury. Therefore, the construction of an efficient and intelligent leakage detection method for guaranteeing the safe operation of the pipeline has important practical significance. With the popularization of sensor layout and the progress of monitoring technology, the data volume generated in the pipeline operation process increases exponentially, and sufficient data support is provided for subsequent intelligent analysis. In this context, deep learning is gradually applied to pipeline leak detection by virtue of its advantages in terms of automatic feature extraction and complex pattern recognition, and some improvement in terms of detection accuracy is achieved. However, most existing methods are often based on samples that are distributed uniformly, which is significantly different from the actual engineering environment. In a real scene, because the occurrence probability of a pipeline leakage event is extremely low and the pipeline leakage event is difficult to comprehensively collect, leakage data is quite scarce, so that the data under normal working conditions is dominant in a sample set, and obvious unbalanced distribution is formed. Under such conditions, models tend to learn most class features, disregard few class patterns, and thus cause classification boundary shifts, impair the ability to identify leakage events, and ultimately reduce the accuracy and reliability of leakage detection. Disclosure of Invention Aiming at the technical problem of insufficient pipeline leakage detection precision under unbalanced data conditions, the invention provides a pipeline leakage detection method, a system, equipment and a medium, by introducing a combined training mechanism of knowledge distillation and supervised comparison prototype learning, a pre-trained teacher model with stronger capability is utilized, the softening probability distribution which is output by the device and is rich in the inter-class relation information is used as a supervision signal to be transferred to a light student model, so that the student model can learn finer discrimination knowledge exceeding a hard tag, and the defects in the prior art are overcome. In a first aspect of an embodiment of the present invention, there is provided a pipe leakage detection method, including the steps of: Acquiring a training sample set, wherein the training sample set comprises a plurality of types of pipeline pressure signal samples, and the types of the samples are distributed in an unbalanced manner; The method comprises the steps of constructing a teacher model and a student model, wherein the student model comprises a multi-scale feature extraction module, a layering splitting module, a convolution block attention module and an output module, wherein the multi-scale feature extraction module is used for carrying out parallel processing on pipeline pressure signals through a plurality of expansion convolution layers with different expansion rates to obtain multi-scale fusion features, the layering splitting module is used for carrying out step-by-step splitting and group-crossing interaction on the multi-scale fusion features to obtain interaction features, the convolution block attention module is used for carrying out attention weighting on the interaction features in a channel and space dimension to obtain strengthening features, and the output module is used for carrying out prediction based on the strengthening features to obtain prediction probability distribution of pipeline states; The training samples are respectively input into the teacher model and the student model to generate corresponding softening probability distribution, knowledge distillation loss is calculated based on the softening probability distribution corresponding to the student model and the teacher model, and supervised comparison prototype learning loss is calculated based on the similarity between the reinforced fe