Regional Inundation Forecasting Using Machine Learning Techniques with the Internet of Things

: Natural disasters have tended to increase and become more severe over the last decades. A preparation measure to cope with future floods is flood forecasting in each particular area for warning involved persons and resulting in the reduction of damage. Machine learning (ML) techniques have a great capability to model the nonlinear dynamic feature in hydrological processes, such as flood forecasts. Internet of Things (IoT) sensors are useful for carrying out the monitoring of natural environments. This study proposes a machine learning-based flood forecast model to predict average regional flood inundation depth in the Erren River basin in south Taiwan and to input the IoT sensor data into the ML model as input factors so that the model can be continuously revised and the forecasts can be closer to the current situation. The results show that adding IoT sensor data as input factors can reduce the model error, especially for those of high-flood-depth conditions, where their underestimations are significantly mitigated. Thus, the ML model can be on-line adjusted, and its forecasts can be visually assessed by using the IoT sensors’ inundation levels, so that the model’s accuracy and applicability in multi-step-ahead flood inundation forecasts are promoted. ARID rising variant ARID hydrograph. to model can learn the relationship between different magnitudes of (large or small) and rainfall types or actual with their correspondent average flooding during


Introduction
Flood is one of the most disruptive natural hazards, which causes significant damage to life, agriculture, and economy, and has a great impact on city development. Nowadays, flood tends to increase and become more severe as climate changes together with the rapid urbanization and aging infrastructure in cities. Early notification of flood incidents could benefit the authorities and public for devising preventive measures, preparing evacuation missions, and alleviating flood victims. A precautionary measure to cope with the upcoming flood is flood forecasting and warning involved persons, which would result in the reduction of damage and life lost. Flood forecast models have been developed over the last decades. Among them, physically based models have been commonly used and showed great capabilities for flood estimation, while they often require hydrogeomorphological monitoring datasets and intensive computation, which prohibits short-term prediction [1][2][3]. Statistical models, such as the multiple linear regression (MLR) [4][5][6] and autoregressive integrated moving average (ARIMA) [7][8][9][10] are also frequently used for flood modeling. Nevertheless, their capability for short-term forecasting has been restricted because of the nonlinear dynamic feature of storm events resulting in a lack of accuracy and robustness of the statistical methods [11].
Machine learning (ML) models have a great capability to model the nonlinear dynamic feature and have widely been used in hydrological issues, such as predicting the level of sewage in sewers [12]; arsenic concentration in groundwater [13]; or flood level prediction [14][15][16][17][18][19]. Among the ML models, nonlinear autoregressive models with exogenous inputs (NARX) [20] can adaptively learn complex flood systems and have been reported as valid for flood forecasting [21][22][23][24][25][26]. There is also relevant literature that applied it to regional flood forecasting. For instance, Shen and Chang [27] established a NARX model for flood forecasting in flood-prone areas in Yilan County, Taiwan and demonstrated that it has an error tolerance rate and can effectively suppress error accumulation in predicting the next 1-6 h; and Chang et al. [28,29] proposed the use of self-organizing map combing with recurrent nonlinear autoregressive with exogenous inputs (SOM-RNARX) for multi-time regional flood forecasting model and indicated the method could effectively model regional flood forecasting. It can provide the accuracy and reliability of the flood management system. The majority of these ML models have used rainfall as an input to make regional flood inundation forecasts. A drawback of these models was that they mainly relied on measurements from rain stations, which hinders the models from being sequentially adjusted due to lack of real observed inundation depth. Consequently, most existing models could not properly respond to a sudden flood and could not verify the resultant flood forecasts. Furthermore, the forecast was made based on present data that restrict it from determining flood inundation depths much further ahead. Consequently, there is a research gap from the perspective of ML modeling and the data monitoring system. In light of this, an analysis was conducted on the use of monitoring inundation depth data gathered from urban areas to forecast flooding with a view of on-line updating the model and mitigating the residuals between model outputs and real observed inundation depths.
Internet of Things (IoT) sensors are a useful means of carrying out the monitoring of rivers and other natural environments. They have attractive features: simple to install, low energy consumption, and high-precision sensors. The integration of a large number of IoT sensors can provide on-line comprehensive and broader information to effectively perform environmental monitoring and forecasting [30][31][32][33][34]. Recently, several studies have implemented IoT and big data [35][36][37][38] for flood forecasting. For instance, Chang et al. [39] proposed building an intelligent hydro-informatics integration platform to integrate ML models with sensors data for flood prediction. Sood et al. [40] proposed the Internet of Things (IoT) smart flood monitoring to predict floods and flood levels. Mishra et al. [41] combined IoT and deep learning to identify ditch or drainage channel blockage images. IoT has become one of the vital development projects in Taiwan lately. The authorities' IoT centers, (e.g., Water Resources Agency) can analyze the data and provide suitable countermeasures and rapidly transmit the data to regional control centers against flood. The integration and application of various sensors can offer a large amount of real-time monitoring data (e.g., inundation depths) for ML models' updating and testing.
This study intends to use the IoT sensor data to construct a machine learning-based embedded flood forecast model for predicting average flood depth in a river basin. The IoT sensor data will be sequentially fused into the ML model as extra input factors, so that the forecast model can be continuously updated and assessed, and the results can be closer to the current situation. This paper is organized as follows. The next section describes the proposed methodology. Subsequently, sections 3 and 4 present the study area and practices relating to flood forecasting systems, respectively. Then, the results of visual assessments and numerical evaluations on studied areas are reported and discussed. Concluding remarks are given in the last section.

