Water supply network leakage identification method and device based on data enhancement and hybrid neural network architecture, equipment and medium
Through data enhancement and a hybrid neural network architecture, a simulated pipeline vibration audio signal is generated and combined with the Mel-frequency cepstral coefficients and first-order difference matrix feature fusion. Using the CNN-BiLSTM model, the problems of data scarcity and low recognition accuracy in water supply network leakage detection are solved, and efficient and intelligent leakage identification and management are achieved.
Patent Information
- Application Number
- CN202510861590.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-25
AI Technical Summary
In existing technologies, water supply network leakage detection relies on manual experience and is inefficient. Traditional methods rely on single static acoustic features, resulting in limited recognition accuracy. Machine learning methods have problems such as low recognition accuracy, poor robustness, and weak generalization ability when identifying water supply network leakage, especially when data is scarce.
A method based on data enhancement and hybrid neural network architecture is adopted. An expanded dataset of simulated pipeline vibration audio signals is generated through a generative adversarial network. Feature fusion is performed by combining Mel-frequency cepstral coefficients with the first-order difference matrix. The CNN-BiLSTM hybrid neural network model is used for training to extract rich features of the pipeline vibration audio signal and realize leakage identification.
It improves the accuracy and robustness of leakage detection, reduces manual intervention, realizes real-time and efficient leakage identification, reduces economic and environmental losses, and promotes the intelligent management of water supply systems.
Smart Images

