Next Article in Journal
Explaining Bounding Boxes in Deep Object Detectors Using Post Hoc Methods for Autonomous Driving Systems
Previous Article in Journal
From Body Monitoring to Biomolecular Sensing: Current Progress and Future Perspectives of Triboelectric Nanogenerators in Point-of-Care Diagnostics
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Detection of Anomalies in Daily Activities Using Data from Smart Meters

by
Álvaro Hernández
1,*,
Rubén Nieto
2,
Laura de Diego-Otón
1,
María Carmen Pérez-Rubio
1,
José M. Villadangos-Carrizo
1,
Daniel Pizarro
1 and
Jesús Ureña
1,*
1
Electronics Department, University of Alcala, 28801 Alcalá de Henares, Spain
2
Electronics Technology Department, Rey Juan Carlos University, 28933 Móstoles, Spain
*
Authors to whom correspondence should be addressed.
Sensors 2024, 24(2), 515; https://doi.org/10.3390/s24020515
Submission received: 19 December 2023 / Revised: 5 January 2024 / Accepted: 11 January 2024 / Published: 14 January 2024
(This article belongs to the Section Sensor Networks)

Abstract

:
The massive deployment of smart meters in most Western countries in recent decades has allowed the creation and development of a significant variety of applications, mainly related to efficient energy management. The information provided about energy consumption has also been dedicated to the areas of social work and health. In this context, smart meters are considered single-point non-intrusive sensors that might be used to monitor the behaviour and activity patterns of people living in a household. This work describes the design of a short-term behavioural alarm generator based on the processing of energy consumption data coming from a commercial smart meter. The device captured data from a household for a period of six months, thus providing the consumption disaggregated per appliance at an interval of one hour. These data were used to train different intelligent systems, capable of estimating the predicted consumption for the next one-hour interval. Four different approaches have been considered and compared when designing the prediction system: a recurrent neural network, a convolutional neural network, a random forest, and a decision tree. By statistically analysing these predictions and the actual final energy consumption measurements, anomalies can be detected in the undertaking of three different daily activities: sleeping, breakfast, and lunch. The recurrent neural network achieves an F1-score of 0.8 in the detection of these anomalies for the household under analysis, outperforming other approaches. The proposal might be applied to the generation of a short-term alarm, which can be involved in future deployments and developments in the field of ambient assisted living.

1. Introduction

In recent years, the aging of population has become a key aspect of the definition of future policies and sustainable healthcare systems in Europe, a continent where people aged over 50 years old are actually 37% of the population. Moreover, EC (European Commission) population estimates predict that the number of people over 60 will increase by about two million -per year over the coming decades, and by 2060, this group is expected to represent around 30% of the total population [1]. The impact of this aging population on public finances and on future public health services is assumed to be huge. In this context, cognitive disorders and impairments already have high care demands, and are becoming a significant health challenge [2]. These disorders will provoke increased demand for long-term care, wherein a crucial issue is the sustainability of coming healthcare systems as well as their cost in terms of gross domestic product.
On the other hand, the deployment of smart meters in most Western countries has boosted the proposal and development of multiple services and applications, many related to the customers’ efficient energy management or energy demand response [3,4]. These applications have spread worldwide, partly due to the current climate emergency and energy shortages. Non-intrusive load-monitoring (NILM) techniques are focused on the energy disaggregation for each electrical load [5,6]. These disaggregated consumption data can be used not only for energy management issues [7], but also for other applications [8]. One of the most significant methods deals with the social and health aspects of aging society, wherein disaggregated load consumption might be used to infer behaviour patterns [9] or to detect anomalies for alarm generation [10,11]. In some cases, smart plugs and/or smart meters may be involved in the measurement deployment, since they provide the disaggregated data per device [12]. Nevertheless, NILM techniques offer high scalability and low intrusiveness without including any additional equipment.
In general terms, NILM techniques are often based on the detection of any change in current or power signals [13], where features are extracted [14,15] to identify loads by applying different classification methods [7,16,17]. From that point, human activity can be inferred based on the usage pattern of some appliances, as they are strongly related to certain daily activities [18,19,20]. Health aspects may also be studied from electrical consumption data, such as possible inactivity, sleep disorders, or low-activity routines [21]. These systems have been proven a suitable tool for the detection of unusual activity patterns, as well as for launching alerts to caregivers or relatives [22].
One of the first works dealing with behaviour monitoring based on electrical consumption was [23], where a unique electrical signature was identified for each person’s activity, which may provide information about their health status. A Markov model was applied in [17] to identify the activity chain based on low-sampling-energy measurements. In [18], the Dempster–Shafer theory is applied to provide a daily score about the normality of a day, when comparing it with a regular behaviour or pattern. The same approach, based on the Dempster–Shafer theory, is proposed in [24] to recognize activities such as preparing breakfast, relaxing, preparing dinner, or showering. On the other hand, in [25], a classifier based on a support vector machine (SVM) and random forest allows energy to be disaggregated in three houses, which are dedicated to training a model. The resulting trained model is then used to monitor two patients with dementia, deriving information about behavioural patterns and modifications in routines. In [26], a regression approach (based on support vector regression and linear regression) is proposed to estimate the expected energy consumption, and then, by comparing with the real one, it detects possible anomalies and launches alarms. A similar application can be found in [27], where the detection of absence from the home is performed in a straightforward manner by monitoring the use of electrical appliances instead of deploying more intrusive sensors in the household. Different machine learning techniques were compared for that purpose, such as decision tables, random forests, naïve Bayes, and neural networks. Finally, in [11], four different models (Seq2Seq, Seq2Point, temporal pooling, and the UNET-NILM model) were applied to the monitoring and evaluation of daily activities, focusing the study on patterns of kettle usage, since it is a suitable representative of hand-operated appliances.
Another interesting approach related to behaviour monitoring and possible anomaly detection is the forecasting of the energy consumption in the household. Many previous works can be found in the literature [28], often depending on the time scale of the prediction. In [29], an LSTM (long short-term memory) network is proposed and tuned for consumption forecasting in a household, as a basis for an intelligent energy management system. The same type of neural network is combined with empirical wavelet transform for the same purpose in [30]. In [31], the use of singular spectral analysis is proposed to mitigate the effect of the variability of energy consumption on the forecasting performance of parallel LSTM networks. Finally, a comparison between an LSTM, a multi-layer GRU, and a Drop-GRU network is carried out in [32], in the context of energy consumption forecasting, wherein the LSTM approach achieved better performance.
A last significant domain of application for energy prediction in general is the optimization of energy management and household efficiency by allowing scheduling and flexibility not only in the usage of electrical appliances by end users, but also in the energy generation decisions of companies. In [33], a process is proposed for detecting the occupancy of residential buildings from their smart meter data. In the same context, short-term load forecasting is developed in [34], based on several approaches, whereas machine learning methods are the most commonly used techniques [35]. Similarly, in [36], a temporal fusion transformer is proposed to forecast the energy consumption demand in a household, improving the performance given by LSTM and temporal convolutional networks.
This work proposes the detection of anomalies in the behaviour of tenants in a household based on electrical measurements coming from a smart meter installed at its entrance. The energy disaggregated per appliance is used in the proposal to assess the performance of the household’s tenants in some daily activities in the short term, such as sleeping, breakfast, or lunch. For that purpose, four machine learning algorithms have been defined for the regression of the expected energy consumption, according to the training data from a previous period. Two approaches based on neural networks have been considered at this point: one based on convolutional networks and another on recurrent networks. For comparison’s sake, a decision tree and a random forest have also been implemented. Furthermore, a short-term alarm generator has been developed, based on statistical considerations of the aforementioned activities throughout the period under study. The performance metrics for these alarms have achieved an accuracy over 99% and an F1-score of 80%. These contributions can then be summarized as follows:
  • The study of different machine learning algorithms capable of predicting the energy consumption of a household after a training period. Four algorithms are considered hereinafter: a convolutional neural network (CNN), a long short-term memory (LSTM) network, a decision tree (DT), and a random forest (RF).
  • The definition of short-term alarm, which is able to launch warnings when there is a divergence in the house between the predicted energy consumption and the real measured one, during the test period after training. In particular, three alarms have been implemented related to the following daily activities: sleeping, breakfast and lunch.
  • The proposal has been successfully validated with experimental data coming from a real household with four tenants. A commercial on-the-shelf smart meter has been used to acquire electrical samples during a period of six months, which proves the feasibility and readiness for implementation of the algorithms and methods described here.
