A Hybrid Neural Network-based Approach for Forecasting Water Demand

2022-11-10 02:31AlBatoolAlGhamdiSouadKamelandMashaelKhayyat
Computers Materials&Continua 2022年10期

Al-Batool Al-Ghamdi,Souad Kamel and Mashael Khayyat

1Department of Computer Science and Artificial Intelligence,College of Computer Sciences and Engineering,University of Jeddah,Jeddah 21959,Saudi Arabia

2Department of Computer and Network Engineering,College of Computer Sciences and Engineering,University of Jeddah,Jeddah 21959,Saudi Arabia

3Department of Information Systems and Technology,College of Computer Sciences and Engineering,University of Jeddah,Jeddah 21959,Saudi Arabia

Abstract:Water is a vital resource.It supports a multitude of industries,civilizations,and agriculture.However,climatic conditions impact water availability,particularly in desert areas where the temperature is high,and rain is scarce.Therefore,it is crucial to forecast water demand to provide it to sectors either on regular or emergency days.The study aims to develop an accurate model to forecast daily water demand under the impact of climatic conditions.This forecasting is known as a multivariate time series because it uses both the historical data of water demand and climatic conditions to forecast the future.Focusing on the collected data of Jeddah city,Saudi Arabia in the period between 2004 and 2018,we develop a hybrid approach that uses Artificial Neural Networks (ANN) for forecasting and Particle Swarm Optimization algorithm(PSO)for tuning ANNs’hyperparameters.Based on the Root Mean Square Error(RMSE)metric,results show that the(PSO-ANN)is an accurate model for multivariate time series forecasting.Also,the first day is the most difficult day for prediction (highest error rate),while the second day is the easiest to predict (lowest error rate).Finally,correlation analysis shows that the dew point is the most climatic factor affecting water demand.

Keywords:Water demand;forecasting;artificial neural network;multivariate time series;climatic conditions;particle swarm optimization;hybrid algorithm

1 Introduction

Water is a precious resource for sustaining life on our planet.Currently,countries suffer from challenges in the availability of freshwater,as its availability may reach 44% of the global land area by the end of the century[1].Water scarcity due to climate change caused pressure on governments to supply water to urban,industrial,and agricultural sectors.Studies have indicated that climate change will constitute a major limitation on urban water demand and will increase by 80% in 2050[2].The Food and Agriculture Organization of the United Nations(FAO)indicated that an increase in evaporation and a decrease in soil moisture can affect freshwater availability especially in arid regions[1].Therefore,many researchers have focused on studying the impact of climate change[3-5].

The Kingdom of Saudi Arabia is the largest country in the Arabian Peninsula.It is located in the continent of Asia.It has a warm and dry desert climate with high temperatures above 50 degrees and an average rainfall of 114 ml per year[6].Also,it suffers from a lack of water resources such as rivers and lakes.Since the United Nations classified Saudi Arabia as a country suffering from water scarcity,providing water to various sectors,as the demand increased by 70%from 2007 to 2018,constitutes a major challenge.So,to supply water,the government resorted to desalinating sea water.In 1970s,the first seawater desalination plant was established in Al-Jubail[6].Now,it reaches 32 stations distributed on the eastern and western coasts of the century.Therefore,the Saline Water Conversion Corporation was classified as the largest corporation in the world for the production of desalinated water[7].However,water desalination has negative effects on the environment,such as the emission of harmful gases into the air,as well as the consumption of 25%of fuel,which has an economic impact on the country[8].Therefore,there is a need to accurately predict the amount of water demand under the arid climatic conditions in order to help the government to supply water to all sectors either in normal or emergency situations and to preserve the environment as well as the economy.

Forecasting can be classified into two types.The former is the short-term type.Its range is from one day to two weeks.The latter is the long-term type.Its range is longer than one year[9].Also,forecasting can be classified either into univariate or multivariate.Univariate time-series forecasting is predicting the future based on one variable.While multivariate one depends on more than one variable to predict future values.Techniques used for forecasting can be divided into two classes:traditional techniques such as Autoregressive Integrated Moving Average(ARIMA),ineffective when dealing with large data or predicting multivariate time series[10],and Machine Learning(ML)techniques such as ANN,used for prediction,classification,recognition...etc.[11].ANN is one of the most widely used techniques for forecasting because of its fault tolerance and its ability to deal with non-linear and complex data.Besides,ANN can be generalized after completing their training[12,13].

