Water supply network pressure prediction method based on residual dense neural network
Through the water supply network pressure prediction method based on residual dense neural network, the problem of complex models and inability to quickly adapt to changes in the prior art is solved, and higher prediction accuracy and model stability are achieved, which is suitable for pressure prediction of municipal pipeline networks.
Patent Information
- Application Number
- CN202510090304.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
Smart Images

Figure CN120011763A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart water services for water supply network pressure prediction methods, and in particular, relates to a water supply network pressure prediction method based on a residual dense neural network. Background Art
[0002] The water supply system is an important part of urban infrastructure. With the development of economy and technology and the improvement of residents' lives, the integration and quality requirements of the water supply system are becoming higher and higher. At present, the adjustment of water supply pressure in most regional pipelines still remains on manual experience and some general formulas. However, relying solely on experience and formula judgments, there is a lack of prior prediction mechanisms, which can easily lead to insufficient or excessive pressure in the pipeline during the water supply process. Insufficient pressure affects residents' water demand, and excessive pressure will lead to a large amount of electricity consumption and more likely to burst pipes, resulting in water resource losses. Therefore, a scientific water supply pipeline pressure prediction model is established to accurately predict the water supply pressure of the pipeline network in a specified area, and assist in the adjustment of water supply pressure and water resource planning in the area.
[0003] At present, the research on pressure prediction at home and abroad mainly focuses on improving the prediction accuracy, and the research methods used mostly focus on machine learning and deep learning. For example, Zhang Zhaoqiang et al. proposed a BP neural network based on the MATLAB toolbox to predict the future water supply network pressure. This method is simple to run and easy to operate, but the accuracy is relatively low; Wang Jian et al. proposed a method of using wavelet neural network to predict the water supply network pressure. This method uses wavelet basis functions to replace BP neural network and optimizes it to make it more practical in water pressure prediction; Zhao Fengmin et al. proposed a steam network pressure prediction method based on improved K nearest neighbor and least squares support vector machine. This method can effectively solve the problem of difficulty in real-time and effective scheduling of steam system caused by factors such as large fluctuations in steam network pressure; Bai Li et al. proposed a spatiotemporal prediction method for water supply network pressure based on time graph convolution network, which effectively combines the spatial distribution of pressure sensors in the water supply network with historical pressure data, and realizes a more accurate prediction of network pressure.
[0004] Although some existing methods can predict the pressure of water supply networks, there are still problems such as overfitting training data due to complex models and the inability of simple models to obtain key data features; in addition, some models are difficult to quickly adapt to changes in network structure or the influence of other external conditions, resulting in the model not working or frequent errors. Therefore, it is necessary to establish a municipal pipe network water supply pressure prediction model that is more suitable for the requirements of municipal pipe networks to solve the problems of urban pressure adjustment and water distribution. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a water supply network pressure prediction method based on a residual dense neural network that can overcome the above problems or at least partially solve the above problems.
[0006] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is: a water supply network pressure prediction method based on residual dense neural network, comprising the following steps:
[0007] S1. Collect historical pressure data and related variable data of the municipal pipe network, including weather data, holiday data and data on whether it is the peak water consumption period;
[0008] S2. Preprocess the collected data, including data completion and normalization;
[0009] S3. Establish a training set and a test set. The training set is used to train the model, and the test set is used to evaluate the model performance. The ratio of the training set to the test set is 8:2.
[0010] S4. Build a residual dense neural network model, which includes a residual neural network branch and a dense neural network branch, both of which include a two-dimensional convolutional layer, a BN layer and an activation function;
[0011] S5. Use the training set to train the residual dense neural network model until the model converges;
[0012] S6. Use the test set to test the trained model and predict the pressure curve of the water supply network for a single day;
[0013] S7. Evaluate the prediction performance of the model based on the evaluation indicators.
[0014] Preferably, in step S1, the weather data includes maximum temperature, minimum temperature and humidity data.
[0015] Preferably, in step S2, the data is completed by a linear interpolation method, and the normalization process is performed by a mean normalization method to normalize the value of the input data between [0, 1], specifically:
[0016]
[0017] Among them, x′ is the normalized data, x is the input or output data; x max 、x min They are the maximum and minimum values of all data of the corresponding data type respectively.
[0018] Preferably, in step S4, the residual neural network branch adopts a jump connection method to pass the input data directly to the next layer; the dense neural network branch adopts a method of directly connecting all convolutional layers; the residual neural network branch and the dense neural network branch both contain three convolutional layers, and each convolutional layer is followed by a BN layer and a RELU activation function.
[0019] Preferably, the residual dense neural network model in step S4 also includes a Flatten layer and a Sigmoid function, the Flatten layer is used to connect the residual neural network branch and the dense neural network branch, and the Sigmoid function is used for the final pressure prediction.
[0020] Preferably, the evaluation indicators in step S7 include mean absolute error MAE, root mean square error RMSE and determination coefficient R2, and the calculation formula is as follows:
[0021]
[0022] Among them, y i Represents the true value of pressure, represents the predicted pressure value, Represents the average pressure, n represents the total number of data points, and the result of each prediction is the pressure of a single monitoring node in MPa.
[0023] Preferably, the method further comprises step S8: adjusting the operating parameters of the water supply system according to the prediction results to optimize the water supply pressure and water distribution.
[0024] Preferably, the water supply network pressure data is instantaneous pressure data once every 60 minutes.
[0025] Preferably, the method further includes a control step of adjusting the water supply network pressure according to the prediction result.
[0026] Preferably, a computer system based on the prediction method includes: a data acquisition module for collecting historical pressure data and related variable data of the municipal pipe network; a data processing module for preprocessing the collected data; a model training module for building a residual dense neural network model and training the model using a training set; a model testing module for testing the trained model using a test set and predicting a single-day water supply pipe network pressure curve; and a performance evaluation module for evaluating the prediction performance of the model according to evaluation indicators.
[0027] After adopting the above technical scheme, the present invention has the following beneficial effects compared with the prior art: a water supply network pressure prediction method based on residual dense neural network proposed in the present invention has advantages over the three deep learning methods of BP, LSTM and CNN-LSTM in terms of MAE, RMSE and R2. Compared with CNN-LSTM, RMSE is reduced by 8.2%, MAE is reduced by 6.8%, and R2 is increased by 0.3%; relative to the LSTM model, RMSE is reduced by 12.1%, MAE is reduced by 9.8%, and R2 is increased by 0.9%; relative to the BP model, RMSE is reduced by 16.9%, MAE is reduced by 15.6%, and R2 is increased by 1.5%; therefore, the method proposed in the present invention is more suitable for pressure prediction of municipal pipe networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In the attached picture:
[0029] Figure 1 A flow chart of a water supply network pressure prediction method based on a residual dense neural network proposed by the present invention;
[0030] Figure 2 This is a comparison chart between the prediction results and the true values in a water supply network pressure prediction method based on a residual dense neural network proposed by the present invention. DETAILED DESCRIPTION
[0031] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments so that those skilled in the art can implement the invention with reference to the description.
[0032] It should be understood that the terms such as “having”, “including” and “comprising” used herein do not exclude the existence or addition of one or more other elements or combinations thereof.
[0033] In the description of the present invention, the terms "lateral", "longitudinal", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc. to indicate directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0034] Reference Figure 1-Figure 2 , including the following steps:
[0035] S1. Collect historical pressure data and related variable data of the municipal pipe network, including weather data, holiday data and data on whether it is the peak water consumption period;
[0036] S2. Preprocess the collected data, including data completion and normalization;
[0037] S3. Establish a training set and a test set. The training set is used to train the model, and the test set is used to evaluate the model performance. The ratio of the training set to the test set is 8:2.
[0038] S4. Build a residual dense neural network model, which includes a residual neural network branch and a dense neural network branch, both of which include a two-dimensional convolutional layer, a BN layer and an activation function;
[0039] S5. Use the training set to train the residual dense neural network model until the model converges;
[0040] S6. Use the test set to test the trained model and predict the pressure curve of the water supply network for a single day;
[0041] S7. Evaluate the prediction performance of the model according to the evaluation indicators;
[0042] In step S1, the weather data includes the maximum temperature, the minimum temperature and the humidity data; in step S2, the data is completed by linear interpolation, and the normalization is performed by mean normalization to normalize the input data between [0,1]; in step S4, the residual neural network branch adopts a jump connection method to pass the input data directly to the next layer; the dense neural network branch adopts a method of directly connecting all convolutional layers; the residual neural network branch and the dense neural network branch both contain three convolutional layers, and each convolutional layer is followed by a BN layer and a RELU activation function; the residual dense neural network model in step S4 also includes a Flatten layer and a Sigmoid function, the Flatten layer is used to connect the residual neural network branch and the dense neural network branch, and the Sigmoid function is used for the final pressure prediction.
[0043] In the present invention, the water supply network pressure prediction data is collected for one month of continuous data, including obtaining the highest temperature, lowest temperature and humidity data of the corresponding time from the Internet, and the water supply network pressure data is obtained from the pressure sensors arranged at the entrance of each community; the humidity data is based on the daily average, and the water supply network pressure data at a fixed time interval of a single day is taken as the instantaneous pressure data every 60 minutes; wherein, the highest temperature, lowest temperature and humidity data are used as input data of the prediction method of the present invention, and the water supply network pressure data at a fixed time of a single day is used as the output data of the prediction method of the present invention; wherein, for missing data and abnormal data, the linear interpolation method is used to fill in, and when establishing the data set, 80% of the data is selected as the training set each time, and the remaining 20% of the data is selected as the test set; in addition, due to the different types of input and output data, the units are also quite different, and direct training of the model will lead to large differences in the weight of the data, resulting in large prediction errors; therefore, in order to unify the order of magnitude of the input data, this paper adopts the mean normalization method to normalize the value of the input data between [0, 1], as follows:
[0044]
[0045] Among them, x′ is the normalized data, x is the input or output data; x max 、x min They are the maximum and minimum values of all data of the corresponding data type respectively.
[0046] In one embodiment, the residual dense neural network model includes two branch models, both of which include a two-dimensional convolutional layer, a BN layer and an activation function, and the two branch models are used to more finely extract features from the water supply network pressure data; the model is trained by the established training set, and then the model is tested by the test set to evaluate the prediction performance of the model;
[0047] The water supply network pressure prediction model based on residual dense neural network contains two branches, namely residual neural network branch and dense neural network branch; the residual neural network mainly connects different layers in a unique residual connection way to simplify network training and does not increase additional parameters in the network; assuming that the residual neural network contains N convolutional layers, P N is the output of the Nth layer, H N is a hidden layer; the connection mode of the residual neural network is skip connection, and the input data can directly pass the information to the next layer through the residual connection, so the output result P of the Nth layer N The calculation formula is as follows:
[0048] P N =H N (P N-1 )+P N-1
[0049] Among them, P N-1 It is the output of the Nlth layer and also the input of the Nth layer, and then passes through the hidden layer H N The output result P is obtained N .
[0050] In one embodiment, a dense neural network is a special form of residual network. It mainly adds a part of feature mapping to the shared information part without changing the original feature information. When connected, it directly connects all convolutional layers to increase the maximum information flow between network layers. Unlike residual neural networks, dense neural networks combine feature information by connecting in dimensions rather than simply summing. Assuming that a dense neural network contains N convolutional layers, P N is the output of the Nth layer, H N is a hidden layer, then the output result of its Nth layer is P N The calculation formula is as follows:
[0051] P N =H N (P0,P1,······,P N-1 )
[0052] Among them, P0, P1, ..., P N-1 Represent the features generated in the 0th, 1st, ...N-1th layers respectively. If each hidden layer H N If n feature maps are generated, the Nth layer will obtain m+n×(N-1) feature maps, where m is the number of channels of the first convolutional layer.
[0053] In one embodiment, the residual neural network and dense neural network constructed by the present invention both include three convolutional layers, and each convolutional layer is followed by a BN layer and a RELU activation function; the connection mode of the residual neural network is that the first layer is directly connected to the last layer, and each layer in the dense neural network is connected to all subsequent layers, and then the two neural networks are connected through a Flatten layer, and the Sigmoid function is used for the final pressure prediction;
[0054] Train the residual dense neural network model. During training, you need to set multiple parameters of the model, including learning rate, batch size, number of iterations, loss function weight coefficient, etc. When setting, set the learning rate to 0.001, the batch size to 64, the maximum number of iterations to 200, the loss function weight to 10, and repeatedly use the training set to train the model 10 times, and select the model with the best training effect;
[0055] After the training is completed, the saved model is tested using the established test set to predict the water supply network pressure prediction curve and evaluate the prediction performance of the residual dense neural network model;
[0056] The present invention uses mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R2) for evaluation. The closer the MAE and RMSE errors are to 0, the higher the R2. 2 The closer to 1, the more accurate the prediction result. 2 The calculation formula is as follows:
[0057]
[0058] Among them, y i Represents the true value of pressure, represents the predicted pressure value, Represents the average pressure, n represents the total number of data points, and the result of each prediction is the pressure of a single monitoring node in MPa.
[0059] Furthermore, in order to evaluate the performance of the water supply network pressure prediction method based on residual dense neural network proposed in the present invention, the method of the present invention is compared with the existing BP, LSTM and CNN-LSTM three deep learning algorithms. The comparison results are shown in Table 1 and Figure 2 As shown:
[0060] Table 1. Experimental results of the proposed method and the comparative method
[0061] Structural model MAE RMSE <![CDATA[R 2 ]]> BP 0.168 0.184 0.962 LSTM 0.110 0.136 0.968 CNN-LSTM 0.080 0.097 0.974 Proposed method 0.012 0.015 0.977
[0062] It can be seen from Table 1 that compared with CNN-LSTM, the proposed method reduces RMSE by 8.2%, MAE by 6.8%, and R 2 Compared with the LSTM model, the RMSE decreased by 12.1%, the MAE decreased by 9.8%, and the R 2 Compared with the BP model, the RMSE decreased by 16.9%, the MAE decreased by 15.6%, and the R 2 Increased by 1.5%; in addition Figure 2 It can be seen that the prediction curve of the method proposed in the present invention is closer to the true value.
[0063] In summary, the method proposed in the present invention is more suitable for pressure prediction of municipal pipe networks.
[0064] Reference Figure 1-Figure 2 The evaluation indicators in step S7 include mean absolute error, root mean square error and determination coefficient; it also includes step S8: according to the prediction results, adjusting the operating parameters of the water supply system to optimize the water supply pressure and water distribution; the water supply network pressure data is instantaneous pressure data every 60 minutes; it also includes a control step of adjusting the water supply network pressure according to the prediction results.
[0065] In the present invention, a water supply network pressure regulating control device connected to the model testing module is also provided, which is used to adjust the water supply network pressure according to the prediction result.
[0066] The prediction task in the present invention is to predict the future development trend of the water supply network pressure based on the historical data and related variables that affect the pressure change. In the process of building the neural network model, the present invention assumes that each water supply plant is independent of each other and the water supply process does not affect each other. Therefore, the collected data corresponds to the pressure data of the total water inlet of each community, and the data is obtained by the pressure sensor arranged at the relevant position; secondly, the related variables affecting the pressure include weather data, holiday data and whether it is the peak water use period. This part of the data is obtained from the Internet. After the data is obtained, the original data is processed, and the missing municipal pressure data is supplemented. Then, the maximum temperature, minimum temperature, humidity, and time-related influencing variables are introduced to train the model, and a single-day water supply network pressure prediction curve is established to reduce the error between the single-day pressure prediction curve and the actual pressure curve; wherein, the temperature data is the highest and lowest values in the weather forecast, the humidity data is the average value of a single day, and the water supply network pressure data takes the instantaneous pressure data every 60 minutes;
[0067] The control steps include: prediction result analysis: in-depth analysis of the prediction results of the residual dense neural network model to determine the pressure change trend of the water supply network in the future period;
[0068] Pressure adjustment strategy formulation: According to the prediction results, formulate corresponding pressure adjustment strategies, including adjusting the operating status of the water supply pump, adjusting the valve opening, etc., to ensure that the pressure of the water supply network remains within a reasonable range;
[0069] Execute adjustment operations: perform actual operations on the water supply network and adjust the network pressure according to the formulated adjustment strategy;
[0070] Adjustment effect monitoring: Real-time monitoring of the adjusted water supply network pressure is carried out to ensure that the adjustment effect meets expectations, and necessary fine-tuning is carried out according to actual conditions.
[0071] Reference Figure 1-Figure 2 A computer system based on the prediction method includes: a data acquisition module for collecting historical pressure data and related variable data of the municipal pipe network; a data processing module for preprocessing the collected data; a model training module for building a residual dense neural network model and training the model using a training set; a model testing module for testing the trained model using a test set and predicting a single-day water supply pipe network pressure curve; and a performance evaluation module for evaluating the prediction performance of the model according to evaluation indicators.
[0072] The present invention improves the prediction accuracy by introducing the influence of other variables on the daily pressure prediction curve. The constructed residual dense neural network model includes a residual neural network branch and a dense neural network branch. The two work together to more finely extract the features in the water supply network pressure data, thereby improving the prediction performance of the model. Compared with the existing deep learning methods such as BP, LSTM and CNN-LSTM, the present invention has higher MAE, RMSE and R 2 It has advantages in all three evaluation indicators and is more suitable for pressure prediction of municipal pipe networks.
[0073] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which are equivalent modifications and improvements made to the above embodiments based on the essential technology of the present invention, and all of them belong to the protection scope of the present invention.
Claims
1. A water supply network pressure prediction method based on residual dense neural network, characterized in that: The following steps are involved: S1. Collect historical pressure data and related variable data of the municipal pipe network, including weather data, holiday data and data on whether it is the peak water consumption period; S2. Preprocess the collected data, including data completion and normalization; S3. Establish a training set and a test set. The training set is used to train the model, and the test set is used to evaluate the model performance. The ratio of the training set to the test set is 8:
2. S4. Build a residual dense neural network model, which includes a residual neural network branch and a dense neural network branch, both of which include a two-dimensional convolutional layer, a BN layer and an activation function; S5. Use the training set to train the residual dense neural network model until the model converges; S6. Use the test set to test the trained model and predict the pressure curve of the water supply network for a single day; S7. Evaluate the prediction performance of the model based on the evaluation indicators.
2. A water supply network pressure prediction method based on residual dense neural network according to claim 1, characterized in that: In step S1, the weather data includes maximum temperature, minimum temperature and humidity data.
3. The method for predicting water supply network pressure based on residual dense neural network according to claim 1 is characterized in that: In step S2, the data is completed by linear interpolation, and the normalization is performed by mean normalization to normalize the value of the input data between [0, 1], specifically: Among them, x′ is the normalized data, x is the input or output data; x max 、x min They are the maximum and minimum values of all data of the corresponding data type respectively.
4. The method for predicting water supply network pressure based on residual dense neural network according to claim 1, characterized in that: In step S4, the residual neural network branch adopts a skip connection method to directly pass the input data to the next layer; the dense neural network branch adopts a method of directly connecting all convolutional layers; Both the residual neural network branch and the dense neural network branch contain three convolutional layers, each of which is followed by a BN layer and a RELU activation function.
5. The method for predicting water supply network pressure based on residual dense neural network according to claim 4 is characterized in that: The residual dense neural network model in step S4 also includes a Flatten layer and a Sigmoid function, the Flatten layer is used to connect the residual neural network branch and the dense neural network branch, and the Sigmoid function is used for the final pressure prediction.
6. The method for predicting water supply network pressure based on residual dense neural network according to claim 1, characterized in that: The evaluation indicators in step S7 include mean absolute error MAE, root mean square error RMSE and determination coefficient R 2 , the calculation formula is as follows: Among them, y i Represents the true value of pressure, represents the predicted pressure value, Represents the average pressure, n represents the total number of data points, and the result of each prediction is the pressure of a single monitoring node in MPa.
7. The method for predicting water supply network pressure based on residual dense neural network according to claim 1, characterized in that: The method further includes step S8: adjusting the operating parameters of the water supply system according to the prediction results to optimize the water supply pressure and water volume distribution.
8. The method for predicting water supply network pressure based on residual dense neural network according to claim 1, characterized in that: The water supply network pressure data is instantaneous pressure data every 60 minutes.
9. The method for predicting water supply network pressure based on residual dense neural network according to claim 1, characterized in that: It also includes a control step of adjusting the water supply network pressure according to the prediction results.
10. A computer system for implementing the method of claim 1, characterized in that: include: Data collection module, used to collect historical pressure data and related variable data of municipal pipe network; A data processing module, used for preprocessing the collected data; Model training module, used to build a residual dense neural network model and train the model using a training set; The model testing module is used to test the trained model using the test set and predict the pressure curve of the water supply network for a single day; The performance evaluation module is used to evaluate the prediction performance of the model based on the evaluation indicators.