Sleep disorders common in aging populations impact not only physical but also mental health. Early identification and knowledge about the root factors play an important role in enhancing quality of life as well as avoiding lasting health complications. In this study introduces a hybrid deep learning approach to not just classify sleep disorders like insomnia and sleep apnea but also determine the responsible factors. A hybrid Convolutional Neural Network (CNN) with Gated Recurrent Units (GRU) model with an attention mechanism is used to extract spatial as well as temporal features from structured health records. SMOTE (Synthetic Minority Over-sampling Technique) is applied in the model to treat class imbalance, allowing for better classification. LIME (Local Interpretable Model-Agnostic Explanations) is also applied to offer insights into the most influencing factors behind the predicted sleep disorder for every sample, allowing for individualized suggestions. Upon prolonged training and through these methodologies combined, the model scores over 90% accuracy, providing an efficient tool to diagnose sleep disorders with high accuracy. This also opens doors to discover the interrelationship among different physiologic and lifestyle factors, thus leading to tailored treatment plans for individuals facing sleep disorders.
Introduction
Sleep is vital for physical and mental health, but sleep disorders—such as insomnia, sleep apnea, and restless leg syndrome—are widespread and significantly impact quality of life globally, including in countries like India and the U.S. These disorders are linked to serious health issues like cardiovascular disease, obesity, diabetes, cognitive impairment, depression, and anxiety.
Sleep quality depends on stages of sleep (NREM and REM), and disturbances in these stages contribute to disorders. Polysomnography (PSG) is the gold standard for diagnosis but is costly and complex. Machine learning (ML) and deep learning (DL) techniques show promise for automated, accurate classification of sleep disorders from physiological data such as EEG and ECG.
Many recent studies use ML/DL for diagnosing sleep disorders, each with limitations like small datasets, lack of clinical validation, or ignoring lifestyle and environmental factors. Current models also struggle with explaining causes, which is key for personalized treatment.
This study proposes a hybrid CNN-GRU model with an attention mechanism to classify sleep disorders using a labeled dataset combining health and lifestyle factors. CNN extracts spatial features, GRU captures temporal dependencies, and attention highlights the most relevant features. LIME is applied to interpret predictions and identify individual risk factors, improving transparency and clinical relevance.
The model outperforms traditional ML methods in accuracy (90.6%), precision, recall, and F1-score, effectively classifying disorders like insomnia and sleep apnea and identifying key causes such as short sleep duration, high stress, high BMI, and low physical activity.
Conclusion
This research has effectively introduced a deep learning-based technique for classifying sleep disorders and identifying their causes using a hybrid CNN-GRU model with an Attention Mechanism and LIME interpretation. The model is able to extract both spatial and temporal features from a dataset on sleep health and lifestyle, leading to improved classification accuracy and causes detection and analysis. Using several deep learning techniques, this system successfully determined the important risk factors?related to the sleep dysregulation that should be addressed for personalised care. After, evaluate metrics on this model such as accuracy, precision, recall, AUC-ROC. showed that in comparison to?classical ML algorithms this model performed efficiently.
The attention mechanism also enhanced interpretability by highlighting important features such as sleep duration, level of stress, and BMI those parameters that are major contributors to diseases such as Insomnia, Sleep Apnea, and No Disorder. These results identify the potential of AI-based solutions in healthcare for early detection and personalized treatment plans.
References
R. Anita and A. Karuppiah, “A Survey on Recent Advances in Machine Learning Based Sleep Apnea Detection Systems,” Healthcare, vol. 9, no. 7, p. 914, Jul. 2021, doi: https://doi.org/10.3390/healthcare9070914.
S. Kusmakar et al., “A machine learning model for multi-night actigraphic detection of chronic insomnia: development and validation of a pre-screening tool,” Royal Society Open Science, vol. 8, no. 6, p. 202264, Jun. 2021, doi: https://doi.org/10.1098/rsos.202264.
N. Singh and R. H. Talwekar, “Comparison of Machine Learning and Deep Learning Classifier to Detect Sleep Apnea Using single-channel ECG and HRV: a Systematic Literature Review,” Journal of Physics: Conference Series, vol. 2273, no. 1, p. 012015, May 2022, doi: https://doi.org/10.1088/1742-6596/2273/1/012015.
G. Bazoukis et al., “Application of Artificial Intelligence in the Diagnosis of Sleep Apnea,” Journal of Clinical Sleep medicine: JCSM: Official Publication of the American Academy of Sleep Medicine, vol. 19, no. 7, pp. 1337–1363, Jul. 2023, doi: https://doi.org/10.5664/jcsm.10532.
Alaa Abd-Alrazaq et al., “Detection of Sleep Apnea Using Wearable AI: Systematic Review and Meta-Analysis,” Journal of Medical Internet Research, vol. 26, no. 10, pp. e58187–e58187, Sep. 2024, doi: https://doi.org/10.2196/58187.
Talal Sarheed Alshammari, “Applying Machine Learning Algorithms for the Classification of Sleep Disorders,” IEEE Access, pp. 1–1, Jan. 2024, doi: https://doi.org/10.1109/access.2024.3374408.
C.-H. Su et al., “Extracting Stress-Related EEG Patterns from Pre-Sleep EEG for Forecasting Slow-Wave Sleep Deficiency,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 32, pp. 1817–1827, 2024, doi: https://doi.org/10.1109/tnsre.2024.3394471.
P. Tripathi et al., “Ensemble Computational Intelligent for Insomnia Sleep Stage Detection via the Sleep ECG Signal,” IEEE Access, vol. 10, pp. 108710–108721, Jan. 2022, doi: https://doi.org/10.1109/access.2022.3212120.
M. Beard, “Smart Pajamas Can Monitor Sleep Apnea and Other Disorders at Home and Send the Results to Your Smartphone,” New York Post, Feb. 21, 2025. https://nypost.com/2025/02/21/health/smart-pajamas-can-monitor-sleep-disorders-at-home/
J. Brownlee, “SMOTE for Imbalanced Classification with Python,” Machine Learning Mastery, Jan. 16, 2020. https://machinelearningmastery.com/smote-oversampling-for-imbalanced-classification/
C. Li, D. Liu, M. Wang, H. Wang, and S. Xu, “Detection of Outliers in Time Series Power Data Based on Prediction Errors,” Energies, vol. 16, no. 2, p. 582, Jan. 2023, doi: https://doi.org/10.3390/en16020582.
Christoph Molnar, “5.7 Local Surrogate (LIME) | Interpretable Machine Learning,” Github.io, Sep. 18, 2019. https://christophm.github.io/interpretable-ml-book/lime.html
T. Soni, “Enhancing Accuracy of Sleep Disorder with Logistic Regression Model | IEEE Conference Publication | IEEE Xplore,” ieeexplore.ieee.org, Sep. 30, 2023. https://ieeexplore.ieee.org/document/10295230
I. A. Hidayat, “Classification of Sleep Disorders Using Random Forest on Sleep Health and Lifestyle Dataset,” Journal of Dinda : Data Science, Information Technology, and Data Analytics, vol. 3, no. 2, pp. 71–76, Aug. 2023, doi: https://doi.org/10.20895/dinda.v3i2.1215.
[15] N. Malik, V. Gupta, and V. Sharma, “Predictive Analysis of Sleep Disorders Using Machine Learning: a Comprehensive Analysis,” 2024 International Conference on Trends in Quantum Computing and Emerging Business Technologies, pp. 1–4, Mar. 2024, doi: https://doi.org/10.1109/tqcebt59414.2024.10545120