Machine learning to predict building energy performance in different climates

Digitalization is sweeping the world of buildings. Notably, the use of machine and deep learning techniques to develop buildings’ digital twins is becoming crucial to foster the energy transition of the construction sector and a sustainable urban growth. Digital twins can ensure a user-friendly, fast and reliable prediction of building energy loads and demands, thereby enabling a comprehensive optimization of planning, design and operation. Accordingly, this study investigates machine learning techniques to predict heating loads of a building in Rome (Italy, Mediterranean conditions, “Csa” climate in the Köppen and Geiger classification) and in Berlin (Germany, European backcountry, “Cfb”). Firstly, the real building, located in Benevento, is used to develop the artificial neural networks (ANNs), then implemented in MATLAB® to achieve meta-models of building energy behavior. NARX (nonlinear autoregressive model with exogenous inputs) networks are used and trained based on simulated data, provided by the well-known building simulation tool EnergyPlus using the software DesignBuilder® as interface. The meta-model inputs are related to weather conditions, while the required outputs concern the thermal energy load for space heating. The analysis is performed with reference to annual forecasts of energy demands. In all cases, the ANNs architecture is optimized to achieve the best fitness with EnergyPlus outputs. The results show that machine learning can be a precious and reliable tool to support energy design and operation of different buildings in different climates. Nonetheless, the meta-modeling procedure needs to be properly conducted by experts to set suitable frameworks and hyperparameter values of the ANNs, as well as to achieve a right and comprehensive interpretation of the results.


