Abstract
Accurately recognizing the rare activities from sensor network based smart homes for monitoring the elderly person is a challenging task. Typically a probabilistic models such as the Hidden Markov Model (HMM) and Linear Discriminant Analysis (LDA) are used to classify the activities. In this work, we demonstrate that discriminative model named Support Vector Machines (SVM) based on the Synthetic Minority Over-sampling Technique (Smote) outperforms HMM, LDA and standard SVM and it can lead to a significant increase in recognition performance. Our experiments carried out on multiple real world activity recognition datasets, consisting of several weeks of data.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
As the number of elderly people in our society increases and the households will include someone who needs help performing basic activities of daily living such as cooking, dressing, toileting, bathing and so on [1, 2]. For their comfort and because the healthcare infrastructure will not be able to handle this growth, it is suggested to assist sick or elderly people at home. Sensor based technologies in the home is the key of this problem. Sensor data collected often needs to be analysed using data mining and machine learning techniques [3] to determine which activities took place. State of the Art methods used for recognizing activities can be divided in two main categories: generative models and discriminative models [3].
However, activity recognition datasets are generally imbalanced, meaning certain activities occur more frequently than others. However, the learning system may have difficulties to learn the concept related to the minority class. Many popular machine learning algorithms have been tried to see how well they can cope with the imbalanced situation [4], e.g. Weighted Support Vector Machine (WSVM) [5], k-Nearest Neighbors k-NN [5], random forests [6] and CS-SVM [7].
The main contribution of our work is twofold. Firstly, we demonstrate the efficiency of the standard discriminative method named Support Vector Machines (SVM) [3] combined with the Synthetic Minority Over-sampling Technique [8] in order to avoid the overfitting caused by imbalanced activity samples in smart homes. Secondly, this method is compared with the standard SVM, Linear Discriminant Analysis (LDA) [9] and Hidden Markov Model (HMM) [2].
2 Discriminative Models for Activity Recognition
2.1 Linear Discriminant Analysis (LDA)
Given a set of observations in n-dimensional space: \(D_{i} = \left\{ {x_{1}^{i} ,\, \ldots ,x_{{m_{i} }}^{i} } \right\}\;(x_{j}^{i} \,{ \in }\,R^{n} )\) from class \(C_{i} (i = 1, \ldots ,N,N\) is the number of classes), we assume that each of the class probability density functions can be modeled as normal distribution. Define the prior probabilities \(p(C_{i} )\), means \(\bar{m}_{i}\), and covariance matrices Σ i of each class:
where \(m_{i}\) is the number of patterns in class \(C_{i}\). With LDA all classes are assumed to have the same covariance matrices Σ i , …, Σ N , on (1). We assign the new feature vector that is to be classified x to \(C_{i}\) with the linear discriminant function \(d_{i}\). This function is obtained by simplification the quadratic discriminant rule [9]
in which S w is the common covariance matrix
The classification rule is given in Eq. 4.
2.2 Proposed Approach for Activity Recognition (Smote-SVM)
Smote-SVM approach is shown in Fig. 1. In the training phase, we perform the necessary pre-processing on the activity data represented in a feature space. We need only to correct the class imbalance using the pre-classification named Smote strategy. The balanced data is then used to learn the SVM classifier. It will then be used to process a new observation during the testing phase where the associated ADL class will be predicted.
-
a.
The Synthetic Minority Over-sampling Technique (SMOTE)
The SMOTE algorithm generates artificial data based on the feature space similarities between existing minority examples in the training set. Synthetic examples are introduced along the line segment between each minority class example and one of its k minority class nearest neighbors. The k-nearest neighbors (k-NN) are defined as the k elements of subset \(S_{{{\mathbf{min}}}} \,{ \in }\,S\) whose Euclidian distance between itself and \(x_{i} \,{ \in }\,S_{{{\mathbf{min}}}}\) under consideration exhibits the smallest magnitude along the n-dimensions of feature space X. To create a synthetic sample, the k-nearest neighbors are randomly chosen, then multiply the corresponding feature vector difference with a random number \(\delta \,{ \in }\,[0,1]\), and finally, add it to x i
where \(x_{i} \,{ \in }\,S_{{{\mathbf{min}}}}\) is the minority instance under consideration, \(\hat{x}_{i}\) is one of the k-NN for \(x_{i}\): \(\hat{x}_{i} \,{ \in }\,S_{{{\mathbf{min}}}}\).
-
b.
Support Vector Machines (SVM)
We assume that we have a training set \(\left\{ {\left( {x_{i} ,y_{i} } \right)} \right\}_{i = 1}^{m}\) where \(x_{i} \,{ \in }\,R^{n}\) are the observations and y i are class labels either 1 or −1. The dual formulation of the SVM can be solved by representing it as a Lagrangian optimization problem as follows [3]:
where \(K(x_{i} ,x_{j} )\) is the kernel, the radial basis kernel function (RBF) is used in the study:\(K(x,y) = \exp \left( {\tfrac{ - 1}{{2\sigma^{2} }}\left\| {x_{i} - x_{j} } \right\|^{2} } \right)\). \(\alpha_{i} > 0\) are Lagrange multipliers. The regularization parameter C is used to control the trade-off between maximization of the margin width and minimizing the number of training error.
Solving (6) for \(\alpha\) gives a decision function in the original space for classifying a test point \(x\, \in \,R^{n}\) [3]
with \(m_{sv}\) is the number of support vectors \(x_{i} \,{ \in }\,R^{n}\).
In this study, a software package LIBSVM [10] was used to implement the multiclass classifier algorithm. It uses the one-versus-one method [3].
3 Experimental Results
We use an openly datasets [11] gathered from three houses KasterenA, KasterenB, KasterenC, having different layouts and different number of sensors, thus providing a diverse testbed. The activities performed using a wireless sensor network with a single man occupant. Data are collected using binary sensors, such as reed switches and float sensors. The sensor data were labelled using different annotation methods using Bluetooth headset or Handwritten diary. We separate the data into a test and training set using a “Leave one day out cross validation” approach [2].
As the activity instances were imbalanced between classes, we evaluate the performance of our models by two measures, the accuracy and the class accuracy. The accuracy shows the percentage of correctly classified instances, the class accuracy shows the average percentage of correctly classified instances per classes. They are defined as follows:
in which [a = b] is a binary indicator giving 1 when true and 0 when false. m is the total number of samples, N is the number of classes and m c the total number of samples for class c. A problem with the accuracy measure is that it does not take differences in the frequency of activities into account. Therefore, the class accuracy should be the primary way to evaluate an activity classifier’s performance.
In our experiments, for the Smote-SVM method, the minority class examples were over-sampled using k = 4 nearest neighbors for Smote. We utilize the leave-one-day-out cross validation technique for the selection of width parameter for the SVM classifier. We found σ opt = 1, σ opt = 1 and σ opt = 2 for these datasets respectively. The summary of the accuracy and the class accuracy obtained, for HMM, LDA, SVM and Smote-SVM methods performed using various real world datasets are shown in Table 1. This table shows that Smote-SVM performs better in terms of class accuracy.
Our results give us early experimental evidence that Smote-SVM works better for model classification; it consistently outperforms the other methods in terms of the class accuracy for all datasets. In the rest of section, we explain the difference in terms of performance between HMM and our method. HMM is trained by splitting the training data in which a separate model \(P(x|y)\) is learned for each class, as parameters are learned for each class separately. This is why HMM performs better for the minority activities. Our method shows that SVM becomes more robust for classifying the minority class.
4 Conclusion and Perspectives
Our experiments on real world datasets show that the choice of Smote-SVM approach can significantly increase the recognition performance to classify multiclass sensory data, and are less prone to overfitting caused by imbalanced datasets. It significantly outperforms HMM, LDA and SVM. Developing Classifiers which are robust and skew insensitive or hybrid algorithms can be point of interest for the future research in activity recognition. It would be interesting to compare Smote-SVM and Smote-CS-SVM [7] and then deciding which gives the best results.
References
Abidine, M.B., Fergani, L., Fergani, B., Fleury, A.: Improving human activity recognition in smart homes. Int. J. E-Health Med. Commun. (IJEHMC) 6(3), 19–37 (2015)
Van Kasteren, T., Noulas, A., Englebienne, G., Kröse, B.: Accurate activity recognition in a home setting. In: Proceedings of UbiComp’08, pp. 1–9. ACM, New York, USA (2008)
Vapnik, V.N.: The Nature of Statistical Learning Theory. Springer, New York (2000)
Chawla, N.V.: Data mining for imbalanced datasets: an overview. In: Data Mining and Knowledge Discovery Handbook, (pp. 875–886). Springer, US (2010)
Abidine, M.B., Fergani, B.: A new multi-class WSVM classification to imbalanced human activity dataset. J. Comput. 9(7), 1560–1565 (2014)
Chen C., Liaw, A., Breiman, L.: Using random forest to learn unbalanced data. Technical Report 666, Statistics Department, University of California at Berkeley (2004)
Abidine, M.B., Fergani, B., Oussalah, M., Fergani, L.: A new classification strategy for human activity recognition using cost sensitive support vector machines for imbalanced data. J. Kybernetes 43(8), 1150–1164 (2014)
Chawla, N.V., Bowyer, K.W., Hall, L.O., Kegelmeyer, W.P.: SMOTE: synthetic minority over-sampling technique. J. Artif. Intell. Res. 16, 321–357 (2002)
Croux, C., Filzmoser, P., Joossens, K.: Classification efficiencies for robust linear discriminant analysis. Statistica Sinica 18(2), 581–599 (2008)
Chang, C.C., Lin, C.J.: LIBSVM: a library for support vector machines. ACM Trans. Intell. Syst. Technol. 2:1–27 (2013). http://www.csie.ntu.edu.tw/~cjlin-/libsvm/
Van Kasteren, T., et al.: Effective performance metrics for evaluating activity recognition methods. In: Proceedings of ARCS 2011 Workshop on Context-Systems Design, Evaluation and Optimisation, pp. 22–23. Italy (2011)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Abidine, M.B., Fergani, B. (2016). Comparing HMM, LDA, SVM and Smote-SVM Algorithms in Classifying Human Activities. In: El Oualkadi, A., Choubani, F., El Moussati, A. (eds) Proceedings of the Mediterranean Conference on Information & Communication Technologies 2015. Lecture Notes in Electrical Engineering, vol 381. Springer, Cham. https://doi.org/10.1007/978-3-319-30298-0_70
Download citation
DOI: https://doi.org/10.1007/978-3-319-30298-0_70
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-30296-6
Online ISBN: 978-3-319-30298-0
eBook Packages: EngineeringEngineering (R0)