Water demand in watershed forecasting using a hybrid model based on autoregressive moving average and deep neural networks

Increasing water demand is exacerbating water shortages in water-scarce regions (such as India, China, and Iran). Effective water demand forecasting is essential for the sustainable management of water supply systems in watersheds. To alleviate the contradiction between water supply and demand in the basin, with water demand for economic growth as the main target, a hybrid moving autoregressive and deep neural network model (ARMA-DNN) was developed in this study, and four commonly used statistical indicators (MAE, RMSE, MSE, and R2) were selected to evaluate the performance of the model. Finally, the validity and practicality of the model were verified by taking the Minjiang River basin in China as an example. The results show that (a) the model can predict future water demand more accurately under the conditions of actual water consumption changes, (b) the ideal agricultural production in the Minjiang River Basin is predicted to be reached 2.26 × 109t in 2021, and (c) the highest industrial economic efficiency in Chengdu is 1.51 × 109yuan, while water satisfaction reaches 102%. This means that effective water demand forecasting can alleviate water demand conflicts under climate change conditions to a certain extent. At the same time, watershed managers can develop different water allocation schemes based on the prediction results of the hybrid ARMA-DNN model.


Introduction
Water is the most important resource for human survival and development. However, in many developing countries (China, India, and Pakistan, etc.), water scarcity has become a bottleneck for regional economic and social growth (Guo et al. 2019;Sharma 2021). To accommodate the rapid growth in municipal and industrial water demand, different water governance bodies around the world are committed to implementing measures to ensure the long-term healthy and sustainable use of water resources (Hu et al. 2016;Xu et al. 2016). As a result, scholars and engineers are working to develop more effective strategies and methods to improve the efficiency of water use (Tanveer and Huan 2019;Löwe et al. 2021). The correct estimation of water demand is the cornerstone of effective and affordable water resource utilization (Quilty and Adamowski 2020;Swfab et al. 2021).
Water demand forecasting can help water resource managers better prepare for emergencies and provide technical assistance for water resource conservation and management (Sun et al. 2016). Water demand forecasting systems are classified into two types: physically driven models and datadriven models. While physically driven models may adapt to water usage processes in the water sector, they usually require measurement data and expert knowledge to update the model's parameters and structure (Huang et al. 2014;Joodavi et al. 2020). In contrast, data-driven models feature fundamental processes that can be efficiently recorded without the requirement for precise mathematical knowledge. With the fast advancement of computer technology, various data-driven models, such as artificial neural networks (ANN), deep neural networks (DNN), and support vector machines (SVM), have grown increasingly popular in recent years (Wu and Chau 2013, Madrigal et al. 2018, Joodavi et al. 2020. Some major data-driven models have been developed and applied to water resource demand prediction as computer technology has progressed. He et al. (2019) proposed a hybrid D-DNN model based on variational mode decomposition (VMD) and deep neural network (DNN) to predict daily runoff. Kim et al. (2020) built a prediction model based on Extreme Learning Machine (BBO-ELM) and deep neural network (DNN) to predict future rainfall in various regions of India. Löwe et al. (2021) trained the neural network model by using terrain data and flood data. Du et al. (2020) proposed a Markov-modified auto-regression moving average (ARIMA) model based on the periodicity and randomness of daily water consumption data and improved the progress of water demand prediction. Liu et al. (2020) proposed the ARIMA model and a hybrid model combining a wavelet neural network and genetic algorithm to predict river water quality, and the prediction result was significantly better than the single model. However, few studies have considered combining deep neural networks with autoregressive moving average models to predict water resources (Sahour et al. 2020).
Water managers, on the one hand, want regional economic development and equality (Van Campenhout 2015; Hu et al. 2020). As a result, the entire basin's economic factors as well as the demand for water in various sectors must be considered. The availability of water resources throughout the basin leads to an increase in the basin's economic GDP (D'Exelle 2005;Bai et al. 2015). Agricultural water is primarily used for food production and animal husbandry, whereas industrial water is primarily used for food, paper, chemicals, and construction, all of which have significant economic implications for regional development (Zhou et al. 2015). Simultaneously, the proportion of water consumption can be used to test the water consumption forecasts of various sectors to some extent. Liu et al. (2018) used a hybrid model to predict monthly water demand in Austin, Texas, and discovered that demand was highly correlated with local population, monthly mean temperature, and monthly mean humidity; Niu and Feng (2021) used principal component analysis regression to study Shanghai's annual water demand; Sun et al. (2016) searched for five major factors that affect the sustainable use of water resources, including the economy, population, water supply and demand, and water quality.
Equal allocation of water resources, on the other hand, is linked to social stability (Cai 2005;Catal et al. 2011;Dariane and Azimi 2018). Managers of water resources hope that the water resource allocation plan will be able to meet actual social demand in a reasonable manner (Dehghani et al. 2019). The population, agricultural development, cultivated land area, industrial GDP, and environmental environment of cities throughout the basin are all manifestations of current social demand. Zhang et al. (2013) evaluated the long-term use of water resources in Beijing, China, considering economic, demographic, water supply and demand, land resources, water pollution, and management factors. Equal allocation of water resources, on the other hand, is linked to social stability (Yang et al. 2016(Yang et al. , 2017. Managers of water resources hope that the water resource allocation plan will be able to meet actual social demand in a reasonable manner (Xu et al. 2017). The population, agricultural development, cultivated land area, industrial GDP, and environmental environment of cities throughout the basin are all manifestations of current social demand.
The increasing uncertainty of water consumption and the instability of a single deep neural network prediction model (Yan and Liu 2020;Yang et al. 2018), which pushed back the need for water resource managers to be able to predict future water consumption accurately . Meanwhile, this study thoroughly analyzed the impacts of socioeconomic development, industrial water demand, and ecological water demand on the prediction model. As a result, deep neural networks and autoregressive moving averages should be integrated into water resource forecasting models (Xu et al. 2013;Sulaiman et al. 2019;Ou et al. 2021). In addition, to assure the correctness of the model outputs, the four regularly used statistical indicators (MSE, RMSE, MAE, and R 2 ) are thoroughly considered.
The following are the study's main contributions: (1) a hybrid autoregressive moving average and deep neural network model is constructed to forecast water consumption; (2) the main indicators of economic growth, social production, and industrial water use are integrated to ensure the accuracy of forecasting results; and (3) food output, social satisfaction, and industrial water use are effectively traded off in the hybrid model. Meanwhile, this study uses data from 2010 to 2020 to forecast water consumption in 2021 for each water-using sector in the Minjiang River basin (http:// tjj. sc. gov. cn/ scstjj/ c1058 55/ nj. shtml) in western China, which can obtain data for the most recent year and provide data for water allocation and scheduling plans for the coming year while ensuring the validity of the data and the reasonableness of the forecast results.
The rest of this study organized as follows. Section 2 gives the materials. The model is described in section 3. Section 4 applies the model to a case study, and the conclusions are given in part 5.

Study area
The Minjiang River is an important tributary of the Yangtze River (Fig. 1). The Minjiang River flows through eight cities, namely Aba, Chengdu, Zigong, Leshan, Meishan, Yibin, Ya'an, and Ziyang. In 2019, the Minjiang River Basin had a population of 15 million people, a cultivated area of 2244.98 ha, and a total water consumption of 11.274 billion cubic meters (Sichuan Statistical Yearbook 2019, http:// slt. sc. gov. cn/). According to the Sichuan Water Resources Bulletin, the Minjiang River Basin provides water resources for eight cities along the basin, and Chengdu, as the economic center of Sichuan Province, has a relatively large consumption of water resources. In addition, according to the principle of ecological priority (http:// www. mwr. gov. cn/ szs/ slcs/ 201612/ t2016 1222_ 776422. html), the minimum guaranteed water needs to be provided to the ecology under the condition of meeting the basic water consumption.

Data sources
The population, cultivated land area, total GDP, and grain output of eight municipalities in the Minjiang River Basin were statistically analyzed from 2010 to 2020 according to Sichuan province's Statistical Yearbook (Tables 1 and 2). Meanwhile, a statistical analysis was conducted on the ecological water, agricultural water, industrial water, other water, and the average annual water volume of the Minjiang River ins 8 municipalities directly according to the Water Resources Bulletin of Sichuan Province 2010-2020 (http:// slt. sc. gov. cn/).

Data pre-processing
The collected data was processed and analyzed to create the corresponding indicator system, which includes three primary indicators and fourteen secondary indicators. Data published by Sichuan Province can be used directly or indirectly to obtain the data for each index (shown in Supplementary materials Table 3). Meanwhile, the values of each evaluation index were mixed with Gaussian noise to generate

Model
The ARMA-DNN model was used in this study to forecast each region's future water demand. To begin, the DNN model was built using each indicator in Table 3 as an input and the water demand of each department as an output. Then, to determine the future water demand, the ARMA model is used to predict each evaluation index of each region in the future. After obtaining the index values of each region in the future, the DNN model is finally used to complete the prediction of the water demand of each region and the water demand of each department.

Symbol description
To facilitate model construction and description, we give the following notation and definitions (Table 4).

Autoregressive moving average model
The autoregressive moving average model ARMA(n, m) is established for the data series of each evaluation index as follows: where φ i (i = 1, 2, …, n) is the autoregressive parameter, θ j (j = 1, 2, …, m) is the moving average parameter, {α t } is a normal white noise process with a mean value of 0 and variance 2 a , and t ∼ N 0, 2 a . For each original evaluation index sequence, when its value is too large or too small, to ensure calculation accuracy, reduce rounding error, and avoid overflow, the original evaluation index sequence can be standardized. x ′ t is denoted as the original evaluation index sequence, and the data can be standardized as follows: (1) For formula 2, μ x and 2 x are respectively the estimation of the mean and variance of x ′ t , and their algorithms are as follows: In the above two formulae, N is the number of evaluation index sequences, which here is the number of years. The normalized sequence {x t } is modeled according to  Hide the corresponding weight matrix between the layer and the output layer b Offset variable x Input value vector (evaluation index vector) a L Output vector (predicted value of per capita water consumption) y Actual per capita water consumption δ l The gradient of z l at the l layer ε Iterative threshold φ i (i = 1, 2, ⋯, n) Autoregressive parameter θ j (j = 1, 2, ⋯, m) Moving average parameter N Number of evaluation index sequences {α t } White-noise process {SW t } Prediction evaluation index sequence R k Evaluate the autocovariance function of index time series AIC Criterion function σ(z) Prediction function J (W, b, x, y) Loss function the autoregressive moving average model (Orimoloye and Sung. 2020), and the prediction evaluation index sequence {SW t } is obtained as follows: Upon the framework, we can predict the evaluation index value and compare the distribution characteristics of the predicted and measured evaluation index values to show that the time series model proposed in this paper can be used to predict the water resources allocation evaluation indicator.

Deep neural network model
The input and output model of deep neural network (DNN) model is different from that of simple pairs (Ahmad and Chen 2020). There will be a linear relationship between simple output and input, and the intermediate output result will be: It is activation function is: The actual situation of DNN is composed of several input layers, several hidden layers and several output layers. It is fully connected between layers, and any neuron of layer i is connected with neuron of layer i +1. It has z = ∑ m i=1 w i x i + b linear relationship (Ahmad and Chen 2019), z = ∑ m i=1 w i x i + b plus the activation function σ(z). As the number of layers of DNN is larger, the number of coefficients W and offset B will also be larger. The following takes DNN of a hidden layer as an example to explain the working principle of DNN. The schematic diagram of DNN structure is shown in Fig. 2. The specific principles of DNN are shown in Supplementary Material 2.

Model evaluation indicators
The root mean squared error (RMSE), mean squared error (MSE), mean absolute error (MAE), and correlation coefficient (R 2 ) are four well-known statistical measures used to evaluate the accuracy of forecasting models (Alizadeh et al. 2018;Finlayson 2017). R 2 in the range [−1, 1] represents the linear connection between two time series. There is no linear association if R 2 = 0; if R 2 = 1 or 1, there is a wholly (7) sign(z) = −1z < 0 1z ≥ 0

Results and discussion
In this study, the Minjiang River Basin is used to test the feasibility, effectiveness, and practicability of the auto-regression moving average and deep neural network models, and the water demand and economic index values of the basin are predicted to depict the relationship between different water consumption sectors in the basin. The water consumption of three water consumption departments in eight Minjiang River Basin sub-regions, as well as the water demand distribution scheme among departments, are obtained. The basin's water consumption and economic analysis will be described in the following two summaries to verify the model's reliability.

Forecast analysis of water demand in the watershed
Data from 2010 to 2020 were used as DNN training data to forecast the water consumption of the water sector in the Minjiang River Basin in 2021, and the data set was set as 15 evaluation indexes, including water shortage rate, river water resource utilization rate, and urban water resource utilization effect evaluation score. Table 6 shows the values of DNN's hyperparameters. The predicted results, as shown in Table 7 and Fig. 3, show that the Minjiang river basin water consumption and water consumption forecast have a maximum variation of 58.66. Through comparison and analysis of the results, the results show that the water in the current situation changes, and the model can forecast future water basins.
It is worth noting that the MAE of the model is 5.14, R 2 is 0.78 (<1), and the error of the mean square RMSE is 5.690 (as shown in Table 8), indicating that the model has a good prediction effect and can be used to predict the water consumption of various cities in the future. The model can be used to estimate future water consumption and provide guidance for watershed managers.

Analysis of water demand plan of the watershed water sector
The future basin water quantity is one of the main factors affecting the basin water management, which will influence Table 5 Model evaluation metrics and implications Note: m is the number of samples, y i is known data, ŷ i is model predicted data, MSE(ŷ, y) is the mean square error between predicted data and known data, and Var(y) is the sample variance of known data.

Evaluation index
Definitions Value Var (y) [−1, 1] the future water allocation scheme. Using the water demand data as a training set, the water demand of different regions in the coming year is predicted, and Table 9 shows the allocation of water resources in the basin in the next year, in which Chengdu has the largest total water supply of 41.678 billion m 3 . Due to its huge economic volume, its GDP will reach 199.198 billion yuan in 2021, exceeding the total GDP of the other seven cities in the Minjiang River basin. At the same time, due to the differences in the industrial structure and development level of the Minjiang River region, there are obvious differences in water consumption in the water conservancy sector in different areas of the Minjiang River basin, with Chengdu using more water at 1471.3 billion cubic meters, which is closely related to the economic development and population surge of Chengdu, Meishan, Yibin, Zigong, Neijiang, Leshan, and Zigong, where more industrial water is used, indicating that these six cities attach more importance to economic development, while Aba has more water for ecological environment and domestic use, which is related to the rapid development of Aba. The future water allocation plan should not only consider the water demand between different water-using sectors in the region but also consider the actual development of each region for water allocation prediction. Figure 4 shows the trend of water distribution in the Minjiang River basin in the coming year under different regional conditions. In addition, we can also see from Fig. 4 that the Minjiang River has the highest agricultural water use in Leshan, the highest industrial water use in Meishan, and the highest water use in Chengdu. The ecological and environmental water use in the eight cities along the Minjiang River is relatively balanced. In addition, the changes in agricultural and domestic water use in the eight cities of the Minjiang River basin are consistent, while the changes in industrial water use are large, indicating that there are obvious regional development differences within the basin. Therefore,  considering the trends of future water consumption in different water-using sectors in the basin can characterize the reasonableness and fairness of future water demand plans and provide data support for water resource managers in the basin in the light of actual conditions.

Agricultural grain output
The Minjiang river valley in Neijiang has the most developed agriculture, with food production reaching 68,911.32 tons in 2021, followed by Leshan, Meishan, Yibin, Zigong, Yaan, Chengdu, and Aba. The agricultural grain output of Chengdu and Aba is at the bottom with 4037.62 tons and 1886.26 tons, respectively, which is due to the transformation of Chengdu's industrial structure and the reduction of agricultural land, which further reduces the agricultural grain output (Fig. 5). Aba cannot produce too much grain due to its geographical location and soil conditions. It is worth noting that changes in agricultural water use in watersheds directly limit agricultural development, but regional development plans and missions should also be considered to make water allocation plans more consistent with future water use trends. Therefore, the prediction of agri-grain yield is consistent with the current situation, and the model can predict the agri-grain yield under ideal conditions in the future and provide a reference for the collaborative development of the basin.

Industrial economic output
The future of the industrial water demand plan will have a significant impact on the development of the urban economy, as shown in Fig. 6, indicating that the basin economic development difference is obvious, with Chengdu's industrial output being the highest at 1.5055924 billion yuan. The industrial economic output value of Ya'an and Yibin is relatively low in the Minjiang River Basin, which is 20186.12 yuan and 222.6392 yuan, respectively. The industrial economic output value of Chengdu is in the first place; Neijiang, Meishan, and Aba are in the second tier; the industrial economic output value of Zigong is in the third tier; and Leshan, Ya'an, and Aba are at the bottom. Compared with the current situation, the change in industrial water demand plan will change the phenomenon that the economic output value of Chengdu city exceeds the other 7 cities in the basin, which is conducive to the coordinated and balanced development of the basin, and the prediction of the industrial economic output of cities in the basin will provide urban development assessment advice for water resources allocation and urban development in the later period.

Satisfaction with domestic water
Ensuring basic life demands is the basic condition of water resource allocation. Figure 7 shows that life satisfaction with water forecast in 2021, by using satisfaction to show the stand or fall of a water allocation scheme, in which Chengdu satisfaction reached 102%. The residents' living water supply is met and the rest of the water resources are available to cope with population growth. The rest of the Minjiang river valley was 7, where satisfaction is above 54%. We already meet the demand of the residents' living water. Residents' satisfaction with water is relatively low in Neijiang, Yaan, Aba, and Zigong City. There are still about 40% that we did not meet. Leshan and Meishan and YIbin's water for life satisfaction is higher. Simultaneously, with the deterioration of climate conditions and the scarcity of water resources, predicting the future of water can provide a foundation for water resource allocation plans. It is important to note that when the climate conditions are serious and there is a shortage of water resources, effective water demand forecasting can provide data support to relieve the contradictions of water demand. At the same time, water-saving measures should be taken in each region of the basin.

Conclusion
In this study, a hybrid ARMA-DNN model was developed to predict water demand, and four commonly used statistical performance indicators (MAE, RMSE, MSE, R2) were selected to evaluate the model. Finally, an empirical study of the model was conducted by selecting the Minjiang River in western China with the example, and the results showed that the hybrid ARMA-DNN forecasting model has good performance with the values of MAE of 5.14, R 2 of 0.78 (<1), RMSE of 17.53, and agricultural water demand forecast of 2.26 × 10 9 t in 2021 for the Minjiang River basin. In addition, this study focused on agricultural, industrial, and domestic water demand in the model development process and obtained different predictions, implying that inputting different model metrics during the model development process will have a large impact on the model results. In the face of climate change and water scarcity, water demand forecasting is an important early warning avenue in the water allocation process. In addition, due to Aba the availability of data, and this study selected 11 years of data to predict future water demand. In order to be a more accurate and reliable model, future studies can consider data of longer time dimension and develop more effective models to predict water demand.