1. Introduction
Water demand forecasting plays a crucial role in sustainable water supply management. The relationship between water demand, system pressure, and leakage highlights the need to match supply to demand accurately [
1]. Oversupply during periods of low demand increases physical water losses, while undersupply during high-demand periods results in consumer dissatisfaction due to inadequate water quantities and low system pressure [
2]. In some countries such as the UK, customers can even claim compensation from water utilities for low-pressure incidents. Consequently, water utilities must not only meet profit and consumer demands but also optimize the use of limited and scarce water resources [
3]. To achieve these objectives, it is essential to ensure that water supply quantities align with anticipated demand. However, forecasting short-term water demand poses challenges due to frequent variations in urban demand patterns. Successfully predicting water demand can aid in the maintenance and expansion of water systems and facilitate the development of efficient decision support systems based on predictive analytics [
4,
5].
There are several factors to consider when forecasting water demand. Factors such as previous demand patterns, time of day, season, weather conditions, workdays, weekends, and holidays can influence demand. Considering these variables can help capture the complex dynamics of water demand and improve the accuracy of forecasting models [
1,
6]. Various approaches, both machine learning- and non-machine learning-based, can be applied to forecast water demand. Within these, several methods are commonly used to forecast water demand, including neural networks, support vector machines, traditional time series, regression models, random forests, and dynamic systems [
1]. Machine learning techniques, such as neural networks, have gained popularity due to their ability to handle complex patterns and relationships in large datasets [
7,
8].
This study was part of the Battle for Water Demand Forecast (BWDF) competition, focusing on forecasting water demand for ten real-life District Metered Areas (DMAs) in Italy. The main aim of the study was to develop a model to forecast hourly demand for an entire week. Forecasting this multi-step problem, where each prediction must estimate 168 values (hourly demand for one week), was challenging. The main objective of the application of a neural network model to short-term water demand forecasting is to improve supply–demand balance. Better matching water supply amounts to anticipated demand enables water utilities to ensure adequate water supply under different demand conditions. Overall, this helps to achieve sustainable water supply management.
2. Methodology
This study employs a Convolutional Neural Network (CNN) for forecasting water demand by integrating historical inflow, weather data, and deterministic temporal information. As shown in
Figure 1, the proposed CNN architecture incorporates two input layers: the first analyzes 14 past time series variables (all features in
Table 1), and the second assesses nine future temporal variables for deterministic forecasting (temporal features in
Table 1). The nine-layer CNN model is a multi-step model which predicts all the hourly demand for the forecast week at once. The past time series variables and future temporal variables are kept separate in the nine convolutional layers before being combined for the final prediction in the output layer.
To imbue the model with a temporal awareness, thetrigonometric encoding techniques using sine and cosine functions were utilized. This method enables the model to recognize and adapt to inherent seasonality and cyclical patterns across daily, weekly, and yearly intervals. Due to the deterministic nature of this temporal data, it can be projected into the future, allowing the model to have some temporal awareness of the future. The inclusion of masking layers within the model plays a pivotal role in eliminating invalid inputs (e.g., missing data), a critical factor for achieving accurate demand forecasting. By concatenating features from various layers, the model is equipped to analyze both historical trends and future conditions effectively. Each convolutional layer has a kernel size of 1 and 256 filters, except the final linear convolutional layer which has a filter size of 1.
Hyperparameter tuning was conducted through Bayesian Optimization, which builds a probabilistic model of the hyperparameter search space, tests the set of hyperparameters that are most likely to be optimal, and updates the probabilistic model after each test. The optimization tested 180 hyperparameter configurations in total, with each training process capped at 250 epochs. An early stopping mechanism was introduced to prevent overfitting, enhancing the model’s generalizability.
Figure 2 shows a training and validation loss example from prediction week W1 for DMA A. Early stopping restores the best parameters from the best epoch. However, training continues for 50 epochs after the last improvement in validation loss before terminating, which helps to overcome small local minima in the objective space, which can be seen around epoch 25 in
Figure 2. For hyperparameter optimization, the dataset was divided into training, validation, and testing segments following a 7:2:1 ratio, ensuring a comprehensive evaluation of the model’s performance. Data were pre-processed using the mean and standard deviation of the training data. Performance metrics were tailored to three given performance indicators, focusing on the mean absolute error (MAE) and maximum absolute error for the initial 24 h, and subsequently concentrating on MAE for the remaining 144 h. For each prediction week in the competition, the model was retrained using the latest dataset. This dataset was split such that the training data encompasses all but the last 4 weeks before the required prediction week. The 4 weeks prior to the prediction week were used as the validation set for early stopping.
3. Results and Discussion
The proposed method achieved reasonable accuracy for each of the three performance indicators during hyperparameter tuning. The three metrics were weighted to give a single value to optimize, with the MAE for the last 144 h being worth 50% compared to the other two performance indicators. This was chosen because two metrics concern the first 24 h of the prediction week, and only one metric concerns the remaining hours of the week. Using the same train–validation–test split as the hyperparameter optimization,
Table 2 shows the three performance indicators for the best model architecture retrained on ‘DMA D’ as an example.
4. Conclusions
This article has developed a convolutional neural network model for forecasting water demand in district-metered areas. The proposed methodology takes advantage of deterministic features of water demand such as time of day, time of year, and seasonality, which provide important information about the future. The methodology showed good results during Bayesian Optimization of the hyperparameters, and example results for a particular DMA from the competition demonstrate low error values for all three performance indicators on the test set.
Author Contributions
Conceptualization, F.A., M.H., M.K., T.K., K.S. and R.F.; methodology, M.H., F.A. and T.K.; software, M.H.; validation, M.H.; formal analysis, M.H.; investigation, M.H.; resources, M.H.; data curation, M.H.; writing—original draft preparation, F.A., M.H., M.K., T.K. and K.S.; writing—review and editing, F.A., M.H., M.K., T.K., K.S. and R.F.; visualization, M.H.; supervision, R.F.; project administration, F.A. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Acknowledgments
Faten Ayyash acknowledges the Faculty for the Future Program, Schlumberger Foundation, for funding her Ph.D. scholarship. Matthew Hayslep acknowledges South West Water Ltd. for funding his Ph.D. Studentship. Taegon Ko acknowledges Korea Water Resources Corporation for funding his Ph.D. scholarship.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Niknam, A.; Zare, H.K.; Hosseininasab, H.; Mostafaeipour, A.; Herrera, M. A Critical Review of Short-Term Water Demand Forecasting Tools—What Method Should I Use? Sustainability 2022, 14, 5412. [Google Scholar] [CrossRef]
- Babić, B.; Dukić, A.; Stanić, M. Managing water pressure for water savings in developing countries. Water SA 2014, 40, 221–232. [Google Scholar] [CrossRef]
- Bello, O.; Abu-Mahfouz, A.M.; Hamam, Y.; Page, P.R.; Adedeji, K.B.; Piller, O. Solving management problems in water distribution networks: A survey of approaches and mathematical models. Water 2019, 11, 562. [Google Scholar] [CrossRef]
- Li, Z.; Wang, G.; Lin, D.; Mashhadi, A. Hybrid approach for accurate water demand prediction using socio-economic and climatic factors with ELM optimization. Heliyon 2024, 10, e25028. [Google Scholar] [CrossRef] [PubMed]
- Koo, K.M.; Han, K.H.; Jun, K.S.; Lee, G.M.; Kim, J.S.; Yum, K.T. Performance assessment for short-term water demand forecasting models on distinctive water uses in Korea. Sustainability 2021, 13, 6056. [Google Scholar] [CrossRef]
- Shabani, S.; Candelieri, A.; Archetti, F.; Naser, G. Gene expression programming coupled with unsupervised learning: A two-stage learning process in multi-scale, short-term water demand forecasts. Water 2018, 10, 142. [Google Scholar] [CrossRef]
- Soori, M.; Arezoo, B.; Dastres, R. Artificial neural networks in supply chain management, a review. J. Econ. Technol. 2023, 1, 179–196. [Google Scholar] [CrossRef]
- Taye, M.M. Understanding of Machine Learning with Deep Learning: Architectures, Workflow, Applications and Future Directions. Computers 2023, 12, 91. [Google Scholar] [CrossRef]
| Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).