The rest of the manuscript is organized as follows: Section 2 describes the proposed global architecture; Section 3 presents the energy prediction model, as well as the corresponding experimental results from a real living scenario; Section 4 details the method proposed for short-term alarm generation in daily activities; Section 5 deals with the limitations, the open challenges and the future works of the proposal; and, finally, conclusions are discussed in Section 6.

2. Global Architecture Overview

The proposed system is based on a smart meter, devices widely deployed in buildings and households in developed countries, which is in charge of acquiring voltage and current signals from the mains. These signals have already been analysed in the literature for NILM applications, where different alternatives have been proposed for their feature extraction. The detection of events (switching on/off of appliances connected to the mains) is likely the most common technique used to avoid continuous processing of incoming signals. Since the events are detected, only an interval of the acquired signals around the event is processed afterwards to identify the load (or appliance). The load identification can be implemented by means of different approaches, such as a Bayesian approach, principal component analysis (PCA) [10], clustering, SVM [23], or deep neural networks [15,16,37], which have become more relevant recently.
Apart from identifying loads, it is possible to deal with the detection of anomalies in usage patterns in a minimally intrusive way, in order to launch short-term alarms that may imply that the a member of the household is not following their ordinary routine in a certain daily activity, and thus might be considered to be in a risky situation to be tackled.
For that purpose, this work is based on a commercial smart meter that already provides the disaggregated energy per appliance, by accessing their company’s cloud services. It is the Wibeee Box Mono [38] that gives the appliances’ consumption per hour. As mentioned before, it has been installed in a household with four tenants (two adults and two teenagers). The energy consumption data are uploaded to the cloud by the Wibeee Box Mono; afterwards, a monitor obtains the energy consumption samples from the last days every hour, in order to forecast the actual consumption values and compare it with the real measured ones. The energy samples are not preprocessed in any way, and feature selection is not implemented before the prediction model. This one directly deals with the raw samples coming from the smart meter every hour.
This proposal is intended to detect non-ordinary situations wherein the household’s consumption is not following the typical daily routine in a significant way, so a short-term alarm might be generated to warn about the anomalous behaviour. This short-term alarm is implemented according to the block diagram shown in Figure 1. The proposal is based on an intelligent system, where four different approaches have been considered: a CNN, an LSTM network, a DT, and an RF. The intelligent system has been trained with the data from the Wibeee smart box installed in the house. The energy disaggregated per appliance is sampled every hour, for a period from November 2020 until May 2021. It is worth noting that these machine learning techniques were chosen due to their relatively reduced complexity and straightforward procedure, thanks to which they may be implemented on the edge (using general-purpose processors or FPGA devices), compared with other recent topologies, such as auto encoders [39]. This is a key aspect, since a last objective is indeed to integrate the whole proposal in a low-complexity smart meter [40,41].

