Abstract
Nowadays, mobile phone sensor technology is advancing at a great pace and is consequently used to perform several tasks with the preinstalled GPS and accelerometer sensors on it. Different human activities including jogging, sitting, standing, walking, climbing stairs, etc., are automatically recorded on a cell phone with the help of installed sensors. The stored data is used to recognize human activities using various machine learning algorithms. In this paper, the performance evaluation of Ensemble learner on the raw sensor data is performed. The WISDM dataset, which uses a phone-based accelerometer to recognize the activities of a human, is used for experimentation. The used dataset keeps a record of the basic human activities such as jogging, sitting, standing, walking, climbing up and down stairs, in the day to day life. The WISDM data contains some missing values which are replaced using the average values. The ensemble classifiers including random forest, AdaBoost, and bagging are used for human activity classification. The performance of classifiers is evaluated against the parameters of accuracy, recall, precision, and f1-measures. The experimentation suggests that the random forest classifier outperforms the other two on every parameter value.
Access provided by Autonomous University of Puebla. Download chapter PDF
Similar content being viewed by others
Keywords
1 Introduction
The smartphones are equipped with powerful preinstalled sensors such as audio sensors, GPS sensors, image sensors, temperature sensors, light sensors, acceleration sensors, and direction sensors which are very much useful for a human [1]. These small mobile devices with fast computing powers to send and receive data create a whole new domain for data mining applications and research.
All the smartphones and music players, including the iPod and the iPhone [2], have triaxial accelerometers installed, which measure the acceleration in all the three spatial dimensions. These accelerometers are highly capable of detecting the location of the mobile device which is very useful and important information for activity recognition. Initially, the accelerometer was installed into these devices to enable the screen rotation and to support advanced game playing, but later the use extended to recognize a user’s activity and many other useful applications. The phone can gather the information about the activity which a human performs and can be used by various applications as per the requirement.
Activity recognition of a human’s body is not a new concept [3]; the concept is used to recognize almost 25 human body activities using the biaxial accelerometer situated in five different locations on the human body. The data used to predict user’s energy consumption [4], the movement of the user after the fall [5], and user’s activity level so that it can be used to promote user’s health and fitness [6]. Earlier studies involved smartphones that focused on a very small set of users [7] and for particular user [8] they had trained models rather than making a universal model which can be applied to any user.
This paper discussed the use of accelerometer sensor installed on a mobile phone, to recognize human activity. The data is taken from mobile phones based on the Android operating system because such phones are easy to handle, operate and are also becoming popular day by day covering the whole market.
The ensemble learning algorithms, namely, random forest, AdaBoost, and bagging are used on the data generated by more than 29 users while performing various physical activities such as jogging, sitting, standing, walking, and climbing stairs. The performance of used ensemble learners is evaluated using accuracy, f1 score, recall, and precision.
Rest of the paper is organized as follows: Sect. 2 discusses related work, and Sect. 3 defines the process, which addresses the activity recognition task and collection of data, preprocessing of data and transformation of data. Section 4 gives us a brief knowledge about the experiments, and the results and Sect. 5 summarizes the future work along with the conclusion.
2 Related Work
The availability of accelerometers in smartphones is increasing day by day, capturing of human activity is becoming very easy. Enormous work has already been reported on the activity recognition using several accelerometers positioned on different body parts to get the of the user’s activity record. In [3] data recorded to track the change in user’s daily activity, five accelerometers on 20 user’s are analyzed using C4.5 and Naive Bayes classifiers and made a model capable of recognizing 20 activities which a user can perform. The results demonstrated that the accelerometers which were placed at thigh proved to be more powerful in recognizing the user’s activity as compared to the others placed on different body parts.
In [9], two accelerometers are employed on three subjects for recording five human activities such as to sit, to walk, to run, to stand, and lie down. The results of this paper claim that the thigh accelerometer was unable to detect activities properly. Therefore, a need arises to place accelerometers at various body parts to resolve the issue. In [10], the data collected from ten different users wearing accelerometers on their lower body parts is tested and analyzed by applying different learning methods. In [11], activity data recorded by putting five accelerometers at different body locations of 21 subjects. The data is used for implementation of a real-time model for recognizing 30 activities added the dataset from the heart monitor along with the accelerometer data.
In [12], authors utilized five triaxial accelerometers attached to different body locations such as wrist, ankle, hip, thigh, and arm to identify 20 activities of 13 different users. The authors used several learning methods to recognize various postures such as standing, lying, sitting, and five movements which include walking, stair climbing, running, and cycling. In [13], five accelerometers in one experiment to generate the dataset are utilized, out of which two accelerometers were used for activity recognition. The experimentation was performed on 31 males, and a hierarchical classification model was designed to easily differentiate between the postures like lying and sitting at different specific angles and also to distinguish between the motions of walking and climbing stairs at different speeds.
In [14], authors identify the user activities such as standing, lying, walking, running, swimming, football, playing ball, croquet, and for using the toilet in the specific locations of subjects by 20 different types of sensors worn on wrist and chest. In [15], activities and locations such as standing, sitting, walking on the ground, walking downstairs, and walking upstairs using the biaxial accelerometer in the sensor module and also used angular velocity sensor kept in the pocket with the digital compass worn by the user at the waist are recognized. In [16], a model capable of recognizing same activities was built, and the dataset was taken from the triaxial accelerometer, phototransistors, temperature and barometric pressure sensors, two microphones, and GPS to distinguish between a stationary state, walking, jogging, driving a vehicle, and climbing up and down stairs. The other systems were not very practical as they involved multiple sensors situated all across the body but in [17] author used a system which involved various accelerometers or combination of accelerometers capable of identifying a wide range of activities. The system can work for only some small-scale applications (e.g., hospital setting). In [18], six activities are identified by employing a watch fitted on the belt, shirt’s pocket, backpack, and trouser pocket. The “e-Watch” dwelled with the biaxial accelerometer and the light sensor and used four classifiers along with five-fold cross-validation. In [4], seven different types of sensors are utilized for the recognition of activities such as walking, sitting, standing, ascending stairs, descending stairs, elevator moving up and down, and brushing one’s teeth.
3 Activity Recognition Task
This section describes the processes for activity recognition and also describes activity recognition. Section 3.1 tells about the raw accelerometer data that have been collected, Sect. 3.2 describes the processing and transformation of raw data into a set of examples and describes the activities that are to be identified or are going to be identified.
3.1 Collection of Data
To collect data for supervised learning, it is mandatory to have large Android-based smartphone users who carry their smartphone with them while they are performing an activity. The data generated by different users were evaluated who carried their smartphone while performing any task like they carried their smartphone in the front pants leg pocket while they were standing, sitting, walking, running, jogging, ascending stairs or descending stairs for a particular period.
The collected data is controlled by a phone-based application which is designed to fulfill the same. This application helps to keep the record of the user’s name, the start and stop time of the user and the activity completed by the user.
3.2 Materials and Methods
The raw time data should be transformed at first as Standard classification algorithm because it cannot be applied directly. Therefore, the data is first preprocessed and transformed into training examples [9]. In the next step, the training dataset is used to make a model to recognize the activities such as jogging sitting, standing, walking, and climbing up and down stairs. Using the information or the dataset, the model recognizes the activities to keep a record of them, which can be used to help the user evaluate whether his daily activity is performing, and the accelerometer also plots the graph of the activities a user performs [10].
4 Experiments and Results
In experimentation, the raw data is collected from WISDM. The WISDM is an Android-based data collection platform consists of software and hardware architecture used to channelize the human activity data through a sensor-based smartphone to the Internet-based server and then the data is transformed. The steps are taken to evaluate the results are shown in Fig. 1, the first step is to take the raw data set which includes the missing values in multi-class than the average of the values are calculated, and the missing values are replaced with the average value. In the next step, the three classifiers are applied at ten-fold cross-validation, and the accuracy of all the three classifiers is evaluated. Moreover, a model is designed which predicts the daily activities such as jogging, sitting, standing, walking, climbing stairs, downstairs with the help of a cell phone based accelerometer that allows a user to have a daily check on his routine whether he is performing his daily routine regularly or not.
The experiment uses a dataset and records the accuracy from three different classifiers, i.e., random forest, AdaBoost, and begging for ten k-folds, and then the average accuracy is calculated. The random forest classifier results in maximum accuracy, and AdaBoost classifier results in the least accuracy.
The results as shown in Table 1 details about the various parameter values obtained on applying different classifiers on the dataset. Random forest classifier outperforms the other two on every parametric value and results into the maximum accuracy of 90.20% which is very high compared to AdaBoost classifier which yields only 67.83% accuracy. The accuracy of bagging classifier is 89.27% which is very much close to that of random forest classifier with 90% accuracy, but the best average result is obtained from random forest classifier.
On the parameter of the F1 score, AdaBoost classifier gives least performance of 61.84% followed by the Bagging classifier with 89.36%. Random forest classifier results into 90.02% F1 score and 90.20% recall value followed by the Bagging with 89.27% and AdaBoost with 67.83% recall value. The precision value for Bagging classifier is 89.76% almost equal to that of Random forest classifier with 90.17%. The AdaBoost again results into least precision of 61.10%.
The performance of AdaBoost classifier on all parametric values is very close to the random forest. However, the best average results are obtained using the random forest. Therefore, out of the three classifiers used Random forest gives the best average result.
The graph in Fig. 2 distinguishes between the average accuracy, the f1 score, recall, and the precision obtained using the three classifiers, and it can be seen that the average best results are obtained from the random forest classifiers.
A confusion matrix is a way of classifying true positives, true negatives, and false positive and false negatives when there are more than two classes. Confusion matrix makes it easy to compute the precision and recall of a class. It is used for computing the precision and recall and hence f1 score for multi-class problems. The columns in Table 2 represent the actual values, and rows represent the predicted values.
In Tables 2, 3, and 4 the confusion matrices are presented which are associated with the three classification algorithms. The confusion matrix indicates the prediction and prediction errors due to confusion between the activities.
Table 2 gives the confusion matrix for random forest classifier in which jogging class is predicted correctly.
Table 3 gives us the confusion matrix about the AdaBoost classifier.
Table 4 gives us the confusion matrix about the bagging classifier.
The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements represent those that are mislabelled by the classifier. The higher the diagonal values of the confusion matrix, the better, indicating many correct predictions.
5 Conclusion
This paper compares the performance of ensemble learners on human activity dataset obtained from WISDM Android-based data collection platform. The WISDM keeps a record of the basic human activities such as jogging, sitting, standing, walking, climbing stairs, downstairs in the day to day life. The raw dataset is preprocessed and prepared for experimentation. The experiments are performed on human activity dataset and record the performance from three different classifiers, i.e., random forest, AdaBoost and begging for ten k-folds, and then the average accuracy is calculated. The classifiers performance is evaluated on the basis of accuracy, average accuracy, f1 score, recall, and precision are calculated along with the confusion matrix. The random forest classifier results in maximum accuracy, and AdaBoost classifier results in the least accuracy.
In future, experiments may be performed with added activities, for instance, bicycling and car driving. The experimental data may be retrieved from users for the possible improvement in the results. More refined and practical features can be developed when collecting the raw time-series data. The impact of placing the cell phone at user’s different body locations like as on a belt loop may be tested.
References
Weiss, G.M.: WISDM (Wireless Sensor Data Mining) Project. Fordham University, Department of Computer and Info. Science (2011)
Nolan, M., Mitchell, J.R., Doyle-Baker, P.K.: Validity of the Apple iPhone{®}/iPod Touch{®} as an accelerometer-based physical activity monitor: a proof-of-concept study. J. Phys. Act. Health 11, 759–769 (2014)
Bao, L., Intille, S.: Activity recognition from user-annotated acceleration data. Pervasive Comput. 1–17 (2004)
Choudhury, T., Hightower, J., Rahimi, A., Rea, A., Hemingway, B., Koscher, K., Landay, J.A., Lester, J., Wyatt, D.: The mobile sensing platform: an embedded activity recognition system. IEEE Pervasive Comput. 7, 32–41 (2008)
Mathie, M.J., Lovell, N., Sydney, U.: Classification of basic daily movements using a triaxial accelerometer. Med. Biol. Eng. Comput. 42, 679–687 (2004)
Anderson, I., Maitland, J., Sherwood, S., Barkhuus, L., Chalmers, M., Hall, M., Brown, B., Muller, H.: Shakra: tracking and sharing daily activity levels with unaugmented mobile phones. Mob. Netw. Appl. 12, 185–199 (2007)
Yang, J.: Toward physical activity diary: motion recognition using simple acceleration features with mobile phones. In: Proceedings of the 1st International Workshop on Interactive Multimedia for Consumer Electronics, pp. 1–10 (2009)
Brezmes, T., Gorricho, J.L., Cotrina, J.: Activity recognition from accelerometer data on a mobile phone. In: Distributed Computing, Artificial Intelligence, Bioinformatics, Soft Computing, and Ambient Assisted Living, pp. 796–799 (2009)
Weiss, G.M., Hirsh, H.: Learning to predict extremely rare events. In: AAAI Workshop on Learning from Imbalanced Data Sets, pp. 64–68 (2000)
Kwapisz, J.R., Weiss, G.M., Moore, S.A.: Activity recognition using cell phone accelerometers. ACM SIGKDD Explor. Newsl. 12, 74–82 (2011)
Krishnan, N.C., Colbry, D., Juillard, C., Panchanathan, S.: Real time human activity recognition using tri-axial accelerometers. In: Sensors, Signals and Information Processing Workshop, pp. 3337–3340 (2008)
Tapia, E.M., Intille, S.S., Haskell, W., Larson, K.W.J., King, A., Friedman, R.: Real-time recognition of physical activities and their intensities using wireless accelerometers and a heart monitor. In: International Symposium on Wearable Computers, pp. 37–40 (2007)
Mannini, A., Sabatini, A.M.: Machine learning methods for classifying human physical activity from on-body accelerometers. Sensors 10, 1154–1175 (2010)
Foerster, F., Fahrenberg, J.: Motion pattern and posture: correctly assessed by calibrated accelerometers. Behav. Res. Methods 32, 450–457 (2000)
Juha, P., Peltola, J.: Activity classification using realistic data from wearable sensors. IEEE Trans. Inf Technol. Biomed. 10, 119–128 (2006)
Lee, S.W., Mase, K.: Activity and location recognition using wearable sensors. IEEE Pervasive Comput. 1, 24–32 (2002)
Subramanya, A., Raj, A., Bilmes, J.A., Fox, D.: Recognizing activities and spatial context using wearable sensors. arXiv preprint arXiv:1206.6869 (2012)
Maurer, U., Smailagic, A., Siewiorek, D.P., Deisher, M.: Activity recognition and monitoring using multiple sensors on different body positions. In: International Workshop on Wearable and Implantable Body Sensor Networks, BSN 2006, 4–pp (2006)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Singapore Pte Ltd.
About this chapter
Cite this chapter
Sisodia, D.S., Yogi, A.K. (2019). Performance Evaluation of Ensemble Learners on Smartphone Sensor Generated Human Activity Data Set. In: Shukla, R.K., Agrawal, J., Sharma, S., Singh Tomer, G. (eds) Data, Engineering and Applications. Springer, Singapore. https://doi.org/10.1007/978-981-13-6351-1_22
Download citation
DOI: https://doi.org/10.1007/978-981-13-6351-1_22
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-13-6350-4
Online ISBN: 978-981-13-6351-1
eBook Packages: Computer ScienceComputer Science (R0)