**1. Introduction**

The Non-Intrusive Appliance Load Monitoring (NIALM or NILM) [1] is a solution for the problem of collecting electrical energy consumption data more accurately than using only typical electricity meters. The methodology (also known as energy disaggregation [2]) is used for power systems analysis, in which demand for energy continuously increases. The purpose of the appliances' load identification is to provide information about the energy consumption of individual devices. This may lead to a decrease in electricity consumption and suppressing environmental pollution [3]. According to [4] the application of NIALM approaches might lead to a reduction of household energy consumption by at least 12%. Another potential application is the diagnostics of electrical appliances [5], like monitoring device degradation or detecting supply network's state in the presence of external disturbances, like voltage spikes, insulation decrease, etc. In the NILM architecture, measurements are done close to the energy meter, in contrast to intrusive systems where every socket or device is equipped with a suitable sensor [6]. When new appliances are plugged into such systems, the measurement hardware is not expanded. Acquired values are typically aggregated currents and voltages [7]. Characteristic features allowing for the identification of a particular Electrical Appliance (EA) are obtained individually during traininginthespecificdeploymentlocation.

Over the past 20 years, the topic was widely explored [7–11]. Public databases were prepared to allow for the verification of new approaches [12–14]. The main achievements are summarized, for instance, in [15].

The taxonomy of NILM methods considers multiple criteria. Firstly, they can be classified based on the frequency of the measured signals [7,8]. In [16] four types of frequency-based methods were identified: LF (Low Frequency), MF (Medium Frequency), HF (High Frequency), and EHF (Extra-High Frequency). The first one exploits the RMS of the current and voltage waveform or the amplitude of its first harmonic collected with the sampling frequency from below one to several Hz. The MF approach processes signal samples collected with a frequency from 1 kHz to dozens of kHz. The HF method operates on transients collected with a sampling frequency from dozens of kHz to several dozens of MHz. Finally, EHF methods operate on sampling frequencies above a dozen of MHz. The latter group was not investigated so far.

The second taxonomy criterion [10,11], is the moment of the appliance analysis. These can be steady-state (SS) or transient state (TS), depending on whether the waveforms are sampled during the state change or after it is already done and no transients are present in the signals. The SS-LF methods are currently the most popular because of the low cost of sensors [17] and the simple mathematical apparatus required to process data with low computational power requirements [18].

The frequency of the measured signals determines features characterizing the analyzed devices. For SS-LF methods the most commonly used parameters are the average power [19–24], reactive power [25,26], and power factor [19]. The SS-MF methods work with the amplitude [27] and phase [28] of the subsequent current harmonics. Power characteristics may be considered as well [3]. The real and imaginary parts of the current odd harmonics were used in [29]. In SS-HF approaches, disturbances not being harmonics of the fundamental component of the power grid (i.e., 50 Hz or 60 Hz) are analyzed. For example, it can be EMI noise specific for different electronic appliances [30].

Some electrical devices, when turned on, generate a short-term current pulse with an amplitude significantly exceeding their nominal supply current [31]. These transients can be used to identify the EA state [32]. Approaches using such features belong to the TS-HF group. In [32], the fundamental voltage component was filtered, from which the frequency components of the disturbances appearing at the moment of switching on the device were extracted. In [33], voltage harmonics were eliminated using Notch filters, and then the signal was analyzed using Wavelet Transform (WT). In [34] the current of devices in the transient states was recorded with the 100 kHz sampling frequency. The model of the transient state was created on the basis of the currents collected when turning the EA on. The energy spectra calculated using WT were used in [34]. Next, the energy distribution in the subbands was used to identify appliances.

The areas of HF and EHF methods, although more challenging, especially from the data acquisition point of view, rely on phenomena that cannot be observed at lower sampling rates. These give possibilities of distinguishing between different appliances, as is shown in this paper.

During our previous research [35], it was discovered that parameters of electrical signals related to the operation of a particular EA depend on other devices operating in the network at the same time. As a result, the set of devices working in the background determines features extracted from the waveforms. Such a phenomenon can be used to identify states of individual EAs.

To verify the practical application of the presented phenomenon, the HF-GEN method was developed. It includes a measurement system acquiring the supply current signal, complemented by the known impulse signal generator. To detect changes in the impulse parameters it is necessary to use the time-frequency analysis, which allows for comparing impulse signals generated when different loads are switched on. The paper also presents the data processing method used for EAs identification, based on cross-correlation of the reference signal with the analyzed signal.