Methodology
We propose a methodology that couples machine learning models, i.e., the recurrent nonlinear autoregressive with exogenous inputs (RNARX) model [20], with the IoT sensor data for providing multi-step-ahead average regional inundated depth (ARID) during storm events. Various IoT sensor data were explored and implemented into the ML model as input factors to continuously update the model's parameters for better forecasting the ARID.
The architecture of the RNARX shown in Figure 1 is a three-layer dynamic neural network. The network was configured by using the model's outputs as parts of inputs, and its weights can be adjusted by using the conjugate gradient back-propagation learning algorithm. The major difference between the dynamic neural networks (e.g., RNARX) and the static neural networks (e.g., back propagation neural network, BPNN) is that dynamic neural networks use the network output of the current moment as one of the input factors for the next moment, so the model can effectively track the time-series features. The dynamic neural networks have been widely used in modeling time series, especially when there is no actual (observed) value of upcoming time, such as inundation depth. For instance, in this study, the average regional flood inundation depth in the urban area would be continuously predicted along the storm event, while there is no observed value in the coming hours. In model configuring stage, we used simulation results to train and validate the constructed model, while in actual applications, the average flooding depth of all grids, however, cannot be obtained. As known, the longer the forecast horizon, the greater the forecast error would be due to a lack of real monitoring of the inundation depth. In this study, a number of flood sensors implemented in the study area were explored for their effectiveness in modeling the multi-step flood inundation forecasts. The network contained P rainfall inputs (R), Q flood sensor inputs (S), and one recurrent input from the previous output. Let ( ) denote the (P + Q + 1) × 1 input vector, ( + ) denote the nstep-ahead network output, and ( + ) denote the output vector of the th layer. The network multiplied the input factors by weights and forwarded them to the next neuron. The neurons were summed up and outputted through the activation function f (•), which was continuously forwarded to the final output layer. The output values of each neuron were defined as Equations (1)-(4).
Let denote the N × (P + Q + 1) weight matrix of the hidden layer. Let denote the N × 1 weight matrix of the output layer. RNARX uses the conjugate gradient back-propagation learning algorithm to adjust the average regional inundation depth (ARID) in a specific time during the training phase. The target output value at time t + n and its error vector were defined as ( + ), as shown in Equation (5), and the instantaneous error function ( + ) was as in Equation (6).
The correction of was defined as the partial differential of the error function ( + ) as Equation (7). After the chain-rule process, Equation (8) could be obtained, so was updated in Equations (9) and (10).
where is the learning rate. Similarly, we could partially differentiate of the ( + ), and the results are shown in Equations (11)- (14).
where is the learning rate; is Kronecker delta with value 1 if and only if = . Through the above weight adjusting process, the error, because of the complicated interaction between the inputs (rainfall, sensor data, feedback flood depth) and the outputs (flood depth at time T + 1-T + 3), would be computed, and the weights were systematically adjusted through continuous iterations so that the error would be gradually reduced until the satisfactory accuracy and/or the number of iterations was reached for the set requirements. Therefore, the RNARX model was used to predict the multi-stepahead flood depth, and at the same time, the differences by using only rainfall and the extra sensors of inundation were compared.

