## 2 Materials and Methods
### Recognition of Appliance Operation Modes  
The recognition of the operation modes of appliances is necessary to estimate the consumption value and the duration of the appliances' modes, thus keeping track of the status of smart devices at any given time. To address this problem, an approach similar to the one presented by [PERSON] et al. [34] is used. Specifically, unsupervised deep learning clustering techniques are applied to a learned, latent-state representation of the raw data to produce the list of appliances' modes of operation. The high-level procedure is divided into the 4 steps displayed in Figure 1. Firstly, segmentation methods are applied to the raw data to extract the power signatures of the device (called _appliance activations_). Subsequently, the extracted signatures undergo standardization before becoming the input of an autoencoder model. This model learns to reconstruct the operation cycles and encode them into a latent representation. Next, a K-means clustering algorithm is applied to the latent representation, being responsible for grouping them into potential appliance modes. Finally, the clusters are manually assigned human-intelligible labels. For the extraction of appliances' activations _the Non-Intrusive Load Monitoring Toolkit_ (NILMTK) ([[https://github.com/nilmtk/nilmtk](https://github.com/nilmtk/nilmtk)]([https://github.com/nilmtk/nilmtk](https://github.com/nilmtk/nilmtk)) accessed on 1 May 2024) has been used. This Python toolkit, designed by [PERSON] et al. [35], provides a way to use and compare \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Appliance Type** & **Dataset** & **Building** & **Manufacturer** & **Model** \\ \hline Radio & GREEND & 3 & Denon & DRA-275 RD \\ Dishwasher & GREEND & 5 & Whirlpool & ADG 555 IX \\ Fridge w/freezer & GREEND & 5 & Siemens & \\ Television & GREEND & 5 & Samsung & LE32C650 \\ Microwave & GREEND & 3 & Whirlpool & AMW 494/IX \\ Lamp & UK-DALE & 1 & & \\ Washing machine & GREEND & 3 & Zanussi & F1215 \\ Desktop & GREEND & 5 & Dimotion & QuietONE Q2 \\ Boiler & UK-DALE & 4 & & \\ Air conditioning & UK-DALE & 5 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Details of the selected appliances. Empty cells indicate that the information was not provided. Figure 1: High-level scheme of the procedure for operation mode extraction. different energy disaggregation algorithms, producing the corresponding power signature. The optimal values for NILMTK's parameters have been selected empirically for each appliance by preferring combinations that produce a balance between the number of activations and their mean length. The extracted data have been then used to train an autoencoder network. This particular type of unsupervised method can learn to compress the inputs into a low-dimensional representation, called a _latent state_[36]. Figure 2 shows the adopted architecture. The _Encoder_ is the part responsible for the conversion of the initial input into a suitable latent state, while the _Decoder_ takes the latent states and converts them back to the original input. The Long Short-Term Memory (LSTM) included in the Encoder and Decoder is a recurrent neural network that can learn long-term temporal dependencies in sequential data [37]. In the case at hand, it is useful to learn the dependencies among the values of the activations of an appliance. The autoencoder is implemented using Tensorflow ([[https://www.tensorflow.org](https://www.tensorflow.org)]([https://www.tensorflow.org](https://www.tensorflow.org)) accessed on 15 May 2024), in its version 2.15.0, along with the Keras ([[https://keras.io](https://keras.io)]([https://keras.io](https://keras.io)) accessed on 15 May 2024) deep learning library, and the code is executed inside a _Google Colab_ notebook environment. Following the training of the autoencoder network, the subsequent step involves applying a clustering procedure to partition the latent states produced by the Encoder.