Machine Learning for Stress Detection: A LightGBM-Based Approach Using Bayesian Optimization

Authors

  • Mohammad Rabib Uddin American International University-Bangladesh
  • Md. Saniat Rahman Zishan American International University-Bangladesh image/svg+xml
  • Shameem Ahmad BRAC University image/svg+xml
  • Upama Dev American International University-Bangladesh image/svg+xml

DOI:

https://doi.org/10.53799/s67m2287

Keywords:

Machine learning, Stress, LightGBM, Accuracy, Bayesian, Hyperparameter

Abstract

Stress is an important physiological and psychological reaction which, when prolonged, has a negative impact on the health and well-being of humans. Traditional stress assessment methods tend to be subjective and are not scalable in real-time. In this research, a lightweight machine learning framework to predict stress from easily measurable environmental and activity-related features, temperature, humidity, and steps, is introduced. The proposed method is different from the approach that depends on complex physiological signals and uses minimal non-invasive inputs that can be applied in the wearable and IoT field. The stress level is considered as the target variable, and all the features used as input variables are independent from each other to prevent data leakage. There are several machine learning and deep learning models and their performances are measured, such as LightGBM, Support vector machine (SVM), AdaBoost, Gated Recurrent Unit (GRU). Bayesian hyperparameter optimization is used to improve the performance of the model and guarantee strong generalization. Experimental results show that LightGBM outperforms the other models, giving an accuracy of 97% and a balanced precision, recall and F1 score of 95%. The results demonstrate promising predictive performance on the evaluated dataset. However, since the model was validated on a relatively small publicly available dataset, further evaluation using larger and more diverse real-world datasets is required before practical deployment.

References

[1] Abd Al-Alim, M., Mubarak, R., Salem, N. M., & Sadek, I. (2024). A machine-learning approach for stress detection using wearable sensors in free-living environments. Computers in Biology and Medicine, 179, Article 108918. DOI: https://doi.org/10.1016/j.compbiomed.2024.108918

[2] Abdelfattah, E., Joshi, S., & Tiwari, S. (2025). Machine and deep learning models for stress detection using multimodal physiological data. IEEE Access, 13, 4597–4608. DOI: https://doi.org/10.1109/ACCESS.2024.3525459

[3] Xiang, J.-Z., Wang, Q.-Y., Fang, Z.-B., Esquivel, J. A., & Su, Z.-X. (2025). A multi-modal deep learning approach for stress detection using physiological signals: Integrating time and frequency domain features. Frontiers in Physiology, 16, Article 1584299. DOI: https://doi.org/10.3389/fphys.2025.1584299

[4] J. A. Healey and R. W. Picard, “Detecting stress during real-world driving tasks using physiological sensors,” IEEE Transactions on Intelligent Transportation Systems, vol. 6, no. 2, pp. 156–166, Jun. 2025. DOI: https://doi.org/10.1109/TITS.2005.848368

[5] Dev, U., Ahmad, S., Uddin, M. R., Kabiruzzaman, M., Dev, S., Hazari, M. R., & Hossain, C. A. (2026). Seasonal and altitudinal wind energy potential assessment at varying heights using stochastic modeling approaches. AIUB Journal of Science and Engineering, 24(3), 238. DOI: https://doi.org/10.53799/k8y06q73

[6] A. Sano and R. W. Picard, “Stress recognition using wearable sensors and mobile phones,” in Proc. 35th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Osaka, Japan, 2019, pp. 6737–6740.

[7] Y. Can, B. Arnrich, and C. Ersoy, “Stress detection in daily life scenarios using smartphones and wearable sensors: A survey,” Journal of Biomedical Informatics, vol. 92, Art. no. 103139, Apr. 2019. DOI: https://doi.org/10.1016/j.jbi.2019.103139

[8] P. Schmidt, R. Reiss, R. Dürichen, C. Marberger, and K. Van Laerhoven, “Introducing WESAD, a multimodal dataset for wearable stress and affect detection,” Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 2, no. 3, Art. no. 112, Sep. 2018. DOI: https://doi.org/10.1145/3242969.3242985