Seeking performance enhancement,many studies combined neural networks with other algorithms in the pre-processing phase or in the post-processing one,or for hyperparameters tuning[14-18].Hyperparameter tuning is the process of enhancing a model’s performance to avoid overfitting and excessive variation[19].It poses a great challenge to researchers and developers.Tuning them manually through Trial and Error,depends on the researcher’s experience.Wrong parameter tuning can cause a model inaccuracy.In fact,the parameter adjustment fluctuates the accuracy of the classification from 32.2% to 92.6%[20].Instead of using Trial and Error,many techniques were used such as Grid search and PSO.In Grid search,researchers specify the minimum and maximum ranges,and the algorithm searches all possible combinations.But this consumes a long-time to find the optimal hyperparameters[21].PSO which is a nature-inspired algorithm constitutes a good alternative.It is widely used to find the optimal hyperparameters since it is fast,easy to implement and can converge to a global optimum[22].Haider et al.[23]presented an open-source package to select the optimal parameters using a PSO,named as“Package for parameters Selection using Particle Swarm Optimization(PSPSO).”This package selects the optimal number of neurons in hidden layers.It also specifies the learning rate,the optimal optimizer used to update weights,and the activation function in hidden and output layers.It supports four models.One of these models is Multilayer Perception(MLP),which is the most popular type of ANN used for forecasting[9].However,one limitation of this package is that it is not dedicated to time series forecasting.Also,it does not support cross-validation for evaluating the prediction.Finally,it is built to be used only for classification and regression.

The above problems prompted us to improve the performance of ANN and select the optimal hyperparameters to build an accurate model that can be used for forecasting water demand while taking into account the climatic conditions in Jeddah city,Saudi Arabia.So,the main objectives of our research are:

• Selecting optimal hyperparameters for MLP using PSO.

• Evaluating time series forecasting using walk-forward validation.

• Forecasting water demand in Jeddah city (while taking into account the climatic conditions)using the proposed hybrid model PSO-ANN.

The remainder of this paper is structured as follows:Section 2 presents the literature review.Section 3 describes the methodology.Section 4 presents the results and discussion.And finally,Section 5 provides conclusions.

2 Literature Review

Many researchers have examined the impact of climate change on water demand.They used various models such as Global Circulation Models (GCMs).In[24,25],the GCMs have been used for long-term forecasting (up to 2100).The result showed that rising temperature highly affects water demand.The disadvantages of these models are that they are expensive and high complex[26].Al-Juaidi et al.[27]used the Water Evaluation and Planning system model (WEAP) to predict water needs in Jeddah City,Saudi Arabia.But tuning WEAP model is very difficult because it contains a large number of parameters[28].Chowdhury et al.[29]forecasted crop water demand in Al-Jouf city of Saudi Arabia under the impact of climatic conditions in the long-term.They used CROPWAT software which is recommended by FAO.However,the software is designed to calculate and forecast only crop water consumption.It is not highly accurate and needs adjustment and calibration to get adequate forecasts[30].Rasifaghihi et al.[15]used Bayesian techniques and clustering to deal with a limited dataset.They found that temperature and precipitation have a high impact on water demand.In the study[31],the Autoregressive(AR)model has been used to forecast and the Singular Spectrum Analysis(SSA)to improve accuracy.Huntra et al.[32]used two models.The former is ARIMA model for univariate time series forecasting(water consumption).The latter is the Autoregressive Integrated Moving Average with Explanatory Variable (ARIMAX) for multivariate time series forecasting (water consumption under the impact of the climatic conditions).The result showed that the average temperature and the dew point have a high impact on water demand.The previous traditional methods mentioned above have the disadvantage of not handling non-linear data.The dataset must be preprocessed to make it stationary by removing seasonality and trend.This preprocessing step is optional in ML techniques,but it could be helpful in increasing performance.