1.
Introduction and state of the art Buildings play a key role in our lives, as we spend a large part of our time indoor. They contribute significantly to global energy consumption and CO2 equivalent emissions. Improving their energy efficiency is, therefore, crucial to achieve the ambitious goal of carbon neutrality by 2050, as set out by the European Green Deal [1]. In 2020, the construction and operation of buildings accounted for about 36% of global energy consumption, with indoor air conditioning accounting for about 35% [2]. Thus, IOP Publishing doi:10.1088/1755-1315/1078/1/012137 2 building HVAC (heating, ventilation, and air conditioning) systems are responsible for more than 10% of final energy consumption and associated CO2-equivalent emissions at the global level.
In this scenario, optimizing the control/operation of HVAC systems plays a crucial role as it can provide huge energy savings [3,4] while providing thermal comfort. Efficient equipment is not enough to achieve high energy performance if it is not properly controlled [5].
Low-energy or zero-energy building design, while important, is not sufficient to minimize energy consumption and greenhouse gas emissions from the construction industry in terms of sustainability and carbon neutrality. Optimal design is useless without optimal control.
In this regard, as outlined by Chari et al. [6], the ability to predict consumption is critical for improving grid efficiency and assessing the impact of different energy efficiency measures at the building level. Building energy consumption forecasting is a more difficult task when it comes to consider many interrelated physical, operational, and behavioral factors such as building materials, equipment type and operation, occupant behavior, which have significant uncertainty. The energy transition is leading towards smart and responsive grids, interacting with renewables and local energy communities. In this regard, several strategies have been proposed to optimize grid performance combined with intermittent renewable energy and storage, with the goal of creating a flexible energy supply network characterized by the bidirectional flow of electricity and information. Clearly, there is added value in injecting more computational intelligence into grid management (Mocanu et al. [7]), enabling them to better dispatch and control the fluctuating electricity supply and demand in real time.
One class of such computational intelligence tools is neural networks. Many recent publications have shown that some of today artificial neural networks can be trained to recognize complex patterns.
The power grids of the future should be able to forecast the energy loads of individual buildings in order to maximize the exploitation of renewable-based distributed generation systems. In addition, the forecasting and decomposition of energy demands is key to investigate energy patters, to identify sustainability targets, to plan energy use and purchases, as well as to manage demand response. The following three types of demand forecasting can be distinguished: • Short-term, related to time intervals from one hour to one week; • Medium-term, from one week to one year; • Long-term, beyond one year.
To estimate building energy consumption, many modeling techniques have been developed, which can be classed as black box, white box, or grey box methods. The black box methods merely look at the system external behavior, whereas the white box methods look at its interior workings. Unlike the white box techniques, the black box methods often do not require implementation of detailed knowledge. A black box method generally takes less time to complete than a white box one. Grey box testing, instead, is a software testing technique in which testers do not have complete knowledge of the product but have limited information on the internal functionality and code.
As reported in the study conducted by Beccali et al. [8], various modeling techniques have been developed to estimate building energy consumption. Some forecasting tools use recorded and/or generated energy consumption data and statistical methods such as regression methods, artificial neural networks (ANNs), or decision trees to predict building energy consumption. Other tools -including, for example, EnergyPlus and TRNSYS® -use deterministic, physics-based approaches such as mass and heat balance techniques to model building heat loads. Currently, in Italy, many local and international research teams are involved in the collection of energy consumption data from public building stocks, with the aim of identifying the best energy retrofit actions and reducing the country's CO2 emissions. In [8], the authors have described a methodology to determine, for local Public Administrations, a decision support tool on the energy efficiency evaluation of an existing building and the selection of the best energy efficiency solutions. After an accurate energy audit of the existing school-buildings stock it was possible to develop an accurate energy database that represents the base of the training of a specific ANN and the development of a decision support tool.
As concerns the prediction of building energy performance, ANNs with shallow architectures are the most used. Deep neural networks are rarely used, as there is not a solid knowledge about the influence IOP Publishing doi:10.1088/1755-1315/1078/1/012137 3 of the number of hidden layers and the size of the data set on the accuracy of predictions and computational efficiency, as reported by Amasyali et al. [9].
As outlined by Zao and Magoulès [10], there are hundreds of comprehensive and reliable building energy simulation tools, such as EnergyPlus, TRNSYS®, ESP-r, IDA ICE, which have been largely implemented to investigate energy performance, to develop energy standards, to optimize building design. Although these tools are effective and accurate, they are not user-friendly and often require significant computational burden and complexity. Furthermore, they need detailed input data and details about building envelope, energy systems, building use and operation, weather conditions, requiring high expertise in building modeling. Globally, model development and simulations are quite time consuming.
In this frame, the development and use of ANNs can significantly reduce computational times, which is fundamental when optimization algorithms are implemented or large-scale analysis is performed to investigate building stocks/categories. Accordingly, in order to address the challenges of multi-objective optimization of building performance using a new meta-model-based approach, Bre et al. [11] presented an efficient method, using the genetic algorithm NSGA-II algorithm and ANNs. In the same vein, for optimizing glazing design, Zhai et al. [12] proposed a multi-objective optimization framework that combines NSGA-II with EnergyPlus. Such a framework can support the optimization of windows design, aiming at minimizing energy consumption while maximizing thermal and visual comfort. Papadopoulos et al. [13] applied the gradient boosted regression trees as a machine learning technique to approximate a building performance simulation model and identify, using a genetic algorithm optimization process, the optimal building design in terms of heating and cooling loads. Yao et al. [14] demonstrated how the use of passive climate-sensitive design solutions can contribute towards improving indoor thermal conditions while reducing energy demand and carbon emissions.
The methodology proposed by Elbeltagi and Wefki [15] is based on the creation of an ANN model that can predict the energy consumption of Egyptian residential buildings. The energy modeling phases adopted in this study are the following: choice of modeling software, identification of input values and design parameters, creation and implementation of a database, development of the ANN model, and evaluation of its performance.
NARX (nonlinear autoregressive model with exogenous inputs) networks showed promising prediction performance when applied to time series. Mena et al. [16] applied a NARX architecture to predict the electricity demand of a non-residential building. Powell et al. [17] applied different ANN architectures to predict hourly heating, cooling and electrical loads of large-scale district, i.e., a campus with around 70000 students and employees, using weather and time variables as inputs. NARX networks provided the best fitting with measured data concerning a 24 h prediction. Also, Mustapa et al. [18] used a NARX network to predict energy consumption and potential energy savings of an educational building. The results showed that NARX outperforms multiple linear regression providing higher fitting accuracy.
The aim of this work is to demonstrate the applicability of artificial neural networks to predict the energy demand for the space heating of a high-efficient building, both in cold and warm climates. Accurate predictions by meta-models would be useful to help designers, policymakers and all stakeholders of the building sector and city to future goals of sustainability, thank to light tools, under the point of view of computational effort, but accurate for what concerns the reliability.

