A Hierarchical Ensemble Deep Learning Activity Recognition Approach with Wearable Sensors Based on Focal Loss
Abstract
:1. Introduction
- (1)
- This paper analyzes the sensitivity of a wearable inertial sensor on the wrist to human activity. For the same sensor, the data generated by different activities are quite different, and for different sensors, the data generated by the same action are relatively different.
- (2)
- In view of the complexity and imbalance of human daily activity data, after preprocessing the data, this paper proposes a deep hierarchical ensemble learning model based on focal loss, and designs an elderly daily activity recognition system based on wearable sensors.
- (3)
- This paper employs real experimental data to evaluate the performance of the proposed method and compares it with some state-of-the-art methods in the literature. Furthermore, this paper evaluates the impact of some key hyperparameters using experimental data.
2. Related Work
3. System Framework
3.1. Formal Description of Data
3.2. Wavelet Transform
3.3. Hierarchical Ensemble Deep Learning Architecture
3.3.1. Single-Channel Sensor Signal Feature Extraction
LSTM Layer
1D-CNN Layer
Fusion Layer
3.3.2. Feature Fusion Extraction of Multi-Sensor Signals
2D-CNN Layer
Fusion Layer
3.4. Loss Function
Algorithm 1 Hierarchical ensemble deep learning model based on focal loss |
input: raw wearable sensor data output: activities 1: encode the raw data as a numeric vector; 2: wavelet transform; 3: normalize the numeric vector; 4: /* Model training*/ 5: while the loss does not converge do forward propagation; use Softmax to get predicted labels; calculate the focal-loss loss-function; backpropagation; gradient descent updates all parameters; end |
4. Experiment
4.1. Experimental Settings
4.1.1. The Overview of Experiments
4.1.2. Neural Networks Models
4.2. Data Collection and Processing
4.3. Analysis of Experimental Results
4.3.1. Analysis of Experimental Results with Private Dataset
4.3.2. Analysis of Experimental Results with Public Dataset
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Xie, B.; Wu, Q. Hmm-based tri-training algorithm in human activity recognition with smartphone. In Proceedings of the 2012 IEEE 2nd International Conference on Cloud Computing and Intelligence Systems, Hangzhou, China, 30 October–1 November 2012. [Google Scholar]
- Sarcevic, P.; Kincses, Z.; Pletl, S. Comparison of different classifiers in movement recognition using WSN-based wrist-mounted sensors. In Proceedings of the 2015 IEEE Sensors Applications Symposium (SAS), Zadar, Croatia, 13–15 April 2015. [Google Scholar]
- Fan, L.; Wang, Z.; Wang, H. Human activity recognition model based on decision tree. In Proceedings of the 2013 International Conference on Advanced Cloud and Big Data, Nanjing, China, 13–15 December 2013. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016. [Google Scholar]
- Donahue, J.; Anne Hendricks, L.; Guadarrama, S.; Rohrbach, M.; Venugopalan, S.; Saenko, K.; Darrell, T. Long-term recurrent convolutional networks for visual recognition and description. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015. [Google Scholar]
- Lane, N.D.; Georgiev, P. Can deep learning revolutionize mobile sensing? In Proceedings of the 16th International Workshop on Mobile Computing Systems and Applications, New York, NY, USA, 12–13 February 2015. [Google Scholar]
- Lee, Y.S.; Cho, S.B. Activity recognition using hierarchical hidden markov models on a smartphone with 3D accelerometer. In Proceedings of the International Conference on Hybrid Artificial Intelligence Systems, Melacca, Malaysia, 5–8 December 2011. [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]
- Sun, L.; Zhang, D.; Li, B.; Guo, B.; Li, S. Activity recognition on an accelerometer embedded mobile phone with varying positions and orientations. In Proceedings of the International Conference on Ubiquitous Intelligence and Computing, Xi’an, China, 26–29 October 2010. [Google Scholar]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
- Jiang, W.; Yin, Z. Human activity recognition using wearable sensors by deep convolutional neural networks. In Proceedings of the 23rd ACM International Conference on Multimedia, Brisbane, Australia, 26–30 October 2015. [Google Scholar]
- Ronao, C.A.; Cho, S.B. Human activity recognition with smartphone sensors using deep learning neural networks. Expert Syst. Appl. 2016, 59, 235–244. [Google Scholar] [CrossRef]
- Ravi, D.; Wong, C.; Lo, B.; Yang, G.Z. Deep learning for human activity recognition: A resource efficient implementation on low-power devices. In Proceedings of the 2016 IEEE 13th International Conference on Wearable and Implantable Body Sensor Networks (BSN), San Francisco, CA, USA, 14–17 June 2016. [Google Scholar]
- Amroun, H.; Temkit, M.H.; Ammi, M. Best feature for CNN classification of human activity using IOT network. In Proceedings of the 2017 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), Exeter, UK, 21–23 June 2017. [Google Scholar]
- Guan, Y.; Plötz, T. Ensembles of deep lstm learners for activity recognition using wearables. In Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, Maui, HI, USA, 11–15 September 2017. [Google Scholar]
- Kuncheva, L.I. Combining Pattern Classifiers: Methods and Algorithms; John Wiley & Sons: Hoboken, NJ, USA, 2014. [Google Scholar]
- Radu, V.; Lane, N.D.; Bhattacharya, S.; Mascolo, C.; Marina, M.K.; Kawsar, F. Towards multimodal deep learning for activity recognition on mobile devices. In Proceedings of the 2016 ACM International Joint Conference on Pervasive and Ubiquitous Computing, Heidelberg, Germany, 12–16 September 2016. [Google Scholar]
- Ordóñez, F.J.; Roggen, D. Deep convolutional and lstm recurrent neural networks for multimodal wearable activity recognition. Sensors 2016, 16, 115. [Google Scholar] [CrossRef] [PubMed]
- Chen, Z.; Jiang, C.; Xie, L. A novel ensemble ELM for human activity recognition using smartphone sensors. IEEE Trans. Ind. Inform. 2018, 15, 2691–2699. [Google Scholar] [CrossRef]
- Sundaramoorthy, P.; Gudur, G.K.; Moorthy, M.R.; Bhandari, R.N.; Vijayaraghavan, V. HARNet: Towards on-device incremental learning using deep ensembles on constrained devices. In Proceedings of the 2nd International Workshop on Embedded and Mobile Deep Learning, Munich, Germany, 15 June 2018. [Google Scholar]
- Wang, K.J.; Makond, B.; Chen, K.H.; Wang, K.M. A hybrid classifier combining SMOTE with PSO to estimate 5-year survivability of breast cancer patients. Appl. Soft Comput. 2014, 20, 15–24. [Google Scholar] [CrossRef]
- Jo, T.; Japkowicz, N. Class imbalances versus small disjuncts. ACM Sigkdd Explor. Newsl. 2004, 6, 40–49. [Google Scholar] [CrossRef]
- Hradsky, O.; Ohem, J.; Zarubova, K.; Mitrova, K.; Durilova, M.; Kotalova, R.; Nevoral, J.; Zemanova, I.; Dryak, P.; Bronsky, J. Disease activity is an important factor for indeterminate interferon-γ release assay results in children with inflammatory bowel disease. J. Pediatr. Gastroenterol. Nutr. 2014, 58, 320–324. [Google Scholar] [CrossRef] [PubMed]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017. [Google Scholar]
- Borovykh, A.; Bohte, S.; Oosterlee, C.W. Conditional time series forecasting with convolutional neural networks. arXiv 2017, arXiv:1703.04691. [Google Scholar]
- Ioffe, S.; Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015. [Google Scholar]
- Stisen, A.; Blunck, H.; Bhattacharya, S.; Prentow, T.S.; Kjærgaard, M.B.; Dey, A.; Sonne, T.; Jensen, M.M. Smart devices are different: Assessing and mitigatingmobile sensing heterogeneities for activity recognition. In Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems, Seoul, Korea, 1–4 November 2015. [Google Scholar]
Reference | Main Contributions | Sensor | Classes |
---|---|---|---|
[7] | The real-time activity recognition application on a smartphone with the Google Android platform | smartphone | stand, walk, stair up/down, run, shopping, taking bus, moving (by walk) |
[8] | The activity recognition model permits users to gain useful knowledge about the habits of millions of users passively just by having them carry cell phones | smartphone | walking, jogging, climbing stairs, sitting, and standing |
[12] | Proposed a deep convolutional neural network (convnet) is to perform HAR using smartphone sensors by exploiting the inherent characteristics of activities and 1D time-series signals | smartphone | walking, upstairs, downstairs, sitting and standing, lying |
[14] | Evaluating what is the best descriptor to recognize human activity using Convolutional Neural Network in a non-controlled environment using a network of smart objects | smartphone | standing, sitting, lying and walking |
[15] | Developed modified training procedures for LSTM networks and combine sets of diverse LSTM learners into classifier collectives | wearable sensors | close/open dishwasher, close/open drawer, close/open door, close/open fridge, toggle switch, drink from cup, clean table |
[17] | Investigating the opportunity to use deep learning to perform this integration of sensor data from multiple sensors | smartphone | sitting, standing, walking, climbing stairs, descending stairs, biking |
[18] | Proposed a generic deep framework for activity recognition based on convolutional and LSTM recurrent units | wearable sensors | close/open dishwasher, close/open drawer, close/open door, close/open fridge, toggle switch, drink from cup, clean table |
[19] | Introduced a novel ensemble ELM algorithm for human activity recognition using smartphone sensors | smartphone | sitting, standing, lying, walking, walking upstairs, and downstairs |
Layers | #Feature Maps | Feature Map Size | #Parameters |
---|---|---|---|
LSTM | 32 | 28 | 4352 |
1D-CNN | 8 | 28 | 1288 |
BN | 8 | 28 | 32 |
Max-pooling1D | 8 | 14 | 0 |
Concatenate | 72 | 14 | 0 |
Reshape | 1 | 14 × 72 | 0 |
Layers | #Feature Maps | Feature Map Size | #Parameters |
---|---|---|---|
2D-CNN | 8 | 14 × 72 | 80 |
BN | 8 | 14 × 72 | 32 |
Max-pooling2D | 8 | 7 × 36 | 0 |
Concatenate | 16 | 7 × 36 | 0 |
2D-CNN | 32 | 7 × 36 | 4640 |
BN | 32 | 7 × 36 | 128 |
Max-pooling2D | 32 | 4 × 18 | 0 |
Layers | #Feature Maps | Feature Map Size | #Parameters |
---|---|---|---|
Flatten | 1 | 2304 | 0 |
Dense-1 | 1 | 64 | 147,520 |
Dense-2 | 1 | 32 | 2080 |
Dense-3 | 1 | 16 | 528 |
Dropout | 1 | 16 | 0 |
Dense-4 | 1 | 8 | 136 |
Dense-5 | 1 | 7 | 63 |
Sensors | Attitude Sensor (BWT61CL) | Triaxial Accelerometer | Gyroscope Sensor |
---|---|---|---|
3-Axis Acceleration | ✓ | ✓ | |
3-Axis Angular Velocity (Gyroscope) | ✓ | ✓ | |
3-Axis Angle | ✓ |
Classes | S1 | S2 | S3 | S4 | S5 |
---|---|---|---|---|---|
Cooking | 708 | 200 | 708 | 708 | 200 |
Keyboarding | 708 | 200 | 708 | 708 | 708 |
Reading | 708 | 708 | 200 | 708 | 708 |
Brushing teeth | 708 | 708 | 200 | 708 | 708 |
Washing face | 708 | 708 | 708 | 200 | 708 |
Washing dishes | 708 | 708 | 708 | 200 | 708 |
Writing | 708 | 708 | 708 | 708 | 200 |
Samples | HAR-FL | HAR-CE | ||||
---|---|---|---|---|---|---|
Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
S1 | 0.9870 | 0.9869 | 0.9868 | 0.9799 | 0.9798 | 0.9797 |
S2 | 0.9759 | 0.9746 | 0.9747 | 0.9539 | 0.9517 | 0.9511 |
S3 | 0.9723 | 0.9720 | 0.9715 | 0.9549 | 0.9543 | 0.9534 |
S4 | 0.9850 | 0.9847 | 0.9846 | 0.9729 | 0.9720 | 0.9710 |
S5 | 0.9823 | 0.9822 | 0.9821 | 0.9636 | 0.9632 | 0.9625 |
Activities | Devices | FS | Users |
---|---|---|---|
[”Biking”, ”Sitting”, ”Walking”, ”StairsUp”, “StairsDown”, “Standing”] | Nexus 4 | 200 | [a,b,c,d,e,f,g,h,i] |
Samsung S3 | 150 | ||
Samsung S3 Mini | 100 | ||
Samsung S+ | 50 |
Classes | S1 | S2 | S3 | |
---|---|---|---|---|
Class Distribution | stand | 7932 | 7932 | 7932 |
sit | 8089 | 8089 | 8089 | |
walk | 10,225 | 10,224 | 10,225 | |
stairsup | 7519 | 2560 | 7519 | |
stairsdown | 6607 | 6607 | 6607 | |
bike | 9580 | 9580 | 2559 |
Samples | HAR-FL | HAR-CE | ||||
---|---|---|---|---|---|---|
Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
S1 | 0.9640 | 0.9641 | 0.9640 | 0.9569 | 0.9571 | 0.9570 |
S2 | 0.9720 | 0.9717 | 0.9718 | 0.9660 | 0.9656 | 0.9657 |
S3 | 0.9474 | 0.9465 | 0.9466 | 0.9388 | 0.9362 | 0.9363 |
Classes | HAR-FL | HAR-CE | ||||
---|---|---|---|---|---|---|
Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
stand | 0.9950 | 0.9965 | 0.9970 | 0.9965 | 0.9960 | 0.9962 |
sit | 1.000 | 0.9990 | 0.9997 | 1.0000 | 0.9995 | 0.9998 |
walk | 0.9626 | 0.9660 | 0.9590 | 0.9618 | 0.9460 | 0.9588 |
stairsup | 0.9089 | 0.9128 | 0.9067 | 0.9008 | 0.9021 | 0.9055 |
stairsdown | 0.8777 | 0.8660 | 0.8783 | 0.8747 | 0.8644 | 0.8710 |
bike | 0.9858 | 0.9880 | 0.9894 | 0.9744 | 0.9871 | 0.9864 |
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
Zhao, T.; Chen, H.; Bai, Y.; Zhao, Y.; Zhao, S. A Hierarchical Ensemble Deep Learning Activity Recognition Approach with Wearable Sensors Based on Focal Loss. Int. J. Environ. Res. Public Health 2022, 19, 11706. https://doi.org/10.3390/ijerph191811706
Zhao T, Chen H, Bai Y, Zhao Y, Zhao S. A Hierarchical Ensemble Deep Learning Activity Recognition Approach with Wearable Sensors Based on Focal Loss. International Journal of Environmental Research and Public Health. 2022; 19(18):11706. https://doi.org/10.3390/ijerph191811706
Chicago/Turabian StyleZhao, Ting, Haibao Chen, Yuchen Bai, Yuyan Zhao, and Shenghui Zhao. 2022. "A Hierarchical Ensemble Deep Learning Activity Recognition Approach with Wearable Sensors Based on Focal Loss" International Journal of Environmental Research and Public Health 19, no. 18: 11706. https://doi.org/10.3390/ijerph191811706
APA StyleZhao, T., Chen, H., Bai, Y., Zhao, Y., & Zhao, S. (2022). A Hierarchical Ensemble Deep Learning Activity Recognition Approach with Wearable Sensors Based on Focal Loss. International Journal of Environmental Research and Public Health, 19(18), 11706. https://doi.org/10.3390/ijerph191811706