*3.4. Classification Accuracy*

The standard method of evaluating the classifier in the multi-category identification problem is the confusion matrix. To determine the overall quality, the accuracy should be calculated as the number of correctly identified examples from the testing set. This can be done for each category*<sup>n</sup>*EA separately:

$$\eta\_{\rm mEA} = \frac{|LSP\_{\rm EA} : y = \hat{y}|}{|LSP\_{\rm EA}|} \tag{7}$$

or on the whole set (of*N*EA categories):

$$\eta\_{\rm ALL} = \frac{1}{N\_{\rm EA}} \cdot \frac{|LSP: y = \mathcal{Y}|}{|LSP|} \tag{8}$$

#### **4. Experimental Results**

The following section discusses details of experiments, including the laboratory test stand, collected data, and classification results.

The HF-GEN method was tested in the laboratory conditions on a fixed set of 15 appliances. For each of them, 150 current pulses were recorded. From the vector*i* in the transient state*l* a signature vector*sl* was obtained. The signature set*S* contains all*LSP* signature vectors.

The used EAs included a vacuum cleaner, a slow juicer, an "Osram" light bulb, the "Philips" light bulb, an "Omega" light bulb, a "Lexman" lamp with four bulbs, a laptop, irons, sharpeners, grinders, kettle, jigsaw, coffee machine, air conditioner and planer.

#### *4.1. Laboratory Test Stand*

The measurement system consists of the single analyzed electrical appliance (EA), a current-voltage converter of the SCT-013-020 (CVC) type, the Advantech PCIE-1744 data acquisition card (AC), signal generator (GEN), and computer (PC) with the LabVIEW-based virtual instrument (SW) installed. The EA was connected to the power network. The CVC was installed on the L1 cable supplying EA through the resistor*R* = 47 Ω. The GEN input-output (I/O) connectors were connected to L1 and N power cables. The AC was configured in such a way that the high level of the sync voltage*<sup>u</sup>*SYN(*t*) applied to the synchronization input would trigger the acquisition of the signal*<sup>u</sup>*AD(*t*) fed to an analog input. The signal*<sup>u</sup>*AC(*t*) was recorded for 10 ms since the occurrence of the high level of synchronization voltage*<sup>u</sup>*SYN(*t*). The AC sampling rate was 30 MS/s. The data stream*in* containing the samples was captured by a SW running on a PC and saved in the \*.tdms file format.

The pulse signal generator consisted of AL, i.e., a lamp with an "Osram" LED bulb, (type AB30526) and a "Relpol" relay (type RM699V-3011-85-1005-RE), voltage transformer (MC-GEN), Advantech PCIE-1816H acquisition card containing an analog-to-digital converter (AD-GEN) and digital output (DO) and a computer (PC-GEN) running the virtual instrument (CS). AL was connected to the supply network via the RE relay, while MC-GEN— to the supply network via the L1 and N conductors. The CVC of the type SCT-013-020 type converts voltage*u*(*t*) to*u*AD−GEN(*t*). Its measuring range is about 120A. Laboratory tests proved that SCT-013-020 allows for accurate measurements of signals with frequency up to 400 kHz which is enough for the presented HF-GEN method. The voltage*<sup>u</sup>*AD−GEN(*t*) was fed to the analog input no 0 (AD-GEN) of the acquisition card.

AD-GEN samples voltage*<sup>u</sup>*AD−GEN(*t*) at 250 kS/s. Based on them, CS detects the voltage phase by actuating a logic signal*on*. The AL is switched on when the voltage*u*(*t*) reaches the value of300 V. DO converts logic signal*on* to voltage*<sup>u</sup>*SYN(*t*). The RE becomes closed when the high state appears on*u*SYN(*t*).

## *4.2. Measurement Procedure*

During experiments, the following measurement procedure was implemented:


These steps are performed for each tested EA. A separate series of measurements is carried out with no EA connected (only steps 2–4 are then taken).

#### *4.3. Analysis of Measured Current Vectors*

