Deep neural networks as surrogate models for urban energy simulations

Building energy simulation helps governments implement effective policies to increase energy efficiency. In this work, we use deep neural networks (DNN) to create a surrogate model of an urban energy simulator. We modelled 7,860 buildings, with 2,620 geometries, and simulated them across all the climatic regions of the US. With these 68 million hourly data points, we trained two DNNs to predict the solar gains and thermal losses. The DNNs reduce computational time by a factor of 2500 while maintaining good accuracy (R2=0.85). Possible applications are prediction of energy demand due to climate change and building refurbishment measures.


Introduction
Buildings are responsible for 20-30% of global greenhouse gas emissions and 32% of global final energy use. The two main paths to improve energy performance of buildings are improving the envelope insulation and increasing the performance of the indoor thermal system. While 70% of carbon reduction can be achieved in the non-residential sector, the residential sector represents 60% of the total energy consumption [1]. Therefore, the focus must be laid on all building types simultaneously, and refurbishment scenarios must be developed at the urban scale to study their impact [2].
To understand and predict the behavior of the energy demand of buildings, building energy simulation at the urban scale is used as a useful tool. Typical urban energy simulation studies use simplified models, i.e., archetypes for buildings, and show the impact on refurbishment only with respect to typical weather data. This reduces computational time at the cost of accuracy. A low computational time is especially important if the model is to be used in, e.g., an optimization study, or in forecasting scenarios over many years in the future. Both require many evaluations of the energy model, and long computation times would make the applications prohibitively slow. Surrogate modeling has been used in some studies available for urban-scale energy modeling. Most of these studies focused on decreasing computational time with acceptable accurate results. Zang et al. used surrogate modeling in order to optimize low-energy building design compared to stand-alone evolutionary algorithm [3]. Melo et al. studied surrogate modeling with artificial neural network in order to improve accuracy of the energy labelling of buildings [4]. In a different approach, Nutkiewicz et al. used residual neural networks as a tool to compensate for the errors and biases of building energy models in EnergyPlus, and predict the energy consumption of buildings more accurately [5]. The main objective of these studies is to reduce the computational time of these algorithms while increasing the accuracy of energy prediction models.
In this work, our aim is also to reduce computational time while maintaining the accuracy of a detailed urban energy model. Different to prior work toward this goal, we investigate the use of surrogate models based on deep artificial neural networks (DNN), and make use of a comprehensive number of physical building properties, geographical variables, and weather variables as inputs to the model. A potential application of this research, in addition to increasing the speed of predicting energy consumption in buildings, would be its integration in platforms that allow the control of energy supply systems for urban energy systems [6] [7].
We have two specific objectives in this paper. First, we investigate the performance of the DNN for different input hyper-parameters, and DNN structures. Second, we compare the accuracy of the predictions of the solar gains and the thermal losses. Finally, we share our DNN models and files in a GitHub repository [8].

Methodology
In the process of generating the data to train our model, we ensured that we had a wide variety of geometries, physical properties, and climatic data. To ensure geometrical diversity, we modelled the 3D geometries of 2,620 buildings obtained from 6 different regions of the city of Austin, TX. Two of the regions were located in the downtown area and comprised mostly of high-rise buildings, other two regions were comprised by mostly mid-rise buildings, and the other two regions modelled contained low-rise residential buildings. From these six initial models comprised of 2,620 buildings ( Figure 1), we created a total of 18 simulation models (7,860 buildings) by randomizing the physical non-geometrical properties of the buildings. Each of these simulation models was then simulated for a randomly chosen climatic region in the US. We ensured that all the climatic regions of the country were simulated at least once. The simulations were performed with CitySim [9], a building energy simulator for urban scale analysis. Among other variables, CitySim returns the solar gains and the thermal losses of every building, which can then be used to calculate the cooling and heating demands. Since the solar gains and the thermal losses depend on different variables, we train two different DNNs to estimate them. Table 1 contains the variables used as inputs by each of the DNNs.
Climate data for the simulation has been obtained from Meteonorm [10] for the following 18 cities in 16 different climatic zones: Albuquerque, Atlanta, Baltimore, Boulder, Chicago, Duluth, Fairbanks, Helena, Houston, Las Vegas, Los Angeles, Miami, Minneapolis, New York, Phoenix, Portland, San Francisco, and Seattle. The DNNs are therefore trained with 68,853,600 hourly data points (7,860 buildings x 8,760 hours), obtained from 18 urban energy simulations. For testing the accuracy of our DNN models, we generated new building energy models with random physical properties and simulated them for the climatic zones of three different cities: Columbus, New Orleans, and Salt Lake City.   In order to provide our model with some information of the urban layout where the buildings are located, we have defined the variable urban area type, which has a value of 0 for buildings located in low-rise residential areas, 1 for those located in mid-rise areas, and 2 for those in areas with many highrise buildings. The height of the buildings in the surroundings is important as it can provide different levels of shadowing to the building.

