Investigating the Impact of Information Sharing in Human Activity Recognition
Abstract
:1. Introduction
- It takes on the challenging task of analyzing a dataset that is both realistic and difficult to investigate
- The developed methodology relies only on accelerometer data, which reduces data collection and computation costs at the price of accuracy; this study tries to decrease this loss in accuracy
- Various machine-learning algorithms reported in the literature are compared based on their performance metrics, including computation time
- A comparative analysis of various methods in which data can be stratified is provided
- This paper establishes the data sharing level as a key variable to be provided when classification results are reported
- A simple post-processing method is developed that can significantly improve detection accuracy
- The study develops a low-cost methodology for Human Activity Recognition.
2. Proposed Methodology
3. Pre-Processing and Feature Extraction
3.1. Study Data
3.2. Pre-Processing of Data
3.3. Feature Extraction
3.4. Window Size and Overlap
3.5. Amount of Data
4. Data Stratification
4.1. Random Stratification
4.2. Trip-Wise Stratification
4.3. User-Wise Stratification
5. Data Balancing
- Downsampling: A number of samples equal to the minority class were randomly selected from the majority classes
- Oversampling: A number of duplications equal to the majority class were randomly performed for the minority classes
- Oversampling and Downsampling: Oversampling of minority classes and downsampling of majority classes was performed to reach the mean value
- SMOTE: Synthetic Minority Oversampling Technique was investigated
6. Classification
7. Post-Processing
8. Evaluation and Analysis
8.1. Evaluation Measures
8.2. Random Stratification Results
8.3. Trip-Wise Stratification Results
8.4. User-Wise Stratification Results
9. Discussion
9.1. Window Size and Overlap
9.2. Classification Results
- The data used in this study are quite unusual. First, they were not collected in a controlled environment where the smartphone positioning is fixed. This includes greater variability in the data. Second, they cover motorized transport captured in an urban setting. This is challenging, as it is difficult to differentiate between a person jogging and a person in a slow-moving car, especially when smartphone positioning is not fixed. Third, this study only takes into account accelerometer data, in order to make the approach more cost efficient.
- The complete removal of information sharing, which has a considerable impact on detection accuracy.
- Efforts to reduce the overall computation cost of the developed methodology take a toll on the accuracy.
10. Conclusions and Future Work
- A larger window size tends to provide better accuracy; however, due to the limitations of the data used and the need to include non-trip activities, the upper threshold was not detected.
- Greater overlap results in both a greater number of data points and higher information sharing among those data points. This may be the reason for the increased prediction accuracy.
- Among the tested conventional machine-learning algorithms XGBoost outperforms all the others, yielding high prediction accuracy while requiring low computation time.
- Simpler methods of data balancing work equally well when compared with SMOTE, and require a relatively short time for computation.
- Decreasing information sharing between the training and testing datasets drastically decreases accuracy, from 99.8% to 77.6%. Therefore, researchers should report the level of information sharing associated with their results in order to allow them to be interpreted in their proper context.
- The Neural Network demonstrates better prediction accuracy than XGBoost; however, the gap can be closed with a simple post-processing step. More importantly, the computation time is relatively low for XGBoost (3.2 min vs. 14.16 min), making it a better option than Neural Network.
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Zhang, S.; Li, Y.; Zhang, S.; Shahabi, F.; Xia, S.; Deng, Y.; Alshurafa, N. Deep Learning in Human Activity Recognition with Wearable Sensors: A Review on Advances. Sensors 2022, 22, 1476. [Google Scholar] [CrossRef] [PubMed]
- Rashid, N.; Demirel, B.U.; Al Faruque, M.A. AHAR: Adaptive CNN for energy-efficient human activity recognition in low-power edge devices. IEEE Internet Things J. 2022. [Google Scholar] [CrossRef]
- Xu, Y.; Qiu, T.T. Human activity recognition and embedded application based on convolutional neural network. J. Artif. Intell. Technol. 2021, 1, 51–60. [Google Scholar] [CrossRef]
- Zhu, N.; Diethe, T.; Camplani, M.; Tao, L.; Burrows, A.; Twomey, N.; Kaleshi, D.; Mirmehdi, M.; Flach, P.; Craddock, I. Bridging e-health and the internet of things: The sphere project. IEEE Intell. Syst. 2015, 30, 39–46. [Google Scholar] [CrossRef] [Green Version]
- Menaspà, P. Effortless activity tracking with Google Fit. Br. J. Sports Med. 2015, 49, 1598. [Google Scholar] [CrossRef]
- Cornacchia, M.; Ozcan, K.; Zheng, Y.; Velipasalar, S. A survey on activity detection and classification using wearable sensors. IEEE Sens. J. 2016, 17, 386–403. [Google Scholar] [CrossRef]
- Lara, O.D.; Labrador, M.A. A survey on human activity recognition using wearable sensors. IEEE Commun. Surv. Tutor. 2012, 15, 1192–1209. [Google Scholar] [CrossRef]
- Mannini, A.; Sabatini, A.M. Machine learning methods for classifying human physical activity from on-body accelerometers. Sensors 2010, 10, 1154–1175. [Google Scholar] [CrossRef] [Green Version]
- Poppe, R. A survey on vision-based human action recognition. Image Vis. Comput. 2010, 28, 976–990. [Google Scholar] [CrossRef]
- Attal, F.; Mohammed, S.; Dedabrishvili, M.; Chamroukhi, F.; Oukhellou, L.; Amirat, Y. Physical human activity recognition using wearable sensors. Sensors 2015, 15, 31314–31338. [Google Scholar] [CrossRef] [Green Version]
- Shoaib, M.; Bosch, S.; Incel, O.D.; Scholten, H.; Havinga, P.J. Complex human activity recognition using smartphone and wrist-worn motion sensors. Sensors 2016, 16, 426. [Google Scholar] [CrossRef] [PubMed]
- Anguita, D.; Ghio, A.; Oneto, L.; Parra, X.; Reyes-Ortiz, J.L. A Public Domain Dataset for Human Activity Recognition Using Smartphones. In Proceedings of the European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, Bruges, Belgium, 24–26 April 2013; pp. 437–442. [Google Scholar]
- Kwapisz, J.R.; Weiss, G.M.; Moore, S.A. Activity recognition using cell phone accelerometers. ACM SigKDD Explor. Newsl. 2011, 12, 74–82. [Google Scholar] [CrossRef]
- Ignatov, A. Real-time human activity recognition from accelerometer data using Convolutional Neural Networks. Appl. Soft Comput. 2018, 62, 915–922. [Google Scholar] [CrossRef]
- Sikder, N.; Chowdhury, M.S.; Arif, A.S.M.; Nahid, A.-A. Human activity recognition using multichannel convolutional neural network. In Proceedings of the 2019 5th International Conference on Advances in Electrical Engineering (ICAEE), Dhaka, Bangladesh, 26–28 September 2019; pp. 560–565. [Google Scholar]
- Hassan, M.M.; Uddin, M.Z.; Mohamed, A.; Almogren, A. A robust human activity recognition system using smartphone sensors and deep learning. Future Gener. Comput. Syst. 2018, 81, 307–313. [Google Scholar] [CrossRef]
- Seto, S.; Zhang, W.; Zhou, Y. Multivariate time series classification using dynamic time warping template selection for human activity recognition. In Proceedings of the 2015 IEEE Symposium Series on Computational Intelligence, Cape Town, South Africa, 7–10 December 2015; pp. 1399–1406. [Google Scholar]
- Sousa, W.; Souto, E.; Rodrigres, J.; Sadarc, P.; Jalali, R.; El-Khatib, K. A comparative analysis of the impact of features on human activity recognition with smartphone sensors. In Proceedings of the 23rd Brazillian Symposium on Multimedia and the Web, Gramado, Brazil, 17–20 October 2017; pp. 397–404. [Google Scholar]
- Chen, Z.; Zhu, Q.; Soh, Y.C.; Zhang, L. Robust human activity recognition using smartphone sensors via CT-PCA and online SVM. IEEE Trans. Ind. Inform. 2017, 13, 3070–3080. [Google Scholar] [CrossRef]
- Figueiredo, J.; Gordalina, G.; Correia, P.; Pires, G.; Oliveira, L.; Martinho, R.; Rijo, R.; Assuncao, P.; Seco, A.; Fonseca-Pinto, R. Recognition of human activity based on sparse data collected from smartphone sensors. In Proceedings of the 2019 IEEE 6th Portuguese Meeting on Bioengineering (ENBENG), Lisbon, Portugal, 22–23 February 2019; pp. 1–4. [Google Scholar]
- Voicu, R.-A.; Dobre, C.; Bajenaru, L.; Ciobanu, R.-I. Human physical activity recognition using smartphone sensors. Sensors 2019, 19, 458. [Google Scholar] [CrossRef] [Green Version]
- Garcia-Gonzalez, D.; Rivero, D.; Fernandez-Blanco, E.; Luaces, M.R. A public domain dataset for real-life human activity recognition using smartphone sensors. Sensors 2020, 20, 2200. [Google Scholar] [CrossRef] [Green Version]
- Chathuramali, K.M.; Rodrigo, R. Faster human activity recognition with SVM. In Proceedings of the International Conference on Advances in ICT for Emerging Regions (ICTer2012), Colombo, Sri Lanka, 12–15 December 2012; pp. 197–203. [Google Scholar]
- Kose, M.; Incel, O.D.; Ersoy, C. Online human activity recognition on smart phones. In Proceedings of the Workshop on Mobile Sensing: From Smartphones and Wearables to Big Data, Beijing, China, 16 April 2012; pp. 11–15. [Google Scholar]
- Maswadi, K.; Ghani, N.A.; Hamid, S.; Rasheed, M.B. Human activity classification using Decision Tree and Naive Bayes classifiers. Multimed. Tools Appl. 2021, 80, 21709–21726. [Google Scholar] [CrossRef]
- Sani, S.; Wiratunga, N.; Massie, S. Learning deep features for kNN-based human activity recognition. In Proceedings of the 25th International Conference on Case-Based Reasoning (ICCBR 2017), Trondheim, Norway, 26–29 June 2017. [Google Scholar]
- Shafique, M.A.; Hato, E. Improving the Accuracy of Travel Mode Detection for Low Data Collection Frequencies. Pak. J. Eng. Appl. Sci. 2020, 27, 67–77. [Google Scholar]
- Feng, Z.; Mo, L.; Li, M. A Random Forest-based ensemble method for activity recognition. In Proceedings of the 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 25–29 August 2015; pp. 5074–5077. [Google Scholar]
- Zhang, W.; Zhao, X.; Li, Z. A comprehensive study of smartphone-based indoor activity recognition via Xgboost. IEEE Access 2019, 7, 80027–80042. [Google Scholar] [CrossRef]
- Chauraisa, S.K.; Reddy, S. Optimized XGBoost algorithm using agglomerative clustering for effective user context identification. In Artificial Intelligence and Speech Technology; CRC Press: Boca Raton, FL, USA, 2021; pp. 339–345. [Google Scholar]
- Javed, A.R.; Sarwar, M.U.; Khan, S.; Iwendi, C.; Mittal, M.; Kumar, N. Analyzing the effectiveness and contribution of each axis of tri-axial accelerometer sensor for accurate activity recognition. Sensors 2020, 20, 2216. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Yu, M.-C.; Yu, T.; Wang, S.-C.; SC, D.; Lin, C.-J.; Chang, E.Y. Big data small footprint: The design of a low-power classifier for detecting transportation modes. Proc. VLDB Endow. 2014, 7, 1429–1440. [Google Scholar] [CrossRef] [Green Version]
Window Size | Overlap (%) | Detection Accuracy (%) | ||||
---|---|---|---|---|---|---|
Inactive | Active | Walking | Driving | Overall | ||
28 s | 25 | 97.22 | 92.13 | 77.55 | 84.81 | 91.16 |
50 | 98.24 | 93.29 | 82.78 | 88.90 | 93.34 | |
75 | 99.02 | 95.81 | 87.24 | 92.92 | 95.47 | |
24 s | 25 | 98.43 | 90.67 | 80.88 | 86.88 | 92.19 |
50 | 98.48 | 92.50 | 84.27 | 88.32 | 93.23 | |
75 | 99.07 | 94.61 | 87.60 | 93.66 | 95.37 | |
20 s | 25 | 98.17 | 93.17 | 79.02 | 87.92 | 92.57 |
50 | 98.18 | 92.46 | 80.76 | 87.17 | 92.38 | |
75 | 98.56 | 95.45 | 88.11 | 92.91 | 95.35 | |
16 s | 25 | 97.57 | 91.01 | 77.85 | 85.60 | 91.03 |
50 | 98.38 | 91.69 | 82.03 | 89.01 | 92.73 | |
75 | 98.66 | 94.23 | 86.29 | 92.51 | 94.77 | |
12 s | 25 | 97.88 | 89.43 | 78.21 | 85.95 | 90.89 |
50 | 98.10 | 90.46 | 78.47 | 87.81 | 91.77 | |
75 | 98.63 | 93.61 | 85.48 | 90.45 | 94.17 | |
8 s | 25 | 97.89 | 87.87 | 76.61 | 84.65 | 90.09 |
50 | 97.79 | 90.09 | 80.08 | 86.15 | 91.30 | |
75 | 98.60 | 92.23 | 84.60 | 89.86 | 93.49 |
Activity | No. of Participants | No. of Trips | Amount of Data | Percentage |
---|---|---|---|---|
Inactive | 13 | 77 | 40,297 | 45.95 |
Active | 9 | 65 | 22,516 | 25.67 |
Walking | 14 | 119 | 12,417 | 14.16 |
Driving | 12 | 73 | 12,471 | 14.22 |
Band | Participant | Inactive | Active | Walking | Driving |
---|---|---|---|---|---|
1 | 1 | 666 | 0 | 0 | 153 |
6 | 0 | 2008 | 973 | 0 | |
2 | 2 | 159 | 0 | 675 | 356 |
13 | 1407 | 495 | 86 | 0 | |
3 | 3 | 20 | 876 | 1014 | 602 |
7 | 1214 | 0 | 906 | 1869 | |
4 | 4 | 849 | 868 | 63 | 260 |
5 | 5 | 331 | 487 | 489 | 3499 |
14 | 152 | 0 | 204 | 0 | |
6 | 8 | 29,865 | 1403 | 4216 | 1441 |
7 | 9 | 1724 | 0 | 2365 | 655 |
11 | 1013 | 12,134 | 618 | 1289 | |
8 | 10 | 0 | 1859 | 279 | 1885 |
15 | 519 | 0 | 45 | 96 | |
9 | 12 | 2378 | 2386 | 484 | 366 |
Trip No. | Actual | Predicted | Forward Voting Sequence | Corrected Prediction | Backward Voting Sequence | Corrected Prediction |
---|---|---|---|---|---|---|
1 | Walking | Walking | 0, 0, 1, 0 | Walking | 0, 0, 8, 0 | Walking |
1 | Walking | Walking | 0, 0, 2, 0 | Walking | 0, 0, 7, 0 | Walking |
1 | Walking | Walking | 0, 0, 3, 0 | Walking | 0, 0, 6, 0 | Walking |
1 | Walking | Driving | 0, 0, 2, 1 | Walking | 0, 0, 5, 0 | Walking |
1 | Walking | Driving | 0, 0, 1, 2 | Driving | 0, 0, 4, 1 | Walking |
1 | Walking | Walking | 0, 0, 2, 1 | Walking | 0, 0, 5, 0 | Walking |
1 | Walking | Walking | 0, 0, 3, 0 | Walking | 0, 0, 4, 0 | Walking |
1 | Walking | Walking | 0, 0, 4, 0 | Walking | 0, 0, 3, 0 | Walking |
1 | Walking | Walking | 0, 0, 5, 0 | Walking | 0, 0, 2, 0 | Walking |
1 | Walking | Driving | 0, 0, 4, 1 | Walking | 0, 0, 1, 0 | Walking |
2 | Inactive | Active | 0, 1, 0, 0 | Active | 4, 1, 0, 0 | Inactive |
2 | Inactive | Inactive | 1, 0, 0, 0 | Inactive | 5, 0, 0, 0 | Inactive |
2 | Inactive | Inactive | 2, 0, 0, 0 | Inactive | 4, 0, 0, 0 | Inactive |
2 | Inactive | Inactive | 3, 0, 0, 0 | Inactive | 3, 0, 0, 0 | Inactive |
2 | Inactive | Inactive | 4, 0, 0, 0 | Inactive | 2, 0, 0, 0 | Inactive |
2 | Inactive | Active | 3, 1, 0, 0 | Inactive | 1, 0, 0, 0 | Inactive |
Algorithm | Measure | Inactive | Active | Walking | Driving |
---|---|---|---|---|---|
XGB | Precision | 0.978 (0.023) | 0.807 (0.135) | 0.869 (0.112) | 0.876 (0.066) |
Recall | 0.929 (0.111) | 0.877 (0.102) | 0.819 (0.127) | 0.884 (0.065) | |
F-Score | 0.95 (0.07) | 0.835 (0.107) | 0.84 (0.11) | 0.878 (0.051) | |
RF | Precision | 0.975 (0.029) | 0.771 (0.219) | 0.873 (0.107) | 0.825 (0.181) |
Recall | 0.933 (0.106) | 0.818 (0.243) | 0.811 (0.141) | 0.861 (0.095) | |
F-Score | 0.951 (0.068) | 0.788 (0.224) | 0.836 (0.117) | 0.835 (0.146) | |
SVM | Precision | 0.959 (0.023) | 0.816 (0.125) | 0.868 (0.107) | 0.856 (0.07) |
Recall | 0.947 (0.097) | 0.829 (0.114) | 0.816 (0.125) | 0.859 (0.093) | |
F-Score | 0.951 (0.058) | 0.814 (0.096) | 0.834 (0.1) | 0.853 (0.063) | |
NB | Precision | 0.934 (0.063) | 0.707 (0.25) | 0.703 (0.185) | 0.588 (0.142) |
Recall | 0.974 (0.051) | 0.476 (0.222) | 0.705 (0.275) | 0.815 (0.107) | |
F-Score | 0.952 (0.049) | 0.555 (0.219) | 0.685 (0.231) | 0.674 (0.115) | |
KNN | Precision | 0.943 (0.024) | 0.788 (0.128) | 0.781 (0.117) | 0.812 (0.09) |
Recall | 0.937 (0.108) | 0.761 (0.136) | 0.781 (0.13) | 0.834 (0.088) | |
F-Score | 0.937 (0.064) | 0.766 (0.113) | 0.777 (0.116) | 0.819 (0.069) |
Algorithm | Accuracy | Computation Time (min) |
---|---|---|
XGB | 0.894 (0.075) | 2.64 |
RF | 0.876 (0.114) | 22.86 |
SVM | 0.886 (0.062) | 208.13 |
NB | 0.786 (0.095) | 5.85 |
KNN | 0.855 (0.069) | 295.02 |
Balancing Method | Accuracy |
---|---|
Downsampling | 0.983 (0.002) |
Oversampling | 0.998 (0.0003) |
Both | 0.995 (0.001) |
SMOTE | 0.997 (0.0002) |
Balancing Method | Measure | Inactive | Active | Walking | Driving | Accuracy |
---|---|---|---|---|---|---|
None | Precision | 0.935 (0.105) | 0.785 (0.212) | 0.729 (0.2) | 0.8 (0.161) | 0.868 (0.084) |
Recall | 0.966 (0.042) | 0.677 (0.212) | 0.798 (0.101) | 0.913 (0.082) | ||
F-Score | 0.948 (0.073) | 0.693 (0.2) | 0.735 (0.127) | 0.846 (0.123) | ||
Downsampling | Precision | 0.961 (0.054) | 0.8 (0.231) | 0.727 (0.205) | 0.793 (0.158) | 0.877 (0.067) |
Recall | 0.952 (0.047) | 0.694 (0.199) | 0.844 (0.083) | 0.909 (0.1) | ||
F-Score | 0.956 (0.041) | 0.709 (0.203) | 0.759 (0.146) | 0.841 (0.126) | ||
Oversampling | Precision | 0.971 (0.034) | 0.84 (0.126) | 0.654 (0.135) | 0.773 (0.215) | 0.871 (0.054) |
Recall | 0.966 (0.035) | 0.726 (0.234) | 0.822 (0.151) | 0.838 (0.146) | ||
F-Score | 0.968 (0.018) | 0.751 (0.173) | 0.712 (0.102) | 0.775 (0.16) |
Algorithm | Measure | Inactive | Active | Walking | Driving | Accuracy | Time (min) |
---|---|---|---|---|---|---|---|
XGB | Precision | 0.878 (0.152) | 0.68 (0.367) | 0.554 (0.254) | 0.635 (0.26) | 0.695 (0.175) | 3.03 |
Recall | 0.908 (0.172) | 0.467 (0.337) | 0.791 (0.195) | 0.646 (0.281) | |||
F-Score | 0.878 (0.148) | 0.486 (0.279) | 0.59 (0.202) | 0.563 (0.244) | |||
NN | Precision | 0.697 (0.275) | 0.62 (0.238) | 0.62 (0.231) | 0.814 (0.171) | 0.731 (0.091) | 14.16 |
Recall | 0.711 (0.228) | 0.609 (0.275) | 0.763 (0.204) | 0.848 (0.142) | |||
F-Score | 0.639 (0.208) | 0.529 (0.232) | 0.649 (0.205) | 0.819 (0.136) | |||
XGB with Postprocessing | Precision | 0.969 (0.06) | 0.81 (0.311) | 0.675 (0.355) | 0.836 (0.274) | 0.766 (0.21) | 3.2 |
Recall | 0.975 (0.047) | 0.508 (0.45) | 0.858 (0.21) | 0.772 (0.274) | |||
F-Score | 0.97 (0.04) | 0.665 (0.324) | 0.66 (0.296) | 0.744 (0.357) |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Shafique, M.A.; Marchán, S.S. Investigating the Impact of Information Sharing in Human Activity Recognition. Sensors 2022, 22, 2280. https://doi.org/10.3390/s22062280
Shafique MA, Marchán SS. Investigating the Impact of Information Sharing in Human Activity Recognition. Sensors. 2022; 22(6):2280. https://doi.org/10.3390/s22062280
Chicago/Turabian StyleShafique, Muhammad Awais, and Sergi Saurí Marchán. 2022. "Investigating the Impact of Information Sharing in Human Activity Recognition" Sensors 22, no. 6: 2280. https://doi.org/10.3390/s22062280
APA StyleShafique, M. A., & Marchán, S. S. (2022). Investigating the Impact of Information Sharing in Human Activity Recognition. Sensors, 22(6), 2280. https://doi.org/10.3390/s22062280