Citation: Zhu, J.; Zhou, A.; Gong, Q.;
Zhou, Y.; Huang, J.; Chen, Z.
Detection of Sleep Apnea from
Electrocardiogram and Pulse
Oximetry Signals Using Random
Forest. Appl. Sci. 2022, 12, 4218.
https://doi.org/10.3390/
app12094218
Academic Editors: Keun Ho Ryu and
Nipon Theera-Umpon
Received: 7 March 2022
Accepted: 20 April 2022
Published: 22 April 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
Article
Detection of Sleep Apnea from Electrocardiogram and Pulse
Oximetry Signals Using Random Forest
Jianming Zhu
1
, Aojie Zhou
1
, Qiong Gong
1
, Yu Zhou
1
, Junxiang Huang
1
and Zhencheng Chen
2,
*
1
School of Life and Environmental Sciences, Guilin University of Electronic Technology, Guilin 541004, China;
zhujianming@guet.edu.cn (J.Z.); 19122202015@mails.guet.edu.cn (A.Z.); gongqiong@guet.edu.cn (Q.G.);
zhouyu5859@163.com (Y.Z.); 19082304011@mails.guet.edu.cn (J.H.)
2
School of Electronic Engineering and Automation, Guilin University of Electronic Technology,
Guilin 541004, China
* Correspondence: chenzhcheng@guet.edu.cn
Abstract:
Sleep apnea (SA) is a common sleep disorder which could impair the human physiological
system. Therefore, early diagnosis of SA is of great interest. The traditional method of diagnosing SA
is an overnight polysomnography (PSG) evaluation. When PSG has limited availability, automatic
SA screening with a fewer number of signals should be considered. The primary purpose of this
study is to develop and evaluate a SA detection model based on electrocardiogram (ECG) and blood
oxygen saturation (SpO2). We adopted a multimodal approach to fuse ECG and SpO2 signals at the
feature level. Then, feature selection was conducted using the recursive feature elimination with
cross-validation (RFECV) algorithm and random forest (RF) classifier used to discriminate between
apnea and normal events. Experiments were conducted on the Apnea-ECG database. The introduced
algorithm obtained an accuracy of 97.5%, a sensitivity of 95.9%, a specificity of 98.4% and an AUC of
0.992 in per-segment classification, and outperformed previous works. The results showed that ECG
and SpO2 are complementary in detecting SA, and that the combination of ECG and SpO2 enhances
the ability to diagnose SA. Therefore, the proposed method has the potential to be an alternative to
conventional detection methods.
Keywords: sleep apnea; electrocardiogram; pulse oximetry; random forest; multimodal
1. Introduction
Sleep apnea (SA) is a common sleep disorder, also commonly known as obstructive
sleep apnea (OSA) [
1
]. OSA occurs due to the abnormal function of the upper respiratory
tract. When the hard palate muscles at the back of the throat that support the soft palate
relax, the soft palate blocks the passage of air into the respiratory system. The clinical
manifestation of SA is a cessation of nasal airflow or a decrease in airflow intensity by more
than 30% compared to the base level, but the corresponding breathing movements are
maintained [
2
]. At the same time, oxygen saturation decreases by more than 4% for more
than 10 s. The prevalence of OSA in adults ranges from 9% to 38% and increases with age [
3
].
Low quality sleep accompanied by apnea usually leads directly to poor concentration,
memory loss, slow response, and depression [
4
]. In addition, OSA is a potential threat to
many physiological systems of the human body, especially the cardiovascular system. It
can induce hypertension, heart failure, coronary artery disease, diabetes, and other diseases,
which seriously threaten the health of patients [
5
]. If patients are identified and then treated
at an early stage of OSA, the health risks can be reduced. Therefore, timely diagnosis of
patients with OSA is essential.
Clinically, polysomnography (PSG) is the reference standard for the diagnosis of SA.
PSG is effective in monitoring sleep conditions by collecting various physiological signals
such as electrocardiogram (ECG), electroencephalogram (EEG), electromyogram (EMG),
blood oxygen saturation (SpO2), airflow signals, respiratory effort, etc. [
6
]. However,
Appl. Sci. 2022, 12, 4218. https://doi.org/10.3390/app12094218 https://www.mdpi.com/journal/applsci