Background: Heart rate variability (HRV) and electrocardiogram (ECG)-derived respiration (EDR) have been used to detect sleep apnea (SA) for decades. The present study proposes an SA-detection algorithm using a machine-learning framework and bag-of-features (BoF) derived from an ECG spectrogram. Methods: This study was verified using overnight ECG recordings from 83 subjects with an average apnea–hypopnea index (AHI) 29.63 (/h) derived from the Physionet Apnea-ECG and National Cheng Kung University Hospital Sleep Center database. The study used signal preprocessing to filter noise and artifacts, ECG time–frequency transformation using continuous wavelet transform (CWT), BoF feature generation, machine-learning classification using support vector machine (SVM), ensemble learning (EL), k-nearest neighbor (KNN) classification, and cross-validation. The time length of the spectrogram was set as 10 and 60 s to examine the required minimum spectrogram window time length to achieve satisfactory accuracy. Specific frequency bands of 0.1–50, 8–50, 0.8–10, and 0–0.8 Hz were also extracted to generate the BoF to determine the band frequency best suited for SA detection. Results: The five-fold cross-validation accuracy using the BoF derived from the ECG spectrogram with 10 and 60 s time windows were 90.5% and 91.4% for the 0.1–50 Hz and 8–50 Hz frequency bands, respectively. Conclusion: An SA-detection algorithm utilizing BoF and a machine-learning framework was successfully developed in this study with satisfactory classification accuracy and high temporal resolution.
Objectives: Sleep disturbances are prevalent problems among human immunodeficiency virus (HIV)-infected persons. The recognition of comorbid sleep disorders in patients with HIV is currently hampered by limited knowledge of sleep-related symptoms, sleep architecture, and types of sleep disorders in this population. We aimed to compare the differences in sleep-related symptoms and polysomnography-based sleep disorders between HIV-infected persons and controls. Methods: The study evaluated 170 men with a Pittsburgh sleep quality index scores greater than 5, including 44 HIV-infected men and 126 male controls who were frequency-matched by sex, age (±3.0 years) and BMI (±3.0 kg/m2). For all participants, an overnight sleep study using a Somte V1 monitor was conducted. Differences in sleep-related symptoms and sleep disorders between HIV-infected patients and controls were examined using t-tests or chi-square tests. Results: HIV-infected persons with sleep disturbances more often had psychological disturbances (72.7% vs. 40.5%, p < 0.001) and suspected rapid eye movement behavior disorder (25.0% vs. 4.8%, p < 0.01) than controls. Sleep-disordered breathing was less common in HIV-infected persons than in controls (56.8% vs. 87.3%, p < 0.001). The mean percentage of rapid eye movement sleep was higher among HIV-infected patients than among controls (20.6% vs. 16.6%, p < 0.001). Nocturia was more common in HIV-infected persons than in controls (40.9% vs. 22.2%, p = 0.02). Conclusions: Psychological disturbances and sleep-disordered breathing can be possible explanations of sleep disturbances in HIV-infected persons in whom sleep-disordered breathing is notable. Further studies are warranted to examine the underlying factors of rapid eye movement behavior disorder among HIV-infected persons with sleep disturbances.