Comparison of Deep Learning Methods for Sleep Apnea Detection Using Spectrogram-Transformed ECG Signals

Keywords: Deep Learning, ECG, Sleep Apnea, Spectrogram

Abstract

Sleep apnea is a sleep disorder that occurs when breathing is disturbed, characterized by repeated periods of stopping breathing during sleep. This condition can cause various serious health problems if not treated, such as: high blood pressure, poor quality sleep, and difficulty concentrating. Sufferers often don't realize sleep apnea because it occurs during sleep. Generally, sleep apnea diagnosis is made by interviewing the patient and family to find out common symptoms such as snoring, then confirmed through physical examination and polysomnography (PSG). Since sleep apnea is related to respiratory activity that correlates with changes in cardiac activity, ECG examination during sleep is an alternative for diagnosis. Therefore, this study presents a comparative analysis of deep learning models for detecting sleep apnea from spectrogram-based ECG representations. The raw ECG signal is transformed into a spectrogram and then saved as an image for classification, specifically for normal and abnormal classification. Deep Learning (DL) method is applied for classification of normal ECG and sleep apnea ECG. EfficientNet, MobileNet V2, DenseNet, AlexNet, and VGG16 were used to evaluate the performance of the proposed method and to identify the best-performing model. The evaluation results show that EfficientNet demonstrated the highest performance with an accuracy of 91.01%, precision of 90.70%, recall of 95.76%, and an F1-score of 92.61%. EfficientNet outperformed the other evaluated models in this study. By utilizing a spectrogram-based approach combined with a scalable architecture, the method demonstrates competitive accuracy for sleep apnea detection. Investigating other methods to enhance accuracy remains an interesting topic for future study.

Downloads

Download data is not yet available.

References

A. Qureshi and R. D. Ballard, “Current reviews of allergy and clinical immunology Obstructive sleep apnea,” 2003, doi: 10.1067/mai.2003.1813.

A. P. Razi, Z. Einalou, and M. Manthouri, “Sleep Apnea Classification Using Random Forest via ECG,” Sleep Vigil, vol. 5, no. 1, pp. 141–146, Jun. 2021, doi: 10.1007/s41782-021-00138-4.

R. J. Thomas et al., “Relationship between delta power and the electrocardiogram-derived cardiopulmonary spectrogram: possible implications for assessing the effectiveness of sleep,” Sleep Med, vol. 15, no. 1, pp. 125–131, Jan. 2014, doi: 10.1016/j.sleep.2013.10.002.

C. Guilleminault, A. Tilkian, and W. C. Dement, “The Sleep Apnea Syndromes,” Annu Rev Med, vol. 27, no. 1, pp. 465–484, Feb. 1976, doi: 10.1146/annurev.me.27.020176.002341.

T. Wang, C. Lu, and G. Shen, “Detection of Sleep Apnea from Single-Lead ECG Signal Using a Time Window Artificial Neural Network,” Biomed Res Int, vol. 2019, pp. 1–9, Dec. 2019, doi: 10.1155/2019/9768072.

A. Zarei and B. M. Asl, “Automatic classification of apnea and normal subjects using new features extracted from HRV and ECG-derived respiration signals,” Biomed Signal Process Control, vol. 59, p. 101927, May 2020, doi: 10.1016/j.bspc.2020.101927.

P. Kumar Tyagi and D. Agrawal, “Automatic detection of sleep apnea from single-lead ECG signal using enhanced-deep belief network model,” Biomed Signal Process Control, vol. 80, p. 104401, Feb. 2023, doi: 10.1016/j.bspc.2022.104401.

A. Rizal, F. D. A. A. Siregar, and H. T. Fauzi, “Obstructive Sleep Apnea (OSA) Classification Based on Heart Rate Variability (HRV) on Electrocardiogram (ECG) Signal Using Support Vector Machine (SVM),” Traitement du Signal, vol. 39, no. 2, pp. 469–474, Apr. 2022, doi: 10.18280/ts.390208.

A. Rizal, S. Hadiyoso, H. Fauzi, and R. Widadi, “Obstructive Sleep Apnea Detection based on ECG Signal using Statistical Features of Wavelet Subband,” International journal of electrical and computer engineering systems, vol. 13, no. 10, pp. 877–884, Dec. 2022, doi: 10.32985/ijeces.13.10.13.

M. Bsoul, H. Minn, and L. Tamil, “Apnea MedAssist: Real-time Sleep Apnea Monitor Using Single-Lead ECG,” IEEE Transactions on Information Technology in Biomedicine, vol. 15, no. 3, pp. 416–427, May 2011, doi: 10.1109/TITB.2010.2087386.

G. B. Papini et al., “On the generalizability of ECG-based obstructive sleep apnea monitoring: merits and limitations of the Apnea-ECG database,” in 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), IEEE, Jul. 2018, pp. 6022–6025. doi: 10.1109/EMBC.2018.8513660.

