Research on Temperature Forecasting Model Based on BiLSTM-Attention Algorithm
摘要
To overcome the limitations of traditional temperature prediction models, which often rely on expert knowledge and exhibit poor fitting effects, we propose a novel multi-variable short-term temperature prediction model named BiLSTM-Attention (Bidirectional Long Short-Term Memory with Attention Mechanism). The model utilizes time series data such as atmospheric pressure, pressure trend, relative humidity at 2 m above the ground, average wind speed, horizontal visibility, and dew point temperature as covariates. These covariates are processed with first-order differencing and smoothing to enhance the model’s pattern recognition capabilities, followed by zero-mean normalization to eliminate dimensional impact. The BiLSTM-Attention model employs a bidirectional long short-term memory (BiLSTM) network to learn the characteristics and inherent laws of the time series data. Additionally, an attention mechanism is integrated to dynamically assign weights to different time steps, highlighting important intervals and reducing the influence of less significant points, thereby improving prediction accuracy. Using atmospheric temperature data from Xining City, Qinghai Province, China, covering the period from 2011 to 2023, the proposed BiLSTM-Attention model demonstrates improved performance compared to traditional BiLSTM and LSTM-Attention models. The four evaluation indicators—mean square error, coefficient of determination, mean absolute error, and root mean square error—have all shown significant improvements, confirming the effectiveness of the model in real-world environments.