Applications of Machine Learning in Building Energy Prediction and Savings

Corresponding Author: Dr. Nabil Nassif Department of Civil and Architectural Engineering and Construction Management, University of Cincinnati, Cincinnati, OH, USA Email: nassifnl@uc.edu Abstract: In a constantly advancing world with growing needs, buildings play in important role in the daily functioning of the society. Developing more and more advanced techniques to optimize the working of these buildings is highly important for a constant growth. Modern computational techniques have opened doors to create advanced models that can utilize efficient techniques to produce highly accurate results. This paper introduces a model that utilizes machine learning algorithms to predict energy consumption in buildings. The model is also compared to a baseline regression model as well as a model based on Artificial Neural Network. The results show that the proposed model performs much better than the other two compared models. The proposed model can be used for many intelligent applications such as measurement and savings verification, optimization, building-energy assessment and fault detection and diagnosis. The models were tested to predict the savings calculations for a simulated building and the results proved the proposed model to be the closest predictor to actual savings.


Introduction
While most new buildings use power meters to record and track their daily energy consumption data, they can be supplemented by digital models that can help to predict upcoming energy data and use it to calculate savings and improve systems in the buildings [1] [6]. Therefore, utilizing modern computational techniques to program models that can achieve high levels of accuracy is a necessity [2]. Generally, there are two wide approaches to model the energy use in a building: forward and inverse approaches. The model in the forward approach predicts the energy use based on detailed physical information of the system. The inverse or data-driven model is developed based on actual data of existing systems. Several types of datadriven models are used for estimating the energy use in either whole building or equipment levels. These models vary from very simple regression model with one/two or sometimes multiple parameters to advanced machine learning and ANN Models. There are no single models that can be appropriate for all buildings and applications. This paper introduces a Machine Learning model based on bootstrap aggregation and uses a regression learning technique as a baseline along with an ANN baseline model to compare with the proposed model. Usually regression models or, more recently models based on Artificial Neural Networks [4] are used to capture and predict performance of equipment like chillers or pumps. Bagging (Bootstrap Aggregation) is a Machine Learning algorithm where the goal is to reduce the variance of a decision tree [3] [7]. The idea is to create several subsets of data from random training sample with replacement. As a result, we end up with an ensemble of different models [5]. Average of all the predictions from different trees are used which is more robust than a single decision tree as shown in Figure 1. The paper also utilizes the trained models to calculate energy savings. Energy use in offices has risen in recent years because of the growth in information technology, air-conditioning, density of use, and a competitive market where tenants see high value in a comfortable workplace. Two-thirds of all energy consumed in an average office building is electricity. Lighting, office equipment and HVAC account for 90 percent of this expenditure. Certainly, the trend of high energy demand is offset by the considerable improvements over time in design, construction, insulation, lighting, and controls.

Data Collection
The electric energy consumption data are collected from two actual buildings (Building 1 and Building 2) located in Greensboro, North Carolina and from simulations of two buildings (Building 3 and Building 4 shown in Figure  2). The Actual building data were recorded on a quarterhourly basis and the data for the simulation were recorded on an hourly basis. Figure 3 shows the whole building electric energy consumptions of those four buildings as a function of outside air or dry bulb temperature. The simulations are done using the building energy simulation program eQuest version 3.65.  All buildings are conditioned with chilled water VAV systems and all are in the range of 40,000 ft2 (3716.1 m2) to 60,000 ft2 (5574.2 m2). The Building 1 combines of classes and offices and no schedule exists even though the building is unoccupied form 10pm to 7am. The Building 2 is similar to Building 1 but with an occupancy schedule applied: 100% occupants form 7am to 10pm for weekday and 50% of occupants from 8am to 8pm for weekend. The Buildings 3 and 4 are simulated office buildings with an occupancy schedule form 8am to 5pm. The mechanical systems start at 7am and stop at 6pm (in case any occupants stay late). Regression Models are most commonly implemented in predictive analysis. The main idea is to examine whether a set of predictor variables do a good job in producing an outcome (dependent variable) and which one of those variables do a good job in predicting those outcomes. While the accuracy of a simple linear model in predicting energy consumption in buildings is really low, it can be improved by adding classifiers and equations of fit. On the other hand, machine learning provides algorithms [8] that utilize more advanced and reliable techniques to produce more accurate results [10]. One of these techniques is known as bootstrapping, which simply put is the method of random sampling with replacement [9]. Such a sample is referred to as a resample. This allows the model or algorithm to get a better understanding of the various biases, variances and features that exist in the resample. Since energy demand data from buildings is usually measured on hourly or sub-hourly intervals, training sets are usually large. When this occurs, the regression coefficients represent the noise rather than the genuine relationships in the population making predictions inaccurate. To prevent overfitting, bagging is used. Bagging stands for bootstrap aggregation; it helps in reducing variance from overfitted models. Bagging gets around overfitting by creating its own variance amongst the data by sampling and replacing data while it tests multiple hypothesis.

