**4. Experimental development**

Next, the steps executed for the experimental development are highlighted:

#### **4.1 Data set**

For this study, a method of multivariate statistics and computational intelligence is designed and implemented, with the objective of identifying electrical appliances connected to the residential electrical network. For this experiment, the proposed system was first installed in 20 homes in Santiago de Chile. Each home has ILM measurement and communication equipment, installed in each electrical outlet in the home. The electrical profiles of household appliances were built and studied based on data from multiple brands and models present in the homes of collaborators in this research.

To obtain electrical consumption data, the operation was measured through an intrusive charging system by means of a low-resolution AMR, which recorded the behavior of the appliance in terms of active power consumed in multiple operating conditions (low, low, medium, and high-performance). Between 50 and 80 samples of each of the variables were obtained for each measured device: kettle, refrigerator, electric oven, microwave, heater, washing machine, and electric grill, among others. The intrusive charging system recorded a sample of electrical consumption measurement in active power, every 10 seconds, and the behavior was measured during 5 minutes of operation, that is, 10 (s), 40 (s), 80 (s), until 300 (s). However, only the first 220 (s) in the ANN training model dataset were used, thus building a data matrix of 11 features, where each one represents an input for the ANN model. It is important to highlight that measurements were made in 20 homes, during 90 days between July 29 and October 30, the spring season. However, a log of 300 (s) is enough to train and recognize artifact profiles. These data were matrix preprocessed but did not require filtering due to the low presence of additive noise.

The measurements are made in 22 devices, of which 9 are shown in the final results of this article, and 6 of these, the most typically used in homes, are used to carry out the ANN training. **Figure 4** shows the characteristic behavior of each of the 6 devices based on the active power demanded during 3 minutes of operation.

Although the energy behavior in a global way tends to be complex to visualize, if the curves are separated intuitively, it can be seen that some devices have similar behaviors in relation to the power demanded, as is the case of the kettle, the heater, and the electric oven (**Figure 5**).

These three electrical appliances incorporate resistive elements in their electrical components, which basically describe their main function of generating heat through electrical energy. However, once a maximum temperature is reached, the kettle stops

**Figure 4.** *Consumption profile of each device.*

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*

**Figure 5.** *Active power demanded in an electric kettle, heater, and oven.*

#### **Figure 6.** *Active power profile in a refrigerator.*

working, unlike other appliances that work under temperature ranges, activating and deactivating its operation for a period.

On the other hand, the consumption curve of a refrigerator, as shown in **Figure 6**, is very characteristic and is not like any other curve studied.

These elements that are capable of being visualized and differentiated intuitively are the ones that are sought to be measured and parameterized through the use of machine learning (ML) techniques, to detect and predict the electrical artifact measured according to its electrical behavior as a function of time. of use.

**Figure 7** shows the behaviors recorded for the microwave and washing machine equipment during the time intervals. For both, a similar work cycle is observed and that generates some complications in their identification.

**Figure 7.** *Microwave and washing machine active power consumption pattern.*

### **4.2 Security and architecture**

Any device and architecture that is exposed to the Internet has a potential risk of intrusion and/or data theft. In the architecture designed for this experiment, the devices send telemetry information to a cloud server, which processes the data, analyzes it, and publishes it on an analytical platform. There are different intrusion scenarios that were considered for the construction of the architecture:


As a first measure of control and related to the world of IOT, it is necessary that all communications are secure and encrypted at all times, from the Smart Socket report to the publication of analytics. The devices use a Wi-Fi connection and are configured to connect to a LAN using WPA2 encryption. Devices communicate with the cloud through MQTT, this protocol is designed for networks with limited resources and restricted bandwidth. It is also possible to select a QoS (quality of service) level to ensure data transmission. To secure the transmission channel, MQTTS over TLS1.3 is used. The devices are responsible for publishing the telemetry to a previously configured domain.

On the other hand, the cloud contains a firewall service that filters all connections that come from ports other than those defined in the devices (8883). To subscribe to the devices, an MQTT Broker is used, which receives the telemetry and sends it to the persistent storage service. This service stores the data using a time series database, which makes subsequent analysis and consultation more efficient. All this infrastructure is separated from any other service and contains security measures such as Intrusion detection systems (IDS) and intrusion prevention systems (IPS).