The outline of the paper is as follows. Section 2 presents the method of determining the characteristics of EA. Section 3 contains the quality assessment method. Section 4 covers experimental results, while Section 5 holds conclusions and future prospects.

#### **2. HF-GEN Method for Determining the Characteristics of EA**

Known methods exploiting the analysis of the transient currents and voltages during the appliance's state change are still a minority. Most EA identification algorithms rely on the characteristic features determined in steady states of operation. The transient signal is a result of changing the state of the device (for instance, by turning it on). Electrical signals recorded at the moment of the transient state change must be analyzed. The key to detecting the EA state change is to find proper features of the impulse signal. They should clearly distinguish impulse signals appearing as a result of changes in the states of various EAs. Two problems emerge that significantly limit the applicability of such approaches. First, EAs are switched on with a random voltage phase, so the transient states of the examined EAs also have the random voltage phase. Secondly, EAs in the background influence parameters of the transient signals. Both factors affect the shape of the analyzed impulse and make assigning the specific transient to a device difficult.

In the HF-GEN method, the generated current pulse signal is introduced into the tested power network circuit. The analyzed impulse is therefore the effect of a deliberately created transition state, not related to any EA. The pulse is generated many times at regular intervals. When the EA state changes, the pulse shape also changes, because it is characteristic of the particular EA. Detection of the EA state change consists of observing corresponding changes in the pulse features, which form the EA signature. The latter should unequivocally identify the specific EA. The principle of the HF-GEN method is illustrated in Figure 1. The pulse shape changes between the appliance's "on" and "off" states.

**Figure 1.** Illustration of the HF-GEN method.

The following were the experiments' assumptions:


•the maximum frequency of measured signals is 15 MHz.

The purpose is to find changes in the pulse signal caused by the load change in the supply circuit. The load on the power circuit depends on the set of EAs connected to it. Characteristics of the impulse signal are related to the specific EA, therefore enabling identification of the moment when the particular device is turned on. The block diagram of the HF-GEN method is shown in Figure 2. The first step is the generation of the impulse signal. The generator detects the supply voltage phase and then inputs the pulse signal to the LV (Low-Voltage) circuit. In the second step, the pulse current is measured with the sampling frequency of 30 MS/s. The acquired samples are processed to select their subset acquired during 4 ms after the pulse detection. Next, cross-correlations between the samples' vector and transients patterns stored in the dictionary are calculated. A signature

characterizing the pulse signal is then prepared. Finally, the signature quality is determined. Subsequent steps are presented in detail in the sections below.

**Figure 2.** Block diagram of the HF-GEN method.

#### *2.1. Pulse Signal Generation*

The block diagram of the pulse signal generator with two connectors/ports is shown in Figure 3. The first one, the input and output port (I/O), is connected to the tested circuit of the power network with a voltage of 230 V and a frequency of 50 Hz. This port is marked as input (I) because it is used to supply the generator with voltage. It is also treated as the output port (O), because of providing the impulse current signal to the power network. The O-SYN port is used to ge<sup>t</sup> the synchronization signal outside the generator. It determines time instances of the pulse signal generation. The synchronization output is used to control the acquisition system. When designing the generator, the following parameters were assumed:


The pulse signal generator consists of a matching circuit (MC-GEN), an Analog-to-Digital converter (AD-GEN), a Digital Output (DO), a Relay (RE), and an Attached Load (AL). The measurement and generation system is connected to a computer (PC-GEN) on which the Control Software (CS) is running.

The pulse amplitude depends primarily on the voltage phase in which the Attached Load (AL) is connected to the power grid. The pulse amplitude is proportional to the voltage value at the moment of turning the AL on. Setting the constant voltage phase (the same each time) is the biggest challenge. The time instant must be synchronized with the phase of the supply voltage. The process is as follows: the main voltage*u*(*t*) is applied to the MC-GEN, which converts the voltage*u*(*t*) into the voltage*<sup>u</sup>*AD−GEN(*t*) whose amplitude matches the dynamic range of the AD-GEN input. The AD-GEN converts voltage*<sup>u</sup>*AD−GEN(*t*) to samples*un* with a speed of 250 kS/s. Based on the voltage samples*un*, the CS detects the supply voltage phase. As a result of its operation, the logic signal*on* is given to the input of DO, assuming a high value when the impulse signal is generated. DO converts the logic signal*on* to the voltage*<sup>u</sup>*SYN(*t*). The O-SYN synchronization output is