3. Energy Consumption Prediction Model

Figure 2 shows the input data coming from the Wibeee device, where the energy is plotted every hour. It is worth mentioning that the samples provided by the meter correspond to the energy consumed during that hour internal (units in W·h). These energy samples per hour are equal numerically to the average power, in Watts, during that hour. The objective is to train the intelligent system to predict the global consumption in the next hour interval (a regression approach), according to an input window with a length that can vary from one week to three weeks. The energy prediction and the real measurement will be then compared, and, if the real measurement significantly differs from the predicted one, an alarm may be issued to let users know about the unusual situation. For the available period, from November 2020 to May 2021 (roughly seven months), data were organized in the following way hereinafter: from the beginning until 3 March 2021, samples were dedicated to training (60%); from that date until 16 April 2021, to validation (20%); and, finally, from that date until nearly the end of May 2021, for testing (20%). All the models considered hereinafter have been developed in Python 3.7 using Keras 2.2.4 and Tensorflow 1.13.1.
Firstly, the influence of the length in the input data was analysed for an LSTM network, since this defines the historic data used to predict the next consumption value. Three different lengths have been studied: one, two and three weeks before the next value. The network has a structure shown in Figure 3, that in the first iteration consists of an LSTM layer + LSTM layer + dense layer + dense layer, both with rectified linear units (ReLU). In all cases, we have not only provided the global consumption data of the house during the final considered days; we have also provided information about the current day of the week and the hour have been directly inserted at the input of the first dense layer after the LSTM layers. These are intended to provide the network with any additional information that may define the typical routines for each day of the week. Table 1 shows the results for the different lengths of the training window, for a learning rate of 10−4, a decay of 10−6, and a maximum number of epochs at 300, with early stopping and patience of 15 epochs. The optimization algorithm is Adam, and the validation loss function is the mean squared error. These training parameters have been chosen empirically, and are fixed throughout this work for the different tests presented hereinafter. Regarding the learning rate and the decay factor, remarkable improvement was not observed when varying them over several decades, both when making them smaller and larger. Concerning the number of epochs, the training sessions are either stopped prematurely with the early stopping mechanism, or they consume all epochs. In both cases, we have empirically chosen the number of epochs to be large enough to guarantee convergence.
It is possible to observe that the longer the training window is (three weeks), the lower the maximum absolute error (MAE) and the maximum squared error (MSE) are in the energy prediction. Nevertheless, at this point, there is a trade-off to be considered with regard to the complexity of the resulting neural network. Since the last goal is to integrate the prediction model in the smart meter itself, likely by means of an FPGA [40,41], in order to avoid a non-affordable increase in the complexity of the network, the training window of the consumption samples is fixed at two weeks hereinafter, since the resulting errors in the prediction are also suitable, while keeping a low computational complexity.
A second aspect to study is the internal structure of the LSTM network. For that purpose, three options have been considered, by changing the number of LSTM layers from one to three, as is shown in Figure 3. In this case, Table 2 shows the prediction results, assuming a training window of two weeks, wherein MAE and MSE still stand for the maximum absolute error and the mean squared error, respectively. It is possible to observe that these small variations in the network’s structure do not actually have a relevant impact on the final performance at the expense of increasing the computational load, where the best balanced figures between error and complexity are obtained for the solution based on a single LSTM layer.
A CNN structure has also been considered. As before, the input data are the energy samples for the last fourteen days every hour, together with the day of the week and the time. The energy samples are organized as an input image, with the size of 336 × 10, where 336 is the temporary depth (14 days × 24 h), and there are samples for ten different appliances. The internal CNN structure has been varied from one layer to three layers, increasing the filter from 16 to 32 and 64, and assuming a 3 × 3 kernel and a ReLU activation function. Figure 4 shows the general scheme of the CNN architecture. Table 3 shows the results for the different CNN topologies. On the other hand, assuming a structure with only one CNN layer (16 filters) and the same input, Table 4 shows the influence of kernel size on performance.
For comparison’s sake, similar tests have been carried out for a random forest (RF) approach, depending on the number of estimators involved in the topology. In this case, the input size still corresponds to a period of fourteen days, with a sample every hour, together with the day of the week and the time, meaning a total of 14 × 24 + 2 = 338 input samples. The performance is shown in Table 5. Similarly, with the same input, a solution based on a decision tree (DT) has been tested by varying the number of leaf nodes, as described in Table 6.
Taking into account all this information, Table 7 lists the best configuration for the four approaches studied in the test dataset: LSTM, CNN, RF, and DT. It is possible to observe that LSTM performs similarly to CNN, but with a higher computational load, whereas the random forest also achieves comparable results in terms of errors when predicting the global energy consumption. Furthermore, Figure 5 plots an example of the energy consumption predicted by the corresponding approach, as well as the real energy measured in the household for a single example day (the 1st of May). Note that energy samples have been normalized hereinafter at 4.5 kWh, since this is the maximum energy limitation existing in the household under analysis (actually, it is a common limitation in most houses in Spain). This normalization allows us to better fit the input and output data into the neural networks.
Despite the fact that the dataset involved is relatively small, the experimental tests presented hereinafter prove that the considered deep learning models do not suffer from severe overfitting. Specifically, the performance metrics in the test data are not significantly affected when increasing the number of training parameters in both the LSTM and CNN models. Table 1, Table 2, Table 3 and Table 4 illustrate that models with significant variation in the number of parameters do exhibit similar performance. Additionally, the results in Table 7 show that deep learning models are comparable in terms of MAE and RMSE to some classic machine learning models, such as RF, that are less prone to suffering from overfitting in this case.