#### **4.3 Machine learning process**

Once the electrical consumption data of the household appliances studied has been obtained, a data and information matrix is generated that was used to train the model.

This stage is systematized as shown in **Figure 8**. The first step is to prepare the data to be used. For this, the erroneous data are eliminated, the characteristics that will be used are studied and chosen, and the factors that are not influential in the predictive results are also dismissed.

This matrix is divided into sub-matrices to be used in the training stages of the neural network, in the testing and subsequent validation of the model.

The second stage consists of preparing and parameterizing the model. In the case of the neural network used, it was generated in Matlab® with an improved ANN

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*

#### **Figure 8.**

*Data processing methodology for ANN training and testing.*

script, which searches and finds the best neural network based on the prediction results obtained, varying the network parameters such as the number of hidden layers, hidden layer neurons, learning rate, and percentage of data in the training, testing, and validation submatrices [11, 12]. This allows the results obtained from the simulation to be the best and therefore define the structure of the model.

Evaluating the generated model is part of stage three, in which the method used to train the neural network must be tested with a new data set. This evaluation must be made from measurements of new artifacts, not used in the previous training, in such a way that they can be compared, thus carrying out a broader evaluation and, in addition, knowing how accurate the proposed model can be.

#### **4.4 Results**

Using the SS, the records of 22 different artifacts are obtained, measured with a resolution of 10 seconds. Of the 9 home appliances, their respective active power consumption patterns are presented (**Figures 9**–**15**):

**Figure 10.** *Active power consumption pattern of a heater. Measurement time in 48-hour intervals.*

**Figure 11.** *Active power consumption pattern of an electric grill. Measurement time in 12-hour intervals.*

**Figure 12.** *Active power consumption pattern of a microwave. Measurement time in 9-hour intervals.*

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*

**Figure 13.** *Active power consumption pattern of an electric oven. Measurement time in intervals of 30 min.*

**Figure 14.**

*Active power consumption pattern of a washing machine. Measurement time in 60 min intervals.*

Models based on Machine Learning techniques were executed with the RapidMiner and Matlab® Software. Using Matlab®, the ANN algorithm was executed, programmed to find the best version and configuration of the model's hyperparameters. The ANN algorithm is applied to 6 different household appliances with 91.7% efficiency in global terms, as shown in **Table 1**.

The electric kettle, heater, and oven have resistive components and tend to get confused. The model makes erroneous predictions, as was intuited from the beginning by reviewing the results from **Figures 4**–**7**. The operation of these three artifacts is sometimes very similar and the algorithm is not capable of effectively separating the data according to their characteristics. of energy consumption.

In **Table 1**, each column delivers the recognition results with respect to each artifact defined in each row. For example, the column of the kettle device indicates that the proposed model recognizes its own device with 86.6% accuracy, assimilates it with an electric oven, and with a heater with 6.7%.

The procedure for the rest of the columns is like the one shown. Each column adds a total of 100% of the results obtained. The row sums have no meaning.

The refrigerator, on the other hand, is the artifact with the highest probability of being effectively detected at 98.4%. On the other hand, the microwave and the washing machine are devices that the algorithm tends to confuse since they maintain somewhat similar operating cycles.

To increase the performance of the algorithm, it is proposed to isolate the problem into subcategories, the data set is grouped using clustering techniques, this hypothesis could be validated, since the data from the kettle, heater, and oven measurements were isolated electrical to generate a new dataset with only these targets.

The result of this test is shown in **Table 2**, where the precision of this algorithm with the previous cluster technique improves the results for the kettle going from 86.6% to 95.1%, in the heater it increases from 91.5% to 95.7% and in the electric oven it changes from 94.4% to 98.1%. These results are better than those reported by [6].

The same occurs in the case of cluster 2, which groups microwaves and washing machines, where the performance of the algorithm substantially improves when artifacts are isolated according to similarities, going from 83.3% to 96.7–100% identification, respectively. The results are shown in **Table 3.**


#### **Table 1.** *Device prediction matrix.*

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*


#### **Table 2.**

*Comparative prediction matrix between kettle, electric oven, and heater; cluster 1.*


**Table 3.**

*Microwave and washing machine; cluster 2.*