Nowadays,ANN is widely used for forecasting.Al-Ghamdi et al.[10]forecasted water demand in Jeddah city of Saudi Arabia using MLP in the short-term.The hyperparameters are tuned by a grid search algorithm.In the study[33],MLP has been compared with six other models for the short-term prediction of water needs while taking into account the climatic conditions.Results showed that MLP provides the best performance.Also,Narvekar et al.[34]used MLP to predict changes of climatic conditions in the short-term.Oyebode[35]discussed the importance of data pre-processing and its capability to improve the model performance while forecasting water demand under the impact of climatic conditions and population.MLP is efficient for both short-term and long-term forecasting.Ajbar et al.[36]found that the temperature is the highly affecting factor on water consumption while predicting of municipal water production in touristic Mecca city,Saudi Arabia using neural networks.Finally,Alotaibi et al.[26]forecasted rainfall and temperature in the Qassim region,Saudi Arabia.They used the ANN,GCMs and adaptive neuro-fuzzy inference system (ANFIS) models for comparing the performance.They used GCMs because is useful for predicting the impact of greenhouse gas emission scenarios.GCMs were developed by the Intergovernmental Panel on Climate Change (IPCC) rather than ANN and ANFIS.The ANN and ANFIS used historical data for prediction.Alotaibi et al.[26]found that ANN results were relatively similar to GCMs’ones.They found also that temperature will increase in the future.

However,improving ANN’s performance poses a great challenge for researchers and developers.Hence,they try to use hybrid models,as we mentioned in Section 1.Al-Zahrani et al.[37]studied the effectiveness of the hybrid model for forecasting daily domestic water consumption under the impact of climatic conditions in Al-Khobar city,Saudi Arabia.They used a hybrid ML model(General Regression Neural Network (GRNN)) with the traditional model which are AR,Moving Average(MA)and Autoregressive Moving Average(ARMA).Also,Zubaidi et al.[38]implemented a hybrid model that uses Lighting Search Algorithm (LSA) for hyperparameters’tuning and MLP for water consumption prediction under the impact of climate variations.Then,they compared their model with the PSO-ANN and Gravitational Search Algorithm (GSA-ANN).Results showed that LSAANN provides the highest performance with an R2equal to 0.96.Also,the results showed that the maximum temperature is the highest valuable parameter affecting experimentations.However,LSA has some limitations.It has a low convergence.Besides,it can easily be down into a local optimum[39].In the study[40],a new model has been designed for forecasting is a Backtracking Search Algorithm(BSA)and ANN,called BSA-ANN.Then,BSA-ANN was compared with the Crow Search Algorithm(CSA).The result showed that BSA-ANN outperformed the CSA-ANN.However,BSA like the previous LSA is easy to down into a local optimum and has a low convergence[41].PSO-ANN is extensively used for forecasting.It can be used to predict the surface settlement caused by tunnel excavations[42].Also,it can be used to forecast the water level to reduce floods’effects[43].Besides,PSO-ANN can be useful in energy especially in wind power prediction[44].Results showed that the hybrid PSO-ANN is reliable,effective,and improves the model’s performance.

In summary,a multitude of models were used to forecast water demand.Only in the study[38],PSO has been used to select hyperparameters of ANN.They determine only the optimal number of neurons in hidden layers and the learning rate.However,five hyperparameters have been specified in the PSPSO package[23].But PSPSO presents some limitations as mentioned in the previous section(i.e.,did not support time series and cross-validation).Therefore,we improve the PSPSO to forecast multivariate time series and evaluate the forecasting using walk-forward validation.Tab.1 summarizes the models used for predicting water demand and their limitations.

Table 1:Summary of water demand forecasting models and their limitations

Ref.Model used Limitations[29]CROPWAT software -It can only be used to predict crop water.-It is not highly accurate.-It is needs adjustment and calibration to get adequate forecasts.[15]Bayesian techniques and cluster.Using for a limited data set.[31]AR and SSA.Using for univariate time series forecasting.[32]ARIMA,ARIMAX.Do not deal with non-linear.[10]ANN.Tuning of hyperparameters based on grid search.[33]Comparison ANN with six models.Tuning of hyperparameters based on trial and error.[34]ANN.Tuning of hyperparameters based on trial and error.[35]ANN.Tuning of hyperparameters based on trial and error.[36]ANN.Tuning of hyperparameters based on trial and error.[26]ANN,ANFIS and GCMs.-Tuning ANN’s hyperparameters based on trial and error.-ANN cannot be used for forecasting emission scenario.[37]ANN,AR,MA,ARMA Tuning ANN’s hyperparameters based on trial and error.[38]LSA-ANN,PSO-ANN.-LSA has a low convergence and can easily down into a local optimum.-Using PSO-ANN to select only the optimal number of neurons in hidden layers and the learning rate.[40]BSA-ANN.BSA has a low convergence and can easily down into a local optimum.[23]PSO to tune four models(MLP,SVM,XGBoost and GBDT).Does not support time series forecasting and walk-forward validation.[42-44]PSO-ANN.Are not designed for predicting water demand(but used in surface settlement,wind power...).Our work PSO-ANN.The model is designed for time series forecasting using MLP but does not support other tasks such as regression or other algorithms such as a Recurrent Neural Network.

