Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views22 pages

Algorithms 17 00527

Uploaded by

downloader1297
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views22 pages

Algorithms 17 00527

Uploaded by

downloader1297
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

algorithms

Article
Sleep Apnea Classification Using the Mean Euler–Poincaré
Characteristic and AI Techniques
Moises Ramos-Martinez 1 , Felipe D. J. Sorcia-Vázquez 1 , Gerardo Ortiz-Torres 1 , Mario Martínez García 1 ,
Mayra G. Mena-Enriquez 2 , Estela Sarmiento-Bustos 3 , Juan Carlos Mixteco-Sánchez 4 ,
Erasmo Misael Rentería-Vargas 1 , Jesús E. Valdez-Resendiz 5, * and Jesse Yoe Rumbo-Morales 1

1 Departamento de Ciencias Computacionales e Ingenierías, Universidad de Guadalajara, Carretera


Guadalajara-Ameca Km.45.5, Ameca 46600, Jalisco, Mexico; [email protected] (M.R.-M.);
[email protected] (F.D.J.S.-V.); [email protected] (G.O.-T.);
[email protected] (M.M.G.); [email protected] (E.M.R.-V.);
[email protected] (J.Y.R.-M.)
2 Biomedical Sciences Department, University of Guadalajara, Tonalá 45425, Jalisco, Mexico;
[email protected]
3 División Académica de Mecánica Industrial, Universidad Tecnológica Emiliano Zapata del Estado de Morelos,
Av. Universidad Tecnológica No. 1, Col. Palo Escrito, Emiliano Zapata 62760, Morelos, Mexico;
[email protected]
4 Natural and Exact Sciences Department, University of Guadalajara, Ameca 46600, Jalisco, Mexico;
[email protected]
5 School of Engineering and Sciences, Tecnologico de Monterrey, Monterrey 64700, Nuevo Leon, Mexico
* Correspondence: [email protected]

Abstract: Sleep apnea is a sleep disorder that disrupts breathing during sleep. This study aims to
classify sleep apnea using a machine learning approach and a Euler–Poincaré characteristic (EPC)
model derived from electrocardiogram (ECG) signals. An ensemble K-nearest neighbors classifier
Citation: Ramos-Martinez , M.; and a feedforward neural network were implemented using the EPC model as inputs. ECG signals
Sorcia-Vázquez, F.D.J.; Ortiz-Torres, were preprocessed with a polynomial-based scheme to reduce noise, and the processed signals were
G.; Martínez García, M.; Mena- transformed into a non-Gaussian physiological random field (NGPRF) for EPC model extraction from
Enriquez, M.G.; Sarmiento-Bustos, E.; excursion sets. The classifiers were then applied to the EPC model inputs. Using the Apnea-ECG
Mixteco-Sánchez, J.C.; Rentería-
dataset, the proposed method achieved an accuracy of 98.5%, sensitivity of 94.5%, and specificity
Vargas, E.M.; Valdez-Resendiz, J.E.;
of 100%. Combining machine learning methods and geometrical features can effectively diagnose
Rumbo-Morales, J.Y. Sleep Apnea
sleep apnea from single-lead ECG signals. The EPC model enhances clinical decision-making for
Classification Using the Mean
evaluating this disease.
Euler–Poincaré Characteristic and AI
Techniques. Algorithms 2024, 17, 527.
https://doi.org/10.3390/a17110527
Keywords: sleep apnea; Euler characteristic; machine learning; random field

Academic Editor: Antonio


Sarasa-Cabezuelo

Received: 10 October 2024 1. Introduction


Revised: 8 November 2024 Sleep apnea is a sleep disorder. During sleep, decreased breathing occurs in periods
Accepted: 13 November 2024 of a few seconds to minutes; this condition is known as sleep apnea. Generally, there is a
Published: 15 November 2024 high prevalence of undiagnosed cases among the population suffering from obstructive
sleep apnea (OSA). This prevalence is higher in men than women; nearly one billion people
have OSA worldwide [1]. OSA affects people with cardiovascular disease (arrhythmia,
Copyright: © 2024 by the authors.
heart failure, coronary syndrome) and increases sympathetic activity that compromises the
Licensee MDPI, Basel, Switzerland.
heart [2–4]. Also, OSA affects people with comorbidities with hypertension, as mentioned
This article is an open access article in [5].
distributed under the terms and OSA can be diagnosed using polysomnography; this method examines sleep and
conditions of the Creative Commons respiration parameters using electroencephalograms (EEGs), electrocardiograms (ECGs),
Attribution (CC BY) license (https:// and other measures, e.g., pulse oximetry (SP O2 ), airflow measurement, and so on [6,7]. This
creativecommons.org/licenses/by/ process is complex and time-consuming because it requires a complete test in a controlled
4.0/). environment to monitor the patient’s sleep and other signals. Also, this diagnosis is

Algorithms 2024, 17, 527. https://doi.org/10.3390/a17110527 https://www.mdpi.com/journal/algorithms


Algorithms 2024, 17, 527 2 of 22

