ApplianceNet a neural network based framework to recognize daily activities_2022
ApplianceNet a neural network based framework to recognize daily activities_2022
https://doi.org/10.1007/s00521-022-07144-1(0123456789().,-volV)(0123456789().
,- volV)
ORIGINAL ARTICLE
Received: 9 July 2021 / Accepted: 24 February 2022 / Published online: 21 March 2022
Ó Crown 2022
Abstract
A smart plug can transform the typical electrical appliance into a smart multi-functional device, which can communicate
over the Internet. It has the ability to report the energy consumption pattern of the attached appliance which offer the
further analysis. Inside the home, smart plugs can be utilized to recognize daily life activities and behavior. These are the
key elements to provide human-centered applications including healthcare services, power consumption footprints, and
household appliance identification. In this research, we propose a novel framework ApplianceNet that is based on energy
consumption patterns of home appliances attached to smart plugs. Our framework can process the collected univariate
time-series data intelligently and classifies them using a multi-layer, feed-forward neural network. The performance of this
approach is evaluated on publicly available real homes collected dataset. The experimental results have shown the
ApplianceNet as an effective and practical solution for recognizing daily life activities and behavior. We measure the
performance in terms of precision, recall, and F1-score, and the obtained score is 87%, 88%, 88%, respectively, which is
11% higher than the existing method in terms of F1-score. Furthermore, our scheme is simple and easy to adopt in the
existing home infrastructure.
Keywords Daily activities Home appliances Healthcare applications Intelligent data processing Time-series analysis
123
12750 Neural Computing and Applications (2022) 34:12749–12763
various appliances are working simultaneously. Similarly, appliances by a feed-forward neural network. Our contri-
such a solution has adoption limitations because instalment butions in this research are as follows.
of the smart meter is related to service providers not the
– The proposed model is based on a data-driven approach
residents of the house.
that does not require domain expert knowledge.
In this paper, we consider a unique perspective to rec-
– The proposed solution is integrated easily with existing
ognize the daily living activities by considering a smart
home infrastructure without disturbing residents’ pri-
plug as an Individual Appliance Monitor (IAM) to collect
vacy and additional sensors that may affect home
the energy consumption data of home appliances [10]. It is
aesthetics or complicate the resident interaction.
considered as Intrusive Load Monitoring (ILM) because
– The home appliances usage differ from one another in
smart plug is attached to each device [11]. The ILM is the
terms of duration. For instance, the duration of
preferred approach for the situations when the consumer is
watching television is longer than the toaster or
interested to monitor daily life activities without adding an
dishwasher. In such scenarios, small usage of home
extra layer of sensors inside the home or involvement of
appliances produces few data samples. Consequently, it
smart meter. The trivial solution for recognizing the elec-
degrades the performance of the machine learning
trical appliance is to statically map the smart plugs for
model. This problem is known as an imbalance dataset.
specific appliances. The potential problem with this
We solve this issue by data augmentation and validate
approach can reduce the applicability of provided services.
performance empirically.
For instance, a smart plug is specified for the oven and if
– The usage pattern of home appliances can provide
households use it for TV or any other device then the
information on behavioral changes, which can be
service model will lead to false-positive results. The oven
captured by our framework and may assist the family
smart plug used for TV can point to some emergency at
to understand the occupant’s behavior.
home in a scenario of 3 hours usage. It can consider stove
is ON for 3 hours while in home setting smart plug is The rest of the research paper is organized as follows. We
attached with TV. The goal of our research is to make the briefly describe related research work and their limitations
smart plug intelligent which can tell which device is con- in Sect. 2. In Sect. 3, we introduce ApplianceNet and its
nected to it. Consequently, it will allow the consumer to implementation for recognizing home appliances. In
use the smart plug freely with any appliance. Furthermore, Sect. 4, experimental setting and hyper-parameter details.
it provides the freedom to residents by specifying which In Sect. 5, we present the results and comparison with the
devices are allowed to be monitored and accessed by smart state-of-the-art techniques. Finally, we conclude our paper
hand-held devices to control its states. Intelligent data in Sect. 6.
processing of smart plugs’ may helps to avoid unseen
problems in daily activities as well as emergency situations
at home. For example, excessive watching of the television 2 Related work
leads to sedentary activity, which may not suitable for the
resident health conditions. Similarly, keeping the micro- Smart homes are designed to monitor vital signs, daily life
wave ‘ON’ after finishing the cooking activity may lead to activities, and possibly avoid emergencies [12, 13]. In this
an emergency. section, we briefly explain different kinds of sensor tech-
In our research, IAM-based solution is considered as an nologies and developed models used for activity recogni-
effective and seamless way to monitor the activities of tion in the home environment. The advancement of neural
daily living and behavior. With the help of smart plugs, we network-based approaches has made significant improve-
monitor basic household appliances, such as toaster, ments in recognition tasks [14]. Mehr et al. [15] proposed a
microwave, fridge, washing machine, etc. To distinguish Convolutional Neural Network (CNN) to recognize human
the type of meal (i.e., breakfast, lunch, or dinner), the time action using multiple cameras inside the home environ-
information is available in collected data streams. The data ment. The experiments were performed on a publicly
stream of smart plugs contains two columns; one is a available dataset, collected using three static cameras to
timestamp and the second is electric power consumption in recognize the ambulatory activities including walking,
watts. The task of recognizing home appliances is very table cleaning, drinking, etc. They achieved 82% of accu-
challenging because most energy consumption patterns of racy for twelve actions available in the dataset. Chen et al.
appliances overlap with other appliances. It makes an [16] also proposed a novel CNN architecture to recognize
unnoticeable difference in readings. The proposed Appli- the fridge, dishwasher, microwave, washing machine, and
anceNet framework (see block diagram in Fig. 1) processes kettle. Their model confirms the applicability of neural
time-series data by extracting features to a repre- network architecture for non intrusive load monitoring.
sentable form and recognizes non-linearly separable home Similarly, Junfeng et al. [17] proposed temporal and
123
Neural Computing and Applications (2022) 34:12749–12763 12751
spectral features learning with two-stream CNN. They health care systems. They performed experiments on a
fused both temporal and spectral feature to recognize the large-scale publicly available dataset collected for five
appliances. They obtained more than 90% accurate results houses in southern England. They learned the activities
based on the fusion of temporal and spectral features. patterns from appliance usage inside the home by mapping
Another possible way to recognize daily life activities is back to energy consumption data from the smart meter.
embedded sensors for household objects. Karvigh et al. [7] This technology adoption in a setting where legacy meters
proposed a framework for real-time activity recognition for are used is a challenge to keep the track of energy usage.
energy efficiency in building. Their approach is capable to Similarly, Delvin et al. [5] classify the activities of daily
detect action, activity recognition, and waste estimation. living using smart meter data. Their approach is based on
Particularly, for activity recognition tap sensors we used neural networks to identify home appliances. They con-
over the objects to sense the ON/OFF states. Their activity sider seven common home appliances and achieved
recognition algorithm is based on ontology and data-driven acceptable (i.e., 77% F1-score) results.
solutions. A number of sophisticated algorithms were France et al. [21] developed an intrusive load monitor-
developed by the research community to monitor home ing approach over the layer architecture and Internet of
activities [8, 18]. These algorithms are based on data-dri- things (IoT) for load monitoring and activity recognition in
ven to knowledge-driven approaches. Most of the devel- smart homes. They consider 5 activities (i.e., dishwasher,
oped models were mature enough to achieve more than hairdryer, iron, oven, and washing machine). The approach
90% accuracy and successfully deployed in different is based on hand-crafted features and neural networks as a
application scenarios [19]. classifier. They reported high accuracy (i.e., 91% F1-score)
Smart plugs were utilized to monitor the energy usage in for considered activities. Similarly, Paganelli et al. [22]
home environments and the developed techniques found in also propose a neural network-based approach for appli-
[20]. Gajowniczek et al. [3] considered the appliances’ ance recognition from smart plugs. The designed approach
status either ON/OFF to detect usage patterns using hier- is developed for home energy management systems in
archical and c-means clustering. The goal of their study Italy. Their approach is also based on hand-crafted fea-
was to contribute in energy consumption awareness and tures. In future work, they also emphasized the need for
energy-saving recommendations. Yan et al. [20] used smart complex event processing techniques.
meter data to extract the characteristics of occupant The above-discussed approaches did not consider the
behavior and energy consumption of home appliances. appliances level usage patterns as well as automatic feature
Seven home appliances, such as refrigerator, electric coo- extraction for daily life activities which can be monitored
ker, air conditioner, television, laptop computer, washing through smart plugs. Our framework is based on appliance
machine, and water dispenser were analyzed in Beijing, level monitoring and automatic feature extraction
China. They developed a Bayes classification based scheme to recognize the daily life activities and behavior
approach to recognize the appliances. inside the home environment depending on the intended
Yassine et al. [9] introduced a mining algorithm to appliance’s usage.
recognize the daily life activities using smart meter data for
123
12752 Neural Computing and Applications (2022) 34:12749–12763
123
Neural Computing and Applications (2022) 34:12749–12763 12753
123
12754 Neural Computing and Applications (2022) 34:12749–12763
We extract the selected feature vector v/ for each smart to every neuron in first layer li and every subsequent layer
plug p and supplied it to the classifier for recognizing home is fully connected to liþ1 with i 2 ½1; L. A weighted sum is
appliances. calculated over each neuron and non-linearity is applied to
squash the strengths.
3.3.3 Classifier " #
Xm
y ¼ / fð wk f k þ bÞ ð6Þ
A non-linear classifier is designed to recognize home k¼0
appliances. The classification network is based on a multi-
where / is the activation function, b is the bias and m is the
layered feed-forward neural network using a back-propa-
number of neurons in each li and considered as hyper-
gation learning mechanism. The designed and implemented
parameters. The model is trained to minimize the cross-
architecture is presented in Fig. 5.
entropy loss (i.e., presented in ‘‘(7)’’) over the extracted
In Fig. 5, architecture contains input and output layer
feature vectors to recognize home appliances.
with five hidden layers. The feature vector v/ is connected
123
Neural Computing and Applications (2022) 34:12749–12763 12755
X
c Table 3 The number of com-
No. Appliances
LðHÞ ¼ yi logðy^i Þ ð7Þ mon home appliances across the
i¼1 five houses 1. Microwave
where c is the class labels, yi is the original label, and y^ is 2. Kettle
the predicted label for home appliances. The details on the 3. Toaster
training procedure and optimal parameters are discussed in 4. Fridge
Sect. 4. 5. Dishwasher
6. Washing machine
3.4 Interface layer 7. Television
8. Desktop PC
At this layer of smart home, the interface connects the
residents, family members, and caregivers in case of
healthcare consumer service. Based on the service, it can period of 2 years. The dataset consists of whole house
facilitate the user to reduce the utility bills, identify power- aggregate loads logged by smart meter as well as nine
hungry devices, power consumption patterns, and aware- appliances inside the house which are connected with the
ness to reduce the CO2 as a social responsibility for con- ‘‘current cost’’ smart plug. We processed only one-month
tributing towards the reduction of global warming. In the data from five houses to get a sufficient footprint of
case of caregivers, it should integrate with the individual attached home appliances with these smart plugs. The one-
physician to check the performed activities, frequency, or month appliance data signature is sufficient to train the
skipping of daily activities. In the case of residents to send ApplianceNet and learn the pattern to recognize the
reminders for the completion of tasks in case of dementia. appliance. The detail about the houses description is pre-
In case of cardiovascular complications, alerts can be sented in Table 2.
generated to perform some tasks and discontinue sedentary In Table 2, the house numbers are kept the same as
activities like excessive watching of television. Further- appeared in the dataset for compatibility reasons. The
more, information about the duration of the activities can house 2 construction year is missing in the dataset while
be determined and shared with personal doctors via secure the number of occupants, appliances, house type, and size
communication. information is provided. The selection of the houses
depends on the number of maximum common electrical
appliances that were attached with smart plugs to report the
4 Experimental setup and details energy values. The considered common home appliances
are listed in Table 3. In Table 3, all the home appliances
This section explains the dataset, experimental setup, and are essential for daily life activities including meal prepa-
hyper-parameter setting with neural network convergence. ration (breakfast, lunch, dinner), sedentary behavior while
watching television, and doing laundry which is considered
4.1 Dataset as an ambulatory activity. The relationship between the
recognized home appliances and daily life activities is
In our experiments, we used a publicly available REFIT presented in Fig. 6.
dataset [28]. It contains information on the individual
appliance usage by utilizing the smart plug ‘‘current cost’’.
By default, all of the installed load monitoring devices had 4.2 Data augmentation
the voltage pre-set to 240 V, suitable for the UK where the
main voltage is rated at 230 V ?10 to -6% [28]. The The classifier requires a sufficient amount of data to train
dataset was collected continuously from 20 houses over a the feed-forward neural network. In the case of appliance
123
12756 Neural Computing and Applications (2022) 34:12749–12763
Fig. 7 The number of training samples before and after data augmentation
recognition, some appliance generates an insufficient In Fig. 7, it is visible that appliance ‘Toaster’, ‘Kettle’
amount of data due to less resident interaction or daily and ‘Dishwasher’, and ‘Washing Machine’ are the minor
usage. In this case, a data augmentation strategy is applied activities which are dominated by ‘Desktop PC’, ‘Micro-
to up-sample the minor classes using scikit learn library wave’ and ‘Television’ activity during the learning phase
[29]. The number of synthetic examples is added to the of the model. By augmentation, we up-sampled the minor
minor classes with the objective to increase the recognition classes with synthetics samples to make the class balance
of electrical appliances during the training phase of the as shown in Fig. 7 (right). It contributes to improve the
model. It is based on bootstrapping procedure to re-sample performance of the model.
the minor classes. The bootstrap is a statistical method to
perform data augmentation. It resamples the data instances 4.3 Training parameters
to create synthetic instances with similar properties to the
original instances. This property is quantified by mean and Our proposed model has nine nobs (i.e., hyperparameters)
histogram. Furthermore, it calculates the standard error, to tune for obtaining the best performance. The number of
confidence interval, and performs hypothesis testing to hidden layers plays an important role to understand the
include the generated sample into the minor classes. Con- feature spaces of the provided data, while a number of
sequently, it increases the performance of the proposed neurons in each layer accommodate the information in
model. Some of the appliance usages are for short time like terms of weights. One of the best practices is to reduce the
‘Toaster’ while ‘Desktop PC’ and ‘Television’ usage is number of neurons in each layer when moving from input
high as compared to other appliances. Figure 7 (left) to output. The loss function for ApplianceNet is cross-en-
presents the number of instances for each appliance usage tropy which aligns well in the case of a classification
and Fig. 7 (right) presents the data samples after problem. The role of the loss function is to guide the net-
augmentation. work to optimize the weights. We also included the batch
processing which stochastic gradient descent (SGD)
123
Neural Computing and Applications (2022) 34:12749–12763 12757
optimizer to update the weights of connection between the hyperparameters setting and experimental arrangements
neurons after each batch. Consequently, it helps reduce the can be analyzed by plotting the network convergence
memory utilization because few examples were used in the graph. This graph explains how the learning of the network
batch to update the weights. All the training is going on with respect to reduce the loss. The curve
123
12758 Neural Computing and Applications (2022) 34:12749–12763
Table 4 The optimal hyper-parameter to train the classifier Table 6 The obtained results of ApplianceNet without data
augmentation
Parameters Values/settings
Appliance Precision (p) Recall (r) F1-score Accuracy
Hidden layers 5
Each layer neurons [512, 256, 128, 64, 32] Television 0.80 0.86 0.83 0.85
Loss function Cross-entropy Microwave 0.93 0.96 0.94 0.96
Batch size 100 Kettle 0.79 0.73 0.76 0.73
Batch normalization All 5 layers Washing machine 0.86 0.76 0.81 0.76
Optimizer Stochastic Gradient Descent (SGD) Toaster 0.00 0.00 0.00 0.00
Learning rate 0.001 Dish washer 0.91 0.75 0.83 0.75
Epochs 250 Desktop PC 0.91 0.92 0.91 0.92
Fridge 0.88 0.83 0.86 0.83
123
Neural Computing and Applications (2022) 34:12749–12763 12759
123
12760 Neural Computing and Applications (2022) 34:12749–12763
123
Neural Computing and Applications (2022) 34:12749–12763 12761
Table 8 The overall ApplianceNet accuracy as compared to the state- desktop PC, and Fridge. The average of performance
of-the-art techniques measures are reported in Table 7.
Model Precision (p) Recall (r) F1- Accuracy In Table 7, the ApplianceNet has better performance as
score compared to the existing method. The common appliances
in both models are ‘Microwave’, ‘Kettle’ and ‘Toaster’,
ApplianceNet 0.87 0.88 0.88 0.89
where our framework is superior by 14%, 7% and 11%
k-nearest neighbor 0.78 0.73 0.73 0.83
respectively in terms of F1-score. Furthermore, we also
Decision tree 0.68 0.62 0.62 0.80
compare the performance of our classifier in ApplianceNet
Naive bayes 0.55 0.48 0.48 0.53
with three state-of-the-art machine learning algorithms.
These methods are decision tree, Naive Bayes classifier,
and k-nearest neighbours with default parameters. The
selection of these algorithms is based on the most fre-
Sunday, and Wednesday. This washing machine usage quently used models for the classification task. The Naive
pattern is frequent and may help to diagnose complications Bayes classifier is probability based model, which is con-
by practitioners or healthcare givers. Such information can sider as gold standard for making comparison, decision tree
also be useful for energy providers as well as residents to is well known method based on information theory to
use the washing machine in an optimal way. Consequently, calculate the information gain, and k nearest neighbour is
it can help to reduce energy consumption. the non-parametric approach that is ranked in top 10
methods in data mining algorithm. Table 8 presents the
5.3 Comparative analysis improvement obtained by ApplianceNet.
Table 8 shows that our model provides better results as
The direct comparison of presented ApplianceNet with compared to the state-of-the-art methods. Furthermore, we
existing models is difficult, since the different datasets have also presented the individual accuracy of each appliance to
been used with different set of appliances. However, a analyze the improvement.
recent study Devlin et al. [5] classify the activities of daily In Fig. 15, it is clear that the proposed ApplianceNet
living using residential smart meter data were identified performs better in most of the cases. Our model obtained
that is similar to our work in terms of recognizing the the best results in the case of ‘Microwave’, ‘Kettle’,
appliances. To recognize daily living activities they con- ‘Toaster’, and ‘Diswasher’ where state-of-the-art models
sider seven appliances—hair dryer, vacuum cleaner, iron, have more confusion to recognize these appliances.
microwave, kettle, toaster, oven. In comparison to our
framework, we recognized eight appliances—television,
microwave, kettle, washing machine, toaster, dish washer,
123
12762 Neural Computing and Applications (2022) 34:12749–12763
123
Neural Computing and Applications (2022) 34:12749–12763 12763
25. Christ M, Braun N, Neuffer J, Kempa-Liehr AW (2018) Time 29. Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B,
series feature extraction on basis of scalable hypothesis tests Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V et al
(tsfresh-a python package). Neurocomputing 307:72–77 (2011) Scikit-learn: machine learning in python. J Mach Learn
26. Christ M, Kempa-Liehr AW, Feindt M (2016) Distributed and Res 12:2825–2830
parallel time series feature extraction for industrial big data 30. Paszke A, Gross S, Massa F, Lerer A, Bradbury J, Chanan G,
applications. arXiv preprint arXiv:1610.07717 Killeen T, Lin Z, Gimelshein N, Antiga L (2019) et al. Pytorch:
27. Benjamini Y, Yekutieli D (2001) The control of the false dis- an imperative style, high-performance deep learning library. In:
covery rate in multiple testing under dependency. Ann Stat Advances in neural information processing systems,
1165–1188 pp 8026–8037
28. Murray D, Stankovic L, Stankovic V (2017) An electrical load
measurements dataset of UK households from a two-year longi- Publisher’s Note Springer Nature remains neutral with regard to
tudinal study. Sci Data 4(1):1–12 jurisdictional claims in published maps and institutional affiliations.
123