3 Methodology

Two main parts can be found in our methodology.It starts with data collection,analysis,and pre-processing.Then,ends by multivariate time series forecasting using PSO-ANN.

3.1 Data Collection

We collect water consumption data in Jeddah city,Saudi Arabia,from the General Directorate of Water in Jeddah(from 2004 to 2018).Also,we collect climatic conditions data from the National Aeronautics and Space Administration (NASA)[45].We consider precipitations,wind speed,humidity,dew point,surface pressure,maximum temperature(max),average temperature(avg),and minimum temperature (min).Then,we split the data into three sets based on their chronological order,not randomly.In fact,the values in the time series are interdependent.The first one is for training and contains 70%of the rows.The second is for validation and contains 15%of rows.And the last set is for testing and contains 15%of rows.

3.2 Data Analysis and Pre-Processing

Here,we analyze the data set of water demand and climatic conditions using Box-Whisker plot.It provides more information about the dataset such as the spread of data,outliers and median values.For water,in Fig.1a,the median values show an increase over years.The spread shows some variability.Also,earlier years are quite different from later ones.Moreover,there are outliers.However,Fig.1b shows that the median values and the spread of data appear reasonably stable for each month.For climatic conditions (see Fig.1a) the median values and the spread of all climate parameters except precipitation appear reasonably stable for each year.But in Fig.1b,we note that the median is constant in most climatic factors and slightly different in wind speed.The spread is apparent in the box,rising in specific months and decreasing in other ones for all climate parameters.However,it does not show any information about precipitation due to its scarcity in Jeddah city.

Figure 1:Box-Whisker plot for water demand and climatic conditions (a) yearly data plot and (b)monthly data plot

Then,we determine the most climate factors correlated with water using Spearman’s correlation.Spearman’s correlation is useful to find non-linear relationships[46].As shown in Fig.2,the dew point is the most correlated factor with water.Then,temperatures(max,min,avg)are in the second rank.Also,there is a slight correlation between humidity and water.In this study,we use the dew point and temperatures(max,min,avg)as the most influential factors in water demand.

Then,we analyze the data.It is useful in time series to analyze the data set to learn more about it in order to make any pre-processing needed.The pre-processing aims to improve the model’s performance.In this stage,we perform three operations.The first operation is to make our timeseries stationary.The second operation is to normalize the inputs and the third one is to make it as a supervised learning.Most of the time series are non-stationary.They have trend and seasonality.In ML techniques,it is preferable to remove trend and seasonality to improve the model’s performance.In this paper,we remove February 29(leap years).Then,we remove the trend using differencing.Finally,we remove seasonality by subtracting the day from the same day in the previous year.As shown in Fig.3,climatic parameters contain systematic seasonality for each year in dew point and temperatures but don’t have any trend.Fig.3 shows also that the water demand increases over years (it has a trend),but the seasonal pattern is not clear.Because,the line plot doesn’t show the seasonal pattern in water demand,we use seasonal subseries plot to clearly view the seasonality.As shown in Fig.4,the water has slightly the seasonal pattern.

Figure 2:Spearman’s correlation

The next step is the normalization of inputs.We use the min-max method because it provides high performance.Further details about normalization can be found through the reference[10].Then,we convert our time series into a supervised learning dataset.The observations of time series are interdependent.We used a sequence of past observations (X) to forecast sequence values (Y)[47].Then,we use the value (Y) as input for the next prediction and so on,as shown in Eq.(1).So,we divide the dataset into the sequence of inputs (called input layer) and sequence of outputs.In this paper,we forecast next week so the sequence of output is seven values.

Y=f(X)(1)

Figure 3:Line plot of water demand and climatic conditions

Figure 4:The seasonal subseries plot of water demand

3.3 Artificial Neural Network(ANN)

Artificial Neural Networks are based on brain-inspired principles.In fact,ANN is able to analyze and extract complex non-linear relationships.ANN is very useful to solve complex problems such as forecasting.In forecasting,three models are extensively deployed.These models are MLP,Recurrent Neural Network(RNN)and Radial Basis Function Neural Network(RBF)[9].