C. Varon, A. Caicedo, D. Testelmans, B. Buyse, and S. Van Huffel, “A Novel Algorithm for the Automatic Detection of Sleep Apnea From Single-Lead ECG,” IEEE Trans Biomed Eng, vol. 62, no. 9, pp. 2269–2278, Sep. 2015, doi: 10.1109/TBME.2015.2422378.

H. Nasifoglu and O. Erogul, “Obstructive sleep apnea prediction from electrocardiogram scalograms and spectrograms using convolutional neural networks,” Physiol Meas, vol. 42, no. 6, p. 065010, Jun. 2021, doi: 10.1088/1361-6579/ac0a9c.

N. Ullah, T. Mahmood, S. G. Kim, S. H. Nam, H. Sultan, and K. R. Park, “DCDA-Net: Dual-convolutional dual-attention network for obstructive sleep apnea diagnosis from single-lead electrocardiograms,” Eng Appl Artif Intell, vol. 123, p. 106451, Aug. 2023, doi: 10.1016/j.engappai.2023.106451.

T. T. D. Linh, N. T. H. Trang, S. Lin, D. Wu, W. Liu, and C. Hu, “Detection of preceding sleep apnea using ECG spectrogram during CPAP titration night: A novel machine-learning and bag-of-features framework,” J Sleep Res, vol. 33, no. 3, May 2024, doi: 10.1111/jsr.13991.

K. Gupta, V. Bajaj, and I. A. Ansari, “OSACN-Net: Automated Classification of Sleep Apnea Using Deep Learning Model and Smoothed Gabor Spectrograms of ECG Signal,” IEEE Trans Instrum Meas, vol. 71, pp. 1–9, 2022, doi: 10.1109/TIM.2021.3132072.

A. Sheta et al., “Diagnosis of Obstructive Sleep Apnea from ECG Signals Using Machine Learning and Deep Learning Classifiers,” Applied Sciences, vol. 11, no. 14, p. 6622, Jul. 2021, doi: 10.3390/app11146622.

N. Salari et al., “Detection of sleep apnea using Machine learning algorithms based on ECG Signals: A comprehensive systematic review,” Expert Syst Appl, vol. 187, p. 115950, Jan. 2022, doi: 10.1016/j.eswa.2021.115950.

A. Hossen and S. Qasim, “IDENTIFICATION OF OBSTRUCTIVE SLEEP APNEA USING ARTIFICIAL NEURAL NETWORKS AND WAVELET PACKET DECOMPOSITION OF THE HRV SIGNAL,” The Journal of Engineering Research [TJER], vol. 17, no. 1, p. 24, May 2020, doi: 10.24200/tjer.vol17iss1pp24-33.

T. Penzel, G. B. Moody, R. G. Mark, A. L. Goldberger, and J. H. Peter, “The apnea-ECG database,” in Computers in Cardiology 2000. Vol.27 (Cat. 00CH37163), IEEE, pp. 255–258. doi: 10.1109/CIC.2000.898505.

O. Alan V. and S. Ronald W., Discrete-Time Signal Processing. Prentice-Hall, 1999.

S. Sultan Qurraie and R. Ghorbani Afkhami, “ECG arrhythmia classification using time frequency distribution techniques,” Biomed Eng Lett, vol. 7, no. 4, pp. 325–332, Nov. 2017, doi: 10.1007/s13534-017-0043-2.

P. Ewert, B. Wicher, and T. Pajchrowski, “Application of the STFT for Detection of the Rotor Unbalance of a Servo-Drive System with an Elastic Interconnection,” Electronics (Basel), vol. 13, no. 2, p. 441, Jan. 2024, doi: 10.3390/electronics13020441.

C. Mateo and J. A. Talavera, “Short-Time Fourier Transform with the Window Size Fixed in the Frequency Domain (STFT-FD): Implementation,” SoftwareX, vol. 8, pp. 5–8, Jul. 2018, doi: 10.1016/j.softx.2017.11.005.

K. Avci, “Fractional Kaiser Window With Application to Finite Impulse Response Digital Filter Design,” IEEE Access, vol. 12, pp. 155549–155563, 2024, doi: 10.1109/ACCESS.2024.3484930.

U. R. Acharya et al., “Automated characterization of coronary artery disease, myocardial infarction, and congestive heart failure using contourlet and shearlet transforms of electrocardiogram signal,” Knowl Based Syst, vol. 132, pp. 156–166, Sep. 2017, doi: 10.1016/j.knosys.2017.06.026.

