Modelling the disaggregated demand for electricity at the level of residential buildings with the use of artificial neural networks (deep learning approach)

The paper addresses the issue of modelling the demand for electricity at the level of residential buildings with the use of artificial intelligence tools, namely artificial neural networks (ANN). The real data for six buildings acquired by measurement meters installed in them was used in the research. Their original frequency of 1 Hz has been resampled to a frequency of 1/600 Hz which corresponds to a period of 10 minutes. Out-of-sample forecasts verified the ability of ANN to disaggregate electricity usage for its specific applications. Four categories were distinguished, which were electricity consumption by: (i) fridge, (ii) washing machine, (iii) personal computer and (iv) freezer. Both standard ANNs with multilayer perceptron architecture and newer types of networks based on deep learning approach were used. The simulations included a total of over 10,000 ANNs differing, e.g. architecture, input variables, activation functions, their parameters, and training algorithms. The research confirmed the possibility of using ANN in modelling the disaggregation of electricity consumption and indicated the way of building a highly optimized model.


Introduction
Electricity used in buildings constitutes 40% of its global consumption [1]. A significant part is used in residential buildings. Households in the European Union are responsible for 25% of total energy consumption, which makes them the second largest source of demand after transport [2].
Knowledge of the amount of energy demand is crucial from the point of view of managing (including optimizing) energy consumption. Optimization processes are understood as those leading to a reduction in electricity consumption and those resulting in a reduction in electricity acquisition costs (e.g. in case of zonal tariffs). Regardless of the adopted objective, a comprehensive approach requires knowledge of data for devices generating demand. In practice, only aggregate data from smart meters are usually available. They do not provide information on the sources of demand for electricity and thus do not provide knowledge on actions that can lead to the optimization of electricity consumption. The aim of this study is to analyze the possibility of modelling the disaggregated demand for electricity at the level of residential buildings with the use of artificial neural networks. Estimation of energy consumption for selected key demand sources would potentially enable the implementation of energy management systems without the need to install individual meters for each consumption point.
The study used real data from ECO data set. They come from six houses in Switzerland and were collected over a period of approximately eight months at a frequency of 1 Hz. Detailed information on the structure of energy demand in each property was described among others in [3]. Since the original frequency was too high to be able to precisely disaggregate the total energy consumption per component using time data, it was necessary to reduce it. The often used time interval is 15 minutes [4]. In this study, higher frequency data (and therefore potentially more useful in practice) have been used. As in [1], the interval of 1/600 Hz, i.e. 10 minutes, was used. In order to carry out the transformation described above, arithmetic averages from seconds readings of power consumption for both the overall data and values representing power consumption by specific devices were calculated.
Previous studies on electricity demand in buildings have confirmed its close connection with many measurable factors. Chen et al. [1] mentions among others: (i) zone temperature measurements, (ii) node temperature measurements system, (iii) lighting schedule, (iv) inroom appliances schedule, (v) room occupancies. It should be noted that the different structure of energy consumption is related to the legitimacy of using different independent variables. For example, in Canada 63% of energy is used for space heating, while in the United States this percentage is only 22%. Analogous energy consumption rates for space cooling are 2% and 9%, respectively [5]. Therefore, in the first case weather data are much more desirable in the model than in the second case.
Knowledge of indicated demand determinants in real time is related to the need to install a technically advanced (expensive) measurement infrastructure connected with the database system. For this reason, numerous studies are focused on the possibility of developing and implementing cheaper systems based only on values of total electricity demand (see [6] -factorial hidden Markov model (FHMM); [7] -differential FHMM; [8] method based on finite states machines (FSM) appliances models; [9] -hinge-loss Markov random field (HL-MRF); [10] -convolutional neural network (CNN); [11] spatiotemporal sattern network (STPN)). This disaggregation technique is also referred to as non-intrusive load monitoring (NILM) and its origins date back to 1984 [12] (see also [13]).
Effective (precise) analyses may concern both individual households (end users of energy) -as presented in this study (see also [14]), and whole building electricity consumption (see [11], [15]).