Figure CN120708653A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water supply network leakage detection, and in particular to a water supply network leakage identification method based on data enhancement and hybrid neural network architecture, corresponding devices, electronic equipment and computer-readable storage medium. Background Art
[0002] Water supply networks are a crucial component of urban infrastructure, their operational status directly impacting the quality of life of urban residents and economic development. However, leakage in these networks remains a major challenge in urban water supply management. These leaks not only waste water resources and increase water supply costs, but also contribute to environmental pollution and the waste of social resources.
[0003] Traditional leak detection methods (such as the listening rod method) rely on manual experience and are inefficient, making them difficult to meet the needs of real-time monitoring. While existing leak detection methods based on pipeline vibration audio signals have made some progress, they suffer from issues such as insufficient feature extraction and insufficient model generalization. For example, existing methods often use a single static acoustic feature (such as MFCC), ignoring the ability of dynamic features to distinguish leak signals, resulting in limited recognition accuracy.
[0004] The rapid development of artificial intelligence (AI), particularly deep learning (DL), has shown promising application prospects in diagnosing system anomalies. Such methods have already demonstrated positive results in water supply network leakage detection. However, using machine learning methods for pipeline leakage detection often relies on large amounts of labeled data. When collecting vibration audio signals from leaking water supply pipelines, it's common to encounter a shortage of signal data samples.
[0005] To sum up, the existing technology is adapted to the scarcity of pipe vibration audio signal annotation data of water supply pipes in a leaking state in the water supply network, and the existing machine learning methods have problems such as low recognition accuracy, poor robustness, and weak generalization ability when identifying water supply network leakage. This application makes corresponding explorations to solve this problem. Summary of the Invention
[0006] The purpose of this application is to solve the above problems and provide a water supply network leakage identification method based on data enhancement and hybrid neural network architecture, corresponding devices, electronic equipment and computer-readable storage medium.
[0007] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0008] A method for identifying water supply network leakage based on data enhancement and a hybrid neural network architecture is proposed to meet one of the purposes of this application, including:
[0009] Collect real pipe vibration audio signals from a water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal dataset, wherein the pipe vibration audio signal dataset includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames;
[0010] After sequentially processing the pipeline vibration audio signal using fast Fourier transform and Mel filter bank, discrete cosine transform is used to extract Mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal to construct a Mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame;
[0011] Calculating and determining a first-order difference matrix of the Mel-cepstral coefficients, and performing feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine a feature fusion matrix for each pipeline vibration audio signal frame;
[0012] Using the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and the leakage state corresponding to the pipe vibration audio signal as a sample label, a preset CNN-BiLSTM hybrid neural network model is trained to determine a water supply network leakage detection model that has been trained to a convergent state;
[0013] The vibration audio signal of the pipeline to be identified is input into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipeline corresponding to the vibration audio signal of the pipeline to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
[0014] Optionally, the step of determining a plurality of pipeline vibration audio signal frames includes:
[0015] Obtain the audio duration, frame duration, overlap duration, and sampling rate of each pipeline vibration audio signal;
[0016] Calculating and determining a first product between the audio duration and the sampling rate, calculating and determining a second product between the frame duration and the sampling rate, and calculating and determining a first difference between the first product and the second product;
[0017] Calculate and determine a second difference between the frame duration and the overlap duration to determine a jump duration, and calculate and determine a third product between the jump duration and the sampling rate;
[0018] The number of frames of each pipe vibration audio signal is determined according to a first ratio between the first difference and the third product, and the pipe vibration audio signal is framed according to the number of frames to determine multiple pipe vibration audio signal frames in each pipe vibration audio signal.
[0019] Optionally, the step of training the generative adversarial network includes:
[0020] Obtain key parameters, initialize the network structure of the generator and discriminator in the preset generative adversarial network, initialize the network weights, and use the Adam optimizer. The key parameters include the dataset path, batch size, random noise dimension, number of training rounds, learning rate, and sampling rate.
[0021] Get the paths of all real pipe vibration audio signals in the audio dataset, create a dataset object, and generate data loaders for the generator and discriminator respectively;
[0022] In each training round, the data loader is traversed for training, the discrimination results of the real pipeline vibration audio signal and the simulated pipeline vibration audio signal are calculated, the gradient penalty term is calculated to ensure the continuity of the discriminator, the parameters of the discriminator are updated to minimize the discriminator's ability to distinguish the generated signal, and the loss value of the discriminator is recorded;
[0023] Generate a simulated pipeline vibration audio signal and calculate the output of the discriminator, update the parameters of the generator to maximize the discriminator's discrimination result on the simulated pipeline vibration audio signal, and record the loss value of the generator;
[0024] At regular training intervals, simulate the pipeline vibration audio signal and save it to a specified directory until the generator can generate high-quality simulated pipeline vibration audio signals. Save the trained generator, use the trained generator to generate new simulated pipeline vibration audio signals, and combine the simulated pipeline vibration audio signals with real pipeline vibration audio signals for data enhancement.
[0025] Optionally, after sequentially processing the pipeline vibration audio signal using fast Fourier transform and Mel filter bank, the step of extracting Mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal using discrete cosine transform to construct a Mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame includes:
[0026] Performing a fast Fourier transform on the pipeline vibration audio signal to convert a time domain signal of each pipeline vibration audio signal frame in the pipeline vibration audio signal into frequency domain data to obtain spectrum information, wherein the spectrum information reflects the energy distribution of the pipeline vibration audio signal at different frequencies;
[0027] filtering the pipeline vibration audio signal using each Mel filter in the Mel filter bank according to the spectrum information to determine output energy on each Mel filter channel, performing a logarithmic operation on the output energy on each Mel filter channel to obtain the logarithmic energy of each Mel filter channel, and converting the logarithmic energy into a logarithmic Mel spectrum;
[0028] Mel cepstral coefficients are extracted according to the logarithmic energy of each Mel filter channel using discrete cosine transform to obtain a Mel cepstral coefficient feature matrix corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal.
[0029] Optionally, the step of training a preset CNN-BiLSTM hybrid neural network model using the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and the leakage state corresponding to the pipe vibration audio signal as a sample label to determine a water supply network leakage detection model that has been trained to a converged state includes:
[0030] Using a preset Bayesian optimization algorithm to optimize the model hyperparameters of the CNN-BiLSTM hybrid neural network model to determine the optimal hyperparameter combination of the CNN-BiLSTM hybrid neural network model, wherein the model hyperparameters include learning rate, batch size, and number of LSTM hidden units;
[0031] The CNN-BiLSTM hybrid neural network model with the optimal hyperparameter combination is used as the water supply network leakage detection model.
[0032] Optionally, the basic network architecture of the water supply network leakage detection model is a CNN-BiLSTM hybrid neural network model, wherein the CNN-BiLSTM hybrid neural network model consists of two layers of convolutional neural networks and one layer of bidirectional long short-term memory network, and the convolutional neural network is constructed by 2 convolutional layers and 2 pooling layers.
[0033] Optionally, the feature fusion matrix represents the joint features of the pipeline vibration audio signal in the time domain and the frequency domain, which not only includes the static spectrum information of the signal, but also combines the dynamic characteristics of the signal changing over time.
[0034] Another object of the present application is to provide a water supply network leakage identification device based on data enhancement and a hybrid neural network architecture, comprising:
[0035] An audio data set construction module is configured to collect real pipe vibration audio signals in a water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, and combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal data set, wherein the pipe vibration audio signal data set includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames;
[0036] a Mel-cepstral coefficient extraction module configured to sequentially process the pipeline vibration audio signal using a fast Fourier transform and a Mel filter bank, and then extract the Mel-cepstral coefficient corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal using a discrete cosine transform to construct a Mel-cepstral coefficient feature matrix of the pipeline vibration audio signal frame;
[0037] a feature fusion matrix construction module, configured to calculate and determine a first-order difference matrix of the Mel-cepstral coefficients, and perform feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine a feature fusion matrix for each pipeline vibration audio signal frame;
[0038] a detection model training module configured to train a preset CNN-BiLSTM hybrid neural network model using a feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and a leakage state corresponding to the pipe vibration audio signal as a sample label, so as to determine a water supply network leakage detection model that has been trained to a convergent state;
[0039] The water supply network leakage identification module is configured to input the vibration audio signal of the pipeline to be identified into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipeline corresponding to the vibration audio signal of the pipeline to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
[0040] An electronic device provided to meet another purpose of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the water supply network leakage identification method based on data enhancement and hybrid neural network architecture described in the present application.
[0041] A computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the water supply network leakage identification method based on data enhancement and hybrid neural network architecture in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
[0042] Compared with the existing technology, this application addresses the problems of scarcity of annotated data of vibration audio signals of water supply pipes in a leaking state in the existing technology, low recognition accuracy, poor robustness, and weak generalization ability of existing machine learning methods in identifying water supply pipe leakage. This application includes but is not limited to the following
[0043] Beneficial effects:
[0044] First, traditional leak detection methods rely on large amounts of labeled data, but the collection of pipe vibration audio signals for leaks in water supply networks often suffers from a scarcity of samples. Generative adversarial networks (WaveGANs) can effectively expand the training dataset, addressing this data scarcity issue and improving the effectiveness of the trained model. By synthesizing real and simulated pipe vibration audio signals, the model's robustness is enhanced in diverse signal and noise environments, ensuring the adaptability of leak detection in diverse environments.
[0045] Second, existing technologies often rely on a single acoustic feature to identify leakage signals, but often ignore the influence of dynamic features. By fusing the Mel-frequency cepstral coefficients with their first-order difference feature matrix, this application extracts richer time and frequency domain features, which can more accurately reflect the changing patterns of leakage signals and enhance the model's ability to distinguish leakage signals.
[0046] Third, the Mel-frequency cepstral coefficients are used to process spectral features, and combined with BiLSTM to capture time series features, so that the model can simultaneously consider the instantaneous spectral characteristics and time variation patterns of the pipeline vibration audio signal when the water supply pipeline is in a leaking state, thereby improving the accuracy of leakage identification.
[0047] Fourthly, this application is based on the CNN-BiLSTM hybrid architecture. Convolutional neural networks (CNN) are good at extracting spatial features, especially when processing high-dimensional data, they have powerful feature learning capabilities. The bidirectional long short-term memory network (BiLSTM) can make full use of the bidirectional information of the time series to capture the long-term dependencies of the signal. Combining the advantages of the two, it is possible to take into account both local and global feature information when processing vibration audio signals of water supply network leakage, thereby improving the recognition effect. After extracting spatial features through CNN, Bi LSTM further mines the time series information, and finally achieves high-precision output of the leakage identification model. This hybrid architecture introduces a more complex network structure based on the traditional method, making leakage identification more accurate.
[0048] Fifth, this application significantly improves the automation and intelligence of leak detection, reducing the vulnerabilities of traditional manual experience. In particular, automated detection based on neural network models can identify pipeline leaks in real time, preventing leaks from being overlooked or misidentified. Compared with traditional manual detection methods, this technology can identify leaks without extensive human intervention, reducing labor costs and improving detection efficiency.
[0049] Sixth, by accurately identifying leakage, this application enables early pipeline maintenance and repair, preventing sudden incidents like pipe bursts and thereby improving the stability and safety of the water supply system. Particularly in large-scale water supply networks, systematic leak detection can effectively prevent water supply interruptions and the resulting socioeconomic losses.
[0050] Furthermore, this application, through the combination of data augmentation and a hybrid neural network architecture, effectively addresses issues such as data scarcity, insufficient feature extraction, and low model accuracy in water supply network leakage detection, significantly improving the accuracy, robustness, and generalization capabilities of leakage detection. This technical solution not only improves the efficiency of water supply network leakage detection and reduces the economic and environmental losses caused by leakage, but also further promotes the development of intelligent management of water supply systems, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0052] Figure 1 Schematic diagram of a flow chart of a water supply network leakage identification method based on data enhancement and hybrid neural network architecture in an embodiment of the present application;
[0053] Figure 2 This is a flowchart of MFCC feature matrix extraction in an embodiment of the present application;
[0054] Figure 3 This is a flowchart of the feature extraction step of the convolutional layer in an embodiment of the present application;
[0055] Figure 4 Schematic diagram of the Bi LSTM unit structure in an embodiment of the present application;
[0056] Figure 5 Schematic diagram of pipeline vibration audio signal processing and CNN-Bi LSTM hybrid neural network structure in an embodiment of the present application;
[0057] Figure 6 This is a principle block diagram of a water supply network leakage identification device based on data enhancement and hybrid neural network architecture in an embodiment of the present application;
[0058] Figure 7 Schematic diagram of the structure of the computer device in the embodiment of the present application. DETAILED DESCRIPTION
[0059] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limiting the present application.
[0060] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.
[0061] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0062] It will be understood by those skilled in the art that the terms "client," "terminal," and "terminal device" as used herein include both devices that are wireless signal receivers, i.e., devices that only have wireless signal receivers without transmission capabilities, and devices that have receiving and transmitting hardware capable of two-way communication over a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers and tablet computers, which have single-line displays, multi-line displays, or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service), which may combine voice, data processing, fax, and / or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, Internet / Intranet access, a web browser, a notepad, a calendar, and / or a GPS (Global Positioning System) receiver; and conventional laptop and / or palmtop computers or other devices, which have and / or include a radio frequency receiver. As used herein, the terms "client," "terminal," or "terminal device" may be portable, transportable, or installed in a vehicle (air, sea, and / or land), or may be adapted and / or configured to operate locally and / or in a distributed manner at any other location on Earth and / or in space. As used herein, the terms "client," "terminal," or "terminal device" may also refer to a communication terminal, an Internet terminal, or a music / video playback terminal, such as a PDA, an MID (Mobile Internet Device), and / or a mobile phone with music / video playback capabilities, or may include a smart TV, a set-top box, or other device.
[0063] The hardware referred to by names such as "server", "client", and "service node" in this application is essentially an electronic device with capabilities equivalent to those of a personal computer. It is a hardware device that has the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. Computer programs are stored in its memory, and the central processing unit loads the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0064] It should be noted that the concept of "server" referred to in this application can also be extended to server clusters. Based on the network deployment principles understood by those skilled in the art, the servers described should be logically divided. In physical space, these servers can be independent of each other but callable through interfaces, or integrated into a single physical computer or a computer cluster. Those skilled in the art should understand this flexibility and should not use it to constrain the implementation of the network deployment method of this application.
[0065] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for implementation.
[0066] Unless expressly specified otherwise, the neural network models referenced or may be referenced in this application may be deployed on a remote server and remotely called on the client, or may be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence may be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.
[0067] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as they are suitable for being called by the technical solution of this application.
[0068] Those skilled in the art should be aware that although the various methods of this application are described based on the same concept and thus exhibit commonality, unless otherwise specified, these methods can be independently executed. Similarly, the various embodiments disclosed in this application are all based on the same inventive concept. Therefore, concepts with the same expression, as well as concepts that are appropriately transformed for convenience despite different expression, should be understood as equivalent.
[0069] Unless expressly stated to be mutually exclusive, the various embodiments disclosed in this application may be cross-combined with the relevant technical features of the various embodiments to flexibly construct new embodiments, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or resolve certain deficiencies in the prior art. Those skilled in the art should be aware of such flexibility.
[0070] See also Figure 1 In one embodiment, the water supply network leakage identification method based on data enhancement and hybrid neural network architecture of the present application includes:
[0071] Step S10: Collect real pipe vibration audio signals in the water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal dataset, wherein the pipe vibration audio signal dataset includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames;
[0072] The water supply network leakage identification system in the terminal device can collect real pipe vibration audio signals in the water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, and combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal dataset, wherein the pipe vibration audio signal dataset includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames;
[0073] In some embodiments, the real pipeline vibration audio signals in the water supply network are collected, and an appropriate number of noise recorders and water sound sensors are arranged in the water supply pipes of the target area. Under the conditions of the target area, the pipeline vibration audio signals of the water supply pipes of ductile iron pipes and PE pipes are collected during a relatively quiet period (after 22:00 every day). During the process of collecting the real pipeline vibration audio signals, a pressure regulating valve is used on the main pipe to adjust the pressure, and the pressure adjustment range is 0.15Mpa to 0.32Mpa. Each time, a small pressure adjustment (for example, 0.05MPa) is performed to simulate leakage of different sizes. The duration of each pipeline vibration audio signal is 5.46 seconds, and the frequency of the pipeline vibration audio signal is 8000Hz. Finally, the real pipeline vibration audio signals are saved in waveform audio file format (WAV), and these real pipeline vibration audio signals will be marked as having leakage or not having leakage. In this embodiment, a total of 788 real pipeline vibration audio signals are collected, of which 612 pipeline vibration audio signals are marked as having leakage and 176 pipeline vibration audio signals are marked as having no leakage.
[0074] In some embodiments, all pipeline vibration audio signals are clipped. To improve the computing speed and save computing time, all pipeline vibration audio signals are clipped to retain 1-second segments. To avoid data imbalance, only the small sample size is focused on solving the problem. Ultimately, 500 pipeline vibration audio signals of water supply pipelines in a leaking state and 500 pipeline vibration audio signals of water supply pipelines in a non-leaking state are selected.
[0075] In some embodiments, a wavelet denoising method is used to reduce the noise of the pipeline vibration audio signal. The wavelet denoising method decomposes the pipeline vibration audio signal into coefficients of different scales through wavelet transform. The coefficients are thresholded to remove noise by utilizing the characteristic differences between the pipeline vibration audio signal and noise at each scale. Finally, the signal is reconstructed through inverse wavelet transform. The calculation formula of wavelet transform is expressed as follows:
[0076]
[0077] Where s represents the original pipe vibration audio signal; is the approximate wavelet coefficient, which represents the coefficient on the scale j0, representing the low-frequency part (smooth part) of the pipeline vibration audio signal, which usually retains a larger amplitude signal; d j (k) is the detail wavelet coefficient, which represents the coefficient at scale j, representing the high-frequency part of the signal (detail part), usually containing noise; Is the scale function, also called the parent wavelet function, which controls the smooth part of the signal. It is a wavelet function based on a specific scale j0 and position k; ψ j,k (t) is a wavelet function based on scale j and position k, which is used to extract the high-frequency details of the signal.
[0078] After wavelet decomposition, the signal-related part of the wavelet coefficient has a larger amplitude, while the noise-related part has a smaller amplitude. Therefore, the small values in the wavelet coefficient are treated as noise and removed or reduced by the soft threshold method. The calculation formula is expressed as:
[0079]
[0080] in, Represents the detail wavelet coefficient after denoising, the wavelet coefficient after soft threshold processing; sign(d j (k)) means return d j The sign of (k), i.e., +1 or -1, is used to maintain the direction of the wavelet coefficients |d j (k)| represents d j The absolute value of (k) represents the amplitude of the wavelet coefficient, and the threshold represents the threshold for distinguishing between signals and noise, which can be set by those skilled in the art according to the characteristics of the noise.
[0081] Finally, the denoised wavelet coefficients are reconstructed and restored through inverse wavelet transform, where the calculation formula of inverse wavelet transform is expressed as:
[0082]
[0083] Among them, s denoisedrepresents the denoised pipeline vibration audio signal, which is reconstructed from the denoised coefficients through inverse wavelet transform. Represents the approximate wavelet coefficients after denoising. Usually these coefficients do not change much during the denoising process because they represent the low-frequency part of the signal. It represents the detail wavelet coefficient after denoising, which is the coefficient obtained by removing noise through the soft threshold method. It represents the scaling function, also called the parent wavelet function, which controls the smooth part of the signal. It is a wavelet function based on a specific scale j0 and position k; j,k (t) is a wavelet function based on scale j and position k, which is used to extract the high-frequency details of the signal.
[0084] In some embodiments, the real pipe vibration audio signal is input into a preset generative adversarial network, and after different rounds of output, a simulated pipe vibration audio signal is generated. The real pipe vibration audio signal is combined with the simulated pipe vibration audio signal to construct a pipe vibration audio signal dataset for data enhancement and database expansion. The basic network architecture of the generative adversarial network includes a WaveGAN network, which is a generative adversarial network specifically used to generate one-dimensional time series data (such as audio signals) and can be implemented in Python.
[0085] Generative Adversarial Networks (GANs) consist of a generator and a discriminator. The generator generates new samples by learning the distribution of real data, while the discriminator is responsible for distinguishing between real samples and generated samples. Through continuous adversarial training, the generator can produce increasingly realistic samples. The steps for training the GAN include:
[0086] Step S101: Obtain key parameters, initialize the network structure of the generator and discriminator in the preset generative adversarial network, initialize the network weights, and use the Adam optimizer, wherein the key parameters include the dataset path, batch size, random noise dimension, number of training rounds, learning rate, and sampling rate;
[0087] Step S102: Obtain the paths of all real pipe vibration audio signals in the audio dataset, create a dataset object, and generate data loaders for the generator and discriminator respectively;
[0088] Step S103: In each training round, traverse the data loader for training, calculate the discrimination results of the real pipeline vibration audio signal and the simulated pipeline vibration audio signal, calculate the gradient penalty term to ensure the continuity of the discriminator, update the discriminator parameters to minimize the discriminator's ability to distinguish the generated signal, and record the discriminator loss value;
[0089] Step S104: Generate a simulated pipeline vibration audio signal and calculate the output of the discriminator, update the parameters of the generator to maximize the discriminator's discrimination result on the simulated pipeline vibration audio signal, and record the loss value of the generator;
[0090] Step S105: Simulate the pipeline vibration audio signal at regular training rounds and save it to a specified directory until the generator can generate high-quality simulated pipeline vibration audio signals. Save the trained generator, use the trained generator to generate new simulated pipeline vibration audio signals, and combine the simulated pipeline vibration audio signals with real pipeline vibration audio signals for data enhancement.
[0091] In some embodiments, the step of determining a plurality of pipe vibration audio signal frames includes:
[0092] Step S1001: Acquire the audio duration, frame duration, overlap duration, and sampling rate of each pipeline vibration audio signal;
[0093] Step S1002: Calculate and determine a first product between the audio duration and the sampling rate, calculate and determine a second product between the frame duration and the sampling rate, and calculate and determine a first difference between the first product and the second product;
[0094] Step S1003: Calculate and determine a second difference between the frame duration and the overlap duration to determine a jump duration, and calculate and determine a third product between the jump duration and the sampling rate;
[0095] Step S1004: Determine the number of frames for each pipe vibration audio signal based on a first ratio between the first difference and the third product, and frame the pipe vibration audio signal according to the number of frames to determine a plurality of pipe vibration audio signal frames in each pipe vibration audio signal.
[0096] Specifically, the pipeline vibration audio signal of a certain audio duration is framed to determine a plurality of pipeline vibration audio signal frames, wherein the calculation formula for determining the number of frames of the pipeline vibration audio signal is expressed as:
[0097]
[0098] Among them, Frames represents the number of frames of each pipe vibration audio signal, nRows represents the number of sampling points contained in the input pipe vibration audio signal, that is, the product of the audio duration (s) and the sampling rate (Hz); winLen represents the number of sampling points contained in the pipe vibration audio signal of each frame duration, which is expressed as the product of the frame duration and the sampling rate; hopLen is the number of sampling points contained in the pipe vibration audio signal of each jump duration, and the jump duration is the difference between the frame duration and the overlap duration, and its expression is: jump duration = frame duration - overlap duration.
[0099] In some embodiments, the audio duration can be 1s, and the sampling rate can be 8000 Hz, which represents the number of sampling points contained in the pipe vibration audio signal per second; the frame duration can be 30ms, that is, 0.03s; and the overlap duration can be 12.5ms, that is, 0.0125.
[0100] Based on the above calculation formula and the above data, it can be calculated that the number of frames of the pipeline vibration audio signal is 56, that is, the number of time steps of the bidirectional long short-term memory network (BiLSTM) in the CNN-BiLSTM hybrid neural network model is 56.
[0101] Step S20: After sequentially processing the pipeline vibration audio signal using fast Fourier transform and mel filter bank, discrete cosine transform is used to extract mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal to construct a mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame;
[0102] Step S30: Calculate and determine the first-order difference matrix of the Mel-cepstral coefficients, and perform feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine a feature fusion matrix for each pipe vibration audio signal frame;
[0103] Real pipe vibration audio signals in a water supply network are collected, and the real pipe vibration audio signals are input into a preset generative adversarial network. After different rounds of output, simulated pipe vibration audio signals are generated. The real pipe vibration audio signals are combined with the simulated pipe vibration audio signals to construct a pipe vibration audio signal dataset. After the pipe vibration audio signals are processed in sequence by fast Fourier transform and Mel filter bank, the Mel cepstral coefficients corresponding to each pipe vibration audio signal frame in the pipe vibration audio signal are extracted by discrete cosine transform to construct a Mel cepstral coefficient feature matrix of the pipe vibration audio signal frame. The first-order difference matrix of the Mel cepstral coefficients is calculated and determined, and the Mel cepstral coefficient feature matrix is feature fused with the first-order difference matrix to determine a feature fusion matrix for each pipe vibration audio signal frame. The feature fusion matrix represents the joint features of the pipe vibration audio signal in the time domain and frequency domain, which not only includes the static spectrum information of the signal, but also combines the dynamic characteristics of the signal changing over time.
[0104] In some embodiments, see Figure 2 , Figure 2 This is a flow chart for extracting the MFCC feature matrix. Before the pipeline vibration audio signal is processed in sequence by using the fast Fourier transform and the Mel filter bank, the pipeline vibration audio signal is pre-emphasized and windowed, which includes:
[0105] S301. Pre-emphasize the pipeline vibration audio signal, enhance the high-frequency component through a high-pass filter, compensate for the high-frequency attenuation in the voice signal caused by the sound system and the propagation medium, and flatten the spectrum. The calculation formula of the pre-emphasis is expressed as:
[0106] y(n)=x(n)-αx(n-1),
[0107] Wherein, x(n) is the sampling value of the original pipe vibration audio signal at time point n, y(n) is the pre-emphasized pipe vibration audio signal, and α is the pre-emphasis coefficient. Generally, α∈[0.95,0.97], and in this embodiment, α=0.97.
[0108] S303. Windowing is performed on the pipeline vibration audio signal to reduce frame edge discontinuity and suppress spectrum leakage. The Hamming window is a commonly used window function that is widely used in the field of signal processing, especially in pipeline vibration audio signal processing. The calculation formula of the Hamming window is expressed as:
[0109]
[0110] Where w(n) represents the window function value at the nth sampling point under the action of the window function. Windowing is used to reduce edge effects during signal framing and prevent spectrum leakage. Indicates applying a cosine function to each sampling point, producing a smooth window function curve. The window function reduces signal abrupt changes at frame edges and reduces spectral leakage. n represents the sampling point index within the current frame, ranging from 0 to N-1. n corresponds to each sampling point within the current frame. The value of n is discrete, representing different positions within the frame. N is the number of frame samples, which represents the number of sampling points contained in each pipe vibration audio signal frame. For example, if the frame length is 30ms and the sampling rate is 8000Hz, then N = 240 (number of sampling points).
[0111] In some embodiments, after sequentially processing the pipeline vibration audio signal using fast Fourier transform and mel filter bank, the step of extracting mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal using discrete cosine transform to construct a mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame includes:
[0112] Step S201: performing a fast Fourier transform on the pipeline vibration audio signal to convert the time domain signal of each pipeline vibration audio signal frame in the pipeline vibration audio signal into frequency domain data to obtain spectrum information, wherein the spectrum information reflects the energy distribution of the pipeline vibration audio signal at different frequencies;
[0113] Step S202: Filter the pipeline vibration audio signal using each mel filter in the mel filter bank according to the spectrum information to determine the output energy of each mel filter channel, perform a logarithmic operation on the output energy of each mel filter channel to obtain the logarithmic energy of each mel filter channel, and convert the logarithmic energy into a logarithmic mel spectrum;
[0114] Step S203: Using discrete cosine transform to extract Mel cepstral coefficients according to the logarithmic energy of each Mel filter channel, so as to obtain a Mel cepstral coefficient feature matrix corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal.
[0115] Specifically, in step S2001, a fast Fourier transform (FFT) is performed on the pipeline vibration audio signal to convert the time domain signal into the frequency domain to obtain spectrum information. The formula of the fast Fourier transform is as follows:
[0116]
[0117] Where X(k) represents the complex frequency domain signal after fast Fourier transform (FFT); |X(k)| 2Represents energy spectrum, which measures the energy distribution of a signal at different frequencies; represents a complex exponential, which represents the kernel function of the Fast Fourier Transform (FFT). x(n) represents the time domain signal; w(n) represents the window function, usually a Hamming window or a Hanning window, which is used to reduce the spectrum leakage caused by signal breakage; N FFT Indicates the number of FFT points, usually a power of 2, such as 1024, 2048, etc.
[0118] Step S2002: Filter the pipeline vibration audio signal using a Mel filter bank, perform a logarithmic operation on the energy on each Mel filter channel to obtain the logarithmic energy, and convert the energy into a logarithmic Mel spectrum;
[0119] Specifically, M triangular filters are evenly divided in the Mel domain, where M can be 40, etc., and the Mel frequency is converted back to linear frequency to determine the center frequency f of each Mel filter. c , starting frequency f l , cutoff frequency f h , after mapping back to linear frequency, calculate the energy of each filter channel, where the conversion formula of Mel frequency is expressed as:
[0120]
[0121] Where, f represents the actual frequency in Hz; F Mel Indicates Mel frequency, the unit is mel.
[0122] Furthermore, the weight H of the mth Mel filter at frequency k m The calculation formula of (k) is expressed as:
[0123]
[0124] Among them, f c represents the center frequency of the Mel filter; f l Indicates the starting frequency of the Mel filter, f h represents the cutoff frequency of the Mel filter; H m (k) represents the weight of the mth Mel filter at frequency k.
[0125] Furthermore, the output energy calculation formula of each filter channel is as follows:
[0126]
[0127] Where E(m) represents the output energy of the mth Mel filter channel; X(k) represents the complex frequency domain signal after fast Fourier transform (FFT); H m (k) represents the weight of the mth Mel filter at frequency k.
[0128] Subsequently, the logarithm log(E(m)) of the output energy of each Mel filter channel is taken to obtain the logarithmic energy of each Mel filter channel, so as to compress the dynamic range of the pipe vibration audio signal to conform to the perceptual characteristics of the logarithmic response of the human ear.
[0129] Step S2003: Use discrete cosine transform to extract Mel-frequency cepstral coefficients (MFCC coefficients) to obtain a Mel-frequency cepstral coefficient (MFCC coefficient) feature matrix, where the calculation formula of discrete cosine transform is expressed as:
[0130]
[0131] Among them, C(n) represents the nth Mel-frequency cepstral coefficient (MFCC coefficient); E(m) represents the output energy of the mth Mel-frequency filter channel; M represents the number of Mel-frequency filter channels; L represents the number of MFCC coefficients, which can be 13, representing a 13-dimensional Mel-frequency cepstral coefficient feature matrix.
[0132] The dimension of the feature parameter output by the transformed Mel-cepstral coefficient feature matrix is 13, including the logarithmic energy of the pipe vibration audio signal frame and 12 Mel-cepstral coefficients. The first-order difference matrix of the Mel-cepstral coefficients (MFCC coefficients) mentioned below is the same.
[0133] Step S2004: Calculate the first-order difference matrix of the Mel-frequency cepstral coefficients (MFCC coefficients), wherein the calculation formula of the first-order difference matrix of the Mel-frequency cepstral coefficients (MFCC coefficients) is expressed as:
[0134] ΔC(j)=C(j+1)-C(j),
[0135] Wherein, j is the number of frames of the pipeline vibration audio signal; C(j) represents the Mel-frequency cepstral coefficient corresponding to the j-th pipeline vibration audio signal frame; ΔC(j) is the first-order difference matrix of the Mel-frequency cepstral coefficient corresponding to the j-th pipeline vibration audio signal frame.
[0136] Step S2005: performing feature fusion on the obtained Mel-cepstral coefficient feature matrix and the first-order difference matrix of the Mel-cepstral coefficient to determine a feature fusion matrix for each pipe vibration audio signal frame; wherein the feature fusion step includes:
[0137] The obtained Mel-frequency cepstral coefficient feature matrix and the first-order difference matrix ΔMFCC of the Mel-frequency cepstral coefficient are horizontally spliced, that is, these two matrices with a feature dimension of 13 are spliced into a matrix with a feature dimension of 26 to determine the feature fusion matrix of each pipeline vibration audio signal frame. The feature fusion matrix of each pipeline vibration audio signal frame in the pipeline vibration audio signal is then input into the CNN-BiLSTM hybrid neural network model for training. After the training reaches a convergence state, a water supply network leakage detection model that has been trained to a convergence state is determined and used for leakage detection in water supply pipes in the water supply network.
[0138] Step S40: Using the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and the leakage state corresponding to the pipe vibration audio signal as a sample label, a preset CNN-BiLSTM hybrid neural network model is trained to determine a water supply network leakage detection model that has been trained to a converged state;
[0139] The first-order difference matrix of the Mel-cepstral coefficients is calculated and determined, and the Mel-cepstral coefficient feature matrix is feature-fused with the first-order difference matrix to determine the feature fusion matrix of each pipe vibration audio signal frame. Then, the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal is used as a training sample, and the leakage state corresponding to the pipe vibration audio signal is used as a sample label to train the preset CNN-BiLSTM hybrid neural network model to determine a water supply network leakage detection model that has been trained to a convergence state; wherein, the basic network architecture of the water supply network leakage detection model is a CNN-BiLSTM hybrid neural network model, wherein the CNN-BiLSTM hybrid neural network model consists of two layers of convolutional neural networks and one layer of bidirectional long short-term memory network, and the convolutional neural network is constructed by 2 convolutional layers and 2 pooling layers.
[0140] In some embodiments, the steps of training a preset CNN-BiLSTM hybrid neural network model using a feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and a leakage state corresponding to the pipe vibration audio signal as a sample label to determine a water supply network leakage detection model that has been trained to a converged state include:
[0141] Step S401: Using a preset Bayesian optimization algorithm to optimize the model hyperparameters of the CNN-BiLSTM hybrid neural network model to determine the optimal hyperparameter combination of the CNN-BiLSTM hybrid neural network model, wherein the model hyperparameters include learning rate, batch size, and number of LSTM hidden units;
[0142] Step S402: Using the CNN-BiLSTM hybrid neural network model with the optimal hyperparameter combination as the water supply network leakage detection model.
[0143] In this embodiment, the hybrid neural network model consists of two layers of CNN (convolutional neural network) and one layer of BiLSTM (bidirectional long short-term memory network) connected in series, with a flattening layer in the middle. Among them, CNN (convolutional neural network) is used to extract the local spatial features of MFCC related features, and BiLSTM (bidirectional long short-term memory network) is used to capture the time series characteristics of CNN (convolutional neural network) output features. For the specific CNN-BiLSTM hybrid neural network model structure and its related parameters, please refer to Table 1, which is a table of CNN-BiLSTM hybrid neural network model structure parameters.
[0144] Table 1 CNN-Bi LSTM hybrid neural network model structure parameters
[0145]
[0146] Build a CNN (convolutional neural network). The CNN (convolutional neural network) consists of 2 convolution layers and 2 pooling layers. Specifically, the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal is extracted through a CNN (convolutional neural network) composed of two convolution layers, ReLU activation function and maximum pooling layer. The feature extraction steps of the convolution layer are as follows: Figure 3 shown.
[0147] The output of the convolutional layer can be expressed by the following formula:
[0148]
[0149] Wherein, I is the input feature matrix; K is the convolution kernel; b is the bias term. In this embodiment, the size of convolution kernel 1 is 5, the number of convolution kernel 1 is 32, the size of convolution kernel 2 is 5, and the number of convolution kernel 2 is 64.
[0150] The activation function uses the ReLU activation function, and its formula is as follows:
[0151] O ReLU =max(0, BN ),
[0152] The ReLU function sets the negative values in the output feature matrix to 0 and retains the positive values.
[0153] The maximum pooling layer downsamples the feature matrix, and the formula is:
[0154] O pool (i, j) = O ReLU =max[OReLU (i+k, j+l)]; (k, l)∈window,
[0155] Among them, window is the pooling window size (2×2); (i, j) is the position of the output feature matrix; (k, l) is the position within the pooling window.
[0156] In a further embodiment, a flattening layer is constructed to expand the feature matrix extracted by the two-layer CNN network into a one-dimensional vector. The feature matrix output by the convolutional layer is converted into a one-dimensional vector through the flattening layer, which is convenient for feeding into the subsequent BiLSTM (bidirectional long short-term memory network) for processing.
[0157] For further examples, please refer to Figure 4 , building a BiLSTM (bidirectional long short-term memory) network to process the feature vectors extracted and flattened by the CNN (convolutional neural network). The BiLSTM is used to process the flattened feature vectors and capture the time series characteristics of the signal. This layer uses a bidirectional LSTM to process the temporal dependencies of the audio signal, thereby capturing both forward and backward information. This allows the model to better understand the temporal dynamics of the leakage signal.
[0158] Specifically, see Table 1, which contains the structural parameters of a BiLSTM (bidirectional long short-term memory) network. Generally speaking, the LSTM algorithm uses three gates (forget gate, input gate, and output gate) to adjust the output state of the current unit and the previous unit.
[0159] Specifically, see Figure 5 , where h t-1 represents the state at time t-1, x t Represents input information. The forget gate adjusts the input data of the previous moment retained by the hidden layer node. Based on the current hidden layer input and the previous moment state calculation, it determines whether the current moment state needs to be discarded or retained, and is output by the sigmoid activation function. The sigmoid activation function formula is as follows:
[0160]
[0161] In an LSTM unit, x t With h t-1 For input information, x t With h t-1 The forget gate will output a value of 0 or 1, where 0 means discard and 1 means retain. The expression of the forget gate is:
[0162] f t =σ(W f ·[ht-1 , x t ]+b f ),
[0163] Among them, σ represents the sigmoid activation function, W f represents the weight of the forget gate, b f Denotes the forget gate bias.
[0164] The input gate adjusts the input state of the current hidden layer memory unit to determine whether the input data is updated with the current memory unit state. The expression of the input gate is:
[0165] i t =σ(W f ·[h t-1 , x t ]+b i ),
[0166] Among them, σ represents the sigmoid activation function, W f represents the input gate weight; b i represents the input gate bias, i t Represents the output value of the input gate.
[0167] x t With h t-1 First use the sigmoid activation function to determine whether the input data is saved or updated, and then x t With h t-1 Get the new candidate memory cell value C′ through the tanh function t , whose expression is:
[0168] C′ t =tanh(W c ·[h t-1 , x t ]+b c ),
[0169] Among them, tanh represents the activation function; W c represents the weight of the candidate memory unit; b c Represents the candidate memory cell bias.
[0170] Multiply the output value at time t-1 by the output value of the forget gate, multiply the candidate memory unit value by the output value of the input gate, and add the two together to update the current state to obtain the current memory unit. The forget gate expression is:
[0171] C t =f t *C t-1 +i t *C′ t ;
[0172] Among them, f t Represents the output of the forget gate, C t-1 represents the cell output value at time t-1, i t Represents the output value of the input gate, C′ t Represents a candidate memory cell value.
[0173] The output gate adjusts the output state of the current hidden layer node to determine whether the data is output to the next unit hidden layer or output layer. According to the current state of the forget gate and input gate update, x t With h t-1 To identify the output signal characteristics, the output gate information is determined by the sigmoid function, and its expression is as follows:
[0174] O t =σ(W o ·[h t-1 , x t ]+b o ),
[0175] Among them, σ represents the sigmoid activation function, W o represents the output gate weight, b o Represents the output gate bias.
[0176] The final output y of the LSTM unit is t Output by the tanh function, its expression is as follows:
[0177] y t =O t tanh(C t )
[0178] In this embodiment, a bidirectional LSTM (i.e., BiLSTM) is used, meaning that two independent LSTMs are run at each time step: one from the beginning to the end of the sequence (forward LSTM) and the other from the end to the beginning of the sequence (backward LSTM). From the above embodiment, it can be seen that the BILSTM takes 56 time steps. The forward LSTM processes the input sequence sequentially from time steps 1 to 56, and ultimately outputs the hidden state of the last time step (step 56) (with dimensions [batch size, number of hidden units]). Simultaneously, the backward LSTM processes the same sequence in reverse order from time steps 56 to 1, and ultimately outputs the hidden state of the last time step (corresponding to step 1 of the original sequence) of its processing flow (also with dimensions [batch size, number of hidden units]). By concatenating the final outputs of these two directional LSTMs along the feature dimension, a merged bidirectional feature representation [forward output, backward output] is obtained, with dimensions [batch size, 2 × number of hidden units]. This structure enables the model to simultaneously capture both forward and backward dependencies of the sequence.
[0179] In a further embodiment, a Softmax output layer is constructed; the task of this embodiment is a binary classification problem (i.e., determining whether the pipeline vibration audio signal is a pipeline vibration audio signal indicating that the water supply pipeline is in a leaking state). After the output of the Softmax layer represents the probability that the sample belongs to the positive class (i.e., leakage occurs), the classification output layer will calculate the binary cross entropy loss, which is calculated as follows:
[0180] Loss=-(y·lg(p)+(1-y)·lg(1-p))
[0181] Where y represents the true label (0 or 1), where 0 represents the non-leakage state and 1 represents the leakage state; p represents the probability of the Softmax layer output.
[0182] The classification layer ultimately converts the probability p output by the Softmax layer into the final classification result and provides training feedback. If p ≥ 0.5, the prediction is positive, indicating that the water supply pipe is leaking; otherwise, the prediction is negative, indicating that the water supply pipe is not leaking.
[0183] Furthermore, Bayesian optimization is used to select and optimize neural network hyperparameters;
[0184] Bayesian optimization is particularly well-suited for solving complex objective functions that are computationally expensive, non-convex, or difficult to differentiate. By constructing surrogate models and acquisition functions, the algorithm effectively explores the parameter space. In the field of deep learning, it is primarily used for automated tuning of neural network hyperparameters, significantly improving the efficiency of parameter optimization.
[0185] In this embodiment, Bayesian optimization is used to optimize hyperparameters such as learning rate, batch size, and the number of hidden units in the LSTM. By building a probabilistic model of the objective function and balancing exploration and exploitation, Bayesian optimization can find the optimal hyperparameter combination within a small number of iterations. In MATLAB, you can use the bayesopt function to implement Bayesian optimization, using accuracy or F1 score as the objective function to improve the performance of the CNN-BiLSTM model.
[0186] Furthermore, during the training process, four performance indicators, namely accuracy, precision, recall, and F1 score, were used to evaluate the detection accuracy and performance of the model to ensure that the model could accurately identify the leakage status;
[0187] The performance evaluation index formula is as follows:
[0188]
[0189]
[0190]
[0191] Among them, TP is true positive; TN is true negative; FP is false positive; FN is false negative.
[0192] Step S50: Input the vibration audio signal of the pipe to be identified into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipe corresponding to the vibration audio signal of the pipe to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
[0193] The feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal is used as a training sample, and the leakage state corresponding to the pipe vibration audio signal is used as a sample label. After the preset CNN-BiLSTM hybrid neural network model is trained to determine the water supply network leakage detection model that has been trained to a convergence state, the pipe vibration audio signal to be identified is input into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipe corresponding to the pipe vibration audio signal to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
[0194] As can be seen from the above embodiments, compared with the prior art, the present application addresses the problems in the prior art such as the scarcity of annotated data for vibration audio signals of water supply pipes in a leaking state, and the low recognition accuracy, poor robustness, and weak generalization ability of existing machine learning methods in identifying water supply pipe leakage. The present application includes but is not limited to the following beneficial effects:
[0195] First, traditional leak detection methods rely on large amounts of labeled data, but the collection of pipe vibration audio signals for leaks in water supply networks often suffers from a scarcity of samples. Generative adversarial networks (WaveGANs) can effectively expand the training dataset, addressing this data scarcity issue and improving the effectiveness of the trained model. By synthesizing real and simulated pipe vibration audio signals, the model's robustness is enhanced in diverse signal and noise environments, ensuring the adaptability of leak detection in diverse environments.
[0196] Second, existing technologies often rely on a single acoustic feature to identify leakage signals, but often ignore the influence of dynamic features. By fusing the Mel-frequency cepstral coefficients with their first-order difference feature matrix, this application extracts richer time and frequency domain features, which can more accurately reflect the changing patterns of leakage signals and enhance the model's ability to distinguish leakage signals.
[0197] Third, the Mel-frequency cepstral coefficients are used to process spectral features, and combined with BiLSTM to capture time series features, so that the model can simultaneously consider the instantaneous spectral characteristics and time variation patterns of the pipeline vibration audio signal when the water supply pipeline is in a leaking state, thereby improving the accuracy of leakage identification.
[0198] Fourthly, this application is based on the CNN-Bi LSTM hybrid architecture. Convolutional neural networks (CNN) are good at extracting spatial features, especially when processing high-dimensional data, they have powerful feature learning capabilities. The bidirectional long short-term memory network (Bi LSTM) can make full use of the bidirectional information of the time series to capture the long-term dependencies of the signal. Combining the advantages of the two, it is possible to take into account local and global feature information when processing vibration audio signals of water supply network leakage, thereby improving the recognition effect. After extracting spatial features through CNN, Bi LSTM further mines the time series information, and finally achieves high-precision output of the leakage identification model. This hybrid architecture introduces a more complex network structure based on the traditional method, making leakage identification more accurate.
[0199] Fifth, this application significantly improves the automation and intelligence of leak detection, reducing the vulnerabilities of traditional manual experience. In particular, automated detection based on neural network models can identify pipeline leaks in real time, preventing leaks from being overlooked or misidentified. Compared with traditional manual detection methods, this technology can identify leaks without extensive human intervention, reducing labor costs and improving detection efficiency.
[0200] Sixth, by accurately identifying leakage, this application enables early pipeline maintenance and repair, preventing sudden incidents like pipe bursts and thereby improving the stability and safety of the water supply system. Particularly in large-scale water supply networks, systematic leak detection can effectively prevent water supply interruptions and the resulting socioeconomic losses.
[0201] Furthermore, this application, through the combination of data augmentation and a hybrid neural network architecture, effectively addresses issues such as data scarcity, insufficient feature extraction, and low model accuracy in water supply network leakage detection, significantly improving the accuracy, robustness, and generalization capabilities of leakage detection. This technical solution not only improves the efficiency of water supply network leakage detection and reduces the economic and environmental losses caused by leakage, but also further promotes the development of intelligent management of water supply systems, and has broad application prospects.
[0202] See also Figure 6, a water supply network leakage identification device based on data enhancement and hybrid neural network architecture is provided to meet one of the purposes of this application, including an audio data set construction module 1100, a Mel-frequency cepstral coefficient extraction module 1200, a feature fusion matrix construction module 1300, a detection model training module 1400 and a water supply network leakage identification module 1500. Among them, the audio data set construction module 1100 is configured to collect real pipe vibration audio signals in the water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, and combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal data set, wherein the pipe vibration audio signal data set includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames; the Mel cepstral coefficient extraction module 1200 is configured to use fast Fourier transform and Mel filter group to process the pipe vibration audio signals in sequence, and then use discrete cosine transform to extract the Mel cepstral coefficients corresponding to each pipe vibration audio signal frame in the pipe vibration audio signal to construct the Mel cepstral coefficient feature matrix of the pipe vibration audio signal frame; feature fusion matrix construction The construction module 1300 is configured to calculate and determine the first-order difference matrix of the Mel-cepstral coefficients, and perform feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine the feature fusion matrix of each pipe vibration audio signal frame; the detection model training module 1400 is configured to use the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample, and the leakage state corresponding to the pipe vibration audio signal as a sample label to train the preset CNN-BiLSTM hybrid neural network model to determine a water supply network leakage detection model that has been trained to a convergence state; the water supply network leakage identification module 1500 is configured to input the pipe vibration audio signal to be identified into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipe corresponding to the pipe vibration audio signal to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
[0203] Based on any embodiment of this application, please refer to Figure 7 Another embodiment of the present application further provides an electronic device, which can be implemented by a computer device, such as Figure 7As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions, and the database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a water supply network leakage identification method based on data enhancement and a hybrid neural network architecture. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the water supply network leakage identification method based on data enhancement and a hybrid neural network architecture of the present application. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0204] In this embodiment, the processor is used to execute Figure 6 The memory stores the program code and various data required to execute the specific functions of each module in the device. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules in the water supply network leakage identification device based on data enhancement and hybrid neural network architecture of this application. The server can call the server's program code and data to execute the functions of all modules.
[0205] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the water supply network leakage identification method based on data enhancement and hybrid neural network architecture described in any embodiment of the present application.
[0206] The present application also provides a computer program product, including a computer program / instruction, which, when executed by one or more processors, implements the steps of the water supply network leakage identification method based on data enhancement and hybrid neural network architecture described in any embodiment of the present application.
[0207] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of the method. The aforementioned storage medium can be a computer-readable storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0208] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A water supply network leakage identification method based on data enhancement and hybrid neural network architecture, characterized in that: include: Collect real pipe vibration audio signals from a water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal dataset, wherein the pipe vibration audio signal dataset includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames; After sequentially processing the pipeline vibration audio signal using fast Fourier transform and Mel filter bank, discrete cosine transform is used to extract Mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal to construct a Mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame; Calculating and determining a first-order difference matrix of the Mel-cepstral coefficients, and performing feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine a feature fusion matrix for each pipeline vibration audio signal frame; Using the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and the leakage state corresponding to the pipe vibration audio signal as a sample label, a preset CNN-BiLSTM hybrid neural network model is trained to determine a water supply network leakage detection model that has been trained to a convergent state; The vibration audio signal of the pipeline to be identified is input into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipeline corresponding to the vibration audio signal of the pipeline to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
2. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to claim 1 is characterized in that: The step of determining a plurality of pipeline vibration audio signal frames comprises: Obtain the audio duration, frame duration, overlap duration, and sampling rate of each pipeline vibration audio signal; Calculating and determining a first product between the audio duration and the sampling rate, calculating and determining a second product between the frame duration and the sampling rate, and calculating and determining a first difference between the first product and the second product; Calculate and determine a second difference between the frame duration and the overlap duration to determine a jump duration, and calculate and determine a third product between the jump duration and the sampling rate; The number of frames of each pipe vibration audio signal is determined according to a first ratio between the first difference and the third product, and the pipe vibration audio signal is framed according to the number of frames to determine multiple pipe vibration audio signal frames in each pipe vibration audio signal.
3. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to claim 1 is characterized in that: The step of training the generative adversarial network comprises: Obtain key parameters, initialize the network structure of the generator and discriminator in the preset generative adversarial network, initialize the network weights, and use the Adam optimizer. The key parameters include the dataset path, batch size, random noise dimension, number of training rounds, learning rate, and sampling rate. Get the paths of all real pipe vibration audio signals in the audio dataset, create a dataset object, and generate data loaders for the generator and discriminator respectively; In each training round, the data loader is traversed for training, the discrimination results of the real pipeline vibration audio signal and the simulated pipeline vibration audio signal are calculated, the gradient penalty term is calculated to ensure the continuity of the discriminator, the parameters of the discriminator are updated to minimize the discriminator's ability to distinguish the generated signal, and the loss value of the discriminator is recorded; Generate a simulated pipeline vibration audio signal and calculate the output of the discriminator, update the parameters of the generator to maximize the discriminator's discrimination result on the simulated pipeline vibration audio signal, and record the loss value of the generator; At regular training intervals, simulate the pipeline vibration audio signal and save it to a specified directory until the generator can generate high-quality simulated pipeline vibration audio signals. Save the trained generator, use the trained generator to generate new simulated pipeline vibration audio signals, and combine the simulated pipeline vibration audio signals with real pipeline vibration audio signals for data enhancement.
4. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to claim 1 is characterized in that: After sequentially processing the pipeline vibration audio signal using fast Fourier transform and Mel filter bank, the step of extracting Mel cepstral coefficients corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal using discrete cosine transform to construct a Mel cepstral coefficient feature matrix of the pipeline vibration audio signal frame includes: Performing a fast Fourier transform on the pipeline vibration audio signal to convert a time domain signal of each pipeline vibration audio signal frame in the pipeline vibration audio signal into frequency domain data to obtain spectrum information, wherein the spectrum information reflects the energy distribution of the pipeline vibration audio signal at different frequencies; filtering the pipeline vibration audio signal using each Mel filter in the Mel filter bank according to the spectrum information to determine output energy on each Mel filter channel, performing a logarithmic operation on the output energy on each Mel filter channel to obtain the logarithmic energy of each Mel filter channel, and converting the logarithmic energy into a logarithmic Mel spectrum; Mel cepstral coefficients are extracted according to the logarithmic energy of each Mel filter channel using discrete cosine transform to obtain a Mel cepstral coefficient feature matrix corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal.
5. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to claim 1 is characterized in that: The steps of training a preset CNN-BiLSTM hybrid neural network model using the feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and the leakage state corresponding to the pipe vibration audio signal as a sample label to determine a water supply network leakage detection model that has been trained to a converged state include: Using a preset Bayesian optimization algorithm to optimize the model hyperparameters of the CNN-BiLSTM hybrid neural network model to determine the optimal hyperparameter combination of the CNN-BiLSTM hybrid neural network model, wherein the model hyperparameters include learning rate, batch size, and number of LSTM hidden units; The CNN-BiLSTM hybrid neural network model with the optimal hyperparameter combination is used as the water supply network leakage detection model.
6. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to claim 1 is characterized in that: The basic network architecture of the water supply network leakage detection model is a CNN-BiLSTM hybrid neural network model, wherein the CNN-BiLSTM hybrid neural network model consists of two layers of convolutional neural networks and one layer of bidirectional long short-term memory network, and the convolutional neural network is constructed by 2 convolutional layers and 2 pooling layers.
7. The water supply network leakage identification method based on data enhancement and hybrid neural network architecture according to any one of claims 1 to 6, characterized in that: The feature fusion matrix represents the joint features of the pipeline vibration audio signal in the time domain and the frequency domain, and not only includes the static spectrum information of the signal, but also combines the dynamic characteristics of the signal changing with time.
8. A water supply network leakage identification device based on data enhancement and hybrid neural network architecture, characterized in that: include: An audio data set construction module is configured to collect real pipe vibration audio signals in a water supply network, input the real pipe vibration audio signals into a preset generative adversarial network, generate simulated pipe vibration audio signals through different rounds of output, and combine the real pipe vibration audio signals with the simulated pipe vibration audio signals to construct a pipe vibration audio signal data set, wherein the pipe vibration audio signal data set includes multiple pipe vibration audio signals of a certain audio duration, and each pipe vibration audio signal includes multiple pipe vibration audio signal frames; a Mel-cepstral coefficient extraction module configured to sequentially process the pipeline vibration audio signal using a fast Fourier transform and a Mel filter bank, and then extract the Mel-cepstral coefficient corresponding to each pipeline vibration audio signal frame in the pipeline vibration audio signal using a discrete cosine transform to construct a Mel-cepstral coefficient feature matrix of the pipeline vibration audio signal frame; a feature fusion matrix construction module, configured to calculate and determine a first-order difference matrix of the Mel-cepstral coefficients, and perform feature fusion on the Mel-cepstral coefficient feature matrix and the first-order difference matrix to determine a feature fusion matrix for each pipeline vibration audio signal frame; a detection model training module configured to train a preset CNN-BiLSTM hybrid neural network model using a feature fusion matrix of each pipe vibration audio signal frame in the pipe vibration audio signal as a training sample and a leakage state corresponding to the pipe vibration audio signal as a sample label, so as to determine a water supply network leakage detection model that has been trained to a convergent state; The water supply network leakage identification module is configured to input the vibration audio signal of the pipeline to be identified into the water supply network leakage detection model that has been trained to a convergence state to determine whether the pipeline corresponding to the vibration audio signal of the pipeline to be identified is in a leakage state or a non-leakage state, so as to complete the water supply network leakage identification based on data enhancement and hybrid neural network architecture.
9. An electronic device comprising a central processing unit and a memory, characterized in that: The central processing unit is configured to call and run a computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that It stores a computer program implemented according to the method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
Citation Information
Patent Citations
Water supply pipeline leakage detection method and system, storage medium and intelligent terminal
CN116705057A
Construction method and application of water supply pipeline leakage identification model based on deep learning
CN116951334A
Water distribution pipe network two-stage leakage monitoring method and device based on sound signals
CN118762717A
Water supply network acoustic leakage detection method based on enhanced semi-supervised model
CN119649848A
Leakage detection method and system for water supply pipeline, and storage medium and smart terminal
WO2024244556A1
Cited By
Limited sample-based water supply pipeline leakage detection method
CN122112927A
A method for detecting leaks in water supply pipelines based on limited samples
CN122112927B