# Research on Water Level Anomaly Data Alarm Based on CNN-BiLSTM-DA Model

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Study Area and Dataset

#### 2.2. Model Structure

#### 2.2.1. CNN

#### 2.2.2. LSTM

- Gate-based Forgetting: selectively forgetting useless information from the previous cell state ${C}_{t-1}$. Read the hidden state ${h}_{t-1}$ from the previous time step and the input data ${x}_{t}$ from the current time step, and calculate a value between 0 and 1. When the value is 0, all information is forgotten, and when it is 1, all information is preserved, as shown in Equation (2).$${f}_{t}=\sigma \left({W}_{f}\xb7\left[{h}_{t-1},{x}_{t}\right]+{b}_{f}\right)$$In the equation: in the calculation of the forget gate status, ${f}_{t}$ represents the result, while ${W}_{f}$ represents the weight matrix of the forget gate, and ${b}_{f}$ represents its bias term; σ denotes the sigmoid activation function.
- Input Gate: Read the input data ${x}_{t}$ at this time and retain useful information. Use the activation function tanh to obtain the temporary cell state ${\tilde{C}}_{t}$ at this time, and finally generate the cell state ${C}_{t}$. Its updating process is shown in Equations (3)–(5).$${i}_{t}=\sigma \left({W}_{i}\xb7\left[{h}_{t-1},{x}_{t}\right]+{b}_{i}\right)$$$${\tilde{C}}_{t}=\mathrm{tan}\mathrm{h}\left({W}_{c}\xb7\left[{h}_{t-1},{x}_{t}\right]+{b}_{c}\right)$$$${C}_{t}={f}_{t}\otimes {C}_{t-1}+{i}_{t}\otimes {\tilde{C}}_{t}$$In the equations: ${i}_{t}$ represents the computation result of the input gate state at time t; ${W}_{i}$ is the weight matrix of the input gate; ${b}_{i}$ is the bias term of the input gate; ${W}_{c}$ is the weight matrix of the cell state; ${b}_{c}$ is the bias term of the cell state; tanh is the hyperbolic tangent activation function; and $\otimes $ is the Hadamard product that multiplies elements in the same position.
- Output Gate: Selecting crucial information to be passed on to the next time step. The desired cell state for output is chosen using the sigmoid activation function, which is multiplied by the output that has passed through the tanh activation function to produce the next hidden state output value, ${h}_{t}$, as shown in Equations (6) and (7).$${o}_{t}=\sigma \left({W}_{o}\xb7\left[{h}_{t-1},{x}_{t}\right]+{b}_{o}\right)$$$${h}_{t}={o}_{t}\otimes \mathrm{tan}\mathrm{h}({C}_{t})$$In the equations: ${o}_{t}$ represents the computation result of the output gate state when t is the current time step; ${W}_{o}$ is the weight matrix of the output gate; and ${b}_{o}$ is the bias term of the output gate.

#### 2.2.3. BiLSTM

#### 2.2.4. The Construction of CNN-BiLSTM

#### 2.2.5. DA

#### 2.3. Anomaly Detection and Early Warning

#### 2.3.1. Data Preprocessing

#### 2.3.2. Training the CNN-BiLSTM Model

#### 2.3.3. Evaluating Prediction Performance

#### 2.3.4. Building the CNN-BiLSTM-DA Model

#### 2.3.5. Validating Model Effectiveness

#### 2.3.6. Real-Time Alerting

## 3. Results

#### 3.1. Evaluation of the Prediction Effect of CNN-BiLSTM Model

#### 3.2. Determination of Threshold Values

#### 3.3. Flood Warning Verification

