A deep learning model for flood forecasting based on dynamic lag encoding and multi-head attention
Abstract
Summary Conventional flood forecasting models often struggle to effectively capture the time-lag characteristics of rainfall-runoff responses within a basin, and their decision-making processes generally lack interpretability. This study used 19 years (1979–1997) of multi-station rainfall and outlet discharge data from the Hydrological Yearbook of the Yellow River Basin, and selected 53 representative flood events from the Huangfuchuan Basin for model development and evaluation. A deep learning flood forecasting model (D-TMA-LSTM) was developed by integrating dynamic lag encoding with a multi-head attention mechanism. The results show that D-TMA-LSTM outperformed the original LSTM and D-LSTM across forecast lead times from t+1 to t+6. At t+1, NSE, KGE, and R2 values were 0.959, 0.934, and 0.964, respectively, while RMSE decreased by 31.74%. The model also maintained stable performance at t+6, providing an effective framework for flood forecasting in basins with complex rainfall-runoff lag responses.