Study Area and Datasets
This research area was the Erren River basin ( Figure 2) located in southern Taiwan. The river length is 63.2 km with the upstream up to 460 m above sea level, and the catchment area is 350.4 km 2 , which is further divided into 10,744 grids (40 m × 40 m). In this study, six actual storm events and twelve designed rainfall patterns with various return periods, as well as their correspondent 2D flood simulation results (simulated by the SOBEK software of Deltares), were collected from the Water Resources Agency. A total of 631 hourly datasets were used to configure the ML models. There were also 631 regional flood inundation maps generated by the SOBEK based on the rainfall patterns mentioned above, which were used as the virtual inundation maps for ML models' training and testing. These datasets were further divided into 391 datasets (10 events) for training, 144 datasets (4 events) for validation, and 96 datasets (4 events) for testing (Table 1).   Figure 3 shows a graph of rainfall and average regional flooding depth (ARID) history of 10 training events, which included three quantitative rainfalls (200, 450, and 800 mm), two different return period rainfalls (10 and 500 years), and five actual rainfall events. The rainfall pattern of quantitative rainfalls and two return period rainfalls adopted the centrally concentrated rain pattern, where the maximum rainfall is placed in the center and then sorted according to the amount of rainfall to the right and left, respectively. The average regional inundation depth (ARID) in a specific time was calculated by summarizing all the inundation depths in each grid and then dividing by the number of grids. The time series of ARID shown in Figure 3 presents a complete hydrograph for the correspondent rainfall event (pattern), with the ARID value along with the time from rising limb to the peak and then to the recession limb. We noticed that the actual rainfall events show more irregular rainfall patterns and produce a variant ARID hydrograph. According to the design of training cases, the model can learn the relationship between the different magnitudes of rainfall (large or small) and rainfall types (design rainfall or actual rainfall) with their correspondent average flooding depths during the training process.