B. K. Nugraha, Q. D. Amalia, A. S. Safitri, A. Rizal, and H. T. Fauzi, “Comparison Analysis for Life-Threatening Arrhythmia Classification from ECG Data Using Machine Learning and Deep Learning Methods,” in 2024 8th International Conference on Information Technology, Information Systems and Electrical Engineering (ICITISEE), IEEE, Aug. 2024, pp. 1–6. doi: 10.1109/ICITISEE63424.2024.10730398.

C. Cao et al., “Deep Learning and Its Applications in Biomedicine,” Genomics Proteomics Bioinformatics, vol. 16, no. 1, pp. 17–32, Feb. 2018, doi: 10.1016/j.gpb.2017.07.003.

B. M. Mathunjwa, Y.-T. Lin, C.-H. Lin, M. F. Abbod, and J.-S. Shieh, “ECG arrhythmia classification by using a recurrence plot and convolutional neural network,” Biomed Signal Process Control, vol. 64, p. 102262, Feb. 2021, doi: 10.1016/j.bspc.2020.102262.

Y. A. Saadoon, M. Khalil, and D. Battikh, “Predicting Epileptic Seizures Using EfficientNet-B0 and SVMs: A Deep Learning Methodology for EEG Analysis,” Bioengineering, vol. 12, no. 2, p. 109, Jan. 2025, doi: 10.3390/bioengineering12020109.

F. A. D. Putra and U. N. Wisesty, “Pneumonia Detection Based on Chest X-Ray Images with MobileNetV2 Architecture,” in 2024 International Conference on Intelligent Cybernetics Technology & Applications (ICICyTA), IEEE, Dec. 2024, pp. 748–753. doi: 10.1109/ICICYTA64807.2024.10913362.

S. U. R. Khan and Z. Khan, “Detection of Abnormal Cardiac Rhythms Using Feature Fusion Technique with Heart Sound Spectrograms,” J Bionic Eng, Apr. 2025, doi: 10.1007/s42235-025-00714-8.

A. Nair, H. Vadher, P. Patel, T. Vyas, C. Bhatt, and A. Bruno, “Lung sound disease detection using attention over pre-trained efficientnet architecture,” Multimed Tools Appl, vol. 84, no. 22, pp. 25485–25519, Aug. 2024, doi: 10.1007/s11042-024-20078-1.

J. Heaton, “Ian Goodfellow, Yoshua Bengio, and Aaron Courville: Deep learning,” Genet Program Evolvable Mach, vol. 19, no. 1–2, pp. 305–307, Jun. 2018, doi: 10.1007/s10710-017-9314-z.

T.-T. Wong and P.-Y. Yeh, “Reliable Accuracy Estimates from k -Fold Cross Validation,” IEEE Trans Knowl Data Eng, vol. 32, no. 8, pp. 1586–1594, Aug. 2020, doi: 10.1109/TKDE.2019.2912815.

I. Amelia Dewi and M. A. Negara Ekha Salawangi, “High performance of optimizers in deep learning for cloth patterns detection,” IAES International Journal of Artificial Intelligence (IJ-AI), vol. 12, no. 3, p. 1407, Sep. 2023, doi: 10.11591/ijai.v12.i3.pp1407-1418.

Y. Shao et al., “An Improved BGE-Adam Optimization Algorithm Based on Entropy Weighting and Adaptive Gradient Strategy,” Symmetry (Basel), vol. 16, no. 5, p. 623, May 2024, doi: 10.3390/sym16050623.

Y. Shao et al., “An Improvement of Adam Based on a Cyclic Exponential Decay Learning Rate and Gradient Norm Constraints,” Electronics (Basel), vol. 13, no. 9, p. 1778, May 2024, doi: 10.3390/electronics13091778.

C. Peng, “Comprehensive Analysis of the Impact of Learning Rate and Dropout Rate on the Performance of Convolutional Neural Networks on the CIFAR-10 Dataset,” Applied and Computational Engineering, vol. 102, no. 1, pp. 183–192, Nov. 2024, doi: 10.54254/2755-2721/102/20241161.

J. Chi, Y. Liu, V. Wang, and J. Yan, “Performance Analysis of Three kinds of Neural Networks in the Classification of Mask Images,” J Phys Conf Ser, vol. 2181, no. 1, p. 012032, Jan. 2022, doi: 10.1088/1742-6596/2181/1/012032.

N. Tauhid Dinitra, I. Wijayanto, F. Akhyar, A. Sekar Safitri, and R. Satria Firdhaust, “Enchancing Skin Cancer Classification Using EfficientNet-Based Architectures,” in 2024 International Conference on Data Science and Its Applications (ICoDSA), IEEE, Jul. 2024, pp. 415–420. doi: 10.1109/ICoDSA62899.2024.10652183.

M.-H. Liu et al., “EfficientNet-based machine learning architecture for sleep apnea identification in clinical single-lead ECG signal data sets,” Biomed Eng Online, vol. 23, no. 1, p. 57, Jun. 2024, doi: 10.1186/s12938-024-01252-w.