## 4. Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Ji, X.-Y.; Yao, Z.-P.; Yang, K.; Chen, Y.-N.; Wang, Z.; An, X.-G. Water quality alert with automatic monitoring data based on MSLSTM-DA model. China Environ. Sci.
**2022**, 42, 1877–1883. (In Chinese) [Google Scholar] - Liu, B.Q.; Jing, R.Y.; Li, N.N.; Yang, G.H. Research and application of dynamic water level early warning mechanism of diversion channel. Water Resour. Hydropower Eng.
**2022**, 53, 166–173. (In Chinese) [Google Scholar] - Zhang, M. Prediction of Water Level at Urban Waterlogging Point Based on Artificial Neural Network. Master’s Dissertation, South China University of Technology, Guangzhou, China, 20 May 2019. (In Chinese). [Google Scholar]
- Yihong, Z. Study on Prediction and Early Warning of Urban Flood Waterlogging Process Based on Deep Learning. Master’s Thesis, Zhengzhou University, Zhengzhou, China, 18 June 2021. (In Chinese). [Google Scholar]
- Sui, Z.; Li, Z. Simulation of Urban Rainstorm Waterlogging and Pipeline Network Drainage Process Based on SWMM. J. Phys. Conf. Ser.
**2019**, 1213, 052061. [Google Scholar] - Hou, Q.Q. Study on Technology of City Flood Warning Based on SWAT and SWMM Model. Master’s Thesis, Hangzhou Normal University, Hangzhou, China, 26 May 2017. (In Chinese). [Google Scholar]
- Xu, Z.M.; Shi, K.; Xu, L.B. Infoworks RS in Flood Warning; China Academic Journal Electronic Publishing House: Beijing, China, 2012; pp. 33–35. (In Chinese) [Google Scholar]
- Nie, Q.M.; Luo, B.; Fang, Z. Research on rainstorm monitoring and early warning system of the Yangtze River tunnel based on internet of things. Water Wastewater Eng.
**2016**, 52, 126–130. (In Chinese) [Google Scholar] - Xiong, H. Numerical Simulation on Urban Flood Based on MIKE FLOOD: A Case Study in Yinchuan City, Ningxia Province. Master’s Thesis, Changsha University of Science & Technology, Changsha, China, 30 May 2016. (In Chinese). [Google Scholar]
- Sandu, M.-A.; Virsta, A. Applicability of MIKE SHE to Simulate Hydrology in Argesel River Catchment. Agric. Agric. Sci. Procedia
**2015**, 6, 517–524. [Google Scholar] [CrossRef] - Charalampos, D.; Pantazis, G.; Dimitris, P. Ecosystem approach to water resources management using the MIKE 11 modeling system in the Strymonas River and Lake Kerkini. J. Environ. Manag.
**2012**, 94, 132–143. [Google Scholar] - Alley, W.M.; Smith, P.E. Distributed Routing Rainfall-Runoff Model, 2nd ed.; US Geological Survey: Reston, VA, USA, 1982. [Google Scholar]
- Warwick, J.J.; Wilson, J.S. Estimating Uncertainty of Stormwater Runoff Computations. J. Water Resour. Plan. Manag.
**1990**, 116, 187–204. [Google Scholar] [CrossRef] - Ganggang, Z. The Research of Weiriver Runoff Prediction Systembased on Machine Learning. Master’s Thesis, Xi’an University of Technology, Xi’an, China, 14 June 2017. [Google Scholar]
- Sun, Y.; Tang, W.; Wang, C.; Li, Y. A river water level interval prediction method based on CNN-Seq2seq. J. Zhejiang Univ. Technol.
**2022**, 50, 381–392. (In Chinese) [Google Scholar] - Liu, W.; Yin, F. A Reservoir Water Level Prediction Method Based on LSTM Model. Radio Eng.
**2022**, 52, 83–87. (In Chinese) [Google Scholar] - Mounce, S.R.; Shepherd, W.; Sailor, G.; Shucksmith, J.; Saul, A. Predicting combined sewer overflowschamber depth using artificial neural networks with rainfall radar data. Water Sci. Technol.
**2014**, 69, 1326–1333. [Google Scholar] [CrossRef] [PubMed] - Chiang, Y.M.; Chang, L.C.; Tsai, M.J.; Wang, Y.F.; Chang, F.J. Dynamic neural networks for real-timewater level predictions of sewerage systems-covering gauged and ungauged sites. Hydrol. Earth Syst. Sci.
**2010**, 14, 2317–2345. [Google Scholar] - Hu, C.-C.; Zhou, L.-T.; Deng, S.-Y. Evaluation of urban waterlogging control based on cloud model. J. Yangtze River Sci. Res. Inst.
**2023**. in press (In Chinese) [Google Scholar] - Han, Y.; Wang, L.; Wei, P.; Li, Z.; Zhou, W. VMD-CNN-GRU hybrid prediction model of reservoir water level. J. Nanjing Univ. Inf. Sci. Technol. Nat. Sci. Ed.
**2022**. in press (In Chinese) [Google Scholar] - Hochreiter, S.; Schmidhuber, J. LSTM can solve hard long time lag problems. Adv. Neural Inf. Process. Syst.
**1997**, 9, 473–479. [Google Scholar] - Ren, J.J.; Wei, H.H.; Zou, L.Z.; Hou, T.T.; Yuan, Y.L.; Shen, J.Q.; Wang, X.M. Ultra-short-term power load forecasting based on CNN-BiLSTM-Attention. Power Syst. Prot. Control
**2022**, 50, 108–115. (In Chinese) [Google Scholar] - Narendra, K.; Kamal, K.K.; Abhishek, S. Prediction of effluent quality in ICEAS-sequential batch reactor using feedforward artificial neural network. Water Sci Technol.
**2019**, 80, 213–222. [Google Scholar] - Narendra, K.; Kamal, K.K.; Abhishek, S. Artificial neural network modelling of faecal coliform removal in an intermittent cycle extended aeration system-sequential batch reactor based wastewater treatment plant. J. Water Process Eng.
**2020**, 37, 101477. [Google Scholar] - Liu, Y.X.; Fan, Q.X.; Shang, Y.Z.; Fan, Q.M.; Liu, Z.W. Short-term water level prediction method for hydropower station based on LSTM neural network. Adv. Sci. Technol. Water Resources.
**2019**, 39, 56–60. (In Chinese) [Google Scholar] - Rahim, B.; Taghi, A.M.; Jan, A. Coupling a hybrid CNN-LSTM deep learning model with a Boundary Corrected Maximal Overlap Discrete Wavelet Transform for multiscale Lake water level forecasting. J. Hydrol.
**2021**, 598, 126196. [Google Scholar]