In this work,we used MLP to predict water demand.The architecture(as shown in Fig.5)and hyperparameters (as shown in Tab.2) can be trained using a backpropagation algorithm.In this algorithm,the input training pattern is fed-forward,errors are calculated and backpropagated,and the synapses are weighted accordingly[48,49].The backpropagation algorithm is useful for learning complex and large-scale problems[50].During training,the amount controlling weight update is called the learning rate(η).The structure of MLP contains three layers.It contains the input,the hidden and the output layers.The output layer has seven neurons to predict the next 7 days(as called multi-step time series forecasting).

Figure 5:The structure of MLP

Table 2:ANN hyperparameters

Then,we select the best activation function.The most common type of activation function used in hidden layers is sigmoid.Another common type is the Rectified Linear Unit (ReLU).The most common types of activation function used in the output layer are the ReLU and linear(see Fig.6).

Figure 6:The activation functions for hidden and output layers

Also,we select the best optimizer (i.e.,adam,adamax...) and theηused for adjusting weights of the synapses.Training is repeated till a certain number of iterations (example:1000 epochs) and stopped when the model’s performance cannot be improved or reaches a minimum error.Finally,we evaluate the final model using walk-forward validation.It predicts one step and evaluates the result against the known value using RMSE,then it stores for the next prediction.This process will be repeated finishing all the testing data.Although its computational cost is high because it moves one step through the time series,it is robust for time series forecasting[47].The outputof MLP model can be calculated by Eq.(2).

where,f(.)is the activation function,bis the bias,ware weights(w1,...,wn)andxare inputs from 1 tonneurons(x1,...,xn).The weight is updated using optimization techniques(i.e.,adam)and theη.To evaluate the performance of a model,we use RMSE metric calculated as in Eq.(3):

where,nis the number of historical data(x index varying from1 ton),yxis the actual value andis the forecasted value.

3.4 Particle Swarm Optimization(PSO)

In 1995,Kennedy and Eberhart presented a particle search algorithm that mimics the behavior of fish and birds[51].There are several candidates for the optimal solution,each of which is driven by individual search(cognitive search)and global search(social search)to minimize the error function shown in Eq.(4).

Each particle has a position denoted byxiϵRn,i=1,..,n,wherenis the number of particles.Also,it has a velocity denoted byviϵRn.Finally,each particle has a fitness value to evaluate its quality.So,during the search process and over each iteration(t),particles move according to Eq.(5).

where,xdenotes the position of particles.idenotes the number of particles.tis the current iteration.The velocityis adjusted according to Eq.(6).

where,

•ωis inertia weight,the common value is:ω=0.7298,

•C1andC2are cognition learning factor and social learning rate,respectively.The common value is:C1=C2=1.49618,

•r1andr2are uniformly random numbers in[0,1],

Tab.3 represents PSO’s hyperparameters used in our work.In this study,we try the model’s effectiveness using population(size=20)and number of iterations(50).

Table 3:PSO’s hyperparameters

3.5 Multivariate Time Series Forecasting Using PSO-ANN

Fig.7 shows steps followed to predict water needs under the impact of climatic conditions using PSO-ANN.These steps can be detailed as follows:

1.Load the data of water demand and climatic conditions from 2004 to 2018.

2.Pre-process the dataset(make it stationary,remove leap year,normalize,and convert time series to a supervised learning).

3.Implement the naïve approach to compare its results with those obtained in PSO-ANN.

4.Specify PSO’s hyperparameters(Tab.3).

5.Specify MLP’s hyperparameters(i.e.,number of epochs in Tab.2).

6.Assignt=1 for the first iteration.

7.Initialize particles randomly(Tab.2 and Eq.(7))

8.Evaluate each particle according to equations Eqs.(8)and(9),then update the personal bestfor each particle and the global bestfor the entire population.

9.Increment the iteration:t=t+1.

10.Update the position of each particle using Eqs.(5)and(6).

11.Update activation functions,the number of hidden neurons,η,andw.

12.Compute the fitness function for each particle using Eqs.(8)and(9).13.Compare the current fitness function to its previous.If the current is improved,then set.

14.Determine and update the global best particle in the swarm.

15.Repeat from step(9)until reaching the max iteration,then output theas the best solution.

Figure 7:The methodology of multivariate time series forecasting

4 Results and Discussion

For implementation,we used Python language.In the following subsections,we show results after making our series stationary,results of naïve forecasting,and results of multivariate time series forecasting using PSO-ANN.

4.1 Making Our Series Stationary

