A building energy consumption prediction method and system based on improved LSTM
By improving the gate structure of LSTM and introducing a stochastic gradient optimization algorithm with weight decay, the hyperparameters of LSTM are optimized, solving the accuracy and stability problems in commercial building energy consumption prediction and achieving higher prediction accuracy and better stability.
Patent Information
- Application Number
- CN202210265853.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Existing building energy consumption prediction methods suffer from insufficient prediction accuracy and poor stability, especially in commercial buildings. The single LSTM model performs poorly when dealing with nonlinear and fluctuating load characteristics, and the stability of the Adam optimization algorithm is affected by weight decay.
By improving the gate structure of LSTM and introducing a stochastic gradient descent (DwdAdam) algorithm with weight decay, the hyperparameters of LSTM are optimized, enhancing its performance in building energy consumption prediction. Specifically, this includes introducing a peephole connection between the forget gate and the input gate, adding a weight decay term during parameter updates, and optimizing the weight and bias matrices of the forget gate, input gate, and output gate.
It improves the accuracy and stability of building energy consumption prediction. Compared with SVR, Adam-LSTM, SCA-LSTM and RMSprop-LSTM models, the MSE value is reduced by 83%, 78%, 66% and 71% respectively, showing higher prediction accuracy and better stability.
Smart Images

