1. Introduction
Urban water utilities are increasingly facing challenges in managing distribution systems under uncertain and dynamic demand patterns. The growing urban population, climate variability, aging infrastructure, and the need for sustainable resource allocation have prompted utilities to adopt advanced data analytics and predictive tools [
1,
2]. Accurate short-term and long-term water demand forecasting plays a crucial role in optimizing system operation, enhancing resilience, reducing energy costs, and supporting leak detection mechanisms. In recent years, the integration of smart metering technologies has enabled the collection of high-frequency water consumption data, opening new opportunities for intelligent modeling and decision support in water distribution systems [
3,
4].
Among the various modeling techniques employed for water demand forecasting, Artificial Neural Networks (ANNs) and hybrid machine learning models have demonstrated significant success due to their ability to capture complex linear and non-linear relationships within time series data [
5,
6]. ANNs, inspired by the structure of the human brain, function as adaptive systems capable of learning from examples without requiring explicit assumptions about the underlying physical processes [
7,
8]. This makes them particularly suitable for water-related applications where consumption behaviors are influenced by multiple interdependent and often unobservable factors such as climate, socioeconomic indicators, user habits, and institutional patterns.
Numerous studies have confirmed the effectiveness of ANNs in modeling water demand across different spatial and temporal scales. Herrera et al. [
9] developed ANN models to predict urban water demand based on historical data, demonstrating high accuracy in medium-range forecasting. Romano and Kapelan [
10] extended this approach by incorporating climatic variables and demand disaggregation to improve model performance. Al-Zahrani and Abo-Monasar [
11] applied ANN-based techniques to predict residential water usage in arid regions and showed that neural networks outperformed classical statistical methods under data scarcity.
Recent studies have also explored a variety of data-driven approaches for improving water demand prediction. For instance, Kim et al. [
12] showed that Long Short-Term Memory (LSTM) models leveraging smart meter data and incorporating prior-day consumption, weather conditions, and calendar effects significantly outperformed traditional ARIMA methods across residential, commercial, and school buildings, with mean correlation coefficients reaching 89% compared to 62% for ARIMA. These findings highlight the importance of temporal dependencies and external drivers in enhancing prediction accuracy. Complementary research by Adamowski and Karapataki [
13] and Bakker et al. [
14] emphasized that integrating exogenous information such as climatic variables, day-of-week patterns, and institutional schedules can capture non-linear dynamics often missed by simpler statistical methods.
Despite these advancements, forecasting peak consumption remains a critical challenge. Walker et al. [
15] reported that while ANN models were capable of capturing overall consumption patterns, they struggled to predict peak values accurately due to sudden changes in user behavior and the stochastic nature of demand spikes. This highlights the need for improved feature engineering, seasonality detection, and the inclusion of external variables such as holidays and event-based signals, as demonstrated in the Hong Kong study by Wong et al. [
16], where calendar and holidays contributed as much as 17% each in explaining urban water consumption variability.
Beyond forecasting accuracy, another major challenge is the treatment of uncertainty. Conventional point forecasts may underestimate risks, particularly when residuals are autocorrelated or when demand spikes occur. In this regard, Li [
17] introduced an uncertainty-aware grey forecasting framework that integrates residual modeling and kernel density estimation to construct calibrated prediction intervals. Their results, validated across several Chinese cities, demonstrated that grey-based approaches remain effective when data are scarce or rapidly evolving, while simultaneously providing interval estimates that improve planning reliability. Similarly, Wu et al. [
18] applied a weighted grey wave forecasting model to urban domestic water use in Chongqing and achieved high predictive accuracy, underscoring the influence of conservation policies on long-term demand trajectories. These contributions highlight the need not only for accurate point forecasts but also for robust confidence intervals to support risk-sensitive water management.
In addition to forecasting, ANNs have also been applied in anomaly detection and leakage identification. Mounce et al. [
19,
20] developed a suite of AI-based models combining neural networks with fuzzy inference systems to detect leaks and bursts in water networks using pressure and flow data. Their methodology, tested on a dataset from 144 District Metered Areas (DMAs) in the United Kingdom, demonstrated promising results, with 44% of the generated alerts corresponding to confirmed bursts. Another study by Mahdi et al. [
21] employed Artificial Neural Networks for leakage diagnosis and localization in laboratory-scale water distribution systems. Using accelerometer and pressure data transformed into statistical features (autocorrelation coefficient and signal energy), their ANN achieved an accuracy of 86.5% demonstrating the potential of feature-engineered neural models for reliable leak detection and localization.
Building on these insights, the literature confirms the growing relevance of intelligent, multi-scale, and uncertainty-aware approaches to water demand forecasting. The Battle of Water Demand Forecasting (BWDF), organized during the 2024 WDSA/CCWI conference and reported by Alvisi et al. [
22], compared multiple forecasting approaches across 10 District Metered Areas (DMAs) in Italy. The study demonstrated that while ANN-based models remain competitive, hybrid methods combining machine learning with time-series analysis often achieved superior performance. Importantly, the BWDF underscored the need for evaluation across multiple case studies and performance indicators to ensure robust conclusions.
This study builds on these insights by proposing an ANN-based methodology with explicit temporal lag optimization to predict water consumption at both daily and hourly resolutions using smart meter data from the SunRise Smart City Project in Lille, France. By focusing on heterogeneous user types, including a university restaurant, an engineering school, and a student residence, the models are trained using historical data with multiple time lags and are calibrated to differentiate between business days, weekends, and holidays to reflect behavioral variations in usage. Forecasting is conducted at both daily and hourly time scales to support operational and strategic planning. The results of this work contribute to advancing predictive analytics for smart urban water networks, with direct implications for operational efficiency, anomaly detection, and long-term resource planning.
2. Materials and Methods
2.1. Background
Artificial Neural Networks (ANNs) provide a flexible framework for capturing the nonlinear relationships inherent in complex processes by learning directly from input-output data pairs [
23]. Conceptually, an ANN is composed of interconnected processing elements called neurons, which are organized into an input layer, one or more hidden layers, and an output layer [
24]. Each connection between neurons carries a weight that reflects the strength of influence from one neuron to the next. The network essentially defines a mapping from the input space to the output space, which is iteratively adjusted during training.
In a feed-forward neural network architecture, the information flows unidirectionally from input to output layers. Training is typically conducted using the back-propagation algorithm, wherein the error between the predicted output and the actual observed value is calculated at the output layer. This error is then propagated backward through the network to update the connection weights using gradient descent or its variants [
25]. The network’s goal is to minimize a predefined loss function, most commonly the Mean Squared Error (MSE), through successive iterations.
To prevent overfitting, a condition where the network learns noise instead of the underlying patterns, the dataset is divided into three subsets: a training set for weight adjustment, a validation set for hyperparameter tuning and early stopping, and a testing set for unbiased evaluation of predictive performance [
26]. Overfitting is detected when the validation error begins to increase while training error continues to decrease, signaling that the model is memorizing the training data rather than generalizing.
Determining the optimal number of hidden neurons remains a major challenge in ANN design. While the sizes of the input and output layers are dictated by the dimensions of the input and output variables, the number of neurons in the hidden layers is often established empirically via trial-and-error to balance model complexity and generalization ability. Riad et al. [
27] suggested using the mean squared error on validation data as a criterion for selecting the best network configuration.
2.2. Method
This study employs a feed-forward back-propagation ANN implemented using a custom MATLAB R2024a script. Historical water consumption time series data, including lagged variables, were integrated as input features to model temporal dependencies and forecast future consumption patterns.
Two levels of temporal resolution were explored:
Daily Forecasting Analysis: Developed to predict total daily water consumption one day ahead, this model incorporates a lag of one day (i.e., previous day’s consumption, Qd−1 to account for autocorrelation in usage patterns.
Hourly Forecasting Analysis: Designed for short-term prediction at hourly intervals, three lag configurations were tested: 1 h (Qh−1), 24 h (Qh−24), and 168 h (Qh−168), corresponding to one week), to evaluate the impact of different temporal dependencies.
For daily predictions, the input vector includes:
Day of the Week indicators (DWi): Seven binary variables (Monday through Sunday) capturing weekly patterns.
Holiday indicators (HO): Accounting for extended breaks such as Christmas or spring vacations.
Special Day indicators (SD): Capturing isolated events (e.g., New Year’s Day, Labor Day).
Each variable is encoded as binary (1 if true, 0 otherwise), ensuring no implicit prioritization of particular days. For hourly analysis, additional input vectors representing the hour of the day (HDi), a set of 24 binary features, are included to identify intraday patterns.
In the case of daily forecasts, the analysis was restricted to a 1-day lag. Autocorrelation analysis indicated that this horizon provided the strongest and most consistent predictive signal, whereas longer lags (e.g., 7 or 14 days) were found to have irregular correlations across the different AMRs. Furthermore, the use of a 1-day lag was considered consistent with the operational focus of the study, which aims to provide short-term forecasts that can directly support utility tasks such as pump scheduling, pressure management, and daily resource allocation.
Prior to modeling, a pre-processing step is performed to identify and exclude anomalies caused by leaks, sensor faults, or other irregularities. Outlier detection uses Chebyshev’s inequality, filtering values exceeding three standard deviations from the mean, thus ensuring model robustness to noise [
28].
The cleaned dataset is divided randomly into three parts: 70% for training, 15% for validation, and 15% for testing. All input and target variables are normalized to the [0, 1] interval using Equation (1) to eliminate scale effects:
where
is the normalized input or target variables X, X
min and X
max represent the minimum and the maximum of the observation values respectively. The aim of the normalization is to avoid any prioritization of the variables and to remove any arbitrary effect of similarity between the objects.
The weights of the neural network are adjusted in a way to minimize the mean squared error (MSE) on training set. The MSE is computed by the Equation (2):
where y
i and ŷ
i are the actual and predictedvalue respectively, ȳ is the mean value of y
i and N is the total number of observations.
The performance of the ANN prediction models is evaluated by both statistical and graphical criteria. The statistical approach consists of the root mean square error (RMSE) and the coefficient of determination (R
2). These statistical coefficients are calculated using Equations (3) and (4) respectively:
The coefficient of determination (R2) varying from 0 to 1 indicates the linear correlation between the variables. The variables that have similar tendency have a correlation factor close to 1. The optimal value for RMSE is equal to 0.
Concerning the graphical criteria, a perfect superposition between the desired and calculated variables is described by a straight line where y = x along the diagonal or along 45 degrees.
2.3. Data Collection
In this study, water consumption data were obtained from a smart metering system implemented on the water supply network of the Scientific Campus at Lille University, situated in northern France. The network spans approximately 15 km and consists primarily of aging grey cast iron pipes, many of which have been in place for over six decades. It provides water to a population of around 25,000 individuals, including students, faculty, staff, and visitors.
To enable real-time monitoring and detailed analysis, the network is equipped with 93 smart meters using Automated Meter Reading (AMR) technology. These meters were installed across 80 buildings and 13 main supply points, allowing for hourly measurement of water usage. The recorded data are transmitted daily to a central system for processing and analysis [
29]. The monitoring system supports efficient management of the network by identifying water losses due to leaks, unauthorized usage, or inefficiencies associated with the old infrastructure.
To enable a comprehensive and multi-scale analysis of water consumption patterns, this study utilizes data collected from distinct functional zones within the monitored network. These include a university restaurant (B1), an engineering academic building (B2), student residential facilities (B3), and the aggregated District Metered Area (DMA). The inclusion of these diverse sectors allows for the investigation of consumption behaviors across different building typologies and user profiles. Such heterogeneity in the dataset enhances the generalizability of the findings and enables the development of more robust and context-aware predictive models.
2.4. Data Analysis
The dataset employed in this study includes hourly water consumption records acquired from four distinct Automated Meter Reading (AMR) nodes within a university campus. These nodes include three specific buildings namely, the engineering school (B2), the university restaurant (B1), and a student residential facility (B3), in addition to one general AMR covering the entire District Metered Area (DMA), which encompasses multiple academic, administrative, and residential units. This configuration facilitates a multiscale assessment of consumption behavior, spanning both localized and aggregated water demand patterns.
An analysis of water consumption trends was conducted over the span of a year. Monthly aggregated consumption profiles, illustrated in
Figure 1 and
Figure 2, show aligned with institutional activity cycles. Specifically, a marked reduction in water consumption is observed during the summer period, which coincides with the academic recess. This decline is particularly prominent in B3 (student residence) and B1 (university restaurant), reflecting the direct impact of occupancy rates and operational schedules on demand. Conversely, during peak academic months, both buildings exhibit elevated consumption, indicative of full-capacity usage and intensified water-dependent activities.
Figure 1 presents the monthly water usage profiles of the three individual buildings. B3 consistently records the highest consumption, corresponding with its residential function and continuous occupancy. B2 demonstrates moderate but relatively stable usage, indicative of regular academic activity. In contrast, B1 displays the lowest overall consumption with notable fluctuations reflecting variations in service utilization over time.
Figure 2 displays the consumption trend for the DMA. As an aggregate of multiple facilities, the DMA shows smoother temporal variations due to the averaging effects of diverse demand profiles. While seasonal troughs are still obvious, the overall amplitude of variation is reduced relative to individual buildings, highlighting the dampening effect of scale on demand variability.
The selected monitoring points represent distinct user profiles within the network. B1 is a university restaurant serving approximately 1250 meals per day during weekday lunch hours. B2 corresponds to the engineering school, hosting about 1450 engineering students, 172 academic/research staff, 70 administrative personnel and 230 guest lecturers. The school operates within two main buildings covering a total area of 23,000 m
2. B3 is a student dormitory comprising 113 housing units. Finally, the DMA covers a heterogeneous urban sector that includes teaching, research, residential and administrative buildings, thus reflecting a highly diverse consumption profile.
Table 1 presents the minimum, maximum, average, and standard deviation of daily and hourly water consumption across all AMRs. The dataset spans a full year of monitoring, providing a strong foundation for analyzing seasonal and temporal variations in consumption. As expected, the DMA registers the highest average daily water demand (388.413 m
3/day) and the largest standard deviation (15.871 m
3/day), reflecting the cumulative and variable nature of campus-wide consumption. Among the individual AMRs, B3 (student residence) shows the highest average daily flow (45.852 m
3/day), followed by B2 (engineering school) with 17.807 m
3/day, and B1 (restaurant) with the lowest average of 4.979 m
3/day. These values align with the expected functional characteristics of the buildings: the residential building demonstrates continuous usage, the engineering school shows moderate but steady demand, and the restaurant displays relatively low and periodic consumption. The standard deviation values further support these observations, indicating the variability of water use patterns in each facility. These statistics are critical for the subsequent modeling phase, as they reveal the essential dynamics of each data source, including baseline demand and peak loads.
4. Discussion
The present study evaluated the performance of Artificial Neural Network (ANN) models for daily and hourly water demand forecasting, with particular focus on the effect of incorporating historical consumption values (lagged inputs). Across all AMRs and temporal resolutions, the inclusion of lagged consumption noticeably improved predictive accuracy, verifying the autocorrelation structure in urban water demand time series. The results of this study confirm the established understanding that incorporating lagged consumption features is not merely beneficial but essential for accurate water demand forecasting [
9,
13,
30]. Building on this foundation, this research systematically evaluates and optimizes different lag structures (1 h, 24 h, and 168 h for hourly data; 1 day for daily data), thereby demonstrating how structured lag selection can significantly enhance model accuracy across heterogeneous user types.
In the daily models, the incorporation of the previous day’s consumption (lag = 24 h) produced substantial improvements in R
2, especially for AMRs with irregular usage patterns (DMA, B3). This is consistent with Boudhaouia and Wira [
31], who demonstrated that including prior-day demand is particularly beneficial in contexts with high variability and intermittent peaks. By contrast, the improvement was marginal for the university restaurant (B1), which operates on highly repetitive schedules; here, exogenous calendar-based variables (day of week, holidays) already explain much of the variability, as also noted by Sardinha-Lourenço et al. [
32] in their analysis of institutional demand forecasting.
For hourly forecasting, the 1-h lag consistently outperformed other configurations, producing the highest R
2 values and lowest RMSE across all AMRs. This finding aligns with Herrera et al. (2010) [
9], who reported that short-term memory effects dominate in high-frequency demand signals, with autocorrelation coefficients declining rapidly after the first few hours. The strong performance of the 1-h lag model can be attributed to the persistence of consumption patterns within short intervals: the demand at any given moment is often a direct continuation of the preceding hour’s behavior, particularly in settings with stable occupancy such as residential buildings (B3) and institutional facilities (B1, B2). The weak performance of the 168-h lag model suggests that weekly periodicity, while present, is less deterministic than immediate consumption history. Factors such as special events, operational schedule changes, or weather fluctuations may disrupt weekly patterns, rendering them less reliable for real-time forecasting.
Despite the overall strong performance, peak demands, such as the 4.93 m
3 event observed in B2, were systematically underestimated. This is a common limitation in ANN-based demand forecasting, as highlighted by Donkor et al. [
33], where extreme events are often underrepresented in training data and thus inadequately captured by models optimized for average performance. The underestimation of peaks has operational implications: while mean errors are low, utilities relying solely on such forecasts may underestimate short-term capacity needs. This could be addressed by incorporating event-based variables, weather predictors, or demand amplification factors during historically peak-prone periods [
23].
From a utility management perspective, these results highlight the operational value of near-real-time forecasting models that exploit short-term consumption memory. For control applications such as pump scheduling, pressure management, or leakage detection, models with 1-h lag inputs offer a practical balance between computational simplicity and predictive performance. In longer-term planning contexts, daily forecasting with 24-h lag inputs can support demand allocation, resource planning, and tariff structuring, especially in systems serving diverse customer types.
The findings of this study also complement the outcomes of the BWDF [
22], which demonstrated that no single model consistently dominated across all DMAs, forecast horizons, and performance metrics. While ANN-based models performed competitively, the benchmark highlighted the superior robustness of hybrid approaches integrating machine learning and time-series methods. In this context, the present study contributes by showing that structured lag optimization enhances ANN accuracy across heterogeneous user types, thereby offering a practical refinement consistent with the comparative framework of forecasting approaches emphasized in the BWDF.
While the ANN models in this study achieved high accuracy, several limitations remain. The absence of meteorological and operational variables, the rarity of extreme events in the training dataset, and the potential lack of model generalizability across different contexts represent key limitations. Future research should explore hybrid approaches combining ANN with statistical decomposition, integrate weather and event-based predictors, and develop probabilistic forecasting schemes to quantify uncertainty and better capture rare peak demand episodes.
5. Conclusions
This study developed feed-forward backpropagation Artificial Neural Network (ANN) models to forecast short-term water demand at both daily and hourly resolutions for a District Metered Area (DMA) and three university buildings with distinct consumption profiles: an institutional restaurant (B1), an engineering school (B2), and a student residence (B3). One year of high-resolution smart metering data was used to evaluate model performance under two configurations: a baseline without historical consumption inputs and an optimized temporal lag approach incorporating prior consumption values. Results demonstrate that the inclusion of lag features substantially enhanced predictive accuracy across all sites. At the daily scale, adding a 1-day lag improved testing R2 values from 0.490 to 0.827 for the DMA, 0.900 to 0.902 for B1, 0.606 to 0.808 for B2, and 0.420 to 0.806 for B3. At the hourly scale, the inclusion of a 1-h lag produced similarly strong gains, with final testing R2 values of 0.944 (DMA), 0.940 (B1), 0.901 (B2), and 0.738 (B3), accurately reproducing both peak and off-peak demand patterns. These results confirm that temporal autocorrelation—particularly at short time lags—is a dominant driver of water demand variability and that ANN-based models can effectively leverage this property for operational forecasting. The proposed approach is computationally efficient, adaptable to diverse consumption contexts, and suitable for real-time deployment in smart water network management. Potential applications include near real-time leakage detection through deviations from forecasted demand, gap-filling in telemetry datasets, and improved operational planning. Future research should integrate additional exogenous drivers such as climatic, demographic, and event-based factors to further enhance peak demand capture, especially in residential settings with higher behavioral variability.