[9] A. Alberdi, A. Aztiria, and A. Basarab, “Towards an automatic early stress recognition system for office environments based on multimodal measurements: A review,” Journal of Biomedical Informatics, vol. 59, pp. 49–75, Feb. 2019. DOI: https://doi.org/10.1016/j.jbi.2015.11.007

[10] B. Shahriari, K. Swersky, Z. Wang, R. P. Adams, and N. de Freitas, “Taking the Human Out of the Loop: A Review of Bayesian Optimization,” Proceedings of the IEEE, vol. 104, no. 1, pp. 148–175, Jan. 2020. DOI: https://doi.org/10.1109/JPROC.2015.2494218

[11] Singh, A., Gupta, R., & Kumar, V., "CNN-based physiological signal analysis for automated stress detection," IEEE Access, vol. 9, pp. 45763–45775, 2023.

[12] Fernandes, J., Silva, H., & Costa, P., "Blood pressure and galvanic skin response as key indicators of stress: A machine learning approach," IEEE Transactions on Biomedical Engineering, vol. 67, no. 5, pp. 1234–1242, 2022.

[13] Alberdi, A., Aztiria, A., & Basarab, A., "Early stress recognition in office environments using multimodal physiological data and deep learning," Sensors, vol. 21, no. 3, p. 678, 2020.

[14] Pluntke, J., Schneider, M., & Bauer, G., "Stress classification in firefighters using heart rate variability and machine learning," IEEE Journal of Biomedical and Health Informatics, vol. 26, no. 7, pp. 1890–1902, 2020.

[15] Sano, A., & Picard, R. W., "Stress recognition using wearable sensors and mobile phones," Proceedings of the IEEE Engineering in Medicine and Biology Society (EMBC), pp. 4744–4747, 2021.

[16] Sandulescu, A., Rodríguez, C., & Fernandez, J., "Fuzzy logic-based stress detection system leveraging deep learning models," Applied Soft Computing, vol. 134, p. 109876, 2019.

[17] Ratul, M. H. A., Tasnim, S., Durjoy, M. M. A. P., Shufian, A., Uddin, M. R., & Hossain, M. S. (2026). NetZeroML: Hybrid PCA-XGBoost framework for global decarbonization and renewable energy forecasting. In 2026 IEEE Region 10 Symposium (TENSYMP 2026). DOI: https://doi.org/10.1109/TENSYMP68909.2026.11704012

[18] T. Elzeiny et al., "Automatic stress detection using voice and physiological signals," Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3672–3676, 2022.

[19] H. R. Fajrin, Sasmeri, L. R. Prilia, B. Untara, and M. A. F. Nurkholid, “Fuzzy logic method-based stress detector with blood pressure and body temperature parameters,” International Journal of Electrical and Computer Engineering (IJECE), vol. 14, no. 2, pp. 2156–2166, Apr. 2024. DOI: https://doi.org/10.11591/ijece.v14i2.pp2156-2166

[20] T. Periyaswamy and M. Balasubramanian, “Combining multiple human physiological signals using fuzzy logic to determine stress caused by battle dress uniforms,” Discover Applied Sciences, vol. 4, Art. no. 319, 2022. DOI: https://doi.org/10.1007/s42452-022-05199-2

[21] Y. Zhang, L. Wang, and J. Liu, "Facial expression analysis for stress detection using deep learning," IEEE Transactions on Affective Computing, vol. 11, no. 4, pp. 567–579, 2020.

[22] H. Gjoreski, M. Gjoreski, and M. Gams, "Context-aware stress detection using wearable sensors and smartphones," IEEE Journal of Biomedical and Health Informatics, vol. 25, no. 8, pp. 3121–3132, 2021.

[23] Kaggle, "Stress Level Detection." Available online: https://www.kaggle.com/datasets/laavanya/stress-level-detection (accessed Dec. 15, 2024).

[24] J. Smith, A. Brown, and P. Taylor, "Explainable artificial intelligence for physiological stress detection," IEEE Transactions on Human-Machine Systems, vol. 52, no. 3, pp. 456–467, 2022.