Artificial neural network
Creation of artificial neural networks (ANNs) dates back to 1943, when a mathematical model of neurons was developed [16] (see Fig. 1a). In 1958, Rosenbaltt [17] presented a model of unidirectional network, in which neurons are grouped into successive so-called layers, and signals -as the name indicates -flow in only one direction (from input to output). Multilayer perceptron (MLP) is composed of three types of layers: (i) always a single input layer, (ii) hidden layers, (iii) one output layer (see Fig. 1b). The last two types of layers are subject to the learning process, which means that the neurons placed in them have the ability to acquire knowledge. Due to the numerous limitations of primary architecture, more advanced ANNs based on modified training algorithms, generally referred to as deep neural networks (DNNs), have been gaining popularity in recent years. Under this name there are many types of networks built on the basis of different types of layers. Although the beginnings of deep learning algorithms in ANNs date back to 1965 [18], the most dynamic growth of their popularity takes place today. Its causes include technological developments and the increasing use of high-performance graphics processing units (GPUs) to accelerate computing in relation to the CPU.
This study uses MLP-type ANNs (with one hidden layer) and DNNs built of three dense layers. Sigmoid and Tanh were used as activation functions in MLP. DNNs uses the rectified linear unit (ReLU) defined by formula (1) which turned out to be the most effective one.
Possibility of using other activation functions such as SoftPlus, SoftSign, SoftMax, Sigmoid, Tanh was also tested during the research process. Their graphs are shown in Fig.  2.

Empirical models of disaggregated demand
In the research, as independent variables were used: (i) sum of real power over all phases in 10 minutes [W], (ii) variable (i) delayed by 10 minutes, (iii) sum of apparent power over all phases in 10 minutes [VA], (iv) variable (iii) delayed by 10 minutes, (v) difference between variable (i) and (iii), (vi) variable (v) delayed by 10 minutes, (vii) natural number from the range [1,144] representing the daily number of 10-minute interval, (viii) dummy variable indicating weekend (1) and weekday (0). Dependent variables were alternatively real power measured by the plugs (each model predicted indications of only one plug meter). In case of all properties, the readings from plug meters did not include the entire period covered by the smart meters measurements. Limiting the analysis only to days for which a full set of data is available (including delayed input variables (ii) and (iv)) would mean using data sets of insufficient size. This would result in both problems with proper ANN training and a decrease in the reliability of study. For this reason, only selected categories of receivers with a sufficient number of plug meters readings (see Table 1) were analyzed.  Fig. 3 shows an example of the arithmetic average of plug meter readings (with a measurement frequency of 1 Hz) recorded in 10 minutes. Due to the fact that at that time it is possible that a given device remained both fully active (high demand for electricity) and in a low (or zero) state of current consumption (standby mode or inactive), it was necessary to determine the threshold of real power above which the device was classified as active. Due to the different electricity demand characteristics of each type of devices, these thresholds were set individually (see Table 1).

Fig. 3. Electricity consumption generated by fridges.
Networks of MLP type were characterized by unacceptably low precision of operation. The percentage of correct responses ranged between 50% and 60%. For this reason, further research was only carried out using DNN networks, which due to other training algorithms can function properly despite the much higher level of complexity (number of layers and neurons).
In the DNN model, a dropout unit of 0.3 was used after each dense layer to reduce interdependent learning amongst the neurons. The number of neurons in the input layer has been adjusted to an optimal set of independent variables (experimentally selected). The output layer always contained only one neuron as all models had a single dependent variable. The number of neurons in the first two dense layers was selected experimentally and it is 70 and 30, respectively. The number of epochs was limited to 200. Other hyperparameters are presented in Table 2.  Table 3 presents results achieved by the best models using four input variables: (i), (v), (vii) and (viii).

Conclusions
Research has confirmed the possibility of modelling the disaggregated demand for electricity at the level of individual households on the basis of data from smart meters extended by time variables. The analysis of results achieved by models shows that the highest precision occurred when estimating the electricity consumption generated by fridge.
The worst results were achieved by modelling the energy consumption of personal computer. It should be assumed that this is due to the fact that the electricity demand is low in relation to the total electricity consumption and the problems with creation of time patterns by the ANNs related to the activity of these devices. Future research should be extended to other ANNs models. It would be reasonable to try to generate results similar in terms of precision by models based on data with a shorter time interval. This would enable to increase the practical value of models and allow modeling the demand for electricity by devices with short time of activity, e.g. microwave ovens. Models presented in the study are predisposed primarily to determine the sources (components) of aggregated demand. However, the possibility of their future use is much wider. For example, their adaptation to issues related to the detection of anomalies in the functioning of electricity receivers before the total failure or subsequent destruction of the technical infrastructure takes place should be considered (see also [19]).