2.
Methodology In order to obtain the load for the building under study, two software are used: DesignBuilder® and EnergyPlus. DesignBuilder® allows to model the building in all its aspects, considering all the physical characteristics of the building, such as the materials of the building envelope, the thickness of the layers of material and the relative thermal transmittances, the window components, the various exposures, and many others. Then, EnergyPlus, based on the data provided by DesignBuilder®, can process them and solve the energy balance in a dynamic regime providing a very accurate forecast of the thermal energy consumption required for ambient heating, primary energy related to the air conditioning systems, electrical energy due to the electronic devices and lighting, also based on the occupancy profile and the use of the building. In order to solve this problem and to present a tool that allows the evaluation of the energy performance of a building with a relatively low computational time and with a good level of accuracy, this work is referred to an artificial intelligence system based on neural networks, now widely used in various scientific fields. The artificial neural network (ANNs), in fact, were created to emulate the behavior of the human brain, i.e., the complex system of biological neurons. In a neural network, information is broken down into many "elementary" pieces of information, each of which is contained within a single neuron. A neural network can be seen as a sort of "box" that is able to give an answer to a question or provide an output in presence of one or more inputs. The power of this system lies in its capacity to represent and simulate complex relations between the input and output variables that other analytical functions cannot represent.
A NARX (non-linear autoregressive with exogenous inputs) network is chosen from among the numerous current network architectures. The adoption of a NARX is linked to the goal of this study, which is to predict a time series. The NARX is a recurrent dynamic network, with feedback connections enclosing several net layers, commonly used in time-series forecasting. Equation (1) provides the NARX defining equation, and the output signal y is assessed as a function (f) of previous time values of the output signal and of the exogenous input signal u; t is the time variable. The function f can be achieved by using a feedforward neural network. Figure 1 schematizes the resulting network, where a two-layer feedforward network is employed.