As a result of measurements for 16 categories (15 types of EA and no-EA),150 × 16 = 2400 vectors of current samples were collected. Details of the recorded vectors are in Table 2. Each current vector*i* has 300,000 samples (representing duration of 10 ms).


#### **Table 2.** Information on recorded current vectors.

The current vectors were selected according to Section 2.3. The result were current vectors*i*SEL which length of*N*SEL = 120,000 (duration of 4 ms). The vectors*i*(*l*) SEL for selected examples*l* are in Figures 18 and 19.

**Figure 18.** Current vector*i*(*l*) SEL for selected examples*l* belonging to categories 0–7.*l* = 1: No EA (**a**),*l* = 151: vacuum cleaner (**b**),*l* = 301: slow juicer (**c**),*l* = 451: lamp with bulb "Osram" (**d**),*l* = 601: lamp with bulb "Philips" (**e**),*l* = 751: lamp with bulb "Omega" (**f**),*l* = 901: wall lamp with four bulbs "Lexman" (**g**),*l* = 1051: laptop (**h**).

**Figure 19.** Current vector*i*(*l*) SEL for selected examples*l* belonging to categories 8–15.*l* = 1201: iron (**a**),*l* = 1351: sharpener (**b**),*l* = 1501: grinder (**c**),*l* = 1651: kettle (**d**),*l* = 1801: jigsaw (**e**),*l* = 1951: coffee machine (**f**),*l* = 2101: air conditioner (**g**),*l* = 2251: planer (**h**).

The average current value*i* (*l*) SEL depends on the analyzed EA. For instance, examples*l* ∈ {151, 1201, 1651, 2251} representing vacuum cleaner, iron, kettle, and planer are characterized by relatively high power. The pulses are generated for the voltage*u* = 300 V when the instantaneous current levels of EAs are close to the maximum value. Therefore, a high average current value is observed here.

The direction of the pulse current is always the same. It results from forcing the voltage phase at the moment of generating the pulse.

All waveforms presented in Figures 18 and 19 are characterized by a rise in the average current value starting approx. at*n*SEL = 30,000. In turn, for the*<sup>n</sup>*SEL = 34,000 ... 50,000 current values drop until reaching the level as before the pulse appearance.

For examples*l* ∈ {1, 1201, <sup>1501</sup>}, the multiple contact of the RE is visible in the form of many similar oscillations which quickly converge to the average current value*i* (*l*) SEL. For category 0 (no EA), this oscillation is visible for the*<sup>n</sup>*SEL = 29, 400, while for category 8 (iron) it is for*<sup>n</sup>*SEL = 30,000, and for category 10 (grinder), 4 such oscillations are visible for*<sup>n</sup>*SEL ∈ { 28,800, 29,500, 30,000, 30,500 }.

The starting point for further analysis is the current vector obtained for category 0 when no EA is connected. The shape of the pulse for the example*l* = 1 (Figure 18a) is the impulse response of AL after switching on the supply voltage. All other current vectors are the impulse response of the system in which two electricity receivers are simultaneously connected to the power supply: AL and the tested EA. The change in the shape of the current waveform*i* (*l*) SEL is proportional to the influence of the tested EA on the total impedance of these two parallelly connected loads in the supply network.

Examples*l* ∈ {751, 901, <sup>1051</sup>}, i.e., lamp with bulb "Omega", wall lamp with four bulbs "Lexman" and kettle are similar to the example*l* = 1. Examples*l* = 451 (lamp with bulb "Osram") and*l* = 601 (lamp with bulb "Philips") are distinguished by the lack of the minimum of the 2A-amplitude instantaneous current for*<sup>n</sup>*SEL = 30,300.

The example*l* = 1951 recorded for the coffee machine has a characteristic shape, especially in the area*n*SEL = 30, 000 ... 31, 000, where rapid changes in the instantaneous current values are visible, and the characteristic for many other examples of quasi-periodic oscillations cannot be found.