As mentioned in Sub-Section 3.2,we firstly determine the most climate factors correlated with water demand using Spearman’s correlation.The result shows that the dew point is the most factor affecting water demand,then min,avg and max temperature by 0.155,0.151,0.137 and 0.144 respectively,as shown in Fig.2.Then we make our time series stationary by removing trend from water demand and seasonality from climatic conditions(see Fig.8).Now,our time series is ready to be modeled.

4.2 Results of Naïve Forecasting

Naïve forecasting is usually used as a baseline for performance’s evaluation.It can be very helpful for improving the proposed model.So,we do three experiments for forecasting the next seven days.We evaluate the forecasting for each day separately and also over all days.Our three experiments used the last day prior(one past day is called daily),the prior week(seven past days is called weekly),and the same week for the last year(seven past days of the last year is called week-yearly).This step is helpful to determine the best number of inputs used for forecasting.Tab.4 and Fig.9 show results of naïve forecasting.Tab.4 shows that,in the first row,we obtain the best performance for all days.Also,the 1stday provided accurate forecasting rather than other days.As shown in Fig.9,the error of week-yearly is very large,but there is a similarity between daily and weekly.The error rate is similar on the 7thday.Also,we consider for the daily curve that the 1stday is the accurate day for forecasting,unlike the 5thday,which is the worst one.

Figure 8:Line plot for our time series after making it stationary

Table 4:RMSE of Naïve forecasting

Figure 9:Naïve forecasting

4.3 Results of Multivariate Time Series Forecasting Using PSO-ANN

Tab.5 shows a comparison between the naïve approach and PSO-ANN.The performance’s prediction has been improved from 17.5 to 11.6.The second day is the easiest day to predict(lowest error),while the first day is the most difficult day to predict(highest error).

Table 5:Comparison between the naïve approach and PSO-ANN

The line plot for RMSE using naïve and PSO-ANN is shown in Fig.10.The RMSE of the 1stday closes in both models.For the following days,the error using the naïve approach increases over time,whereas it decreases when using PSO-ANN.As shown in the PSO-ANN curve,the 1stday has the highest error while the 2ndday has the lowest error and can be considered the accurate day for forecasting.Then,the error increases again on the 3rdday and decreases in the following two days.Finally,it increases and becomes stable during the last two days.

Figure 10:Comparison between the naïve approach and PSO-ANN forecasting

Hence,we use PSO-ANN to predict daily water needs while considering the impact of climatic conditions.Fig.11 depicts the number of days used on training,validation,testing,and prediction.However,Fig.12 illustrates a zoomed-in view of the testing and prediction.It indicates that prediction values are closely following testing values.

We can conclude that the PSO-ANN’s performance is effective.Hence,our hybrid model can be generalized to be used in a multitude of multivariate time series problems.This work used PSO to tune ANN’s hyperparameters instead of using a traditional grid random search algorithm.

Figure 11:PSO-ANN forecasting

Figure 12:A zoomed-in view of PSO-ANN forecasting

5 Conclusion

Throughout our work,we developed a hybrid model for forecasting daily water needs while considering climatic conditions.The historical data was collected in the period(2004-2018)in Jeddah city,Saudi Arabia.Then,we study the relationship between water demand and climatic conditions using Spearman’s correlation.After that,we pre-processed the multivariate time series in order to make it stationary by removing trend and seasonality.We used the min-max for normalization and converted it to supervised learning.Then,we used ANN for forecasting the future,PSO for tuning ANN’s hyperparameters and the naïve approach for comparison.Finally,we provided the hybrid model called PSO-ANN to predict water needs under the impact of climatic conditions.Walk-forward validation has been used for evaluating PSO-ANN.Results showed PSO-ANN is an accurate model and reliable for forecasting.In fact,PSO-ANN outperformed the naïve approach.The RMSE in PSOANN is equal to 11.6 while it is equal to 17.5 in the naïve approach.Also,results showed that the RMSE on the first day is the biggest,while the RMSE on the second day is the smallest.Finally,results showed that the dew point is the most climatic condition affecting water demand.Future work can investigate other extensively used techniques such as genetic algorithm or any other evolutionary algorithms for ANN’s hyperparameters tuning.

Acknowledgement:We are deeply grateful to the General Directorate of Water in Jeddah,Saudi Arabia for providing us with the historical water consumption.

Funding Statement:The authors received no specific funding for this study.

Conflicts of Interest:The authors declare that they have no conflicts of interest to report regarding the present study.