unfeasible and extremely expensive for a large population. Some alternative methods
were developed using single ECG signals and machine learning techniques to diagnose
OSA problems.
Studies, including [8–10], have demonstrated the capability of ECG signals to identify
respiratory events. Furthermore, research results such as in [11,12], indicate that heart
rate variability (HRV) signals can be used to measure and detect apnea events. Atrial
fibrillation (AF) is widely related to OSA problems, as mentioned in [13,14], where the
authors conducted questionnaires and home sleep studies to check this relation.
Researchers have explored two approaches to detect sleep apnea events in the litera-
ture: feature engineering-based techniques and deep learning-based methods. In the first
category, the ECG signal is analyzed, and different features are extracted from the P-wave
(atrial depolarization), QRS complex (ventricular depolarization), and T-wave (ventricular
repolarization), which reflect different cardiac cycle phases. For example, Babaeizadeh et al.
presented a cost-effective, noninvasive algorithm for detecting sleep apnea using single-
lead ECG. By analyzing heart rate variability and QRS complexes, the algorithm accurately
classifies apnea episodes, achieving 84.7% accuracy and demonstrating high potential for
sleep medicine applications [15]. Yilmaz explored the utility of using a single-lead ECG to
determine sleep stages and detect OSA across 30-s epochs throughout the night, potentially
replacing more complex polysomnography systems. Data from 18 subjects, including
10 diagnosed with OSA, revealed promising results: support vector machines (SVMs) and
quadratic discriminant analysis (QDA) achieved over 82% accuracy in classifying sleep
stages and around 88% in detecting OSA. Using the RR-interval (time interval between two
successive R-peaks in an ECG), three features were extracted, resulting in high classification
performance. This suggests that single-lead ECG, combined with SVM or QDA, could
effectively monitor sleep and OSA. However, integrating additional physiological features
could further enhance accuracy [16]. Zarei et al. described an algorithm that detects sleep
apnea using ECG features and a combined convolutional neural network (CNN) and long
short-term memory (LSTM) recurrent network [17]. Using the same combination of net-
works, we looked at the work by Bahrami and Forouzanfar [18], which reported accuracy,
sensitivity, and specificity of 88.13%, 84.26%, and 92.27%, respectively.
Feature extraction using machine learning (ML) methods was employed to detect OSA
events. In the study by Pant et al. [19], wavelet transform was used to extract features from
the sub-bands and classify them using various ML methods. In the work of Yang et al., the
HRV analysis and ECG-derived respiration (EDR) were used to extract complementary
information using a residual group network [20]; their results had an accuracy of 90.3%, a
sensitivity of 87.6%, and a specificity of 91.9%. Liu et al. demonstrated a CNN that learned
features from the ECG, reaching a sensitivity of 88.2% in classification [21].
Instead of relying on an overall diagnostic analysis of the entire biomedical signal,
certain studies focus on determining if a patient is experiencing apnea by analyzing specific
indicators. One approach measures the variation in oxygen saturation over a short inter-
val (12 s) [22,23]; other indicators include non-linear methods mentioned in [24]. Maier
et al. used Holter-ECG to screen for sleep-disordered breathing (SDB) by comparing it
with nocturnal polygraphy (PG) in 50 cardiology patients. The ECG estimates demon-
strated strong agreement with PG, exhibiting high specificity (0.96) and good sensitivity
(0.77) for detecting significant SDB, promising an effective, cost-efficient method for SDB
screening [25].
Some studies have adopted an approach of using fragments of the signal, such as
analyzing it minute by minute [26] or using windows of varying sizes [27], to identify
occurrences of apnea instead of making an overall diagnosis of OSA, which is generally
regarded as the responsibility of physicians.
Various biomedical signals are utilized for the classification and diagnosis of OSA. For
instance, the photoplethysmography signal ([28], the S p O2 signal [24,29,30], the oronasal air
flow signal [31], the ECG signal [23,26], and so on. These works use techniques that involve
Algorithms 2024, 17, 527 3 of 22

RR variability [26,32,33], frequency domain features using wavelet transform [29,34], and
machine learning techniques as neural networks [17,29,34–36], and so on.
Artificial intelligence models currently play a huge role in medicine, especially artificial
neural networks, which have been used for the classification and detection of diseases
such as diabetes [37], heart diseases [38], chronic kidney disease [39], and in oncological
diagnostics [40]. Due to the efficiency and utility of these tools, we use neural networks in
this work.
Our study makes significant contributions to the field of ECG analysis by introducing
an innovative algorithm that integrates geometric models as features and inputs for AI
models, specifically designed to classify and detect sleep apnea and heart diseases. This
algorithm leverages geometric features that closely match the behavior of the ECG, enhanc-
ing the accuracy of classifications. We ensure relevance and continuity in ECG research by
addressing the challenges posed by limited and imbalanced datasets and aligning our work
with historical benchmarks established in the 2000 challenge [41] using the Apnea-ECG
database [42]. Overall, this comprehensive approach not only deepens our understanding
of ECG signal behavior but also lays the groundwork for future studies involving larger and
more balanced datasets, ultimately improving diagnostic capabilities and patient outcomes.
Existing OSA detection methods often rely on handcrafted features and struggle to
achieve high accuracy with single-lead ECG signals. To address these limitations, this article
introduces a novel algorithm that uses random algebraic polynomials (RAP) for signal
smoothing and creates a non-Gaussian physiological random field (NGPRF) to capture
intricate, non-Gaussian ECG features. This innovative framework models critical ECG
peaks (P-waves, QRS-complex, T-waves) and extracts their geometrical characteristics as
Euler–Poincaré characteristics (EPCs). By capturing unique geometrical forms in the ECG
signal, the EPCs provide robust inputs to our classification system. Unlike conventional
approaches, we integrate these advanced geometric descriptors with machine learning
classifiers, including ensemble K-nearest neighbors (EKNN) and feedforward multi-layer
neural networks (FNNs), to significantly improve OSA detection accuracy. This novel
combination of RAP-based signal processing and advanced classification methods bridges
existing gaps, making single-lead ECG-based OSA detection more accurate and potentially
adaptable for real-time and diverse clinical applications.
This article is organized as follows: In Section 2, we describe the mathematics involved.
In Section 3, we describe the data used. In Section 4, we discuss the methodology applied
to the cases. Then, in Section 5, we present the results and discussion. Finally, a conclusion
and future works are provided in Section 6.

2. Mathematical Framework
This section can help one understand the main steps of the methodology mentioned
in [43].

2.1. Polynomization
The first step of the method involves pre-processing to smooth the signal. In this step,
we model the ECG signals using RAP to reduce noise and construct the NGPRF. RAP is
denoted by φ(X, ξ ), for an ECG cycle j from 1 to N. The elemental waves in the ECG are
P-waves, QRS complex, and T-waves. In this case, each cycle is divided by a threshold R( j),
resulting in two intervals: I1 = [1 R( j)] and I2 = [ R E( j)], with E(j) representing the final
index in each cycle. Additionally, we define the RAP of order D representing the P-waves,
as follows:
D
φ B (S , Ω, X ( j)) = ∑k=0 ak ( j, Ω)X ( j)k , (1)
where S = (Ω, F , P ) represents a complete probability space, Ω denotes the sample space,
F denotes the σ-algebra of events, and P denotes the probability measure on F . Moreover,
ak ( j, ω̄ ) denotes a sequence of independent and identically distributed random variables
Algorithms 2024, 17, 527 4 of 22

for each cycle. The selected interval includes both the R-peak and the P-wave, represented
as X ( j) = [1, R( j)], where R( j) indicates the index of the R-peak.

2.2. Building Non-Gaussian Physiological Random Field


This framework defines a two-dimensional NGPRF, Φ = (X, ξ ), within a complete
probability space S . It models physiological signals across cardiac cycles, mapping θ : ξ →
RD . Here, X ∈ D ⊂ R2 , and θ denotes a two-dimensional NGPRF defined over N cardiac
cycles as follows:
N
Φ( X1 , X2 , ξ̄ ) = ∑ φB (S , ξ̄, X ( j))δ( j − X2 ) (2)
c =1

with φ B (S , ξ̄, X ( j)) as the random polynomial that represents the ECG behavior, and δ is
the Dirac’s distribution. According to Equation (2), polynomials φ B (S , ξ̄, X ( j)) are used to
decompose each ECG signal at a fixed point into an NGPRF in the coordinate X2 .

2.3. Excursion Set


In the random field theory, the excursion set is the main concept. Consider θ (X , ξ ) as
NGPRF, where X ∈ D ⊂ R2 is defined within a set D . The excursion set is a geometric
entity defined as the collection of points where the field exceeds a certain threshold value.
Specifically, for a given threshold λ, the excursion set is given by the following:

Aλ (θ, D) = {X ∈ D , θ (X , ξ ) ≥ λ} (3)

The set Aλ of θ (X , ξ ) above a threshold λ consists of points in D ⊂ R2 , where


θ (X , ξ ) exceeds λ. Stratified manifolds D ∈ R2 can be partitioned into disjoint unions
of k−dimensional manifolds, expressed as D = ∪dim D
k=0 ∂k D , where each stratum ∂k D
represents several k−dimensional manifolds. The non-Gaussian properties of θ necessitate
the consideration of generalized random fields, expressed as follows:

θ (X , ξ ) = F (θ∗ (X , ξ )) = F (θ∗1 (X , ξ ), . . . , θ∗m (X , ξ )) (4)


where θ (X , ξ ) represents a collection of independent and identically distributed (i.i.d.)
Gaussian random fields (GRFs), each defined over a topological space D . The function
F : Rm → R is a smooth, piecewise twice continuously differentiable function with
appropriate boundary conditions. The excursion set of a real-valued non-Gaussian field
θ = F ◦ θ∗ above a threshold λ is equivalent to the excursion set for a vector-valued
Gaussian field θ∗ in F −1 [λ, ∞), and is given by the following:

Aλ (θ, D) = Aλ ( F ◦ θ∗ , D) = {X ∈ D , ( F ◦ θ∗ )(X , ξ ≥ λ} (5)


In our context, let SS = (s1 , . . . , sS M ) denote the set of signatures, where each sk
represents a signed unit weight associated with the sub-Gaussian random field θsk (X , ξ ).
Furthermore, we define S M = ΣkM=1 (−1)k sk . We shall characterize the NGPRF, defined by
Equation (2), as follows:

θ (X , ξ, S M ) = (s1 θS1 (X , ξ ), . . . , sS M θSS (X , ξ ), (6)


M

where sS M θsS (X , ξ ) represents a set of i.i.d.-signed GRFs with X ∈ R2 , ξ ∈ Ω, and


M
s2n = +1, s2n+1 = −1.

2.4. Euler–Poincaré Characteristic


Let ϕ( Aλ (θ, D)) represent the EPC of the set Aλ (θ, D). For multiple trials, if the
expected value E {ϕ( Aλ (θ, D))} is computable, the random field theory imposes specific
regularity conditions on θ (X, ξ ). These conditions ensure that the realizations of θ are
smooth and that the boundary ∂D is smooth as well. Thus, D is regarded as a regular
Algorithms 2024, 17, 527 5 of 22

C2 domain within a compact subset of R2 , bounded by a smooth, one-dimensional C2


manifold ∂D .
Consider θ (X , ξ ), where X = [χ1 , χ2 ] ⊂ R2 , as a stationary, non-isotropic random
∂θ (X ,ξ ) ∂2 θ (X ,ξ )
field. Define θ̇i (X , ξ ) = ∂χi and θ̈ij (X , ξ ) = ∂χi ∂χ j , where i, j = 1, 2.
The moduli of continuity of θ̇ j (X , ξ ), and θ̈ jk (X , ξ ) inside D , are given by the following:

ξ j (h) = sup θ̇ j (X , ξ ) − θ̇ j (Y , ξ ) ,
∥X −Y ∥<h,ξ

and
ξ jk (h) = sup θ̈ jk (X , ξ ) − θ̈ jk (Y , ξ ) ,
∥X −Y ∥<h,ξ

respectively.
To ensure that the realizations of θ (X , ξ ) are sufficiently smooth, the following condi-
tions must be met:
• C1 : The maximum of ξ j (h) and ξ jk (h) should be asymptotically negligible, specifically
o (h N ), as h → 0.
• C2: The Hessian θ̈ of θ̇ jk must have a finite variance conditional on θ, where θ̇ is the
gradient of θ̇ j .
• C3: The densities of θ and θ̇ must be uniformly bounded for all X ∈ D .
At a boundary point X on ∂D :
• θ̇⊥ is the gradient of θ in the direction perpendicular to ∂D .
• θ̇D is the gradient in the tangent direction within the plane of ∂D .
• θ̈D denotes the 1 × 1-Hessian matrix in the tangent plane.
• r is the 1 × 1 matrix representing the internal curvature of ∂D .
Using the sign function, denoted as sign, and following Knuth’s notation [44], which
assigns a value of 1 to a true expression in parentheses, and 0 if false, the EPC is then given
by the following:

Ψ(Aλ (θ, D)) = ΣX ∈D (θ ≥ λ)(θ̇ = 0)sign[det(−θ̈)]


(7)
+ ΣX ∈D (θ ≥ λ)(θ̇D = 0)(θ̇⊥ ≤ 0) × sign[det(−θ̈D ) − θ̇ ⊥ r )],

with a probability of one. In R2 , integral geometry characterizes φ(Aλ (θ, D)) as the differ-
ence between the count of connected components and the number of voids in Aλ (θ, D).
Moreover, the expected value of φ(Aλ (θ, D)) over multiple realizations is as follows:

Z
E{Ψ(Aλ (θ, D))} = E{(θ ≥ λ) det(−θ̈)|θ̇ = 0} β(0)dX
D
Z (8)
+ E{(θ ≥ λ)(θ̇⊥ < 0) det(−θ̈D − θ̇ ⊥ r )|θ̇D = 0} × β D (0)dX ,
∂D

where β(.) is the density of θ̇ and β D (.) is the density of θ̇D . It is shown that, under the
condition that the boundary of D consists of a finite number of piecewise filtered segments,
the expected value of the excursion set of a mean-zero, unit-variance random field is given
by the following:
N
E{Ψ(Aλ (θ, D))} = ∑ ρ j (λ)L j (D) (9)
j =0

where ρ j (λ) = (2π )−( j+1)/2 Hj−1 (λ) exp(−λ2 /2) is the intensity of the EPC per unit volume,
Hj denotes the j − th Hermite polynomial, and L j (D) represents the Lipschitz–Killing
curvatures.
Algorithms 2024, 17, 527 6 of 22

3. Data Used
The Apnea-ECG database [42] was used in this study. It contains 70 records, divided
into two groups: a training set of 35 records, including 20 severe cases, 5 mild cases, and
10 non-apnea cases, and a validation set consisting of the remaining 35 records. All ECG
signals in the dataset are annotated with QRS complexes. The data are derived from a
population aged between 27 and 60 years, with all records digitized at 100 samples per
second. The length of the records ranges from 7 to 10 h.

4. Methodology
Figure 1 represents the proposed methodology used for classifying sleep apnea. The
methodology consists of the following five steps:
1. Pre-processing: As part of this step, the ECG signals were filtered using random
polynomials. This process is referred to as polynomization.
2. Random field transformation: The filtered signal was used to build the NGPRF,
collapsing c number of cycles into a geometric structure.
3. Geometrical property: Each NGPRF was sectioned at several levels, denoted by λ,
known as excursion sets.
4. Feature extraction: For each excursion set, a value was calculated that represented the
difference between the number of connected components and the number of holes,
capturing key aspects of the set’s geometric structure. This feature is referred to as the
Euler–Poincaré characteristic.
5. Classifier selection: An EKNN model is proposed to classify OSA from the EPC
models. The training dataset was used for learning, and the test dataset was used to
validate the model. Also, a feedforward multi-layer neural network is proposed for
the binary classification.

Figure 1. Methodology to classify sleep apnea. The first stage involves the data or ECG. The second
stage involves pre-processing, where the ECG is cleaned. The third stage involves random field
conversion. The fourth stage focuses on geometrical properties, where the excursion set is obtained.
The fifth stage is feature extraction. Finally, the last stage involves selecting a classifier model (EKNN,
SVM, FNN) to differentiate between an apnea patient and a non-apnea patient.
Algorithms 2024, 17, 527 7 of 22

4.1. Pre-Processing
The pre-processing stage is referred to as ‘polynomization’, and was dealt with as
follows. First, the ECG cycle was divided into two interval parts, as our focus was on the
part containing the P-waves and R-peaks, only one interval was selected. The function for
this process is presented in (1).
We identified the R-peaks using the Pan–Tompkins algorithm [45] to achieve this
objective. Afterward, we split the ECG cycle from R-peak to R-peak using the middle
points, mk , and a fixed threshold. Each ECG cycle preserved the main waves, i.e., P,
Q, R, S, and T. Every cycle Nj was segmented two sections, P1 (C ) = [mk Rk+1 ], and
P2 (C ) = [ Rk+1 mk+1 ]. Upon completion of the process, the result was in the form of
polynomials that correspond to the appropriate order D. In these cases, we only used the
P1 (C ) polynomials.
We assessed the normalized root mean square error (NRMSE) using Equation (10) to
identify the optimal order of the random polynomials that best approximated the data.
D (C )
 
P1 (C ) − ∑k=1 0 âk (k, ω̄ ) X j (k)k
FIT = 1001 −  (10)
∥ P1 (C ) − P̄1 (C )∥

where P1 (C ) represents the section of the ECG containing the P-waves and R-peaks, P̄1 (C ) is
the mean of each interval P1 , and the inverse of the Vandermonde matrix is used to calculate
the vector of estimated coefficients âk [46]. Our goal is to find the maximum FIT based on
NRMSE. To do this, we evaluate a group of samples (100,000) from each of the 35 patients
for the training set using polynomial orders ranging from 15 to 25 (D1 (c) = 15, . . . , 25).
To calculate the order of polynomials for the sections of the ECG from the R-peaks to the
T-waves, we used Equation (10), and instead of P1 (C ), we used P2 (C ). Also, we used
the integral absolute error (IAE) criterion. The results for P1 (C ) and P2 (C ) are shown in
Figure 2a,b with both criteria.

(a) (b)
Figure 2. Polynomial order results for the sections of the ECG; sections P1 (C ) and P2 (C ). (a) His-
togram of the polynomials of P-waves (blue) and T-waves (red) using FIT (Equation (10)). (b) His-
togram of the polynomials of P-waves (blue) and T-waves (red) using the IAE criterion.

The optimal polynomial order is 15 according to the FIT criterion and 21 based on the
IAE criterion. It is later shown that the order of the polynomials significantly influences the
final results, particularly during the classification process. Algorithm 1 shows the entire
procedure used for selecting the orders and obtaining the polynomials P1 (C ) and P2 (C ).
However, we only use the P-wave polynomials P1 (C ) in the following steps.
Algorithms 2024, 17, 527 8 of 22

Algorithm 1 Algorithm for pre-processing the ECG signals


Input: ECG
Output: Polynomials P1 (C ) and/or P2 (C )
Initialization;
1: Search the locations M j , j = 1, . . . , Nc ;
2: Locate the middle points m j ;
3: Find the best order for P1 (C ) and P2 (C ) using Equation (10);
4: Estimate the polynomials I1 (c ), c ∈ [ m j , M j+1 ], and I2 (c ), c ∈ [ M j+1 , m j+1 ];
5: Assess the results;

4.2. Transforming into a Random Field and Geometrical Approach


Once the ECG signal is filtered using the polynomization method, we combine the
results of each cardiac cycle to form the random field (see Figure 3). The NGPRF can be
expressed as Equation (2).
The excursion set, defined in Equation (3), utilizes a threshold level λ determined from
the range [−1, 1]. This range is used because we normalize the signal in the pre-treatment
process.

Figure 3. Random field of the P-waves, Q-peaks, and R-peaks in a short number of cycles (100).

To ensure homogeneity across the random fields, any empty spaces should be filled
with zeros. Figures 4 and 5 show the behaviors of the excursion set at threshold level
λ = 0, where we note the R-peaks and the P-waves of each type of patient. We developed
Algorithm 2, which measures the vectors with the P-waves and R-peaks to build the non-
Gaussian random field. The algorithm first determines the maximum length of the cycles.
If the length of any cycle is less than this maximum, the algorithm fills the empty spaces
with zeros to ensure homogeneity.
100

R-peaks
Cardiac cycle number

80
P-waves

60

40

20

0
260 200 150 100 50 0
Sample number

Figure 4. P-waves and R-peaks from the binary image (excursion set) at level λ = 0.2 for an apnea
patient. The binary representation of the P-wave varies depending on the level of u.
Algorithms 2024, 17, 527 9 of 22

100
90
80

Cycle cardiac number


70 R peaks

60
P-waves
50
40
30
20
10
0
260 200 150 100 50 0
Sample number

Figure 5. P-waves and R-peaks from the binary image (excursion set) at level λ = 0.2 for a non-apnea
patient. Normally, the P-wave follows a straight line at each level u.

Algorithm 2 Process to construct the non-Gaussian random physiological field


Input: RAPs P1 (C ), empty vector A = [ ]
Output: Φ(X, Ω̄, S M )
Initialization;
1: for i = 1 to Mc do
2: M (i ) = length( P1 (C )i )
3: end for
4: Val M = max{ Matrix }|Val M ∈ R
5: if (Matrixi < Val M ) then
6: Φ([i, 1 : M ], Ω̄) = [zeros, P1 (C )k ]
7: else
8: Φ([i, 1 : M ], Ω̄) = P1 (C )k
9: end if

4.3. Extracting the feature


In this work, feature extraction relies on the excursion set to calculate the Euler–
Poincaré characteristic (EPC), represented as φ(Aλ (Φ, D)). The approach involves trans-
forming the excursion set into a binary image, where each value is set to 1 if it exceeds
the threshold level λ, and 0 otherwise. To compute the EPC values, we applied Gray’s
algorithm [47]. The EPC is a scalar quantity that represents the difference between the
number of connected components and the number of holes within those components [48].
After that, the EPC is obtained for all apnea and non-apnea patients in the training set.
Figure 6 shows the EPC for each apnea patient; the blue lines depict the results obtained
with 15th-order polynomials, while the red lines indicate the behaviors associated with
21st-order polynomials. Figure 7 shows the borderline apnea patients (patients 21–25) and
non-apnea patients (26–35), where we have the results of both polynomials, i.e., the blue
lines denote 15th-order and the red lines denote 21st-order.

4.4. Classification
The last step of the methodology involves searching for the best classifier. To predict
the type of apnea, we use a matrix X with 102 columns; columns 1 to 101 contain the
stacked EPC values, and the last column represents the target value, where sleep apnea is
denoted as 0 and non-apnea as 1. The matrix described is utilized for training the classifier.

Z11 Z21 ··· Zn1


 
Y1
 Z2 Z22 ··· Zn2 Y2 
 1 
 . .. .. .. .. 
 .. . . . . 
Z1m Z2m · · · Znm Ym

where Z jk denotes the predictors with j = [1, 101], and Yk denotes the class of each patient.
Algorithms 2024, 17, 527 10 of 22

Figure 6. EPC values from the sleep apnea patients. Patients from 1 to 20 show OSA events at
different times with severe cases. In the majority of these cases, the duration of the OSA event is
about 1 hour.

Figure 7. EPC values from sleep apnea patients with borderline cases (patients 21–25), where activity
was less than an hour, and non-apnea patients (patients 26–35), who served as control cases.

In our study, we utilized Classification Learner, a Matlab toolbox, to model several


classifiers. We chose several models to provide a baseline comparison, varying complexity
and interoperability. Our objective was to evaluate simple and sophisticated models
to observe the complexity of the OSA classification. The results are shown in Table 1,
Algorithms 2024, 17, 527 11 of 22

applying EPC models derived from 15th-order polynomials as inputs for the classifiers.
The computations were conducted on an AMD Ryzen 5 processor with 16 GB of RAM,
utilizing the parallel pool option. We used k-fold cross-validation with k = 5 in all cases.

Table 1. Comparing machine learning techniques to classify sleep apnea using EPC models as inputs.

Type of Classifier Accuracy Sensitivity Specificity F1 Score MCC


Linear SVM 62.86% 70% 20% 76.36% −7.75%
Decision Tree 65.71% 78.26% 41.67% 75% 20.94%
KNN 74.29% 78.57% 57.14% 83.02% 31.62%
Logistic Regression 77.14% 86.96% 58.33% 83.33% 47.59%
Ensemble KNN 80% 82.14% 71.43% 86.79% 47.43%

With the results shown previously, we applied an ensemble of K-nearest neighbors


(EKNN); this approach can help to improve the prediction with non-informative fea-
tures [49]. In Figures 6 and 7, we observed all the EPCs from all the patients; analyzing
these data presents a challenge, so we employed classifiers to reveal information that aids
in their classification.
Figure 8 presents a diagram of the ensemble KNN classifier, where the EPC models
from both healthy and unhealthy patients serve as the training data.

Figure 8. The ensemble KNN classifier example; each dataset is composed of 65 random features. In
this setup, 30 KNN classifiers (learners) are activated, and the final prediction is determined by a
majority vote.

We conducted a study where we selected 30 learners, each representing a different


subspace. For each learner, we randomly chose 65 variables to predict their behavior,
resulting in 35 observations for both the training and test phases. In the next section, we
will discuss the results and findings of this model in detail. Table 2 shows the parameters
used to train the EKNN model using 101 features as inputs. Remember that from the
Apnea-ECG database, there are two sets, one called training data and the other called test
data, each with 35 records unbalanced in the classes.

Table 2. Parameters used in the ensemble KNN model.

Parameters Values
Number of Neighbors (k) 10
Weighting Method ‘distance’
Distance Metric ‘euclidean’
Algorithm for Finding Neighbors ‘auto’
Number of Estimators 30
Ponderation of Models Uniform
Algorithms 2024, 17, 527 12 of 22

4.5. Neural Network Classifier


This work uses a feedforward multi-layer neural network to classify apnea or non-
apnea patients. In this architecture, data move in one direction from the input layer
through one or more hidden layers to the output layer. FNNs are commonly used for
classification tasks, such as determining whether a patient has sleep apnea. The network
is fully connected, meaning each neuron in one layer connects to every neuron in the
next layer. The model is trained by adjusting the weights between these connections to
minimize the difference between the predicted and actual labels using a process called
backpropagation. In binary classification, the output typically comes from a single neuron
using a sigmoid activation function to produce a probability.
The main equation governing the computation in a neural network is the weighted
sum of the inputs at each neuron, followed by an activation function. For neuron j, the
pre-activation output z j is given by the following:
n
zj = ∑ ω ji xi + bj (11)
i =0

where ω ji denotes the weights, xi denotes the input values, and b j denotes the bias. The
weighted sum z j is then passed through an activation function f (z j ) to introduce non-
linearity. This nonlinearity is essential for the network to model complex patterns in the
data. The final output from the network depends on both the network architecture and the
activation function choice.
Figure 9 shows the neural network used in this work to classify apnea, where an
input layer, two hidden layers, and an output layer were implemented. A Swish activation
function was implemented in the input layer, a ReLU activation function was implemented
in the first hidden layer, a tanh activation function was used in the second hidden layer,
and a softmax was used in the output layer.
Table 3 summarizes the values of the parameters of the FNN builder in Python using
the TensorFlow library.

Figure 9. Feedforward multi-layer neural network architecture proposed for classifying sleep apnea;
an input layer using a Swish activation function, two hidden layers—one with a ReLU function and
the other with a tanh function—and an output layer equipped with a softmax function.
Algorithms 2024, 17, 527 13 of 22

Below are the results obtained using two types of polynomial orders to smooth the
signal. They are also compared with other models.

Table 3. Summary of feedforward multi-layer neural network parameters.

Parameter Description Value


Input Layer Number of input features 101 (from EPC model)
Hidden Layers Number of hidden layers 2
Neurons Number of neurons per layer 100 (Layer 1), 64 (Layer 2), 64 (Layer 3)
Output Layer Number of neurons in output layer 1
Swish (Layer 1), ReLU (Layer 2),
Activation Functions Activation function per layer
Tanh (Layer 3), Softmax (Output Layer)
Optimizer Optimization algorithm Adam
Epochs Number of epochs 100
Classes Number of output classes 2 (binary classification)

5. Results and Discussion


A machine learning model was developed to detect cases of sleep apnea using an
ensemble K-nearest neighbors (KNN) classifier. The first phase of the study involved
training the model using a dataset that included 20 cases of severe sleep apnea (1 h of
activity), 5 mild cases (<1 h), and 10 cases with non-apnea. The results of this phase
are presented in the form of a confusion matrix, as shown in Figure 10. The model’s
accuracy was found to be 80%. Also, we found a sensitivity of 82% and a specificity of
71%. To achieve these results, we used the following formulas using the results of the
confusion matrix:

Accuracy = ( TP + TN )/( P + N ) = (23 + 5)/(35) × (100%) = 80%


Sensitivity = ( TP)/( TP + FN ) = (23)/(23 + 5) × (100%) = 82%
Speci f icity = ( TN )/( TN + FP) = (5)(5 + 2) × (100%) = 71%
where P and N represent positive and negative cases, respectively; TP and TN denote true
positives and true negatives; and FP and FN represent false positives and false negatives.

Figure 10. Confusion matrix for the training phase using 15th- and 21st-order polynomials. Both
cases had the same results.

Figure 10 shows the total correct predictions of the trained model, where it achieved
92% accuracy in apnea cases and 50% accuracy in non-apnea cases. In this work, we
used 15th- and 21st-order polynomials to soften the signal, but the model achieved the
same results obtained with the training data; Figure 10 expresses the results for the two
polynomial orders in this phase.
Algorithms 2024, 17, 527 14 of 22

In the testing phase, we used the validation data to obtain the results presented in
Figures 11 and 12; one set of results uses a 15th-order polynomial and the other uses a
21st-order polynomial. Figure 11 shows that patients with apnea were correctly classified
100% of the time, while those without apnea were correctly classified 88% of the time. In
addition, the accuracy, sensitivity, and specificity were calculated with the above-mentioned
formulas, yielding results of 97%, 96%, and 100%, respectively.

Figure 11. Results of the confusion matrix for the validated data using a 15th-order polynomial.

Figure 12 shows the results using the 21st-order polynomial, where the patients with
apnea were correctly classified 100% of the time, and those without apnea were correctly
classified 75% of the time. Additionally, the accuracy, sensitivity, and specificity were
calculated using the formulas mentioned above, yielding results of 94%, 93%, and 100%,
respectively.

Figure 12. Results for the test phase using a 21st-order polynomial.

A new method for classifying sleep apnea is proposed, which involves performing a
geometric transformation and extracting information through the Euler–Poincaré charac-
teristic model from Holter ECG and one lead (lead V3 ). Using a 15th-order polynomial in
the pre-processing phase, the model achieves an average accuracy of 89%, a sensitivity of
89%, and a specificity of 86%.
The results obtained with the feedforward neural network are presented for the
training phase in Figure 13 and for the test phase in Figure 14. The summary of these
results is shown in Table 4.
Algorithms 2024, 17, 527 15 of 22

Figure 13. Confusion matrix for the training phase using a 15th-order polynomial and FNN.

Figure 14. Results of the confusion matrix for the test set using a 15th-order polynomial and FNN.

Table 4. Table presenting the accuracy, sensitivity, specificity, and F1 score results of the FNN classifier.

Phase Accuracy Sensitivity Specificity F1 Score


Training 100% 96% 100% 98%
Test 97% 93% 100% 95%

The FNN has a better response than the EKNN. We used a 15th-order polynomial EPC
model to obtain the FNN classifier model because it had better results compared to the
21st-order polynomial. The next step is to compare the two approaches with several cases
in the literature.
Table 5 compares our approach with various cases from the 2000 challenge to modern
techniques that employ deep learning machines.
The heart rate variability (HRV) analysis has been employed in the literature. For
example, [26] used domain time features of the HRV, achieving a performance of 92.6%.
In [34], the authors analyzed the frequency domain features from the T-wave, using the
wavelet transform, and reached 92.3% accuracy. In [32], the spectral analysis of HRV
features achieved an accuracy of 89.36%.
Other works used oxygen saturation (S p O2 ) data to classify OSA. In [29], three different
algorithms using the wavelet transform were compared, and the results yielded an accuracy
of 88%.
The decision methods can vary by work. The most used classifiers include random
forest, support vector machines, linear or quadratic regression, neural networks, and KNN.
In [50], a linear discriminant using frequency domain features extracted from the Hilbert
transform achieved 90% accuracy. In [30], a decision tree combined with blood oxygen
saturation levels classified the OSA and achieved an accuracy of 93.03%, a sensitivity of
92.35%, and a specificity of 93.52%. In [36], a neural network was used to classify RR
interval data and multi-frequency filters, achieving a specificity of 99%.
Algorithms 2024, 17, 527 16 of 22

In [51], a random forest classifier used features from the power spectrum and discrete
wavelet transform. The best features were selected as inputs with the aid of the particle
swarm optimization method. The reported accuracy was 99.22%.
The authors of [35] and [17] used deep neural networks. A multi-layer feed-forward
neural network (FNN) using information from the ECG, S p O2 , and BMI yielded an accuracy
of 97.8% [35]. In [17], the authors proposed an algorithm that used deep learning layers
(convolutional neural networks and long short-term memory) to extract features and
classify the OSA. It achieved an accuracy of 97.21%, a sensitivity of 94.41%, and a specificity
of 98.94% on the Apnea-ECG database.
The related works and each study’s performance measures, signals used, techniques,
and decision methods are summarized in Table 5. Our approach stands out in terms of per-
formance measures (sensitivity, specificity, and accuracy); we also employed a geometrical
approach, which is unique among the studies reviewed. We used a different multi-layer
FNN and the EPC model as features, obtaining a similar performance to Li et al. [35].

Table 5. Comparison between our approach and the approaches used in the literature.

Literature Work Efficiency Analyzed Signal Proposed Techniques Classification


HRV in RR, T and S Threshold
Mcnames et al. [26] Accu = 92.6% ECG
ECG pulse Energy(WT) (5 min window)
EDR signal Shared mixture classifier
Raymond et al. [34] Accu = 92% ECG
RR signal (spectral features)
Accu = 89.4%
De Chazal et al. [32] ECG RR variability Linear and quadratic discriminants
Sens = 84.1%
R-wave amplitude (PSD) (spectral features)
Spec = 90.0%
Accu = 88%
Lee et al. [29] S p O2 WT Transform coefficients Threshold
Sens = 98%
ADA,DDA,NA
Spec = 92%
Accu = 89.8%
Maier et al. [33] ECG RR series Threshold
Sens = 81.3%
MAV series (120 ms. window)
Spec = 82.8%
Accu = 90%
Corthout et al. [50] ECG EDM+HT, EDM+RAS Linear Discriminant classifier
Sens = 84%
WA (feature set)
Spec = 93%
Accu = 93.03%
Burgos et al. [30] Sens = 92.35% S p O2 Desaturation indexes Bagging with ADTree
Spec = 93.52%
Accu = 99.22%
Ye et al. [36] Sens = 99.25% ECG R-R intervals FENet
Spec = 99.02%
Accu = 89% Power Spectrum,
Random forest classifier
Rajesh et al. [51] Sens = 86% ECG Discrete Wavelet Transform,
Spec = 92% PSO
Accu = 97.8% ECG
Li et al. [35] Sens = 98.6% SpO2 Feature extraction Multi-layer FNN
Spec = 93.9% BMI
Accu = 97.21%
Zarei et al. [17] Sens = 94.41% ECG LSTM-CNN AHI index
Spec = 98.94%
Accu = 89%
EKNN approach ECG Random Field EKNN classifier
Sens = 89%
Euler–Poincaré characteristic
Spec = 86%
Accu = 98.5%
FNN approach ECG Random Field Multi-layer FNN
Sens = 94.5%
Euler–Poincaré characteristic
Spec = 100%
Algorithms 2024, 17, 527 17 of 22

Appendix A outlines our application of the Synthetic Minority Oversampling Tech-


nique (SMOTE) to address dataset imbalance in the database used. This enhancement
increases the robustness of detecting sleep apnea and heart disease from ECG data.

6. Conclusions and Future Works


This study introduced a novel method for detecting obstructive sleep apnea (OSA)
using single-lead ECG signals by leveraging the Euler–Poincaré characteristic (EPC) to
represent ECG peaks geometrically. The RAP-based methodology for smoothing the ECG
signal and extracting EPC provided a rich feature set that captured the intricate patterns of
ECG peaks. We then applied an ensemble K-nearest neighbors (EKNN) classifier to these
EPC features, outperforming traditional methods by combining multiple KNN models for
improved accuracy. This approach highlights the effectiveness of using geometric represen-
tations and advanced ensemble techniques to enhance OSA detection from ECG data.
In conclusion, using the EKNN as a classifier during the training phase, we achieved
an accuracy of 80%, with a sensitivity of 82% and a specificity of 71%. In the test phase, we
attained an accuracy of 97%, a sensitivity of 96%, and a specificity of 100%.
For the FNN, as a binary classifier, we recorded a perfect accuracy of 100%, with a
sensitivity of 96% and a specificity of 100% in the training phase. In the test phase, we
achieved an accuracy of 97%, a sensitivity of 93%, and a specificity of 100%.
In future works, the NGRF will be built using smooth signals from the P-waves, QRS-
peaks, and T-waves to obtain a model that represents the behavior of the full ECG instead
of only one section (P-R section).
Our framework works with the EPC as a direct input to the classifier. In future works,
we will include different features in various domains (time, frequency, geometric, and
statistical) and larger datasets to classify various diseases.

Author Contributions: Conceptualization, M.R.-M. and G.O.-T.; methodology, F.D.J.S.-V. and M.M.G.;
validation, E.S.-B. and J.C.M.-S.; formal analysis, J.E.V.-R. and E.M.R.-V.; Investigation, M.R.-M. and
M.G.M.-E.; writing—review and editing, J.Y.R.-M. All authors have read and agreed to the published
version of the manuscript.
Funding: This research received no external funding.
Data Availability Statement: The database Apnea-ECG, described in [42], is available on PhysioNet
at https://physionet.org/content/apnea-ecg/1.0.0/ (accessed on 22 August 2024).
Acknowledgments: We thank the Centro Universitario de los Valles of the University of Guadalajara
for the access and use of the research laboratories.
Conflicts of Interest: The authors declare no conflicts of interest.

Abbreviations
The following abbreviations are used in this manuscript:
Accu accuracy
BMI body mass index
CNN convolutional neural network
CTM central tendency measure
DWT discrete wavelet transform
ECG electrocardiogram
EDR ECG-derived respiration
EEG electroencephalogram
EKNN ensemble k-nearest neighbors
EMG electromyogram
EPC Euler–Poincaré characteristic
FENet frequency extraction network
FNN feedforward neural network
Algorithms 2024, 17, 527 18 of 22

HRV heart rate variability


IAE integral absolute error
KNN k-nearest neighbors
LSTM long short-term memory
LZ Lempel–Ziv
ML machine learning
NGPRF non-Gaussian physiological random field
NGRF non-Gaussian random field
NRMSE normalized root mean square error
OSA obstructive sleep apnea
PG polygraphy
PSO particle swarm optimization
RFC random forest classifier
ROC-AUC characteristic-area under the curve
SBD sleep-disordered breathing
Sen sensitivity
Spec specificity
S p O2 pulse oximetry

Appendix A. Results Obtained with Balance Data Using SMOTE


This study utilized the datasets from the Apnea-ECG database on sleep apnea. How-
ever, due to the inherent class distribution, a significant imbalance was observed, with the
minority class being underrepresented. To address this issue and improve the model’s per-
formance, particularly in detecting the minority class, we employed the synthetic minority
over-sampling technique (SMOTE) [52].
SMOTE generates synthetic samples by interpolating between existing minority class
instances, thereby increasing the representation of the minority class in the dataset. This
approach helps to balance the class distribution, mitigating the risk of the model becoming
biased toward the majority class. A new and balanced dataset was created by incorporating
the synthetic samples generated by SMOTE, which was then used for model training and
evaluation. This strategy aimed to enhance the model’s ability to accurately identify in-
stances of sleep apnea, especially those belonging to the previously underrepresented class.
The strategy criteria applied to this dataset are as follows:
1. Data preparation: Load the ECG dataset, separate features and labels, and scale the
features using the StandardScaler.
2. Data balancing: Apply SMOTE to handle class imbalance, ensuring balanced data for
model training. In this step, features from the EPC model are randomly copied to
generate new data for the minority class.
3. Train–test split: Split the balanced dataset into training and testing sets, resulting in
two groups of 52 patients each, with 26 patients from the apnea group and the others
from the no-apnea group.
4. Model building and training: Create a neural network model, compile it with the
Adam optimizer, and train it on the training set with one-hot encoded labels, using the
same FNN with parameters described in Table 3.
5. Model evaluation: Evaluate the model’s performance on the test set and generate
predictions.
6. Performance metrics: Calculate and visualize confusion matrices, and compute
detailed metrics such as accuracy, sensitivity, specificity, precision, and F1 score for
both training and test sets.
To handle class imbalance, the SMOTE algorithm generates 34 new instances for the
non-apnea class, each with 101 features. Then, the results are split into two sets (train and
test), each containing 52 elements, with 26 apnea and 26 non-apnea patients, achieving a
balance ratio of 50.
Algorithms 2024, 17, 527 19 of 22

Figure A1 shows the confusion matrix for the training set with an accuracy of 92.31%,
a sensitivity of 100%, and a specificity of 84.62%.
Figure A2 shows the confusion matrix for the test set with an accuracy of 84.62%, a
sensitivity of 80.77%, and a specificity of 88.46%.
The summary of the metrics for this dataset, using the SMOTE algorithm to balance
the data, is presented in Table A1.
Confusion Matrix - Train
25

0 22 4 20

15
True label

10

1 0 26
5

0
0 1
Predicted label
Figure A1. Confusion matrix for the training set using the balanced data. Class 0 represents the
apnea patients, and class 1 represents the non-apnea patients.

Confusion Matrix - Test


22.5

20.0
0 23 3
17.5

15.0
True label

12.5

10.0
1 5 21
7.5

5.0

0 1
Predicted label
Figure A2. Confusion matrix for the test set using the balanced data. Class 0 represents the apnea
patients, and class 1 represents the non-apnea patients.
Algorithms 2024, 17, 527 20 of 22

Table A1. Performance metrics summary using SMOTE.

Metric Training (%) Test (%)


Accuracy 92.31 84.62
Sensitivity 100.00 80.77
Specificity 84.62 88.46
Precision 86.67 87.50
F1 Score 92.86 84.00

References
1. Malhotra, A.; Ayappa, I.; Ayas, N.; Collop, N.; Kirsch, D.; Mcardle, N.; Mehra, R.; Pack, A.I.; Punjabi, N.; White, D.P.; et al. Metrics
of sleep apnea severity: Beyond the apnea-hypopnea index. Sleep 2021, 44, zsab030. [CrossRef]
2. Baranchuk, A. Sleep apnea, cardiac arrhythmias, and conduction disorders. J. Electrocardiol. 2012, 45, 508–512. [CrossRef]
[PubMed]
3. Suen, C.; Wong, J.; Ryan, C.M.; Goh, S.; Got, T.; Chaudhry, R.; Lee, D.S.; Chung, F. Prevalence of Undiagnosed Obstructive Sleep
Apnea Among Patients Hospitalized for Cardiovascular Disease and Associated In-Hospital Outcomes: A Scoping Review. J.
Clin. Med. 2020, 9, 989. [CrossRef] [PubMed]
4. Anzai, T.; Grandinetti, A.; Katz, A.R.; Hurwitz, E.L.; Wu, Y.Y.; Masaki, K. Association between central sleep apnea and atrial
fibrillation/flutter in Japanese-American men: The Kuakini Honolulu Heart Program (HHP) and Honolulu-Asia Aging Study
(HAAS). J. Electrocardiol. 2020, 61, 10–17. [CrossRef] [PubMed]
5. Leung, A.A.; Williams, J.V.; Padwal, R.S.; McAlister, F.A. Prevalence, Patient Awareness, Treatment, and Control of Hypertension
in Canadian Adults With Common Comorbidities. CJC Open 2024. [CrossRef] [PubMed]
6. Rundo, J.V.; Downey, R., III. Polysomnography. Handb. Clin. Neurol. 2019, 160, 381–392.
7. Gottlieb, D.J.; Punjabi, N.M. Diagnosis and management of obstructive sleep apnea: A review. Jama 2020, 323, 1389–1400.
[CrossRef]
8. Khandoker, A.H.; Palaniswami, M.; Karmakar, C.K. Support vector machines for automated recognition of obstructive sleep
apnea syndrome from ECG recordings. IEEE Trans. Inf. Technol. Biomed. 2008, 13, 37–48. [CrossRef]
9. Varon, C.; Caicedo, A.; Testelmans, D.; Buyse, B.; Van Huffel, S. A novel algorithm for the automatic detection of sleep apnea
from single-lead ECG. IEEE Trans. Biomed. Eng. 2015, 62, 2269–2278. [CrossRef]
10. Hwang, S.H.; Lee, Y.J.; Jeong, D.U.; Park, K.S. Apnea–hypopnea index prediction using electrocardiogram acquired during the
sleep-onset period. IEEE Trans. Biomed. Eng. 2016, 64, 295–301.
11. Mohammadzadeh-Asl, B.; Setarehdan, S.K. Neural network based arrhythmia classification using heart rate variability signal. In
Proceedings of the 2006 14th European Signal Processing Conference, Florence, Italy, 4–8 September 2006; pp. 1–4.
12. Asl, B.M.; Sharafat, A.R.; Setarehdan, S.K. An adaptive backpropagation neural network for arrhythmia classification using RR
interval signal. Neural Netw. World 2012, 22, 535. [CrossRef]
13. Starkey, S.Y.; Jonasson, D.R.; Alexis, S.; Su, S.; Johal, R.; Sweeney, P.; Brasher, P.M.; Fleetham, J.; Ayas, N.; Orenstein, T.; et al.
Screening for Obstructive Sleep Apnea in an Atrial Fibrillation Population: What’s the Best Test? CJC Open 2021, 3, 442–449.
[CrossRef] [PubMed]
14. Sun, D.; Schaff, H.V.; Somers, V.K.; Nishimura, R.A.; Geske, J.B.; Dearani, J.A.; Ommen, S.R. Association of Preoperative
Sleep-Disordered Breathing With Functional Status After Septal Myectomy for Obstructive Hypertrophic Cardiomyopathy. CJC
Open 2022, 4, 848–853. [CrossRef] [PubMed]
15. Babaeizadeh, S.; White, D.P.; Pittman, S.D.; Zhou, S.H. Automatic detection and quantification of sleep apnea using heart rate
variability. J. Electrocardiol. 2010, 43, 535–541. [CrossRef] [PubMed]
16. Yılmaz, B. Sleep staging and apnea detection from single-lead electrocardiogram. J. Electrocardiol. 2011, 44, e31–e32. [CrossRef]
17. Zarei, A.; Beheshti, H.; Asl, B.M. Detection of sleep apnea using deep neural networks and single-lead ECG signals. Biomed.
Signal Process. Control 2022, 71, 103125. [CrossRef]
18. Bahrami, M.; Forouzanfar, M. Sleep Apnea Detection From Single-Lead ECG: A Comprehensive Analysis of Machine Learning
and Deep Learning Algorithms. IEEE Trans. Instrum. Meas. 2022, 71, 1–11. [CrossRef]
19. Pant, H.; Dhanda, H.K.; Taran, S. Sleep apnea detection using electrocardiogram signal input to FAWT and optimize ensemble
classifier. Measurement 2022, 189, 110485. [CrossRef]
20. Yang, Q.; Zou, L.; Wei, K.; Liu, G. Obstructive sleep apnea detection from single-lead electrocardiogram signals using one-
dimensional squeeze-and-excitation residual group network. Comput. Biol. Med. 2022, 140, 105124. [CrossRef]
21. Liu, H.; Cui, S.; Zhao, X.; Cong, F. Detection of obstructive sleep apnea from single-channel ECG signals using a CNN-transformer
architecture. Biomed. Signal Process. Control 2023, 82, 104581. [CrossRef]
22. Magalang, U.J.; Dmochowski, J.; Veeramachaneni, S.; Draw, A.; Mador, M.J.; El-Solh, A.; Grant, B.J. Prediction of the Apnea-
Hypopnea Index From Overnight Pulse Oximetry. Chest 2003, 124, 1694–1701. : 10.1378/chest.124.5.1694 [CrossRef] [PubMed]
23. Heneghan, C.; Chua, C.P.; Garvey, J.F.; de Chazal, P.; Shouldice, R.; Boyle, P.; McNicholas, W.T. A Portable Automated Assessment
Tool for Sleep Apnea Using a Combined Holter-Oximeter. Sleep 2008, 31, 1432–1439. [CrossRef] [PubMed]
Algorithms 2024, 17, 527 21 of 22

24. Álvarez, D.; Hornero, R.; Abásolo, D.; del Campo, F.; Zamarrón, C. Nonlinear characteristics of blood oxygen saturation from
nocturnal oximetry for obstructive sleep apnoea detection. Physiol. Meas. 2006, 27, 399–412. [CrossRef] [PubMed]
25. Maier, C.; Friedrich, J.; Katus, H.; Dickhaus, H. Prospective evaluation of a Holter-ECG derived severity index for screening of
sleep disordered breathing. J. Electrocardiol. 2016, 49, 919–924. [CrossRef] [PubMed]
26. McNames, J.N.; Fraser, A.M. Obstructive sleep apnea classification based on spectrogram patterns in the electrocardiogram.
In Proceedings of the Computers in Cardiology 2000. Vol.27 (Cat. 00CH37163), Cambridge, MA, USA, 24–27 September 2000;
pp. 749–752. [CrossRef]
27. Gil, E.; Vergara, J.M.; Laguna, P. Study of the relationship between Pulse Photopletismography amplitude decrease events and
sleep apneas in children. In proceeding of 2006 International Conference of the IEEE Engineering in Medicine and Biology
Society, New York, NY, USA, 30 August–3 September 2006; pp. 3887–3890.
28. Gil, E.; Monasterio, V.; Laguna, P.; Vergara, J.M. Pulse Photopletismography Amplitude Decrease Detector for Sleep Apnea
Evaluation in Children. In proceeding of 2005 IEEE Engineering in Medicine and Biology 27th Annual Conference, Shanghai,
China, 17–18 January 2006; pp. 2743–2746.
29. Lee, Y.K.; Bister, M.; Blanchfield, P.; Salleh, Y.M. Automated detection of obstructive apnea and hypopnea events from oxygen
saturation signal. In Proceedings of the The 26th Annual International Conference of the IEEE Engineering in Medicine and
Biology Society, San Francisco, CA, USA, 1–5 September 2004; Volume 1, pp. 321–324. [CrossRef]
30. Burgos, A.; Goñi, A.; Illarramendi, A.; Bermudez, J. Real-Time Detection of Apneas on a PDA. IEEE Trans. Inf. Technol. Biomed.
2010, 14, 995–1002. [CrossRef]
31. Varady, P.; Micsik, T.; Benedek, S.; Benyo, Z. A novel method for the detection of apnea and hypopnea events in respiration
signals. IEEE Trans. Biomed. Eng. 2002, 49, 936–942. [CrossRef]
32. de Chazal, P.; Heneghan, C.; Sheridan, E.; Reilly, R.; Nolan, P.; O’Malley, M. Automatic classification of sleep apnea epochs using
the electrocardiogram. In Proceedings of the Computers in Cardiology 2000. Vol.27 (Cat. 00CH37163), Cambridge, MA, USA,
24–27 September 2000; pp. 745–748. [CrossRef]
33. Maier, C.; Dickhaus, H.; Laguna, P. Amplitude variability extraction from multi-lead electrocardiograms for improvement of
sleep apnea recognition. In Proceedings of the Computers in Cardiology, Lyon, France, 25–28 September 2005; pp. 355–358.
[CrossRef]
34. Raymond, B.; Cayton, R.M.; Bates, R.A.; Chappell, M. Screening for obstructive sleep apnoea based on the electrocardiogram-the
computers in cardiology challenge. In Proceedings of the Computers in Cardiology 2000. Vol.27 (Cat. 00CH37163), Cambridge,
MA, USA, 24–27 September 2000; pp. 267–270. [CrossRef]
35. Li, Z.; Li, Y.; Zhao, G.; Zhang, X.; Xu, W.; Han, D. A model for obstructive sleep apnea detection using a multi-layer feed-forward
neural network based on electrocardiogram, pulse oxygen saturation, and body mass index. Sleep Breath. 2021, 25, 2065–2072.
[CrossRef]
36. Ye, G.; Yin, H.; Chen, T.; Chen, H.; Cui, L.; Zhang, X. FENet: A Frequency Extraction Network for Obstructive Sleep Apnea
Detection. IEEE J. Biomed. Health Informatics 2021, 25, 2848–2856. [CrossRef]
37. Rashid, M.M.; Askari, M.R.; Chen, C.; Liang, Y.; Shu, K.; Cinar, A. Artificial Intelligence Algorithms for Treatment of Diabetes.
Algorithms 2022, 15, 299. [CrossRef]
38. Asif, D.; Bibi, M.; Arif, M.S.; Mukheimer, A. Enhancing Heart Disease Prediction through Ensemble Learning Techniques with
Hyperparameter Optimization. Algorithms 2023, 16, 8. [CrossRef]
39. Mondol, C.; Shamrat, F.M.J.M.; Hasan, M.R.; Alam, S.; Ghosh, P.; Tasnim, Z.; Ahmed, K.; Bui, F.M.; Ibrahim, S.M. Early Prediction
of Chronic Kidney Disease: A Comprehensive Performance Analysis of Deep Learning Models. Algorithms 2022, 15, 308.
[CrossRef]
40. Khoperskov, A.V.; Polyakov, M.V. Improving the Efficiency of Oncological Diagnosis of the Breast Based on the Combined Use of
Simulation Modeling and Artificial Intelligence Algorithms. Algorithms 2022, 15, 292. [CrossRef]
41. Goldberger, A.L.; Amaral, L.A.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.;
Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet components of a new research resource for complex physiologic signals.
Circulation 2000, 101, e215–e220. [CrossRef] [PubMed]
42. Penzel, T.; Moody, G.B.; Mark, R.G.; Goldberger, A.L.; Peter, J.H. Apnea-ECG Database. Comput. Cardiol. 2000, 27, 255–258.
[CrossRef]
43. Ramos-Martinez, M.; Corbier, C.; Alvarado, V.M.; Lopez, G.L. Decomposed Mean Euler-Poincaré Characteristic Model for a
Non-Gaussian Physiological Random Field. IEEE Access 2021, 9, 21180–21191. [CrossRef]
44. Knuth, D.E. Two notes on notation. Am. Math. Mon. 1992, 99, 403–422. [CrossRef]
45. Pan, J.; Tompkins, W.J. A Real-Time QRS Detection Algorithm. IEEE Trans. Biomed. Eng. 1985, BME-32, 230–236. [CrossRef]
46. Klinger, A. The Vandermonde Matrix. Am. Math. Mon. 1967, 74, 571–574. [CrossRef]
47. Gray, S.B. Local Properties of Binary Images in Two Dimensions. IEEE Trans. Comput. 1971, C-21, 551–561. [CrossRef]
48. Richardson, E.; Werman, M. Efficient classification using the Euler characteristic. Pattern Recognit. Lett. 2014, 49, 99–106.
[CrossRef]
49. Gul, A.; Perperoglou, A.; Khan, Z.; Mahmoud, O.; Miftahuddin, M.; Adler, W.; Lausen, B. Ensemble of a subset of k NN classifiers.
Adv. Data Anal. Classif. 2018, 12, 827–840. [CrossRef] [PubMed]
Algorithms 2024, 17, 527 22 of 22

50. Corthout, J.; Van Huffel, S.; Mendez, M.O.; Bianchi, A.M.; Penzel, T.; Cerutti, S. Automatic screening of Obstructive Sleep
Apnea from the ECG based on Empirical Mode Decomposition and wavelet analysis. In Proceedings of the 2008 30th Annual
International Conference of the IEEE Engineering in Medicine and Biology Society, Vancouver, BC, Canada, 20–25 August 2008;
pp. 3608–3611. [CrossRef]
51. Rajesh, K.; Dhuli, R.; Kumar, T.S. Obstructive sleep apnea detection using discrete wavelet transform-based statistical features.
Comput. Biol. Med. 2021, 130, 104199. [CrossRef] [PubMed]
52. Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic Minority Over-sampling Technique. J. Artif. Intell.
Res. 2002, 16, 321–357. [CrossRef]

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.

You might also like