triggered at the right moment by a high voltage level. The main function of the RE is to apply the supply voltage to AL when a high voltage level appears at*u*SYN(*t*).

**Figure 3.** Block diagram of the pulse signal generator.

The pulse shape parameters are determined by the AL. The rise time of the pulse and its total duration depends on the AL impedance. Contrary to the tested EA, AL is a known load with a specific transmittance, temporarily connected to the supply network to change the parameters of the network. In practice, any appliance approved for use in the LV grid, for example, an energy-saving light bulb, can be used as AL. In such a situation, the pulse generator is no different than other appliances in the network. It is a typical load, connected to the network at specified intervals (e.g., 1 s) for a specific time (e.g., 40 ms).

## *2.2. Measurement Method*

In the HF-GEN method, the measured signal is the impulse in the current introduced to the tested circuit by the signal generator. The parameters of the signal change with the load of the tested network after introducing the specific EA. This fact is used to detect the change in the EA state.

The measurement system from Figure 4 consists of a transient generator (GEN), an electrical appliance energy receiver (EA), a Current-Voltage Converter (CVC), an Acquisition Card (AC), a computer (PC), software (SW), and memory (MM). The tested EA and GEN are powered from the network with an RMS voltage of 230 V and frequency of 50 Hz.

The supply network voltage*u*(*t*) is provided to GEN through the I/O terminals connected to the phase conductor L1 and the neutral conductor N. The synchronization voltage*<sup>u</sup>*SYN(*t*) is supplied from the synchronization output O-SYN of GEN to the synchronization input of the Analog-to-Digital Converter. High levels of*<sup>u</sup>*SYN(*t*) determine time instants for pulse generation. The current*<sup>i</sup>*(*t*) is converted by the CVC into*<sup>u</sup>*AD(*t*) voltage with a level adjusted to the dynamic range of the analog input of the acquisition card (AC) converter, providing samples*in*.

The voltage*<sup>u</sup>*SYN(*t*) also triggers the acquisition of current samples when a pulse is generated. The SW running on PC controls the AC operation and collects the current samples*in* storing them in MM for further analysis. Due to triggering the AC converter acquisition, the amount of data for processing is significantly reduced.

**Figure 4.** Diagram of the measuring system of the HF-GEN method.

#### *2.3. Selection of Current Samples*

The result of data acquisition is the current vector*i* = [*i*1 ... *iN*] (see Figure 5). It contains current samples recorded around (before and after) the pulse manifestation.

**Figure 5.** The sampled current vector *i*.

Due to the effectiveness of further calculations, only a selected fragment of the current vector is analyzed. This is because some fragments of the obtained current data do not contain useful information. Specifically, the current vector contains data measured prior to generating the current pulse (e.g., current vector samples from 1 to 125,000 in Figure 5). The data in this fragment of the current vector bear no information characteristic for the tested EA.

The most relevant is the fragment of the current vector near the largest pulse peak. Therefore only part of the original vector (i.e.,*i*SEL) is extracted for analysis. The vector*i* is filtered by the high-pass filter with a cut-off frequency of 1 kHz, which enables effective suppression of the 50 Hz component and its harmonics (100 Hz, 150 Hz, and so on). Then, the maximum of the high-frequency components (i.e., above 10 kHz) is found. The vector*i*SEL contains 2700 selected samples around the maximum of the high-frequency components. Figure 6 shows example of the*i*SEL vector.

**Figure 6.** Current vector*i*SEL for sample measurement data.

#### *2.4. Preparation of a Dictionary of Transients*

The dictionary of transients *D* is a set of selected fragments of the current vectors containing pulses for various appliances:

$$D = \left\{ \mathbf{i}\_{\text{DIC}}^{(1)} \, \mathbf{i}\_{\text{DIC}}^{(2)} \, \dots \, \mathbf{i}\_{\text{DIC}}^{(l\_{\text{D}})} \dots \mathbf{i}\_{\text{DIC}}^{(l\_{\text{D}})} \, \dots \, \mathbf{i}\_{\text{DIC}}^{(LDIC)} \right\},\tag{1}$$

