Water Flow Prediction Based on Improved Spatiotemporal Attention Mechanism of Long Short-Term Memory Network
Abstract
:1. Introduction
- Integration of LSTM with Spatiotemporal Attention Mechanism: Construct a water plant pipeline flow prediction model that combines Long Short-Term Memory (LSTM) networks with spatiotemporal attention mechanisms, improving the model’s interpretability of flow changes. Achieve the visual representations of spatial and temporal attention weights, and preliminarily explain their relationship with hydrological prediction.
- Fusion of Hydrological Station Parameters and Meteorological Conditions: Innovatively utilize surrounding hydrological station parameters in conjunction with external meteorological conditions for water plant flow prediction and to improve prediction accuracy.
2. Materials
2.1. Study Area
2.2. Research Data
3. Methodology
3.1. Framework
3.2. LSTM
3.3. Encoder Decoder with Self-Attention
3.4. Spatial Attention with Encoder
3.5. Temporal Attention with Decoder
4. Results and Discussion
4.1. Evaluation Metrics
4.2. Hyperparameter Analysis
4.3. Experiment Settings
4.4. Results and Analysis
4.4.1. Performance Comparison
4.4.2. Ablation Study
4.4.3. Visual Attention Analysis
4.5. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Nguyen, T.T.; Ngo, H.H.; Guo, W.; Wang, X.C.; Ren, N.; Li, G.; Ding, J.; Liang, H. Implementation of a specific urban water management-Sponge City. Sci. Total Environ. 2019, 652, 147–162. [Google Scholar] [CrossRef] [PubMed]
- Jain, S.K.; Singh, V.P. Water Resources Systems Planning and Management; Elsevier: Amsterdam, The Netherlands, 2023; ISBN 0323984126. [Google Scholar]
- Ghorani, M.M.; Haghighi, M.H.S.; Maleki, A.; Riasi, A. A numerical study on mechanisms of energy dissipation in a pump as turbine (PAT) using entropy generation theory. Renew. Energy 2020, 162, 1036–1053. [Google Scholar] [CrossRef]
- Yan, P.; Zhang, Z.; Lei, X.; Hou, Q.; Wang, H. A multi-objective optimal control model of cascade pumping stations considering both cost and safety. J. Clean. Prod. 2022, 345, 131171. [Google Scholar] [CrossRef]
- Lu, L.; Tian, Y.; Lei, X.; Wang, H.; Qin, T.; Zhang, Z. Numerical analysis of the hydraulic transient process of the water delivery system of cascade pump stations. Water Sci. Technol. Water Supply 2018, 18, 1635–1649. [Google Scholar] [CrossRef]
- Shi, L.; Zhang, W.; Jiao, H.; Tang, F.; Wang, L.; Sun, D.; Shi, W. Numerical simulation and experimental study on the comparison of the hydraulic characteristics of an axial-flow pump and a full tubular pump. Renew. Energy 2020, 153, 1455–1464. [Google Scholar] [CrossRef]
- Rashidov, J.; Kholbutaev, B. Water distribution on machine canals trace cascade of pumping stations. In IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK, 2020; p. 12066. [Google Scholar]
- Assem, H.; Ghariba, S.; Makrai, G.; Johnston, P.; Gill, L.; Pilla, F. Urban water flow and water level prediction based on deep learning. In Proceedings of the Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2017, Skopje, Macedonia, 18–22 September 2017; Proceedings, Part III 10. pp. 317–329. [Google Scholar]
- Cisty, M.; Soldanova, V. Flow prediction versus flow simulation using machine learning algorithms. In Machine Learning and Data Mining in Pattern Recognition. In Proceedings of the 14th International Conference, MLDM 2018, New York, NY, USA, 15–19 July 2018; Proceedings, Part II 14. pp. 369–382. [Google Scholar]
- Yuan, X.; Chen, C.; Lei, X.; Yuan, Y.; Muhammad Adnan, R. Monthly runoff forecasting based on LSTM–ALO model. Stoch. Environ. Res. Risk Assess. 2018, 32, 2199–2212. [Google Scholar] [CrossRef]
- Ahmed, A.N.; Othman, F.B.; Afan, H.A.; Ibrahim, R.K.; Fai, C.M.; Hossain, M.S.; Ehteram, M.; Elshafie, A. Machine learning methods for better water quality prediction. J. Hydrol. 2019, 578, 124084. [Google Scholar] [CrossRef]
- Li, X.; Xu, W.; Ren, M.; Jiang, Y.; Fu, G. Hybrid CNN-LSTM models for river flow prediction. Water Supply 2022, 22, 4902–4919. [Google Scholar] [CrossRef]
- Fathian, F.; Mehdizadeh, S.; Kozekalani Sales, A.; Safari, M.J.S. Hybrid models to improve the monthly river flow prediction: Integrating artificial intelligence and non-linear time series models. J. Hydrol. 2019, 575, 1200–1213. [Google Scholar] [CrossRef]
- Khazaee Poul, A.; Shourian, M.; Ebrahimi, H. A Comparative Study of MLR, KNN, ANN and ANFIS Models with Wavelet Transform in Monthly Stream Flow Prediction. Water Resour. Manag. 2019, 33, 2907–2923. [Google Scholar] [CrossRef]
- Zhang, J.; Zhu, Y.; Zhang, X.; Ye, M.; Yang, J. Developing a Long Short-Term Memory (LSTM) based model for predicting water table depth in agricultural areas. J. Hydrol. 2018, 561, 918–929. [Google Scholar] [CrossRef]
- Zaremba, W.; Sutskever, I.; Vinyals, O. Recurrent neural network regularization. arXiv 2014, arXiv:1409.2329. [Google Scholar]
- Zhou, Y.; Guo, S.; Xu, C.; Chang, F.; Yin, J. Improving the reliability of probabilistic multi-step-ahead flood forecasting by fusing unscented Kalman filter with recurrent neural network. Water 2020, 12, 578. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Le, X.; Ho, H.V.; Lee, G.; Jung, S. Application of long short-term memory (LSTM) neural network for flood forecasting. Water 2019, 11, 1387. [Google Scholar] [CrossRef]
- Hu, Y.; Yan, L.; Hang, T.; Feng, J. Stream-Flow Forecasting of Small Rivers Based on LSTM. arXiv 2020, arXiv:2001.05681. [Google Scholar]
- Bahdanau, D.; Cho, K.; Bengio, Y. Neural Machine Translation by Jointly Learning to Align and Translate. arXiv 2014, arXiv:1409.0473. [Google Scholar]
- Kroner, A.; Senden, M.; Driessens, K.; Goebel, R. Contextual encoder–decoder network for visual saliency prediction. Neural Netw. 2020, 129, 261–270. [Google Scholar] [CrossRef]
- Zhu, S.; Luo, X.; Yuan, X.; Xu, Z. An improved long short-term memory network for streamflow forecasting in the upper Yangtze River. Stoch. Environ. Res. Risk Assess. 2020, 34, 1313–1329. [Google Scholar] [CrossRef]
- Zounemat-Kermani, M.; Mahdavi-Meymand, A.; Hinkelmann, R. A comprehensive survey on conventional and modern neural networks: Application to river flow forecasting. Earth Sci. Inform. 2021, 14, 893–911. [Google Scholar] [CrossRef]
- Alizadeh, B.; Ghaderi Bafti, A.; Kamangir, H.; Zhang, Y.; Wright, D.B.; Franz, K.J. A novel attention-based LSTM cell post-processor coupled with bayesian optimization for streamflow prediction. J. Hydrol. 2021, 601, 126526. [Google Scholar] [CrossRef]
- Xie, Z.; Du, Q.; Ren, F.; Zhang, X.; Jamiesone, S. Improving the forecast precision of river stage spatial and temporal distribution using drain pipeline knowledge coupled with BP artificial neural networks: A case study of Panlong River, Kunming, China. Nat. Hazards 2015, 77, 1081–1102. [Google Scholar] [CrossRef]
- Fu, Y.; Wang, X.; Wei, Y.; Huang, T. STA: Spatial-Temporal Attention for Large-Scale Video-based Person Re-Identification. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January 2019–1 February 2019. [Google Scholar]
- Chang, L.; Liou, J.; Chang, F. Spatial-temporal Flood Inundation Nowcasts by Fusing Machine Learning Methods and Principal Component Analysis. J. Hydrol. 2022, 612, 128086. [Google Scholar] [CrossRef]
- Noor, F.; Haq, S.; Rakib, M.; Ahmed, T.; Jamal, Z.; Siam, Z.S.; Hasan, R.T.; Adnan, M.S.G.; Dewan, A.; Rahman, R.M. Water Level Forecasting Using Spatiotemporal Attention-Based Long Short-Term Memory Network. Water 2022, 14, 612. [Google Scholar] [CrossRef]
- Wang, Y.; Huang, Y.; Xiao, M.; Zhou, S.; Xiong, B.; Jin, Z. Medium-long-term prediction of water level based on an improved spatio-temporal attention mechanism for long short-term memory networks. J. Hydrol. 2023, 618, 129163. [Google Scholar] [CrossRef]
- Li, H.; Cao, P.; Wang, X.; Yi, B.; Huang, M.; Sun, Q.; Zhang, Y. Multi-task spatio-temporal augmented net for industry equipment remaining useful life prediction. Adv. Eng. Inform. 2023, 55, 101898. [Google Scholar] [CrossRef]
- Chen, C.; Zhou, H.; Zhang, H.; Chen, L.; Yan, Z.; Liang, H. A Novel Deep Learning Algorithm for Groundwater Level Prediction Based on Spatiotemporal Attention Mechanism; Creative Commons: Mountain View, CA, USA, 2020. [Google Scholar]
- Lin, T.; Pan, Y.; Xue, G.; Song, J.; Qi, C. A Novel Hybrid Spatial-Temporal Attention-LSTM Model for Heat Load Prediction. IEEE Access 2020, 8, 159182–159195. [Google Scholar] [CrossRef]
- Linardatos, P.; Papastefanopoulos, V.; Kotsiantis, S. Explainable ai: A review of machine learning interpretability methods. Entropy 2020, 23, 18. [Google Scholar] [CrossRef]
- Li, X.; Xiong, H.; Li, X.; Wu, X.; Zhang, X.; Liu, J.; Bian, J.; Dou, D. Interpretable deep learning: Interpretation, interpretability, trustworthiness, and beyond. Knowl. Inf. Syst. 2022, 64, 3197–3234. [Google Scholar] [CrossRef]
- Ding, Y.; Zhu, Y.; Feng, J.; Zhang, P.; Cheng, Z. Interpretable spatio-temporal attention LSTM model for flood forecasting. Neurocomputing 2020, 403, 348–359. [Google Scholar] [CrossRef]
- Ghobadi, F.; Kang, D. Improving long-term streamflow prediction in a poorly gauged basin using geo-spatiotemporal mesoscale data and attention-based deep learning: A comparative study. J. Hydrol. 2022, 615, 128608. [Google Scholar] [CrossRef]
- Graves, A. Generating Sequences with Recurrent Neural Networks. arXiv 2014, arXiv:1308.0850. [Google Scholar]
- Sutskever, I.; Vinyals, O.; Le, Q.V. Sequence to sequence learning with neural networks. arXiv 2014, arXiv:1409.3215. [Google Scholar]
- Cho, K.; van Merriënboer, B.; Bahdanau, D.; Bengio, Y. On the Properties of Neural Machine Translation: Encoder–Decoder Approaches; Association for Computational Linguistics: Doha, Qatar, 2014; pp. 103–111. [Google Scholar] [CrossRef]
- Hassanin, M.; Anwar, S.; Radwan, I.; Khan, F.S.; Mian, A. Visual attention methods in deep learning: An in-depth survey. Inf. Fusion. 2024, 108, 102417. [Google Scholar] [CrossRef]
- Vaswani, A.; Shazeer, N.M.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is All you Need. arXiv 2017, arXiv:1706.03762. [Google Scholar]
- Zheng, C.; Fan, X.; Wang, C.; Qi, J. Gman: A graph multi-attention network for traffic prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; pp. 1234–1241. [Google Scholar]
- Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar]
- Shi, X.; Chen, Z.; Wang, H.; Yeung, D.; Wong, W.; Woo, W. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. arXiv 2015, arXiv:1506.04214. [Google Scholar]
Input Attribute | Description | Unit |
---|---|---|
PIPE_PRESS (P) | Pipeline pressure | Mpa |
Water Level (H) | Water level height | m |
Water Flow (Q) | Water flow rate | m3/h |
Rainfall (R) | Local rainfall | mm |
Temperature (T) | Local temperatures | °C |
Activation Combination | MAE | RMSE | R2 |
---|---|---|---|
tanh–LeakyReLU | 3.95 | 5.74 | 0.974 |
tanh–ReLU | 3.93 | 5.70 | 0.976 |
ReLU–LeakyReLU | 3.95 | 5.74 | 0.974 |
LeakyReLU–tanh | 3.31 | 4.37 | 0.991 |
Models | Parameters | ||
---|---|---|---|
Learning Rate | Run Units | Activation | |
LSTM | 0.001 | 128 | tanh |
GRU | 0.001 | 128 | tanh |
CNN | 0.001 | 128 | tanh |
CNN-LSTM | 0.001 | 128 | ReLU |
STA-LSTM | 0.001 | p = 60 * q = 60 * | LeakyReLU–tanh |
Models | MAE | RMSE | MAPE | R2 |
---|---|---|---|---|
LSTM | 26.72 | 35.97 | 0.009 | 0.9298 |
GRU | 29.07 | 36.73 | 0.010 | 0.9148 |
CNN | 41.75 | 53.54 | 0.015 | 0.8142 |
CNN-LSTM | 23.73 | 29.45 | 0.008 | 0.9516 |
STA-LSTM | 3.57 | 4.61 | 0.001 | 0.9912 |
Dataset | MAE | RMSE | MAPE | R2 |
---|---|---|---|---|
Hydrological data | 5.25 | 7.32 | 0.0023 | 0.9668 |
Hydrological and meteorological data | 3.57 | 4.61 | 0.0012 | 0.9912 |
Model | MAE | RMSE | MAPE | R2 |
---|---|---|---|---|
TA-LSTM | 23.43 | 32.01 | 0.0081 | 0.9428 |
SA-LSTM | 19.56 | 28.81 | 0.0069 | 0.9507 |
STA-LSTM | 3.57 | 4.61 | 0.0012 | 0.9912 |
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. |
© 2024 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
Hu, W.; Yu, Y.; Yan, J.; Zhao, Z.; Sun, W.; Shen, X. Water Flow Prediction Based on Improved Spatiotemporal Attention Mechanism of Long Short-Term Memory Network. Water 2024, 16, 1600. https://doi.org/10.3390/w16111600
Hu W, Yu Y, Yan J, Zhao Z, Sun W, Shen X. Water Flow Prediction Based on Improved Spatiotemporal Attention Mechanism of Long Short-Term Memory Network. Water. 2024; 16(11):1600. https://doi.org/10.3390/w16111600
Chicago/Turabian StyleHu, Wenwen, Yongchuan Yu, Jianzhuo Yan, Zhe Zhao, Wenxue Sun, and Xumeng Shen. 2024. "Water Flow Prediction Based on Improved Spatiotemporal Attention Mechanism of Long Short-Term Memory Network" Water 16, no. 11: 1600. https://doi.org/10.3390/w16111600
APA StyleHu, W., Yu, Y., Yan, J., Zhao, Z., Sun, W., & Shen, X. (2024). Water Flow Prediction Based on Improved Spatiotemporal Attention Mechanism of Long Short-Term Memory Network. Water, 16(11), 1600. https://doi.org/10.3390/w16111600