Comparative Assessment of Transformer and Conventional Deep Learning Models for Dam Inflow Prediction
摘要
Accurate forecasting of reservoir inflow is critical for sustainable water resource management, particularly under conditions of increasing climatic variability. This study develops and benchmarks a seasonality-aware Transformer-based model for daily inflow prediction, designed to capture both short-term variability and long-range seasonal patterns. The proposed architecture fuses sequential hydrometeorological variables (inflow, temperature, precipitation) with static seasonal features, including day of year and month (encoded as sine and cosine functions), and a rolling inflow averages, within a multihead attention framework and positional encoding scheme. Unlike recurrent neural networks, the Transformer allows parallel sequence processing and more effective modeling of complex temporal dependencies. The model was rigorously evaluated using time-series cross-validation and compared against classical machine learning models (Random Forest, XGBoost, Linear Regression) and deep learning baselines (ANN, RNN, LSTM, and GRU). The results showed that the Transformer consistently achieved the highest R²/NSE performance (test R²=0.8002 ± 0.14) and strong performance during hydrological extremes (e.g., high-flow MAE: 4.69 Mm³/day). Although recurrent models produced lower and more stable overall MAE/RMSE values, they did not match the Transformer in terms of R²/NSE performance and high-flow event representation. These findings highlight the value of attention-based architectures for hydrological forecasting and establish a reproducible and potentially transferable approach for inflow prediction in seasonally variable catchments.