**1. Introduction**

Nowadays, the amount of data that is generated almost continuously is enormous. Once analyzed, they can reveal useful information in many different disciplines; economy, healthcare, and e-commerce, to name a few. In this context, the energy sector could not have been an exception. Traditionally, energy data was acquired at a few critical points of the power grid, usually at the transmission level, but the landscape has changed due to the advance in smart-metering technologies. Thousands of internet-of-things (IoT) endpoints are placed within the smart grid, providing energy utilities access to valuable data; thus, new opportunities have been created for energy services and data-driven business models [1–5]. Energy disaggregation is an example of such a service.

Energy disaggregation is the process of consumption breakdown at appliance or activity level for residential or commercial-industrial (C&I) users; in other words, it estimates the individual power consumption for all appliances contributing to the total mains power. This process can help energy utilities reveal useful information to support load forecasting and demand-side managemen<sup>t</sup> programs. Regarding residential consumers, it can be used

**Citation:** Athanasiadis, C.; Doukas, D.I.; Papadopoulos, T.; Chrysopoulos, A. A Scalable Real-Time Non-Intrusive Load Monitoring System for the Estimation of Household Appliance Power Consumption. *Energies* **2021**, *14*, 767. https://doi.org/10.3390/en14030767

Received: 16 December 2020 Accepted: 28 January 2021 Published: 1 February 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

to provide accurate billing and meaningful feedback regarding their energy consumption as well as to improve the appliance efficiency (e.g., by detecting old devices and replace them with more efficient ones) [6].

There are two main possible energy disaggregation solutions: (a) Intrusive Load Monitoring (ILM) and (b) Non-Intrusive Load Monitoring (NILM). In ILM, i.e., a hardwarebased approach, power meters are attached behind each target appliance. The large number of hardware devices required for ILM makes the installation process difficult and costinefficient but results in very accurate power estimates. On the other hand, NILM is a software-based approach. It requires a single meter for the total aggregated power, thus the installation process is simplified and the corresponding cost is reduced. However, since there is no information about the aggregated power appliances, appropriate algorithms should be created to perform energy decomposition.

The utilities should perform a large-scale deployment to support thousands of consumers to benefit as much as possible from energy disaggregation services; only then it is possible to extract useful information for business models. This large-scale deployment makes NILM far more favorable than ILM due to the low cost, installation simplicity and minimum hardware requirements. However, in many cases, NILM algorithms present high computational complexity and significant memory requirements. In this sense, utilities should either use high-end smart meters—or extra hardware attached to them—with powerful central processing units (CPUs) and sufficient memory. Alternatively, energy disaggregation must be performed in cloud services. In the latter case, the cost of cloud services increases with the number of consumers. To this end, utilities must adopt scalable solutions. Scalability can be more critical even than disaggregation accuracy. As it is realized, low computational and memory requirements are necessary to run the service on the edge with conventional microprocessors or minimize the cost of needed cloud services. Furthermore, to improve user experience, minimum feedback must be required; thus, the necessity for pre-trained generic appliance models is of utmost importance.

Several approaches have been proposed to cope with the NILM problem [7,8]. It was first introduced by Hart [9]. Hart's approach was based on monitoring power changes (corresponding to the appliance turning-on/off events) of both active and reactive power signals. These power changes are grouped into clusters, with each cluster representing a state change of a target appliance. Since then, several works have investigated the NILM problem utilizing different sampling rates and techniques. Earlier approaches employed sampling rates lower than 1 Hz, where event detection (appliances turningon/off) is impractical and probabilistic models, such as variants of hidden Markov models (HMM) were examined [10–17]. HMMs yield promising results but present disadvantages, e.g., high computational complexity when the number of appliances increases and difficulty in classifying appliances that present similar power consumption [18]. Due to these disadvantages, researchers have turned to alternative methods, including machine learning and deep learning techniques [18–38]. NILM approaches can be generally categorized as event-based and state-based.

Event-based solutions [33–39] leverage the information-rich transient response of an appliance turning-on. Specifically, they consist of two modules: (a) an event detection algorithm for discovering power changes corresponding to an appliance turning-on and (b) a classifier for identifying the appliance that caused the power change. This approach is based on the fact that turn-on transient responses contain more information regarding the operating device than steady states. However, in order to obtain this transient state information, high-resolution data is vital [33–38]. One widespread event-based method is the V-I trajectory, utilizing high-resolution voltage and current measurements. In [37,38], useful features are extracted from the V-I trajectories and neural networks are trained for classification. Other researchers depict the trajectories as binary images [34–36]. This visual representation solves the appliance recognition problem by exploiting computer vision techniques. Furthermore, transfer learning techniques have been investigated, as in [36] where an image classifier has been implemented based on AlexNet [40]. An important advantage of event-based approaches is the low complexity; only a few time instants corresponding to on/off events are processed. Furthermore, such approaches can detect an appliance turn-on event in real-time since information only from the transient state is required. However, high-resolution data of several kHz is essential, applying mainly to detect appliance turn-on/off events, without calculating power consumption.

