Mental health issues like stress and sadness are becoming more common in today\'s fast-paced, extremely demanding society. Early detection and intervention are therefore essential to stop these conditions from deteriorating. Using data gathered from the Smart_Pillow_Stress_Detection_Machine_Learning dataset, this project offers a smart mobile app that uses machine learning algorithms to forecast user stress and depression levels. Given its simplicity and efficacy in managing health-related behavioral data, the program uses the K-Nearest Neighbors (KNN) classification approach. The system uses sleep patterns, heart rate, and other vital signs recorded via a smart pillow to examine physiological and behavioral parameters in order to categorize the user\'s mental state into different degrees of stress and sadness. Supported healthier and more balanced lives, this smart prediction tool seeks to help people monitor their mental health and act timely.
Introduction
Mental health issues, especially stress and depression, have become increasingly prevalent in the 21st century due to fast-paced, digitally connected lifestyles. Despite the high global impact—depression affects over 264 million people—traditional mental health evaluations are often inconvenient and inaccessible.
Emerging smart healthcare technologies like smartwatches and smart pillows enable continuous, non-invasive monitoring of physiological and behavioral data. These devices, combined with machine learning, offer new opportunities for real-time mental health prediction. The smart pillow, equipped with sensors tracking sleep quality, heart rate, and movement, serves as a key data source for detecting stress and sadness.
This project uses the Smart_Pillow_Stress_Detection_Machine_Learning dataset and employs the K-Nearest Neighbors (KNN) algorithm, a straightforward and efficient supervised learning method, to classify users’ mental states via a mobile app. The app aims to provide timely mental health insights, raising awareness and promoting early intervention.
Additionally, AI and computer vision techniques analyzing facial expressions can aid depression detection by identifying unique behavioral patterns like reduced expressiveness or sad micro-expressions. Advances in machine learning and mobile sensing have significantly expanded access to mental health monitoring, potentially closing gaps between diagnosis and treatment through continuous, personalized care.
The literature review highlights numerous machine learning models applied to mental health prediction, with varied approaches including neural networks, SVM, and decision trees, often achieving high accuracy.
Conclusion
In this research, a stress level classifier system was implemented using the dataset and the K-Nearest Neighbours (KNN) algorithm. The system accurately classified stress at three levels—Low, Medium, and High—with a total accuracy of over 94%. With extensive preprocessing, model optimization, and assessment using metrics such as accuracy, precision, recall, and confusion matrix, the system proved high in reliability and low in misclassification.
This model was incorporated into a depression detection application, in which it is used as the foundation of the prediction module. Coupled with an assessment interface, the application provides an applicable, real-time mental health monitoring tool. The method demonstrates that machine learning, particularly KNN, has the potential to contribute significantly to improved personal well-being through accessible and intelligent stress detection.
References
[1] M. Mohan, A. Abhinav, A. Ashok, A. Akhil, and P. R. Achinth,“Depression detection using facial expression and sentiment analysis,”2021 Asian Conference on Innovation in Technology (ASIANCON).
[2] X. Zhou, K. Jin, Y. Shang, and G. Guo, “Visually interpretable representation learning for depression recognition from facial images,” IEEE Transactions on Affective Computing,2020
[3] S. Tyagi, K. Panchal, P. Chitta, S. Todi, S. Priya, and R. Pawar, “Emotionomics: Pioneering depression detection through facial expression analytics,” 2023 7th International Conference On Computing, 2023
[4] Z. Shangguan, Z. Liu, G. Li, Q. Chen, Z. Ding, and B. Hu, “Dual-stream multiple instance learning for depression detection with facial expression videos,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 31, pp. 554–563, 2022
[5] M. Yang, Y. Ma, Z. Liu, H. Cai, X. Hu, and B. Hu, “Undisturbed mental state assessment in the 5g era: A case study of depression detection based on facial expressions,” IEEE Wireless Communications, vol. 28, pp. 46–53, 2021
[6] J. Ye, Y. Yu, Y. Zheng, Y. Liu, and Q. Wang, “Dep-fer: Facial expression recognition in depressed patients based on voluntary facial expression mimicry,” IEEE Transactions on Affective Computing, vol. 15, pp. 1725–1738, 2024
[7] X. hua Chen and T. Luo, “Catching elusive depression via facial microexpression recognition,” IEEE Communications Magazine, vol. 61, pp.30–36, 2023.
[8] Q. Wang, H. Yang, and Y. Yu, “Facial expression video analysis for depression detection in chinese patients,” J. Vis. Commun. Image Represent., vol. 57, pp. 228–233, 2018.
[9] M. Li, Y. Wang, C. Yang, Z. Lu, and J. Chen, “Automatic diagnosis of depression based on facial expression information and deep convolutional neural network,” IEEE Transactions on Computational Social Systems, vol. 11, pp. 5728–5739, 2024.
[10] R. Islam and S. W. Bae, “Facepsy: An open-source affective mobile sensing system - analyzing facial behavior and head gesture for depression detection in naturalistic settings,” ArXiv, vol. abs/2406.17181,2024.
[11] Y. Li, Z. Liu, L. Zhou, X. Yuan, Z. Shangguan, X. Hu, and B. Hu,“A facial depression recognition method based on hybrid multi-headcross attention network,” Frontiers in Neuroscience, vol. 17, 5 2023.
[12] W. Guo, H. Yang, Z. Liu, Y. Xu, and B. Hu, “Deep neural networks for depression recognition based on 2D and 3D facial expressions under emotional stimulus tasks,” Frontiers in Neuroscience, vol. 15, 4 2021.
[13] R. Wang, J. Huang, J. Zhang, X. Liu, X. Zhang, Z. Liu, P. Zhao, S. Chen, and X. Sun, “FacialPulse: an efficient RNN-based depression detection via temporal facial landmarks,” 8 2024.
[14] M. Tadalagi and A. Joshi, “Autodep: automatic depression detection using facial expressions based on linear binary pattern descriptor,”Medical Biological Engineering Computing, vol. 59, pp. 1339 – 1354, 2021.
[15] S. Harati, A. Crowell, Y. Huang, H. Mayberg, and S. Nemati, “Classifying depression severity in recovery from major depressive disorder via dynamic facial features,” IEEE journal of biomedical and health informatics, vol. 24, no. 3, pp. 815–824, 2019.
[16] G. Gilanie, M. Asghar, A. M. Qamar, H. Ullah, R. U. Khan, N. Aslam, I. U. Khan et al., “An automated and real-time approach of depression detection from facial micro-expressions.” Computers, Materials &Continua, vol. 73, no. 2, 2022.
[17] S. Nepal, A. Pillai, W. Wang, T. Griffin, A. C. Collins, M. Heinz, D. Lekkas, S. Mirjafari, M. Nemesure, G. Price et al., “Moodcapture: Depression detection using in-the-wild smartphone images,” in Proceedings of the 2024 CHI Conference on Human Factors in ComputingSystems, 2024, pp. 1–18.
[18] A. Diwan, R. Sunil, P. Mer, R. Mahadeva, and S. P. Patole, “Advancements in emotion classification via facial and body gesture analysis: A
[19] survey,” Expert Systems, vol. 42, no. 2, p. e13759, 2025.
[20] GundetiSaiManvith*1,GunnaShivaniReddy*2,BandiLakshmaReddy*3,‘’MENTALHEALTHPREDICTIONFORANINDIVIDUALUSINGMACHINE LEARNING’’,07 july 2022
[21] Samaneh Madanian, David Parry, Olayinka Adeleye, Christian Poellabauer,Farhaan Mirza, Shilpa Mathew, Sandra Schneider ,‘’ Automatic Speech EmotionRecognition Using Machine Learning: Mental Health Use Case’’ , 2022
[22] U.Sairam1,SanthoshVoruganti2,‘’MentalHealthPredictionUsingDeepLearning‘’,Feb2022
[23] Prem Patil1, Arun Bhau2, ShubhamDamani3, Pritam Pandile4, Prof. Swapnaja Jadhav5 , ‘’ Mental HealthChatbot System by Using Machine Learning‘’ , 05May2022
[24] Shumaila Aleem1 , Noor ul Huda 1 , Rashid Amin1,* , Samina Khalid2 ,Sultan S. Alshamrani 3 and Abdullah Alshehri 4 , ‘’ MachineLearning Algorithmsfor Depression: Diagnosis, Insights, and Research Directions ‘’ ,31 March 2022
[25] IqraAmeer1[0000?0002?1134?9713],MuhammadArif1[0000?0001?06141?02047],GrigoriSidorov1[0000?0003?3901?3522],HelenaG´omez-
[26] Adorno2[0000?0002?6966?9912],AlexanderGelbukh1[0000?0001?7845?9039],‘’MentalIllnessClassificationonSocialMediaTextsusingDeepLearning and Transfer Learning’’ , 3 Jul 2022
[27] Katrina Hueniken1,2 , MPH; Nibene Habib Somé 2,3,4,5,6 , PhD; Mohamed Abdelhack1 , PhD; Graham Taylor7,8 , PhD; Tara Elton Marshall2,3,4,6,9,10 ,PhD;Christine MWickens2,3,4,11,12 ,PhD;Hayley AHamilton2,3,4 ,PhD;Samantha Wells2,3,4,6,13,14 ,PhD;Daniel Felsky1,13,15,16 ,PhD ,‘’ MachineLearning–Based Predictive Modeling of Anxiety and Depressive Symptoms During 8 Months of the COVID-19 Global Pandemic: Repeated Cross-sectionalSurvey Study’’, 2021
[28] Fadhluddin Sahlan1 , Faris Hamidi2 , Muhammad Zulhafizal Misrat3 , Muhammad Haziq Adli4 , Sharyar Wani5 , Yonis Gulzar6 , ‘’ Prediction of MentalHealth Among University Students’’ ,27 July 2021
[29] Prof.YogeshPingle,‘’EvaluationofMentalStressusingPredictiveAnalysis’’,2021
[30] Anja Thieme, Danielle Belgrave, and Gavin Doherty , ‘’ Machine Learning in Mental Health: A Systematic Review of the HCI Literature to Support theDevelopment of Effective and Implementable ML Systems ‘’, August 2020
[31] ROHIZAHABDRAHMAN1,KHAIRUDDINOMAR1,SHAHRULAZMANMOHDNOAH1,(Member,IEEE),MOHDSHAHRULNIZAMMOHD
[32] DANURI2,(Member,IEEE),ANDMOHAMMEDALIAL-GARADI3,‘’ApplicationofMachineLearningMethodsinMentalHealthDetection:ASystematic Review ‘’, October 20, 2020
[33] AnuPriyaa,ShrutiGarga,*,NehaPrernaTiggaa,‘’PredictingAnxiety,DepressionandStressinModernLifeusingMachineLearningAlgorithms‘’, 2020.