Construction and Application of Building Energy Consumption Prediction Model Based on Machine Learning Algorithm
摘要
This paper aims to solve the shortcomings of the existing building energy consumption prediction model in terms of accuracy, and improve the prediction accuracy by constructing a CNN-LSTM (Convolutional Neural Network-Long Short-Term Memory) model combined with an attention mechanism (AM). This paper applies an integrated model CNN-LSTM-AM that integrates CNN, LSTM, and AM, and uses CNN to extract local features of time series data. Then, LSTM is used to capture long-term dependencies, and finally the attention mechanism is applied to dynamically allocate weights to enhance the model’s attention to key time steps. This paper selects multiple different types of datasets for comparative analysis, uses four models, this paper’s model, CNN-LSTM, LSTM, and Transformer, for training and testing, and evaluates the model performance through MSE (Mean Square Error), MAE (Mean Absolute Error), and R2 indicators. At the 50th Epoch, this paper’s model has the lowest MSE on the test set, which is 0.020. The MSE, MAE, and R2 of this paper’s model are 0.020, 0.015, and 0.982, respectively; the MSE predictions of this paper’s model in the four seasons are 0.018, 0.021, 0.017, and 0.020, respectively. MSE maintains the lowest value in all seasons, significantly better than CNN-LSTM, LSTM, and Transformer. It shows that this paper’s model optimizes the prediction accuracy by effectively integrating local feature extraction and long-term dependency modeling, and combining it with the attention mechanism, especially showing stronger generalization ability on non-stationary time series data. This paper provides a new solution for time series forecasting by proposing an efficient integrated model, significantly improving model performance, and providing important technical support and theoretical basis for practical applications in energy management, financial market forecasting, meteorological analysis, and other fields.