4. Short-Term Alarm Generation

Based on the predicted and real energy consumptions, an alarm generator has been proposed for three different daily activities: breakfast, lunch, and sleeping. These activities were selected because they can be directly linked to the usage pattern of certain appliances, although the methods described hereinafter can be easily extended to other daily activities. This alarm generator is based on the following algorithm:
  • The breakfast alarm Ab is activated when the averaged predicted energy p e ¯ provided by the model between 8 a.m. and 11 a.m. is higher than the averaged measured value or real one p m ¯ for the same interval plus three times the standard deviation σe[n] of the error between the predicted and the measured energies in that same interval (1). The limit of three times the standard deviation implies that the current difference between the predicted and the measured energies is significantly apart from the usual error from a Gaussian point of view. This means that breakfast activity did not take place as usual.
A b = 1       i f   p e ¯ > p m ¯ + 3 · σ e 0       i f   p e ¯ p m ¯ + 3 · σ e
  • The lunch alarm Al is activated in the range from 1 p.m. to 4 p.m. if the averaged predicted energy p e ¯ by the forecasting model in that interval is greater than the averaged real one p m ¯ plus three times the standard deviation of the prediction error for that interval, similar to (1), assuming then that the lunch was different from usual.
  • The sleeping alarm As is generated in the range from 12 p.m. to 6 a.m. when the averaged measured energy p m ¯ is higher than the averaged energy consumption p e ¯ predicted by the model plus the error standard deviation for that interval (2), indicating unusual activity during nighttime hours.
A s = 1       i f   p m ¯ > p e ¯ + σ e 0       i f   p m ¯ p e ¯ + σ e
As was mentioned before, the proposals were trained with data from November 2020 to April 2021, and they were validated with available data from 16 April to 23 May. The alarm generator was tested for the three aforementioned daily activities, where the corresponding results are plotted in Figure 6. The breakfast alarm Ab is denoted by a red circle, the lunch alarm Al by a magenta cross, and the sleeping alarm As by a green asterisk. Furthermore, the plotted alarms can only be binary (1 for active and 0 for inactive). It is worth mentioning that the ground truth is provided in Figure 6a (it is the same for the other topologies); this ground truth was roughly and manually annotated by the dwellers in the household. For clarity’s sake, Figure 7 compiles the alarms generated by the four methods considered (LSTM, CNN, RF and DT), together with the corresponding ground truth, so they can be easily compared. It is possible to observe how two successive alarms for breakfast and lunch are generated on 16 May, corresponding to a weekend when the house remained empty.
Performance metrics have been obtained for the ADL alarm generation, according to the existing ground truth in Figure 6a. Table 8 provides these metrics, with which a limited analysis can be carried out due to the reduced number of alarm cases for the period under study (12 positive cases). Note that the accuracy, the precision, the recall, and the F1-score are calculated according to (3) and (4):
A c c u r a c y = T P + T N T P + F P + T N + F N       P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N       F 1 s c o r e = 2 · p r e c i s i o n · r e c a l l p r e c i s i o n + r e c a l l
where TP is the number of true positives; TN is the number of true negatives; FP is the number of false positives; and FN is the number of false negatives. Assuming that false negatives (FN) are the worst situation from a conservative point of view in this type of application, LSTM seems to provide the best performance, with the highest recall and F1-score.

5. Discussion

Monitoring the behaviour and routine patterns of persons living in a household in a non-intrusive way is a relevant field of research; it can provide interesting insights and information for different types of applications. The intelligent management of the energy demand is not only significant for companies, but also for end users that might benefit of better fees with the scheduled usage of certain electrical appliances. On the other hand, energy monitoring and forecasting are also an interesting tool in the domain of ambient intelligence for independent living. Particularly in Western countries, the ageing population is placing strain upon social and health services, and the search for novel remote health assistance systems and procedures is an open challenge. The possibility of installing sensors with a low level of intrusiveness in households to monitor and track the daily activities of tenants is a very attractive approach for specialists. In this context, smart meters may become a key device that may allow monitoring with almost negligible intrusiveness.
Data coming from smart meters can be processed and interpreted in many different ways. One option is that presented in this work, wherein a prediction model is developed to forecast future energy consumption based on the samples acquired in recent days or even weeks. Furthermore, the approach proposed here uses this prediction to launch a short-term alarm whenever the real energy consumption significantly diverges from the predicted series, since this implies variation in the usage pattern of electrical appliances. In this way, it is worth noting that the coarse-grain tracking of the daily activities in a house is feasible, and can be implemented using only a single-point sensor such as a smart meter.
Nevertheless, there are still some aspects and issues that are worth researching in the coming years. The first is the definition of intelligent systems that may be capable of monitoring activities in the long term, thus allowing the detection of possible variations in the behaviour of tenants. These variations are sometimes key for health specialists as an indication of a change in the health status of the patient. In this context, the type of activities and routines that can be inferred by smart meters are constrained to only those tasks involving the use of an electrical appliance, and many times only the most energy consuming appliances are clearly identified by NILM techniques. Recent studies have proven that higher sampling frequencies (in the range of kHz) and advanced signal processing, together with machine learning, may be able to identify loads with lower energy consumption, such as laptops, chargers, and so on. The identification of these devices would imply the recognition of more daily activities, thus enhancing behaviour monitoring.
Similarly, in more advanced scenarios, it is interesting to foresee how smart meters can be integrated in a more complex IoT (Internet of Things) sensor network, where other sensors, such as positioning, temperature, or smart devices (typically smartphones or smartwatches), can complement each other to obtain overall monitoring of the daily activity of a person. The main challenge here is how we may merge the different information coming from sensors in an efficient way, while keeping a low level of intrusiveness in the house under analysis.
Another important aspect that we have not fully explored here and that deserves further investigation is the interpretability and explainability of AI backbones. Indeed, the LSTM network, which obtains the best results in alarm detection in our datasets, is a very complex black-box model whose interaction with the input signals cannot be easily seen or explained by a human. Classic machine learning methods, such as DT or RF, are highly interpretable and explainable, allowing us to rank the most important features that contribute to predictions and to evaluate biases in our datasets. However, their generalization and regression power is limited. On the contrary, the considered deep learning models are powerful, but not easily interpretable; thus, specific methods are required for analysing deep learning models and model agnostic approaches. This is an active topic of research that should be studied in future works, since explainable AI techniques might improve the training of models, by refining the importance of the features in the input signal.

