Predicting Stress During Sleep from Biosensor Data: An Optimized Machine Learning Framework
Downloads
Objectives: This study aims to develop an optimized machine learning (ML) framework for predicting stress levels via physiological signals collected during sleep via Internet of Medical Things (IoMT)-enabled biosensors. The primary goal is to increase the accuracy and efficiency of stress prediction by identifying the most significant features that influence stress classification. Method/Analysis: The proposed framework employs two feature selection methods: particle swarm optimization combined with the whale optimization algorithm (PSO-WOA) and an enhanced version incorporating Lévy flight (PSO-WOA with Lévy flight). These methods are designed to reduce feature dimensionality while maximizing classification performance. A set of single (LR, KNN, NB, MLP, and SVM) and ensemble (RF, XGBoost, and Voting) classifiers are evaluated via 10-fold cross-validation. The Sleep-IoMT stress dataset, comprising biosensor-based physiological signals, was used for experimental validation. Findings: The framework achieved high classification accuracy across all the models, with all the classifiers exceeding 0.98 accuracy. Compared with the PSO-WOA, the PSO-WOA with the Lévy flight method demonstrated superior performance in terms of both feature selection quality and training time efficiency. The results confirm that effective feature selection significantly improves model accuracy and interpretability. Novelty/Improvement: This research introduces a hybrid approach for feature selection (PSO-WOA) in the context of stress prediction from sleep-related IoMT data. The integration of Lévy flight into the PSO-WOA enhances exploration capabilities and reduces premature convergence, offering a robust solution for real-world healthcare applications, e.g., mobile stress monitoring and early intervention systems.
Downloads
[1] Wilson, D. (2025). Ranked: The World’s Most and Least Stressed Countries, 2025. CEOWORLD magazine, New York, United States. Available online: https://ceoworld.biz/2025/01/13/ranked-the-worlds-most-and-least-stressed-countries-2025/ (accessed on August 2025).
[2] Marks, H., & King, L. M. (2020). Stress Symptoms. WedMD, New York, United States. Available online: https://www.webmd.com/balance/stress-management/stress-symptoms-effects_of-stress-on-the-body#1 (accessed on August 2025).
[3] Tuan, T. A., Trang, L. T. T., An, T. D., Nghia, N. H., & Loan, D. T. T. (2024). An Analysis of Machine Learning for Detecting Depression, Anxiety, and Stress of Recovered COVID-19 Patients. Journal of Human, Earth, and Future, 5(1), 1–18. doi:10.28991/HEF-2024-05-01-01.
[4] Tuan, T. A., Nghia, N. H., An, T. D., & Loan, D. T. T. (2024). Exploring Mental Stress Expressions in Online Communities: A Subreddit Analysis. Journal of Human, Earth, and Future, 5(2), 131–150. doi:10.28991/HEF-2024-05-02-01.
[5] Howarth, N. E., & Miller, M. A. (2024). Sleep, Sleep Disorders, and Mental Health: A Narrative Review. Heart and Mind, 8(3), 146–158. doi:10.4103/hm.hm-d-24-00030.
[6] Pekgor, M., Algin, A., & Toros, T. (2025). RFID-embedded mattress for sleep disorder detection for athletes in sports psychology. Scientific Reports, 15(1), 14697. doi:10.1038/s41598-025-96311-0.
[7] Nilsson, P. M., Nilsson, J. Å., Hedblad, B., & Berglund, G. (2001). Sleep disturbance in association with elevated pulse rate for prediction of mortality - Consequences of mental strain? Journal of Internal Medicine, 250(6), 521–529. doi:10.1046/j.1365-2796.2001.00913.x.
[8] Arumugam, G. R. M., Anbananthen, K. S. M., & Muthaiyah, S. (2025). Improving Patient Turnaround Time in Malaysian Hospitals with Real-Time IoT BLE Location Tracking. Journal of Human, Earth, and Future, 6(1), 115–130. doi:10.28991/HEF-2025-06-01-08.
[9] Kajornkasirat, S., Sawangwong, C., Puangsuwan, K., Chanapai, N., Phutthamongkhon, W., & Puttinaovarat, S. (2025). Integrating AI-Driven Predictive Analytics in Wearable IoT for Real-Time Health Monitoring in Smart Healthcare Systems. Applied Sciences (Switzerland), 15(8), 4400. doi:10.3390/app15084400.
[10] Ciabattoni, L., Ferracuti, F., Longhi, S., Pepa, L., Romeo, L., & Verdini, F. (2017). Real-time mental stress detection based on smartwatch. 2017 IEEE International Conference on Consumer Electronics, ICCE 2017, 110–111. doi:10.1109/ICCE.2017.7889247.
[11] Nath, R. K., Thapliyal, H., & Caban-Holt, A. (2020). Validating Physiological Stress Detection Model Using Cortisol as Stress Bio Marker. 2020 IEEE International Conference on Consumer Electronics (ICCE), 1–5. doi:10.1109/icce46568.2020.9042972.
[12] Wu, W., Pirbhulal, S., Zhang, H., & Mukhopadhyay, S. C. (2019). Quantitative Assessment for Self-Tracking of Acute Stress Based on Triangulation Principle in a Wearable Sensor System. IEEE Journal of Biomedical and Health Informatics, 23(2), 703–713. doi:10.1109/JBHI.2018.2832069.
[13] Rachakonda, L., Mohanty, S. P., Kougianos, E., & Sundaravadivel, P. (2019). Stress-Lysis: A DNN-Integrated Edge Device for Stress Level Detection in the IoMT. IEEE Transactions on Consumer Electronics, 65(4), 474–483. doi:10.1109/TCE.2019.2940472.
[14] Kumar, A., Sharma, N., Chauhan, R., Joshi, K., Mitra, D., & Madaan, V. (2024). Predicting Stress Levels in Sleep Patterns using Machine Learning Models and a Smart Yoga Pillow. 2024 7th International Conference on Contemporary Computing and Informatics (IC3I), 516–522. doi:10.1109/ic3i61595.2024.10828782.
[15] Anitha, K. L. (2025). Stacking Ensemble Model for Stress Detection using Sleeping Habits. 2025 International Conference on Intelligent and Innovative Technologies in Computing, Electrical and Electronics (IITCEE), 1–4. doi:10.1109/iitcee64140.2025.10915516.
[16] Wahab, O., Adda, M., & Zrira, N. (2024). SereniSens: a Multimodal AI Framework with LLMs for Stress Prediction through Sleep Biometrics. Procedia Computer Science, 251, 342–349. doi:10.1016/j.procs.2024.11.119.
[17] Jayawickrama, J. G., & Rupasingha, R. A. H. M. (2023). Human Stress Detection Based on Sleeping Habits Using Machine Learning Algorithms. 2023 3rd International Conference on Advanced Research in Computing (ICARC), 7–12. doi:10.1109/icarc57651.2023.10145663.
[18] Rachakonda, L., Bapatla, A. K., Mohanty, S. P., & Kougianos, E. (2021). SaYoPillow: Blockchain-Integrated Privacy-Assured IoMT Framework for Stress Management Considering Sleeping Habits. IEEE Transactions on Consumer Electronics, 67(1), 20–29. doi:10.1109/TCE.2020.3043683.
[19] Shruthika, L., & Rasheedha, A. (2025). Machine learning strategies for human stress level prediction: a comparative performance analysis. IET Conference Proceedings, 2024(23), 235–239. doi:10.1049/icp.2024.4429 9.
[20] Brabin, D. R., Agitha, W., Lakshmi, P. S., & Kumar, K. K. (2025). Advanced Deep Learning for IoT Sensor Data Processing in Autonomous Vehicle Navigation Systems. AI's Role in Enhanced Automotive Safety. IGI Global Scientific Publishing, Hershey, United States. doi:10.4018/979-8-3373-0442-7.ch001.
[21] Krishnamurthi, R., Kumar, A., Gopinathan, D., Nayyar, A., & Qureshi, B. (2020). An overview of IoT sensor data processing, fusion, and analysis techniques. Sensors (Switzerland), 20(21), 1–23. doi:10.3390/s20216076.
[22] Benghazouani, S., Nouh, S., & Zakrani, A. (2025). Optimizing breast cancer diagnosis: Harnessing the power of nature-inspired metaheuristics for feature selection with soft voting classifiers. International Journal of Cognitive Computing in Engineering, 6, 1–20. doi:10.1016/j.ijcce.2024.09.005.
[23] Manikandan, G., Pragadeesh, B., Manojkumar, V., Karthikeyan, A. L., Manikandan, R., & Gandomi, A. H. (2024). Classification models combined with Boruta feature selection for heart disease prediction. Informatics in Medicine Unlocked, 44, 101442. doi:10.1016/j.imu.2023.101442.
[24] Saha, R., Malviya, L., Jadhav, A., & Dangi, R. (2024). Early stage HIV diagnosis using optimized ensemble learning technique. Biomedical Signal Processing and Control, 89, 105787. doi:10.1016/j.bspc.2023.105787.
[25] Qi, Z., Yang, S., He, X., & Shi, D. (2024). Research on Human Resource Management and Prediction Model Based on Neural Network Optimized by Genetic Algorithm. 2024 IEEE 2nd International Conference on Image Processing and Computer Applications (ICIPCA), 38, 2049–2053. doi:10.1109/icipca61593.2024.10709104.
[26] Hassan, M., & Kaabouch, N. (2024). Impact of Feature Selection Techniques on the Performance of Machine Learning Models for Depression Detection Using EEG Data. Applied Sciences (Switzerland), 14(22), 10532. doi:10.3390/app142210532.
[27] Challhua, R., Prati, R., & Champi, A. (2024). Feature engineering and machine learning for electrochemical detection of rabies virus in graphene-based biosensors. Microchemical Journal, 204, 111074. doi:10.1016/j.microc.2024.111074.
[28] Habib, S., Khan, I., Aladhadh, S., Islam, M., & Khan, S. (2022). External Features-Based Approach to Date Grading and Analysis with Image Processing. Emerging Science Journal, 6(4), 694–704. doi:10.28991/ESJ-2022-06-04-03.
[29] Scikit-learn Developers. (2025). 3.1. Cross-validation: evaluating estimator performance. Available online: https://scikit-learn.org/stable/modules/cross_validation.html (accessed on August 2025).
[30] Jamil, M., & Zepernick, H.-J. (2013). Lévy Flights and Global Optimization. Swarm Intelligence and Bio-Inspired Computation, 49–72. Elsevier, Amsterdam, Netherlands. doi:10.1016/b978-0-12-405163-8.00003-x.
[31] Viswanathan, G. M., Afanasyev, V., Buldyrev, S. V., Havlin, S., da Luz, M. G. E., Raposo, E. P., & Stanley, H. E. (2000). Lévy flights in random searches. Physica A: Statistical Mechanics and Its Applications, 282(1–2), 1–12. doi:10.1016/s0378-4371(00)00071-6.
[32] Reynolds, A. M., & Rhodes, C. J. (2009). The Lévy flight paradigm: Random search patterns and mechanisms. Ecology, 90(4), 877–887. doi:10.1890/08-0153.1.
[33] Marini, F., & Walczak, B. (2015). Particle swarm optimization (PSO). A tutorial. Chemometrics and Intelligent Laboratory Systems, 149, 153–165. doi:10.1016/j.chemolab.2015.08.020.
[34] Mohammed, H. M., Umar, S. U., & Rashid, T. A. (2019). A Systematic and Meta-Analysis Survey of Whale Optimization Algorithm. Computational Intelligence and Neuroscience, 2019(1), 8718571. doi:10.1155/2019/8718571.
[35] Nasiri, J., & Khiyabani, F. M. (2018). A whale optimization algorithm (WOA) approach for clustering. Cogent Mathematics & Statistics, 5(1), 1483565. doi:10.1080/25742558.2018.1483565.
[36] Chung, J., & Teo, J. (2023). Single classifier vs. ensemble machine learning approaches for mental health prediction. Brain Informatics, 10(1), 1–10. doi:10.1186/s40708-022-00180-6.
[37] Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., ... & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. The Journal of Machine Learning Research, 12, 2825-2830.
[38] Bates, S., Hastie, T., & Tibshirani, R. (2024). Cross-validation: what does it estimate and how well does it do it?. Journal of the American Statistical Association, 119(546), 1434-1445. doi:10.1080/01621459.2023.2197686.
[39] Nuankaew, P., Sorat, J., Intajak, J., Inta, J., & Nuankaew, W. S. (2025). AI for Healthcare: A Classification Model for Personalized Premenstrual Symptoms and Depressive Crisis Risk Tracking Using Data Analytics and Machine Learning. 2025 Joint International Conference on Digital Arts, Media and Technology with ECTI Northern Section Conference on Electrical, Electronics, Computer and Telecommunications Engineering, 299–304. doi:10.1109/ectidamtncon64748.2025.10962042.
[40] Monga, S. V., Chaudhary, R. K., Kumar, D., Jahanavi, & Jain, V. (2024). Predicting Mental Health Stress Levels Through Sleep Patterns using Ensemble Models and Explainable AI. 2024 3rd Edition of IEEE Delhi Section Flagship Conference (DELCON), 1–7. doi:10.1109/delcon64804.2024.10866636.
[41] Yang, X., Yang, Z. X., Ye, J. Y., & Chen, Y. Y. (2025). Kernel-free quadratic proximal support vector machine with Lp-norm regularization. Engineering Applications of Artificial Intelligence, 151, 110658. doi:10.1016/j.engappai.2025.110658.
[42] Lawanot, W., Inoue, M., Yokemura, T., Mongkolnam, P., & Nukoolkit, C. (2019). Daily Stress and Mood Recognition System Using Deep Learning and Fuzzy Clustering for Promoting Better Well-Being. 2019 IEEE International Conference on Consumer Electronics, ICCE 2019, 1–6. doi:10.1109/ICCE.2019.8661932.
[43] Haque, Y., Zawad, R. S., Rony, C. S. A., Al Banna, H., Ghosh, T., Kaiser, M. S., & Mahmud, M. (2024). State-of-the-art of stress prediction from heart rate variability using artificial intelligence. Cognitive Computation, 16(2), 455-481. doi:10.1007/s12559-023-10200-0.
[44] Hossain, A. A., Ahamed, I. U., Gupta, U. Das, Anika, A. N., Islam, A., & Saha, U. (2024). Exploring Sleep Patterns and Behavioral Components for Stress Detection: A Machine Learning Approach. 2024 International Symposium on Networks, Computers and Communications, ISNCC 2024, 1–6. doi:10.1109/ISNCC62547.2024.10758990.
[45] Dasgupta, A., & Basu, A. (2025). Measurement and Instrumentation for Mental Stress Detection in Humans. IEEE Instrumentation and Measurement Magazine, 28(2), 10–17. doi:10.1109/MIM.2025.10946259.
[46] Sadeghian, Z., Akbari, E., Nematzadeh, H., & Motameni, H. (2025). A review of feature selection methods based on meta-heuristic algorithms. Journal of Experimental & Theoretical Artificial Intelligence, 37(1), 1–51. doi:10.1080/0952813X.2023.2183267.
[47] Alyasiri, O. M., Cheah, Y.-N., Zhang, H., Al-Janabi, O. M., & Abasi, A. K. (2024). Text classification based on optimization feature selection methods: a review and future directions. Multimedia Tools and Applications, 84(15), 14187–14233. doi:10.1007/s11042-024-19769-6.
[48] Wang, H., Liang, Q., Hancock, J. T., & Khoshgoftaar, T. M. (2024). Feature selection strategies: a comparative analysis of SHAP-value and importance-based methods. Journal of Big Data, 11(1), 44. doi:10.1186/s40537-024-00905-w.
[49] Ju, E., Guo, Y., Park, J. I., Kim, J., Qu, A., & Lee, J. A. (2025). Sleep Quality of Persons with Dementia and Family Caregivers in Korean Americans: Wearable Technology to Study the Dyadic Association. Western Journal of Nursing Research, 47(5), 404–412. doi:10.1177/01939459251323675.
[50] Sweeten, B. L. W., Sutton, A. M., Wellman, L. L., & Sanford, L. D. (2020). Predicting stress resilience and vulnerability: Brain-derived neurotrophic factor and rapid eye movement sleep as potential biomarkers of individual stress responses. Sleep, 43(1), 199. doi:10.1093/sleep/zsz199.
[51] Mateo-Reyes, R., Cruz-Albarran, I. A., & Morales-Hernandez, L. A. (2025). Intelligent Stress Detection Using ECG Signals: Power Spectrum Imaging with Continuous Wavelet Transform and CNN. Journal of Experimental and Theoretical Analyses, 3(1), 6. doi:10.3390/jeta3010006.
- The authors retain all copyrights. It is noticeable that authors will not be forced to sign any copyright transfer agreements.
- This work (including HTML and PDF Files) is licensed under a Creative Commons Attribution 4.0 International License.