[25] J. Perez, R. Martinez, and L. Garcia, "Federated learning for stress detection: A privacy-preserving approach," IEEE Internet of Things Journal, vol. 8, no. 12, pp. 9876–9887, 2021.

[26] L. Wang, Y. Zhang, and X. Liu, "Environmental factors and stress detection using IoT sensors and physiological data," IEEE Sensors Journal, vol. 23, no. 5, pp. 5678–5690, 2023.

[27] A. Kumar, S. Sharma, and R. Singh, "Thermal imaging-based stress detection using deep learning," IEEE Transactions on Instrumentation and Measurement, vol. 71, pp. 1–12, 2022. DOI: https://doi.org/10.1109/TIM.2022.3204316

[28] Dev, U., Ahmad, S., Uddin, M. R., Dhar, R., Mubarak, H., Hazari, M. R., & Mekhilef, S. (2025). Short-term wind speed forecasting using different LSTM deep learning methods. In Innovations in Electrical and Electronics Engineering (Lecture Notes in Electrical Engineering, Vol. 1295, pp. 199–211). Singapore: Springer Nature. DOI: https://doi.org/10.1007/978-981-97-9112-5_12

[29] M. Hernandez, L. Gomez, and P. Sanchez, "Social media activity analysis for stress detection using NLP techniques," IEEE Transactions on Computational Social Systems, vol. 9, no. 2, pp. 345–356, 2022.

[30] T. Nguyen, H. Tran, and Q. Le, "Multimodal data fusion for stress detection using deep learning," IEEE Transactions on Affective Computing, vol. 14, no. 1, pp. 123–135, 2023.

[31] R. Gupta, S. Kumar, and A. Jain, "Gait analysis for stress detection using machine learning," IEEE Sensors Journal, vol. 21, no. 15, pp. 16789–16800, 2021.

[32] J. Lee, K. Kim, and S. Park, "Transfer learning for stress detection in small datasets," IEEE Transactions on Neural Networks and Learning Systems, vol. 34, no. 5, pp. 2345–2356, 2023.

[33] X. Chen, Y. Li, and Z. Wang, "Voice-based stress detection using deep learning models," IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 29, pp. 2150–2161, 2021.

[34] H. Kurniawan, J. Maslovsky, and M. Pfurtscheller, "EEG-based stress detection using machine learning techniques," Frontiers in Neuroscience, vol. 7, no. 1, pp. 1-9, 2023.

[35] Dev, U., Uddin, M. R., Ahmad, S., & Islam, A. (2026). Edge cutting and AI-driven protection strategies for DC microgrids: A comprehensive survey of challenges, technologies, and future trends. Results in Engineering, 30, Article 110013. DOI: https://doi.org/10.1016/j.rineng.2026.110013

[36] M. T. Islam et al., "Ensemble learning-based stress classification using wearable sensor data," IEEE Sensors Journal, vol. 20, no. 17, pp. 10215-10227, 2020.

[37] Uddin, M. R., Zishan, M. S. R., Ahmad, S., & Dev, U. (2026). Enhancing stress detection using Bayesian optimized boosting algorithms and feature analysis using SHAP. In ICT for Intelligent Systems (ICTIS 2025) (Lecture Notes in Networks and Systems, Vol. 1510). Singapore: Springer. DOI: https://doi.org/10.1007/978-981-96-9275-0_22

[38] Dev, U., Ahmad, S., Uddin, M. R., Hazari, M. R., Kabiruzzaman, M., Zishan, M. S. R., & Ahmed, K. F. (2025). Day ahead wind energy forecasting in two distinct locations of Bangladesh using deep learning models. In 2025 International Conference on Electrical, Computer and Communication Engineering (ECCE) (pp. 1–6). DOI: https://doi.org/10.1109/ECCE64574.2025.11013432

Downloads

Published

30-10-2026

How to Cite

[1]
“Machine Learning for Stress Detection: A LightGBM-Based Approach Using Bayesian Optimization”, AJSE, vol. 25, no. 2, pp. 123–133, Oct. 2026, doi: 10.53799/s67m2287.

Most read articles by the same author(s)