Abstract
Human activity recognition (HAR) finds application from the field of ambient assisted living (AAL), health condition monitoring to surveillance, gaming, etc. Persuaded by the enormous application area, research activity in this field has also been escalated in last decade. Application of machine learning techniques for HAR is also famed. This work utilizes a very well-known machine learning technique random forest classifier to classify five activities of daily life (ADL). For sensing data, only one wrist worn tri-axial accelerometer is used, which makes this system cost effective and handy. To reduce time complexity of the classifier, dimensionality of training features needs to be reduced. Here to get this, dimension of the raw data has been reduced using principal component analysis. After that using a very few statistical and frequency domain features, the system offers 96% classification accuracy.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
- Human activity recognition (HAR)
- Ambient assisted living (AAL)
- Activities of daily life (ADL)
- Accelerometer
- Principal component analysis (PCA)
- Random forest classifier
1 Introduction
In this modern digital era, self-dependency is one of the foremost stipulations of mankind. The aged and differently abled persons are also not out of this ensemble. The field of technology which helps to meet their craving is named ambient assisted living [1]. In the field of ambient assisted living, the primary requirement is human activity recognition. Excluding AAL, the real-time monitoring of human activity finds major application in the area of personal fitness, gaming, and entertainment. Human activity recognition can be done using two types of sensors; the first one is high-end audio visual sensor nodes with camera [2, 9], microphone [3], etc., and the second type is wearable sensors like gyroscope, accelerometer [4,5,6,7,8], thermal sensors, radio frequency identifier [10, 11], etc. Among these, the gyroscope and accelerometer are aptly felicitous for their small size, low-power consumption, fingertip availability with smart phone and smart watches, and they do not constrain user mobility while protecting their privacy. For these reason, these sensors found huge application in the field of AAL, while image or video processing-based activity recognition is useful for surveillance and security purpose. As this work deals with detection of daily life activities for assisted living, tri-axial accelerometer is used as sensor.
From the detail study of the previous proposed works for activity detection, the pr methods can broadly be categorized as the generative model and the discriminative approach. Majority of the state-of-the-art works comes under generative model category. Application of Gaussian mixture modeling (GMM) and Gaussian mixture regression (GMR) on accelerometer data [5], hidden Markov models (HMM) on RFID tag generated data in smart home environment [11], dictionary learning approach on accelerometer data [7] are some of them. In the discriminative approach for recognition of activities of daily life, we find application of support vector machine [3, 9, 12], KNN [13], decision tree [14], ANN [8], and many more classifiers. In a HMM-based HAR system, [15] classification accuracy of 69.18% is achieved, while in a principal component analysis (PCA) of video signal being accompanied with SVM classifier, 95% accuracy is reported [9]. In many HAR systems, PCA [9, 16, 17] makes a salient appearance in dimensionality reduction of large number of feature set extracted from sensor data. Walse et al. [8] shown that use of PCA reduces the dimension of feature set from 561 to 70 causing a visible reduction of modeling time while compromising very less with the accuracy of the system. PCA-based decision tree classifier is proven to be useful in classification of cancer data [18] and other medical data [19]. Being inspired by the efficient application of PCA in dimensionality reduction without losing information, it is used in this proposed work to reduce the three dimensional data of tri-axial accelerometer into one dimensional data keeping major information content within them. In this aspect, it is novel approach to wield PCA on raw sensor data unlike on feature set as seen in most state-of-the-art works. The high-classification accuracy in various discriminative approaches lead us toward the use of a very popular bagging technique named random forest classifier. Application of random forest algorithm on combined feature set of data generated by accelerometer and gyroscope is reported [20, 23] to be capable of activity recognition with accuracy of 90–98% depending on selection of activity type. In a random forest-based sports activity, recognition system around 99% detection accuracy was achieved using sensors worn on arm, forearm, belt, and dumbbell [21]. A comparative study of different classifier algorithm [22] on inertia sensors data, worn on wrist, chest, and ankle shows random forest which gives sufficiently high accuracy with very less training time.
In rest of this paper, Sect. 2 describes the data collection and pre-processing using PCA, Sect. 3 contains feature extraction, and Sect. 4 emphasis on classification of activities of daily life using random forest classifier. Result and comparative study with other related works are depicted in Sect. 5.
2 Data Collection and Pre-processing
The data for this noble activity detection algorithm are acquired from a popular benchmark dataset named human motion primitive (HMP) dataset collected from archive.ics.uci.edu [24]. In this work, five common daily life activities are considered for classification. These are (i) descend stairs, (ii) climb stairs, (iii) comb hair, (iv) brush teeth, and (v) drink glass.
Around 25 dataset of each activities are taken. These dataset contains readings of tri-axial accelerometer worn on right wrist of the volunteer, with a sampling frequency of 32 Hz. The three columns of the dataset contain coded values of accelerometer reading along X, Y, and Z direction. These data are normalized between the ranges −1.5 to +1.5 g and filtered using a median filter of size 3 to reduce noise. The sensitivity of this data is 6 bits per axis. The sample plots of data of each selected activities are shown in Fig. 1.
Observation of these plots adjudicates that though the signals of last three activities are quite different from each other, the nature of signals of first two activities is very much similar. Also the data of the three axis for a particular activity are very much random in nature, and it is difficult to establish any mathematical relationship in between them. Therefore in most of the related work, features are extracted from all the three columns of sensor data, and a large dimensional feature set is developed which increases complexity and execution time of the classifier algorithm.
This work uses a different approach by reducing the dimensionality of the raw data while protecting the major information content within them. Here, principal component analysis (PCA) comes out to be the best possible tool to extract a single dimensional data from the three dimensional data without reducing the information content in the raw dataset.
PCA is a method of representing a given dataset A of a certain dimension into a derived dataset of same dimension where the axis of representing the vector samples of the data matrix is different. For example, if A is an n dimensional matrix, given by A = {A1, A2, A3 … An}, PCA converts it into another n dimensional matrix B = {B1, B2, B3 … Bn} where most of the information of dataset A is conserved into the first few columns of matrix B. Thus, the dimensionality of matrix A is reduced significantly with a small tradeoff information content in initial data.
A can be converted to B by a matrix computation
where C is an n × n coefficient matrix.
Its values are determined in such a way that maximum variance of new data is ensured in first column of matrix B, and this variance gradually reduces as we proceed toward 1 to n. Here, information content in a data is basically represented by its variance. But direct determination of C is not possible, therefore covariance matrix K is computed using following equation.
where Aʹ is the mean of the considered data samples and is given by
Next, the eigenvalues of Kn × n for initial data A are calculated, and let they are denoted by λ1, λ2, … λn. Here, λ1 ≥ λ2 ≥ λ3… λn − 1 ≥ λn. Then, eigenvectors corresponding to n eigenvalues are computed among them m eigenvectors S1, S2 … Sm associated with m highest eigenvalues define the representation of data A into m dimensional axis known as principal axis. In this work, the raw dataset is 3 dimensional, and PCA decomposes each dataset into three different uncorrelated array of data, which are actually the eigenvectors SCORE1, SCORE2, SCORE3. The plot of these for a ‘comb hair’ dataset is shown in Fig. 2. Among these only the array of data with highest eigenvalue, i.e., the first one is taken for further analysis which is also known as principal component of data. Plot of this for the same dataset is shown in Fig. 3. This single dimensional principal component data with highest variance are taken for further analysis.
3 Feature Extraction
Several time domain and frequency domain features of this principal component of accelerometer data are calculated. Mean, median, variance, standard deviation, kurtosis, and RMS value are the time domain features estimated here, among them the variance and standard deviation are found to come up as very much significant in the classification algorithm.
The significant frequencies of this principal component of data are determined using fast Fourier transform technique.
The frequency spectrum got from this is shown in Fig. 4. The peak amplitude in this spectrum and its corresponding frequency is recorded as two significant feature for classification. A complex feature is derived by taking the ratio of this recorded amplitude and frequency denoted as ratio of amplitude to frequency (RAF).
The most significant features which are used in classification process are, respectively, variance (var), standard deviation (std), peak amplitude of frequency spectrum (amp), corresponding frequency of this peak amplitude (principal frequency), and ratio of this amplitude and frequency (RAF). The feature table with three sample dataset of each activity is shown in Table 1. In actual practice, 25 such datasets of each activity are analyzed to form a feature set of 125 (25 × 5) rows and 5 columns.
4 Classification Based on Random Forest
Random forest classifier is used to classify the five different types of activity. Random forest is a popular bagging technique. Here, if a n × m dimensional feature set is used to train a classifier, then it randomly selects some ensembles of feature samples with dimension p × q where p < n and q < m. Presence of feature samples in these ensembles is repetitive. Decision trees are formed using each ensemble by choosing the best suitable feature to split training set on the node without pruning. Thus, largest possible trees are grown by selecting appropriate feature and binary classification at every node. In programming, this is done using nested if else loop. Here, some of the feature data samples may remain out of the ensembles which are known as out of bag samples. At every iteration of a tree grown using a selected ensemble of samples, the out of bag classification error is calculated which plays an important role in determination of appropriate number of trees to be grown in the random forest to get best classification result. Thus, once the training is completed, the testing can be done using a feature set of any unknown class. Different class prediction may be obtained by different decision trees, and the final prediction result is achieved by maximum class voting.
Here from the feature table among the 25 datasets of a particular activity, 15 randomly selected datasets are taken for training the classifier model, while 10 datasets are kept for testing purpose. Thus, the input to the classifier is the feature dataset (X) and a class variable (Y) which contains the classes of activity to be trained for its corresponding features. Here, five different types activities are to be classified, and in the class variable, they are denoted as follows; descend stairs as ‘1’, climb stairs as ‘2’, comb hair as ‘3’, brush teeth as ‘4’, and drink glass as ‘5’. The random forest classifier then generates number of decision trees as specified by user, here in this case 10.
The number of grown trees is taken as 10 by viewing the number of grown trees versus out of bag classification error plot as shown in Fig. 5. From the graph, it is observed that the classification error is minimum for approximately 10 grown trees, which increases further and remains almost constant for up to 30 grown trees. In detail experimentation, it was observed that this error increases further with number of grown trees due to overtraining. Therefore, 10 decision trees are finally grown during training. One such grown decision tree is shown in Fig. 6, where at every node, a binary split is occurring depending on a threshold value of a certain feature denoted as x1, x2 … x5. Such binary classification at multiple stage gives rise to a complete tree capable to decide class of all the five activities denoted as 1–5.
Thus, the trained classifier model when fed by a test feature set of a unknown activity 10 decisions emerges from 10 classification trees among these which decision gets majority votes that comes out as final class prediction. Similarly by testing on 10 feature sets of each activity, 96% accuracy is achieved. The test results are shown in Table 3.
5 Result
The developed human activity detection system is found to be capable of detecting five activities of daily life with an average accuracy of 96%. The confusion matrix is formed with the classification results of test data which are 40% of the total available dataset. Remaining 60% data are used for training. The confusion matrix in Table 2 shows four activities climb stairs, comb hair, brush teeth, and drink something from a glass are truly detected with 100% accuracy. Where only 20% of descend stairs is detected as climb stairs which is false detection. The accuracy of a particular activity detection is calculated as (true positive/number of instances) × 100%. Table 3 shows classification accuracy of five different activities. The average of those 96% is considered to be the overall accuracy of the proposed model (Table 4).
Around 95–98% classification accuracy is achieved by a SVM-based HAR system [9] which uses camera as sensor node. The BiLSTM RNN system [16] registered average accuracy of 97.64% using three accelerometer, two gyroscope, two magnetometer, and one ECG sensor. In two other random forest-based multi-sensor HAR systems, overall accuracy of 93.44 [22] and 90% [23] is reported. In comparison with these state-of-the-art works, this proposed system ensures 96% detection accuracy with only single wrist worn accelerometer, which makes the system simple, feasible, and cost effective.
6 Discussion
This proposed method is found to be capable of recognizing human activity with a reasonably good accuracy using limited resource, i.e., only one tri-axial accelerometer. Application of PCA on the raw sensor data reduces the dimension of data keeping all important information. This leads to less time complexity and faster response of the system reducing amount of data handling requirement. The MATLAB program execution time in a i3 7th Gen PC with 8 GB RAM is approximately 4.5 s. Application of random forest classifier gives 100% detection accuracy for four activity and 80% for descend stair only. Hence, it is worth saying that the proposed method can be adopted to develop small, wearable, and cost-effective HAR systems. Application of this HAR method for more number of ADL detection is future plan of this work.
References
Amina E, Anouar A, Abdellah T, Abderahim T (2018) Ambient assisted living system’s models and architectures: a survey ofthe state of the art. J King Saud Univ Comput Inf Sci. https://doi.org/10.1016/j.jksuci.2018.04.009
Costa A, Castillo JC, Novais P, Fernndez-Caballero A, Simoes R (2012) Sensor-driven agenda for intelligent home care of the elderly. Expert Syst Appl 39:12192–12204
Fleury A, Vacher M, Noury N (2010) Svm-based multimodal classification of active ities of daily living in health smart homes: sensors, algorithms, and first experimental results. IEEE Trans Inform Technol Biomed 14:274–283. ID: 1
Chernbumroong S, Cang S, Atkins A, Hongnian Y (2013) Elderly activities recognition and classification for applications in assisted living. Expert Syst Appl 40:1662–1674
Bruno B, Mastrogiovanni F, Sgorbissa A, Vernazza T, Zaccaria. Analysis of human behaviour recognition algorithms based on acceleration data. In: 2013 IEEE international conference on robotics and automation (ICRA) Karlsruhe, Germany, May 6–10, 2013, pp 1602–1607
Bruno B, Mastrogiovanni F, Sgorbissa A, Vernazza T, Zaccaria R Human motion modelling and recognition: a computational approach. In 8th IEEE international conference on automation science and engineering, Seoul, Korea, August 20–24, 2012, pp 156–161
De P, Chatterjee A, Rakshit A Recognition of human behaviour for assisted living using dictionary learning approach. IEEE Sens J. https://doi.org/10.1109/JSEN.2017.2787616
Walse KH, Dharaskar RV, Thakare VM PCA based optimal ANN classifiers for human activity recognition using mobile sensors data. In: First international conference on information and communication technology for intelligent systems: volume 1, smart innovation, systems and technologies, p 50. https://doi.org/10.1007/978-3-319-30933-0_43
Shiripova LV, Myasnikov EV Human action recognition using dimensionality reduction and support vector machine. In: 5th international conference on “information technology and nanotechnology” (ITNT-2018)
Huang P-C, Lee S-S, Kuo Y-H, Lee K-R (2010) A flexible sequence alignment approach on pattern mining and matching for human activity recognition. Expert Syst Appl 37:298–306
Kasteren TV, Noulas A, Englebienne G, Krose B (2008) Accurate activity recognition in a home setting. In: Proceedings the 10th international conference ubiquitous computing, Tokyo, Sept. 11–14, pp 1–8
Manosha Chathuramali KG, Rodrigo R (2012 ) Faster human activity recognition with SVM. In: The international conference on advances in ICT for emerging regions—ICTer, pp 197–203
Jain A, Kanhangad V (2018) Human Activity classification in smartphones using accelerometer and gyroscope sensors. IEEE Sens J 18(3):1169–1177
Huang YC, Yi CW, Peng WC, Lin HC, Huang CY (2017) A study on multiple wearable sensors for activity recognition. In: 2017 IEEE conference dependable security computing, pp 449–452
Brezmes T, Gorricho JL, Cotrina J (2009) Activity recognition from accelerometer data on a mobile phone. In: Lecture notes computer science (including subseries on lecture notes artificial intelligence lecture notes bioinformatics), vol 5518 LNCS, no. PART 2, pp 796–799
Aljarrah AA, Ali AH (2019) Human activity recognition using PCA and BiLSTM recurrent neural networks In: 2nd international conference on engineering technology and their applications-IICET2019, IEEE
Abidine MB, Fergani B (2013) Evaluating a new classification method using PCA to human activity recognition. In: International conference on computer medical applications, ICCMA, pp 1–4
Chokka A, Sandhya Rani K (2019) PCA based regression decision tree classification for somatic mutations. Int J Eng Adv Technol (IJEAT) 8(6S3). ISSN: 2249–8958
Sasikala S, Appavu Alias Balamurugan S Data classification using PCA based on effective variance coverage (EVC). In: IEEE international conference on emerging trends in computing, communication and nanotechnology (ICECCN 2013)
Sijo Antony NJ, Kavitha R (2017) Human activity recognition from sensor data using random forest algorithm. Int J Adv Res Comput Sci [S.l.] 8(3):334–337. ISSN 0976-5697
Mandha P, Lavanya Devi G, Viziananda Row S (2017) A random forest based classification model for human activity recognition. Int J Adv Sci Technol Eng Manage Sci 3(1) (IJASTEMS-ISSN: 2454-356X)
Feng Z, Mo L, Li M (2015) A random forest-based ensemble method for activity recognition. In: 37th annual international conference of the IEEE engineering in medicine and biology society
Xu L, Yang W, Cao Y, Li Q (2017) Human activity recognition based on random forests. In: 2017 13th international conference on natural computation, fuzzy systems and knowledge discovery (ICNC-FSKD), pp 548–553. https://doi.org/10.1109/FSKD.2017.8393329
UCI Machine Learning Repository. Dataset for ADL recognition with wrist-worn accelerometer data set. https://archive.ics.uci.edu/ml/datasets/Dataset+for+ADL+Recognition+with+Wrist-worn+Accelerometer
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Mandal, R., Maji, U., Pal, S. (2022). Human Activity Recognition: A Step Toward Ambient Assisted Living. In: Chong, P.H.J., Kalam, A., Pascoal, A., Bera, M.K. (eds) Emerging Electronics and Automation. Lecture Notes in Electrical Engineering, vol 937. Springer, Singapore. https://doi.org/10.1007/978-981-19-4300-3_17
Download citation
DOI: https://doi.org/10.1007/978-981-19-4300-3_17
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-19-4299-0
Online ISBN: 978-981-19-4300-3
eBook Packages: Computer ScienceComputer Science (R0)