H. Pan, Y. Yu, J. Ye, and X. Zhang, “MobileNetV2: A lightweight classification model for home-based sleep apnea screening,” Dec. 2024, [Online]. Available: http://arxiv.org/abs/2412.19967

P. Hemrajani, V. S. Dhaka, G. Rani, P. Shukla, and D. P. Bavirisetti, “Efficient Deep Learning Based Hybrid Model to Detect Obstructive Sleep Apnea,” Sensors, vol. 23, no. 10, p. 4692, May 2023, doi: 10.3390/s23104692.

C. Zhang et al., “ResNet or DenseNet? Introducing Dense Shortcuts to ResNet,” Oct. 2020, [Online]. Available: http://arxiv.org/abs/2010.12496

D. Gupta, B. Bajpai, G. Dhiman, M. Soni, S. Gomathi, and D. Mane, “Review of ECG arrhythmia classification using deep neural network,” Mater Today Proc, May 2021, doi: 10.1016/j.matpr.2021.05.249.

A. Kumar M. and A. Chakrapani, “Classification of ECG signal using FFT based improved Alexnet classifier,” PLoS One, vol. 17, no. 9, p. e0274225, Sep. 2022, doi: 10.1371/journal.pone.0274225.

Z.-P. Jiang, Y.-Y. Liu, Z.-E. Shao, and K.-W. Huang, “An Improved VGG16 Model for Pneumonia Image Classification,” Applied Sciences, vol. 11, no. 23, p. 11185, Nov. 2021, doi: 10.3390/app112311185.

D. M. W. Powers, “Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlation,” Oct. 2020.

T. Fawcett, “An introduction to ROC analysis,” Pattern Recognit Lett, vol. 27, no. 8, pp. 861–874, Jun. 2006, doi: 10.1016/j.patrec.2005.10.010.

T. Saito and M. Rehmsmeier, “The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets,” PLoS One, vol. 10, no. 3, p. e0118432, Mar. 2015, doi: 10.1371/journal.pone.0118432.

C. J. CLOPPER and E. S. PEARSON, “THE USE OF CONFIDENCE OR FIDUCIAL LIMITS ILLUSTRATED IN THE CASE OF THE BINOMIAL,” Biometrika, vol. 26, no. 4, pp. 404–413, 1934, doi: 10.1093/biomet/26.4.404.

M.-H. Liu et al., “EfficientNet-based machine learning architecture for sleep apnea identification in clinical single-lead ECG signal data sets,” Biomed Eng Online, vol. 23, no. 1, p. 57, Jun. 2024, doi: 10.1186/s12938-024-01252-w.

T. Gomes, A. Benedetti, A.-L. Lafontaine, R. J. Kimoff, A. Robinson, and M. Kaminska, “Validation of STOP, STOP-BANG, STOP-BAG, STOP-B28, and GOAL screening tools for identification of obstructive sleep apnea in patients with Parkinson disease,” Journal of Clinical Sleep Medicine, vol. 19, no. 1, pp. 45–54, Jan. 2023, doi: 10.5664/jcsm.10262.

Y. Yu, Z. Yang, Y. You, and W. Shan, “FASSNet: fast apnea syndrome screening neural network based on single-lead electrocardiogram for wearable devices,” Physiol Meas, vol. 42, no. 8, p. 085005, Aug. 2021, doi: 10.1088/1361-6579/ac184e.

F. R. Mashrur, Md. S. Islam, D. K. Saha, S. M. R. Islam, and M. A. Moni, “SCNN: Scalogram-based convolutional neural network to detect obstructive sleep apnea using single-lead electrocardiogram signals,” Comput Biol Med, vol. 134, p. 104532, Jul. 2021, doi: 10.1016/j.compbiomed.2021.104532.

S. M. I. Niroshana, X. Zhu, K. Nakamura, and W. Chen, “A fused-image-based approach to detect obstructive sleep apnea using a single-lead ECG and a 2D convolutional neural network,” PLoS One, vol. 16, no. 4, p. e0250618, Apr. 2021, doi: 10.1371/journal.pone.0250618.

A. Kolesnikov et al., “Big Transfer (BiT): General Visual Representation Learning,” May 2020.

Published
2025-10-30
How to Cite
[1]
S. Hadiyoso, I. Wijayanto, A. Sekar Safitri, T. Dewi Rahmaniar, A. Rizal, and S. Lata Tripathi, “Comparison of Deep Learning Methods for Sleep Apnea Detection Using Spectrogram-Transformed ECG Signals”, j.electron.electromedical.eng.med.inform, vol. 7, no. 4, pp. 1340-1354, Oct. 2025.
Section
Medical Engineering