where*i*(*l*D) DIC are the most interesting fragments of vectors *i* describing the pulse and*LDIC* is the number of examples. Figure 7 shows the method of preparing the dictionary. Samples from vector*i* are selected as in Section 2.3. Then, the initial and terminal indexes of the transition are marked, leading to the structure presented below.

**Figure 7.** Preparation of dictionary of transients.

The marking process is performed by specifying the initial*<sup>n</sup>*START and terminal*<sup>n</sup>*STOP indexes. The fragment*i*DIC is then extracted as follows:

$$\mathbf{i}\_{\text{DDC}} = \begin{bmatrix} i\_{\text{DDC},1} \dots i\_{\text{DDC},N\_{\text{DDC}}} \end{bmatrix} = \begin{Bmatrix} i\_{\text{SEL},\text{J}\_{\text{SILKT}}} \ i\_{\text{SEL},\text{J}\_{\text{SILKT}}+1} \dots \ i\_{\text{SEL},\text{J}\_{\text{SCIGP}}-1} \ i\_{\text{SEL},\text{J}\_{\text{SCIGP}}} \end{Bmatrix}, \tag{2}$$

where*N*DIC = *n*STOP − *n*START + 1 denotes the number of samples in*i*DIC.

Figure 8 shows the example of*i*SEL with the marked indices*<sup>n</sup>*START and*<sup>n</sup>*STOP (**a**) and the extracted*i*DIC (**b**).

**Figure 8.** Current vectors for the sample measurement data:*i*SEL (**a**) and*i*DIC (**b**).

For each considered EA, 10 examples of transition states were added to the dictionary. They differ in amplitude and shape. The selected number is the compromise between the variety of stored data and the computational effort required to obtain examples. An example is a current vector and corresponding category from the set*D*CAT (which cardinality determines the number of identified appliances *NEA*). Therefore, the number of vectors*i*DIC in the dictionary is*LDIC* = 10·*N*EA.

#### *2.5. Determining the Cross-Correlation*

In this stage, the maximum correlation between the measured signal*i*SEL and subsequent dictionary entries*i*DIC is found. The vector*i*SEL is longer than the current vector from the dictionary*i*DIC, so the correlation is calculated for all possible shifts between*i*DIC and*i*SEL.

The vector*i*SEL has*N*SEL = 120, 000 samples (representing the duration of 4 ms for sampling frequency *fS* = 30 MHz). The correlation will be determined many times for each transition state. Therefore, the method of determining the cross-correlation should be computationally efficient. The determination of the cross-correlation without normalization was considered due to the simplicity and efficiency of calculations. In the discussed problem, the cross-correlation without normalization cannot be used, because the elements of current vectors mainly contain a fundamental component of the current signal with a frequency of 50 Hz. On the other hand, pattern vectors only contain components with frequencies at least 200 times greater than the fundamental component. The 50 Hz frequency component significantly changes the average value of the current vector, and as a result, significantly affects the value of cross-correlation without the normalization. The measure of similarity between sample vectors based on the Pearson correlation coefficient was used. The mean and standard deviation for each fragment of the vector*i*SEL was calculated, which requires significant computational effort. Therefore, the optimized calculation method [36] was used.

As a result, vectors of correlations *r* and shifts*c* were obtained. Figures 9–11 illustrate the procedure.

**Figure 9.** Determining the correlation for sample measurement data, delay c = 18,000.

**Figure 10.** Determining the correlation for sample measurement data, delay c = 21,160.

**Figure 11.** Determining the correlation for sample measurement data, delay c = 22,000.

Figure 12a shows the cross-correlation vector*r* as a function of delay*c* for the example of measurement data. Figure 12b shows the same relationship for the vector fragment*r* with the highest correlation values.

**Figure 12.** Cross-correlation as a function of delay for an example of the measurement data; the whole correlation vector (**a**); the fragment of the vector*r* that contains the highest correlation values (**b**).

## *2.6. Signature Calculation*

The signature parameters are the maximum cross-correlation determined between the current vector*i*SEL and all current vectors*i*(*l*D) DIC from the dictionary of transients. Correlation vectors for successive current vectors*i*(*l*D) DIC are denoted as**r***l*D . The set of categories*D*CAT from the dictionary of transitions is used to name successive signature features. The idea is presented in Figure 13.

