Building water supply and drainage pipe network leakage detection positioning method and system based on deep learning
By combining adaptive acoustic feature enhancement and multi-scale attention feature extraction networks with graph neural networks, the problems of detection sensitivity and positioning accuracy of building water supply and drainage network leakage detection in low signal-to-noise ratio environments are solved, realizing real-time high-precision leakage detection and positioning on edge computing devices.
Patent Information
- Application Number
- CN202610723550.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-25
AI Technical Summary
Existing building water supply and drainage network leakage detection technologies are difficult to effectively identify weak leaks in low signal-to-noise ratio environments, and their positioning accuracy is insufficient, failing to meet the needs of refined management of building pipe networks. In particular, they are difficult to achieve real-time high-precision detection in complex topology structures and when edge computing equipment resources are limited.
An adaptive acoustic feature enhancement module is used to adaptively enhance the signal-to-noise ratio. Combined with a multi-scale attention feature extraction network and a graph neural network, through multi-scale feature fusion and graph structure data processing, the system can achieve refined discrimination and high-precision localization of lost signals.
It improves the detection sensitivity of weak leakage signals, enhances the accuracy of leakage location, and reduces computational complexity and memory usage, adapting to the real-time detection needs of complex topologies and edge computing devices.
Smart Images

Figure CN122634243A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data processing technology, and in particular to a method and system for detecting and locating leaks in building water supply and drainage pipe networks based on deep learning. Background Technology
[0002] Building water supply and drainage networks are a core component of modern building infrastructure, undertaking critical functions such as domestic water supply, fire-fighting water supply, and sewage discharge. Because building pipe networks are mostly laid inside walls, under floors, or behind decorative layers, pipe leaks are highly concealed and difficult to detect. Especially early, minor leaks, masked by background noise, have extremely weak acoustic signals, making them difficult to identify effectively using traditional detection methods. If not detected and addressed promptly, minor leaks will gradually develop into serious pipe ruptures, not only causing significant waste of water resources but also potentially triggering secondary disasters such as structural dampness, steel corrosion, damage to decorative layers, and even electrical short circuits, seriously threatening the safety and durability of the building.
[0003] Currently, leakage detection in building water supply and drainage networks mainly relies on manual inspections and simple threshold judgment methods. Manual inspections, which require personnel to check each area individually, are not only inefficient and costly but also heavily influenced by subjective experience, making them ineffective for inspecting pipes laid in concealed locations. Automatic detection methods based on simple threshold judgments analyze short-time energy, zero-crossing rate, kurtosis, and other statistical parameters of signals collected by acoustic or pressure sensors deployed at key nodes in the network, comparing these parameters with preset thresholds to determine the leakage status. While these methods can be effective under high signal-to-noise ratio conditions, in the low signal-to-noise ratio environments common in building pipe networks, leakage characteristics are easily masked by background noise, resulting in high false alarm and false false alarm rates, failing to meet the reliability requirements of refined management of building pipe networks.
[0004] To improve the intelligence level of leakage detection, some studies have attempted to introduce convolutional neural networks to automatically learn and discriminate features from acoustic signals. These methods typically first convert the time-domain signal acquired by the sensor into a time-frequency domain representation using short-time Fourier transform or Mel-frequency cepstral coefficient transform, and then use a standard convolutional network to extract features and output the leakage status classification result. However, these methods still have the following three shortcomings in practical applications:
[0005] The ability to enhance the acoustic features of weak leakage signals is limited. Leakage acoustic signals in building pipeline environments often exhibit broadband and multi-component characteristics, and the effective leakage signal components are often concentrated in specific frequency bands. Under low signal-to-noise ratio conditions, directly extracting features from the entire frequency band time spectrum can easily mask weak leakage signal components by energy-dominant background noise, resulting in insufficient sensitivity of the model to detect early, minor leaks.
[0006] Single-scale feature extraction methods struggle to simultaneously capture the refined discriminative features of leaky signals. Leaky signals exhibit differentiated behavior across different time and frequency scales—transient impulse components require smaller receptive fields for detailed characterization, while sustained spectral characteristics necessitate larger receptive fields to capture global energy distribution and structural patterns. Existing standard convolutional networks employ fixed receptive fields for feature extraction, failing to effectively integrate local details with global structural information.
[0007] In the leakage location stage, the traditional correlation method based on time delay estimation is mainly relied upon. This method measures the time delay difference of the leakage signal arriving at different sensors and calculates the location of the leakage point based on the wave velocity. The location accuracy of this method is highly dependent on the accuracy of the time delay estimation. However, in building pipe networks, due to the complexity of the pipe topology, the limited sensor deployment density, and the influence of multipath propagation and signal attenuation, the accuracy of time delay estimation is difficult to guarantee. Especially in scenarios with dense pipe network branches or multiple concurrent leakages, the location accuracy of the traditional correlation method is significantly limited.
[0008] Furthermore, to meet the real-time and edge deployment requirements of building pipeline monitoring, deep learning models need to have low computational complexity and memory consumption while ensuring detection performance. However, most existing solutions do not have a dedicated lightweight model design for edge computing scenarios. When feature extraction networks with a large number of parameters are directly deployed on edge computing devices with limited computing power, it is difficult to simultaneously meet the requirements of real-time inference and high-precision detection.
[0009] This invention aims to solve the technical problems existing in the prior art. To this end, it proposes a method and system for detecting and locating leakage in building water supply and drainage pipe networks based on deep learning. Summary of the Invention
[0010] The purpose of this invention is to provide a method and system for detecting and locating leakage in building water supply and drainage pipe networks based on deep learning, so as to solve the technical problems existing in the prior art.
[0011] This invention provides a deep learning-based method for detecting and locating leaks in building water supply and drainage networks, comprising the following steps:
[0012] S1. Acquire the raw acoustic signals collected by acoustic sensors deployed at each monitoring node of the building's water supply and drainage network, preprocess the raw acoustic signals to obtain preprocessed acoustic signals; the preprocessing includes at least bandpass filtering, frame windowing and short-time Fourier transform, and convert the amplitude spectrum after short-time Fourier transform into a log-Mel spectrum through a Mel filter bank.
[0013] S2. Input the preprocessed acoustic signal into the pre-constructed adaptive acoustic feature enhancement module, perform sub-band decomposition on the acoustic signal, calculate the local signal-to-noise ratio estimate of each sub-band, generate sub-band adaptive gain coefficients based on the local signal-to-noise ratio, apply enhancement to the low signal-to-noise ratio sub-band, and maintain the original energy level of the high signal-to-noise ratio sub-band to obtain the enhanced acoustic feature spectrum.
[0014] S3. Input the enhanced acoustic feature spectrum into the pre-constructed multi-scale attention feature extraction network, and extract time-frequency domain features by using multiple parallel convolutional branches of different scales. After the features of each branch are weighted by the channel attention mechanism, they are spliced and fused along the channel dimension to form a multi-scale fused feature vector.
[0015] S4. Input the multi-scale fused feature vector into the leakage status classifier and output the leakage status discrimination result of each monitoring node. The discrimination result includes leakage status and non-leakage status.
[0016] S5. When any monitoring node is determined to be in a leaking state, the enhanced acoustic feature spectra of all nodes associated with that node are processed by the multi-scale attention feature extraction network to obtain the embedded vectors, which are then organized into graph structure data according to the pipeline network topology. This data is then input into the pre-built graph neural network localization model, and the estimated spatial coordinates of the leaking point in the pipeline network topology coordinate system are output.
[0017] Further, in step S2, the subband decomposition adopts a subband decomposition method based on Gammatone filter banks, and the center frequency of the filter banks is uniformly distributed on the logarithmic frequency axis; the local signal-to-noise ratio estimate is obtained by comparing the ratio of the subband energy to the background noise energy estimate, and the background noise energy estimate is obtained by a noise estimation algorithm based on minimum statistics.
[0018] Furthermore, in step S2, the subband adaptive gain coefficient is calculated based on the local signal-to-noise ratio estimate through a nonlinear mapping function, which applies a large gain in the low signal-to-noise ratio region and approaches unity gain in the high signal-to-noise ratio region.
[0019] Further, in step S3, the multiple convolutional branches of different scales include at least one fine-grained feature extraction branch using a small convolutional kernel, one medium-grained feature extraction branch using a medium convolutional kernel, and one coarse-grained feature extraction branch using a large convolutional kernel; each convolutional branch is followed by a channel attention module. The channel attention mechanism generates attention weights for each channel through global average pooling, one-dimensional convolutional cross-channel interaction, and nonlinear activation operations.
[0020] Furthermore, in step S5, the graph structure data uses monitoring nodes as graph nodes, pipeline connection relationships as edges, and node features as embedded vectors of the enhanced acoustic feature spectra of the corresponding nodes after feature extraction; the graph neural network localization model is implemented using a graph attention network or a graph convolutional network, which aggregates the information of adjacent nodes through a message passing mechanism, and finally outputs the normalized coordinates of the leakage point.
[0021] Furthermore, the output of the graph neural network localization model is the normalized coordinates of the leakage point in the pipeline topology coordinate system, and the normalized coordinates are converted into the physical location in the building space through a preset coordinate mapping relationship.
[0022] Furthermore, between steps S3 and S4, a knowledge distillation step is also included: using a multi-scale attention feature extraction network as the student network and a pre-trained, larger-scale multi-scale attention feature extraction network as the teacher network, the student network is trained in a lightweight manner through soft label distillation and feature layer distillation.
[0023] This invention provides a deep learning-based system for detecting and locating leaks in building water supply and drainage networks, comprising:
[0024] The signal acquisition and preprocessing unit is used to acquire the raw acoustic signals collected by acoustic sensors deployed at each monitoring node of the building's water supply and drainage network, and to preprocess the raw acoustic signals.
[0025] The acoustic feature enhancement unit, which embeds an adaptive acoustic feature enhancement module, is used to perform sub-band adaptive enhancement processing on the preprocessed acoustic signal;
[0026] A multi-scale feature extraction unit, which embeds a multi-scale attention feature extraction network, is used to extract multi-scale fused feature vectors from the enhanced acoustic feature spectrum.
[0027] The leakage detection and discrimination unit has an embedded leakage status classifier, which is used to output the leakage status discrimination results of each monitoring node based on the multi-scale fused feature vector;
[0028] The leakage location unit, with an embedded graph neural network location model, is used to output the estimated spatial coordinates of the leakage point when leakage is detected.
[0029] And a pipeline topology data storage unit, used to store the topology data of the building's water supply and drainage pipeline network, including the spatial coordinates of each monitoring node, the pipeline connection relationship between nodes, and pipeline attribute information.
[0030] Furthermore, the system also includes a knowledge distillation training unit, which is used to perform lightweight compression on the multi-scale attention feature extraction network, thereby reducing the computational resource requirements and inference latency of the model without significantly reducing detection accuracy.
[0031] Furthermore, the acoustic sensor is at least one of an acoustic emission sensor, an acceleration sensor, or a hydrophone deployed on the outer wall of the building's water supply and drainage network or at the pipe joint.
[0032] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described deep learning-based method for detecting and locating leakage in building water supply and drainage networks.
[0033] Compared with the prior art, the beneficial effects of the present invention are:
[0034] By using an adaptive acoustic feature enhancement module, the enhancement gain is dynamically adjusted according to the local signal-to-noise ratio of each sub-band, which can specifically enhance the energy of weak leakage signal components while maintaining the original characteristics of high signal-to-noise ratio sub-bands. This effectively solves the technical problem of difficult detection of low signal-to-noise ratio leakage signals in building pipeline network environments.
[0035] By using a multi-scale attention feature extraction network, time-frequency domain features are extracted in parallel using convolutional branches of different granularities, and dynamic weighted fusion of features is achieved through a channel attention mechanism. This enables the simultaneous capture of discriminative information of the lost signal in both fine-grained local texture and coarse-grained global structure.
[0036] By incorporating prior knowledge of pipeline topology into the positioning process through a graph neural network positioning model, and utilizing spatial relationship constraints between nodes for message passing and information aggregation, this method achieves higher positioning accuracy and adaptability to complex topologies compared to traditional time delay estimation methods.
[0037] By using a knowledge distillation strategy to lightweight the feature extraction network, the computational complexity and memory usage of the model are significantly reduced while maintaining detection performance, which is beneficial for deployment on embedded edge computing devices. Attached Figure Description
[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating a deep learning-based method for detecting and locating leaks in building water supply and drainage networks, as provided in an embodiment of the present invention.
[0040] Figure 2 This is a schematic diagram of the processing flow of the adaptive acoustic feature enhancement module in an embodiment of the present invention.
[0041] Figure 3 This is a schematic diagram of the structure of the multi-scale attention feature extraction network in an embodiment of the present invention.
[0042] Figure 4 This is a schematic diagram of the graph neural network localization model in an embodiment of the present invention.
[0043] Figure 5 This is a schematic diagram of the model training process in an embodiment of the present invention.
[0044] Figure 6 This is a structural block diagram of a deep learning-based building water supply and drainage network leakage detection and location system provided in an embodiment of the present invention. Detailed Implementation
[0045] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0046] Example 1: Detection and Positioning Method
[0047] This embodiment provides a deep learning-based method for detecting and locating leaks in building water supply and drainage pipe networks. (Refer to...) Figure 1 The method mainly includes the following steps: acquiring the original acoustic signals of each monitoring node of the building water supply and drainage network and preprocessing them; performing adaptive acoustic feature enhancement on the preprocessed acoustic signals; extracting multi-scale fusion feature vectors from the enhanced acoustic feature spectrum using a multi-scale attention feature extraction network; inputting the multi-scale fusion feature vectors into a leakage state classifier and outputting the leakage state discrimination result; when leakage is detected, outputting the spatial coordinate estimate of the leakage point through a graph neural network localization model.
[0048] Step S1: Acoustic signal acquisition and preprocessing
[0049] An array of acoustic sensors is deployed at key nodes in the building's water supply and drainage network. These acoustic sensors can be acoustic emission sensors, accelerometers, or hydrophones, and are deployed at locations including, but not limited to, stress concentration points and key signal propagation points such as pipe bends, tee joints, before and after valves, and connections between risers and horizontal pipes. Each sensor synchronously acquires acoustic signals from the pipeline at a preset sampling rate, forming a multi-channel synchronous acoustic signal stream.
[0050] The acquired raw acoustic signals are preprocessed as follows: First, low-frequency structural vibrations and high-frequency electromagnetic interference unrelated to leakage signals are filtered out using a bandpass filter. The frequency range of the bandpass filter is determined based on the prior spectral characteristics of the leakage acoustic signals from the building's water supply and drainage network. Second, the filtered signals are framed and windowed using a Hanning window to balance the trade-off between frequency resolution and spectral leakage. The frame length and frame shift are set according to the sampling rate and time-frequency resolution requirements. Finally, a short-time Fourier transform is performed on each frame to obtain a complex spectrum. The amplitude spectrum is then used to obtain a log-Mel spectrum, which serves as the input feature representation for subsequent modules.
[0051] Step S2: Adaptive Acoustic Feature Enhancement
[0052] The core of this step lies in adaptively adjusting the enhancement gain based on the local signal-to-noise ratio (SNR) of each sub-band, applying greater enhancement to low SNR sub-bands while maintaining the original characteristics of high SNR sub-bands. (Refer to...) Figure 2 The specific processing flow for adaptive acoustic feature enhancement is as follows:
[0053] First, the preprocessed log-Mel spectrum is decomposed into subbands along the frequency dimension. A Gammatone filter bank is then used for perceptual weighting of the acoustic signal. The Gammatone filter bank effectively simulates the propagation characteristics of acoustic signals in a pipe, exhibiting high frequency resolution in the low-frequency region and effectively capturing the fine features of leakage signals in the low-frequency band. The center frequencies of each filter are uniformly distributed along the logarithmic frequency axis, and the number of subbands is set according to the target frequency range. After processing by the filter bank, several subband signals are obtained.
[0054] Then, local signal-to-noise ratio (SNR) estimation is performed on each sub-band signal. A noise estimation algorithm based on minimum statistics is adopted, which tracks the background noise energy by searching for local minima in the time dimension of each sub-band signal to obtain the estimated background noise energy value of each sub-band. By comparing the sub-band energy with the noise energy estimate, the local SNR estimate of each sub-band is obtained.
[0055] Finally, the corresponding adaptive gain coefficients are calculated based on the local signal-to-noise ratio estimates for each sub-band. The gain coefficients are determined using the following nonlinear mapping function:
[0056]
[0057] in, For the first Adaptive gain coefficients for each subband For maximum gain, For the first Local signal-to-noise ratio estimates for each subband This is the lower limit threshold for the signal-to-noise ratio. This is the upper limit threshold for the signal-to-noise ratio. The shape parameter is used to control the rate of decrease in gain. The physical meaning of this mapping function is: to apply a larger gain in the lower signal-to-noise ratio region to improve the discernibility of weak leakage signals, and to maintain the original energy in the medium-to-high signal-to-noise ratio region to avoid introducing additional distortion;
[0058] The above parameters are determined in the following way:
[0059] A grid search method was employed on the validation set to optimize the maximum gain, lower signal-to-noise ratio (SNR) threshold, upper SNR threshold, and shape parameters, aiming to maximize the F1 score for leakage detection. The value ranges of each parameter can be reasonably set by those skilled in the art based on the actual SNR distribution of the pipeline acoustic environment, and effective values can be obtained without excessive experimentation.
[0060] The enhanced subband signal is the original signal multiplied by the corresponding gain coefficient. All the enhanced subband signals are synthesized and reconstructed in the frequency dimension to obtain the enhanced acoustic feature spectrum.
[0061] Step S3: Multi-scale attention feature extraction
[0062] This step utilizes multiple parallel convolutional branches of different scales to extract time-frequency domain features, and then performs adaptive weighted fusion through a channel attention mechanism. (Refer to...) Figure 3 The structure of the multi-scale attention feature extraction network is as follows:
[0063] The network input receives the enhanced acoustic feature spectrum, which is then processed through an initial convolutional layer for shallow feature extraction. The feature maps are then fed in parallel into three convolutional branches of different scales:
[0064] The first branch is a fine-grained feature extraction branch, which uses a depthwise separable convolution with a small kernel to focus on capturing local transient changes and subtle spectral texture features of the lost signal;
[0065] The second branch is a medium-granularity feature extraction branch, which uses standard convolution with medium kernel to capture the transitional features of the leakage signal in a medium time-frequency range.
[0066] The third branch is a coarse-grained feature extraction branch, which uses dilated convolution with a larger kernel. By dilated convolution with an expansion rate greater than 1, a larger receptive field is obtained, capturing the global structure and energy distribution features of the leaked signal over a wide time-frequency range.
[0067] The output feature maps of each convolutional branch are adaptively weighted along the channel dimension by the channel attention module. The channel attention module generates the attention weights for each channel using the following efficient implementation:
[0068]
[0069] in, For the input feature map, For global average pooling, each channel is compressed into a scalar descriptor; It is a one-dimensional convolution that enables cross-channel interaction between adjacent channels, and its kernel size is adaptively determined according to the total number of channels; The sigmoid function maps the output to the (0,1) interval. The weighted feature map is as follows. ,in This represents channel-by-channel multiplication, thereby enhancing important feature channels and suppressing irrelevant channels.
[0070] The feature maps after weighting the three branches are concatenated along the channel dimension, and then a transitional convolutional layer is used for feature fusion and channel number compression. Finally, a multi-scale fused feature vector is obtained by global average pooling.
[0071] Step S4: Leakage Status Determination
[0072] The multi-scale fused feature vector is input into the leak state classifier. The leak state classifier consists of multiple fully connected layers connected in series, with non-linear activation functions and Dropout regularization used between layers. The output layer uses the Softmax activation function to output the probability of a node being in a normal state or a leak state. The discrimination rule is: when the leak probability exceeds a preset threshold, the node is determined to have a leak, triggering the leak localization process.
[0073] Step S5: Leakage localization based on graph neural network
[0074] When any monitoring node in step S4 is determined to be in a leakage state, the leakage location process is initiated.
[0075] First, a graph structure data related to leakage events is constructed. Nodes identified as leaking and all nodes within their K-hop neighborhoods in the pipeline topology are used as graph nodes, with pipeline connections as edges. Node features are embedded vectors obtained by forward propagation of the corresponding node's enhanced acoustic feature spectrum through the feature extraction network in step S3.
[0076] Then, the graph structure data is input into a pre-trained graph neural network localization model. (See reference...) Figure 4 The localization model consists of multiple stacked graph convolutional layers. Each graph convolutional layer aggregates neighboring node information through a message passing mechanism. Its forward propagation process is as follows:
[0077]
[0078] in, To add the adjacency matrix after adding self-loops, This is the corresponding degree matrix. For the first The learnable weight matrix of the layer, This is a non-linear activation function. This operation effectively aggregates information about each node itself and its neighboring nodes, enabling the network to learn the spatial characteristics of leakage signal propagation in the pipeline network.
[0079] After L layers of graph convolution, the final embedding vector of each node is input into a coordinate regression head composed of fully connected layers, which outputs the normalized coordinate estimate of the leakage point corresponding to that node. The final leakage point location estimate is generated through a weighted aggregation strategy, where the weighting coefficients are determined based on the leakage probability value of each node and the estimated distance between the node and the leakage center, thereby improving the robustness of the localization.
[0080] Finally, the obtained normalized coordinates are converted into physical locations within the building space using a preset coordinate mapping relationship. This coordinate mapping relationship is established based on the spatial coordinates of each monitoring node in the pipeline topology data storage unit, ensuring that the output results can be directly used for maintenance personnel positioning.
[0081] Example 2: Model Training Method
[0082] This embodiment provides a training method for the deep learning model involved in the above detection and localization method. (Refer to...) Figure 5 The training process includes the following stages:
[0083] Data collection and labeling
[0084] On actual building water supply and drainage networks or scaled-down experimental platforms, multi-channel acoustic signal data under normal operating conditions and various leakage conditions were collected by creating leakage holes of different sizes at different locations in the pipeline, under different water supply pressures and flow rates. The collected acoustic signal data were manually or semi-automatically annotated, with annotation information including the leakage status of each node within each time window and the actual coordinates of the leakage point when the leakage event occurred. After annotation, the data was divided into training, validation, and test sets according to a preset ratio.
[0085] Parameter determination of the adaptive acoustic feature enhancement module
[0086] The adaptive acoustic feature enhancement module does not involve trainable neural network parameters. Specifically, the center frequency and bandwidth parameters of the Gammatone filter bank are determined during the model design phase based on the target frequency range and frequency resolution requirements; the threshold and shape parameters of the gain function are determined on the validation set through grid search or Bayesian optimization. The minimum statistical window length of the noise estimation algorithm is determined based on the degree of signal non-stationarity.
[0087] Joint training of multi-scale attention feature extraction network and classifier
[0088] An end-to-end supervised learning approach was used to jointly train a multi-scale attention feature extraction network and a missing state classifier. The standard cross-entropy loss function was employed for classification, measuring the difference between the predicted probability distribution and the true label. During training, the AdamW optimizer and cosine annealing learning rate scheduling strategy were used, along with weight decay and early stopping mechanisms to prevent overfitting. Training data augmentation was performed, including adding random Gaussian noise to simulate environments with different signal-to-noise ratios, random time shifts to enhance the model's time-shift invariance, and mixing acoustic signals from different operating conditions to improve the model's generalization ability.
[0089] Training a graph neural network localization model
[0090] After training the feature extraction network and classifier, their weights are fixed, and a graph neural network localization model is trained using labeled missing event data. The localization loss function employs a smoothed L1 loss, which represents mean squared error to provide a stable gradient when the error is small, and mean absolute error to reduce the impact of outliers when the error is large, thus ensuring the robustness of the training process. During training, data augmentation strategies such as randomly perturbing node features and randomly removing some nodes are also introduced to improve the model's adaptability to sensor failures and signal anomalies.
[0091] Lightweighting of knowledge distillation
[0092] To meet the stringent requirements of model inference speed and resource consumption in edge computing scenarios for building pipeline networks, a knowledge distillation strategy is employed to lightweight the multi-scale attention feature extraction network. Specifically, a fully trained large-scale feature extraction network is used as the teacher network, while a more compact, smaller-scale feature extraction network is designed as the student network. The student network's convolutional branches employ a design with fewer channels and shallower layers, and the number of subbands in the Gammatone filter bank can be adjusted to reduce the dimensionality of the input features during preprocessing. During training, three losses are jointly optimized: hard label classification loss, KL divergence loss between the output distributions of the teacher and student networks, and mean squared error loss between the intermediate feature maps of both networks. By appropriately setting the weights of each loss, the student network significantly reduces inference latency and memory consumption with a slight sacrifice in accuracy.
[0093] Example 3: Detection and Positioning System
[0094] Reference Figure 6 This embodiment provides a deep learning-based system for detecting and locating leaks in building water supply and drainage networks. This system can be deployed on edge computing nodes or remote monitoring servers within a building to execute the aforementioned detection and location methods. The system includes the following units:
[0095] The signal acquisition and preprocessing unit is used to acquire the raw acoustic signals collected by acoustic sensors deployed at each monitoring node of the building's water supply and drainage network, and to perform preprocessing operations such as bandpass filtering, frame windowing, and short-time Fourier transform. This unit maintains a connection with the acoustic sensors deployed at each monitoring node of the network via wired or wireless communication, and buffers and batch processes the acoustic signals at preset time intervals.
[0096] The acoustic feature enhancement unit embeds an adaptive acoustic feature enhancement module. This module implements subband decomposition based on the Gammatone filter bank, estimates the background noise energy of each subband through the minimum statistics noise estimation algorithm, calculates the local signal-to-noise ratio of each subband, generates adaptive gain coefficients based on a nonlinear mapping function, and finally outputs the enhanced acoustic feature spectrum through subband weighting and synthesis reconstruction.
[0097] The multi-scale feature extraction unit embeds a multi-scale attention feature extraction network. This network contains three parallel convolutional branches, each followed by a channel attention module. The outputs of the three branches are concatenated and fused to generate a multi-scale fused feature vector. This unit can load lightweight model weights trained by knowledge distillation, achieving low-latency inference while ensuring the quality of feature extraction.
[0098] The leakage detection and discrimination unit embeds a leakage state classifier, receives the feature vector output by the multi-scale feature extraction unit, outputs the leakage state probability through a fully connected layer and a Softmax activation function, and compares it with a preset threshold to generate a leakage / normal binary discrimination result.
[0099] The leakage location unit incorporates a graph neural network location model. When the leakage detection and discrimination unit triggers a leakage alarm, this unit retrieves the relevant area's pipeline topology from the pipeline topology data storage unit, constructs graph structure data, performs forward inference using the location model, outputs the estimated spatial coordinates of the leakage point, and converts them into physical coordinates.
[0100] The pipeline topology data storage unit is used to store the topology data of the building's water supply and drainage pipeline network, including the unique identifier of each monitoring node, spatial coordinates, pipeline connection relationships between nodes, pipeline attributes, and other information, which are then called by the leakage location unit when constructing the graph structure data and coordinate mapping.
[0101] The knowledge distillation training unit is used for lightweight compressed training of the network in the multi-scale feature extraction unit during the offline phase. This unit stores the model structure and weights of the teacher network and student network, supports joint optimization of soft label distillation loss and feature layer distillation loss, and outputs lightweight student network weights for online deployment.
[0102] The data flow between the units is as follows: the output of the signal acquisition and preprocessing unit is connected to the input of the acoustic feature enhancement unit; the output of the acoustic feature enhancement unit is connected to the input of the multi-scale feature extraction unit; the output of the multi-scale feature extraction unit is connected to the input of the leakage detection and discrimination unit; the output of the leakage detection and discrimination unit serves as the trigger signal for the leakage location unit; the pipeline topology data storage unit provides topology data support for the leakage location unit; and the knowledge distillation training unit provides lightweight weight updates for the multi-scale feature extraction unit during the offline phase.
[0103] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0104] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for detecting and locating leakage in building water supply and drainage pipe networks based on deep learning, characterized in that, Includes the following steps: S1. Acquire the raw acoustic signals collected by acoustic sensors deployed at each monitoring node of the building's water supply and drainage network, and preprocess the raw acoustic signals to obtain preprocessed acoustic signals. The preprocessing includes at least bandpass filtering, frame windowing, and short-time Fourier transform, and the amplitude spectrum after the short-time Fourier transform is converted into a log-Mel spectrum through a Mel filter bank; S2. Input the preprocessed acoustic signal into the pre-constructed adaptive acoustic feature enhancement module, perform sub-band decomposition on the acoustic signal, calculate the local signal-to-noise ratio estimate of each sub-band, generate sub-band adaptive gain coefficients based on the local signal-to-noise ratio, apply enhancement to the low signal-to-noise ratio sub-bands, and maintain the original energy level of the high signal-to-noise ratio sub-bands to obtain the enhanced acoustic feature spectrum. S3. Input the enhanced acoustic feature spectrum into a pre-constructed multi-scale attention feature extraction network, and extract time-frequency domain features by using multiple parallel convolutional branches of different scales. After the features of each branch are weighted by the channel attention mechanism, they are spliced and fused along the channel dimension to form a multi-scale fused feature vector. S4. Input the multi-scale fused feature vector into the leakage status classifier and output the leakage status discrimination result of each monitoring node. The discrimination result includes leakage status and non-leakage status. S5. When any monitoring node is determined to be in a leaking state, the enhanced acoustic feature spectra of all nodes associated with that node are processed by the multi-scale attention feature extraction network to obtain the embedded vectors, which are then organized into graph structure data according to the pipeline network topology. This data is then input into the pre-built graph neural network localization model, and the estimated spatial coordinates of the leaking point in the pipeline network topology coordinate system are output.
2. The method according to claim 1, characterized in that, In step S2, the subband decomposition adopts a subband decomposition method based on Gammatone filter banks; the local signal-to-noise ratio estimate is obtained by comparing the ratio of subband energy to background noise energy estimate, and the background noise energy estimate is obtained by a noise estimation algorithm based on minimum statistics.
3. The method according to claim 1, characterized in that, In step S2, the subband adaptive gain coefficient is calculated based on the local signal-to-noise ratio estimate through a nonlinear mapping function. The nonlinear mapping function applies a large gain in the low signal-to-noise ratio region and approaches unity gain in the high signal-to-noise ratio region.
4. The method according to claim 3, characterized in that, The nonlinear mapping function is a piecewise function. When the local signal-to-noise ratio estimate is lower than the preset upper limit threshold, the gain coefficient increases monotonically from the maximum gain value as the signal-to-noise ratio decreases. When the local signal-to-noise ratio estimate is higher than the upper limit threshold, the gain coefficient remains at unity gain.
5. The method according to claim 1, characterized in that, In step S3, the multiple convolutional branches of different scales include: a fine-grained feature extraction branch using a first convolutional kernel size, a medium-grained feature extraction branch using a second convolutional kernel size, and a coarse-grained feature extraction branch using a third convolutional kernel size, wherein the first convolutional kernel size is smaller than the second convolutional kernel size, and the second convolutional kernel size is smaller than the third convolutional kernel size; each convolutional branch is followed by a channel attention module.
6. The method according to claim 5, characterized in that, The channel attention module generates channel attention weights in the following manner: global average pooling is performed on the input feature map to obtain channel descriptors; one-dimensional convolution is performed on the channel descriptors to achieve cross-channel interaction; non-linear activation is applied to the one-dimensional convolution result to obtain an attention weight vector; and the attention weight vector is multiplied with the input feature map channel by channel.
7. The method according to claim 1, characterized in that, In step S5, the graph neural network localization model is composed of multiple stacked graph convolutional layers. Each graph convolutional layer is multiplied by the node feature matrix after normalization by adding a self-loop adjacency matrix and degree matrix. After learningable weight matrix transformation and nonlinear activation, the adjacency node information is aggregated. After multiple graph convolutions, the embedding vector of each node is input into the coordinate regression head to output normalized coordinates.
8. The method according to claim 1, characterized in that, Step S5 further includes: normalizing the coordinates of the leakage points output by the graph neural network positioning model and converting them into physical locations in the building space through a preset coordinate mapping relationship; the coordinate mapping relationship is determined based on the known spatial coordinates of each monitoring node in the pipeline topology data.
9. The method according to claim 1, characterized in that, The training of the multi-scale attention feature extraction network adopts a knowledge distillation strategy: the multi-scale attention feature extraction network is used as the student network, and a pre-trained isomorphic multi-scale attention feature extraction network with more channels or deeper layers is used as the teacher network. The student network is trained by joint optimization of soft label distillation loss, feature layer distillation loss and hard label classification loss.
10. A deep learning-based system for detecting and locating leaks in building water supply and drainage networks, characterized in that, include: The signal acquisition and preprocessing unit is used to acquire the raw acoustic signals collected by acoustic sensors deployed at each monitoring node of the building's water supply and drainage network, and to preprocess the raw acoustic signals. The acoustic feature enhancement unit, which embeds an adaptive acoustic feature enhancement module, is used to perform sub-band adaptive enhancement processing on the preprocessed acoustic signal; A multi-scale feature extraction unit, which embeds a multi-scale attention feature extraction network, is used to extract multi-scale fused feature vectors from the enhanced acoustic feature spectrum. The leakage detection and discrimination unit, which embeds a leakage state classifier, is used to output the leakage state discrimination result of each monitoring node based on the multi-scale fused feature vector; the leakage localization unit, which embeds a graph neural network localization model, is used to output the spatial coordinate estimate of the leakage point when leakage is detected. The pipeline topology data storage unit is used to store the topology data of the building's water supply and drainage pipeline network, including the spatial coordinates of each monitoring node, the pipeline connection relationship between nodes, and pipeline attribute information.