A method for deploying leak location sensors in water supply networks based on graph convolutional networks
By combining graphical analysis and topological information of water supply distribution networks, using graph convolution networks and K-means clustering algorithms to optimize sensor layout, the problem of inaccurate sensor layout in the existing methods is solved, and more efficient leakage detection and water resource management are achieved.
Patent Information
- Application Number
- CN202111550865.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2041-12-17
AI Technical Summary
The existing leak detection and sensor arrangement methods in the water supply distribution network lack effective graphic analysis and topological information, resulting in inaccurate sensor arrangement and affecting the effect of leak detection.
Using a graph convolution network-based method, graph analysis is combined with topological structure information of water supply distribution network, pseudo-label is constructed through the K-means clustering algorithm, the monitoring area is divided using the graph convolution network, and the optimal sensor arrangement node is selected through the cross-correlation function algorithm.
It improves the accuracy and effectiveness of sensor layout, enables more accurate positioning of leakage points, reduces water resource loss, and reduces operating costs.
Smart Images

Figure CN114245337B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water supply distribution networks, and more specifically, to a method for arranging leakage locating sensors for a water supply network based on a graph convolutional network. Background Art
[0002] As a basic civil utility system, the water supply distribution network has many factors that affect its service quality, one of the most important factors is leakage. However, with the continuous growth of the world's population and the impact of some natural disasters, many countries are facing a serious shortage of water resources. In addition, there are many important factors that exacerbate the shortage of water resources, such as the aging of water supply pipelines, incomplete construction facilities, and the lack of regular maintenance and management measures. As a result, the amount of water lost in the water supply distribution network is as high as 30% of the total water consumption. In order to reduce the loss of water resources and reduce the expensive operating costs of water companies, it is crucial to develop effective anomaly detection methods.
[0003] At present, some methods of leak detection and location are based on data collected by sensors installed in the water supply network. Therefore, the research field of optimal sensor layout for leak detection in water supply networks is very worthy of study, and its purpose is to effectively control, efficiently manage and continuously maintain the water supply network. Therefore, leak detection and optimal sensor layout should be studied together. The optimal sensor layout provides indispensable data for leak detection, and the results of leak detection promote the continuous optimization of the optimal sensor layout.
[0004] In reality, the water supply and distribution network is very large, requiring a lot of operating funds and maintenance costs every year. Therefore, it is particularly important to deploy a limited number of data acquisition sensors in a very large water supply and distribution network without affecting the monitoring of the entire water supply and distribution network.
[0005] For a water supply and distribution network with a known leak location, the leak location will be focused on, which is called supervised conditions. In general, leaks in water supply and distribution networks are unknown, that is, sensor locations are arranged for leak detection under unsupervised conditions. Moreover, for some methods, some nodes in the complete water supply and distribution network are often discarded. For example, in existing research, nodes near water tanks and water pumps are not considered. In reality, every node in the water supply and distribution network needs to be taken into account. In addition, there is a lack of research on the combination of graphical analysis and water supply and distribution network topology information in the sensor optimization layout method for leak detection. Summary of the invention
[0006] The purpose of the present invention is to design and develop a method for arranging water supply network leakage positioning sensors based on graph convolutional networks, which combines graph analysis with water supply distribution network topology information to solve the problem of optimal sensor layout for leak detection, and combines the impact of leakage events at each node in the actual water supply distribution network to improve the accuracy of sensor layout.
[0007] The technical solution provided by the present invention is:
[0008] A method for arranging leakage positioning sensors in a water supply network based on a graph convolutional network comprises the following steps:
[0009] Step 1: Collect three-dimensional data to create a data set of the water supply network;
[0010] Step 2: Cluster the data into K categories using the K-means clustering algorithm, select the sample points of each category that are closest to the cluster center of the category as nodes for constructing pseudo labels and label them from 0 to K;
[0011] Step 3: Divide all sample points in the data set into monitoring areas through a graph convolutional network;
[0012] Step 4: Use the cross-correlation function algorithm to traverse the sample points in each monitoring area until all sample points have been traversed once, and select a sample point with the largest sum of correlations with other sample points in the monitoring area as the optimal sensor layout node.
[0013] Preferably, the three-dimensional data includes:
[0014] The first dimension of data is the value of the pressure difference at each node when the leakage event and leakage simulation time point of the node are determined;
[0015] The second dimension of data is the change of the pressure difference value of each node with the start and end time of the leakage simulation in the case of a leakage event at a specified node;
[0016] The third dimension of data is the change in the value of the pressure difference corresponding to each node at different leakage simulation times in the case of leakage events at different nodes.
[0017] Preferably, the step 1 further comprises performing noise processing and standardization processing on the data set in sequence, wherein the noise processing is:
[0018] The data set is divided into a training data set and a test data set. Noise is randomly added to the training data set with a probability of 50%, and noise is randomly added to the test data set with a probability of 100%. The signal-to-noise ratio of the noise is 30db to 40db.
[0019] Preferably, the standardization process satisfies:
[0020]
[0021] In the formula, is the dataset after adding noise and standardization, S is the original dataset without processing, μ S is the mean of the original data set, σ S is the standard deviation of the original data set, σ n is the mean standard deviation of the noise.
[0022] Preferably, the K-means clustering algorithm in step 2 specifically includes the following steps:
[0023] Step 1: randomly divide the data set into K categories according to the number of arranged positioning sensors, randomly select an initialization area, and calculate the cluster center of each category;
[0024] Wherein, the cluster center satisfies:
[0025]
[0026] In the formula, K i is the number of sample points contained in the i-th class, w ij is the jth sample point in the i-th class, is the average value of the cluster center of the i-th category;
[0027] Step 2: Calculate the distances from all sample points to the K cluster centers respectively, and classify the sample points into the cluster center category with the smallest distance;
[0028] Step 3: When the distance between the sample point and the cluster center is not the minimum value, the sample point is moved to the cluster center category with the minimum distance, and the cluster centers are recalculated for the class from which the sample point moves out and the class to which the sample point moves in;
[0029] Step 4: When the square error reaches the minimum value, stop clustering;
[0030] Wherein, the square error is:
[0031]
[0032] In the formula, {C1,C2,…,C K} is a data set divided into K categories, K is the number of classes, and i is the number of class objects.
[0033] Preferably, the graph convolutional network satisfies:
[0034]
[0035] In the formula, g θ(Λ) is the eigenvalue function of the Laplace matrix, Λ is the diagonal matrix of eigenvalues, x is the vector representation of the node attributes in the graph, θ is the Chebyshev coefficient, is the degree matrix, is a self-circular adjacency matrix;
[0036] Wherein, the degree matrix satisfies:
[0037]
[0038] In the formula, is the self-loop matrix of the current node η;
[0039] The self-circulating adjacency matrix satisfies:
[0040]
[0041] In the formula, A is the adjacency matrix, I N is the identity matrix.
[0042] Preferably, the cross-correlation function algorithm in step 4 satisfies:
[0043]
[0044] In the formula, is the sample cross-covariance function, and s is the sample standard deviation of the process.
[0045] Preferably, it also includes:
[0046] Step 5: Evaluate the optimal sensor arrangement nodes using a bidirectional long short-term memory network;
[0047] The evaluation includes precision, average topological distance, and root mean square error of average topological distance;
[0048] The accuracy meets:
[0049]
[0050] Where ACC is the accuracy, Γ a,a is the number of times node a is correctly predicted to leak, N is the number of nodes in the water supply network, Γ a,j is the number of times a leak in node a is identified as a leak in node j;
[0051] The average topological distance satisfies:
[0052]
[0053] In the formula, ATD is the average topological distance, D a,j is the distance between node a and node j;
[0054] The root mean square error of the average topological distance satisfies:
[0055]
[0056] Where RMSE is the root mean square error of the average topological distance.
[0057] Preferably, the storage unit of the bidirectional long short-term memory network is composed of an input gate, a forget gate and an output gate, and specifically includes the following process:
[0058] The operation result of the previous output and the current input is passed to the next storage unit through the forget gate, and the forget gate determines whether the previous information is retained or cleared:
[0059] f t =σ(W f ·(h t-1 ,x t )+b f );
[0060] In the formula, f t is the forget gate vector, σ(·) is the sigmoid activation function, W f is the weight matrix of the forget gate, h t-1 is the previous output, x t is the current input, b f is the offset value of the forget gate;
[0061] The input gate vector determines whether the temporary new state updates the current cell state:
[0062] i t =σ(W i ·(h t-1 ,x t )+b i );
[0063]
[0064] In the formula, i t is the input gate vector, W i is the weight matrix of the input gate, b i is the offset value of the input gate, is a temporary new state, W c is the weight matrix modified by the unit state, b c is the offset value modified by the cell state, C t is the current unit state, tanh(·) means through the tanh activation function;
[0065] The current output satisfies:
[0066] ot =σ(W o ·(h t-1 ,x t )+b o );
[0067] h t =tanh(C t )×o t ;
[0068] In the formula, o t is the output gate vector, h t is the current output, W o represents the weight matrix of the output gate, b o Indicates the offset value of the output gate.
[0069] The beneficial effects of the present invention are:
[0070] (1) The present invention designs and develops a method for arranging leak location sensors for water supply pipe networks based on graph convolutional networks. It combines graph analysis with water supply distribution network topology information for the first time to solve the problem of optimizing the arrangement of sensors for leak detection, and effectively considers the impact of leak events at each node in the actual water supply distribution network.
[0071] (2) The present invention designs and develops a method for arranging sensors for leak location in a water supply network based on a graph convolutional network. The method converts the sensor optimization arrangement problem into a semi-supervised graph convolutional network node classification problem and a maximum correlation problem between nodes. By using an unsupervised K-Means clustering algorithm, pseudo-label nodes are obtained based on the criterion of minimizing the sum of squared errors between each sample and each center. Only one pseudo-label node is obtained for each type of sample. After training a semi-supervised graph convolutional network that combines graph analysis with network topology, the water supply distribution network is divided into several areas. The most representative nodes in each area are selected by the maximum correlation of the nodes in the area. Sensors are arranged on the nodes to monitor the entire water supply distribution network, thereby improving the effectiveness and superiority of the sensor arrangement. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 This is a flow chart of the method for arranging water supply network leakage locating sensors based on graph convolutional networks according to the present invention.
[0073] Figure 2 A schematic diagram of the format of the data set described in the present invention.
[0074] Figure 3 It is a schematic diagram of the structure of the bidirectional long short-term memory network described in the present invention.
[0075] Figure 4A schematic diagram of the structure of a storage unit of the bidirectional long short-term memory network described in the present invention.
[0076] Figure 5 This is a schematic diagram of the Anytown network structure described in the present invention.
[0077] Figure 6 It is a bar chart diagram of the hourly node demand coefficients of all nodes in Anytown described in the present invention.
[0078] Figure 7 Schematic diagram of the results of k-means clustering and pseudo-labeled nodes in Anytown described in the present invention.
[0079] Figure 8 This is a schematic diagram of the classification results of Anytown by the graph convolutional network described in the present invention.
[0080] Fig. 9 This is a schematic diagram of monitoring nodes selected in Anytown by the proposed method 2 according to the present invention.
[0081] Fig.10 This is a schematic diagram of monitoring nodes selected by method 1 in Anytown according to the present invention.
[0082] Fig.11 This is a schematic diagram of the network layout of the complex network Net3 described in the present invention.
[0083] Fig.12 Schematic diagram of the hourly node demand coefficients of all nodes in Net3 of the present invention.
[0084] Fig.13 Schematic diagram of the results of k-means clustering and pseudo-labeling nodes in Net3 described in the present invention.
[0085] Fig.14 This is a schematic diagram of the classification results of the graph convolutional network of Net3 described in the present invention.
[0086] Fig.15 Schematic diagram of monitoring nodes selected by the method proposed by the present invention in Net3 of the present invention.
[0087] Fig.16 Schematic diagram of monitoring nodes selected for the new semi-supervised method in Net3 described in the present invention.
[0088] Fig.17 Schematic diagram of monitoring nodes selected by the traditional semi-supervised method in Net3 described in the present invention. DETAILED DESCRIPTION
[0089] The present invention is further described in detail below so that those skilled in the art can implement it according to the description.
[0090] like Figure 1 As shown, the present invention provides a method for arranging water supply network leakage positioning sensors based on graph convolutional networks, which converts the water supply network sensor optimization arrangement problem under unsupervised conditions into a region division and node selection problem under semi-supervised conditions. Assuming that only three sensors are arranged in the water supply network, the method includes the following steps:
[0091] Step 1: Create a dataset:
[0092] 1. Generation of data sets:
[0093] If you want to obtain the real pipeline leakage data of a city's water supply network, you need to artificially destroy the pipeline nodes in certain areas of the water supply network to obtain the data. Obviously, this practice has seriously affected the personal lives of the entire city's population. Therefore, the present invention uses a hydraulic simulator to obtain complete leakage data for the city. However, the EPANET python wrapper WNTR version 0.3.1 will be used as a hydraulic simulator toolkit for obtaining complete leakage data in the present invention. WNTR contains two simulators, EpanetSimulator and WNTRSimulator. The present invention uses the WNTRSimulator simulator. The simulator evaluates specific water supply network leakage scenarios by establishing a transient model. Since the simulator adds leakage to the water supply network by establishing a transient model, there is no need to adjust the transmitter coefficient to control the leakage size. The WNTRSimulator simulator models the network leakage, outputs the normal pressure P through the normal demand d of the water supply pipeline, and generates a leakage demand d after adding a leakage point in the water supply pipeline. l , thus generating abnormal pressure -P l , the pressure difference value ΔP is generated by adding the normal pressure and the abnormal pressure;
[0094] Among them, the mass flow rate of fluid passing through the hole in the water supply network is expressed as follows:
[0095]
[0096] Among them, d l is the leakage demand, C d is the flow coefficient, α is an index related to the leakage characteristics, that is, the flow-related index, p is the water pressure in the water supply pipe, ρ is the density of the fluid, and A is the area of the leakage mesh.
[0097] The area of the leakage mesh satisfies:
[0098]
[0099] Where D is the diameter of the leakage mesh.
[0100] Assuming that the water flow is turbulent and there is a large amount of leakage in the steel pipe, take C d =0.75 and α=0.5, further simplify the above formula and define the pressure head as follows:
[0101]
[0102] Among them, H is the pressure head, p is the water pressure in the pipe, ρ is the density of the fluid, and g is the acceleration due to gravity.
[0103] The above two formulas can be used to obtain the expression of leakage flow, which is expressed as follows:
[0104]
[0105] The establishment of the dataset using the transient model needs to be completed in two steps, including setting the simulated leakage location, leakage simulation time, leakage area, and the impact of leakage on pressure data through the established transient model. If you want to correctly simulate the leakage location, you first need to find the pipeline for simulating leakage in the water supply network; then use the WNTR toolkit to obtain the start and end nodes of the pipeline, find the leakage location to be simulated on the pipeline according to the set leakage location and add nodes. These nodes added to the water supply pipeline are connected to the network with new pipelines. After determining the location of the simulated leakage, the size of the leakage is controlled by setting the size of the simulated leakage area. After determining the leakage location and leakage size, using the WNTR toolkit to set the node leakage start time and end time can effectively control the node simulation leakage time; finally, simulate the node leakage through the established transient model and run the simulation.
[0106] In order to make the data generated by the simulated leakage more similar to the data under the actual pipeline leakage, and to eliminate the adverse effects of the different placement positions of the sensors collecting data on data collection, the data needs to be further processed, including adding noise and standardization.
[0107] The data set is divided into a training data set and a test data set. In order to simulate the actual leakage scenario, noise is randomly added to the training data set with a probability of 50%, and noise is randomly added to the test data set with a probability of 100%. Both the training data set and the test data set add noise with a signal-to-noise ratio of 30db to 40db.
[0108] After adding noise, the training data set and the test data set are standardized in the same way. The standardization is expressed as follows:
[0109]
[0110] In the formula, is the dataset after adding noise and standardization, S is the original dataset without processing, μ S is the mean of the original data set, σ S is the standard deviation of the original data set, σ n is the mean standard deviation of the noise.
[0111] like Figure 2 As shown, the established data sets (including training set, validation set and test set) are all generated by the above method, and the format of the generated data sets is consistent, which is a three-dimensional data, and each dimension represents a different meaning:
[0112] The first dimension of data represents the value of the pressure difference at each node when the leakage event and leakage simulation time point of the node are determined;
[0113] The second dimension of data indicates how the pressure difference value of each node changes with the start and end time of the leakage simulation in the case of a leakage event at a specified node;
[0114] The third dimension data represents the change in the pressure difference value corresponding to each node under leakage events at different nodes and at different leakage simulation times.
[0115] The size of the data set is determined by the configuration of the water supply network itself (number of nodes, number of pipes), the time of simulated leakage and the size of the simulated leakage. When generating the data set, all nodes with water supply demand in a water supply network are traversed, the start and end time points of the simulated leakage and the leakage area of the simulated leakage are set, and the pressure difference values of each node in the network are collected until a simulated leakage scenario of the complete network is generated and saved in the data set.
[0116] Step 2: Create pseudo labels:
[0117] In real life, when a leak occurs in a real water supply network, it is impossible to know in advance where the leak occurs, that is, for the network, its leakage label is unknown. In the present invention, it is assumed that a leak occurs in the simulated actual network and it is also unknown where the leak occurs, that is, the data set has no leakage label. However, in order to complete the optimal sensor layout task in the water supply network, the data set must have at least one label. Therefore, the K-means clustering algorithm is used to cluster all nodes in a water supply network (except water tanks, water pumps and reservoirs) into K categories (K represents the number of sensors arranged), and the nodes closest to the cluster center of each category are selected as nodes for constructing pseudo labels and labeled from 0 to K. Then, the unsupervised problem is converted into a semi-supervised problem for further processing.
[0118] K-means clustering algorithm is an unsupervised clustering algorithm with good clustering effect and simple implementation, so it is widely used. This method is based on optimizing the clustering criterion function F. The function value generally depends on the database {C1, C2, ..., C k}, the sum of the distances between each element and its nearest cluster center is used as the clustering criterion to find the local optimal solution. This criterion is sometimes called the square error criterion, so it can be expressed as follows:
[0119]
[0120] In the formula, {C1,C2,…,C K} is a data set divided into K categories, K is the number of classes, K i is the number of sample points contained in the i-th class, i is the number of class objects, w ij is the jth sample point in the i-th class, w i is the centroid of the i-th class, defined as:
[0121]
[0122] In the formula, is the average value of the cluster center of the i-th category;
[0123] The steps of K-means clustering algorithm are as follows:
[0124] Step 1: In the K categories {C1, C2, ..., C k}In this step, an initialization region is randomly selected and the cluster center (centroid) of each class is calculated;
[0125] Step 2: For any sample point, calculate its distance to the K cluster centers and classify the sample point into the cluster center category with the smallest distance.
[0126] Step 3: Transform the sample w i Reassign to its nearest cluster center, for all j = 1, 2, ..., K, j ≠ s, if Then i ∈C s From C s Move to C t , and then recalculate the cluster center C s and C t ;
[0127] Step 4: Continue until the squared error cannot be reduced further, then stop; otherwise, return to step 3.
[0128] Step 3: Division of monitoring areas:
[0129] The pressure difference between adjacent nodes in the water supply network is generally similar. As a feature extractor of the graph network, the graph convolutional network can well extract the features between the nodes in the water supply network and classify these nodes (that is, classify all sample points into K categories). The pseudo-labeled data set is input into the two-layer graph convolutional network for appropriate training, and the output results are used as the basis for the division of the water supply network monitoring area.
[0130] Convolutional neural networks (CNNs) are used to process regular networks. However, in most cases, a lot of data are presented in irregular forms, such as social networks. Therefore, a graph convolutional network (GCN) is proposed. The graph data in the water supply network node classification task studied in this invention is also presented in irregular forms.
[0131] There are two methods for graph convolutional networks: spectral method and spatial method. The basic idea of spectral method-based graph convolutional network is to realize graph convolution through filters from the perspective of graph signal processing; the graph convolutional network based on spatial method uses the direct relationship between spatial nodes to act on the graph.
[0132] The graph convolutional network operation based on the spectral method is expressed as follows:
[0133] g θ (Λ)*x=Ug θ (Λ)U T x;
[0134] Where x is the vector representation of the node attributes in the graph, and U is the normalized graph Laplace L = UΛU T is the eigenvector matrix of , Λ is the diagonal matrix of eigenvalues λ, U T x is the Fourier transform of the graph of x, g θ (Λ) is a function of the eigenvalues of L.
[0135] For large graphs, the multiplication complexity of the eigenvalue function and the eigenvector matrix is very high, about ο(N 2 ) times, so in order to simplify the calculation, g θ (Λ) can be expressed by K-order Chebyshev polynomials The truncated expansion approximation of λ max is the maximum eigenvalue of L, I N is the unit matrix, that is where θ′∈R K represents the K-order Chebyshev coefficient vector, so the graph convolution network operation can be restated as;
[0136]
[0137] in,
[0138] Because this expression is a K-order polynomial, it is a local optimization that depends on the K-order neighborhood of the central node. According to the above formula, it is linear in the number of edges. On this basis, let K = 1 and λ max =2 further simplifies the graph convolutional network model and proposes a fast approximate expression:
[0139]
[0140] In the formula, g θ (Λ) is the eigenvalue function of the Laplace matrix, Λ is the diagonal matrix of eigenvalues, x is the vector representation of the node attributes in the graph, θ is the Chebyshev coefficient, is the degree matrix, is a self-circular adjacency matrix;
[0141] Wherein, the degree matrix satisfies:
[0142]
[0143] In the formula, is the self-loop matrix of the current node η;
[0144] The self-circulating adjacency matrix satisfies:
[0145]
[0146] In the formula, A is the adjacency matrix, I N is the identity matrix.
[0147] The above formula is applied to the graph G data with attribute matrix X to perform multi-layer graph convolution operations and propagate layer by layer.
[0148] Step 4: Select representative nodes:
[0149] After the water supply network monitoring area is divided, the nodes in each area may become the most representative nodes in the area. The nodes in each area are traversed through the algorithm of the cross-correlation function until all the nodes in the area have been traversed once, and finally the most representative node in the area is selected. The above traversal is performed for each area separately until all areas are traversed. The most representative nodes selected in each area are used as nodes for arranging sensors, that is, these most representative nodes selected are the nodes for optimal sensor arrangement.
[0150] Among them, the most representative node is the sample point with the largest sum of correlations with other sample points in the monitoring area where the node is located.
[0151] The cross-correlation function can reflect the degree of similarity between two functions or data sets at different relative positions, that is, the measure of similarity. The cross-correlation function is calculated differently for continuous functions and discrete functions.
[0152] Assuming f and g are two continuous functions, under the condition of a given time lag τ, the cross-correlation function is defined as follows:
[0153]
[0154] Among them, f * (t) is the complex conjugate function of f(t);
[0155] Assuming f and g are two discrete functions, under the condition of a given time lag τ, the cross-correlation function is defined as follows:
[0156]
[0157] Therefore, it can be seen from the above two formulas that the cross-correlation function can measure the similarity between the functions f(t) and g(t+τ).
[0158] Assume (X t ,Y t ) represents a pair of stationary time series, then the cross-correlation function of these two stationary time series is as follows:
[0159]
[0160] Among them, γ X,Y (τ) = E(X t -μ X )(Y t+τ -μ Y ) is the cross-covariance function, μ is the mean of the stationary time series, and σ is the standard deviation of the stationary time series.
[0161] Assume (X t ,Y t ) represents two stationary processes, and the cross-correlation function of these two stationary processes is as follows:
[0162]
[0163] in, is the sample cross-covariance function, and s is the sample standard deviation of the process.
[0164] The nodes in the data set of the present invention are in a random and stable process.
[0165] Step 5: Result evaluation:
[0166] The present invention uses a simple BiLSTM neural network to complete the task of locating water supply network leaks. The trained classifier needs an indicator to measure the quality of its training, so the confusion matrix is used as the result obtained by the classifier to verify the test data set. The confusion matrix is usually a square matrix with the same number of rows and columns, which is equal to the number of nodes in the network (nodes used for leakage simulation). Ideally, the confusion matrix should be a diagonal matrix, that is, the predicted value and the true value are consistent, where each coefficient Γ on the diagonal is a,a Indicates the number of times node a is correctly predicted to leak. In fact, non-zero values appear on the off-diagonal line of the confusion matrix, that is, the predicted value is different from the true value, and a prediction error occurs, where Γ a,j represents the number of times the leak in node a is identified as a leak in node j. As can be seen from the above, It represents the number of times node a is mispredicted, where N represents the number of nodes in the network. Therefore, the accuracy of the classifier ACC is used as an important indicator for result evaluation, and its expression is as follows:
[0167]
[0168] As can be seen from the above, it is far from enough to use only accuracy as an evaluation indicator, because accuracy is used to judge the classification effect of the classifier, but cannot explain the quality of leak location. Therefore, the average topological distance (ATD) is used as the second evaluation indicator. ATD refers to the average topological distance between the real leak node and the predicted leak node. Its expression is as follows:
[0169]
[0170] Among them, D a,j is the distance between node a and node j, which is represented by the number of connecting pipes between the two nodes in the network.
[0171] Usually, the important indicator for evaluating the error of experimental results is the root mean square error. The root mean square error of the average topological distance is defined as follows:
[0172]
[0173] This indicator can indicate the error size of the average topological distance between the real leakage node and the predicted leakage node, and further explain the quality of the prediction result, which is of great significance.
[0174] Recurrent Neural Network (RNN) is a network with data time as the background. However, this structure has problems such as gradient vanishing or gradient exploding. Therefore, the Long Short-Term Memory (LSTM) network solves the problem of RNN gradient vanishing or gradient exploding by adding a gate mechanism in each unit. The LSTM network can memorize the previous state information and has the ability to predict sequence data. However, the LSTM network can only memorize the previous state information, but not the subsequent state information. In, a bidirectional long short-term memory (BiLSTM) network is proposed to solve this problem. The structure of the BiLSTM network is as follows Figure 3 As shown. The output of the current state is determined by the past state and the future state. For example, the output of the last layer unit is y n is a function of the output of the forward layer and the output of the backward layer. The output of the forward layer is the sum of the current input layer x n , the previous forward layer output And the state of the previous unit Similarly, the output of the backward layer is determined by the current input layer x n , the future backward layer output And the next layer unit state Determined.
[0175] Each storage unit is the core part of the BiLSTM network, where a storage unit structure of BiLSTM is as follows: Figure 4 As shown. Each storage unit is mainly composed of three control gates, including the input gate (middle dotted part), the forget gate (left dotted part) and the output gate (right dotted part). The operations in each control gate mainly include addition, multiplication, sigmoid and tanh. Among them, sigmoid and tanh are two different activation functions, which are expressed as follows:
[0176]
[0177] The functional implementation of each storage unit is as follows:
[0178] First, the previous output h is forgotten by the forget gate t-1 and the current input x t The result of the operation is passed to the next storage unit, and the forget gate determines whether the previous information is retained or cleared:
[0179] f t =σ(W f ·(h t-1 ,x t )+b f );
[0180] In the formula, f tis the forget gate vector, σ(·) is the sigmoid activation function, W f is the weight matrix of the forget gate, h t-1 is the previous output, x t is the current input, b f is the offset value of the forget gate;
[0181] Secondly, by inputting the gate vector i t Decide on a temporary new state Whether to change the current unit state C t To update:
[0182] i t =σ(W i ·(h t-1 ,x t )+b i );
[0183]
[0184]
[0185] In the formula, i t is the input gate vector, W i is the weight matrix of the input gate, b i is the offset value of the input gate, is a temporary new state, W c is the weight matrix modified by the unit state, b c is the offset value modified by the cell state, C t is the current unit state, tanh(·) means through the tanh activation function;
[0186] Finally, the current output h t Through the output gate vector o t and the current cell state C t Determined:
[0187] o t =σ(W o ·(h t-1 ,x t )+b o );
[0188] h t =tanh(C t )×o t ;
[0189] In the formula, o t is the output gate vector, h t is the current output, W o represents the weight matrix of the output gate, b oIndicates the offset value of the output gate.
[0190] The present invention provides two embodiments, and all experiments are run on a desktop computer using INTEL CORE i5-10400F CPU @ 2.90 [GHz], 8 [GB] of RAM memory as well as a Windows 10 Home 64bits OS. At the same time, Python 3.8 software is applied.
[0191] Example 1
[0192] like Figure 5 As shown in Figure 1, the network consists of 16 nodes, 40 pipes, 1 water pump, 2 storage tanks, and 1 reservoir. Table 1 gives the node properties of the Anytown network; the pipe characteristics are listed in Table 2; the pipe diameter is between 200 mm and 400 mm, and the average daily demand is about 457.08 L / s. Different nodes are assigned different daily demand patterns. The hourly node demand coefficients for all nodes in Anytown are shown in Table 1. Figure 6 shown.
[0193] Table 1 Node attributes of Anytown network
[0194]
[0195]
[0196] Table 2 Pipeline characteristics of Anytown network
[0197]
[0198]
[0199] Although there is no actual standard for water supply network leakage at present, it must be satisfied that the abnormal change of node pressure value caused by leakage is different from the normal pressure value of the node when there is no leakage. In this case, the amount of water flowing to the surface for simulation is set to 7.88% of the daily average demand, that is, the leakage of all nodes in the water supply network is 36 liters / second. The time sample of each leakage event (leakage at each node) is 9 hours. The input of the present invention is a pressure difference matrix of size 19*171, where 19 represents the number of leakage events and 171 represents the product of the time sample of each leakage event and the number of nodes. Subsequently, the WDN (water supply network) is divided into several areas according to the K-Means clustering algorithm and the cluster center position of each area is calculated. As the K value increases, the number of clusters increases from 1 to 4. Regardless of how many areas Anytown is divided into, the clustering results can be easily obtained. The Euclidean distance method is then used to find the node closest to the cluster center position in each divided area to construct a pseudo-label. In the present invention, Figure 5 The Anytown network in is divided into two regions and a pseudo-label is constructed in each region (see Figure 7 ). Then the pseudo-labeled data is input into the 2-layer graph convolutional neural network, and the training results are as follows: Figure 8 As shown in the figure. Anytown is divided into two areas, consisting of 9 and 10 nodes. Each area consists of several adjacent nodes with similar pressure change patterns. Finally, the correlation of nodes in each divided area is used to select monitoring nodes. The ultimate goal of the sensor optimization layout problem is to deploy pressure sensors on the most representative nodes. A semi-supervised method and a deep learning method are used to select monitoring nodes. The monitoring nodes selected using these two methods are shown in the figure. Fig. 9 , 10 As shown in Figure 2, Method 1 represents the deep learning method and Method 2 represents the method proposed in this paper. Fig. 9 , 10 It can be seen that the set of nodes finally selected by method 1 is {80, 110} and the set of nodes selected by method 2 is {140, 150}. Fig. 9 , 10 The two methods shown select different sets of nodes. Figure 8 as well as Fig. 9 , 10It can be seen that the monitoring pressure sensors selected by method 1 are distributed at the edge of the divided area. However, the monitoring pressure sensors selected by method 2 are more dispersed in the divided area than those of method 1. Compared with method 1, method 2 can detect almost all leakages. Method 1 does not consider the correlation and redundancy between all nodes in the divided area. However, method 2 considers the correlation and redundancy between all nodes in each divided area in the water supply network. Therefore, compared with method 1, method 2 is a better choice for dealing with the problem of optimal layout of sensors in wireless communication networks. Finally, a simple BiLSTM neural network is used to detect the leakage of the selected monitoring pressure sensor combination to verify the practicality of the two methods. It should be noted that the size of the leakage should be as widely distributed as possible under reasonable conditions, that is, the leakage size should be distributed from small leakage to large leakage within a reasonable range. Otherwise, it cannot meet the actual scenario of pipeline leakage in real life. In this case, the average water demand for the simulated flow to the surface ranges from 23 L / s to 47 L / s, and is added to all nodes of the water supply network at intervals of random size. The leakage generated by each node in the training set and the test set meets the ratio of 4:1, that is, 120 leakages are generated for each node in the training set and 30 leakages are generated for each node in the test set. Since the training set has to go through a series of data preprocessing, the results of the BiLSTM neural network are not particularly stable. To overcome this problem, the data of the training set are preprocessed separately for a total of 10 times. Accuracy, average topological distance, and RMSE are used to evaluate the performance indicators of the two methods and are summarized in Tables 3 and 4.
[0200] Table 3 ACC, ATD and RMSE results of Anytown based on method 1
[0201]
[0202]
[0203] Table 4 ACC, ATD and RMSE results of Anytown based on Method 2
[0204] Data set ACC ATD RMSE 1 0.92 0.144 0.533 2 0.93 0.116 0.463 3 0.92 0.137 0.509 4 0.92 0.135 0.518 5 0.91 0.158 0.565 6 0.92 0.129 0.513 7 0.91 0.149 0.538 8 0.92 0.146 0.541 9 0.90 0.175 0.601 10 0.91 0.159 0.567 Average 0.92 0.145 0.535
[0205] It can be seen from Table 3 and Table 4 that the accuracy of the LSTM neural network leakage detection results based on method 2 is higher than that of method 1, which is about 1.07 times. The ATD value of method 1 is 1.84 times that of method 2, and the RMSE value of method 1 is 1.46 times that of method 2. This shows that according to the experimental results of the above two methods, the farther the average topological distance (ATD) between the predicted leakage location and the actual leakage location is, the lower the stability of the predicted leakage location is.
[0206] Example 2
[0207] like Fig.11 As shown in the figure, the network consists of 92 nodes, 117 pipelines, 2 water pumps, 3 storage tanks and 2 reservoirs. It is worth noting that in the prior art, considering that some nodes are too close to reservoirs, water tanks or water pumps, such as the node set {10, 20, 40, 50, 60, 61, 601}, the leakage of these nodes is not considered. However, in actual situations, water supply network leakage may also occur very close to reservoirs, water tanks or water pumps. Therefore, all nodes in the water supply network should be taken into account. The average daily flow rate of the network is approximately 3048.11L / s. The hourly node demand coefficients of all nodes in Net3 are as follows: Fig.12 shown.
[0208] The amount of water flowing to the surface simulation is set to 3.94% of the daily average demand, that is, the leakage of all nodes in the water supply network is 120 liters / second. The time sample of each leakage event (leakage at each node) is 640 hours. In other words, the size of the input pressure difference matrix is 92*58880, where 92 represents the number of leakage events and 58880 represents the product of the time sample of each leakage event and the number of nodes. Subsequently, the Net3 water supply network is divided into 4 areas according to the K-Means clustering algorithm and the cluster center position of each area is calculated. Then, the Euclidean distance method is used to find the node closest to the cluster center position in each divided area to construct a pseudo label. Fig.11 The Net3 network in is divided into 4 regions and a pseudo label is constructed in each region (such as Fig.13 ). Then the pseudo-labeled data is input into the 2-layer graph convolutional neural network, and the training results are as follows: Fig.14 As shown. Fig.14 In , adjacent nodes are assigned to the same area. Moreover, adjacent nodes have a common feature, that is, the pressure difference matrix is approximately the same.
[0209] Finally, the correlation of nodes in each partition area is used to select monitoring nodes. The selection combination of all nodes is as follows:
[0210]
[0211] Among them, N c is the selected combination of all nodes, n f is the number of all nodes, n s is the number of nodes to select.
[0212] If we want to use correlation to select a few nodes from a water supply network with hundreds or thousands of nodes to place pressure sensors, it is obviously not practical. f =92,n s =4, then N c =2794155. However, only a small number of the combinations of so many selected nodes can reasonably predict the occurrence of leakage. Therefore, it is very necessary to use correlation to find the most representative node in each divided area. According to experiments, it can be found that each area can find a node that can represent all the nodes in the area, that is, the node found has the greatest correlation with the other nodes in the area. So, Fig.15 As shown in Figure 2, the proposed method finally selected the node set {105, 237, 169, 151}. In addition, a new semi-supervised method and a traditional semi-supervised method were used to select the node sets {109, 119, 184, 229} and {109, 119, 149, 229} respectively. Fig.16 and 17 shown.
[0213] For these three methods, the method proposed in this invention can well cover all nodes of the entire water supply network and achieve full regional coverage. However, the traditional semi-supervised method has regional monitoring blind spots, that is, there are no monitoring nodes in a certain area, which means that there is no node in a certain area that can represent all nodes in the area. Fig.17 As shown in the figure, there is no monitoring node in the second cluster area, but there are two monitoring nodes monitoring the third cluster area, which may cause a waste of resources. Although the new semi-supervised method can monitor each area, the monitoring nodes in each area are distributed at the boundary of the area, which may lead to the inability to achieve effective monitoring in a certain area. Fig.16 As shown, the monitoring nodes of the 0th cluster area, the 2nd cluster area, and the 3rd cluster area are all distributed on the boundaries of the area, which is likely to cause the ineffectiveness of regional monitoring.
[0214] In order to verify the practicality of the three methods, the pressure difference matrix of the monitoring nodes is input into a simple LSTM neural network for leak detection. The average water demand for the simulated flow to the surface is in the range of 63 liters / second to 630 liters / second, and is added to all nodes of the water supply network at random intervals. The leakage generated by each node in the training set and the test set meets the ratio of 4:1, that is, 120 leakages are generated for each node in the training set and 30 leakages are generated for each node in the test set. As in case 1, the data of the training set are preprocessed separately for a total of 10 times. Accuracy, average topological distance and RMSE are used to evaluate the performance indicators of the three methods and are summarized in Tables 5, 6 and 7.
[0215] Table 5 ACC, ATD and RMSE results based on the new semi-supervised method in Net3
[0216]
[0217]
[0218] Table 6 Results of ACC, ATD and RMSE based on the proposed method in Net3
[0219]
[0220] Table 7 Results of ACC, ATD and RMSE based on traditional semi-supervised methods in Net3
[0221]
[0222]
[0223] It can be seen from Tables 5, 6 and 7 that the accuracy of the new semi-supervised method is 0.70, the average topological distance is 1.269 and the RMSE is 3.671. The accuracy of the traditional semi-supervised method is 0.66, the average topological distance is 1.439 and the RMSE is 3.655. The accuracy of the method proposed in the present invention is 0.72, the average topological distance is 0.892 and the RMSE is 2.601. It can be seen that the complexity of the water supply network Net3 is much higher than that of Anytown, which is the main reason for the decrease in accuracy and the increase in the average topological distance and RMSE values.
[0224] The present invention designs and develops a method for arranging leak location sensors for water supply network based on graph convolution network, which is used for leak location of nodes in water supply network. In this method, K-means clustering algorithm is used to construct pseudo labels; then, the nodes with pseudo labels are input into a two-layer graph convolution network for training, and then the classification of nodes in the network is completed; finally, the correlation between nodes is applied to select the most representative nodes for arranging sensors. The effectiveness and superiority of this method are verified by Anytown and Net3 networks. In Example 1, the method proposed by the present invention is analyzed with the genetic algorithm from three aspects: ACC, ATD and RMSE. The results show that the method proposed by the present invention is superior to the genetic algorithm in all indicators. In Example 2, the method of the present invention is analyzed with the other two semi-supervised strategies from three aspects: ACC, ATD and RMSE. The results show that the method of the present invention is slightly better than the semi-JMI method pre-processed by FCM, and is much better than the traditional semi-JMI method without FCM pre-processing. The method of the present invention can well solve the problem of leak detection in wireless data networks.
[0225] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes. They can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the embodiments shown and described herein.
Claims
1. A method for arranging leak location sensors in a water supply network based on a graph convolutional network, characterized in that: The steps include: Step 1: Collect three-dimensional data to create a data set of the water supply network; Step 2: Cluster the data into K categories using the K-means clustering algorithm, select the sample points of each category that are closest to the cluster center of the category as nodes for constructing pseudo labels and label them from 0 to K; Step 3: Divide all sample points in the data set into monitoring areas through a graph convolutional network; Wherein, the graph convolutional network satisfies: In the formula, g θ (Λ) is the eigenvalue function of the Laplace matrix, Λ is the diagonal matrix of eigenvalues, x is the vector representation of the node attributes in the graph, θ is the Chebyshev coefficient, is the degree matrix, is a self-circular adjacency matrix; Wherein, the degree matrix satisfies: In the formula, is the self-loop matrix of the current node η; The self-circulating adjacency matrix satisfies: In the formula, A is the adjacency matrix, I N is the identity matrix; Step 4: Use the cross-correlation function algorithm to traverse the sample points in each monitoring area until all sample points have been traversed once, and select a sample point with the largest sum of correlations with other sample points in the monitoring area as the optimal sensor layout node; Wherein, the cross-correlation function algorithm satisfies: In the formula, is the sample cross-covariance function, τ is the time lag, and s is the sample standard deviation of the process; Step 5: Evaluate the optimal sensor arrangement nodes using a bidirectional long short-term memory network; The evaluation includes precision, average topological distance, and root mean square error of average topological distance; The accuracy meets: Where ACC is the accuracy, Γ a,a is the number of times node a is correctly predicted to leak, N is the number of nodes in the water supply network, Γ a,j is the number of times a leak in node a is identified as a leak in node j; The average topological distance satisfies: In the formula, ATD is the average topological distance, D a,j is the distance between node a and node j; The root mean square error of the average topological distance satisfies: Where RMSE is the root mean square error of the average topological distance.
2. The method for arranging water supply network leakage positioning sensors based on graph convolutional networks according to claim 1, characterized in that: The three-dimensional data includes: The first dimension of data is the value of the pressure difference at each node when the leakage event and leakage simulation time point of the node are determined; The second dimension of data is the change of the pressure difference value of each node with the start and end time of the leakage simulation in the case of a leakage event at a specified node; The third dimension of data is the change in the value of the pressure difference corresponding to each node at different leakage simulation times in the case of leakage events at different nodes.
3. The method for arranging leakage positioning sensors for a water supply network based on a graph convolutional network as claimed in claim 2, characterized in that: The step 1 also includes performing noise processing and standardization processing on the data set in sequence, wherein the noise processing is: The data set is divided into a training data set and a test data set. Noise is randomly added to the training data set with a probability of 50%, and noise is randomly added to the test data set with a probability of 100%. The signal-to-noise ratio of the noise is 30db to 40db.
4. The method for arranging leakage positioning sensors for a water supply network based on a graph convolutional network according to claim 3, characterized in that: The standardization process satisfies: In the formula, is the dataset after adding noise and standardization, S is the original dataset without processing, μ S is the mean of the original data set, σ S is the standard deviation of the original data set, σ n is the mean standard deviation of the noise.
5. The method for arranging water supply network leakage positioning sensors based on graph convolutional networks according to claim 1, characterized in that: The K-means clustering algorithm in step 2 specifically includes the following steps: Step 1: randomly divide the data set into K categories according to the number of arranged positioning sensors, randomly select an initialization area, and calculate the cluster center of each category; Wherein, the cluster center satisfies: In the formula, K i is the number of sample points contained in the i-th class, w ij is the jth sample point in the i-th class, is the average value of the cluster center of the i-th category; Step 2: Calculate the distances from all sample points to the K cluster centers respectively, and classify the sample points into the cluster center category with the smallest distance; Step 3: When the distance between the sample point and the cluster center is not the minimum value, the sample point is moved to the cluster center category with the minimum distance, and the cluster centers are recalculated for the class from which the sample point moves out and the class to which the sample point moves in; Step 4: When the square error reaches the minimum value, stop clustering; Wherein, the square error is: In the formula, {C1,C2,…,C K } is a data set divided into K categories, K is the number of classes, and i is the number of class objects.
6. The method for arranging water supply network leakage positioning sensors based on graph convolutional networks according to claim 1, characterized in that: The storage unit of the bidirectional long short-term memory network is composed of an input gate, a forget gate and an output gate, and specifically includes the following process: The operation result of the previous output and the current input is passed to the next storage unit through the forget gate, and the forget gate determines whether the previous information is retained or cleared: f t =σ(W f ·(h t-1 ,x t )+b f ); In the formula, f t is the forget gate vector, σ(·) is the sigmoid activation function, W f is the weight matrix of the forget gate, h t-1 is the previous output, x t is the current input, b f is the offset value of the forget gate; The input gate vector determines whether the temporary new state updates the current cell state: i t =σ(W i ·(h t-1 ,x t )+b i ); In the formula, i t is the input gate vector, W i is the weight matrix of the input gate, b i is the offset value of the input gate, C t is a temporary new state, W c is the weight matrix modified by the unit state, b c is the offset value modified by the cell state, C t is the current unit state, tanh(·) means through the tanh activation function; The current output satisfies: the t =σ(W o ·(h t-1 ,x t )+b o ); h t =tanh(C t )×o t ; In the formula, o t is the output gate vector, h t is the current output, W o represents the weight matrix of the output gate, b o Indicates the offset value of the output gate.
Citation Information
Patent Citations
Metal pressure vessel leakage online detection method based on sound emission signal
CN110044554A
Method and system for monitoring leakage of water supply pipeline between buildings
CN112833336A