AI Model for Detecting Depression Based on Sleep Pattern Analysis Using Sequence Models
Abstract
Depression is generally diagnosed through subjective clinical assessments, so objective biomarkers such as sleep patterns are needed. Unfortunately, conventional machine learning methods often ignore the temporal dynamics of sleep. This study aims to evaluate four Sequence Models architectures (LSTM, Bi-LSTM, GRU, Bi-GRU) to detect indications of depression from 7 days of sequential sleep data. The methodology processes data from 5,782 subjects using six physiological features (oxygen saturation, sleep efficiency, spindle microarchitecture) converted into a 3D matrix. Evaluation uses Precision, Recall, F1-Score, and ROC-AUC metrics to handle imbalanced data. The results prove that the Bidirectional model is more robust in capturing the temporal context holistically. Bi-GRU achieved the highest ROC-AUC score (0.9909), while Bi-LSTM produced the best F1-Score (0.85) and Recall (0.82). The standard GRU was validated as the most computationally efficient model (5 seconds/epoch). Explainable AI analysis confirmed that fast spindle percentage, REM duration, and spindle density are the strongest predictors of affective dysfunction. In conclusion, the Bidirectional architecture has proven reliable in identifying sleep anomalies, providing a solid foundation for real-time IoMT-based psychiatric screening systems.
Downloads
References
I. D. Nugraha and Y. Azhar, “Deteksi Depresi Pengguna Twitter Indonesia Menggunakan Metode Long Short-Term Memory Recurrent Neural Network (LSTM-RNN) Jurnal Nasional Pendidikan Teknik Informatika : JANAPATI | 321,” vol. 11, pp. 320–329, 2022.
M. Bragan, “Quality of Sleep and Depression in College Students : A Systematic Review,” vol. 11, no. 4, pp. 290–301, 2023, doi: 10.5935/1984-0063.20180045.
P. Malik, “Time-Series Analysis of Behavioral Patterns from Wearable Device Data for Depression Detection,” pp. 1–11, 2025.
M. Xing, L. Zhang, J. Li, Z. Li, Q. Yu, and W. Li, “European Journal of Internal Medicine Development and validation of a novel sleep health score in the sleep heart health study,” vol. 127, no. April 2024, pp. 112–118, 2025, doi: 10.1016/j.ejim.2024.05.002.
D. A. Putri and M. Yasin, “Data Mining dengan Menggunakan Metode Time Series Analysis pada Pola Waktu Tidur,” vol. 07, no. 02, pp. 65–72, 2025.
R. Tao, S. Ding, J. Chen, et al., "Identifying Depressive Disorder With Sleep Electroencephalogram Data: A Study Based on Deep Learning," Journal of Sichuan University (Medical Science Edition), vol. 54, no. 2, pp. 287-292, 2023.
A. Nadeem, M. Naveed, M. I. Satti, H. Afzal, T. Ahmad, and K. Kim, “Depression Detection Based on Hybrid Deep Learning SSCL Framework Using Self-Attention Mechanism : An Application to Social Networking Data,” pp. 1–28, 2022.
S. A. Nabi, L. Smitha, S. Kodati, N. Srinivas, and D. Madhavi, “Automated Depression Detection Using EEG Signals with Deep Learning and Attention Mechanism,” vol. 13, no. 4, pp. 336–348, 2024.
A. M. Huda, G. F. Shidik, V. Praskatama, I. Engineering, and U. D. Nuswantoro, “Comparative Analysis of LSTM, BiLSTM, GRU, CNN, and RNN for Depression Detection on Indonesian Twitter Users,” vol. 5, no. 6, pp. 1723–1735, 2024.
D. Li, Z. Li, M. Li, B. Liu, and Q. Fang, “Regular sleep patterns , not just duration , critical for mental health : association of accelerometer-derived sleep regularity with incident depression and anxiety,” 2025.
N. Overmars, “Predicting Depression and Sleep Disturbances from Circadian Rhythm Biomarkers with Machine Learning,” 2025.
H.-W. Yang et al., “Fractal biomarker of daily activity for women with early onset depression,” pp. 1–8, 2025, doi: 10.1136/bmjment-2024-301321.
S. M. Alhashmi and S. Hashim, “Depression Detection using a Hybrid CNN-BiGRU-BiLSTM model with BERT Embedding and Data Augmentation,” 2025 IEEE 22nd Int. Multi-Conference Syst. Signals & Devices, pp. 340–347, 2025, doi: 10.1109/SSD64182.2025.10989873.
O. Cetin and H. M. Saraoglu, “Deep Recurrent Architectures for EEG-Based Classification of Major Psychiatric Disorders : A Comparative Study of LSTM , BiLSTM , GRU , BiGRU , and Their Hybrids,” IEEE Access, vol. 14, no. January, pp. 12354–12375, 2026, doi: 10.1109/ACCESS.2026.3655481.
Y. Cao, Y. Hao, B. Li, and J. Xue, “Depression prediction based on BiAttention ‑ GRU ,” J. Ambient Intell. Humaniz. Comput., no. 0123456789, 2021, doi: 10.1007/s12652-021-03497-y.
M. Albathan, “Sleep Disorder Diagnosis Through Complex-Morlet- Wavelet Representation Using Bi-GRU and Self- Attention,” vol. 15, no. 8, pp. 129–144, 2024.
J. Kim and M. Park, “Systems memory consolidation during sleep : oscillations , neuromodulators , and synaptic remodeling,” vol. 58, no. 10, pp. 425–436, 2025.
C. Cirelli and G. Tononi, “Seminars in Cell and Developmental Biology The why and how of sleep-dependent synaptic down-selection,” Semin. Cell Dev. Biol., no. January, 2021, doi: 10.1016/j.semcdb.2021.02.007.
D. Riemann et al., “Chronic insomnia , REM sleep instability and emotional dysregulation : A pathway to anxiety and depression ?,” no. April 2024, pp. 1–14, 2025, doi: 10.1111/jsr.14252.
M. J. Ahmed, A. Mozo, and A. Karamchandani, “A survey on graph neural networks , machine learning and deep learning techniques for time series applications in industry,” no. 2006, 2025, doi: 10.7717/peerj-cs.3097.
S. Difrancesco and F. Lamers, “The role of depressive symptoms and symptom dimensions in actigraphy-assessed sleep , circadian rhythm , and physical activity,” 2022.
M. Xu, X. Yin, and Y. Gong, “Lifestyle Factors in the Association of Shift Work and Depression and Anxiety,” vol. 6, no. 8, pp. 1–12, 2023, doi: 10.1001/jamanetworkopen.2023.28798.
S. R. Yiallourou, L. Cribb, M. G. Cavuoto, and E. Rowsthorn, “Association of the Sleep Regularity Index With Incident Dementia and Brain Volume,” pp. 1–9, 2024, doi: 10.1212/WNL.0000000000208029.
F. Rivas and J. E. Sierra-garcia, “Comparison of LSTM- and GRU-Type RNN Networks for Attention and Meditation Prediction on Raw EEG Data from Low-Cost Headsets,” pp. 1–33, 2025.
J. Mulo, H. Liang, M. Qian, M. Biswas, B. Rawal, and Y. Guo, “Navigating Challenges and Harnessing Opportunities : Deep Learning Applications in Internet of Medical Things,” pp. 1–48, 2025.