Figure 1. NARX network operating logic (source: MATLAB® [19] users' manual)
The following independent input variables are used for the neural network whose objective is to forecast the hourly values of space heating load throughout the year: • external dry bulb temperature of the site under consideration [°C]; • global solar radiation of the site [Wh/m²]. Of course, these are not the only inputs that influence the performance of a building. In fact, in the performance simulations, the inputs due to occupancy, lighting, and equipment were set equal to zero in order to test the performance of the network with only two decision variables. This limitation is necessary to better manage the development, at this stage. Of course, in future investigations, it will be overpassed. The first step for the development of the NARX is to import input and output data in csv format, generated by EnergyPlus simulations, into the MATLAB® environment. To determine the specific structure of each artificial neural network, a heuristic procedure is carried out that led to different

3.
Case study The study is carried out on an existing building with known characteristics. The case study (Figure 2) is a single-storey house built in Benevento (Italian climatic zone C, 1316 heating degree days, baseline 20 °C) also known as BNZEB. This section reports only a short description to help the readers, since the authors already detailed the building in [20]. The dwelling has a net area of around 70 m 2 , the window/wall ratio around 22.5%, and the ratio between volume and dispersing surface equal to 1.03 m -1 . The structural frame (Fig. 2a)  respectively, cooling capacity and EER equal to 2.14 kW and 2.95, respectively. In this case, horizontal geothermal probes with a total length of 100 m, positioned at a depth of 2.0 m, are used to pre-cool or pre-heat ventilation air. The first option is activated in this study because it is more popular in residential buildings. A solar thermal collector with a surface area of 2.16 m 2 and a photovoltaic system with 16 monocrystalline silicon panels are installed. A lithium battery with 6.5 kWh capacity is also available for electricity storage. The house is equipped with several sensors and actuators for a comprehensive monitoring of indoor/outdoor conditions, energy consumption and renewable energy generation, as detailed in [21]. As said, the building performance is simulated using DesignBuilder® and EnergyPlus software. For the creation of the NARX network, five different input data are considered. For training, validation and testing of the network, hourly data from annual simulations provided by EnergyPlus are used to create a model that is valid for different climates. According to Italian rules [22], the national territory is divided into six climatic zones, each with a specified range of heating degree days (HDD), as shown in  Table 1. Depending on the climatic zone, heating systems can only be used for a certain period of the year and for a certain number of hours every day. Only two municipalities are in climatic zone A, thus this latter is not considered in this study because not representative. Notably, in the application of the proposed methodology, the climatic zones B, C, D, E, and F are used as case studies. One representative city is identified as a building location for each analyzed zone.  Table 2 shows the five cities used as data samples for the creation of the network, which belong to different climate zones. It should be noted that the original simulation model has been widely validated [20,21] by comparisons with monitored data, in the real location. Then, in order to verify the capabilities of the NARX networks, a weather file from another city that is not included in the training sample ("exogenous") is used. Table 3 shows the cities "exogenous" from the training sample used for the validation of the different networks, i.e., Rome (zone D) and Berlin (zone F).  (Figure 3 to 6). The Levenberg-Marquardt algorithm is being used to train the NARX. A value of 200000 is chosen for the number of eras, that is the maximum number of iterations. Instead, a gradient of 10 -9 is used, which represents the square of the error function. Table 4 shows the best hyperparameters combo for the different networks created, i.e., for each setpoint temperature (18 °C, 19 °C, 20 °C, 21 °C). The prediction performance of the developed NARX networks as concerns the testing set is also reported in Table 4, which shows a good reliability with simulated data. Figures 3 to 6 represents the predictions of the heating load with regards to the testing set. The same network is used for thermal load prediction in both Rome and Berlin.  In general, a very good capability of the ANNs to predict the heating load without a significant computational effort (i.e., much lower if compared to the one of the EnergyPlus transient energy simulations) is verified for all the different setpoint temperatures. Finally, the network can follow the targets simulated in EnergyPlus, although still not perfect. The difference lies in the calculation time, after the creation of the network the simulation of a case though it lasts only 10 seconds justifies the efforts in the development of this methodology. The results surely are quite satisfactory, even if with all limitations of a single case study, in two climates. In this regard, developments are undergoing, with the extension of the input data, evaluation of some other energy uses (space cooling, equipment, plugged powers, and other electricity needs of the whole facility) also by changing the case study.

5.
Conclusions Reducing the computational cost of the building energy modeling/simulation process is a necessity. The building modeling/simulation process is a powerful tool, but, as well-known, it is a time consuming process that requires expertise and computational efforts. Thus, when possible, also in order to have a digital twin of the building that can be used even for a real time management, the development of metamodels based on machine learning, AI and IoT is a possibility that must be exploited.
This study shows that, by developing EnergyPlus-based artificial neural networks, it is possible to predict building energy loads, notably for space heating, with satisfactory accuracy and reduced computational time. Analyzing the results, it is also evident that using a different sample of data to those used for the training but of the same climatic zone to test the performance of the network, the results are acceptable. However, when considering other locations not included in the training set, the results provided by the network may deviate sharply from the EnergyPlus reference results in some time intervals. To achieve more accurate and realistic results in the future, the artificial neural network architecture needs to be optimized for use with a wide range of climatic data, including other inputs that affect the energy consumption of the building, such as occupant behavior, setpoint temperatures, free inputs, and many others. Another step is to experiment with different types of neural networks and compare results to verify which solution is the best one.