The EA signature contains maximum values of the cross-correlation between the analyzed current vector and the individual dictionary elements. Signature features are determined as the maximum absolute value of the cross-correlation*<sup>r</sup>l*D between the analyzed current vector*i*SEL and the stored current vector*i*(*l*D) DIC:

$$\text{COR}\\_x\\_y = \max |\mathbf{r}\_{\text{lp}}|\_\text{\textdegree} \tag{3}$$

where*x* ∈ {1, . . . , *<sup>N</sup>*EA}, *y* ∈ {A, B, C, D, E, F, G, H, I, J}.

The computed cross-correlation with the marked maximum value for sample measurement data are presented in Figure 14.

A signature**<sup>s</sup>***l* consists of*P*HF−COR = 10·*N*EA features, arranged in a specific order. Names of features and their acronyms are listed in Table 1.

$$\mathbf{s}\_{l} = \begin{bmatrix} s\_{l,1} \dots s\_{l,p} \dots s\_{l,P\_{\text{HF}\dots\text{COR}}} \end{bmatrix}^T. \tag{4}$$

**Figure 13.** Signature determination algorithm for the HF-COR method.

**Figure 14.** The absolute value of cross-correlation with the maximum value marked for example measurement data.



Signature vectors for individual transient states constitute successive columns of the signature array*S*:

$$\mathbf{S} = [\mathbf{s}\_1 \dots \mathbf{s}\_l \dots \mathbf{s}\_{LSP}],\tag{5}$$

where*LSP* is the total number of transients processed.

#### **3. Signature Quality Assessment Method**

The signature well describes devices if its features allow for distinguishing between them. Feature vectors for the same appliance should be similar to each other. The purpose of the signatures quality assessment is to verify if they can be used to identify appliances.

The process is presented in Figure 15. Division of available data into training and testing sets is important. The *K*-fold Cross-Validation (CV) with*K* = 10 was used here. The data set is split *K* times into training and testing subsets (with the ratio of 9:1) in such a way that each EA is represented by the single signature in the testing set. The training sets were used to extract knowledge for the intelligent classifier, while the testing ones were applied to verify their generalization abilities. The classification accuracy was averaged on all trials.

**Figure 15.** Block diagram of the signature quality assessment method.

The classifier processes signatures*S*(*k*) test to predict appliance identifiers (represented by category estimates*y*<sup>ˆ</sup>(*k*) test). The latter are compared to actual categories*y*(*k*) test so sample errors can be calculated. Among many types of candidates for classifiers, the following were selected:


For each round of the CV, each classifier is trained and tested separately (see Figure 16). This way all approaches can be compared. Also, their fusion may be applied if necessary. Each algorithm has specific advantages and hyperparameters. For instance, DT during training selects features based on which rules are constructed. This is the problem for kNN, where the subset of signature values must be manually selected or weighted. Also, the number of neighbors influences diagnostic accuracy. One CV round produces four vectors:

• actual appliances identifiers in the testing set—*y*(*k*) test,


**Figure 16.** Detailed diagram of one cross-validation attempt.

## *3.1. Decision Tree*

The DT is a tool storing knowledge in the form of a tree (Figure 17). Nodes indicated by circles represent tests on the selected feature (in our case, one of the signature parameters) and its threshold value (like *x*1 > 15). The result of the test redirects the analyzed vector of features to the node one level below until the terminal node (leaf) is reached. The leaves (rectangles) represent appliance categories. Classification of the example is then based on exploring the tree from the root (yellow node) to one of the leaves. Tests performed at each node indicate which way to take next. Generation of the DT is done using one of the machine learning algorithms like C4.5 or CART, which differ in the method of selecting tests for nodes.

**Figure 17.** Decision tree example.

## *3.2. Neural Network*

The ANN is widely used in classification. The feed-forward structures, like multilayered perceptrons or RBF networks, are the most popular. Their hyperparameters include the number of hidden layers or the number of neurons in them*<sup>s</sup>*HL. Also, the output layer category coding is important, depending on the activation functions (like sigmoidal ones or softmax). The optimal structure of ANN is then found to maximize the classification accuracy for the minimum number of neurons. Knowledge extraction is performed using gradient-based algorithms.