Simulated Data
In turn, this reduces the noise by utilizing multiple samples that would most likely be made up of data with various attributes. Once each model has developed a hypothesis. The models use voting for classification or averaging for regression. This is where the "Aggregating" in "Bootstrap Aggregating" comes into play. Each hypothesis has the same weight as all the others. Figure 1 shows the working of a Bootstrap Aggregation Model The models were trained and tested based on the following inputs: Month, Day, Hour and Dry Bulb Temperature. The data from the actual buildings was trained for a duration for one year and tested for an upcoming year while data from simulation. The models are compared in terms of classification accuracies Accuracy is one metric for evaluating classification models. Informally, accuracy is the fraction of predictions that the model got right.
Formally, accuracy has the definition as shown in Eq.1. Data from actual buildings was measured at sub-hourly intervals and it does have several missing entries while simulation data which was measured on hourly intervals and has a smaller training set. Regardless of these missing points, the accuracy, when compared to the linear regression model remains significantly high. Model 3 can be easily retrained to fit newer sets of data without affecting their performance. Even after the model is trained, it can be supplemented by further data points without disturbing the pre-existing training samples. This allows the model to continuously improve its accuracy over time. There are various other factors at play in the measured data vs simulated data, such as occupant behavior, measurement errors etc. Moreover, the simulation is an idealization and hence fitting a model is expected to be easier. Figure 5 shows a randomly selected sample from the four buildings selected for the final model with only one visible error point.

Results for Model Training and Testing
The Aggregated Bootstrapping model was trained using a selected data set comprised of diverse data points that allow the algorithm to construct more testable hypothesis. In addition to the Aggregated Bootstrapping model a baseline linear model and another artificial neural network model is also investigated as shown in Table 1. (2)

Error Point
The inputs for training were formatted into an input matrix. An infinite variety of network architectures can be used for this purpose, but after testing several models with different hidden layers and neurons, the interest of conserving computer time the simplest structure was needed to be considered that could still keep a high accuracy. The chosen model has two hidden layers, 6 neurons and the output layer with one neuron and an activation function based on the sum of the weighted hidden layer neurons. The ANN model is trained and tested using the actual and simulated data shown in Figure  2. The accuracy for training and testing were measured and presented in Table 2. It can be seen that the accuracy ranges for the predictions by model 3 lie in the range of 93-99% while Model 1 is in the 10-20% range and Model 2 in 53-60% range making Model 3 the most accurate of them all. It is also noticeable for Figure 4, building 1 has a visible blue region. This is because of missing data entries in the training matrix for building 1. This could be a possible result of miscommunication between the measuring equipment and the Building Automation System. The training time for the simple linear regression model is lowest at 6.4s which despite of its low training time would not help in solving real life problems due to its low accuracy thus making the Aggregated Bootstrapping model the better one despite of the high training time. The simulated building locations have a better ratio of training to testing accuracies because the model was trained using controlled simulations of energy predictions compared to the random conditions for actual buildings. The Aggregated Bootstrapping model proved to be a more reliable model that could be implemented in making building systems better [10].  Table 3: Training/Testing time comparison for all models in seconds. Figure 6: Comparison of actual and simulated data with predictions from all discussed models.

Simulated Data
However, as a result of randomness and noisy disturbance, it is not an easy task to realize accurate prediction of the building energy consumption. The machine learning model was significantly better in both training and testing as well as its real-life application of predicting savings. After the models were trained, they were tested to predict energy data for a period of an entire year as depicted in Figure 6 as well as for a period of a week as depicted in Figure 7. Model 3 was able to predict the consumption data with highest accuracy as shown in Table 3. The only drawback of the bootstrap aggregation model is the really considerable amount of time it takes as training sets keep on getting bigger. It can be seen in Table  3 that the Bootstrap aggregation model has a training time of 2619.6 seconds which when compared to a Model 1 (8.2 seconds) and Model 2 (410.9 seconds) training times is significantly larger for the similar criteria. Despite of the training time, Model 3 was still closest to the actual savings as shown in Table 5. On closer inspection of Figure 7, it can be seen that quite a lot of data points predicted by Model 3 overlap the actual data while Model 1 and Model 2 only come close a several times. This proves how Model 3 is accurate in prediction of both long term as well as data over short periods of time. While this paper only presented the energy savings application of an ensemble of bagged trees model, it can also be used for many other energy efficiency applications required to estimate building energy consumptions, particularly for hourly or sub-hourly time interval predictions. Savings prediction allows us to optimize building systems to make them more efficient.

Results for Savings Calculations
After training the models with the required data sets, savings were calculated on both the actual and simulated data, and then compared to the actual savings to evaluate effectiveness of the model in its real-life applications.    Actual savings were calculated through the energy simulation program eQuest with optimization settings as the following: Light change from 1.2 W/ft 2 to 0.8 W/ft 2 , Chiller efficiency from 0.82 kW/tons to 0.6 kW/ton and Optimal Supply Air Temperature was change from constant 55 to respective optimal value as shown in Table  4. Actual building savings were recorded from collected data over a period of four years. The collected data is represented in Table 5. Actual savings were calculated to be 27.3% for Simulated building 3 and 35.51% for Actual building 1 and the aggregated bootstrapping model proved to come closest to actual savings with a prediction of 29.8% and 32.6% respectively.

Conclusion
Three different models: Linear Regression, Artificial Neural Network and Aggregated Bootstrapping model were trained and tested based on similar training sets and then used to predict building energy consumption data. The Aggregated Bootstrapping model based on the aggregated bootstrapping algorithm proved to be the most accurate solution to the problem. The proposed model had the highest accuracy in all the compared cases for both simulated and actual data with accuracy as high as 99.8%. The trained models were then used to calculate energy savings in which the Machine learning model proved to be the closest predictor to actual savings. While energy savings is only one of the many applications of such techniques other possible applications could be energy measurement and saving verification, optimization, building energy assessment, and fault detection and diagnosis.

Author's Contributions
Dr. Nabi Nassif supervised the research project, collected and provided data that was utilized to train and test the models. Kevin Eaton and Alexander Rodrigues helped with sorting the data into training ready sets. Priyan Rai worked to create the actual models, compile the results and write the paper.