6. Conclusions

This work presents the generation of activity alarms based on electrical consumption data from a commercial smart meter. These data are used to train an intelligent system capable of predicting the energy consumption of a household in the next one-hour interval. By comparing this prediction with the actual consumed energy, it is possible to identify the unusual completion of a certain daily activity, and, consequently, to launch a corresponding alarm, while maintaining negligible intrusiveness; this is because cameras, microphones and extra sensors are not required. Four different approaches have been studied for the design of the intelligent system: a recurrent network, a convolutional network, a random forest, and a decision tree. For experimental validation, a smart meter was installed in a household with four tenants, wherein data have been acquired and stored for a period of seven months. The resulting metrics indicate better performance in the case of the recurrent network, mainly due to the fact that it is more precise when detecting positive cases, thus reducing the number of false negatives and achieving a higher recall. In particular, the LSTM network proposed here has achieved a recall of 0.83 and an F1-score of 0.80, whereas the other models provide humbler figures below 0.58 and 0.63, respectively.

Author Contributions

Conceptualization, Á.H., L.d.D.-O., R.N., D.P. and J.U.; methodology, Á.H. and D.P.; software, L.d.D.-O., M.C.P.-R. and J.M.V.-C.; validation, Á.H., D.P. and L.d.D.-O.; formal analysis, J.U.; resources, L.d.D.-O. and M.C.P.-R.; data curation, Á.H. and L.d.D.-O.; writing, Á.H., R.N., L.d.D.-O., M.C.P.-R., J.M.V.-C., D.P. and J.U.; visualization, Á.H. and L.d.D.-O.; supervision, Á.H.; project administration, Á.H., D.P. and J.U. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded in part by the Spanish Ministry of Science, Innovation and Universities MCIN/AEI/10.13039/501100011033 (PoM project, PID2019-105470RA-C33, ALONE project, ref. TED2021-131773B-I00, INDRI project, ref. PID2021-122642OB-C41, and ATHENA project, ref. PID2020-115995RB-I00), and by the Community of Madrid (RACC project, ref. CM/JIN/2021-016).

Institutional Review Board Statement

The study was conducted in accordance with the Declaration of Helsinki, and approved by the Institutional Review Board (or Ethics Committee) of Guadalajara University Hospital (protocol code 2023.01.PR and 17 January 2023).

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

