SleepHealth-AI: Interpretable machine learning for exploratory sleep-apnea screening using lifestyle and vitals data
Figures
Abstract
The recent years have seen a notable rise in the attention paid to the problem of the morbidity caused by obstructive sleep apnea (OSA) and its comorbidities with cardiovascular, metabolic, and neurocognitive diseases. Despite this, OSA stays severely under-diagnosed, owing to the high cost of the current diagnostic method (polysomnography, or PSG) and its invasiveness. Hence, the development of efficient and inexpensive tools for population-wide OSA screenings has become urgent. Against this backdrop, the present work introduces SleepHealth-AI – an explainable machine learning approach based on the physiological, lifestyle, and demographical data obtained from the Sleep Health and Lifestyle Dataset (SHLD). Specifically, a pipeline of leakage-free data pre-processing, Gini-based feature selection, and comparative performance testing of six algorithms (Random Forest, or RF; Gradient Boosted Trees, or GBT; Support Vector Machine, or SVM; Logistic Regression, or LR; Artificial Neural Network, or ANN; and meta-classifier) was developed. For reliable evaluation, ten-fold nested cross-validation was implemented. The results indicated that RF and GBT provided comparable metrics (mean accuracy of 0.96 and F1-score of 0.92). At the same time, the best AUC of 0.953 was reported for the SVM model (the 95% confidence interval – [0.821, 1.000]). Additionally, the strong probability calibration of the algorithm was confirmed, with the Brier score equaling 0.048 and the Expected Calibration Error equaling 0.016. Finally, decision curve analysis (DCA) yielded positive net benefit values for all tested threshold probabilities (ranging from 0.05 to 0.50). Moreover, the repeated block-wise ablation analysis showed low sensitivity to the loss of partial input information, which suggests model robustness. Given the synthetic nature of SHLD and the absence of independently verified clinical diagnostic labels, these findings should be interpreted as exploratory and require validation in clinically characterized cohorts. Overall, the results support further investigation of SleepHealth-AI as a non-invasive screening aid for identifying individuals who may warrant definitive diagnostic testing, rather than as an alternative to PSG.
Citation: Ul Haq I, Patoli N, Khan MA, Iqbal A, Almuqren L, Yang Z, et al. (2026) SleepHealth-AI: Interpretable machine learning for exploratory sleep-apnea screening using lifestyle and vitals data. PLoS One 21(12): e0362743. https://doi.org/10.1371/journal.pone.0362743
Editor: Sina Dindarian, University of Pennsylvania Perelman School of Medicine, UNITED STATES OF AMERICA
Received: May 14, 2026; Accepted: October 29, 2026; Published: December 2, 2026
Copyright: © 2026 Ul Haq et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The data that support the findings of this study are openly available in the Sleep Health and Lifestyle Dataset at https://www.kaggle.com/datasets/uom190346a/sleep-health-and-lifestyle-dataset.
Funding: This work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia, under Grant No. KFU265442. This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) under the artificial intelligence star fellowship support program to nurture the best talents (IITP-2026-RS-2026-25617111) grant funded by the Korea government(MSIT), the National Research Foundation of Korea(NRF) grant funded by the Korea government(MSIT) (No. RS-2023-00218176) and the Soonchunhyang University Research Fund. The authors also acknowledge Princess Nourah bint Abdulrahman University Researchers 327 Supporting Project number PNURSP2026R349, Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia.
Competing interests: NO authors have competing interests.
Introduction
Sleep disorders and OSA have been of utmost importance over the past few decades because of the various cardiovascular, metabolic and cognitive implications caused thereby [1–3]. OSAS is marked by repeated episodes of upper airway obstruction during sleep leading to periodic hypoxia, disrupted sleep pattern and sleep arousal [4,5]. The prevalence rate of OSA ranges anywhere between 9% and 38%, and it appears to be more common among older patients and obese individuals [6,7]. One of the major drawbacks related to OSA is that it has been under-diagnosed over the years owing to its invasive and expensive nature of diagnosis through PSG procedure which includes recording of physiological signals such as EEG, EOG, EMG, airflow, oxygen saturation, and respiration activity [8,9]. Although PSG serves as the gold-standard test for the detection of OSA, it is very costly, cumbersome, and difficult to implement because of all the above reasons, which led researchers to devise ways for detecting the condition based on readily available indicators such as demographics, physiologic measurements and lifestyle-related parameters.
Fig 1 illustrates various symptoms of OSA including those experienced at nighttime and during daytime. These symptoms are inclusive of loud snoring, sleep gasping, frequent arousals from sleep as well as daytime consequences like fatigue, poor concentration and drowsiness.
A number of studies have used artificial intelligence or machine learning to develop models for the screening or predicting OSA. Some such models make use of biomedical signal data whereas others depend on data obtained from wearable sensors or employ feature extraction techniques [10,11]. Though promising results have been reported, several of these approaches have depended on dedicated sensors or lack thorough validation of their performance, interpretability, and generalizability.
On the other hand, datasets like SHLD enable the development of such diagnostic algorithms based on non-invasive and accessible features. However, little progress has been made in developing such systems with regard to structured frameworks for assessing reliability, interpretability, and robustness when developed through such data sources. Specifically, very few such models have attempted systematic assessment of feature importance, model stability under partial input conditions, and comparative benchmarking with respect to multiple classifiers.
Hence, the current work proposes SleepHealth-AI, an interpretable machine-learning framework for exploratory screening of the dataset-provided sleep-apnea category using SHLD. The proposed system includes pre-processing, feature selection, classifier development and evaluation of model robustness through ablation analysis. This framework is based on several classification models to provide comparisons. In general, the present study seeks to achieve the following objectives:
- To develop and internally evaluate a machine-learning framework for exploratory sleep-apnea screening using accessible tabular attributes.
- To develop, compare, and evaluate multiple classification models for assessing performance.
- To assess feature importance and model stability under partial input conditions.
- To explore the potential of the proposed framework as a preliminary screening aid that may support referral for definitive diagnostic testing in future telemedicine or primary-care applications.
These objectives support the primary aim of developing a low-cost, reliable and interpretable framework for exploratory sleep-apnea screening. The proposed approach is intended as a potential preliminary aid for identifying individuals who may warrant subsequent clinically validated sleep assessment; it is not intended to replace PSG or other established diagnostic procedures.
The paper has been organized as follows. The literature review is presented in Section 1. Description of the proposed methodology follows in Section 1. Experimental results and comparative analysis are provided in Section 1. The concluding remarks follow in Section 1.
Literature review
The complex nature of obstructive sleep apnea (OSA), together with its associated morbidities, including excessive daytime sleepiness, cardiovascular disease, metabolic disorders, and cognitive impairment, has motivated extensive research on automated OSA screening and diagnosis. Several studies have explored machine learning (ML) and artificial intelligence (AI) methods for OSA prediction and detection [12,13].
The clinical gold standard for OSA diagnosis is polysomnography (PSG). However, PSG is time-consuming, expensive, and intrusive for many patients [14]. These limitations have encouraged the use of alternative input data for ML-based OSA screening, including demographic attributes, lifestyle-related variables, questionnaire responses, wearable sensor data, and clinical attributes. For example, the publicly available Sleep Health and Lifestyle Dataset (SHLD) provides synthetic tabular records containing demographic, lifestyle, sleep-related, and cardiovascular attributes together with categorical sleep-disorder labels [15]. Because the dataset documentation does not report clinically verified diagnostic procedures for these labels, SHLD is more appropriately used for exploratory machine-learning development than for establishing clinical diagnostic performance.
Several studies have investigated structured datasets and clinical features for OSA prediction. Gutiérrez-Tobal et al. [16] evaluated multiple ML algorithms for estimating OSA severity using at-home oximetry data. Kim et al. [17] trained ML models to predict OSA in Korean adults. Alshammari [18] examined supervised learning algorithms for sleep disorder classification using questionnaire-based data and showed the potential of ML approaches in sleep health analysis. However, many of these studies depend on signal-based inputs or provide limited analysis of feature-level contribution, feature selection, and model robustness.
Advanced learning paradigms, including ensemble models, probabilistic models, and artificial neural networks (ANNs), have also been used for OSA prediction. Khan et al. [19] proposed an ML-and optimization-based approach to identify OSA risk factors using SHLD data. Shi et al. [20] developed an ML-based method for predicting OSA-related hypertension. Liang [21] proposed a probabilistic ensemble model for home-based OSA screening using overnight SpO2 measurements. Although these approaches reported promising predictive performance, they often rely on biosignal data or do not sufficiently evaluate model robustness when only partial feature information is available.
Wearable-device-based ML and deep learning methods have also gained attention for sleep apnea detection and diagnosis. Osa-Sanchez et al. [22] reviewed recent wearable sensor-and AI-driven methods for detecting sleep apnea and related sleep disorders. Yook et al. [23] developed a deep learning framework to predict sleep apnea-hypopnea events and estimate their clinical severity. Hoang and Liang [24] extended this direction using continuous wearable SpO2 measurements and multiscale feature extraction. Although these methods show strong performance, they require labeled biomedical signals and sufficient computational resources for implementation.
Another important direction in sleep apnea research involves explainable AI (XAI). Deep learning and attention-based models [25], such as those proposed by Supratak et al. [25] and Eldele et al. [26], have achieved promising results in sleep stage classification using electroencephalography (EEG) data. However, these models still rely on biosignal data and require specialized hardware for data acquisition. In contrast, tabular-data-based ML algorithms provide a lightweight alternative for preliminary OSA screening using demographic, lifestyle, and clinical features.
Table 1 provides a comparative summary of previous studies in OSA detection and related sleep health prediction. As shown in the table, most existing approaches depend on biosignal data, such as SpO2 or EEG, and many do not provide sufficient generalization analysis, ablation analysis, or interpretability assessment.
Overall, the limitations of existing literature can be summarized as follows: (i) inconsistencies in preprocessing pipelines; (ii) limited interpretability and ablation analysis; (iii) inadequate error assessment and model convergence analysis; and (iv) insufficient robustness evaluation under partial feature availability. These limitations highlight the need for computationally efficient, explainable, and deployable models based on feasible and easily obtainable data.
To address these gaps, the proposed SleepHealth-AI system uses Gini-based feature selection and ANN-based classification with block-wise ablation analysis. In addition, statistical measures, including confidence intervals and error distribution analysis, are used to evaluate model performance more comprehensively.
Compared with existing SHLD-based models, which mainly focus on classification accuracy, the proposed study emphasizes robustness, interpretability, and deployment feasibility. Through ablation-based validation and lightweight feature extraction, SleepHealth-AI demonstrates reduced dependence on specific feature clusters and improved stability under partial input conditions.
Proposed methodology
This section describes the methodological pipeline adopted for exploratory sleep-apnea screening using the proposed ML framework. The pipeline includes dataset characterization, data preprocessing, feature engineering, model comparison, hyperparameter tuning through cross-validation, model evaluation, model calibration, and robustness assessment using a block-wise ablation approach. The complete workflow is shown in Fig 2.
The proposed end-to-end framework includes data collection, feature generation, model benchmarking, calibration, decision curve analysis, and robustness validation through ablation analysis.
Ethics approval
Not applicable. This study involved secondary analysis of a publicly available synthetic dataset and did not involve recruitment of human participants, animal subjects, access to identifiable health records, or collection of new clinical data.
Dataset characterization and label definition
This study used the publicly available Sleep Health and Lifestyle Dataset (SHLD) hosted on Kaggle [15]. According to the dataset documentation, SHLD is a synthetic dataset created for illustrative and educational purposes rather than a cohort derived from prospectively recruited patients. It contains demographic, lifestyle, sleep-related, and cardiovascular variables, including age, gender, occupation, sleep duration, subjective sleep quality, physical activity level, stress level, body-mass-index category, blood pressure, heart rate, daily steps, and a categorical SleepDisorder variable.
Importantly, the public dataset documentation does not report a clinical data-acquisition protocol for the SleepDisorder labels and does not indicate that the “Sleep Apnea” category was established using polysomnography (PSG), home sleep apnea testing (HSAT), medical-record adjudication, or another clinically validated diagnostic procedure. Accordingly, apnea–hypopnea index (AHI) or respiratory-event-index (REI) thresholds are not available. The dataset also provides only the generic label “Sleep Apnea” and does not distinguish obstructive from central sleep apnea. Therefore, throughout the present analysis, this category is treated as the dataset-provided sleep-apnea label and should not be interpreted as an independently verified clinical diagnosis or as a confirmed obstructive sleep apnea subtype.
The original SleepDisorder variable is represented as a single categorical field with three possible labels: None, Insomnia, and Sleep Apnea. To formulate the present exploratory binary screening task, records carrying the single Insomnia label were excluded and the remaining records were encoded as follows:
(1)In Eq (1), Y = 1 denotes records carrying the dataset-provided Sleep Apnea label, whereas Y = 0 denotes records for which SleepDisorder was recorded as None. After excluding records labelled Insomnia, the analytical dataset contained 297 records: 78 (26.3%) in the sleep-apnea-labelled class and 219 (73.7%) in the no-recorded-sleep-disorder class. Thus, the approximate class ratio was 1:2.8. Stratified sampling was used within cross-validation to preserve this class distribution across folds. Because the source dataset is synthetic and does not provide independently verified clinical diagnoses, these class labels are used for methodological model development and internal evaluation rather than as confirmed patient-level diagnostic outcomes.
To describe the records represented in the binary analysis, Table 2 summarizes selected demographic, sleep-related, lifestyle, and cardiovascular characteristics according to the dataset-provided sleep-apnea status. Continuous variables are reported as mean standard deviation on their original measurement scale, before normalization, whereas sex is reported as number and percentage.
The dataset does not permit a separate determination of co-morbid insomnia and sleep apnea (COMISA). Specifically, SleepDisorder is represented by a single categorical label rather than independent indicators for insomnia and sleep apnea. Consequently, excluding records carrying the Insomnia label should not be interpreted as the deliberate exclusion of clinically identified COMISA cases. It cannot be determined from SHLD whether records carrying the Sleep Apnea label also had insomnia symptoms or would meet clinical criteria for COMISA. The present analysis therefore does not establish model performance in individuals with co-morbid insomnia and sleep apnea or other mixed sleep complaints, and applicability to such populations requires evaluation using clinically characterized datasets with independent insomnia and sleep-apnea annotations.
Data preprocessing and feature engineering
One-hot encoding was applied to categorical features, including Gender, Occupation, and BMICategory. Missing numerical values were replaced using median imputation, whereas missing categorical values were replaced using mode imputation. These imputation strategies were selected because they are less affected by skewness and outliers, which are commonly observed in self-reported health data. All continuous variables were normalized using z-score transformation:
(2)In Eq (2), denotes the original value of the ith feature, denotes the normalized value, represents the mean of the corresponding feature, and denotes its standard deviation.
To improve discriminative representation, additional engineered indicators were created, including mean blood pressure, stress-to-activity ratio, and a hypertension flag:
(3)(4)(5)In Eq (3), BPmean denotes the average of systolic and diastolic blood pressure values, StressToActivity represents the ratio between stress level and physical activity level, and HighBPFlag is a binary indicator function. The indicator function takes the value of 1 when systolic blood pressure exceeds 130 and 0 otherwise.
Correlation and inferential analyses supported the inclusion of these engineered variables. The BP Mean feature showed a moderate positive correlation with sleep apnea, with r = 0.42 and p < 0.01.
The StressToActivity feature differed significantly between the groups according to the Mann–Whitney U test, with p < 0.05. Similarly, HighBPFlag was significantly more prevalent among apnea subjects, with and p < 0.01. Highly correlated variables were removed to reduce multicollinearity. Feature relevance was ranked using Random Forest-based Gini impurity reduction:
(6)In Eq (6), denotes the total Gini-based importance score of feature , T represents the total number of decision nodes considered across the ensemble, p(t) is the proportion of samples reaching node t, and denotes the impurity decrease contributed by feature at node t.
Comparative model benchmarking and cross-validation
For fair model comparison, the same preprocessing and validation strategy was used for training and evaluating all supervised classifiers. The evaluated models included Random Forest (RF), Gradient Boosting Tree (GBT), Support Vector Machine (SVM), Logistic Regression (LR), Artificial Neural Network (ANN), and a stacked ensemble model. In the stacked model, the predicted probabilities generated by the five base classifiers were used as inputs to a logistic regression meta-classifier. This design allowed the ensemble to combine information from individual learners rather than relying on a single model. All classifiers were evaluated using the same input features, scaling procedures, and performance assessment pipeline.
Hyperparameter tuning was carried out using nested stratified -fold cross-validation. This design was used to reduce the risk of data leakage and to obtain a more reliable estimate of model performance. In each outer fold, the training data were further divided into inner folds, where grid search was used to identify suitable hyperparameters for each classifier. The outer folds were then used to calculate the final validation statistics. Model selection was guided by the mean F1-score across the outer validation folds:
(7)In Eq (7), represents the average F1-score across the validation folds, is the F1-score obtained in the kth fold, and K is the number of outer cross-validation folds.
The ANN was implemented using one hidden layer containing ten neurons. It was trained using the scaled conjugate gradient algorithm, and binary cross-entropy was used as the loss function. This relatively simple architecture was selected because the dataset was moderate in size, and a larger network could increase the risk of overfitting:
(8)In Eq (8), denotes the binary cross-entropy loss, N is the total number of samples, is the true label for the ith sample, and is the predicted probability of sleep apnea for that sample. Overall, the nested cross-validation framework ensured that the reported results were based on held-out validation data rather than on the same data used for tuning. This strengthened the reliability and reproducibility of the model comparison.
Model calibration and decision curve analysis
To examine the reliability of predicted probabilities, the classifiers were calibrated using either Platt scaling or isotonic regression, depending on the model type. Calibration performance was assessed using the Brier score and Expected Calibration Error (ECE). Reliability diagrams were also used to compare predicted probabilities with observed event rates.
Potential decision-analytic utility was explored using Decision Curve Analysis (DCA). For this analysis, the net benefit (NB) was calculated across threshold probabilities from 0.05 to 0.50. The net benefit at a given threshold was defined as follows:
(9)In Eq (9), NB(t) is the net benefit at threshold probability t, TP is the number of true positives, FP is the number of false positives, and N is the total number of evaluated cases. DCA was included because discrimination metrics alone do not show whether a model would be useful in practice. By comparing the proposed model with the two simple strategies of treating all subjects or treating none, this analysis provides an exploratory assessment of whether the model could have decision-support value as a screening aid, subject to validation in clinically characterized populations.
Ablation and statistical robustness analysis
A block-wise ablation study was conducted to evaluate the relative importance of different feature categories. Each block corresponded to a semantically distinct variable set, namely Vitals, Lifestyle, Psychological, and Engineered features. For each configuration, the model was retrained after omitting one feature block, and the resulting performance variation was quantified as follows:
(10)In Eq (10), denotes the accuracy degradation associated with removing feature block g, denotes classification accuracy, represents the full model trained with all feature blocks, and M–g denotes the model trained after excluding block g. Statistical robustness was assessed using Wilcoxon signed-rank tests across repeated cross-validation runs to determine whether the observed performance differences were statistically significant. Furthermore, 95% bootstrap confidence intervals were estimated for accuracy, F1-score, and area under the receiver operating characteristic curve (AUC) to provide uncertainty quantification for all evaluation metrics.
Evaluation metrics and interpretability
Performance evaluation incorporated multiple quantitative and interpretability-oriented criteria. Model discrimination was quantified using accuracy, F1-score, precision, recall, and AUC. To provide a screening-oriented interpretation of model performance, the selected SVM was additionally evaluated at the two prespecified operating points, and , using sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV). The numbers of false-negative sleep-apnea-labelled records and false-positive non-apnea records were also reported to quantify missed cases and potential unnecessary referrals, respectively. The corresponding 95% confidence intervals for sensitivity, specificity, PPV, and NPV were estimated using Wilson score intervals from the pooled outer-fold predictions of the nested cross-validation procedure. Reliability and probabilistic alignment were assessed using the Brier score and ECE. Decision curve and calibration plots were used to interpret clinical benefit and probability reliability. Feature-level interpretability was analyzed using permutation-based feature importance for tree-based models and partial dependence plots (PDPs) for the most influential predictors, such as mean blood pressure and sleep duration. This combined methodological structure ensured that SleepHealth-AI satisfied the transparency, robustness, and reproducibility standards expected in biomedical informatics research.
Pseudocode of the proposed SleepHealth-AI pipeline
The complete operational procedure of the proposed SleepHealth-AI framework is summarized in Algorithm 1. The pseudocode describes the major steps from preprocessing to model training, evaluation, and ablation-based robustness assessment.
Algorithm 1 SleepHealth-AI: Structured Pipeline for Exploratory Sleep-Apnea Screening
Require: Cleaned dataset SDS; evaluation metrics
Ensure:: predicted sleep apnea labels
1. Phase 1: Preprocessing and Feature Engineering
2. Exclude records carrying the single SleepDisorder label Insomnia
3. Encode target:
4. Engineer mean blood pressure:
5.
6. Engineer stress-to-activity ratio:
7.
8. Engineer hypertension flag:
9.
10. One-hot encode Gender, Occupation, and BMICategory
11. Normalize numerical features using
12. Construct feature matrix
13. Phase 2: Train-Test Split and Model Training Split X,Y into
14. Train Random Forest:
15. Train Support Vector Machine:
16. Train Artificial Neural Network:
17. Construct ensemble prediction:
18. Phase 3: Evaluation and Visualization
19. Predict for all trained models
20. Compute accuracy, F1-score, ROC curve, and AUC
21. Generate confusion matrices, ROC curves, reliability diagrams, and decision curves
22. Phase 4: Ablation Study
23. for all feature block do
24. Remove from X
25. Retrain the classifier using the reduced feature set
26. Evaluate and
27. end for
Results and discussion
This section presents the evaluation of SleepHealth-AI across four main aspects: discrimination, calibration, clinical usefulness, and robustness under feature-group removal. All experiments were conducted in MATLAB and followed the methodological pipeline shown in Fig 2. Unless stated otherwise, the main results were obtained using a leakage-safe nested cross-validation design, with 10 outer folds and 5 inner folds for hyperparameter tuning. In addition to standard discrimination metrics, probability calibration and decision-analytic net benefit were also assessed, because these measures are important when evaluating the framework as a potential screening aid. All screening-oriented results are interpreted as internal exploratory evidence because SHLD is synthetic and does not contain independently verified clinical diagnostic outcomes.
The flowchart summarizes the complete pipeline from preprocessing to feature engineering, model benchmarking, calibration analysis, decision curve analysis, and ablation-based robustness assessment.
Classification performance
Fig 3 presents the confusion matrices from representative single-split experiments, showing the class-wise prediction errors for each model. To reduce split-specific bias, model performance was summarized using the 10 outer folds of the nested cross-validation protocol. The mean values with 95% confidence intervals are reported in Table 3.
Confusion matrices of RF, SVM, ANN, and ensemble classifiers are shown for an illustrative single-split experiment.
RF, GBT, LR, and STACK achieved similar ACC and F1 values with overlapping uncertainty bands. In comparison, SVM achieved the best ranking performance, with a mean AUC of 0.9531, indicating favorable operating characteristics across classification thresholds. ROC curves for a representative split are shown in Fig 4, while the corresponding ACC and F1-score comparisons are shown in Fig 5.
ROC curve comparison of RF, SVM, ANN, and ensemble classifiers using an illustrative split. Nested cross-validation summaries are reported in Table 3.
The figure shows ACC and F1-score comparison across the evaluated models using an illustrative split.
Probability calibration and exploratory decision-oriented analysis
Calibration was performed using the out-of-fold predictions generated by the nested cross-validation strategy. The model achieved a Brier score of 0.0481 and an Expected Calibration Error (ECE) of 0.0164. The reliability plot showed close agreement with the identity line, indicating good alignment between predicted probabilities and observed event rates. Decision Curve Analysis (DCA) was performed across threshold probabilities in the range . The results showed that the model achieved higher net benefit than both the treat-all and treat-none strategies. To express the results in terms more directly relevant to screening decisions, the cross-validated SVM predictions were additionally evaluated at and at the lower exploratory screening threshold . At , sensitivity was 91.0% (95% CI: 82.6–95.6%), specificity was 97.7% (94.8–99.0%), PPV was 93.4% (85.5–97.2%), and NPV was 96.8% (93.6–98.5%). This operating point correctly identified 71 of 78 sleep-apnea-labelled records, corresponding to 7 missed records (9.0%), while 5 of 219 records without the sleep-apnea label (2.3%) would have been classified as positive and potentially referred for further diagnostic assessment. At , sensitivity increased to 92.3% (95% CI: 84.2–96.4%), whereas specificity decreased to 95.4% (91.8–97.5%). PPV was 87.8% (79.0–93.2%) and NPV was 97.2% (94.0–98.7%). At this threshold, 72 of 78 sleep-apnea-labelled records were identified, leaving 6 missed records (7.7%), whereas 10 of 219 non-apnea records (4.6%) would have been classified as positive. Thus, lowering the threshold from 0.50 to 0.125 identified one additional sleep-apnea-labelled record at the cost of five additional false-positive referrals. Table 4 and Fig 6 summarize these threshold-specific trade-offs. Because PPV and NPV depend on outcome prevalence, these values reflect the 26.3% prevalence of the dataset-provided sleep-apnea label in the present analytical sample and should not be interpreted as population-level predictive values.
Point estimates for sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV) are shown with 95% Wilson confidence intervals. At , 7 of 78 sleep-apnea-labelled records were missed and 5 of 219 non-apnea records were classified as screening-positive. At , 6 of 78 sleep-apnea-labelled records were missed and 10 of 219 non-apnea records were classified as screening-positive.
Ablation and robustness to feature loss
Block-wise ablation was performed using repeated stratified cross-validation with 30 repetitions of 5-fold validation. Each feature-block removal was compared with the full feature set using paired Wilcoxon signed-rank tests. Median paired differences were and for all blocks. The corresponding p-values were 0.0265 for Vitals based on ACC, 0.0502 for Vitals based on F1, < 0.0001 for Lifestyle based on both ACC and F1, 0.9171 for Psychological based on ACC, 0.9382 for Psychological based on F1, and 1.0000 for Engineered features based on both ACC and F1. Effect sizes were negligible, and the observed directions were non-deteriorating, indicating redundancy-aware generalization and tolerance to missing fields. Aggregate means and confidence intervals are reported in Table 5.
Interpretability and model diagnostics
The permutation importance results from the pooled Random Forest model, together with the split-gain analysis, showed that blood-pressure variables, including Systolic and BP Mean, were among the most influential predictors. Sleep quality and activity-related variables also contributed strongly. This pattern is clinically reasonable, because cardiovascular factors and lifestyle-related measures are known to be associated with OSA risk. The limited performance change observed after ablation does not necessarily indicate that these variables are unimportant. Instead, it suggests that related feature groups may share predictive information. For example, blood-pressure measures may overlap with age-or body-mass-index-related effects, while StressToActivity may capture information already represented by sleep quality and physical activity.
Neural network behaviour
Fig 7 shows the training diagnostics for the ANN model. Overall, the model appears to converge steadily, as indicated by the reduction in cross-entropy loss. The validation results also remain controlled, and the error histograms are centered, suggesting that the model is not showing obvious signs of unstable learning. These results indicate reasonable generalization for a moderate-sized tabular dataset.
Training performance, validation behavior, error distribution, confusion matrix, and ROC analysis of the ANN model.
To further support the ANN training interpretation, Fig 8 presents the MATLAB training status and architecture view of the implemented pattern recognition network. The network was configured with 29 input features, one hidden layer containing 10 neurons, and 2 output classes for apnea and non-apnea classification. The training process used random data division, the scaled conjugate gradient algorithm, and cross-entropy as the performance function. Training stopped after 13 epochs because the validation criterion was met. During training, the cross-entropy performance decreased from 0.316 to 0.0681, while the gradient decreased from 0.568 to 0.0221. These values support the observation that the ANN learned the tabular feature patterns in a stable manner without requiring the maximum number of training epochs.
The ANN met the validation criterion after 13 epochs and used 29 inputs, 10 hidden neurons, and 2 output classes.
In the nested cross-validation results, the ANN achieved an accuracy of 0.9263, an F1-score of 0.8587, and an AUC of 0.9330. While this performance is still competitive, it was slightly below the calibrated margin-based and tree-based models. For this reason, the SVM was selected as the preferred discriminator, mainly because it achieved the stronger AUC.
The decision threshold can still be adjusted depending on the intended use case. Therefore, reporting results at both and is useful, since these two operating points provide different balances between sensitivity and specificity for triage-oriented applications.
Positioning against prior work
Earlier SHLD-related studies primarily focused on predictive accuracy using individual data splits or did not include calibration and decision-analytic assessment. In contrast, the current study integrates nested cross-validation with calibration assessment using Brier score and ECE, decision curve analysis, and iterative ablation analysis supported by statistical testing. The proposed model achieved competitive discrimination performance, with an SVM AUC of 0.9531. Furthermore, it showed positive decision-curve behavior at low threshold probabilities and demonstrated resilience to the removal of structured feature groups.
Conclusion and future work
This paper presented SleepHealth-AI, a structured machine learning framework designed to support exploratory screening of the dataset-provided sleep-apnea label using easily obtainable lifestyle, demographic, and physiological attributes from the Sleep Health and Lifestyle Dataset (SHLD). Rather than establishing a clinical diagnosis, the present analysis examined whether these accessible tabular attributes can support preliminary risk stratification and identify records that would warrant further diagnostic assessment in a future clinically validated setting. A leakage-aware nested cross-validation strategy was used to obtain reliable internal generalization estimates, while probability calibration and Decision Curve Analysis (DCA) were included to assess probabilistic reliability and exploratory decision-analytic performance beyond standard discrimination metrics.
Several methodological components were integrated to evaluate SleepHealth-AI, including Gini-based feature selection, comparison of six classifiers, probability calibration, and ablation-based robustness assessment. Among the evaluated models, the Support Vector Machine (SVM) achieved the highest ranking performance, with a mean AUC of 0.9531 and a 95% confidence interval of [0.8210, 1.0000]. Tree-based and linear classifiers also showed competitive performance, with the Random Forest model achieving an accuracy of 0.9599 and an F1-score of 0.9231 under nested cross-validation. These findings indicate that the proposed SleepHealth-AI framework can provide strong discriminatory performance while maintaining low computational complexity for structured health data.
The probability calibration results further supported the reliability of the framework. The pooled cross-validated predictions produced a Brier score of 0.0481 and an Expected Calibration Error (ECE) of 0.0164, indicating good agreement between predicted probabilities and observed outcomes. DCA showed that the model provided positive net benefit across threshold probabilities from 0.05 to 0.50 when compared with treat-all and treat-none strategies. Within this internal exploratory analysis, these findings suggest potential decision-support value for sleep-apnea screening; they do not establish clinical utility or diagnostic validity. Threshold-specific analysis further showed that at , the SVM achieved 91.0% sensitivity and 97.7% specificity, with 7 of 78 sleep-apnea-labelled records missed and 5 of 219 non-apnea records classified as screening-positive. At the exploratory lower threshold of , sensitivity increased to 92.3% and NPV to 97.2%, while specificity decreased to 95.4%; 6 sleep-apnea-labelled records were missed and 10 non-apnea records were classified as screening-positive. These results quantify the trade-off between reducing missed screening-positive records and increasing the number requiring subsequent diagnostic assessment.
The repeated cross-validation ablation study, conducted using 30 repetitions of 5-fold validation, showed stable model performance after removing Vitals, Lifestyle, Psychological, or Engineered feature blocks. The median paired differences showed no clinically meaningful deterioration in accuracy, with , or F1-score, with . This indicates redundancy-aware robustness under partial feature availability. Additional diagnostic analyses, including ROC curves, confusion matrices, reliability plots, error distribution visualization, and neural network convergence analysis, further supported the stability and interpretability of the proposed framework.
Beyond predictive accuracy, the main strengths of SleepHealth-AI include methodological robustness, the use of engineered health indicators that could potentially be obtained in future telemedicine-oriented workflows, probability calibration, and reproducible model evaluation. These characteristics support further investigation of SleepHealth-AI as an exploratory screening framework, but clinical deployment would require validation using independently characterized patient cohorts and clinically established reference diagnoses.
An important limitation concerns mixed sleep-disorder presentations. Because SHLD encodes SleepDisorder as a single categorical label, co-existing insomnia and sleep apnea cannot be identified independently. Although records carrying the Insomnia label were excluded when constructing the binary analytical dataset, this does not establish that clinically defined COMISA cases were absent from the Sleep Apnea group. Accordingly, the present findings should not be generalized to individuals with COMISA or other mixed sleep complaints until the framework is evaluated using clinically characterized datasets in which insomnia and sleep apnea are recorded independently.
Future work will extend the functionality of SleepHealth-AI in several directions:
- Incorporation of wearable sensor data, such as photoplethysmography (PPG) and actigraphy, for hybrid decision fusion.
- Use of explainable artificial intelligence (XAI) methods, such as SHAP and LIME, to improve the interpretability of individual predictions.
- Evaluation of model generalization using larger and multi-center datasets.
- Development of a lightweight edge-computing implementation for mobile health applications.
- Addition of a metrological validation layer to assess uncertainty bounds, traceability, and repeatability according to relevant ISO standards.
Further investigation should also examine the transportability and clinical interpretability of the proposed method under temporal and demographic shifts. This can be achieved through external validation, structured missingness experiments, partial dependence analysis, and Shapley-based effect estimation.
Providing a reproducible artifact that includes source code, model configurations, preprocessing parameters, and decision-support thresholds will be important for future translational use in telehealth-driven OSA screening.
Acknowledgments
The authors acknowledge the support and facilities provided by their respective institutions during the preparation of this research work.
References
- 1. Abbasi A, Gupta SS, Sabharwal N, Meghrajani V, Sharma S, Kamholz S, et al. A comprehensive review of obstructive sleep apnea. Sleep Sci. 2021;14(2):142–54. pmid:34381578
- 2. Yeghiazarians Y, Jneid H, Tietjens JR, Redline S, Brown DL, El-Sherif N, et al. Obstructive Sleep Apnea and Cardiovascular Disease: A Scientific Statement From the American Heart Association. Circulation. 2021;144(3):e56–67. pmid:34148375
- 3. Schneider G. Obstructive Sleep Apnea - Influence on the Cardiovascular System and Cognition. Laryngorhinootologie. 2023;102(S 01):S101–14. pmid:37130534
- 4.
Slowik JM, Collen J. Obstructive sleep apnea. In: StatPearls. Treasure Island (FL): StatPearls Publishing; 2024.
- 5. Thomson LDJ, Landry SA, Singleton R, Wong A-M, Joosten SA, Beatty CJ, et al. The Effect of Hypopnea Scoring on the Arousal Threshold in Patients with Obstructive Sleep Apnea. Am J Respir Crit Care Med. 2020;202(9):1308–11. pmid:32551850
- 6. Hartfield PJ, Janczy J, Sharma A, Newsome HA, Sparapani RA, Rhee JS, et al. Anatomical determinants of upper airway collapsibility in obstructive sleep apnea: A systematic review and meta-analysis. Sleep Med Rev. 2023;68:101741. pmid:36634409
- 7. Lechat B, Naik G, Reynolds A, Aishah A, Scott H, Loffler KA, et al. Multinight Prevalence, Variability, and Diagnostic Misclassification of Obstructive Sleep Apnea. Am J Respir Crit Care Med. 2022;205(5):563–9. pmid:34904935
- 8. Mellor A, Kavaliotis E, Mascaro L, Drummond SPA. Approaches to the assessment of adherence to CBT-I, predictors of adherence, and the association of adherence to outcomes: A systematic review. Sleep Med Rev. 2022;63:101620. pmid:35398650
- 9. Bazoukis G, Bollepalli SC, Chung CT, Li X, Tse G, Bartley BL, et al. Application of artificial intelligence in the diagnosis of sleep apnea. J Clin Sleep Med. 2023;19(7):1337–63. pmid:36856067
- 10. Levy J, Álvarez D, Del Campo F, Behar JA. Deep learning for obstructive sleep apnea diagnosis based on single channel oximetry. Nat Commun. 2023;14(1):4881. pmid:37573327
- 11. Leong ZH, Loh SRH, Leow LC, Ong TH, Toh ST. A machine learning approach for the diagnosis of obstructive sleep apnoea using oximetry, demographic and anthropometric data. Singapore Med J. 2025;66(4):195–201. pmid:37171440
- 12. Senaratna CV, Perret JL, Lodge CJ, Lowe AJ, Campbell BE, Matheson MC, et al. Prevalence of obstructive sleep apnea in the general population: A systematic review. Sleep Med Rev. 2017;34:70–81. pmid:27568340
- 13. Punjabi NM. The epidemiology of adult obstructive sleep apnea. Proc Am Thorac Soc. 2008;5(2):136–43. pmid:18250205
- 14. Franklin KA, Lindberg E. Obstructive sleep apnea is a common disorder in the population-a review on the epidemiology of sleep apnea. J Thorac Dis. 2015;7(8):1311–22. pmid:26380759
- 15.
Suraj S, Puttaswamy DG, Ujwal. Sleep Health and Lifestyle Dataset. Kaggle; 2021. Accessed 30 June 2025. Available from: https://www.kaggle.com/datasets/uom190346a/sleep-health-and-lifestyle-dataset
- 16. Gutierrez-Tobal GC, Alvarez D, Crespo A, Del Campo F, Hornero R. Evaluation of Machine-Learning Approaches to Estimate Sleep Apnea Severity From At-Home Oximetry Recordings. IEEE J Biomed Health Inform. 2019;23(2):882–92. pmid:29993673
- 17. Kim YJ, Jeon JS, Cho S-E, Kim KG, Kang S-G. Prediction Models for Obstructive Sleep Apnea in Korean Adults Using Machine Learning Techniques. Diagnostics (Basel). 2021;11(4):612. pmid:33808100
- 18. Alshammari TS. Applying Machine Learning Algorithms for the Classification of Sleep Disorders. IEEE Access. 2024;12:36110–21.
- 19. Khan M, Singh Y, Bhardwaj H. Harnessing Machine Learning and Optimization Techniques for Identifying Risk Factor of Sleep Apnea by Exploring Sleep Health and Lifestyle Dataset. Sleep Vigilance. 2025;9(2):219–29.
- 20. Shi Y, Ma L, Chen X, Li W, Feng Y, Zhang Y, et al. Prediction model of obstructive sleep apnea-related hypertension: Machine learning-based development and interpretation study. Front Cardiovasc Med. 2022;9:1042996. pmid:36545020
- 21. Liang Z. Developing probabilistic ensemble machine learning models for home-based sleep apnea screening using overnight SpO2 data at varying data granularity. Sleep Breath. 2024;28(6):2409–20. pmid:39190088
- 22. Osa-Sanchez A, Ramos-Martinez-de-Soria J, Mendez-Zorrilla A, Ruiz IO, Garcia-Zapirain B. Wearable Sensors and Artificial Intelligence for Sleep Apnea Detection: A Systematic Review. J Med Syst. 2025;49(1):66. pmid:40387964
- 23. Yook S, Kim D, Gupte C, Joo EY, Kim H. Deep learning of sleep apnea-hypopnea events for accurate classification of obstructive sleep apnea and determination of clinical severity. Sleep Med. 2024;114:211–9. pmid:38232604
- 24. Hoang NH, Liang Z. Detection and Severity Classification of Sleep Apnea Using Continuous Wearable SpO2 Signals: A Multi-Scale Feature Approach. Sensors (Basel). 2025;25(6):1698. pmid:40292768
- 25. Supratak A, Dong H, Wu C, Guo Y. DeepSleepNet: A Model for Automatic Sleep Stage Scoring Based on Raw Single-Channel EEG. IEEE Trans Neural Syst Rehabil Eng. 2017;25(11):1998–2008. pmid:28678710
- 26. Eldele E, Chen Z, Liu C, Wu M, Kwoh C-K, Li X, et al. An Attention-Based Deep Learning Approach for Sleep Stage Classification With Single-Channel EEG. IEEE Trans Neural Syst Rehabil Eng. 2021;29:809–18. pmid:33909566