Physical Activity Monitoring and Classification Using Machine Learning Techniques
Abstract
:1. Introduction
- The paper compares several machine learning techniques to identify the best-suited activity classification techniques on a balanced dataset.
- The physical activity dataset is intentionally skewed to introduce class imbalance and to evaluate the abilities of six well-known machine learning classifiers.
- The proposed work compares the performance of the selected state-of-the-art machine learning algorithms with different training splits and various degrees of imbalance and identifies the best-suited machine learning techniques.
2. System Model
2.1. Wireless Communications Framework
2.2. Machine Learning Paradigm for Physical Activity Classification
2.2.1. Dataset
2.2.2. Feature Computation
2.2.3. Experiments
2.2.4. Machine Learning Algorithms Used
3. Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
Appendix A
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 97.62 | 94.09 | 95.19 | 86.74 | 95.65 | 93.42 |
Upstairs | 96.78 | 90.66 | 92.44 | 86.37 | 91.91 | 89.10 |
Downstairs | 98.08 | 93.97 | 94.49 | 81.03 | 92.37 | 89.82 |
Sit | 92.26 | 87.45 | 89.55 | 80.36 | 89.36 | 89.78 |
Stand | 93.55 | 89.57 | 91.26 | 81.42 | 91.04 | 90.64 |
Lie | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 |
Overall | 96.38 | 92.62 | 93.82 | 85.99 | 93.39 | 92.13 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 76.92 | 15.96 | 9.23 | 6.25 | 25.35 | 34.11 |
Upstairs | 90.80 | 76.23 | 78.80 | 72.26 | 80.81 | 82.22 |
Downstairs | 87.73 | 70.76 | 74.00 | 65.22 | 70.03 | 69.82 |
Sit | 92.26 | 85.93 | 85.53 | 81.76 | 90.74 | 89.73 |
Stand | 93.55 | 88.13 | 86.90 | 82.60 | 92.05 | 90.67 |
Lie | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 |
Overall | 90.21 | 72.83 | 72.41 | 68.02 | 76.50 | 77.76 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 81.92 | 51.04 | 13.83 | 44.41 | 47.15 | 60.22 |
Upstairs | 49.68 | 39.11 | 27.09 | 65.26 | 47.36 | 53.82 |
Downstairs | 64.55 | 59.53 | 61.23 | 62.82 | 56.04 | 59.89 |
Sit | 92.28 | 85.99 | 84.05 | 80.81 | 89.36 | 89.66 |
Stand | 93.47 | 87.87 | 70.42 | 81.84 | 90.88 | 90.55 |
Lie | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 |
Overall | 80.32 | 70.59 | 59.44 | 72.52 | 71.80 | 75.69 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 84.30 | 62.19 | 23.49 | 69.53 | 77.59 | 75.24 |
Upstairs | 79.21 | 67.58 | 40.00 | 71.26 | 74.44 | 73.49 |
Downstairs | 77.99 | 76.32 | 77.01 | 73.67 | 78.60 | 72.94 |
Sit | 92.28 | 72.36 | 78.74 | 73.70 | 82.92 | 89.05 |
Stand | 93.47 | 85.91 | 58.54 | 76.87 | 86.48 | 90.19 |
Lie | 100.00 | 100.00 | 100.00 | 99.72 | 100.00 | 100.00 |
Overall | 87.88 | 77.39 | 62.96 | 77.46 | 83.34 | 83.49 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 84.30 | 71.29 | 35.79 | 60.89 | 65.68 | 78.91 |
Upstairs | 79.35 | 65.12 | 45.05 | 72.67 | 42.90 | 72.75 |
Downstairs | 77.99 | 75.60 | 78.09 | 68.01 | 67.74 | 73.81 |
Sit | 67.29 | 61.67 | 61.06 | 46.13 | 61.02 | 63.20 |
Stand | 81.23 | 77.69 | 55.93 | 77.30 | 77.17 | 79.48 |
Lie | 100.00 | 98.71 | 100.00 | 95.30 | 100.00 | 100.00 |
Overall | 81.70 | 75.01 | 62.65 | 70.05 | 69.09 | 78.02 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 84.30 | 58.55 | 65.23 | 61.04 | F-score | 69.80 |
Upstairs | 79.35 | 55.60 | 48.78 | 67.14 | 64.38 | 71.53 |
Downstairs | 77.99 | 76.61 | 79.96 | 67.58 | 57.96 | 72.94 |
Sit | 83.12 | 65.34 | 66.55 | 79.92 | 70.77 | 84.11 |
Stand | 85.43 | 74.15 | 80.73 | 81.68 | 80.08 | 83.47 |
Lie | 100.00 | 98.08 | 90.86 | 100.00 | 80.99 | 99.63 |
Overall | 85.03 | 71.39 | 72.02 | 76.23 | 100.00 | 80.25 |
Activity Type | SVM (%) | XGB (%) | GB (%) | CB (%) | ADA (DT) (%) | ADA (RF) (%) |
---|---|---|---|---|---|---|
Walk | 84.30 | 63.61 | 21.72 | 71.23 | 59.02 | 83.08 |
Upstairs | 79.35 | 56.58 | 43.16 | 62.70 | 53.74 | 76.52 |
Downstairs | 77.99 | 77.26 | 75.66 | 72.36 | 70.94 | 76.15 |
Sit | 82.88 | 73.37 | 75.18 | 81.34 | 79.68 | 81.57 |
Stand | 85.27 | 80.70 | 58.96 | 78.95 | 80.30 | 81.60 |
Lie | 100.00 | 99.91 | 99.72 | 96.23 | 99.53 | 100.00 |
Overall | 84.97 | 75.24 | 62.40 | 77.14 | 73.87 | 83.15 |
References
- World Health Organization. Global Status Report on Noncommunicable Diseases 2014 (No. WHO/NMH/NVI/15.1); World Health Organization: Geneva, Switzerland, 2014. [Google Scholar]
- Awais, M.; Chiari, L.; Ihlen, E.; Helbostad, J.; Palmerini, L. Classical Machine Learning versus Deep Learning for the Older Adults Free-Living Activity Classification. Sensors 2021, 21, 4669. [Google Scholar] [CrossRef]
- Wolfenden, L.; Barnes, C.; Jones, J.; Finch, M.; Wyse, R.J.; Kingsland, M.; Tzelepis, F.; Grady, A.; Hodder, R.K.; Booth, D. Strategies to improve the implementation of healthy eating, physical activity and obesity prevention policies, practices or programmes within childcare services. Cochrane Database Syst. Rev. 2016, 10, CD011779. [Google Scholar] [CrossRef]
- Ding, D.; Gebel, K. Built environment, physical activity, and obesity: What have we learned from reviewing the literature? Health Place 2012, 18, 100–105. [Google Scholar] [CrossRef] [Green Version]
- Sacchetti, R.; Dallolio, L.; Musti, M.A.; Guberti, E.; Garulli, A.; Beltrami, P.; Castellazzi, F.; Centis, E.; Zenesini, C.; Coppini, C. Effects of a school based intervention to promote healthy habits in children 8–11 years old, living in the lowland area of Bologna Local Health Unit. Ann. Ig. 2015, 27, 432–446. [Google Scholar]
- La Torre, G.; Mannocci, A.; Saulle, R.; Sinopoli, A.; D’Egidio, V.; Sestili, C.; Manfuso, R.; Masala, D. Improving knowledge and behaviors on diet and physical activity in children: Results of a pilot randomized field trial. Ann. Ig. Med. Prev. Comunita 2017, 29, 584–594. [Google Scholar]
- Caspersen, C.J.; Powell, K.E.; Christenson, G.M. Physical activity, exercise, and physical fitness: Definitions and distinctions for health-related research. Public Health Rep. 1985, 100, 126–131. [Google Scholar]
- Novaes, M.T.; de Carvalho, O.L.; Ferreira, P.H.; Tiraboschi, T.L.; Silva, C.S.; Zambrano, J.C.; Gomes, C.M.; de Paula Miranda, E.; de Carvalho Júnior, O.A.; de Bessa Júnior, J. Prediction of secondary testosterone deficiency using machine learning: A comparative analysis of ensemble and base classifiers, probability calibration, and sampling strategies in a slightly imbalanced dataset. Inform. Med. Unlocked 2021, 23, 100538. [Google Scholar] [CrossRef]
- Singh, L.K.; Garg, H.; Khanna, M.; Bhadoria, R.S. An Analytical Study on Machine Learning Techniques. In Multidisciplinary Functions of Blockchain Technology in AI and IoT Applications; IGI Global: Hershey, PA, USA, 2021; pp. 137–157. [Google Scholar]
- Awais, M.; Chiari, L.; Ihlen, E.A.F.; Helbostad, J.L.; Palmerini, L. Physical Activity Classification for Elderly People in Free-Living Conditions. IEEE J. Biomed. Health Inform. 2018, 23, 197–207. [Google Scholar] [CrossRef]
- Kerdjidj, O.; Ramzan, N.; Ghanem, K.; Amira, A.; Chouireb, F. Fall detection and human activity classification using wearable sensors and compressed sensing. J. Ambient Intell. Humaniz. Comput. 2019, 11, 349–361. [Google Scholar] [CrossRef] [Green Version]
- Qi, J.; Yang, P.; Newcombe, L.; Peng, X.; Yang, Y.; Zhao, Z. An overview of data fusion techniques for Internet of Things enabled physical activity recognition and measure. Inf. Fusion 2019, 55, 269–280. [Google Scholar] [CrossRef]
- Roy, P.K.; Om, H. Suspicious and Violent Activity Detection of Humans Using HOG Features and SVM Classifier in Surveillance Videos. In Advances in Soft Computing and Machine Learning in Image Processing; Springer: Berlin/Heidelberg, Germany, 2018; pp. 277–294. [Google Scholar]
- Thyagarajmurthy, A.; Ninad, M.G.; Rakesh, B.G.; Niranjan, S.; Manvi, B. Anomaly Detection in Surveillance Video Using Pose Estimation. In Emerging Research in Electronics, Computer Science and Technology; Springer: Berlin/Heidelberg, Germany, 2019; pp. 753–766. [Google Scholar]
- Yang, H.; Yuan, C.; Li, B.; Du, Y.; Xing, J.; Hu, W.; Maybank, S.J. Asymmetric 3D Convolutional Neural Networks for action recognition. Pattern Recognit. 2018, 85, 1–12. [Google Scholar] [CrossRef] [Green Version]
- Nadeem, A.; Jalal, A.; Kim, K. Accurate Physical Activity Recognition using Multidimensional Features and Markov Model for Smart Health Fitness. Symmetry 2020, 12, 1766. [Google Scholar] [CrossRef]
- Ehatisham-Ul-Haq, M.; Javed, A.; Azam, M.A.; Malik, H.M.A.; Irtaza, A.; Lee, I.H.; Mahmood, M.T. Robust Human Activity Recognition Using Multimodal Feature-Level Fusion. IEEE Access 2019, 7, 60736–60751. [Google Scholar] [CrossRef]
- Cheng, X.; Lin, S.-Y.; Liu, J.; Liu, S.; Zhang, J.; Nie, P.; Fuemmeler, B.; Wang, Y.; Xue, H. Does Physical Activity Predict Obesity—A Machine Learning and Statistical Method-Based Analysis. Int. J. Environ. Res. Public Health 2021, 18, 3966. [Google Scholar] [CrossRef] [PubMed]
- Li, J.; Siegrist, J. Physical Activity and Risk of Cardiovascular Disease—A Meta-Analysis of Prospective Cohort Studies. Int. J. Environ. Res. Public Health 2012, 9, 391–407. [Google Scholar] [CrossRef] [PubMed]
- Awais, M.; Palmerini, L.; Bourke, A.K.; Ihlen, E.A.F.; Helbostad, J.L.; Chiari, L. Performance Evaluation of State of the Art Systems for Physical Activity Classification of Older Subjects Using Inertial Sensors in a Real Life Scenario: A Benchmark Study. Sensors 2016, 16, 2105. [Google Scholar] [CrossRef] [Green Version]
- Pereira, L.M.C.; Aidar, F.J.; de Matos, D.G.; Neto, J.P.D.F.; de Souza, R.F.; Sousa, A.C.S.; de Almeida, R.R.; Nunes, M.A.P.; Nunes-Silva, A.; Júnior, W.M.D.S. Assessment of Cardiometabolic Risk Factors, Physical Activity Levels, and Quality of Life in Stratified Groups up to 10 Years after Bariatric Surgery. Int. J. Environ. Res. Public Health 2019, 16, 1975. [Google Scholar] [CrossRef] [Green Version]
- Hernando, C.; Hernando, C.; Collado, E.J.; Panizo, N.; Martinez-Navarro, I.; Hernando, B. Establishing cut-points for physical activity classification using triaxial accelerometer in middle-aged recreational marathoners. PLoS ONE 2018, 13, e0202815. [Google Scholar] [CrossRef]
- Qi, J.; Yang, P.; Hanneghan, M.; Tang, S.; Zhou, B. A Hybrid Hierarchical Framework for Gym Physical Activity Recognition and Measurement Using Wearable Sensors. IEEE Internet Things J. 2018, 6, 1384–1393. [Google Scholar] [CrossRef] [Green Version]
- 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]
- Sanhudo, L.; Calvetti, D.; Martins, J.P.; Ramos, N.M.; Mêda, P.; Gonçalves, M.C.; Sousa, H. Activity classification using accelerometers and machine learning for complex construction worker activities. J. Build. Eng. 2020, 35, 102001. [Google Scholar] [CrossRef]
- Pizot, C.; Boniol, M.; Mullie, P.; Koechlin, A.; Boniol, M.; Boyle, P.; Autier, P. Physical activity, hormone replacement therapy and breast cancer risk: A meta-analysis of prospective studies. Eur. J. Cancer 2015, 52, 138–154. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Chong, J.; Tjurin, P.; Niemelä, M.; Jämsä, T.; Farrahi, V. Machine-learning models for activity class prediction: A comparative study of feature selection and classification algorithms. Gait Posture 2021, 89, 45–53. [Google Scholar] [CrossRef] [PubMed]
- Anguita, D.; Ghio, A.; Oneto, L.; Parra-Llanas, X.; Reyes-Ortiz, J. A public domain dataset for human activity recognition using smartphones. In Proceedings of the ESANN 2013 Proceedings, European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, Bruges, Belgium, 24–26 April 2013; Volume 3, p. 3. [Google Scholar]
- Peter, S.; Diego, F.; Hamprecht, F.A.; Nadler, B. Cost efficient gradient boosting. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Advances in Neural Information Processing Systems. Volume 30. [Google Scholar]
- Hancock, J.T.; Khoshgoftaar, T.M. CatBoost for big data: An interdisciplinary review. J. Big Data 2020, 7, 94. [Google Scholar] [CrossRef]
- Wu, Y.; Ke, Y.; Chen, Z.; Liang, S.; Zhao, H.; Hong, H. Application of alternating decision tree with AdaBoost and bagging ensembles for landslide susceptibility mapping. Catena 2019, 187, 104396. [Google Scholar] [CrossRef]
- Suthaharan, S. Support vector machine. In Machine Learning Models and Algorithms for Big Data Classification; Springer: Berlin/Heidelberg, Germany, 2016; pp. 207–235. [Google Scholar]
- Chen, T.; He, T.; Benesty, M.; Khotilovich, V.; Tang, Y.; Cho, H.; Chen, K. Xgboost: Extreme Gradient Boosting; R Package Version 0.4-2; 2015; Volume 1, pp. 1–4. Available online: https://cran.microsoft.com/snapshot/2017-12-11/web/packages/xgboost/vignettes/xgboost.pdf (accessed on 1 February 2022).
- Ghori, K.M.; Ayaz, A.R.; Awais, M.; Imran, M.; Ullah, A.; Szathmary, L. Impact of feature selection on non-technical loss detection. In Proceedings of the 2020 6th Conference on Data Science and Machine Learning Applications (CDMA), 4–5 March 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 19–24. [Google Scholar]
- Ghori, K.M.; Awais, M.; Khattak, A.S.; Imran, M.; Amin, F.E.; Szathmary, L. Treating Class Imbalance in Non-Technical Loss Detection: An Exploratory Analysis of a Real Dataset. IEEE Access 2021, 9, 98928–98938. [Google Scholar] [CrossRef]
- Feng, W.; Dauphin, G.; Huang, W.; Quan, Y.; Bao, W.; Wu, M.; Li, Q. Dynamic Synthetic Minority Over-Sampling Technique-Based Rotation Forest for the Classification of Imbalanced Hyperspectral Data. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2019, 12, 2159–2169. [Google Scholar] [CrossRef]
- He, H.; Bai, Y.; Garcia, E.A.; Li, S. ADASYN: Adaptive synthetic sampling approach for imbalanced learning. In Proceedings of the 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), Hong Kong, China, 1–8 June 2008; IEEE: Piscataway, NJ, USA, 2008; pp. 1322–1328. [Google Scholar]
- Ramentol, E.; Caballero, Y.; Bello, R.; Herrera, F. SMOTE-RSB: A hybrid preprocessing approach based on oversampling and undersampling for high imbalanced data-sets using SMOTE and rough sets theory. Knowl. Inf. Syst. 2012, 33, 245–265. [Google Scholar] [CrossRef]
- Goorbergh, R.V.D.; van Smeden, M.; Timmerman, D.; Van Calster, B. The harm of class imbalance corrections for risk prediction models: Illustration and simulation using logistic regression. J. Am. Med. Inform. Assoc. 2022, ocac093. [Google Scholar] [CrossRef]
- Japkowicz, N. The class imbalance problem: Significance and strategies. In Proceedings of the 2000 International Conference on Artificial Intelligence, Acapulco, Mexico, 11–14 April 2000; Volume 56, pp. 111–117. [Google Scholar]
- Arya, K.V.; Bhadoria, R.S. The Biometric Computing: Recognition and Registration; CRC Press: Boca Raton, FL, USA, 2019. [Google Scholar]
- Awais, M.; Raza, M.; Singh, N.; Bashir, K.; Manzoor, U.; Islam, S.U.; Rodrigues, J.J.P.C. LSTM-Based Emotion Detection Using Physiological Signals: IoT Framework for Healthcare and Distance Learning in COVID-19. IEEE Internet Things J. 2020, 8, 16863–16871. [Google Scholar] [CrossRef]
Activity Type | Total Dataset | Percentage (Total Dataset) | Train Split | Test Split |
---|---|---|---|---|
Walk | 1722 | 16.72% | 1226 | 496 |
Upstairs | 1544 | 14.99% | 1073 | 471 |
Downstairs | 1406 | 13.65% | 986 | 420 |
Sit | 1777 | 17.25% | 1286 | 491 |
Stand | 1906 | 18.51% | 1374 | 532 |
Lie | 1944 | 18.88% | 1407 | 537 |
Activity Type | E1 | E2 | E3 | E4 | E5 | E6 | E7 |
---|---|---|---|---|---|---|---|
Train Split | Train Split | Train Split | Train Split | Train Split | Train Split | Train Split | |
Walk | 1226 | 100 | 100 | 100 | 100 | 100 | 100 |
Upstairs | 1073 | 1073 | 100 | 100 | 100 | 100 | 100 |
Downstairs | 986 | 986 | 986 | 100 | 100 | 100 | 100 |
Sit | 1286 | 1286 | 1286 | 1286 | 100 | 100 | 100 |
Stand | 1374 | 1374 | 1374 | 1374 | 1374 | 100 | 100 |
Lie | 1407 | 1407 | 1407 | 1407 | 1407 | 1407 | 100 |
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
Alsareii, S.A.; Awais, M.; Alamri, A.M.; AlAsmari, M.Y.; Irfan, M.; Aslam, N.; Raza, M. Physical Activity Monitoring and Classification Using Machine Learning Techniques. Life 2022, 12, 1103. https://doi.org/10.3390/life12081103
Alsareii SA, Awais M, Alamri AM, AlAsmari MY, Irfan M, Aslam N, Raza M. Physical Activity Monitoring and Classification Using Machine Learning Techniques. Life. 2022; 12(8):1103. https://doi.org/10.3390/life12081103
Chicago/Turabian StyleAlsareii, Saeed Ali, Muhammad Awais, Abdulrahman Manaa Alamri, Mansour Yousef AlAsmari, Muhammad Irfan, Nauman Aslam, and Mohsin Raza. 2022. "Physical Activity Monitoring and Classification Using Machine Learning Techniques" Life 12, no. 8: 1103. https://doi.org/10.3390/life12081103
APA StyleAlsareii, S. A., Awais, M., Alamri, A. M., AlAsmari, M. Y., Irfan, M., Aslam, N., & Raza, M. (2022). Physical Activity Monitoring and Classification Using Machine Learning Techniques. Life, 12(8), 1103. https://doi.org/10.3390/life12081103