On the other hand, state-based approaches [19–27] mainly require lower frequency data. These approaches do not detect state transitions. On the contrary, they parse all available data of a time-series, even if no events occur. In such approaches, the appliance must operate for at least some minutes to determine if it is on [20,22]. There are even cases where the appliance end-use has to be fully completed to estimate the power consumption [19,24]. In [19], three different neural network architectures were presented, i.e., (a) long short-term memory (LSTM) networks, (b) stacked denoising autoencoders, and (c) a regression algorithm to forecast the start time, stop time and average power demand of devices. In [21], a bidirectional LSTM cell was used; in [26] a deep convolutional neural network (CNN) that uses as input a time window of active power consumption and predicts the active power in the center of the window. In [23], the authors feed their network with active, reactive, and apparent power and current data. Furthermore, they use mainly CNN blocks in order to create a recurrent property similar to LSTMs. Finally, in [24], an attention-based deep neural network is introduced, inspired by deep learning techniques used in Natural Language Processing (NLP). State-based approaches use low-resolution data and predict the power consumption per appliance. However, they present higher computational complexity since all available data are used, thus cannot detect in real-time an appliance being turned-on/off.

The scope of this paper is to present a real-time event-based NILM methodology to detect an appliance turn-on event and calculate its power consumption in real-time. The proposed NILM design is built on top of three main blocks, i.e., an event detector, a CNN classifier and a power estimation algorithm. The main strengths of the proposed NILM system rely on the following:


Generally, as it can be suggested from the above analysis, the proposed system constitutes a real-time scalable solution presenting minimum hardware requirements; thus, it can be integrated into low-cost chip-sets and, consequently, run on the edge.

The paper is structured as follows: In Section 2, the proposed methodology is presented. In Section 3, the dataset and the metrics used for evaluation are described. In Section 4, experimental validation results from real-life installations are analyzed and the performance of the system is compared to other state-of-the-art approaches. In Section 5, an industrial perspective regarding scalable real-time NILM services is discussed. Finally, Section 6 concludes the paper.

## **2. Proposed System**

The proposed methodology comprises of three main parts: (a) an event-detection system to find active power changes corresponding to turn-on events, (b) a CNN binary classifier to determine if the turn-on event was caused by a specific target appliance or not, and (c) a power estimation algorithm to calculate in real-time the appliance power per second and consequently the energy consumption. An overview of the system in flowchart form is illustrated in Figure 1.

**Figure 1.** Proposed system flowchart.

## *2.1. Event Detection*

The event detection algorithm is used to identify the time instant (trigger time) when a sudden increase of active power occurs, indicating a possible turn-on event. The advantages of the proposed event detection algorithm are its simplicity and the fact that no pre-training is required.

Let us assume that the aggregated active power time-series at 100 Hz is *P*. The original signal *P* is down-sampled at 1 Hz by means of averaging, resulting into signal *P*d. Downsampling is applied for two main reasons: (a) the event detection algorithm becomes simpler, presenting less computational burden and (b) most of power changes are still easily identifiable assuming an 1 Hz sampling frequency. However, if two or more events occur almost simultaneously, e.g., in a period of less than a second, the algorithm detects these events as a single one. Considering that the probability of this scenario is very low, the frequency of 1 Hz has been selected. Next, the maximum power difference (*MPD*) for each second *n* is calculated as:

$$MPD(n) = \max(P\_{\rm{d}}(n+1), P\_{\rm{d}}(n+2), P\_{\rm{d}}(n+3)) - \min(P\_{\rm{d}}(n-3), P\_{\rm{d}}(n-2), P\_{\rm{d}}(n-1)).\tag{1}$$

MPD shows the maximum difference in active power in a region around *n*, i.e., the maximum power during the first three seconds after *n*, minus the minimum power of the three first seconds before *n*. In this sense, the transient onset can be accurately determined since the real power increase may not appear immediately, but some seconds after *n*. To determine the trigger time candidates, *MPD* is compared with a threshold, *P*th, which is determined in terms of the appliance rating power. This means that, at time instant *n* an event occurs if

$$MPD(n) > P\_{\text{th}}.\tag{2}$$

At this point, it should be mentioned that trigger time candidates close in time are merged. For each trigger time, a 6 s window of the captured transient response, *P*tr, is

generated from *P* (100 × 6 = 600 samples). The pseudo-code for the process described is presented in Algorithm 1.

**Algorithm 1:** Event detection.

```
Input: P, Pth
Output: list of captured transient responses
Pd = P down-sampled at 1 Hz;
Initialize an empty list L;
Initialize an empty list transients;
for each second n do
   max_after = max(Pd(n + 1), Pd(n + 2), Pd(n + 3));
   min_before = min(Pd(n−3), Pd(n−2), Pd(n−1));
   MPD = max_after − min_before;
   if MPD ≥ Pth then
       Append n to L;
   end
end
Merge consecutive seconds in L;
for t in L do
   Ptr = P(t − 300:t + 299);
   Append Ptr to transients;
end
returntransients;
```