Model Construction
The research process was divided into three stages as shown in Figure 4. The first stage was to collect data, which includes two-dimensional flood simulation data, five stations of rainfall data, and 25 stations of flood sensor datasets. The total datasets were divided into three independent datasets for model training, validation, and testing. The second stage was to construct the forecast models. Three models were built to make multi-step-ahead forecasts of the average regional inundation depth (ARID). The models' parameters are shown in Table 2   Input variable selection is an essential step in the development of machine learning models. In recent years, various input selection methods have been satisfactorily used to improve prediction accuracy and produce parsimonious models in numerous applications [42][43][44][45]. For instance, in hydrological issues, Taormina and Chau [46] used binary-coded particle swarm optimization and extreme learning machines for rainfall-runoff modeling; Chang et al. used the Gamma test to identify the most suitable input variables for multi-step-ahead water level forecasting [26] and estimating stream total phosphate concentration [47]. While new methods continue to emerge, each has its own advantages and limitations, and there is no best method for all modeling purposes. In this study, we aimed learn whether the new implemented 25 sensors in the study area could be beneficial to model the regional flood inundation forecast. The input variable selection was mainly based on correlation analysis between the sensors. As shown above, the main difference between Model 2 and Model 3 was that Model 2 used all sensors (25) as the model input, while Model 3 used 7 selected sensors as input. A 25 × 25 correlation matrix was constructed. The selection process is shown in Figure 5 and explained as follows.
1. Calculate the correlation matrix between sensors. 2. Count the number of highly correlated (R 2 > 0.9) sensors and sorting their number from large to small. 3. Select a representative sensor from those sensors that have the highest number of correlated sensors; if the number is the same, compare their ARID and then select the sensor with the largest ARID for priority selection (as the representative sensor). 4. Remove those highly correlated sensors with the above representative sensor to avoid repeated selection. For example, in the first round, was selected as the representative sensor ( Figure  5). Before moving to the next round of selection, those sensors highly correlated with sensor (i.e., R 2 > 0.9) would be removed from the correlation matrix. In this round, 10 sensors (including ) were removed. 5. If the selection has not been completed, return to step 1 and recalculate the correlation matrix of the remaining sensors until the selection is completed. That is, all the sensors will either be selected as the representative sensors or be removed during the selection process.
In this way, one of the most representative sensors will be selected for each round until all sensors have been picked or removed. We noticed that this study conducted a total of 7 rounds and picked out S , S , S , S , S , S , S , a total of 7 representative sensors.
where and are the observed value and the forecasted value of the ith data, respectively; ̅ and y are the means of the observed and forecasted values.
(a) Forecasted average regional inundation depth by Model 2 vs. 25 sensors' data (b) Forecasted average regional inundation depth by Model 3 vs. 7 sensors' data

Results
As known, there is a temporal relationship between observations of the rainfall and IoT sensors' inundation level of the study area and hence the value of observation at a particular time depends to some extent on past values. This study sought to model the temporal relationship and forecast the average regional inundation depth by using the machine learning model. Our reason for employing IoT sensor data was that the sensors could provide monitored (real) inundation values for model's training as well as testing and thus improve the multi-step forecast accuracy. Moreover, the real-time monitoring datasets could be used to on-line adjust the model's parameters and visually assess the model's performance, which could largely promote the model's applicability and reliability. The results of the three models are shown in Table 3. There were two very large flood events (water depth > 0.5 m) in the training case. Model 1 results indicated those high flood events were underestimated, but its performances, in general, was good, where the RMSE could reach 0.049, 0.050, and 0.061 m in training, validation and testing cases, respectively. The small values of RMSE and high R 2 and NSE values indicate that Model 1, which was solely based on rainfall information as input, could provide suitable 1-3 h ahead forecasts, while it would largely underestimate the peak flood inundation depth. Model 2 used the data of 5 rainfall stations and 25 flood sensors. In the training phase, its errors in T + 1-T + 3 were significantly reduced as compared with those of Model 1. For instance, the RMSE values of Model 1 and Model 2 at T + 3 were 0.083 and 0.049, respectively. We notice that Model 2 had much better performances in multi-step-ahead forecasts (T + 1-T + 3) than those of Model 1 in the training phase, while that was not the case in both the validation and testing phases. In order to investigate the inconsistency problem, we explored the relationship between sensors' data with the models' forecast values in the event (24H100y) of the testing case. Figure 7a shows that the time series of 25 sensors were inconsistent, especially during the 12th-18th hours, where some of them were ascending, while the rest of them were descending, and the time series of the 3 h ahead forecasted ARID made by Model 2 was in sharp descent. We noticed that the inconsistency between sensors' hydrographs might have been due to the propagation time between the upstream and downstream locations of the sensors resulting in the different lag time between the increasing and decreasing limb of their associated hydrograph. The inconsistency between the sensors' datasets as well as the forecasted ARID values, however, could result in a large error (i.e., RMSE = 0.113 shown in Table 3). The results indicated that adding the IoT sensors information could, in general, reduce the forecast error of the ARID in the training phase due to using more information (25 sensors' data) as input. Nevertheless, using a large number of inconsistent sensors values along the time series as input might introduce too many parameters in the model and result in an overfitting (overtraining) problem.  To reduce the input variables (sensors), correlation analysis was used to select a limited number of sensors as the representative sensors. Model 3 used the data of 5 rainfall stations and 7 representative sensors as inputs. Figure 7b shows the time series of 3 h forecasted ARID with the inundation depths of 7 representative sensors. As shown, the time series of 7 selected sensors as well as the forecasted ARID were relatively consistent, as compared with those of Figure 7a. The results show that Model 3, in general, was superior to the Model 1 and Model 2 in all the validation and testing phases, and its R 2 values in T + 1-T + 3 were consistent and higher than 0.9 in all the phases (Table 3). Thus, the Model 3 forecasts maintained fairly high accuracy (very small RMSE and high R 2 and NSE). Figure 8 presents the forecast results of Model 1 and Model 3 at T + 1 in three phases. It shows that Model 1 underestimated the peak flow in the first and fifth events of the training session (i.e., 24H800mm and 24H500y), while they overestimated the peak flow in the validation and testing phases. In contrast, the results of Model 3 indicated that the problems of overestimated or underestimated peak values of ARIDs were significantly mitigated, its estimating errors (RMSE), in general, were also much smaller than those of Model 1 in all three phases.   Figure 9 shows the RMSE charts in the training, validation, and testing phases of the three models. It is clearly shown that Model 3 had the most reliable and accurate performance compared to Models 1 and 2. Model 2 could be very well trained and was superior to Model 1 in all cases except in the cases of T + 2 and T + 3 in the testing phase, which was mainly caused by an inconsistency issue in the event of 24H100y. Model 3 had better performance than Model 2 in the validation and testing phases, where the average improvement rates were 22.65% and 42.71%, respectively. Moreover, the model's weights were reduced from 166 (Model 2) to 76 (Model 3), when the number of parameters was significantly reduced by 54.21%. The analyzed results provide an extra evidence and demonstrate that using the selected sensors as model input not only produces a parsimonious model but also improves prediction accuracy in multi-step-ahead flood inundation forecasts. These results represent the great value and benefit of IoT sensors, which fuse as inputs into the machine learning models. Figure 9. The radar chart of models' performance (RMSE) in three phases.

