Abstract
Traditional prediction models, which are based on artificial neural networks (ANNs), consider the various factors affecting building energy consumption comprehensively. However, their explanatory power is not ideal in actual application, resulting in prediction errors of building energy consumption. Thus, this paper pursues the explanatory optimization of the prediction model for building energy consumption. First, the authors displayed the architecture of the prediction model for building energy consumption, which is based on the temporal pattern attention mechanism (TPAM), and explained the principle of predicting building energy consumption. Then, the input of the TPAM was illustrated, and the execution steps of the model were depicted. Based on feature importance and the Shapley additive explanations (SHAP) method, the explanatory power of the proposed prediction model was analyzed, from the perspective of the time series features of building energy consumption prediction. The proposed model was proved effective through experiments.
1. Introduction
With the rapid development of the economy, global energy consumption has increased year by year. Meanwhile, buildings become larger in scale, and better in grade, taking up a growing portion in global energy consumption. Therefore, it is practically significant to reduce the energy consumption, lower the emissions, and predict the energy consumption of large buildings [1–7]. For models with low data requirements, the trend of the time series for building energy consumption prediction can be obtained through simple statistical analysis of time nodes. Then, it is possible to make the final prediction of building energy consumption [8–17]. Traditional prediction models, which are based on artificial neural networks (ANNs), consider the various factors affecting building energy consumption comprehensively. However, their explanatory power is not ideal in actual application, resulting in prediction errors of building energy consumption. This significantly limits the applicable range of the models. As a result, it is necessary to develop models that can explain building energy consumption [18–21].
Nearly, 40% of global carbon emissions come from the building industry, which has a great potential for meeting the climate targets. Aiming to enhance building energy efficiency, the energy performance certificate requires accurate prediction of building energy performance. With the significant improvement of information and communication technology, the data-driven method has been introduced to study building energy performance and proved to boast a high computing efficiency and predictive performance. Nevertheless, most studies focus on predictive performance, without considering the potential of explaining artificial intelligence (AI). To fill up the gap, Wenninger et al. [6] designed the novel QLattice algorithm, which considers both predictive performance and the explanatory power. The algorithm was applied to forecast the annual energy-saving performance on a dataset containing 25,000 plus German residential buildings. Lei and Yin [22] improved the standard backpropagation (BP) neural network with the Levenberg–Marquardt (LM) algorithm and built an LMBP-based prediction model for the lighting energy consumption of high-rise buildings. The traditional prediction models for building energy consumption in shopping malls face limitations in the type and number of input variables. To overcome the limitations, Jing et al. [23] proposed a prediction model for building energy consumption in shopping malls based on the chaotic theory. The first step of the model is to compute the Lyapunov exponent of the energy consumption, which proves the chaotic nature of the energy consumption. As an important process in the sustainable building design, the evaluation of building energy-saving performance has a great impact on global energy reduction and environmental protection. Li et al. [24] developed an efficient way to evaluate building energy consumption. Their strategy integrates building information modeling (BIM), energy consumption simulation, and energy consumption prediction. The accurate prediction of building energy consumption is of great significance to the building energy management system. Nonetheless, building energy consumption is difficult to predict because the relevant data are often nonlinear and unsmooth. Karijadi and Chou [25] combined random forest (RF) and long short-term memory (LSTM) to predict building energy consumption, based on the complete ensemble empirical mode decomposition with adaptive noise (CEEMDAN).
Many studies have successfully predicted building energy consumption. Yet, most of them concentrate on improving prediction accuracy, summing up the key factors affecting building energy consumption, and the research trend of building energy prediction. The prediction effect of ensemble models depends on the basic learner and the ensemble strategy. It is impossible to demonstrate whether the model prediction is trustworthy or not. Thus, the prediction results often trigger many controversies. As a result, the building energy prediction models lack explanatory power. The model users in need of forecasting building energy consumption no longer trust the prediction results. In addition, the models are not frequently used in actual scenarios. Therefore, this paper pursues the explanatory optimization of the prediction model for building energy consumption. Section 2 displays the architecture of the prediction model for building energy consumption, which is based on the temporal pattern attention mechanism (TPAM), and explains the principle of predicting building energy consumption. Section 3 illustrates the input of the TPAM, and details the execution steps of the model. Section 4 analyzes the explanatory power of the proposed prediction model based on feature importance and the Shapley additive explanations (SHAP) method, from the perspective of the time series features of building energy consumption prediction. Finally, the proposed model was proved effective through experiments.
2. Prediction Principle of Building Energy Consumption
In traditional prediction models of building energy consumption, an information loss may occur due to the connection vector between the encoder and the decoder. To solve the problem, this paper introduces the TPAM to the existing prediction framework. The new prediction model can make better predictions of building energy consumption, during the handling of the input time series, which involve multiple variables. Figure 1 illustrates the architecture of the TPAM-based prediction model for building energy consumption.
Figure 1.
TPAM-based prediction model for building energy consumption.
Compared with traditional attention mechanism, the TPAM can effectively handle the multivariate input time series for the forecast of building energy consumption. This mechanism can mine more deep-seated information from the multivariate input time series, according to the weights of specific variables, and the acquired local features. It can also identify the lost position and other key information. The TPAM mainly encompasses two parts: a time detection module of convolutional neural network (CNN) and an attention weighting module. The workflow of the TPAM is as follows:
In the prediction model, the bidirectional gated recurrent unit (BiGRU) layer mainly computes the n-dimensional hidden state fi of each time step, and then derive the hidden state matrix F = {fe − q, fe- + 1,…, fe − 1}, where q is the length of the sliding window. For the time series for building energy prediction, the states of each variable at all time steps can be represented by a row vector of the hidden state matrix E. The states of all variables at each time step can be characterized by a column vector in that matrix. Then, a one-dimensional (1D) CNN can be called to extract the variable time pattern:
(1) |
Formula (1) performs a convolution operation D with l filters and the kernel size of 1 × E over the row vector of F, producing the time pattern matrix FD corresponding to that variable. Let FijD be the calculation result of the i-th row vector and the j-th kernel; FiD be the i-th row of matrix FD; Qx be the trainable weight matrix; fe be the hidden state outputted by the BiGRU layer. Then, the variable time pattern can be evaluated by the following:
(2) |
To obtain multiple variables that facilitate the prediction of building energy consumption, the TPAM would determine the attention weights by sigmoid function. The attention weight βi can be calculated by the following:
(3) |
Finally, the context vector vtue can be obtained as the weighted sum of the vectors in row FD:6
(4) |
The GA optimization of the BP neural network intends to improve the initial weights and thresholds of the network. However, the traditional GA has difficulty in optimizing the structural parameters of the neural network. The main difficulty lies in the variation of chromosome length with the number of hidden layers. To solve this problem, the GA is improved in this research. In the improved GA, the single-point crossover is adopted as follows:
(5) |
where
(6) |
The improved GA adopts polynomial mutation. Suppose the mutation operator is ul′=ul+ξ · (vl − kl), ξ1=(ul − kl)/(vl − kl), and ξ2=(vl − ul)/vl − kl. Let vdenote a random variable in [0, 1]; γn denote the dispersion index; ul denote a parent individual. Then, ξ can be calculated by the following:
(7) |
3. Construction of the Energy Consumption Prediction Model
The TPAM-based energy consumption prediction model consists of three parts: BiGRU encoder, TPAM, and BiGRU decoder. Figure 2 illustrates the input of the TPAM. The prediction model is executed in the following steps:
Figure 2.
Input of TPAM.
Step 1 . —
Let ae be the input time series at the current time step; fe − 1 be the hidden state at the previous time step; fe be the hidden state at the current time step e. After importing ae, and fe − 1 into the encoder, fe can be calculated by the following:
(8)
Step 2 . —
Let be − 1 be the previous output series; re − 1 be the hidden state of the previous time step; re be the hidden state of the current time step. Based on be − 1 and re − 1, the decoder can compute re:
(9)
Step 3 . —
Let Qu be the parameter matrix. The context vectors ue and re can be connected to obtain the following:
(10)
Step 4 . —
Let Qr be the parameter matrix. Then, be can be solved based on the SoftMax function:
(11) The energy consumption of buildings is affected by various factors. The time series inputted to predict building energy consumption can be divided into the historical energy consumptions at the n previous moments, time variables, and weather variables. Here, the objective function of building energy consumption prediction is defined as follows:
(12) where A=(PE, SF, XO, QR, F, C, Q, N, W), with PE, SF, XO, QR, F, C, Q, N, and W being the various input variables, such as wind velocity, humidity, temperature, and sun intensity. The historical energy consumptions at the n previous moments are denoted by B = (Ke, Ke − 1, Ke − 2, Ke − 3, Ke − 4,…, Ke − n), with n being the window length of the historical data. The predicted values for the m future moments are denoted as b∗=(be+1∗, be+2∗, be+3∗,…, be+m∗). Figure 3 illustrates the input data of the model.
The Adam algorithm can dynamically adjust the learning rate of each parameter, making the update of parameters steadier. In actual applications, this algorithm outshines most gradient-based optimizes. This paper relies on the Adam algorithm to iteratively update the weight and bias of each node of the prediction model, in order to obtain an adaptive learning rate. Let ne and me be the estimation for the first-order moment of gradients, and that for the second-order moment of gradients; ne′ and me′ be the correction for ne and me, respectively; γ be the learning rate. Then, we have as follows:
(13) where ne′ and me′ can be viewed as unbiased estimates of expectations. The loss function of the model is the easily solvable mean squared error (MSE):
(14) where m is the number of samples; bi and bio are actual value and predicted value, respectively.
Figure 3.
Input data of the model.
4. Analysis on Explanatory Power
Based on feature importance and the SHAP method, the explanatory power of the proposed prediction model was analyzed, from the perspective of the time series features of building energy consumption prediction.
To disturb each time series for predicting building energy consumption, noises are added to the eigenvalues of each time series. The model performance is measured by MSE (14). The importance of feature l can be calculated by the following:
(15) |
Let MSEi and MSEj denote the MSE of the model before and after noise addition, respectively. The greater the SHAP feature importance, the more important the features of a time series. The SHAP feature importance can be calculated by the following:
(16) |
where m is the sample size; Ψj(i) is the Shapley value of the j-th feature in the i-th time series sample.
The interaction effect between time series features can be measured by the effect of the combinatory features added to a single time series feature. The Shapley interaction index of two time series features can be defined as follows:
(17) |
If i≠j, we have the following:
(18) |
5. Experiments and Result Analysis
To highlight the universality of predicting building energy consumption, two different public datasets were selected from China and a foreign country for our experiments.
Out of the various factors affecting building energy consumption, the change of the local climate is a leading factor. This paper summarizes the energy consumption of target buildings at different temperatures. The results in Figure 4 show that when the temperature is below 20°C, the mean energy consumption of buildings does not change significantly with the rise of the mean temperature; when the temperature is above 20°C, the mean energy consumption of buildings surges up with the growth of the mean temperature, mainly due to the increase of refrigeration loads.
Figure 4.
Influence of temperature on building energy consumption.
To demonstrate its effectiveness, the proposed prediction model of building energy consumption was compared with recurrent neural network (RNN) (model 1), GRU (model 2), LSTM (model 3), deep Q network (DQN) (model 4), and dueling DQN (model 5). Figure 5 compares the prediction results of the different models. It can be observed that the prediction of our model is closer to the actual value, and more accurate than that of other models. Besides, the prediction effect of our model is better, when the refrigeration load consumes much energy during the working period, as evidenced by the minimum prediction error.
Figure 5.
Prediction results of different models.
Table 1 compares the prediction errors of different models. Obviously, the five models differed significantly in the prediction accuracy on the time series for building energy consumption. Our experiment lasted five months. The results show that our model had a 3–6% lower MAPE and 35–50% lower MSE than the other models. The low MAPE and MSE demonstrate the good generalization and robustness of our model.
Table 1.
Prediction errors of different models.
Period | Metric | Dataset | |||||
---|---|---|---|---|---|---|---|
Model 1 | Model 2 | Model 3 | Model 4 | Model 5 | Our model | ||
January | MAPE | 16.24% | 14.73% | 12.15% | 10.58% | 13.96% | 6.48% |
MSE | 7.19 | 6.33 | 5.24 | 4.35 | 3.85 | 2.39 | |
| |||||||
February | MAPE | 17.54% | 15.21% | 14.62% | 9.58% | 9.16% | 5.37% |
MSE | 7.98 | 6.08 | 5.03 | 4.81 | 4.59 | 2.74 | |
| |||||||
March | MAPE | 16.61% | 14.73% | 12.54% | 9.38% | 14.71% | 6.85% |
MSE | 7.49 | 6.63 | 5.06 | 4.71 | 4.38 | 2.74 | |
| |||||||
April | MAPE | 17.28% | 16.11% | 13.62% | 11.48% | 9.62% | 5.37% |
MSE | 6.99 | 6.52 | 6.09 | 4.35 | 4.18 | 2.63 | |
| |||||||
May | MAPE | 17.84% | 17.03% | 16.95% | 11.41% | 13.64% | 6.17% |
MSE | 7.84 | 5.87 | 5.16 | 4.95 | 4.35 | 2.81 | |
| |||||||
Mean | MAPE | 15.78% | 114.57% | 13.05% | 11.62% | 13.84% | 6.37% |
MAPE is short for mean absolute percentage error.
As a tool for explaining the prediction of building energy consumption, SHAP can explain the quality of the prediction on a single test sample, and the importance of complex time series features. Figure 6 compares the metrics of different models. It can be seen that our model predicted building energy consumption better than the other models, as evidenced by its superior fitting effect on the time series for building energy consumption.
Figure 6.
Metrics of different models. RMSE and MAE are short for root mean square error and mean absolute error.
Table 2 presents the SHAP values of the features of the 11 variables below the mean prediction output. The SHAP values of variables PE, QR, C, Q, and N were smaller than zero, indicating that these variables negatively affect the prediction output of our model. The SHAP values of the other variables are greater than zero, suggesting that they promote the prediction output of our model. In the meantime, the positive effect of the eigenvalues corresponding to the 11 features was smaller than the negative effect of these eigenvalues. Thus, the output of the time series for building energy consumption is smaller than the mean prediction output.
Table 2.
SHAP values of the features of the variables below the mean prediction output.
Variable | Eigen value | SHAP value | Variable | Eigen value | SHAP value |
---|---|---|---|---|---|
PE | 43 | −5.1273 | C | 10 | −0.4627 |
SF | 42.8 | 1.6259 | Q | 75.69 | −0.3162 |
XO | 189 | 2.4815 | N | 184.53 | −1.4851 |
QR | 40.53 | −2.4183 | W | 78 | 0.4195 |
F | 72 | 0.7481 | B | 15 | 0.3268 |
b ∗ | 36 | 0.1245 |
Figure 7 shows the importance of the SHAP features of the 11 variables. It can be observed that the high-ranking variables exert a significant impact on the prediction output of building energy consumption. Among them, the SHAP feature corresponding to b∗ was the most important, indicating that b∗ contributes the greatest to the output of the energy consumption prediction model. By contrast, the SHAP feature corresponding to wind velocity PE was the least important, indicating that PE contributes the least to the output.
Figure 7.
Importance of the SHAP features of the 11 variables.
6. Conclusions
This paper optimizes the explanatory power of the prediction model for building energy consumption. Specifically, the authors displayed the architecture of the TPAM-based prediction model for building energy consumption and introduced the principle of predicting building energy consumption. Then, they went on to illustrate the input of the TPAM and explain the execution steps of the model. Based on feature importance and SHAP method, the explanatory power of the proposed prediction model was analyzed, from the perspective of the time series features of building energy consumption prediction. Through experiments, this paper summarizes the energy consumption of target buildings at different temperatures and identifies the main reasons for the influence of temperature on building energy consumption. To demonstrate its effectiveness, our prediction model for building energy consumption was compared with different models. The comparison of prediction errors proves the effectiveness of our model. In addition, the authors displayed the SHAP values of the features of the 11 variables below the mean prediction output and exhibited the importance of the SHAP features of these variables. Finally, the explanatory power of our model was analyzed.
Due to the limited data volume, it is difficult to build an energy consumption prediction model for each season. In future, as more data become available, the research of building energy prediction model will be further improved and better prediction effect will be realized.
Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
References
- 1.Yang X., Zhang S., Xu W. Impact of zero energy buildings on medium-to-long term building energy consumption in China. Energy Policy . 2019;129:574–586. doi: 10.1016/j.enpol.2019.02.025. [DOI] [Google Scholar]
- 2.Zhang M., Ge X., Zhao Y., Xia-Bauer C. Creating statistics for China’s building energy consumption using an adapted energy balance sheet. Energies . 2019;12(22):p. 4293. doi: 10.3390/en12224293. [DOI] [Google Scholar]
- 3.Huang Z., Ge J., Zhao K., Shen J. Post-evaluation of energy consumption of the green retrofit building. Energy Procedia . 2019;158:3608–3613. doi: 10.1016/j.egypro.2019.01.903. [DOI] [Google Scholar]
- 4.Wang Y., Wang P. Effects of building physics form on energy consumption for buildings. Journal of Physics: Conference Series . 2022;2186(1) doi: 10.1088/1742-6596/2186/1/012008.012008 [DOI] [Google Scholar]
- 5.Ji C., Hong T., Kim H., Yeom S. Effect of building energy efficiency certificate on reducing energy consumption of non-residential buildings in South Korea. Energy and Buildings . 2022;255 doi: 10.1016/j.enbuild.2021.111701.111701 [DOI] [Google Scholar]
- 6.Wenninger S., Kaymakci C., Wiethe C. Explainable long-term building energy consumption prediction using QLattice. Applied Energy . 2022;308 doi: 10.1016/j.apenergy.2021.118300.118300 [DOI] [Google Scholar]
- 7.Touzani S., Ravache B., Crowe E., Granderson J. Statistical change detection of building energy consumption: applications to savings estimation. Energy and Buildings . 2019;185:123–136. doi: 10.1016/j.enbuild.2018.12.020. [DOI] [Google Scholar]
- 8.Li H. J., Qiao Z., Chen W., Zeng X. Q., Wu L. Research on public building energy consumption prediction method based on NAR neural network prediction technology. E3S Web of Conferences . 2019;118 doi: 10.1051/e3sconf/201911804010.04010 [DOI] [Google Scholar]
- 9.Tian C., Li C., Zhang G., Lv Y. Data driven parallel prediction of building energy consumption using generative adversarial nets. Energy and Buildings . 2019;186:230–243. doi: 10.1016/j.enbuild.2019.01.034. [DOI] [Google Scholar]
- 10.Xie Q., Ni J. Q., Bao J., Su Z. A thermal environmental model for indoor air temperature prediction and energy consumption in pig building. Building and Environment . 2019;161 doi: 10.1016/j.buildenv.2019.106238.106238 [DOI] [Google Scholar]
- 11.Sha G., Qian Q. Prediction of commercial building lighting energy consumption based on EPSO-BP. Proceedings of the 2018 18th International Conference on Control, Automation and Systems (ICCAS); 17-20 October 2018; PyeongChang, Korea (South). pp. 1035–1040. [Google Scholar]
- 12.Li C., Ding Z., Yi J., Lv Y., Zhang G. Deep belief network based hybrid model for building energy consumption prediction. Energies . 2018;11(1):p. 242. doi: 10.3390/en11010242. [DOI] [Google Scholar]
- 13.Chen S., Ren T. T., Wu Z. C. Research on neural network optimization algorithm for building energy consumption prediction. Journal of Computational Methods in Science and Engineering . 2018;18(3):695–707. doi: 10.3233/jcm-180820. [DOI] [Google Scholar]
- 14.Ahmad M. W., Mourshed M., Rezgui Y. Trees vs Neurons: comparison between random forest and ANN for high-resolution prediction of building energy consumption. Energy and Buildings . 2017;147:77–89. doi: 10.1016/j.enbuild.2017.04.038. [DOI] [Google Scholar]
- 15.El-Gohary K., El-Gohary N. Building lighting energy consumption prediction for supporting energy data analytics. Procedia Engineering . 2016;145:511–517. doi: 10.1016/j.proeng.2016.04.036. [DOI] [Google Scholar]
- 16.Son H., Kim C., Kim C., Kang Y. Prediction of government-owned building energy consumption based on an RReliefF and support vector machine model. Journal of Civil Engineering and Management . 2015;21(6):748–760. doi: 10.3846/13923730.2014.893908. [DOI] [Google Scholar]
- 17.Ullah I., Ahmad R., Kim D. A prediction mechanism of energy consumption in residential buildings using hidden Markov model. Energies . 2018;11(2):p. 358. doi: 10.3390/en11020358. [DOI] [Google Scholar]
- 18.Kim S., Kim D. Prediction-learning algorithm for efficient energy consumption in smart buildings based on particle regeneration and velocity boost in particle swarm optimization neural networks. Energies . 2018;11(5):p. 1289. doi: 10.3390/en11051289. [DOI] [Google Scholar]
- 19.Mena R., Rodríguez F., Castilla M., Arahal M. R. A prediction model based on neural networks for the energy consumption of a bioclimatic building. Energy and Buildings . 2014;82:142–155. doi: 10.1016/j.enbuild.2014.06.052. [DOI] [Google Scholar]
- 20.Zhang Y., Chen Q. Prediction of building energy consumption based on PSO-RBF neural network. Proceedings of the 2014 IEEE International Conference on System Science and Engineering (ICSSE); 11-13 July 2014; Shanghai, China. pp. 60–63. [DOI] [Google Scholar]
- 21.Ferlito S., Atrigna M., Graditi G., et al. Predictive models for building’s energy consumption: an Artificial Neural Network (ANN) approach. Xviii Aisem Annual Conference . 2015;2015:1–4. doi: 10.1109/aisem.2015.7066836.7066836 [DOI] [Google Scholar]
- 22.Yin R., Yin J. Prediction method of energy consumption for high building based on LMBP neural network. Energy Reports . 2022;8:1236–1248. doi: 10.1016/j.egyr.2022.02.071. [DOI] [Google Scholar]
- 23.Jing W., Zhen M., Guan H., Luo W., Liu X. A prediction model for building energy consumption in a shopping mall based on Chaos theory. Energy Reports . 2022;8:5305–5312. doi: 10.1016/j.egyr.2022.03.205. [DOI] [Google Scholar]
- 24.Li X., Liu S., Zhao L., Meng X., Fang Y. An integrated building energy performance evaluation method: from parametric modeling to GA-NN based energy consumption prediction modeling. Journal of Building Engineering . 2022;45 doi: 10.1016/j.jobe.2021.103571.103571 [DOI] [Google Scholar]
- 25.Chou I., Chou S. Y. A hybrid RF-LSTM based on CEEMDAN for improving the accuracy of building energy consumption prediction. Energy and Buildings . 2022;259 doi: 10.1016/j.enbuild.2022.111908.111908 [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The data used to support the findings of this study are available from the corresponding author upon request.