Using an Ancillary Neural Network to Capture Weekends and Holidays in an Adjoint Neural Network Architecture for Intelligent Building Management
Zhicheng Ding Mehmet Kerem Turkcan Albert Boulanger


Large Gauge Symmetries of an Asymptotically de Sitter Horizon:
 An Extended First Law of Thermodynamics 
    Hossein Shojaie
    December 30, 2023
========================================================================================================





The US EIA estimated in 2017 about 39% of total U.S. energy consumption was by the residential and commercial sectors. Therefore, Intelligent Building Management (IBM) solutions that minimize consumption while maintaining tenant comfort are an important component in 

reducing energy consumption.
A forecasting capability for accurate prediction of indoor temperatures in a planning horizon of 24 hours is essential to IBM. It should predict the indoor temperature in both short-term (15 minutes) and long-term (24 hours) periods accurately including weekends, major holidays, and minor holidays. Other requirements include the ability to predict the maximum and the minimum indoor temperatures precisely and provide the confidence for each prediction. To achieve these requirements, we propose a novel adjoint neural network architecture for time series prediction that uses an ancillary neural network to capture weekend and holiday information. We studied four long short-term memory (LSTM) based time series prediction networks within this architecture. We observed that the ancillary neural network helps to improve the prediction accuracy, the maximum and the minimum temperature prediction and model reliability for all networks tested. 




energy consumption, adjoint neural network, intelligent building management, time series prediction, multiple-steps ahead prediction.



















§ INTRODUCTION























With a rapid population growth, the total energy consumption in both residential and commercial buildings has increased and threatens the environment of the earth <cit.>. 
Developing an energy-saving IBM system helps to mitigate this problem.


Predicting indoor temperature is the key to building such systems. This is a difficult task because energy consumption is influenced by many different factors such as occupancy, outside weather, solar load, and the building's construction <cit.>. As a result, IBM has become a popular research topic <cit.> in recent years.

Recent literature on IBM focuses on models utilizing artificial neural networks (ANN) since such approaches are powerful in modeling nonlinear problems which are hard to model by other machine learning approaches <cit.>. Recurrent neural networks (RNNs) have shown remarkable performance in predicting when trained with large time series datasets <cit.>. RNNs work well for indoor temperature forecasting because the indoor temperature has certain time-related patterns that for example include daily, weekly, monthly, seasonally,  and yearly patterns. A number of practical studies prove the efficacy of ANNs for IBM. For example, an ANN model was used to predict the air temperature of buildings and was found to exhibit the best performance  <cit.>. Another ANN model that was built for indoor air temperature forecasting outperformed competing regression methods <cit.>.

However, most of these studies utilize a single ANN model <cit.> and only a few studies that combine two or more networks or models have so far been proposed. In addition, only a small set of studies provide the confidence of the model, which is important for evaluating a model's reliability <cit.>. In addition, the model should predict the indoor temperature in both short-term and the long-term time periods  <cit.>. Short-term predictions provide relatively precise results to the IBM whereas the long-term predictions offer an overview to the system, allowing the IBM enough foresight to optimize current actions to take care of temperature control challenges later in the day.

Inspired by ensemble methods and dropout inference <cit.>, we propose a novel adjoint neural network architecture that uses an ancillary neural network to capture weekends and holidays to increase the indoor temperature prediction accuracy for IBM. This architecture also combines the advantages of LSTMs and multilayer feed-forward neural networks <cit.>. Our proposed method addresses the aforementioned issues and outperforms the prediction of a single model. Meanwhile, it provides predictions for every 15 minutes of 24 hours with 68% and 95% confidence intervals (CIs). The main contributions of this paper are summarized as follows.


  
  * We propose an adjoint neural network architecture that uses an ancillary neural network to capture weekends and holidays to increase the accuracy of indoor temperature predictions. This architecture enables the prediction of up to 96 steps (24 hours) and provides confidence for all the predictions.
  
  * We conducted a comprehensive analysis and comparison by applying our proposed architecture to four popular time series prediction models. The comparison includes three metrics (average error of prediction, the error of max/min temperature prediction, and reliability of the prediction) in both one-step ahead prediction and multiple-steps ahead prediction.








