Skip to main content

Advertisement

Log in

Stress Detection via Keyboard Typing Behaviors by Using Smartphone Sensors and Machine Learning Techniques

  • Image & Signal Processing
  • Published:
Journal of Medical Systems Aims and scope Submit manuscript

Abstract

Stress is one of the biggest problems in modern society. It may not be possible for people to perceive if they are under high stress or not. It is important to detect stress early and unobtrusively. In this context, stress detection can be considered as a classification problem. In this study, it was investigated the effects of stress by using accelerometer and gyroscope sensor data of the writing behavior on a smartphone touchscreen panel. For this purpose, smartphone data including two states (stress and calm) were collected from 46 participants. The obtained sensor signals were divided into 5, 10 and 15 s interval windows to create three different data sets and 112 different features were defined from the raw data. To obtain more effective feature subsets, these features were ranked by using Gain Ratio feature selection algorithm. Afterwards, writing behaviors were classified by C4.5 Decision Trees, Bayesian Networks and k-Nearest Neighbor methods. As a result of the experiments, 74.26%, 67.86%, and 87.56% accuracy classification results were obtained respectively.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

References

  1. Ciman, M., Wac, K., & Gaggi, O.,. iSenseStress: Assessing stress through human-smartphone interaction analysis. In proceedings of the 9th international conference on pervasive computing Technologies for Healthcare. 84-91, 2015.

  2. Can, Y. S., Arnrich, B., & Ersoy, C., Stress detection in daily life scenarios using smart phones and wearable sensors: A survey. J. Biomed. Inform., 103139, 2019.

  3. Gjoreski, M., Luštrek, M., Gams, M., and Gjoreski, H., Monitoring stress with a wrist device using context. J. Biomed. Inform. 73:159–170, 2017.

    Article  Google Scholar 

  4. Picard, R. W., Automating the recognition of stress and emotion: From lab to real-world impact. IEEE MultiMedia 23(3):3–7, 2016.

    Article  Google Scholar 

  5. Stress is Killing You. http://www.who.int/occupational_health/topics/stressatwp/en/ Accessed: 06.11.2019.

  6. Gjoreski, M., Gjoreski, H., Luštrek, M., & Gams, M., Continuous stress detection using a wrist device: In laboratory and real life. In proceedings of the 2016 ACM international joint conference on pervasive and ubiquitous computing: Adjunct. 1185-1193, 2016.

  7. Minguillon, J., Perez, E., Lopez-Gordo, M., Pelayo, F., and Sanchez-Carrion, M., Portable system for real-time detection of stress level. Sensors 18(8):2504, 2018.

    Article  Google Scholar 

  8. Padmaja, B., Prasad, V. R., and Sunitha, K. V., A machine learning approach for stress detection using a wireless physical activity tracker. Int. J. Mach. Learn. Comput 8:33–38, 2018.

    Article  Google Scholar 

  9. Pandey, P. S., Machine learning and IoT for prediction and detection of stress. In: In 2017 17th international conference on computational science and its applications (ICCSA), 2017, July, 1–5.

    Google Scholar 

  10. Choi, J., Ahmed, B., and Gutierrez-Osuna, R., Development and evaluation of an ambulatory stress monitor based on wearable sensors. IEEE Trans. Inf. Technol. Biomed. 16(2):279–286, 2011.

    Article  Google Scholar 

  11. Zenonos, A., Khan, A., Kalogridis, G., Vatsikas, S., Lewis, T., and Sooriyabandara, M., HealthyOffice: Mood recognition at work using smartphones and wearable sensors. In: In 2016 IEEE international conference on pervasive computing and communication workshops, 2016, 1–6.

    Google Scholar 

  12. Mozos, O. M., Sandulescu, V., Andrews, S., Ellis, D., Bellotto, N., Dobrescu, R., and Ferrandez, J. M., Stress detection using wearable physiological and sociometric sensors. Int. J. Neural Syst. 27(02):1650041, 2017.

    Article  Google Scholar 

  13. Egilmez B, Poyraz E, Zhou W, Memik G, Dinda P and Alshurafa N., UStress: Understanding college student subjective stress using wrist-based passive sensing, 2017 IEEE international conference on pervasive computing and communications workshops (PerCom workshops) paper 7, 2017.

  14. Navea, R. F., Buenvenida, P. J., & Cruz, C. D., Stress detection using galvanic skin response: An android application. In journal of physics: Conference series (Vol. 1372, no. 1, p. 012001). IOP publishing, 2019, November.

  15. Sysoev, M., Kos, A., and Pogačnik, M., Noninvasive stress recognition considering the current activity. Pers. Ubiquit. Comput. 19(7):1045–1052, 2015.

    Article  Google Scholar 

  16. Lu, H., Frauendorfer, D., Rabbi, M., Mast, M. S., Chittaranjan, G. T., Campbell, A. T., ... & Choudhury, T., Stresssense: Detecting stress in unconstrained acoustic environments using smartphones. In Proceedings of the 2012 ACM Conference on Ubiquitous Computing, 351–360, 2012.

  17. Wang, R., Chen, F., Chen, Z., Li, T., Harari, G., Tignor, S., ... & Campbell, A. T., StudentLife: assessing mental health, academic performance and behavioral trends of college students using smartphones. In Proceedings of the 2014 ACM international joint conference on pervasive and ubiquitous computing, 3–14, 2014.

  18. Bogomolov, A., Lepri, B., Ferron, M., Pianesi, F., & Pentland, A. S., Daily stress recognition from mobile phone data, weather conditions and individual traits. In proceedings of the 22nd ACM international conference on multimedia, 477-486, 2014.

  19. Bauer, G., and Lukowicz, P., Can smartphones detect stress-related changes in the behaviour of individuals? In: In 2012 IEEE international conference on pervasive computing and communications workshops, 2012, 423–426.

    Chapter  Google Scholar 

  20. Cho, Y., Bianchi-Berthouze, N., and Julier, S. J., DeepBreath: Deep learning of breathing patterns for automatic stress recognition using low-cost thermal imaging in unconstrained settings. In: In 2017 seventh international conference on affective computing and intelligent interaction (ACII), 2017, 456–463.

    Google Scholar 

  21. Han, H., Byun, K., & Kang, H. G., A deep learning-based stress detection algorithm with speech signal. In proceedings of the 2018 workshop on audio-visual scene understanding for immersive multimedia, 11-15, 2018.

  22. Kostopoulos, P., Kyritsis, A. I., Deriaz, M., and Konstantas, D., Stress detection using smart phone data. In: eHealth 360°. Cham: Springer, 2017, 340–351.

    Chapter  Google Scholar 

  23. Gimpel, H., Regal, C., & Schmidt, M. (2015). myStress: Unobtrusive smartphone-based stress detection. In ECIS.

  24. Raichur, N., Lonakadi, N., and Mural, P., Detection of stress using image processing and machine learning techniques. International Journal of Engineering and Technology 9(3):1–8, 2017.

    Article  Google Scholar 

  25. Vildjiounaite, E., Kallio, J., Kyllönen, V., Nieminen, M., Määttänen, I., Lindholm, M. et al., Unobtrusive stress detection on the basis of smartphone usage data. Personal and Ubiquitous Computing 22(4):671–688, 2018.

    Article  Google Scholar 

  26. Maier, E., Reimer, U., Laurenzi, E., Ridinger, M., and Ulmer, T., A mobile solution for stress recognition and prevention. In Proc. Int’l Conf. Health Informatics (HealthInf):428–433, 2014.

  27. Muaremi, A., Arnrich, B., and Tröster, G., Towards measuring stress with smartphones and wearable devices during workday and sleep. BioNanoScience 3(2):172–183, 2013.

    Article  Google Scholar 

  28. Sano, A., & Picard, R. W., Stress recognition using wearable sensors and mobile phones. In 2013 Humaine association conference on affective computing and intelligent interaction, 671-676, 2013.

  29. Kim, H. J., & Choi, Y. S., Exploring emotional preference for smartphone applications. In 2012 IEEE consumer communications and networking conference (CCNC), 245-249, 2012.

  30. Lee, H., Choi, Y. S., Lee, S., & Park, I. P., Towards unobtrusive emotion recognition for affective social communication. In 2012 IEEE Consumer Communications and Networking Conference (CCNC), 260-264, 2012.

  31. Gao, Y., Bianchi-Berthouze, N., and Meng, H., What does touch tell us about emotions in touchscreen-based gameplay? ACM Transactions on Computer-Human Interaction (TOCHI) 19(4):31, 2012.

    Article  Google Scholar 

  32. Lau, S. H., Stress detection for keystroke dynamics. Doctoral dissertation: Carnegie Mellon University, 2018.

    Google Scholar 

  33. Ghosh, S., Ganguly, N., Mitra, B., & De, P., Tapsense: Combining self-report patterns and typing characteristics for smartphone based emotion detection. In Proceedings of the 19th International Conference on Human-Computer Interaction with Mobile Devices and Services (p. 2), 2017.

  34. Ghosh, S., Sahu, S., Ganguly, N., Mitra, B., and De, P., EmoKey: An emotion-aware smartphone keyboard for mental health monitoring. In: In 2019 11th international conference on communication systems & networks (COMSNETS), 2019, 496–499.

    Chapter  Google Scholar 

  35. Exposito, M., Hernandez, J., & Picard, R. W., Affective keys: Towards unobtrusive stress sensing of smartphone users. In proceedings of the 20th international conference on human-computer interaction with Mobile devices and services adjunct (pp. 139-145), 2018, September.

  36. Sağbaş, E. A., & Ballı, S., Usage of the smartphone sensors and accessing raw sensor data. In proceedings of the 17th conference of Academic Computing:158–164, Eskişehir, Turkey, 2015, February.

  37. Peker, M., Ballı, S., & Sağbaş, E. A., Predicting human actions using a hybrid of ReliefF feature selection and kernel-based extreme learning machine. In handbook of research on predictive modeling and optimization methods in science and engineering. 379-397, 2018.

  38. Yuksel, A. S., Senel, F. A., and Cankaya, I. A., Classification of soft keyboard typing behaviors using Mobile device sensors with machine learning. Arab. J. Sci. Eng. 44(4):3929–3942, 2019.

    Article  Google Scholar 

  39. L. Bernardi, J. Wdowczyk-Szulc, C. Valenti, S. Castoldi, C. Passino, G. Spadacini, and P. Sleight., Effects of controlled breathing, mental activity and mental stress with or without verbalization on heart rate variability. J. Am. Coll. Cardiol. 1462–1469, 2000.

  40. Dickerson, S. S., and Kemeny, M. E., Acute stressors and cortisol responses: A theoretical integration and synthesis of laboratory research. Psychological bulletin.:355–391, 2004.

  41. Stroop, J. R., Studies of interference in serial verbal reactions. J. Exp. Psychol. 18(6):643, 1935.

    Article  Google Scholar 

  42. Lezak, M.D., Neuropsychological assessment, Oxford University Press, USA, 2004.

  43. Likert, R., A technique for the measurements of attitudes. Archives of psychology 55, 1932.

  44. Hall, M. A., and Holmes, G., Benchmarking attribute selection techniques for discrete class data mining. IEEE Trans. Knowl. Data Eng. 15(6):1437–1447, 2003.

    Article  Google Scholar 

  45. Priyadarsini, R. P., Valarmathi, M. L., and Sivakumari, S., Gain ratio based feature selection method for privacy preservation. ICTACT Journal on soft computing 1(4):201–205, 2011.

    Article  Google Scholar 

  46. Trabelsi, M., Meddouri, N., and Maddouri, M., A new feature selection method for nominal classifier based on formal concept analysis. Procedia Computer Science 112:186–194, 2017.

    Article  Google Scholar 

  47. Karegowda, A. G., Manjunath, A. S., and Jayaram, M. A., Comparative study of attribute selection using gain ratio and correlation based feature selection. International Journal of Information Technology and Knowledge Management 2(2):271–277, 2010.

    Google Scholar 

  48. Yazıcı B, Yaslı F, Gürleyik HY, Yurgut UO., Aktas MS, Kalıpsız O. Veri Madenciliğinde Özellik Seçim Tekniklerinin Bankacılık Verisine Uygulanması Üzerine Araştırma ve Karşılaştırmalı Uygulama. In Proceedings of the 9th Turkish National Software Engineering Symposium, 1–11.

  49. Witten, I. H., Frank, E., and Hall, M. A., Data mining: Practical machine learning tools and techniques. 3rd edition. Burlington: Morgan Kaufmann, 2011.

    Google Scholar 

  50. Yüksel, A. S., Şenel, F. A., and Çankaya, İ. A., Classification of writing behaviors using mobile device sensors. Dicle University Journal of Engineering 9(1):133–142, 2018.

    Google Scholar 

  51. Witten, I. H., and Frank, E., Data mining: Practical machine learning tools and techniques with Java implementations. Acm Sigmod Record 31(1):76–77, 2002.

    Article  Google Scholar 

  52. Amin, H. U., Malik, A. S., Ahmad, R. F., Badruddin, N., Kamel, N., Hussain, M., and Chooi, W.-T., Feature extraction and classification for EEG signals using wavelet transform and machine learning techniques. Australas. Phys. Eng. Sci. Med. 38(1):139–149, 2015.

    Article  Google Scholar 

  53. Korb, K. B., and Nicholson, A. E., Bayesian artificial intelligence. 2 nd ed. Boca Raton: FL, USA, CRC Press, 2011.

    Google Scholar 

  54. Sağbaş, E. A., and Ballı, S., Transportation mode detection by using smartphone sensors and machine learning. Pamukkale University Journal of Engineering Sciences 22(5):376–383, 2016.

    Article  Google Scholar 

  55. Feng T., Timmermans H.J.P., Comparative evaluation of algorithms for GPS data imputation. 13 th WCTR, 1-11, 2010

  56. Ballı, S., and Sağbaş, E. A., Classification of human motions with Smartwatch sensors. Süleyman Demirel University Journal of Natural and Applied Sciences 21(3):980–990, 2017.

    Google Scholar 

  57. Peker, M., A new approach for automatic sleep scoring: Combining Taguchi based complex-valued neural network and complex wavelet transform. Comput. Methods Programs Biomed. 129:203–216, 2016.

    Article  Google Scholar 

  58. Balli, S., Sağbaş, E. A., and Peker, M., Human activity recognition from smart watch sensor data using a hybrid of principal component analysis and random forest algorithm. Meas. Control. 52(1–2):37–45, 2019.

    Article  Google Scholar 

Download references

Acknowledgements

We would like to thank the personnel and undergraduate students of the Computer Engineering Department of Ege University for volunteering to participate in the experiment. Raw sensor data are available at: https://tinyurl.com/2019-stress-detection-dataset.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Serkan Balli.

Ethics declarations

Conflict of Interest

The authors declare that they have no conflict of interest.

Ethical Approval

All procedures performed in studies involving human participants were in accordance with the ethical standards of the institutional and/or national research committee and with the 1964 Helsinki declaration and its later amendments or comparable ethical standards.

Informed Consent

Informed consent was obtained from all individual participants included in the study.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This article is part of the Topical Collection on Image & Signal Processing

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Sağbaş, E.A., Korukoglu, S. & Balli, S. Stress Detection via Keyboard Typing Behaviors by Using Smartphone Sensors and Machine Learning Techniques. J Med Syst 44, 68 (2020). https://doi.org/10.1007/s10916-020-1530-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10916-020-1530-z

Keywords

Navigation