Conclusions
This study sought to model the temporal relationship and forecast the average regional inundation depth by using the IoT-based machine learning model. The datasets obtained from rainfall stations and IoT flood sensor data were used to model the average regional flood forecasts and explore the effectiveness and usefulness of the IoT sensors data in the model's reliability and accuracy. The results show that adding IoT sensor data as a model input can reduce the model error, especially for those of long horizontal (T + 2 and T + 3) forecasts in high-flood-depth conditions, where their underestimations are significantly mitigated. For instance, by adding 25 IoT sensors of inundation depth as extra inputs of Model 2, an average error improvement rate up to 18.49% could be reached as compared with Model 1 (only used rainfall datasets). While we also noticed that the inconsistent relationship between the 25 sensors datasets could over train the model and result in a chaotic issue in late application. For instance, Model 2 does provide the worst performances in the testing phase of T + 3 case. On the other hand, Model 3 used 7 IoT representative sensors, selected by the principle of correlation, as the extra inputs to model the multi-step flood forecasts. The number of parameters of Model 3 were greatly reduced (over 50%) as compared with Model 2. Furthermore, Model 3 was superior to Model 2, with an average improvement rate up to 18%, and it also provided much better forecast performances (small RMSE and high R 2 and NSE values) than Model 1 in all the T + 1-T + 3 cases. Therefore, these results give very promising evidence and demonstrate that using the IoT representative sensors as the model input to configure the machine learning models not only can produce a parsimonious model but also significantly improve the models' reliability and accuracy in multi-step-ahead regional flood inundation forecasts. The most fascinating achievement of this study is that the constructed model now can be on-line adjusted and its real-time forecast can be visually assessed and numerically evaluated based on the current implemented IoT inundation levels in the studied areas. Thus, the IoT-based machine learning model performance could be continuously assessed and adjusted, and its reliability and accuracy could be consistent.