A vacuum cleaner(*l* = <sup>151</sup>), slow juicer(*l* = <sup>301</sup>), jigsaw(*l* = <sup>1801</sup>), and planer(*l* = 2251) reduce the frequency of current oscillations, and increase the number of visible oscillations, which is unique for each EA. Specifically, for example*l* = 151, five oscillations have period of approximately 940 samples corresponding to a frequency of 31.9 kHz. For the example*l* = 301(slow juicer), four periods exist (923 samples each) which corresponds to a frequency of 32.5 kHz. For the example*l* = 1801 (jigsaw), five periods of 500 samples correspond to a frequency of 60 kHz. For the example*l* = 2251 (planer), there are six periods, each 610 samples long, which corresponds to a frequency of 49.2 kHz. All these categories have motors, which may shape the current pulse.

#### *4.4. Dictionary of Transients*

The measurement data for the transient dictionary does not coincide with the measurement data used to train and test the classification algorithms. The set of measurement data used in the transient state dictionary was prepared independently of the data set described in Section 4.3. Selection of current vectors for the dictionary does not disturb the obtained classification results.

To prepare the dictionary of transients, the procedure presented in Section 2.4 was used. For each of sixteen categories, 10 examples of transient current*i* were collected, from which current vectors*i*SEL were obtained. The resulting dictionary of transients is presented in Table 3. The most important fragments of current vectors*i* (*l*D) DIC for selected categories are in Figures 20–23.


**Figure 21.** Current vectors**i**DIC for the vacuum cleaner(*x* = <sup>1</sup>).

**Figure 22.** Current vectors*i*DIC for the dictionary elements for the category lamp with a bulb "Osram"(*x* = <sup>3</sup>).

**Figure 23.** Current vectors*i*DIC for dictionary elements for the planer category (x = 15).

Despite ensuring similar conditions for generating impulses, the current vectors*i*DIC for the no-EA category (Figure 20) differ from each other. The first difference between examples is the multiple contact phenomenon described in Section 4.3, visible for the examples*l*D ∈ {5, 6, <sup>10</sup>}.

In all waveforms, a quasi-periodic oscillation is present, disappearing after about three periods. A characteristic of these vectors is a rising edge on which the oscillation is located. In the example*l*D = 7, the slope is visible for*<sup>n</sup>*DIC = 1 ... 2000. The rising edge is a characteristic feature of applied AL.

For dictionary examples representing the vacuum cleaner (Figure 21), three types of waveforms can be distinguished. They differ mainly in the shape of the initial part of the vector*i*DIC (*<sup>n</sup>*DIC = 1 ... 1000). The first type is present in examples*l*D = 11 and*l*D = 19. The second type is visible in examples*l*D ∈ {14, 15, <sup>18</sup>}, while the third one—in examples*l*D ∈ {12, 13, 16, 17, <sup>20</sup>}. The oscillation frequency in the second part of the vector*i*DIC is lower than in the no EA case (category 0 in Figure 20). Duration of the oscillation between samples*<sup>n</sup>*DIC = 1000 and*<sup>n</sup>*DIC = 4000 is the same for all vectors in this category with period of about 940 samples, which corresponds to a frequency of 31.9 kHz.

Waveforms in Figure 22 represent lamps with the "Osram" bulb. Here, the multiplecontact phenomenon of the relay is visible, especially for the example*l*D = 40, where four similar oscillations are present in the first part of the current vector.

Vectors for the planer (Figure 23) are different from other appliances, and at the same time, they are similar to each other. Their distinguishing feature is the shape of the first part of the vector*i*DIC(*<sup>n</sup>*DIC = 1 . . . <sup>300</sup>). Here examples*l*D ∈ {151, 153, 154, 155} have one maximum above the slope of the oscillation. It is present around the sample*<sup>n</sup>*DIC = 100. Examples*l*D ∈ {152, 156, 157, 158, 159, 160} have two visible maxima, one for*<sup>n</sup>*DIC = 90 and the other one at*n*DIC = 190. In all examples for the planer, at least five periods of oscillation with a period of about 610 samples are present, corresponding to a frequency of about 49.2 kHz.