Model Dataset | Duration | Number (pcs) |
---|---|---|

Training set | 1 January 2006 to 31 December 2012 | 2557 |

Validation set | 1 January 2013 to 31 December 2014 | 730 |

Test set | 1 January 2015 to 31 December 2015 | 365 |

Index | MAE | MAPE | ||||
---|---|---|---|---|---|---|

Datasets | Training Set | Validation Set | Test Set | Training Set | Validation Set | Test Set |

0.0260 | 0.0330 | 0.0364 | 0.0353 | 0.0373 | 0.0365 | |

Index | MAD | RMSE | ||||

Datasets | TrainingSet | ValidationSet | TestSet | TrainingSet | ValidationSet | TestSet |

0.0259 | 0.0331 | 0.0375 | 0.0476 | 0.0643 | 0.0856 |

Models | CNN-BiLSTM | LSTM | CNN-LSTM | |
---|---|---|---|---|

Accuracy Index | ||||

MAE | 0.0330 | 0.0530 | 0.0364 | |

MAPE | 0.0373 | 0.0610 | 0.0411 | |

MAD | 0.0331 | 0.0534 | 0.0364 | |

RMSE | 0.0643 | 0.0756 | 0.0673 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Hu, C.; Zhou, L.; Gong, Y.; Li, Y.; Deng, S.
Research on Water Level Anomaly Data Alarm Based on CNN-BiLSTM-DA Model. *Water* **2023**, *15*, 1659.
https://doi.org/10.3390/w15091659

**AMA Style**

Hu C, Zhou L, Gong Y, Li Y, Deng S.
Research on Water Level Anomaly Data Alarm Based on CNN-BiLSTM-DA Model. *Water*. 2023; 15(9):1659.
https://doi.org/10.3390/w15091659

**Chicago/Turabian Style**

Hu, Cancan, Lanting Zhou, Yunzhu Gong, Yufei Li, and Siyuan Deng.
2023. "Research on Water Level Anomaly Data Alarm Based on CNN-BiLSTM-DA Model" *Water* 15, no. 9: 1659.
https://doi.org/10.3390/w15091659