Research data are unavailable at this moment due to privacy and ethical restrictions.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. European Commission; Directorate-General for Economic and Financial Affairs, EC; Economic Policy Committee of the European Communities. The 2015 Ageing Report: Economic and Budgetary Projections for the 28 EU Member States (2013–2060); Publications Office: Luxembourg, 2015. [Google Scholar]
  2. Galeotti, F.; Giusti, A.; Meduri, F.; Raschetti, R.; Scardetta, P.; Vanacore, N. Epidemiological Data on Dementia. ALzheimer COoperation Valuation in Europe (ALCOVE), Synthesis Report, 2013. Available online: https://www.alcove-project.eu/images/synthesis-report/ALCOVE_SYNTHESIS_REPORT_WP4.pdf (accessed on 1 June 2022).
  3. European Commission Joint Research Centre, European Commission Joint Research Centre, Smart Metering Deployment in the European Union, Report, 2021. Available online: https://ses.jrc.ec.europa.eu/smart-metering-deployment-european-union (accessed on 1 June 2022).
  4. Fakhar, M.Z.; Yalcin, E.; Bilge, A. A survey of smart home energy conservation techniques. Expert Syst. Appl. 2023, 213 Pt B, 118974. [Google Scholar] [CrossRef]
  5. Ruano, A.; Hernández, A.; Ureña, J.; Ruano, M.; García, J.J. NILM Techniques for Intelligent Home Energy Management and Ambient Assisted Living: A Review. Energies 2019, 12, 2203. [Google Scholar] [CrossRef]
  6. Kaselimi, M.; Protopapadakis, E.; Voulodimos, A.; Doulamis, N.; Doulamis, A. Towards Trustworthy Energy Disaggregation: A Review of Challenges, Methods, and Perspectives for Non-Intrusive Load Monitoring. Sensors 2022, 22, 5872. [Google Scholar] [CrossRef] [PubMed]
  7. Hosseini, S.S.; Agbossou, K.; Kelouwani, S.; Cardenas, A. Non-intrusive load monitoring through home energy management systems: A comprehensive review. Renew. Sustain. Energy Rev. 2017, 79, 1266–1274. [Google Scholar] [CrossRef]
  8. Ghosh, S.; Chatterjee, D. Non-intrusive identification of harmonic polluting loads in a smart residential system. Sustain. Energy Grids Netw. 2021, 26, 100446. [Google Scholar] [CrossRef]
  9. Lai, Q.H.; Lai, C.S. Healthcare with Wireless Communication and Smart Meters. IEEE Consum. Electron. Mag. 2023, 12, 53–62. [Google Scholar] [CrossRef]
  10. Alcalá, J.M.; Ureña, J.; Hernández, A.; Gualda, D. Sustainable Homecare Monitoring System by Sensing Electricity Data. IEEE Sens. J. 2017, 17, 7741–7749. [Google Scholar] [CrossRef]
  11. Bousbiat, H.; Leitner, G.; Elmenreich, W. Ageing Safely in the Digital Era: A New Unobtrusive Activity Monitoring Framework Leveraging on Daily Interactions with Hand-Operated Appliances. Sensors 2022, 22, 1322. [Google Scholar] [CrossRef]
  12. Suryadevara, N.K.; Biswal, G.R. Smart Plugs: Paradigms and Applications in the Smart City-and-Smart Grid. Energies 2019, 12, 1957. [Google Scholar] [CrossRef]
  13. Rehman, A.U.; Lie, T.T.; Vallès, B.; Tito, S.R. Event-Detection Algorithms for Low Sampling Nonintrusive Load Monitoring Systems Based on Low Complexity Statistical Features. IEEE Trans. Instrum. Meas. 2020, 69, 751–759. [Google Scholar] [CrossRef]
  14. Zhao, B.; Li, X.; Luan, W.; Liu, B. Apply Graph Signal Processing on NILM: An Unsupervised Approach Featuring Power Sequences. Sensors 2023, 23, 3939. [Google Scholar] [CrossRef] [PubMed]
  15. Akarslan, E.; Dogan, R. A novel approach based on a feature selection procedure for residential load identification. Sustain. Energy Grids Netw. 2021, 27, 100488. [Google Scholar] [CrossRef]
  16. Ciancetta, F.; Bucci, G.; Fiorucci, E.; Mari, S.; Fioravanti, A. A New Convolutional Neural Network-Based System for NILM Applications. IEEE Trans. Instrum. Meas. 2021, 70, 1–12. [Google Scholar] [CrossRef]
  17. Holweger, J.; Dorokhova, M.; Bloch, L.; Ballif, C.; Wyrsch, N. Unsupervised algorithm for disaggregating low-sampling-rate electricity consumption of households. Sustain. Energy Grids Netw. 2019, 19, 100244. [Google Scholar] [CrossRef]
  18. Alcalá, J.; Ureña, J.; Hernández, A.; Gualda, D. Assessing Human Activity in Elderly People Using Non-Intrusive Load Monitoring. Sensors 2017, 17, 351. [Google Scholar] [CrossRef]
  19. Devlin, M.A.; Hayes, B.P. Non-intrusive load monitoring and classification of activities of daily living using residential smart meter data. IEEE Trans. Consum. Electron. 2019, 65, 339–348. [Google Scholar] [CrossRef]
  20. Belley, C.; Gaboury, S.; Bouchard, B.; Bouzouane, A. An efficient and inexpensive method for activity recognition within a smart home based on load signatures of appliances. Pervasive Mob. Comput. 2014, 12, 58–78. [Google Scholar] [CrossRef]
  21. Patrono, L.; Primiceri, P.; Rametta, P.; Sergi, I.; Visconti, P. An innovative approach for monitoring elderly behavior by detecting home appliance’s usage. In Proceedings of the 2017 25th International Conference on Software, Telecommunications and Computer Networks (SoftCOM), Split, Croatia, 21–23 September 2017; pp. 1–7. [Google Scholar]
  22. Kim, G.; Park, S. Pre-trained non-intrusive load monitoring model for recognizing activity of daily living. Appl. Intell. 2023, 53, 10937–10955. [Google Scholar] [CrossRef]
  23. Noury, N.; Berenguer, M.; Teyssier, H.; Bouzid, M.J.; Giordani, M. Building an index of activity of inhabitants from their activity on the residential electrical power line. IEEE Trans. Inf. Technol. Biomed. 2011, 15, 758–766. [Google Scholar] [CrossRef]
  24. Liao, J.; Stankovic, L.; Stankovic, V. Detecting household activity patterns from smart meter data. In Proceedings of the 2014 International Conference on Intelligent Environments, Shanghai, China, 30 June–4 July 2014; pp. 71–78. [Google Scholar]
  25. Chalmers, C.; Fergus, P.; Montanez, C.A.C.; Sikdar, S.; Ball, F.; Kendall, B. Detecting activities of daily living and routine behaviors in dementia patients living alone using smart meter load disaggregation. IEEE Trans. Emerg. Top. Comput. 2020, 10, 157–169. [Google Scholar] [CrossRef]
  26. Nordahl, C.; Persson, M.; Grahn, H. Detection of residents’ abnormal behaviour by analysing energy consumption of individual households. In Proceedings of the 2017 IEEE International Conference on Data Mining Workshops (ICDMW), New Orleans, LA, USA, 18–21 November 2017; pp. 729–738. [Google Scholar]
  27. Lentzas, A.; Vrakas, D. Machine learning approaches for non-intrusive home absence detection based on appliance electrical use. Expert Syst. Appl. 2022, 210, 118454. [Google Scholar] [CrossRef]
  28. Klyuev, R.V.; Morgoev, I.D.; Morgoeva, A.D.; Gavrina, O.A.; Martyushev, N.V.; Efremenkov, E.A.; Mengxu, Q. Methods of Forecasting Electric Energy Consumption: A Literature Review. Energies 2022, 15, 8919. [Google Scholar] [CrossRef]
  29. Hora, S.K.; Poongodan, R.; de Prado, R.P.; Wozniak, M.; Divakarachari, P.B. Long Short-Term Memory Network-Based Metaheuristic for Effective Electric Energy Consumption Prediction. Appl. Sci. 2021, 11, 11263. [Google Scholar] [CrossRef]
  30. Peng, L.; Wang, L.; Xia, D.; Gao, Q. Effective energy consumption forecasting using empirical wavelet transform and long short-term memory. Energy 2022, 238 Pt B, 121756. [Google Scholar] [CrossRef]
  31. Jin, N.; Yang, F.; Mo, Y.; Zeng, Y.; Zhou, X.; Yan, K.; Ma, X. Highly accurate energy consumption forecasting model based on parallel LSTM neural networks. Adv. Eng. Inform. 2022, 51, 101442. [Google Scholar] [CrossRef]
  32. Mahjoub, S.; Chrifi-Alaoui, L.; Marhic, B.; Delahoche, L. Predicting Energy Consumption Using LSTM, Multi-Layer GRU and Drop-GRU Neural Networks. Sensors 2022, 22, 4062. [Google Scholar] [CrossRef] [PubMed]
  33. Rashid, H.; Singh, P.; Stankovic, V.; Stankovic, L. Can non-intrusive load monitoring be used for identifying an appliance’s anomalous behaviour? Appl. Energy 2019, 238, 796–805. [Google Scholar] [CrossRef]
  34. Khosravani, H.; Castilla, M.; Berenguel, M.; Ruano, A.; Ferreira, P. A Comparison of Energy Consumption Prediction Models Based on Neural Networks of a Bioclimatic Building. Energies 2016, 9, 57. [Google Scholar] [CrossRef]
  35. Voyant, C.; Notton, G.; Kalogirou, S.; Nivet, M.-L.; Paoli, C.; Motte, F.; Fouilloy, A. Machine learning methods for solar radiation forecasting: A review. Renew. Energy 2017, 105, 569–582. [Google Scholar] [CrossRef]
  36. Nazir, A.; Shaikh, A.K.; Shah, A.S.; Khalil, A. Forecasting energy consumption demand of customers in smart grid using Temporal Fusion Transformer (TFT). Results Eng. 2023, 17, 100888. [Google Scholar] [CrossRef]
  37. Wu, H.; Liu, H. Non-intrusive load transient identification based on multivariate LSTM neural network and time series data augmentation. Sustain. Energy Grids Netw. 2021, 27, 100490. [Google Scholar] [CrossRef]
  38. Smilics Technologies, S.L., Wibeee Box Mono, Technical Description, 2021. Available online: https://smilics.com/ (accessed on 1 November 2019).
  39. Langevin, A.; Carbonneau, M.-A.; Cheriet, M.; Gagnon, G. Energy disaggregation using variational autoencoders. Energy Build. 2022, 254, 111623. [Google Scholar] [CrossRef]
  40. Hernández, A.; Nieto, R.; Fuentes, D.; Ureña, J. Design of a SoC Architecture for the Edge Computing of NILM Techniques. In Proceedings of the 2020 XXXV Conference on Design of Circuits and Integrated Systems (DCIS), Segovia, Spain, 18–20 November 2020; pp. 1–6. [Google Scholar]
  41. Tapiador, M.; de Diego-Otón, L.; Hernández, A.; Nieto, R. Implementing a CNN in FPGA Programmable Logic for NILM Application. In Proceedings of the 2023 38th Conference on Design of Circuits and Integrated Systems (DCIS), Málaga, Spain, 15–17 November 2023; pp. 1–6. [Google Scholar]
