Abstract:An accurate prediction model can be required for the greenhouse air temperature, such as Model Predictive Control. Long short-term memory neural networks (LSTM) have been widely used to predict time series data, such as air temperature. However, the prediction accuracy of LSTM can be reduced for the long time series data, due to data forgetting. In this study, the LSTM model was combined with the attention mechanism to construct the LSTM-AT model. The query vector, key vector, and value vector were calculated, according to attention mechanism and output states of LSTM’s hidden layer. The similarity between the query and key vector was calculated to obtain the similarity score. Softmax function was used to obtain attention distribution for the normalization processing. The larger the attention value was, the higher the relevance of input information to the task objective was. The dot product operation was carried out with the normalized weight and value vector to obtain the output of the attention mechanism. The local information integration and data dimension transformation were carried out through the full connection layer. Finally, the output data was obtained in the output layer of the LSTM-AT model. The weights were assigned to the output states of LSTM’s hidden layer, according to the degree of importance. The forgetting of long time series data was effectively solved to improve the prediction accuracy of indoor air temperature. The prediction performances were verified and compared on the LSTM-AT, LSTM, recurrent neural network (RNN), gated recurrent unit (GRU), and bi-directional long short-term memory (BiLSTM) model in the different prediction horizons (12, 24 and 48 h). The results showed that the prediction accuracy of the five models shared a decreasing trend with the increase in prediction time. The maximum and minimum RMSE for the LSTM-AT model were 1.34 ℃ and 0.59 ℃, respectively. The maximum and minimum RMSE for the rest four models were 3.37 ℃ and 0.66 ℃, respectively. The maximum and minimum MAPE for the LSTM-AT model were 8.14% and 2.48%, respectively. The maximum and minimum MAPE for the rest four models were 38.7% and 2.90%, respectively. Therefore, the prediction accuracy of the LSTM-AT model was higher than that of rest four models. The average RMSE for LSTM-AT, LSTM, GRU, RNN, and BiLSTM were 0.89, 1.42, 1.89, 2.10, and 1.51 ℃, respectively. The average MAPE for LSTM-AT, LSTM, GRU, RNN, and BiLSTM were 4.26%, 8.96%, 13.57%, 17.70%, and 10.67%, respectively. The sort data of the prediction model was ranked in descending order of the LSTM-AT, LSTM, BiLSTM, GRU, and RNN. The prediction performances of the LSTM-AT and LSTM model were compared under different weather conditions (sunny, cloudy, and rainy), in order to further explore the universality of the LSTM-AT model. The minimum and maximum RMSE for LSTM-AT were 0.26℃ and 0.70 ℃, respectively. The minimum and maximum RMSE for LSTM were 0.68 ℃ and 1.57 ℃, respectively. The minimum and maximum MAPE for LSTM-AT were 1.61% and 10.51%, respectively. The minimum and maximum MAPE for LSTM were 4.27% and 25.07%, respectively. The prediction accuracy of the LSTM-AT model was higher than LSTM in all weather conditions. The LSTM-AT model has a higher prediction accuracy to accurately predict the indoor air temperature.