Figure CN114742278B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of energy consumption prediction, and in particular relates to a building energy consumption prediction method and system based on improved LSTM. Background Art
[0002] As the pace of urbanization accelerates and the number of urban buildings increases, building energy consumption accounts for an increasing proportion of the entire energy consumption system. Global building energy consumption has exceeded that of industry and transportation, accounting for 46% of total energy consumption, and building carbon emissions account for as much as 36%. Humans spend 90% of their time in buildings, and people's constant pursuit of thermal comfort has led to an increase in building energy consumption, greenhouse gases, etc. The United Nations Intergovernmental Panel on Climate Change pointed out that in order to achieve the goal of controlling temperatures at 2°C in the Paris Agreement, the world must achieve carbon neutrality by 2050, which makes energy demand management in the building industry, which accounts for a large proportion of energy consumption, an important research area.
[0003] Among all building types, commercial buildings consume 30% more energy than residential buildings. The main reason is that commercial buildings have large areas, large traffic, long working hours, and high demands for lighting and air conditioning. According to surveys and analysis, shopping malls have the highest energy consumption among commercial buildings, with an average energy consumption of 3.521GJ / (m 2 *a), about three times that of office buildings and twice that of hotel buildings. Given that energy consumption prediction is the key to improving energy efficiency and reducing peak electricity demand, commercial building energy consumption prediction has become a global concern. However, outdoor temperature and humidity, solar radiation, personnel flow, etc. will cause changes in energy consumption in buildings. At the same time, the nonlinear and fluctuating characteristics of most equipment in buildings make it a huge challenge to accurately predict energy consumption data. In recent years, the widespread use of high-precision sensors has provided important support for predicting building energy consumption.
[0004] In recent years, energy consumption prediction methods are mainly divided into two categories: (1) physical models (including EnergyPlus, eQuest, Ecotect, etc.); (2) data-driven models (including artificial neural networks (ANN), convolutional neural networks (CNN), support vector machines (SVM), decision trees (DT), regression models (RM), etc.). Data-driven methods have been widely used in building energy consumption prediction in recent years due to their universality, flexibility, and high accuracy.
[0005] In terms of short-term load forecasting: Kim Y demonstrated that the ANN model has the best prediction accuracy by predicting the 1-hour peak load in an institutional building in Seoul, South Korea, but the interpretability is poor. ANN has been proven to be a robust method to effectively predict the power consumption of domestic units. CNN is used to extract nonlinear load features and nonlinear load temperature features from the constructed hourly load cube, and the extracted features are used as inputs to support vector regression (SVR) for short-term load forecasting. SVM has been most actively used in predicting short-term power load. Mohandes M first applied SVM to power load forecasting using the same data and weights as auto-regression, and the results showed better performance, but it was found that SVM is more suitable for long-term load forecasting.
[0006] Regression prediction targets the dependencies within the data set, while time series prediction targets the dependencies between the data set and time. In recent years, when studying nonlinear time series problems, many scholars have begun to combine traditional time series prediction models with recurrent neural networks (RNNs) and have achieved good performance. From the perspective of neuron structure, the nodes of the hidden layer of RNN are connected together. It will remember the previous information and use the previous information to affect the output of the subsequent nodes. Although it can theoretically solve the training of sequence data well, it often encounters the problem of gradient explosion and disappearance, which is particularly serious when the sequence is very long. In order to solve the defects of RNN, Hochreiter & Schmidhuber proposed a variant of RNN, the long short-term memory (LSTM) neural network in 1997. The innovation of LSTM network lies in the introduction of three control gates (input gate, output gate and forget gate). By adjusting the switch of the valve, the memory function of the model is realized, and the previous data is selectively retained and forgotten, so as to realize the influence of the early sequence on the final result. Due to its excellent ability in memorizing time series, LSTM is widely used in text generation, machine translation, speech recognition, and posture prediction. However, Klaus Greff et al. found in their experiments that the setting of LSTM-related hyperparameters has a significant impact on prediction accuracy. Therefore, it is a challenging task to select appropriate algorithms to improve LSTM prediction accuracy according to different application scenarios. Gradient descent and back propagation algorithms are usually used to update LSTM hyperparameters. However, the performance of gradient descent depends on hyperparameters such as learning rate, weight decay, and momentum.
[0007] Adaptive moment estimation (Adam) is an effective stochastic gradient optimization algorithm that comprehensively considers first-order moment estimation and second-order moment estimation. It can update parameters through the oscillation of historical gradients and the real historical gradients after filtering the oscillation, and limit the update step size to a certain range according to the initial learning rate. At the same time, the update is not affected by the scaling transformation of the gradient, and has good interpretability for hyperparameters.
[0008] However, the performance of a single model is limited. Nowadays, many scholars use hybrid models to improve the prediction accuracy of energy consumption. However, the current hybrid models are used to complete specific tasks, rather than adjusting the structure of LSTM itself to improve its prediction accuracy. Therefore, research on solving practical engineering problems by enhancing the performance of the LSTM algorithm itself is still in a blank stage. In addition, the stability of Adam is affected by weight decay. Summary of the invention
[0009] Based on the above problems, in order to better realize energy consumption prediction, the present invention proposes a building energy consumption prediction method (DwdAdam-LSTM) based on improved LSTM and a system.
[0010] The technical solution adopted by the present invention is as follows:
[0011] A building energy consumption prediction method based on improved LSTM includes the following processes:
[0012] Get the optimal parameters corresponding to the LSTM neural network;
[0013] The optimal parameters are introduced into the LSTM variant neural network, and the hyperparameters in the LSTM variant neural network are optimized using the stochastic gradient optimization algorithm based on weight decay to obtain the optimal hyperparameters of the LSTM variant neural network, and the LSTM variant neural network corresponding to the optimal hyperparameters is used as the optimal LSTM prediction model;
[0014] The optimal LSTM prediction model is used to process the collected data that affects the building load, predict the load data of the building at a specified time, and realize the building energy consumption prediction.
[0015] Preferably, the process of obtaining the optimal parameters corresponding to the LSTM neural network includes:
[0016] The data affecting the building load within a preset time period before predicting the building energy consumption are converted into a three-dimensional array, and the three-dimensional array is used as the original data for the next time step of the prediction. The grid search method is used to determine the LSTM neural network batch b, the number of hidden layers d and the number of hidden units u, wherein the batch b, the number of hidden layers d and the number of hidden units u constitute a three-dimensional search space, stepb, stepd and stepu correspond to the grid step lengths of the search for the batch b, the number of hidden layers d and the number of hidden units u, respectively. The training data set in the pre-established historical database is used for training and testing. The training is performed a preset number of times within the range of parameter values. The mean absolute error MAE value is used as the objective function of the grid search method to obtain the optimal parameters corresponding to the LSTM neural network.
[0017] Preferably, the optimal parameters corresponding to the LSTM neural network include the number of batches, the number of hidden layers and the number of hidden units, wherein the batch range is 13-18, the number of hidden layers is 1-3, and the number of hidden units is 20-80.
[0018] Preferably, the LSTM variant neural network model is obtained by improving the gate structure of the LSTM neural network;
[0019] The process of improving the gate structure of the LSTM neural network includes: introducing the cell state at the previous moment when calculating the forgotten data, adding the peephole connection to the forget gate system; connecting the forget gate with the input gate, introducing new information when the old information is forgotten, and setting the retained old information and the introduced new information to be complementary, while not changing the input activation function.
[0020] Preferred:
[0021] The calculation formula of the forget gate is as follows:
[0022] f t =sigmoid(W f [x t ,h t-1 , C t-1 ]+b f )
[0023] The input gate calculation formula is as follows:
[0024] i t =sigmoid(W i [x t ,h t-1 , (1-f t )]+b i )
[0025]
[0026] In the formula, C t-1 is the cell state at time step t-1, 1-f t is the old information that is retained, W f is the weight matrix of the forget gate, W i and W C is the weight matrix of the input gate, vector b f is the bias vector of the forget gate, b i and b c is the bias vector of the input gate, h t-1 is the output value of the hidden state at time step t-1, x t is the input information at time step t, f t is the output of the forget gate, i t is the input gate output, C tis the candidate value at time t, sigmoid() and tanh() are activation functions respectively.
[0027] Preferably, the stochastic gradient optimization algorithm based on weight decay is obtained by introducing a weight decay term when updating parameters in the Adam optimization algorithm after gradient moment estimation and deviation correction.
[0028] Preferably, the parameter update formula of the stochastic gradient optimization algorithm based on weight decay is as follows:
[0029]
[0030] θ=[W,b]
[0031] Where W contains the weight matrix W of the forget gate f , the weight matrix Wi of the input gate, the weight matrix W of the input gate C And the weight matrix W of the output gate o , b contains the bias matrix b of the forget gate f , the bias matrix b of the input gate i , the bias matrix b of the input gate c And the bias matrix b of the output gate o ,θ t is the parameter updated at time step t, θ t-1 is the parameter updated at time step t-1, m t is the first moment vector, is the deviation correction of the second moment vector, ε is the minimum value, η is the learning rate, and ωt-1 is the weight decay rate.
[0032] Preferably, the hyperparameters optimized for the LSTM variant neural network using the stochastic gradient optimization algorithm based on weight decay include the weight matrix of the forget gate, the weight matrix of the input gate, the weight matrix of the output gate, the bias matrix of the forget gate, the bias matrix of the input gate, and the bias matrix of the output gate (i.e., specifically including W f , W i , W C , W o 、b f 、b i 、b o and b c ); When optimizing, first set the exponential decay rate β1 of the first estimate, the exponential decay rate β2 of the second estimate, the learning rate η, and the gradient g of the initialization parameter vector t time step in the stochastic gradient optimization algorithm based on weight decay t 、The first moment vector m t 、The second moment vector v t , deviation correction of the first moment vector Deviation Correction of the Second Moment Vector and update the parameters θ t , and then use the training data set in the pre-established database for training to find a set of hyperparameters that minimize the loss function f(θ). The hyperparameters at this time are the optimal hyperparameters.
[0033] Preferably, the data affecting the building load include temperature, humidity, solar radiation, wind speed and actual data of air conditioning load.
[0034] The present invention also provides a building energy consumption prediction system based on improved LSTM, comprising:
[0035] Optimal parameter acquisition unit: used to obtain the optimal parameters corresponding to the LSTM neural network;
[0036] Data analysis unit: used to introduce the optimal parameters into the LSTM variant neural network, use the stochastic gradient optimization algorithm based on weight decay to optimize the hyperparameters in the LSTM variant neural network, obtain the optimal hyperparameters of the LSTM variant neural network, and use the LSTM variant neural network corresponding to the optimal hyperparameters as the optimal LSTM prediction model;
[0037] Data application unit: used to process the collected data affecting the building load using the optimal LSTM prediction model, predict the load data of the building at a specified time, and realize the building energy consumption prediction.
[0038] The present invention has the following beneficial effects
[0039] Most studies use SVR and Adam-LSTM neural network models to predict the hourly energy consumption of air-conditioning systems. However, due to the limitations of the prediction model itself, the prediction results are not satisfactory. The method of the present invention not only provides an adaptive learning rate for the hyperparameters, but also adds a weight decay term to update the loss parameters, thereby improving the convergence rate. Experimental results show that the method of the present invention can more fully and effectively memorize historical data than the SVR network model, has stronger stability than Adam-LSTM, and has more accurate prediction accuracy. Compared with SVR and LSTM, the MSE values of hourly energy consumption prediction are reduced by 83% and 78%, respectively, and compared with SCA-LSTM, RMSprop-LSTM and Adam-LSTM, the MSE values are reduced by 66%, 71% and 30%, respectively. Therefore, the method of the present invention has higher prediction accuracy, better stability, and is more suitable for short-term energy consumption prediction of commercial buildings. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the improved structure of the LSTM neural network of the present invention;
[0041] Figure 2This is the flow chart of the AdamW-LSTM network model of the present invention;
[0042] FIG3( a ) is a correlation analysis diagram of load and temperature in a hysteresis period of 6 hours according to the present invention;
[0043] FIG3( b ) is a correlation analysis diagram of load and humidity in the present invention with a hysteresis period of 6 hours;
[0044] FIG3( c ) is a correlation analysis diagram of the load and solar radiation of the present invention with a hysteresis period of 6 hours;
[0045] FIG3( d ) is a correlation analysis diagram of load and wind speed in the present invention with a hysteresis period of 6 hours;
[0046] Figure 4 A schematic diagram of loss values of different numbers of hidden layers during iterations of the present invention;
[0047] Figure 5 It is a schematic diagram of the change of loss value of one hidden layer after 100 iterations of the present invention;
[0048] Figure 6 This is a schematic diagram of the change in loss value of the three hidden layers of the present invention after 100 iterations. DETAILED DESCRIPTION
[0049] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0050] The present invention is based on the improved LSTM building energy consumption prediction method, comprising the following steps:
[0051] Step 1: Build an energy consumption prediction model (DwdAdam—LSTM)
[0052] The energy consumption prediction model consists of four layers: data acquisition layer, data preprocessing layer, data analysis layer, and data application layer.
[0053] The data collection layer uses high-precision sensors, controllers and other automated equipment to collect, summarize and store temperature, humidity, solar radiation and wind speed that affect building loads.
[0054] The data preprocessing layer processes the collected raw data. First, the raw data may be damaged or inaccurate due to extreme weather conditions of the collection equipment; at the same time, bad values or missing data may occur due to packet loss during transmission. The bad values are removed and processed together with the missing data through interpolation, average filter and other means. The second step is to observe the internal rules of each set of data by drawing statistical graphs, and use correlation analysis to study the correlation between energy consumption and various influencing factors, and perform appropriate screening. In addition, the data is normalized to the minimum and maximum values so that the data is mapped between [0,1]. This not only solves the problem caused by different data dimensions but also improves the convergence speed of the model. Finally, the idea of cross-validation is introduced in data processing, and the energy consumption data is divided into training set and test set.
[0055] The data analysis layer uses the improved DwdAdam optimization algorithm to optimize the LSTM variant neural network to obtain the optimal value of the hyperparameters to improve the prediction accuracy. The existing energy consumption data is trained and tested, and the loss (MAE) of the test set is calculated. When the loss is minimized, the iteration is completed.
[0056] The data application layer uses the trained model to predict the load data of large commercial buildings at a specified time.
[0057] Step 2: Build LSTM variant neural network
[0058] The present invention improves the gate structure of LSTM, introduces the cell state of the previous moment when calculating the forgotten data, and adds the peephole connection to the forget gate system, which can more accurately learn the information that needs to be retained. The forget gate is connected to the input gate, and new information is introduced when the old information is forgotten. The retained old information and the introduced new information are set to be complementary, while the input activation function is not changed. The improved LSTM variant neural network structure model is as follows Figure 1 shown.
[0059] The calculation of the forget gate and input gate after the LSTM network variant is as shown in formulas (1)-(3):
[0060] A) The forget gate is calculated as follows:
[0061] f t =sigmoid(w f [x t ,h t-1 , C t-1 ]+b f ) (1)
[0062] B) Input gate calculation is as follows:
[0063] i t =sigmoid(W i [xt ,h t-1 , (1-f t )]+b i ) (2)
[0064]
[0065] In the formula, C t-1 is the cell state at time step t-1, 1-f t is the old information that is retained, W f is the weight matrix of the forget gate, W i and W C is the weight matrix of the input gate, vector b f is the bias vector of the forget gate, b i and b c is the bias vector of the input gate, h t-1 is the output value of the hidden state at time step t-1, x t is the input information at time step t, f t is the output of the forget gate, i t is the input gate output, C t is the candidate value at time t, sigmoid() and tanh() are activation functions respectively.
[0066] Step 3: DwdAdam optimization algorithm
[0067] The traditional Adam optimizer estimates the first-order moment and second-order moment of the gradient, calculates the individual adaptive learning rate of different parameters after bias correction, and finds the optimal value of the hyperparameter. However, in some tasks, it is found that Adam is less stable than SGD, and the main reason is weight decay.
[0068] The present invention combines traditional Adam, after gradient moment estimation, after deviation correction, introduces weight decay term when updating parameters, and obtains stochastic gradient optimizer DwdAdam based on weight decay. The advantage of this is that the update of individual adaptive learning rate is decoupled from weight decay, so that hyperparameters are no longer dependent on each other, thereby achieving independent optimization of hyperparameters. The calculation process of DwdAdam optimization algorithm is as follows:
[0069]
[0070] θ=[W,b] (5)
[0071] Where W contains the weight matrix W of the forget gate f , the weight matrix W of the input gate i , the weight matrix W of the input gate C And the weight matrix W of the output gate o, b contains the bias matrix b of the forget gate f , bias matrix b of the input gate i , bias matrix b of the input gate c And the bias matrix b of the output gate o ,θ t is the parameter updated at time step t, θ t-1 is the parameter updated at time step t-1, m t is the first moment vector, is the deviation correction of the second moment vector, ε is the minimum value, η is the learning rate, ω t-1 is the weight decay rate.
[0072] Step 4: Building Energy Consumption Forecast
[0073] By analyzing the data, it can be seen that short-term load forecasting is somewhat dependent on the load and weather factors of the previous few days. Therefore, the DwdAdam optimization algorithm is used to obtain the optimal hyperparameters of the LSTM network and obtain the most efficient results in the shortest time.
[0074] The overall work of building energy consumption prediction can be divided into four parts, namely (1) data cleaning; (2) optimization of LSTM structure; (3) prediction of short-term energy consumption value; (4) DwdAdam-LSTM model evaluation. The algorithm flow is as follows Figure 2 shown.
[0075] Step 4-1: Data cleaning
[0076] The proposed model is used to predict the energy consumption demand of buildings, and the real data collected in the building are used to prove the superiority of the established model. In order to further improve the efficiency of parameter updating and the accuracy of the model in predicting energy consumption data, the abnormal and missing data in the original data set are interpolated, and the main factors affecting energy consumption are screened out using the correlation analysis method. The data are normalized in the range of [0,1] and the sample set is divided into a training set and a test set. Figure 3(a)-Figure 3(d) shown.
[0077] Step 4-2: Optimize the structure of the LSTM neural network
[0078] Before using LSTM to predict load, the load, temperature, humidity, and solar radiation data for the previous 6 hours are converted into a three-dimensional array, which is used as the original data for the next time step. The grid search method is used to determine the LSTM batch b, the number of hidden layers d, and the number of hidden units u. b, d, and u constitute a three-dimensional search space, and stepb, stepd, and stepu correspond to the grid step size of each parameter search. The training data set in the historical database is used for training and testing. Five trainings are performed within the range of parameter values. The mean absolute error MAE value is used as the objective function of the grid search algorithm to obtain the optimal parameters corresponding to the LSTM neural network. The value range of the LSTM network parameter variables is shown in Table 1.
[0079] Table 1
[0080] Number of batches [13-18] Number of hidden layers [1-3] Number of hidden layer units [20-80]
[0081] The optimal parameters are introduced into the LSTM variant neural network. Then the DwdAdam optimization algorithm is used to optimize the hyperparameter W in LSTM. f , W i , W C , W o 、b f 、b i 、b o and b c First, set the parameters β1, β2, η and the initialization parameter vector g in DwdAdam t 、m t 、v t , θ t , and then use the training data set in the database for training to find a set of hyperparameters that minimizes the loss function f(θ), thereby obtaining the optimal LSTM prediction model.
[0082] Step 4-3: Short-term energy consumption forecast
[0083] Use the test set of the database to test the optimal LSTM prediction model obtained in step 4-2 to obtain the short-term energy consumption prediction value.
[0084] Step 4-4: Evaluate the model
[0085] According to the predicted energy consumption value, CV-RMSE, MSE, MAE, and MAPE are used to evaluate the accuracy of the energy consumption prediction model.
[0086] Example
[0087] This example studies the energy consumption data of a large commercial building and demonstrates the superior prediction performance of the model used.
[0088] 1 Experimental Description
[0089] The experiment uses hardware devices such as temperature and humidity sensors, solar radiation sensors, micro wind speed sensors, smart meters, smart gateways, DDC controllers, data concentrators, air switches, and 24V switching power supplies. The DwdAdam-LSTM energy consumption prediction model used is implemented in the Python 3.8 language environment under the Windows 10 operating system based on the AMD R7 processor. The entire experimental process is divided into four stages: (1) data collection; (2) data preprocessing; (3) DwdAdam-LSTM model setting; (4) performance evaluation.
[0090] 1.1 Dataset Description
[0091] The data was collected from a large commercial building with a height of 40.6 meters and a construction area of about 250,000 square meters, of which the air-conditioning coverage area was about 187,600 square meters. The data set includes actual data on temperature, humidity, solar radiation, wind speed, and air-conditioning load from 8:00 a.m. to 10:00 p.m. from June 2, 2021 to August 12, 2021, recorded once every hour, for a total of 1,080 sets of data.
[0092] 1.2 Data Preprocessing
[0093] Data preprocessing is an indispensable step before analyzing data. It avoids the loss of model traceability due to missing values, outliers, etc. It also takes into account the compatible format of the learning model caused by the dimensional differences between data, and adopts minimum and maximum normalization processing to avoid the decline of prediction accuracy.
[0094] By observing the internal rules of each set of data, the correlation analysis method is used to study the correlation between energy consumption and various influencing factors, and the factors with high correlation are screened out. The processed data set is divided into training and test samples to reduce the complexity of the model and improve the prediction accuracy of the model. The experimental data set totals 1080 groups, of which the test samples account for 10% of the total data set. Figure 3(a)-Figure 3(d) The figure shows the correlation between load and other influencing factors with a lag period of 6 hours. It is obvious that the correlation between load and temperature, humidity, and solar radiation exceeds the upper and lower limits of confidence. Among them, the correlation coefficient between load and solar radiation is the highest, while the correlation between load and wind speed is the lowest, so the wind speed variable is eliminated.
[0095] 1.3DwdAdam-LSTM model settings
[0096] The structural parameters of LSTM are obtained through the grid search algorithm. The specific parameter settings are shown in Table 2.
[0097] Table 2
[0098]
[0099]
[0100] The simulation experiment is implemented in Python using the Keras deep learning library based on Tensorflow.
[0101] 1.4 Model Evaluation Indicators
[0102] In order to effectively evaluate the model, four indicators, namely, mean absolute error (MAE), mean absolute percentage error (MAPE), mean square error (MSE), and coefficient of variation of root mean square error (CV-RMSE), are used as performance evaluation criteria for the energy consumption prediction model. MAE is used as the loss function. The smaller the loss function value, the better the prediction model performance.
[0103] 2 Results and discussion
[0104] Various experimental models were compared and analyzed, proving the advantages of the DwdAdam-LSTM of the present invention over the comparative experimental models in terms of energy consumption prediction accuracy. In order to reduce the accidental error of the experiment, the average value was calculated after running 20 times to obtain the final performance evaluation value.
[0105] 2.1 LSTM Optimal Parameters
[0106] The first step of the experiment is to find the optimal number of LSTM hidden layers, batches, and hidden units by using a grid search algorithm. LSTM neural network models with hidden layer numbers ranging from [1, 3], batches ranging from [5, 18], and hidden unit numbers ranging from [30, 80] were tested.
[0107] The experimental results show that the best batch is 15. The main reason is that the mall is open from 8:00 to 22:00 every day. The energy consumption prediction is for the air conditioning load in the commercial area. The change of air conditioning load is related to weather and time factors and changes regularly. The best hidden unit is 50 and the number of hidden layers is 3. The experiment once again verified the size of the loss value of different hidden layers under the best hidden unit and batch. Figure 4 The effect of different numbers of hidden layers over 5 iterations is given in the form of mean absolute error (MAE). Figure 4 It can be seen that the loss of the number of hidden layers is 2 is slightly higher than the other two, and the loss of the number of hidden layers is 3 for three times is the smallest. However, after 100 iterations of the test data set, it is found that Figure 5 and Figure 6 Although the training loss with 3 hidden layers is smaller than that with 1 hidden layer, the test loss with 3 hidden layers is worse than that with 1 hidden layer, which indicates overfitting. Therefore, the optimal number of hidden layers is 1.
[0108] 4.2.2 Comparison between the proposed method and mainstream prediction models
[0109] LSTM and SVR neural networks have the ability to predict energy consumption. When processing multi-source heterogeneous data, the optimization algorithm is mixed with the data-driven model to improve the accuracy and stability of the energy consumption prediction model.
[0110] The predicted values obtained by applying the LSTM neural network and the SVR network are basically consistent with the actual values, but the error of the SVR network is significantly higher than that of the LSTM neural network within a week, and the error range is relatively large. Analysis shows that the energy consumption of the air-conditioning system is greatly affected by external environmental factors and has strong volatility. In addition, multiple input parameters such as temperature and solar radiation are also the reasons for the decline in SVR performance. However, LSTM is a recursive neural network that retains the nonlinear mapping ability of the SVR neural network and is suitable for processing trend data. Because the historical data is long, the forget gate still retains useful data.
[0111] After applying different optimization algorithms to optimize the LSTM neural network, the prediction effect is significantly improved. However, it is found that the absolute error of SCA-LSTM is generally large, and the range of errors of RMSprop-LSTM and Adam-LSTM is large, indicating that their stability is poor. DwdAdam-LSTM performs stably, and the error fluctuation range is within 15%.
[0112] The quality performance indicators of different prediction models under the optimal architecture were calculated. The experiment found that the single data-driven model LSTM had higher prediction accuracy than SVR, and the MSE value of hourly energy consumption prediction was reduced by 23%. However, the single data-driven model was far inferior to the hybrid model in terms of convergence issues and model accuracy. The hybrid model also performed differently in various performance indicators. For example, compared with RMSprop-LSTM, SCA-LSTM performed poorly in MAE and MAPE, but performed well in MSE. Among the hybrid models, SCA-LSTM performed the worst, with its CV-RMSE, MAE, MAPE, and MSE decreasing by 19%, 8.6%, 10.7%, and 35.7% compared with LSTM. The proposed model DwdAdam-LSTM decreased its CV-RMSE, MAE, MAPE, and MSE by 58%, 81%, 79%, and 78% respectively compared with LSTM, and decreased by 41%, 53%, 52%, and 30% respectively compared with the second best Adam-LSTM. The comparison results of the quality performance indicators of energy consumption prediction of different prediction models are shown in Table 3.
[0113] Table 3
[0114]
[0115] It can be seen that the energy consumption prediction model based on DwdAdam-LSTM has significant improvements in various performance evaluation indicators compared with the comparison model.
Claims
1. A building energy consumption prediction method based on improved LSTM, characterized in that: The process includes the following: Get the optimal parameters corresponding to the LSTM neural network; The optimal parameters are introduced into the LSTM variant neural network, and the hyperparameters in the LSTM variant neural network are optimized using the stochastic gradient optimization algorithm based on weight decay to obtain the optimal hyperparameters of the LSTM variant neural network, and the LSTM variant neural network corresponding to the optimal hyperparameters is used as the optimal LSTM prediction model; The optimal LSTM prediction model is used to process the collected data affecting the building load, predict the load data of the building at a specified time, and realize the building energy consumption prediction; The stochastic gradient optimization algorithm based on weight decay is obtained by introducing a weight decay term when updating parameters in the Adam optimization algorithm after gradient moment estimation and deviation correction; The parameter update formula of the stochastic gradient optimization algorithm based on weight decay is as follows: θ=[W,b] Where W contains the weight matrix of the forget gate, the weight matrix of the input gate, and the weight matrix of the output gate, b contains the bias matrix of the forget gate, the bias matrix of the input gate, and the bias matrix of the output gate, θ t is the parameter updated at time step t, θ t-1 is the parameter updated at the t-1 time step, mt is the first moment vector, is the deviation correction of the second moment vector, ε is the minimum value, η is the learning rate, ω t-1 is the weight decay rate.
2. According to claim 1, a building energy consumption prediction method based on improved LSTM is characterized in that: The process of obtaining the optimal parameters of the LSTM neural network includes: The data affecting the building load within a preset time period before predicting the building energy consumption are converted into a three-dimensional array, and the three-dimensional array is used as the original data for the next time step of the prediction. The grid search method is used to determine the LSTM neural network batch b, the number of hidden layers d and the number of hidden units u, wherein the batch b, the number of hidden layers d and the number of hidden units u constitute a three-dimensional search space, stepb, stepd and stepu correspond to the grid step lengths of the search for the batch b, the number of hidden layers d and the number of hidden units u, respectively. The training data set in the pre-established historical database is used for training and testing. The training is performed a preset number of times within the range of parameter values. The mean absolute error MAE value is used as the objective function of the grid search method to obtain the optimal parameters corresponding to the LSTM neural network.
3. A building energy consumption prediction method based on improved LSTM according to claim 2, characterized in that: The optimal parameters corresponding to the LSTM neural network include the number of batches, the number of hidden layers and the number of hidden units, wherein the batch range is 13-18, the number of hidden layers is 1-3, and the number of hidden units is 20-80.
4. The building energy consumption prediction method based on improved LSTM according to claim 1 is characterized in that: By improving the gate structure of the LSTM neural network, the LSTM variant neural network model is obtained; The process of improving the gate structure of the LSTM neural network includes: introducing the cell state of the previous moment when calculating the forgotten data, and adding the peephole connection to the forget gate system; Connect the forget gate to the input gate, introduce new information when the old information is forgotten, and set the retained old information and the introduced new information to be complementary, while not changing the input activation function.
5. The building energy consumption prediction method based on improved LSTM according to claim 4 is characterized in that: The calculation formula of the forget gate is as follows: f t =sigmoid(W f [x t ,h t-1 ,C t-1 ]+b f ) The input gate calculation formula is as follows: i t =sigmoid(W i [x t ,h t-1 (1-f t )]+b i ) In the formula, C t-1 is the cell state at time step t-1, 1-f t is the old information that is retained, W f is the weight matrix of the forget gate, W i and W C is the weight matrix of the input gate, vector b f is the bias vector of the forget gate, b i and b c is the bias vector of the input gate, h t-1 is the output value of the hidden state at time step t-1, x t is the input information at time step t, f t is the output of the forget gate, i t is the input gate output, is the candidate value at time t, sigmoid() and tanh() are activation functions respectively.
6. The building energy consumption prediction method based on improved LSTM according to claim 1 is characterized in that: The hyperparameters optimized for the LSTM variant neural network using the stochastic gradient optimization algorithm based on weight decay include the weight matrix of the forget gate, the weight matrix of the input gate, the weight matrix of the output gate, the bias matrix of the forget gate, the bias matrix of the input gate, and the bias matrix of the output gate; when optimizing, first set the exponential decay rate of the first estimate, the exponential decay rate of the second estimate, the learning rate, the gradient of the initialization parameter vector t time step, the first moment vector, the second moment vector, the deviation correction of the first moment vector, the deviation correction of the second moment vector, and the update parameters in the stochastic gradient optimization algorithm based on weight decay, and then use the training data set in the pre-established database for training to find a set of hyperparameters that minimize the loss function f(θ), and the hyperparameters at this time are the optimal hyperparameters.
7. The building energy consumption prediction method based on improved LSTM according to claim 1 is characterized in that: The data affecting the building load include temperature, humidity, solar radiation, wind speed and actual data of air conditioning load.
8. A building energy consumption prediction system based on improved LSTM, characterized in that: include: Optimal parameter acquisition unit: used to obtain the optimal parameters corresponding to the LSTM neural network; Data analysis unit: used to introduce the optimal parameters into the LSTM variant neural network, use the stochastic gradient optimization algorithm based on weight decay to optimize the hyperparameters in the LSTM variant neural network, obtain the optimal hyperparameters of the LSTM variant neural network, and use the LSTM variant neural network corresponding to the optimal hyperparameters as the optimal LSTM prediction model; the stochastic gradient optimization algorithm based on weight decay is in the Adam optimization algorithm, after the gradient moment estimation, after the deviation correction, the weight decay term is introduced during the parameter update to obtain the stochastic gradient optimization algorithm based on weight decay; the parameter update formula of the stochastic gradient optimization algorithm based on weight decay is as follows: θ=[W,b] Where W contains the weight matrix of the forget gate, the weight matrix of the input gate, and the weight matrix of the output gate, b contains the bias matrix of the forget gate, the bias matrix of the input gate, and the bias matrix of the output gate, θ t is the parameter updated at time step t, θ t-1 is the parameter updated at time step t-1, m t is the first moment vector, is the deviation correction of the second moment vector, ε is the minimum value, η is the learning rate, ω t-1 is the weight decay rate Data application unit: used to process the collected data affecting the building load using the optimal LSTM prediction model, predict the load data of the building at a specified time, and realize the building energy consumption prediction.
