A water supply pipeline leakage identification method based on hydrophone signals in a noise background
By processing hydrophone signals using improved ESRGAN and AlexNet networks, the problems of feature distortion and low classification accuracy in water supply pipeline leak identification under noisy backgrounds are solved, achieving high-precision leak identification in noisy environments.
Patent Information
- Application Number
- CN202511669632.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-14
AI Technical Summary
Existing technologies struggle to effectively remove noise interference in water supply pipeline leak identification under noisy backgrounds, leading to feature distortion, low classification accuracy, and insufficient model generalization ability.
An improved ESRGAN network is used for multi-directional convolution and residual dense block processing of Mel spectrograms. Combined with an improved AlexNet classification network, feature preservation and classification recognition capabilities are improved through multi-directional gradient optimization and channel attention weight learning.
It improves the accuracy and stability of leak detection in noisy environments, reduces the false alarm and missed alarm rates, and is suitable for leak detection in water supply pipelines in complex noisy scenarios.
Smart Images

Figure CN121112210B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial anomaly detection, and in particular to a water supply pipeline leakage identification method based on hydrophone signals in a noise background. BACKGROUND
[0002] Water supply pipeline leakage detection is an important link to ensure the stable operation of the urban water supply system, and timely identification of leakage can effectively prevent water resource waste and reduce the risk of pipeline damage. At present, acoustic detection technology based on hydrophones is widely used in pipeline leakage identification. The core of the technology is to collect acoustic signals during pipeline operation, convert them into mel spectrograms to extract features, and then use a classification network to determine whether there is leakage. Acoustic processing technology has application value in the fields of water supply and municipal administration. However, the pipeline is subject to turbulent flow, pump valve noise and external environmental interference, and the feature extraction process mainly relies on frequency spectrum conversion, without deep enhancement and denoising of key leakage features in the original signal. It is easy to be disturbed by environmental noise and to submerge the characteristics of the leakage signal, which brings challenges to accurate identification.
[0003] The existing technology cannot simultaneously remove noise and retain the gradient details of the leakage signal in the noise background, resulting in distortion of the features after denoising. Classification identification is performed on the basis of feature distortion, and the classification network lacks targeted attention to leakage features and does not fully consider sample distribution balance during training, which is prone to leakage sample omission and low model generalization ability. These deficiencies make it difficult to meet the engineering requirements in terms of identification accuracy and reliability in complex noise scenarios, and it is of great significance to remove background noise and efficiently retain features to improve classification accuracy and generalization ability. SUMMARY
[0004] The purpose of the present application is to provide a water supply pipeline leakage identification method based on hydrophone signals in a noise background.
[0005] To achieve the above purpose, the present application is implemented according to the following technical solutions:
[0006] The present application provides a water supply pipeline leakage identification method based on hydrophone signals in a noise background, comprising:
[0007] Collecting hydrophone signals under different working conditions of a predetermined water supply pipeline, framing and dimensionally transforming the hydrophone signals to obtain mel spectrograms;
[0008] Labeling the noise background of the mel spectrogram according to the working condition, inputting the mel spectrogram into an improved ESRGAN network based on the labeling, and obtaining a denoised mel spectrogram through multi-directional convolution and residual dense blocks;
[0009] Based on the labeling, the denoised mel spectrogram is divided into a training set and a validation set, a single-channel denoised mel spectrogram is input into an AlexNet classification network, a fixed-size feature map of the leakage feature is obtained, the fixed-size feature map is flattened and activated, and a leakage identification classification result is obtained.
[0010] The leakage identification classification is used as a training label, the training set, the validation set and the training label are used for five-fold cross-validation training of the classification network, a leakage identification model is obtained, and a leakage identification result is output based on the leakage identification model.
[0011] Further, the method for obtaining the mel spectrogram comprises:
[0012] The hydrophone signals under different working conditions of the preset water supply pipeline are collected, the sampling frequency is set to 8 kHz, the signal duration is 6 s, the water pipe leakage signals and the normal non-leakage signals are obtained as the original signal data, the short-time frames are obtained by frame pre-processing and normalization of the continuous time domain signals according to the original signal data;
[0013] The short-time frames are subjected to short-time Fourier transform, the short-time frames are filtered, logarithmically transformed and compressed in the time dimension by downsampling according to the mel filter bank, and a single-channel mel spectrogram is obtained, wherein the different working conditions include no leakage, small leakage and moderate leakage working conditions of the pipeline.
[0014] Further, the method for obtaining the noisy mel spectrogram comprises:
[0015] The noise background of the mel spectrogram is labeled according to the working condition, the size of the mel spectrogram is adjusted to 128 by 90 pixels to obtain an input image, a training data set is constructed based on the labeling according to the noisy spectrogram and the clean spectrogram of the input image, the clean spectrogram is used as a training label, the noisy spectrogram is input into an improved ESRGAN for training, and a multi-directional gradient is calculated, wherein the multi-directional gradient calculation formula is:
[0016] ;
[0017] Wherein is a multi-directional gradient, is the total number of samples in the training set, is the training sample index, is the gradient direction, is the set of all gradient directions, is the L1 norm, is the pixel gray scale change rate in the input training sample direction of the generator, is the function of the generator, is the first A noisy spectrogram of a sample, A clean spectrogram of a sample, A clean spectrogram of a sample;
[0018] The improved ESRGAN generator is optimized according to the multi-directional gradient through a gradient descent algorithm, and iterative training is performed until the multi-directional gradient loss is minimized, so that a trained model is obtained.
[0019] The input image is input into the trained model, and a first feature map containing initial shallow layer features is obtained through one convolution operation of the feature extraction head module. The first feature map is input into the backbone module, four layers of multi-directional convolution are performed based on the residual dense blocks of the backbone module, the output of each layer of the four layers of multi-directional convolution is concatenated with the input, the channel dimension is expanded layer by layer, and the channel compression is performed on the three directional convolution results of the multi-directional convolution in the last layer. The feature map with the same size as the input is output, and the output feature map and the input feature map are fused through residual connection.
[0020] The predicted noise component is generated based on the fused output feature map through the feature reconstruction tail module, the input image is subtracted from the predicted noise component, the denoising strength is adaptively adjusted according to the learnable scaling parameter of the feature reconstruction tail module, and the denoised mel spectrogram is obtained. The network architecture of the improved ESRGAN includes the feature extraction head module, the backbone module and the feature reconstruction tail module.
[0021] Further, the method for obtaining the improved ESRGAN includes:
[0022] The improved ESRGAN only retains the network structure of the ESRGAN generator part, and uses a multi-directional convolution kernel based on the generator to replace the standard two-dimensional convolution. The feature extraction head module is a standard 3x3 convolution layer.
[0023] The backbone module includes three residual dense blocks and a convolution fusion layer. The residual dense block is a four-layer multi-directional convolution structure, which includes a standard 3x3 convolution layer, a longitudinal stretching 3x5 convolution layer and a transverse stretching 5x3 convolution layer. The output of each layer of the four layers is concatenated with the input, and the channel dimension is expanded layer by layer. The last layer is a channel-compressed standard 3x3 convolution. The convolution fusion layer is a 1x1 convolution layer.
[0024] The feature reconstruction tail module includes a convolution layer for extracting deep layer features, a LeakyReLU activation function and an output channel convolution layer with the same channel dimension as the input image.
[0025] Further, the method for obtaining the leakage identification classification result includes:
[0026] Based on noise annotation, the denoised Mel spectrograms are divided into training and validation sets. The denoised single-channel Mel spectrograms from the training set are input into an improved AlexNet classification network, and features are extracted layer by layer through a feature extraction module. Based on the frequency-temporal distribution features captured in the first layer, the feature map size is compressed using pooling layers, resulting in a uniform 4×4 fixed-size feature map. This fixed-size feature map is then input into a weight learning module, which enhances the channel weights of the leaked features. The formula for the weight learning module is as follows:
[0027] ;
[0028] ;
[0029] in For channel dimension The channel attention weight vector, It is the Sigmoid activation function. Here is the weight matrix of the fully connected layer, and represents the channel dimension for recovery. For Mish activation function, Let be the weight matrix of the fully connected layer, and be the compressed channel dimension. For global average pooling, For global max pooling, For channel dimension The input feature map is a fixed-size feature map. This is a channel-by-channel multiplication operation. This is the weighted output feature map;
[0030] The weighted feature map is flattened into a one-dimensional vector by a fully connected neural network. The channel dimension of the one-dimensional vector is restored by the Mish activation function, Dropout layer and output layer. The leakage or normal binary classification result is output by the Softmax activation function to obtain the leakage identification classification result. The improved AlexNet classification network includes a feature extraction module, a weight learning module and a fully connected neural network.
[0031] Furthermore, the method for obtaining the improved AlexNet classification network includes:
[0032] The improved AlexNet network model uses a Mish function to replace a ReLU activation function, uses BatchNorm2d for normalization after each convolution layer, the feature extraction module includes four convolution blocks, the first convolution block includes a two-dimensional convolution layer with an input channel number of 1 and an output channel number of 32, a convolution kernel size of 3*3, a padding size of 1, a batch normalization layer BatchNorm2d, a Mish activation function, a 2*2 maximum pooling layer MaxPool2d, the second to fourth convolution blocks expand the channel number to 64, 128 and 256 in turn, and adopt the same convolution, batch normalization, activation and pooling combination, and the pooling layer of the fourth convolution block adopts adaptive average pooling AdaptiveAvgPool2d;
[0033] The weight learning module includes two full connection layers, the full connection neural network includes a full connection layer with an input dimension of 4096 and an output dimension of 512, a Mish activation function, a Dropout layer, the Dropout layer has a dropout rate of 0.5, and a linear classification layer, and the output dimension corresponds to two classes of leakage and non-leakage.
[0034] Further, the method for obtaining the leakage identification result comprises the following steps.
[0035] The leakage identification classification result, the training set and the verification set are obtained, the leakage identification classification result is taken as a training label, and the proportion of leakage samples and normal samples is consistent with that of the original data set in the training set and the verification set according to stratified sampling;
[0036] The training set is divided into five mutually exclusive subsets, the sample distribution of the subsets is consistent with that of the whole training set, round training is performed according to the subset number, the subset corresponding to the number of the current round is taken as a verification subset, the remaining four subsets of the current round are combined as a training subset, the improved AlexNet classification network is trained using the training subset, Adam is used as an optimizer, and the leakage identification model with the optimal comprehensive performance is selected based on the accuracy, recall rate and F1 score on the verification set, and the leakage identification result is output based on the leakage identification model.
[0037] Compared with the prior art, the embodiments of the present application have at least the following advantages or beneficial effects:
[0038] The application improves the effective noise reduction processing of the generated Mel spectrum by the improved enhanced super-resolution generation adversarial network ESRGAN model, improves the expression ability of the key features in the original signal, classifies and identifies through the improved AlexNet neural network, and replaces the activation function in the network with the Mish activation function, enhances the robustness and nonlinear feature learning ability of the model in the complex environment, the method improves the recognition accuracy and stability while keeping low computing resource consumption, effectively reduces the false negative and false positive rates, and is suitable for the leakage signal identification task in the noise environment. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A step flow chart of a water supply pipeline leakage identification method based on hydrophone signals in a noise background in the embodiments of the application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the application.
[0041] Referring to Figure 1 The application provides a water supply pipeline leakage identification method based on hydrophone signals in a noise background, which comprises the following steps:
[0042] Collect hydrophone signals under different working conditions of a preset water supply pipeline, frame the hydrophone signals and convert the dimensions to obtain a Mel spectrum;
[0043] In actual evaluation, high-precision hydrophones are arranged at key nodes such as valve wells and branch pipe connection positions along the preset water supply pipeline, acoustic signals of the pipeline under three working conditions of no leakage, 1mm aperture micro-leakage and 3mm aperture moderate leakage are collected, the sampling frequency is set to 8kHz, the signal length of each segment is 6s, a total of 36000 groups of effective signals are collected, 21600 groups of signals are collected under no leakage, 14400 groups of signals are collected under leakage, 7200 groups of signals are collected under micro-leakage, and 7200 groups of signals are collected under moderate leakage as original data, the original signals are framed and pretreated, the frame length is 256 points, the frame shift is 128 points, and the short-time frames are normalized to obtain short-time frames, the short-time frames are subjected to short-time Fourier transform, are filtered through 26 Mel filter banks, are subjected to logarithmic transformation, are down-sampled and compressed in the time dimension, and finally a single-channel Mel spectrum with a size of 128x90 is generated;
[0044] The noise background of the Mel spectrogram is labeled according to the working condition, the Mel spectrogram is input into an improved ESRGAN network based on the labeling, and a denoised Mel spectrogram is obtained through multidirectional convolution and residual dense blocks;
[0045] In actual evaluation, the noise background of 36000 groups of Mel spectrograms is labeled according to the working condition, a training data set is constructed, 14400 groups of noisy spectrograms, 21600 groups of clean spectrograms and a verification set of 4000 groups, the clean spectrogram is used as a training label, the noisy spectrogram is input into the improved ESRGAN for training, the ESRGAN only retains the generator part, the feature extraction head is a 3*3 standard convolution layer, the main module contains 3 residual dense blocks, the 3 residual dense blocks are sequentially connected, the output features are weighted and residual connected with the original input feature map, the depth and stability of feature expression are enhanced, and a multidirectional gradient loss is introduced during training, wherein the gradient direction of the 100th sample is {0°, 45°, 90°, 135°}, 0° is a horizontal direction difference, , M is a spectrogram matrix, 90° is a vertical direction difference, , 45° and 135° are diagonal direction differences, the horizontal gradient and the vertical gradient are obtained through linear transformation combination, the multidirectional gradient is 25.6, the Adam optimizer is used, the learning rate is 1e-4, the weight decay is 1e-5, the iteration training is performed for 500 rounds, the verification is performed once every 50 rounds, the training is stopped when the MDG loss of the verification set is lower than 0.02, the alpha converges to 0.92 after training, and a denoising model is obtained. The noisy Mel spectrogram to be denoised is input into the model, and after feature extraction, multidirectional convolution residual transformation and prediction of noise components, the denoised Mel spectrogram is obtained by inputting the image-alpha*the predicted noise component, and the alpha is a global adaptive learnable parameter;
[0046] The denoised Mel spectrogram is divided into a training set and a verification set based on the labeling, a single-channel denoised Mel spectrogram is input into an AlexNet classification network, a fixed-size feature map of a leakage feature is obtained, the fixed-size feature map is flattened and activated, and a leakage recognition classification result is obtained.
[0047] In actual evaluation, 36000 groups of denoised mel-frequency spectrograms are divided into a training set of 28800 groups and a validation set of 7200 groups based on noise labeling in a ratio of 8:2, stratified sampling is used to ensure that the proportions of leakage samples and normal samples are consistent with the original data set, and the proportions of no leakage, slight leakage and moderate leakage are 6:2:2, the single-channel denoised mel-frequency spectrogram of the training set is input into the improved AlexNet classification network, in the feature extraction stage, the input single-channel image is first input into the feature extraction module, and is processed in turn through multiple convolution layers, normalization layers, activation functions and down-sampling layers, and 4 channel statistical information is extracted through global average pooling and global maximum pooling, and channel attention weight is generated through compression and recovery of channel dimensions of two fully connected layers, wherein W1 is a 2x512 fully connected layer for compression, W2 is a 512x256 fully connected layer, the input of the first feature channel is , GAP is 0.375, GMP is 0.8, the concatenated [0.375, 0.8] is input into W1, and the channel attention weight vector is 0.85 after W2 transformation and Sigmoid, i.e. each element is multiplied by 0.85, realizing weighted enhancement of the first channel feature, the output feature map is flattened into a one-dimensional feature vector with a length of 256x4x4=4096, and then input into a fully connected neural network for classification, the 4096-dimensional input is flattened, and the fully connected layer reduces the dimension from 4096 to 512, and then the Mish activation and the Dropout layer are used, the Dropout dropout rate is 0.5, the linear classification layer reduces the dimension from 512 to 2, and the Softmax outputs the binary classification result, 0=normal and 1=leakage, obtaining the leakage recognition classification result.
[0048] The leakage recognition classification is used as a training label, the training set, the validation set and the training label are used for five-fold cross-validation training of the classification network, and a leakage recognition model is obtained, and the leakage recognition result is output based on the leakage recognition model.
[0049] In the actual evaluation, the leakage identification classification result, the training set and the verification set are obtained, the leakage identification classification result is taken as the training label, the training set 28800 groups are split into 5 mutually exclusive subsets, each subset has 5760 groups, the sample distribution of each subset is consistent with the whole training set, in each round, 1 subset is taken as the verification subset, and the remaining 4 subsets are combined as the training subset, under the guidance of the loss function of the existing AlexNet network, the Mish activation function is selected, the optimizer Adam is selected, the improved AlexNet classification network is trained based on the training set and the verification set according to the training label, a total of 5 rounds are executed, the model with the optimal comprehensive performance is selected as the leakage identification model based on the accuracy, the recall rate and the F1 score of the verification set, wherein the F1 score of the model trained in the third round is the highest, and is 0.972; 1000 groups of denoised mel spectrograms of the pipeline to be detected are input into the leakage identification model, wherein 200 groups contain micro leakage, 300 groups contain moderate leakage, and 500 groups contain no leakage; the identification accuracy is 97.6%; the model outputs the probability distribution of all categories for each sample, and the maximum probability value is taken as the confidence of the sample belonging to the corresponding category; the confidence of the suspected sample is less than 0.8, and only accounts for 3.2%.
[0050] In the embodiment, the method for obtaining the mel spectrogram comprises:
[0051] The hydrophone signals of the pre-set water supply pipeline under different working conditions are collected, the sampling frequency is set to 8 kHz, the signal duration is 6 s, the water pipe leakage signals and the normal no-leakage signals are obtained as the original signal data, the short-time frames are obtained by frame pre-processing and normalization on the continuous time domain signals according to the original signal data;
[0052] The short-time frames are subjected to short-time Fourier transform, the short-time frames are filtered, logarithmically transformed and compressed in the time dimension by downsampling according to the mel filter bank, and the single-channel mel spectrogram is obtained, wherein the different working conditions include the no-leakage, micro-leakage and moderate-leakage working conditions of the pipeline.
[0053] In the embodiment, the method for obtaining the noise-added mel spectrogram comprises:
[0054] The noise background of the mel spectrogram is labeled according to the working condition, the size of the mel spectrogram is adjusted to 128 by 90 pixels to obtain an input image, the training data set is constructed based on the noise-containing spectrogram and the clean spectrogram of the input image, the clean spectrogram is taken as the training label, the noise-containing spectrogram is input into the improved ESRGAN for training, and the multi-directional gradient is calculated, wherein the multi-directional gradient calculation formula is:
[0055] ;
[0056] wherein is the multi-directional gradient, is the total number of samples in the training set, is an index of a training sample, is a gradient direction, is a set of all gradient directions, is an L1 norm, is a multi-directional gradient operator, and is an input training sample is a pixel gray scale change rate in the direction, is a function of the generator, is a noisy spectrogram of the i-th sample, is a clean spectrogram of the i-th sample; According to the multi-directional gradient, the improved ESRGAN generator is optimized by a gradient descent algorithm, and iterative training is performed until the multi-directional gradient loss is minimized, so as to obtain a trained model;
[0057] The input image is input into the trained model, and a first feature map containing initial shallow layer features is obtained by performing a convolution operation once through a feature extraction head module. The first feature map is input into a backbone module, four layers of multi-directional convolution are performed based on the residual dense blocks of the backbone module, the output of each layer of the four layers of multi-directional convolution is concatenated with the input, the channel dimension is expanded layer by layer, and the channel compression is performed on the three direction convolution results of the multi-directional convolution in the last layer. A feature map with the same size as the input is output, and the output feature map and the input feature map are fused through a residual connection.
[0058] Based on the fused output feature map, a predicted noise component is generated through a feature reconstruction tail module, the input image is subtracted from the predicted noise component, the denoising strength is adaptively adjusted according to the learnable scaling parameters of the feature reconstruction tail module, and a denoised mel spectrogram is obtained. The network architecture of the improved ESRGAN includes a feature extraction head module, a backbone module and a feature reconstruction tail module.
[0059] In the embodiment, the method for obtaining the improved ESRGAN includes:
[0060] The improved ESRGAN only retains the network structure of the ESRGAN generator part, uses a multi-directional convolution kernel of a multi-directional convolution structure based on the generator to replace a standard two-dimensional convolution, and the feature extraction head module is a standard 3x3 convolution layer.
[0061] The improved ESRGAN only retains the network structure of the ESRGAN generator part, uses a multi-directional convolution kernel of a multi-directional convolution structure based on the generator to replace a standard two-dimensional convolution, and the feature extraction head module is a standard 3x3 convolution layer.
[0062] The main trunk module comprises three residual dense blocks and a convolution fusion layer, the residual dense block is a four-layer multidirectional convolution structure, the multidirectional convolution structure comprises a standard 3*3 convolution layer, a longitudinal stretching 3*5 convolution layer and a transverse stretching 5*3 convolution layer, each layer of the four layers is cascaded with the input after output, the channel dimension is expanded layer by layer, and the last layer is a standard 3*3 convolution with channel compression, and the convolution fusion layer is a 1*1 convolution layer.
[0063] The feature reconstruction tail module comprises a convolution layer for extracting deep layer features, a LeakyReLU activation function and an output channel convolution layer with the same channel dimension as the input image.
[0064] In the embodiment, the method for obtaining the leakage identification classification result comprises the following steps:
[0065] Based on the noise annotation, the denoised mel spectrum is divided into a training set and a validation set, the single-channel mel spectrum in the training set is input into the improved AlexNet classification network, and features are extracted layer by layer through the feature extraction module, the frequency-time distribution features of the spectrum are captured according to the first layer, the feature map size is compressed according to the pooling layer, and a unified 4*4 fixed size feature map is output, the fixed size feature map is input into the weight learning module, the channel weight of the leakage feature is enhanced according to the weight learning module, and the formula of the weight learning module is:
[0066] ;
[0067] ;
[0068] wherein is a channel attention weight vector of the channel dimension , is a Sigmoid activation function, is a weight matrix of a full connection layer, and is a restored channel dimension, is a Mish activation function, is a weight matrix of a full connection layer, and is a compressed channel dimension, is a global average pooling, is a global maximum pooling, is an input feature map of the channel dimension , and is a fixed size feature map, is a channel-by-channel multiplication operation, is a weighted output feature map.
[0069] The weighted feature map is flattened into a one-dimensional vector by a fully connected neural network, the one-dimensional vector is recovered to have a channel dimension by a Mish activation function, a Dropout layer and an output layer, and a two-class classification result of leakage or normal is output by a Softmax activation function to obtain a leakage identification classification result, and the improved AlexNet classification network comprises a feature extraction module, a weight learning module and a fully connected neural network.
[0070] In the embodiment, the method for obtaining the improved AlexNet classification network comprises:
[0071] The improved AlexNet network model uses a Mish function to replace a ReLU activation function and uses BatchNorm2d to normalize after each convolutional layer, the feature extraction module comprises four convolutional blocks, the first convolutional block comprises a two-dimensional convolutional layer with an input channel number of 1 and an output channel number of 32, a convolutional kernel size of 3x3 and a padding size of 1, a batch normalization layer BatchNorm2d, a Mish activation function and a 2x2 maximum pooling layer MaxPool2d, the second to fourth convolutional blocks sequentially expand the channel number to 64, 128 and 256 and adopt the same combination of convolution, batch normalization, activation and pooling, and the pooling layer of the fourth convolutional block adopts an adaptive average pooling AdaptiveAvgPool2d.
[0072] The weight learning module comprises two fully connected layers, the fully connected neural network comprises a fully connected layer with an input dimension of 4096 and an output dimension of 512, a Mish activation function, a Dropout layer with a dropout rate of 0.5 and a linear classification layer with an output dimension corresponding to two classes of leakage and non-leakage.
[0073] In the embodiment, the method for obtaining the leakage identification result comprises:
[0074] The leakage identification classification result, the training set and the validation set are obtained, the leakage identification classification result is taken as a training label, and the proportion of leakage samples and normal samples is made consistent with that of the original data set in the training set and the validation set according to stratified sampling;
[0075] The training set is split into five mutually exclusive subsets, the sample distribution of the subsets is consistent with that of the training set as a whole, round training is performed according to the subset number, the subset corresponding to the number of the current round is taken as a validation subset, the remaining four subsets of the current round are combined as a training subset, the improved AlexNet classification network is trained using the training subset, Adam is taken as an optimizer, and the leakage identification model with the optimal comprehensive performance is selected based on the accuracy, recall rate and F1 score on the validation set, and the leakage identification result is output based on the leakage identification model.
[0076] The above merely illustrates and explains the structure of the present application. Those skilled in the art can make various modifications or supplements to the described specific embodiments or replace them with similar ways, as long as they do not deviate from the structure of the present application or exceed the scope defined by the present claims.
Claims
1. A method for leak identification in water supply pipes based on hydrophone signals in noise background, characterized in that, Includes the following steps: Hydrophone signals under different operating conditions of a preset water supply pipeline are collected, and the hydrophone signals are framed and dimensionally transformed to obtain Mel spectrograms. The noise background of the Mel spectrogram is labeled according to the operating conditions. Based on the labeling, the Mel spectrogram is input into an improved ESRGAN network, and a denoised Mel spectrogram is obtained through multi-directional convolution and residual dense blocks; including: The noise background of the Mel spectrogram is labeled according to the working conditions. The size of the Mel spectrogram is adjusted to 128 x 90 pixels to obtain the input image. Based on the labeling, a training dataset is constructed from the noisy and clean spectrograms of the input image. The clean spectrogram is used as the training label, and the noisy spectrogram is input into the improved ESRGAN for training. Multi-directional gradients are calculated. The multi-directional gradient calculation formula is as follows: ; wherein is a multi-directional gradient, is the total number of samples in the training set, is the training sample index, is a gradient direction, is a set of all gradient directions, is an L1 norm, is a multi-directional gradient operator, and is the rate of change of pixel intensity in the direction is a function of the generator, is the noisy spectrogram of the th sample, is the clean spectrogram of the th sample; The ESRGAN generator, which is optimized and improved by the gradient descent algorithm based on multi-directional gradients, is iteratively trained until the multi-directional gradient loss is minimized, thus obtaining the trained model. The input image is fed into the trained model, and a convolution operation is performed through the feature extraction head module to obtain a first feature map containing initial shallow features. The first feature map is then input into the backbone module, and four layers of multi-directional convolution are performed based on the residual dense blocks of the backbone module. The output of each of the four layers of multi-directional convolution is concatenated with the input, and the channel dimension is expanded layer by layer. The last layer performs channel compression on the three directions of the multi-directional convolution results, and outputs a feature map of the same size as the input. The output feature map and the input feature map are then fused through residual connections. Based on the fused output feature map, a predicted noise component is generated through the feature reconstruction tail module. The predicted noise component is subtracted from the input image. The denoising intensity is adaptively adjusted according to the learnable scaling parameter of the feature reconstruction tail module to obtain the denoised Mel spectrum. The improved ESRGAN network architecture includes a feature extraction head module, a backbone module, and a feature reconstruction tail module. The improved ESRGAN retains only the network structure of the ESRGAN generator part. Based on the generator, it uses multi-directional convolutional kernels with multi-directional convolutional structure to replace the standard two-dimensional convolution. The feature extraction head module is a standard 3×3 convolutional layer. The backbone module includes three residual dense blocks and a convolutional fusion layer. The residual dense blocks are four-layer multi-directional convolutional structures, including a standard 3×3 convolutional layer, a vertically stretched 3×5 convolutional layer, and a horizontally stretched 5×3 convolutional layer. The output of each of the four layers is concatenated with the input to expand the channel dimension layer by layer. The last layer is a standard 3×3 convolution with channel compression. The convolutional fusion layer is a 1×1 convolutional layer. The feature reconstruction tail module includes a convolutional layer for extracting deep features, a LeakyReLU activation function, and an output channel convolutional layer with the same channel dimension as the input image. The denoised mel-frequency spectrum is divided into a training set and a verification set based on the label, a single-channel denoised mel-frequency spectrum is input into an AlexNet classification network to obtain a fixed-size feature map of a leakage feature, the fixed-size feature map is flattened and activated to obtain a leakage identification classification result; The leakage identification classification is used as a training label, and the classification network is trained by five-fold cross-validation using the training set, the verification set and the training label to obtain a leakage identification model, and a leakage identification result is output based on the leakage identification model.
2. The method of claim 1, wherein, A method for obtaining the mel-frequency spectrum comprises: Water pipe leakage signals and normal non-leakage signals are obtained as original signal data by collecting hydrophone signals under different working conditions of a preset water supply pipeline, setting a sampling frequency of 8 kHz and a signal duration of 6 s, and performing frame preprocessing and normalization on the continuous time-domain signals according to the original signal data to obtain short-time frames; The short-time frames are subjected to short-time Fourier transform, filtering, logarithmic transformation by a mel filter bank, and compression of the time dimension by downsampling to obtain a single-channel mel-frequency spectrum, and the different working conditions include no leakage, small leakage and moderate leakage of the pipeline.
3. The method of claim 1, wherein, A method for obtaining the leakage identification classification result comprises: The denoised mel-frequency spectrum is divided into a training set and a verification set based on the label, a single-channel denoised mel-frequency spectrum is input into an AlexNet classification network to obtain a fixed-size feature map of a leakage feature, the fixed-size feature map is flattened and activated to obtain a leakage identification classification result; ; ; wherein is a channel dimension is a channel attention weight vector, is a Sigmoid activation function, is a weight matrix of a fully connected layer, and is a channel dimension is a Mish activation function, is a weight matrix of a fully connected layer, and is a channel dimension is a global average pooling, is a global max pooling, is an input feature map of a channel dimension is a fixed-size feature map, is a channel-wise multiplication operation, is a weighted output feature map; The leakage identification classification is used as a training label, and the classification network is trained by five-fold cross-validation using the training set, the verification set and the training label to obtain a leakage identification model, and a leakage identification result is output based on the leakage identification model.
4. The method of claim 3, wherein, A method for obtaining the improved AlexNet classification network comprises: The improved AlexNet network model uses a Mish function to replace a ReLU activation function, uses BatchNorm2d for normalization after each convolution layer, the feature extraction module includes four convolution blocks, the first convolution block includes a two-dimensional convolution layer with an input channel number of 1 and an output channel number of 32, a convolution kernel size of 3*3, a padding size of 1, a batch normalization layer BatchNorm2d, a Mish activation function, a 2*2 maximum pooling layer MaxPool2d, the second to fourth convolution blocks expand the channel number to 64, 128 and 256 in turn, and adopt the same convolution, batch normalization, activation and pooling combination, and the pooling layer of the fourth convolution block adopts adaptive average pooling AdaptiveAvgPool2d; The weight learning module includes two fully connected layers, the fully connected neural network includes a fully connected layer with an input dimension of 4096 and an output dimension of 512, a Mish activation function, a Dropout layer, the Dropout layer has a dropout rate of 0.5, and a linear classification layer, and the output dimension corresponds to two classes of leakage and non-leakage.
5. The method of claim 1, wherein, The method for obtaining the leakage identification model comprises the following steps: Obtaining a leakage identification classification result, a training set and a validation set, taking the leakage identification classification result as a training label, and making the proportion of leakage samples and normal samples consistent with the original data set in the training set and the validation set according to stratified sampling; The training set is divided into five mutually exclusive subsets, the sample distribution of the subsets is consistent with the whole training set, round training is performed according to the subset number, the subset corresponding to the current round number is taken as a validation subset, the remaining four subsets of the current round are combined as a training subset, an improved AlexNet classification network is trained using the training subset, Adam is used as an optimizer, and the leakage identification model with the optimal comprehensive performance is selected based on the accuracy, recall rate and F1 score on the validation set, and a leakage identification result is output based on the leakage identification model.
Citation Information
Patent Citations
Pipeline leakage detection method
CN113719764A
Pipeline tiny leakage vibration analysis method based on voiceprint analysis
CN118031137A