§ RELATED WORK




 §.§ Artificial Neural Networks

ANNs have achieved a great success in many different fields <cit.>. A typical neural network contains many artificial neurons which are known as units. There are three types of units <cit.>: input units, hidden units, and output units. With more and more hidden layers employed, the neural work is more able to learn deeper abstractions and learns as an artificial brain <cit.>.

Techniques to effectively train ANNs with more than three layers have become standard. Deep Neural Networks (DNNs) are neural networks with more than one hidden layer and it usually works better than shallow neural networks <cit.> for a particular task. 

DNNs have been used in many different domains. In the image processing domain, DNNs were used to learn graphics representations <cit.> and estimate human pose <cit.>. In the traffic domain, DNNs were used to classify traffic signs <cit.> and predict traffic flow <cit.>. In our IBM domain, DNNs helped predict indoor temperature <cit.> and energy consumption <cit.>.

In recent years, other ANN designs have become commonly used. The LSTM and Bayesian Neural Network (BNN) designs are relevant and are reviewed below.




 §.§ Long Short-Term Memory

LSTM networks <cit.> have become popular in the recent years for time series prediction <cit.>. LSTM networks are a special kind of RNNs which are designed to solve the long-term memory problem. LSTMs have been used in many time series problems. For example, networks using LSTMs have been successfully employed in a number of important problems like speech recognition <cit.>, machine translation <cit.>, and energy load forecasting <cit.>.

In this paper, we will use a densely connected multilayer feed-forward network after an LSTM encoder. The multilayer feed-forward neural network utilizes the temporal information for a robust prediction.  We take the advantage of the encoder in the LSTM layer for extracting temporal information. We feed the final states of the LSTM encoder to the multilayer feed-forward network. 











 
  
  



  




  



  

  


 


§ METHODOLOGY

The complete architecture proposed is shown in Figure 1. The architecture contains three parts: A) is the main neural network (LSTM followed by a multilayer feed-forward network) which aims to learn temporal patterns from significant features. B) is an ancillary neural network which takes in extra features regarding weekends and holidays using an LSTM followed by relatively shallow multilayer feed-forward network). C) is the combiner part whose outputs are the weighted average of the predictions from part (A) and part (B). The output includes the forecast of one-step ahead (next 15 minutes) and multi-step ahead (up to 96 steps, 24 hours in total).  After that, we add a dropout unit to infer the CIs of the result. We will discuss each module and CI in the details below.



 §.§ Main Neural Network

This module aims to learn from the important features. Those features usually change along with time, such as outside temperature, occupancy, and date. Also, these features have daily, weekly, monthly, seasonally, and yearly patterns. Thus, we construct the data as continuous time series input. Those data pass to the LSTM units which learn temporal information and construct internal states. The internal states are further propagated to a 7-layer feed-forward network that forecasts the one-step ahead and 96-steps ahead indoor temperature ŷ_main.

Given a dataset which includes S timestamps, the model needs to predict the next n timestamps and for each timestamp, there are m features. Thus, we construct the input data as a three-dimensional matrix and the size of the matrix is S × n × m, 

We use a 2-layer LSTM network to extract temporal information and then feed the temporal information to a 7-layer feed-forward neural network. Next, the network forecasts the indoor temperature ŷ_main which contains 96-steps ahead predictions. Since the duration of each time step is 15 minutes, the 96-steps ahead predictions will cover the prediction of every 15 minutes of next 24 hours.



 §.§ Ancillary Neural Network

In the ancillary neural network, we aim to utilize extra features like weekends and holidays. These features are ancillary because, with enough data, this information could be learned by the main neural network itself from significant features fed into the main neural network. But explicitly providing these features helps increase the performance of the model especially if the size of the dataset is small. These values of these extra features are either 0 or 1 which is used as an indicator of being a weekend or holiday. Then, to reduce the model complexity, those extra features are learned by a relatively shallow neural network (a 4-layer feed-forward neural network). The size and dimension of the output ŷ_anc is exactly the same as the output from the main neural network.



 §.§ Model Weighting

After the main neural network and ancillary neural network are fully trained, we use the weighted average <cit.> and use rectifier (ReLU) <cit.> as the activation function to forecast the output, shown as below:



    ŷ = ReLU(w_1 ŷ_main + w_2 ŷ_anc)


where ReLU is the activation function which is computationally efficient to compute and has less likelihood of a vanishing gradient.

The output of the weighted average ŷ includes multiple steps predictions with the same dimension as the output of main neural network module ŷ_main and ancillary neural network ŷ_anc. We minimize the root mean squared error (RMSE) between all these values and corresponding ground truth value. In this case, we had prepared our ground truth indoor temperature with multiple timestamps as a three-dimensional matrix.

The output layer provides one output for each of the 96 timestamps. The closer timestamp to the forecast time is usually more accurate than later timestamps. The later timestamp forecasting provides an overview of how indoor temperature is going to change and allows for taking some actions ahead of time <cit.> for better anticipatory HVAC control of the building. This helps provide desired temperatures with less energy consumed since less radical (more planned) actions are taken. 




 §.§ Deriving Confidence Intervals

After the model is fully trained, we need to derive the CI of the output of the model. We use MC dropout proposed in <cit.> and this provides a framework to estimate uncertainty without any change of the existing model.

Specifically, we add stochastic dropouts to each hidden layer of the neural network. Then we add sample variance to the output from the model <cit.>. Finally, we estimate the uncertainty by approximating the sample variance. We assume that indoor temperature is approximately a Gaussian distribution. In this paper, we will derive the 68% and 95% CIs and use it to evaluate the reliability of the model. Given the sample data, we could calculate the mean μ and standard deviation σ. Then the 100 · (1-α)% CI <cit.> is:


    [μ - t_1-α/2·σ/√(n), μ + t_1-α/2·σ/√(n)]

where n is the sample number and t denotes the density function.



 
  
  

  
    









  
  
  
  





§ EXPERIMENTS

In this section, we will first test our proposed architecture with the LSTM-DNN <cit.> network in both one-step ahead (15 minutes) prediction and 96-steps ahead (24 hours) prediction. Later, we will do similar test to the other three popular time series prediction models: LSTM RNN <cit.>, LSTM encoder-decoder <cit.>, and LSTM encoder w/predictnet <cit.>. We will compare not only the error (RMSE, MAE, and MAPE) of all predictions but also the error of predicting the maximum and the minimum temperatures. In addition, we will evaluate the reliability of the models by calculating the probability of ground truth temperature being within the 68% and 95% CIs respectively.




 §.§ Setting

The data comes from a multistory building located in New York City (NYC). Data are collected by the Building Management System (BMS) every 15 minutes. The temperature predicted is for one sensor on a floor of the building. Total building occupancy data are also collected. In addition, we collect the outside weather information, including wind speed and direction, humidity and dew point, pressure and weather status (fog, rain, snow, hail, thunder, and tornado),  and temperature from the Central Park NOAA weather station. The analyzed data are from June 9th, 2012 to November 16th, 2014 (84,768 timestamps). We utilized 67,814 of the timestamps for training and 16,954 for testing. The ratio of training to testing is 8:2. We then split 20% of the timestamps from the training dataset for validation.  After the neural networks are trained, we added dropout layer and repeatedly sample for 10,000 times. Finally, we derive 68% and 95% CIs from the sample outputs.




 §.§ One-Step Ahead Prediction Evaluation


We first compare the capacity of capturing time series pattern between the LSTM-DNN model without the ancillary model and the LSTN-DNN model using the adjoint architecture. Later on, we will evaluate the improvement of using our proposed architecture from three different perspectives (error of the total prediction, error of predicting max/min temperature, and model reliability based on the CIs).

Capacity of Capturing the Time Series Pattern: 
to retrieve the one-step ahead data from the output consisting of 96-steps ahead predictions, we extract the first step of the output temperature of each input and splice these data. Figure 2 demonstrates the sample predictions of using our proposed architecture. The plot includes one-step ahead prediction with the 68% CI and 95% CI. The 68% and 95% CIs are shown as gray and light gray color band respectively. The black solid line represents the ground truth indoor temperature and the gray dash line is the prediction. We noticed that the model learns the daily and weekly patterns as the temperature pattern during weekdays and weekends is different.  But we also found that the bands of the CIs are large at the maximum and the minimum temperature. 

In order to evaluate the improvement of prediction using the adjoint neural network, we plot the predictions (without CIs) of the LSTM-DNN without the ancillary network, the adjoint LSTM-DNN, and ground truth indoor temperature in the same plot. Figure 3 shows the selected result of the one-step ahead prediction from 22nd September to 22nd October. We observed that both models capture the daily, weekly and holiday patterns well. But the adjoint model has better predictions, especially when the predicting of the maximum and the minimum temperature. Next, we will compare the model using our proposed architecture with the model without the ancillary network these three different perspectives.




  §.§.§ Error of All Predictions
 
First of all, we calculated the monthly error of all predictions. Specifically, we calculated the monthly error of RMSE, MAE, and MAPE using all timestamps (every 15 minutes) for the months of June to November. Then we compared the error of both the LSTM-DNN without the ancillary network and the adjoint LSTM-DNN. Figure 4 illustrates the comparison of error (RMSE, MAE, and MAPE) of the two models. It is obvious that the model using our proposed architecture has a much smaller error than the LSTM-DNN without the ancillary network.



  §.§.§ Error of Max/Min Predictions

In addition, we evaluated the improvement of using our proposed architecture to predict the maximum and the minimum temperatures. To begin with, we found the timestamps of both the maximum and the minimum temperatures with respect to each day. Next, we calculated the RMSE, MAE, and MAPE from 30 minutes (2 timestamps) before to 30 minutes after the timestamp of the maximum or the minimum temperatures. Last, we summarized the error in the same month. Figure 5 illustrates that, using our proposed architecture, the model has a much better capacity for predicting the maximum and the minimum temperatures.



  §.§.§ Reliability of Predictions

Last, we evaluated the reliability of the model.  This is evaluated by calculating the probability that the ground truth indoor temperatures are not within 68% and 95% CIs respectively, as shown in Figure 6. We notice that both models have similar changes during the month. But the probability of using our proposed architecture is always lower than the LSTM-DNN without the ancillary network. Therefore, using the adjoint network increases the reliability of the model.

Then, the same analysis was conducted for the three other base models, LSTM RNN, LSTM encoder-decoder, and LSTM encoder w/predictnet, within the adjoint neural network architecture and without the adjoint architecture. 

To sum up, Table 1 illustrates the comparison of one-step ahead predictions between the models with and without the ancillary network. It shows that the adjoint neural network architecture decreases the error and increases the reliability of the models. Also, we observed that our proposed model (LSTM-DNN) which is not the best model without the ancillary network becomes the best model when used within our adjoint neural network architecture.





 §.§ Multiple Timestamps Evaluation



In this section, we will evaluate the prediction errors for 96-steps ahead. Each step represents 15 minutes, so 96 steps denote the predictions for 24 hours. We will first compare the models' performance using or not using our proposed architecture to capture the daily pattern. Then, we will compare the two models from these three different prospectives.

Capacity of Capturing the Time Series Pattern: 
Figure 7 shows the predictions of using our proposed architecture for July 1st which was a Tuesday. The prediction is for 96-steps ahead including the 68% CI and the 95% CI. The 68% and 95% CIs are shown as the gray and light gray color bands respectively. The black solid line represents the ground truth indoor temperature and the gray dash line is the scalar predictions of the adjoint model. We noticed the model learned the daily temperature and predicts the 24 hours fairly well. At midnight, the indoor temperature is high since the HVAC system is shut down at that hour. During the daytime, the HVAC system is operating, and the indoor temperature is lower. As people leave the office, the building operators ramp down and later turn off the HVAC system and the temperature raises again.


In order to evaluate the improvement of the prediction using our proposed architecture, we plot the predictions (without CIs) of the LSTM-DNN without the ancillary network, the adjoint LSTM-DNN, and the ground truth indoor temperature in the same plot, as shown in Figure 8. We observed that the adjoint neural network has better performance for fitting the 24 hour prediction, especially for predicting the maximum and the minimum indoor temperature. Next, we compare the model using our proposed architecture with the model without the ancillary network from three different perspective.



  §.§.§ Error for all predictions
 

Firstly, we calculated the monthly error of all predictions. Specifically, we calculated the monthly error of RMSE, MAE, and MAPE using 96-steps ahead (24 hours) predictions of all the timestamps in that month respectively. Next, we compared the error of both the LSTM-DNN without the ancillary network and the LSTM-DNN using our proposed architecture. Figure 9 demonstrates the comparison of the two models. Though the error is higher than the one-step ahead predictions, the model that uses our proposed architecture still outperforms the model without the ancillary network.



  §.§.§ Error of Max/Min Predictions

Secondly, we evaluated the predictions on the maximum and the minimum temperature. To begin with, we found the timestamps of both the maximum and the minimum temperature. Then we calculated the RMSE, MAE, and MAPE from 30 minutes before and after the time of the maximum or the minimum temperature. Finally, we summarized the error in the same month. Figure 10 illustrates that the model using our proposed architecture has the better capacity to predict the maximum and the minimum temperatures.





  §.§.§ Reliability of Predictions

Thirdly, we evaluated the reliability of the model. We calculated the probability of the ground truth indoor temperatures are outside of the 68% CI and the 95% CI respectively. Thus, the lower the probability is, the more reliable the model is. Figure 11 shows the result of how the probability changes from June to November. We noticed that the models have fairly similar change during this time period, but the adjoint neural network architecture is more reliable than the LSTM-DNN without the ancillary network. 

Then, the same analysis was conducted for the three other base models, LSTM RNN, LSTM encoder-decoder, and LSTM encoder w/predictnet, within the adjoint neural network architecture and without the adjoint architecture.

To sum up, Table 2 illustrates the comparison of the multi-step ahead predictions between the model using our proposed model and the corresponding model without the ancillary network. It shows that the ancillary neural network can also decrease the error and increase the reliability of the model in multi-step ahead forecast. The interesting finding, that the model (LSTM-DNN) which is not the best model becomes the best model by using our adjoint neural network architecture, also holds true in the multi-step ahead forecast.






§ CONCLUSIONS


In this paper, we propose a novel adjoint neural network architecture for time series prediction that uses an ancillary neural network to capture weekend and holiday information for IBM. We used the dataset of a multistory building in NYC and compared four different base models (LSTM RNN, LSTM encoder-decoder, LSTM encoder w/predictnet and our proposed LSTM-DNN model) within the adjoint architecture with the corresponding models without the ancillary network. The models' performance was evaluated in both one-step ahead prediction (15 minutes) and 96-steps ahead prediction (24 hours) in three different perspectives. First, we compared the total error of RMSE, MAE, and MAPE of all prediction accounted. Second, we compared the error (RMSE, MAE, and MAPE) of predicting the maximum and the minimum temperatures. Third, we compared the reliability of the models by calculating the probability of the ground truth indoor temperatures are not within CIs.

From the result of the one-step ahead prediction (Figure 3), the models using an ancillary NN successfully capture the daily, the weekly patterns and the holidays. In addition, it performs better prediction result than the models without using ancillary network. Then,  from the result of the multi-step ahead prediction (Figure 7), the models using an ancillary network successfully captures the daily patterns better, especially on predicting the maximum and the minimum temperatures.

Our adjoint neural network architecture with the LSTM-DNN model could be used for building a more dependable IBM system. With accountable predicted indoor temperatures, the system can provide comfortable indoor temperatures with less energy consumed.



























































IEEEtran