Modelling deep neural networks
We have created two deep neural networks (DNNs) to predict the thermal losses and the solar gains of the buildings, the subtraction of which is the cooling and heating demand ( Figure 2). The DNN used to predict the thermal losses has 25 input variables, while the DNN that predicts the solar gains has 15 input variables. Both DNNs have one single neuron in the output layer, and two hidden layers. We used rectified linear units (ReLU) activation functions in the hidden layers. To predict the thermal losses, we used a linear activation function in the output layer, whereas we used a ReLU activation function in the output layer of the DNN that predicts the solar gains (since they can only have positive values). We used two fully connected hidden layers (25 and 12 neurons) to predict the thermal losses, and two fully connected hidden layers (20 and 10 neurons) to predict the solar gains. We used batch normalization in every layer to prevent the covariance shift problem [11], Ridge regularization (weight decay = 1e-5) to prevent overfitting, and Lasso regularization to prevent overfitting and for feature selection purposes. We used a learning rate α = 0.01 to predict the solar gains and α = 0.02 for the thermal losses. We tested  [12] to avoid overfitting, using multiple probabilities of decay, but this did not seem to improve our results, possibly because we were already using other regularizers. We also tested a residual neural network (ResNet) [13], in which the inputs skipped the first hidden layer, but this architecture did not seem to improve the results either. However, more research will be done in testing other neural network architectures to improve our results.

Assumptions and limitations
Some assumptions have been made in the level of detail required to develop our model. Some input variables, such as the glazing ratio, the U-values or the short-wave reflectance are the average values of the building. Accounting for the orientation associated to these variables (i.e. average glazing ratio of the walls facing east/west, etc.) could provide additional accuracy. We also assumed the temperature set-point of every building to be constant over time. Therefore, our model predicts well the hourly thermal losses for any temperature set-point but does not predict well the transient cooling or heating demand when the set-point changes. To accurately predict the transient dynamics of the hourly changes of the temperature set-points we would need to include new inputs that provide information about the thermal mass of the building and use recurrent neural networks. Furthermore, we have modelled the buildings as single thermal zones, and without accounting for different possible shapes of the roofs.

Performance metrics
Since the objective of this study is to create a surrogate model of an urban energy simulator, which returns hourly results, we analyse the performance of our model on an hourly scale. For this purpose, we measure the mean absolute error (MAE), which averages the absolute values of all the deviations between the actual values and the predictions; the mean squared error (MSE), which averages the squared of the errors, and therefore it penalizes more the larger errors; and the coefficient of determination R 2 , which measures what percentage of the variability of the data around its mean is explained by our model. Eq. 1 shows the mathematical expressions of these error metrics, where ̂ are the predicted values and the actual values or targets.

Results
After training both neural networks with more than 68 million hourly data points to predict the thermal losses and the solar gains, we evaluated them using the test set. Table 2 contains the main results of our study. The coefficient of determination R 2 = 0.85 for both the prediction of the thermal losses and the solar gains, which means that our models explained 85% of the variance of the data around its mean. The prediction of the solar gains was slightly better, which was a surprising result as we expected them to be more difficult to predict due to the uncertainties introduced by the diverse geometries of the buildings and their surroundings. The lack of presence of trees or other obstacles in our models may be the reason why the solar gains were not as difficult to predict as we would have expected.  Figure 3 illustrates the predicted solar gains and thermal losses in a sample building. For this sample building, the DNN that predicts the thermal losses tends to overshoot more than the DNN that predicts the solar gains. The use of a ReLU activation function in the output layer of DNN that predicts the solar gains helps avoid negative values and improves the predictions significantly. As for the computational speed, we simulated the 1,140 buildings of the test set in three separate simulation files in CitySim, which took total 8h 12min (CPU: i7-6700 K 4.0 GHz, RAM: 64.0 GB). The models simulated using our deep neural networks returned the results in 12 seconds, i.e., a decrease in computational time by a factor of ~ 2500, while the predictions had reasonable accuracy (R 2 = 0.85). The accuracy of these predictions is likely to further improve after testing other DNN architectures and finetuning their hyper-parameters.

Conclusion
Building energy modelling at the urban scale can help policy makers, building managers and other stack holders to predict the energy consumption of buildings and estimate the impact of the decisions they take regarding energy efficiency. However, creating and simulating these models can be very time consuming, and calibrating them accurately requires an elevated number of simulations and is computationally expensive. We have presented a surrogate model using deep neural networks that can reduce the time of computation of traditional urban scale simulation tools (i.e. CitySim) by a factor of ~2500 while maintaining reasonable accuracy. Our model accounts for certain geometrical properties, physical characteristics, geographical conditions, and weather variables to predict the solar gains and the thermal losses in every building separately using two deep neural networks. These thermal gains and losses can then be added up to know the cooling and heating loads in the buildings.
Future work will focus on increasing the model accuracy by increasing the information content of the training data and exploring other neural network structures. We also consider important to analyze the level of uncertainty of our model and how this uncertainty is distributed depending on the input variables. The decrease in the model accuracy with respect to traditional building energy models could be partially compensated by the fact that the reduction in the time of computation can lead to more accurate calibrations of this data-driven model. Furthermore, when predicting the energy consumption at an aggregated level (a whole neighborhood), some of the errors of the model may cancel out and improve accuracy. In future work we will also test our model to predict the change in energy consumption due to climate change and building refurbishment measures.