Advanced control concepts for building energy sys- tems, such as Model Predictive Control, often require modelsthatforecasttheenergydemandofabuilding. Such models are commonly based on ﬁrst principles, however the cost and eﬀort required to develop such models may be prohibitive for real-life applications. As an alternative, we introduce and validate a data- driven simulation approach based on Artiﬁcial Neural Networkstoforecasttheheatingdemandofbuildings. The forecast is enhanced with the help of two cor- rection methods, based on online learning and fore- cast error auto-correlation. Validation results based on data from four oﬃce buildings suggest that our method shows better forecasting performance than a ﬁtted 5R3C building model. Introduction Predictive control of buildings allows for energy and money savings as well as reduction of CO2 emissions (Halvgaard et al., 2012). This can be achieved by predicting future states of a system and optimally determining according set-points, making use of re- newable energy when available or taking advantage of time-dependent electricity prices for example. The concept of Model Predictive Control (MPC) has suc- cessfully been demonstrated in the building energy domain (Sturzenegger et al., 2016; Oldewurtel et al., 2012). Several authors, however, (see for example (Jain et al., 2018; Smarra et al., 2018)) argue that a major bottleneck with this approach is the need to develop and maintain ﬁrst principles models. Indeed the time and eﬀort necessary to develop, customise and maintain ﬁrst principles models can often be pro- hibitive for real life deployment to building energy management. With increasing availability of high-resolution energy monitoring data in the building domain, the possibil- ity of data-driven modelling approaches (or Machine Learning based approaches) arises. With the help of methods such as Artiﬁcial Neural Networks (ANN) previously measured data of the ambient tempera- ture and the heating demand can be used to predictthe future heating demand of the building. In (Bünning et al., 2019) a heating demand forecast- ing approach based on ANN with forecast correction methods based on online learning and forecast error auto-correlation was introduced. The aim is to gen- erate a 24h forecast of the heating demand in 15- minute intervals. The method showed high predic- tion accuracy on a modern multi-use building and outperformed other regression-based methods such as random forests or support vector machines, as well as ﬁtted resistor-capacitor models with varying com- plexity. Moreover, thedependenceofANNprediction performance on initialization parameters, which are commonly randomly set, as critized by Recht (2018); Henderson et al. (2018) and others, is signiﬁcantly lowered with the shown methods. Here we explore this approach further and show that the concept generalises well to diﬀerent types of data and buildings. In particular we apply the method to four diﬀerent buildings, each with diﬀerent build- ing characteristics and data availability. By compar- ing the prediction accuracy to a ﬁtted 5R3C building model, which gives a reasonable trade-oﬀ between de- tail and modelling/ﬁtting eﬀort, we demonstrate that the approach outperforms the R-C model in all pre- sented cases. Furthermore, the robustness to initial- izing parameters of the ANN is also preserved for all test cases. Methodology This section is divided into four subsections. First, the forecasting task is introduced. Second, the fore- casting method based on ANN with forecasting cor- rection based on online learning and error auto- correlationisexplained. Third, theusedR-Cbuilding model is introduced. Finally, an overview of the val- idation study, key-performance indicators and build- ings is provided. Forecasting task In this study the following forecasting task is as- sumed: A heating demand forecast is made at mid- nightforthenext24hours,sampledevery15minutes. The training and validation data are assumed to be ________________________________________________________________________________________________ ________________________________________________________________________________________________ Proceedings of the 16th IBPSA Conference Rome, Italy, Sept. 2-4, 2019 1428 https://doi.org/10.26868/25222708.2019.210673 i1 i2 i3w1 w2 w3inputs weights sum activation function bw0 biasFigure 1: Artiﬁcial neuron. sampled at the same frequency. Furthermore, perfect knowledge of the ambient temperature for the fore- casting period is assumed. This is done as it avoids uncertainty in the inputs when comparing the diﬀer- ent methods. Artiﬁcial Neural Network with forecast cor- rection We use ANN for the heating demand forecast. An ANN is a sequence of artiﬁcial neurons, also called nodes. A schematic of a node with three inputs is shown in Figure 1. The output of a node is the ac- tivation function applied to the weighted sum of all inputs. The nodes weights are the parameters that are ﬁtted in the training process of the ANN. For a more detailed explanation of ANN, see (Basheer and Hajmeer, 2000) for example. In (Bünning et al., 2019) two forecast correction methods were developed. The ﬁrst forecast correc- tion method is based on error auto-correlation and is not speciﬁc to ANN. The use of the error autocor- relation is motivated by the assumption that errors in building energy forecasts are correlated over time, because the source of the error persists for more time than one sample: for example if a window is opened or a failure in a ﬂuid pump occurs, the forecasting error will last for more than one interval, because the source of the error is not always eliminated dur- ing this interval (window closed or ﬂuid pump ﬁxed). Thus, if an error is measured, it can be used to make an estimate of the error in the following forecasting steps. Figure 2 demonstrates the ﬁrst correction procedure. Oﬄine, based on the measured errors of all past fore- casts (which are stored in a data-base), an estimation of the error auto-correlation is made. As a ﬁrst step in the online phase, a forecast is made with an ANN. We will call this the uncorrected forecast.With the help of the auto-correlation and the forecasting error of the previous day (which is the uncorrected forecast of the previous day minus the measured load of that day), an estimation for the forecasting error of the uncorrected forecast can be made. The uncorrected forecast is then corrected by adding the estimation of the forecasting error, giving rise to the corrected forecast. error estimationdelay measured load- +++ ANNuncorrected forecast estimated error previous errorcorrected forecastFigure 2: Forecast correction scheme. TambientCzone Rwall1 Q1Rwall2Cwall RinﬁltrationQ2RcoreCcore Rground TgroundTzone Figure 3: 5R3C building model. The second forecast correction method is speciﬁc to ANN and makes use of online learning. Instead of onlytrainingonthebasisofthetrainingset, theANN is retrained based on the measurement of the lat- est heating demand realization and the correspond- ing network inputs at the end of every day. This biases the network towards the recent behaviour of the building and appears to improve the forecasting accuracy. The two forecast correction methods can of course be combined. R-C building model In order to benchmark the performance of the ANN and the correction mechanisms, we use a 5R3C build- ing model. This model was chosen because on the one hand it should oﬀer enough complexity to capture the governing thermal behaviour of the buildings and on the other it should perform well with a modelling ef- fort similar to the neural networks. More detailed models, for example an EnergyPlus model combined with an occupancy model adapted to each building, may outperform the 5R3C and ANN models in terms of forecasting accuracy, but would require consider- ablymoreeﬀorttodevelopandmaintain, asdiscussed above. Figure 3 shows a schematic of the 5R3C model. The model features a capacitor for outer walls, a thermal zone and inner walls. Furthermore, there are ﬁve re- sistors - two for the outer walls, one for the inner walls, one for heat conductions towards the ground and one for building inﬁltration. All capacitor and resistorvaluesareoptimizationvariablesintheﬁtting ________________________________________________________________________________________________ ________________________________________________________________________________________________ Proceedings of the 16th IBPSA Conference Rome, Italy, Sept. 2-4, 2019 1429 process. The total heating demand of the building ˙Qtotal=˙Q1+˙Q2, (1) is distributed between ˙Q1(directly to the zone) and ˙Q2(to the core) to be able to model both direct heat- ing systems such as radiators and indirect ones such as concrete core activation. The share, cf, between ˙Q1and ˙Q2is also a decision variable in the ﬁtting process: ˙Q1=cf×˙Qtotal. (2) To emulate a simple control system, the temperature ofCzone,Tzone, is controlled with a P controller, ˙Qtotal=kp×(Tset−Tzone), (3) where Tsetdenotes the temperature set point for the zone. The gain, kp, is also a decision variable in the ﬁtting process. Validation study General description To validate the neural networks and the correction methods and to benchmark them against the R-C model, four diﬀerent buildings were selected as case studies. For each building heating demand measurements and ambient temperature measurements in 15 minute in- tervals were available over a period of one to three years. In each case 70% of the available dataset was used for model training (for both the ANN and the R-C models) and 30% of the dataset was used for model validation. As a key performance indicator the coeﬃcient of de- termination, R2= 1−/summationtext i∈N(yi−f(xi))2 /summationtext i∈N(yi−¯yN)2, (4) is used. It is zeroif the forecast f(xi)is as good as takingtheaverage ¯yNofthedataintheconsideredset Nas a forecast, and oneif the forecast is exactly the same as the validation data yi.R2becomes negative if the forecast is worse than taking the average. Thediﬀerentbuildingsareintroducedinthefollowing and are depicted in Figure 4. Building (a) is the NEST building at Empa in Dübendorf, Switzerland. Opened in 2016, it is a multi-use building with residential units, oﬃce units as well as meeting rooms and a ﬁtness center. Its heating and cooling system is build to imitate a dis- trictenergysystem. Thebuildingisthereforereferred toasa’verticaldistrict’(asopposedtoaconventional district, which is built horizontally). 13.5 months of measured demand data was used for this building. (a) NEST at Empa, c/circlecopyrt Zooey Braun. (b) ETL at ETH Zürich (ETH Zürich, 2019). (c) Bauhalle at Empa, c/circlecopyrt Heinrich Helfenstein. (d) Verwaltungsgebäude at Empa (Empa, 2019). Figure 4: Buildings used in the validation study. Building (b) is the ETL building located at the zen- trum campus of ETH Zürich. It is an eleven-story oﬃce building that comprises several research insti- tutes, experimental laboratories and a machine shop. Six stories lie below ground. 36 months of measured demand data was used for this building. Building (c) is the Bauhalle at Empa. The building has oﬃces and testing facilities for material science experiments. The oﬃces are spread over three stories while some of the laboratories have the ceiling height of these three stories. The building also has a base- ment. 24 months of measured demand data was used for this building. Building (d) is the Verwaltungsgebäude at Empa. This is a three-storey oﬃce building with some meet- ing rooms. 24 months of measured demand data was used for this building. Speciﬁc models for the case studies Artiﬁcial Neural Networks with two hidden layers, each containing eight nodes were chosen as the net- work architecture. They are trained with ten epochs on the training set, meaning that the network’s weights are updated ten times based on each sam- ple in the training data. The choice of parameters for the architecture and training process is based on a sensitivity analysis regarding these parameters. As inputs to the network the following features were chosen: 1. ambient temperature 2. hour of the day 3. weekday/weekend 4. heating load of the previous day 5. heating load of the previous week The feature hour of the day was one-hot encoded, meaning that instead of one input with a continuous ________________________________________________________________________________________________ ________________________________________________________________________________________________ Proceedings of the 16th IBPSA Conference Rome, Italy, Sept. 2-4, 2019 1430 value,24inputswithbinaryvalues(either0or1)were used. Our experiments suggest that this improves prediction accuracy compared to a continuous input.1 Thefeature weekday/weekend isalsobinary. Allother features are continuous. The Python package Keras (Chollet, 2018) was used to implement the network and the solver adam (Kingma and Lei Ba, 2015) was used for the optimization of the network parameters. The training of one network takes between ﬁve and twelve minutes. The 5R3C model was implemented in Modelica (Mattsson et al., 1998) and simulated in Dymola (Brück et al., 2002). To ﬁt the parameters, the model was coupled to Python and optimized with a CMA- ES (Covariance Matrix Adaption Evolution Strat- egy) optimizer to minimize the sum of squared errors between the predicted load and the reference load. The optimization budget was ﬁxed at three hours for each model. As the model does not allow for the other inputs, only the ambient temperature is used. The room temperature set point is Tset= 20◦C and Tgroundis set to constant 12◦C in all cases.2 Results and discussion Variance The prediction performance of ANN is dependent on their parameters, some of which are random, for example the initialization parameters of the node weights. If ANN are used in a control context, a reduction of the variance in prediction performance is desirable, as the controller needs to be designed for the expected accuracy of the forecast. To investigate the variance in prediction accuracy, 100instancesofANNweretrainedandtestedforeach building. Each individual network is initialized with random node weights. As the training process is non- convex this leads to a diﬀerent prediction accuracy of each network. Figure 5 (a)-(d) shows the variance of the coeﬃcient of determination for 100 diﬀerent instances of neu- ral networks for each building (with boxes describing the interquartile range, whiskers of 1.5 times the in- terquartile range, circles indicating outliers and the orange line indicating the median). The ﬁrst col- umn depicts uncorrected networks, the second col- umn networks with error auto-correlation correction, the third column networks with online learning and thelastcolumnacombinationofbothcorrectionmea- sures. 1This can be explained with the monotonic increase of the ReLu activation functions that are used in the network. A con- tinuous implementation of the time as an input would imply that the inﬂuence of the time on the demand is either mono- tonically increasing or decreasing. 2This might have an eﬀect on the accuracy of the fore- cast. However, a more detailed implementation would require a human-in-the-loop model for the temperature set-point and a ground model for the ground temperature, both of which require extensive modelling eﬀort.Subplot(a)correspondstotheNESTbuilding(build- ing (a)) that was also used in (Bünning et al., 2019). It can be seen that the median of the coeﬃcient of de- termination increases whereas the variance decreases from no correction to the combination of both cor- rection methods. Online learning gives the bigger improvement when compared to the correction based on the error auto-correlation. However, the combina- tion of both gives the best results: even though the variance does not improve much, the median of the coeﬃcient of determination further increases. The same trends are observed for buildings (b) and (c). In the case of building (d), the trend is not as strong, but still present. The median increases with each individual correction method, but the median R2of the online learning correction is lower than the one for error auto-correlation correction. The median of the combined method is again the highest one. The maximum achieved coeﬃcient of performance is lower for the online learning and the combination of both correction methods compared to the uncorrected net- work and the correction method based on error auto- correlation. This is due to overcorrection of already well predicting networks. The diﬀerence in the result between building (d) and the other buildings could be explained by the qual- ity of the available data set. The measured heating demand of building (d) has a quantization of 0.5 kW at a maximum load of 26.5 kW, while for all other buildings the measured demand has a quantization of 0.5 kW at a maximum load of at least 86 kW. Quan- tisation error eﬀects are therefore likely to be more pronounced for building (d). These results generally support the ﬁndings of Bün- ning et al. (2019) and indicate that the correction methods can be beneﬁcial for a range of diﬀerent buildings. An interesting question is why the combi- nation of both correction methods tends to improve over the individual methods. Both correction meth- ods address a similar problem: the mismatch between forecast and realization due to recently changed be- haviour of the building. It seems, however, that the two methods correct for slightly diﬀerent, comple- mentary phenomena. The correction based on error auto-correlation can react very eﬃciently to errors that have occurred shortly before the end of the last day’s forecast and correct the beginning of the next day’s forecast, when the auto-correlation, hence the conﬁdence in the error estimation, is high. However, strong corrections are only possible for the ﬁrst few intervals of the day, as the auto-correlation of the forecasting error decreases during the course of the day. The correction based on online learning, on the other hand corrects to a lesser extend on each indi- vidual interval, as the ANN still needs to be able to generalize. However, this correction can be applied over the course of the full day’s forecast and not just ________________________________________________________________________________________________ ________________________________________________________________________________________________ Proceedings of the 16th IBPSA Conference Rome, Italy, Sept. 2-4, 2019 1431 Uncorrected Auto Online Auto+Online0.7250.7500.7750.8000.8250.8500.8750.900R2 score (a) Uncorrected Auto Online Auto+Online0.700.750.800.850.900.95R2 score (b) Uncorrected Auto Online Auto+Online0.550.600.650.700.750.80R2 score (c) Uncorrected Auto Online Auto+Online0.830.840.850.860.87R2 score (d) Figure 5: Variance of the coeﬃcient of determination for all buildings. The label of the subplots (a)-(d) reﬂects the number of the building used in the case study. Table 1: R2of diﬀerent modelling approaches for all buildings. Building ANN uncorr. ANN auto ANN online ANN auto+online 5R3C model Building (a) 0.818 0.860 0.878 0.885 0.761 Building (b) 0.886 0.907 0.933 0.936 0.890 Building (c) 0.674 0.752 0.793 0.809 0.676 Building (d) 0.856 0.858 0.860 0.862 0.747 2017-10-03 2017-10-10 2017-10-17 2017-10-24 2017-10-31 2017-11-07 2017-11-14 2017-11-21 2017-11-28 Timestamp0.00.10.20.3Heating load scaledReal load Forecast Figure 6: Forecast trajectory example from building (b) test set with one instance of an ANN and both correction methods. ________________________________________________________________________________________________ ________________________________________________________________________________________________ Proceedings of the 16th IBPSA Conference Rome, Italy, Sept. 2-4, 2019 1432 at the beginning of the day. The combination of both therefore gives the best result. Accuracy Table 1 shows the mean coeﬃcient of determination (as opposed to the median in Figure 5) of the dif- ferent ANN approaches for all buildings as well as the coeﬃcient of determination achieved by the 5R3C building model. It can be seen that the average R2 increases for all four buildings when the individual correction methods are applied. A combination of both approaches (auto + online) gives a further im- provement in all cases. The ANN with the applied correction methods outperform the 5R3C model in all investigated cases. These results are of course by no means a proof that the ANN with corrections outperforms R-C type models in general. The R-C model could for exam- ple be made more complex or the parameter ﬁtting could be improved leading to higher coeﬃcients of de- termination. However, the results do give an indica- tion that the corrected ANN perform reasonably well compared to conventional methods and generalize to diﬀerent types of buildings. We note in passing that it is not possible to com- pare the coeﬃcient of determination between build- ings, because it depends on the distribution of heat- ing loads in the data set, which is diﬀerent for each building. Physical behaviour of the forecast Figure 6 shows the scaled forecast and real heating load of building (b) from an excerpt of the test set. The ﬁgure demonstrates that the real load is cap- tured reasonably well by the forecast, although the peaks in the last third of the excerpt are not pre- dicted well. This lends further support to our earlier observations on the accuracy of the forecasts based on the coeﬃcient of determination. Moreover, even though ANN are known to sometimes have weak ex- trapolation capabilities, in our case the forecast does not show any unrealistic behaviour in the sense of un- reasonably high or low forecasting values. The results for all other buildings3also point to the same conclu- sion. While this does not guarantee that non-physical behaviour is impossible with other forecasting inputs or for other building cases, the positive results for all four buildings indicate a robustness that could be suﬃcient for non-safety-critical control tasks. To further increase the conﬁdence in the forecast, it could be limited in its derivative and maximum/min- imum values. 3The full forecasting plots of both training and test set for one instance of an ANN with both correction methods applied to all four buildings are shown in Appendix A and Appendix B.Limitations The results of the case studies indicate that the meth- ods are sensitive to the quality of the measurement data. A quantitative statement cannot be made yet. This will be considered in following studies. Furthermore and as mentioned before, this validation study gives an indication that the methods developed in (Bünning et al., 2019) generalize to diﬀerent build- ings. However, it does not give a theoretical proof of any kind. The conﬁdence in the methods is strength- ened by the consistency of the results. Conclusion Generating and maintaining building models based on ﬁrst principles is often considered prohibitively ex- pensive and time consuming for applications such as real-time optimal control. The increasing availabil- ity of data in the building domain allows the use of data-driven modeling approaches. However, such ap- proaches have the disadvantage that they - in theory - allow non-physical behaviour and that they depend on random parameters such as the initialization of node weights in ANN. In this case study we have validated two forecast cor- rection methods for ANN for the forecasting of sub- hourly heating demands in buildings. The results for four diﬀerent buildings have shown that the resulting ANN perform well when compared to a 5R3C build- ing model in these cases. Furthermore, the correc- tion methods avoid non-physical behaviours and sig- niﬁcantly reduce the variance in ANN performance, which can improve conﬁdence in using ANN in the frame of control tasks. In future work we want to quantify the quality of input data vs. accuracy of forecast trade-oﬀ. More- over, we want to couple the introduced approaches to randomised optimisation methods (treating fore- casts from diﬀerent networks as samples) and robust optimisation methods (using the intervals). Acknowledgements We would like to thank Kristina Orehounig and Vik- tor Dorer for their valuable help and support. We are also grateful to Ahmed Aboudonia, Annika Eich- ler, Benjamin Flamm, Reto Fricker, Marc Hohmann, Mohammad Khosravi, Ralf Knechtle, Sascha Stoller, Bratislav Svetozarevic, Christoph Waibel and Joseph Warrington for fruitful discussions. This research project is ﬁnancially supported by the Swiss Innovation Agency Innosuisse and is part of the Swiss Competence Center for Energy Research SCCER FEEB&D.