Figure 1. Global architecture of the proposed system.
Figure 1. Global architecture of the proposed system.
Sensors 24 00515 g001
Figure 2. Available input data (energy consumed each hour) from the Wibeee device installed in a test house with four tenants: (a) the whole period under analysis; (b) the first week under analysis.
Figure 2. Available input data (energy consumed each hour) from the Wibeee device installed in a test house with four tenants: (a) the whole period under analysis; (b) the first week under analysis.
Sensors 24 00515 g002
Figure 3. General scheme of the different LSTM topologies studied.
Figure 3. General scheme of the different LSTM topologies studied.
Sensors 24 00515 g003
Figure 4. General scheme of the different CNN topologies studied.
Figure 4. General scheme of the different CNN topologies studied.
Sensors 24 00515 g004
Figure 5. Real and estimated energy consumption on an hourly sampling basis (one sample per hour) for the four considered solutions: (a) LSTM; (b) CNN; (c) RF; and (d) DT. Note that the values have been normalized over a maximum of 4.5 kWh.
Figure 5. Real and estimated energy consumption on an hourly sampling basis (one sample per hour) for the four considered solutions: (a) LSTM; (b) CNN; (c) RF; and (d) DT. Note that the values have been normalized over a maximum of 4.5 kWh.
Sensors 24 00515 g005aSensors 24 00515 g005b
Figure 6. Activities’ alarm generation for the four considered solutions: (a) LSTM; (b) CNN; (c) RF; and (d) DT. The breakfast alarm Ab is denoted by a red circle, the lunch alarm Al by a magenta cross, and the sleeping alarm As by a green asterisk. Note that the ground truth is only included for the LSTM (a) because it is the same for the other topologies. The energy values are normalized over a maximum of 4.5 kWh.
Figure 6. Activities’ alarm generation for the four considered solutions: (a) LSTM; (b) CNN; (c) RF; and (d) DT. The breakfast alarm Ab is denoted by a red circle, the lunch alarm Al by a magenta cross, and the sleeping alarm As by a green asterisk. Note that the ground truth is only included for the LSTM (a) because it is the same for the other topologies. The energy values are normalized over a maximum of 4.5 kWh.
Sensors 24 00515 g006
Figure 7. Summary of activities’ alarm generation for the four considered solutions: LSTM, CNN, RF and DT. The breakfast alarm Ab is still denoted by a red circle, the lunch alarm Al by a magenta cross, and the sleeping alarm As by a green asterisk. The energy values are normalized over a maximum of 4.5 kWh.
Figure 7. Summary of activities’ alarm generation for the four considered solutions: LSTM, CNN, RF and DT. The breakfast alarm Ab is still denoted by a red circle, the lunch alarm Al by a magenta cross, and the sleeping alarm As by a green asterisk. The energy values are normalized over a maximum of 4.5 kWh.
Sensors 24 00515 g007
Table 1. Influence of the length of the training window on the energy prediction based on an LSTM network.
Table 1. Influence of the length of the training window on the energy prediction based on an LSTM network.
No. of Weeks123
No. of inputs170338506
Structure: LSTM + LSTM + dense + dense168/168/672/1336/336/1344/1504/504/2016/1
Trainable parameters19,309,925153,096,389515,158,565
Batch size706865
MAE0.05980.05870.0590
MSE0.01050.01070.0102
Table 2. Analysis of the LSTM structure for a training input window of two weeks.
Table 2. Analysis of the LSTM structure for a training input window of two weeks.
LSTM StructureStructure SizeTrainable ParametersMAEMSE
LSTM + dense + dense336/1344/1152,191,8770.06010.0106
LSTM + dense + dense336/512/158,259,0770.05890.0106
LSTM + LSTM + dense + dense336/336/1344/1153,096,3890.05870.0107
LSTM + LSTM + dense + dense336/168/512/129,697,0610.06160.0107
LSTM + LSTM + LSTM + dense + dense336/168/84/512/115,331,3810.06110.0108
Table 3. Analysis of the CNN structure for a training input window of two weeks.
Table 3. Analysis of the CNN structure for a training input window of two weeks.
CNN StructureStructure SizeTrainable ParametersMAEMSE
CNN + dense + dense16/200/19,620,1650.06450.0116
CNN + CNN + dense + dense16/64/200/114,879,2050.07280.1340
CNN + CNN + CNN + dense + dense16/64/64/200/121,144,1010.07160.0129
Table 4. Influence of kernel size on the CNN layer.
Table 4. Influence of kernel size on the CNN layer.
Kernel SizeTrainable ParametersMAEMSE
3 × 39,620,1650.06450.0116
5 × 57,438,0210.06640.0117
7 × 75,281,6050.06270.0130
9 × 93,150,9170.06570.0113
11 × 111,045,9570.05970.0107
Table 5. Performance in the global energy prediction using a random forest.
Table 5. Performance in the global energy prediction using a random forest.
Number of EstimatorsMAEMSE
4000.05980.0098
2000.05880.0097
1000.05860.0097
500.05890.0099
Table 6. Performance in the global energy prediction using a decision tree.
Table 6. Performance in the global energy prediction using a decision tree.
Number of Leaf NodesMAEMSE
50,0000.07770.0211
10,0000.07770.0211
50000.07770.0211
5000.07590.0211
500.06400.0143
Table 7. Comparison of the four approaches considered (LSTM, CNN, RF, and DT) using the test dataset.
Table 7. Comparison of the four approaches considered (LSTM, CNN, RF, and DT) using the test dataset.
TopologyFeaturesMAEMSE
LSTMLSTM (336) + dense (512) + dense (1) 0.05890.0106
CNNCNN (16, 11 × 11) + dense (200) + dense (1)0.07050.0128
RF200 estimators0.05880.0097
DT50 node leafs0.06400.0143
Table 8. Performance metrics in the proposed ADL alarm generation.
Table 8. Performance metrics in the proposed ADL alarm generation.
LSTMCNNRFDT
Negative cases (NC)895895895895
Positive cases (PN)12121212
True positive (tp)10347
True negative (tn)892892893892
False positive (fp)2323
False negative (fn)3985
Accuracy0.990.990.990.99
Precision0.770.750.670.70
Recall0.830.250.330.58
F1-score0.800.380.440.63
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hernández, Á.; Nieto, R.; de Diego-Otón, L.; Pérez-Rubio, M.C.; Villadangos-Carrizo, J.M.; Pizarro, D.; Ureña, J. Detection of Anomalies in Daily Activities Using Data from Smart Meters. Sensors 2024, 24, 515. https://doi.org/10.3390/s24020515

AMA Style

Hernández Á, Nieto R, de Diego-Otón L, Pérez-Rubio MC, Villadangos-Carrizo JM, Pizarro D, Ureña J. Detection of Anomalies in Daily Activities Using Data from Smart Meters. Sensors. 2024; 24(2):515. https://doi.org/10.3390/s24020515

Chicago/Turabian Style

Hernández, Álvaro, Rubén Nieto, Laura de Diego-Otón, María Carmen Pérez-Rubio, José M. Villadangos-Carrizo, Daniel Pizarro, and Jesús Ureña. 2024. "Detection of Anomalies in Daily Activities Using Data from Smart Meters" Sensors 24, no. 2: 515. https://doi.org/10.3390/s24020515

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop