0% found this document useful (0 votes)
9 views

Project Paper 14

Uploaded by

Sneha S.R
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)
9 views

Project Paper 14

Uploaded by

Sneha S.R
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/ 18

biosensors

Article
Machine Learning Assisted Wearable Wireless Device for Sleep
Apnea Syndrome Diagnosis
Shaokui Wang 1 , Weipeng Xuan 1, * , Ding Chen 1 , Yexin Gu 1 , Fuhai Liu 1 , Jinkai Chen 1 , Shudong Xia 2 ,
Shurong Dong 3 and Jikui Luo 1,3, *

1 Ministry of Education Key Laboratory of RF Circuits and Systems, College of Electronics & Information
Hangzhou Dianzi University, Hangzhou 310018, China
2 The Fourth Affiliated Hospital Zhejiang University School of Medicine, Yiwu 322000, China
3 Key Laboratory of Advanced Micro/Nano Electronic Devices & Smart Systems of Zhejiang,
College of Information Science & Electronic Engineering, Zhejiang University, Hangzhou 310027, China
* Correspondence: [email protected] (W.X.); [email protected] (J.L.)

Abstract: Sleep apnea syndrome (SAS) is a common but underdiagnosed health problem related to
impaired quality of life and increased cardiovascular risk. In order to solve the problem of complicated
and expensive operation procedures for clinical diagnosis of sleep apnea, here we propose a small
and low-cost wearable apnea diagnostic system. The system uses a photoplethysmography (PPG)
optical sensor to collect human pulse wave signals and blood oxygen saturation synchronously. Then
multiscale entropy and random forest algorithms are used to process the PPG signal for analysis and
diagnosis of sleep apnea. The SAS determination is based on the comprehensive diagnosis of the PPG
signal and blood oxygen saturation signal, and the blood oxygen is used to exclude the error induced
by non-pathological factors. The performance of the system is compared with the Compumedics
Grael PSG (Polysomnography) sleep monitoring system. This simple diagnostic system provides a
feasible technical solution for portable and low-cost screening and diagnosis of SAS patients with a
high accuracy of over 85%.

Keywords: sleep apnea syndrome; photoplethysmography (PPG); wearable device; machine learning

Citation: Wang, S.; Xuan, W.; Chen, 1. Introduction


D.; Gu, Y.; Liu, F.; Chen, J.; Xia, S.;
With the rapid progress of modern society, continuous improvement in the quality
Dong, S.; Luo, J. Machine Learning
of people’s lives and living standards has gained more and more attention. Sleeping-
Assisted Wearable Wireless Device
associated diseases have become one of the most serious health problems due to the
for Sleep Apnea Syndrome Diagnosis.
Biosensors 2023, 13, 483. https://
increased work-associated stress and the fast pace of modern society. Sleep apnea syn-
doi.org/10.3390/bios13040483
drome (SAS) is a representative of sleep-disordered breathing diseases that constantly
threaten human health. When breathing stops for about ten seconds or more during
Received: 20 February 2023 sleep unintentionally, apnea occurs. Repeated nocturnal hypoxia and hypercapnia due
Revised: 31 March 2023
to SAS can lead to complications such as hypertension, coronary heart disease, diabetes,
Accepted: 14 April 2023
cerebrovascular disease, traffic accidents, and even sudden death at night. According to
Published: 17 April 2023
statistics, the global prevalence of SAS is about 4% for men and 2% for women, and it
increases with the age of the population. For example, the prevalence of SAS among seniors
over 65 is 20% to 40% [1]. Therefore, early diagnosis and screening for sleep-disordered
Copyright: © 2023 by the authors.
breathing diseases will be effective in preventing SAS.
Licensee MDPI, Basel, Switzerland. For the diagnosis of sleep apnea, most medical institutions rely on the doctor’s per-
This article is an open access article sonal experience and physical examination results. These contain artifacts and human
distributed under the terms and errors. There are also some medical tools, such as the Polysomnograph (PSG), that can be
conditions of the Creative Commons used to measure and diagnose sleep apnea with more accurate physiological information
Attribution (CC BY) license (https:// than those artificial methods and have already been used to acquire physiological signals
creativecommons.org/licenses/by/ during sleep [2,3]. However, they have many limitations, such as complex testing methods,
4.0/). requiring professionals to operate in specific sleeping test rooms, and being complex to

Biosensors 2023, 13, 483. https://doi.org/10.3390/bios13040483 https://www.mdpi.com/journal/biosensors


Biosensors 2023, 13, 483 2 of 18

wear. Furthermore, the high medical costs of these facilities also cause an economic burden
on patients. Therefore, there is an urgent need for the development of portable/wearable
hardware and machine learning methods that could be employed for diagnosis of the
screening and diagnosis of sleep apneas [4]. Compared to PSG, some portable sleep moni-
tor devices have many advantages, such as low cost and convenience, but the data are much
less accurate than those of PSG. As a result, there is considerable room for improvement in
portable sleep monitor devices.
The use of portable monitoring devices to evaluate initial practice guidelines for SAS
was described by the American Association of Sleep Medicine (AASM) in 1994 [5,6]. In
an attempt to lower the cost and complexity of the PSG-based methods, many studies
have been done to create new instruments and techniques for screening SAS [7,8]. Various
strategies have been developed, and one of the most commonly recommended methods for
adults and children is PPG-based screening for SAS [9–11].
So far, wearable devices with built-in photoplethysmography (PPG) sensors have
become increasingly useful for detecting the physiological characteristics of diseases. PPG
is an optical approach that measures blood flow characteristics in the microvascular tissue
bed to monitor heartbeats [12]. It uses the light intensity difference to determine physio-
logical parameters, such as heart rate and blood oxygen saturation level, by monitoring
light intensities for light passing through the tissue or being reflected by the tissue [13,14].
However, due to numerous environmental noises (optical and electrical) and motion arti-
facts, the recorded signal may be distorted, resulting in measurement inaccuracies [15–17].
Hayano et al. presented a SAS detection system based on wearable watches [18], and Wu
et al. developed a SAS screening method based on wearable bracelets [19]. Selvakumar
et al. proposed a low-cost Cortex-M4 microcontroller to obtain the photoplethysmography
signal and use of an incremental merge segmentation algorithm to measure the respiration
rate [20]. On the other hand, measurement errors caused by motion artifacts usually occur
when the user moves freely, and patients are required to be in stable condition for tests,
which usually means lying in a bed. Therefore, the device for monitoring sleep should be
specifically designed to achieve stable measurement.
According to research, machine learning has been shown to be feasible for SAS diag-
nosis in a few experiments. With an 83.4% test accuracy, Margot et al. employed a least
squares support vector machine classifier to classify the PPG signal and applied it to the
PSG data from 102 participants suspected of having sleep apnea-hypopnea syndrome [21].
Debangshu et al. proposed a convolutional neural network-based deep learning frame-
work and employed the single-lead electrocardiogram (ECG) data in PSG to detect SAS
automatically with a test accuracy of 98.91% [22]. Lazazzera et al. used a threefold cross-
validation method to detect sleep apnea and hypopnea, combining PPG and SpO2 signal
fragments, which were used to detect sleep apnea and hypopnea, respectively, by envelope
and adaptive threshold estimation and obtained an accuracy of 75.1% in the detection of
apnea and hypopnea, and 92.6% in the classification of sleep-disordered breathing by SVM
in 2021 [23]. Wei et al. proposed a deep convolutional network MS-net consisting of a
multiscale block and shadow module, which used a PPG signal to detect sleep apnea with
an accuracy of 87% for the F1-score in 2023 [24]. Yin et al. validated and improved their
prediction accuracy through K-fold cross-validation and transfer learning that optimized
the detection of sleep apnea in COPD (chronic obstructive pulmonary disease) [25]. Massie
et al. used an ensemble of tree classifiers to predict obstructive sleep apnea and evaluated
the classifier performance using the leave-one-out cross-validation, which achieved a sen-
sitivity of 81%, a specificity of 99% and an accuracy of 90% in positive prediction in the
apnea–hypopnea index [26]. However, most of the approaches still utilized big facilities
for testing and were designed for advanced SAS diagnosis rather than feasible devices
to screen sleeping-related disorders, limiting their widespread use for large populations.
Furthermore, despite their good accuracy, most current diagnostic algorithms for PPG
are still in the stage of theoretical study. It is difficult to adapt it to the actual detection
environment due to its high complexity, time and resource consumption.
rithms for PPG are still in the stage of theoretical study. It is difficult to adapt it to
rithms for PPG are still in the stage of theoretical study. It is difficult to adapt it to t
actual detection environment due to its high complexity, time and resource consumpt
actual detection environment due to its high complexity, time and resource consumptio
In this work, a wearable wireless sleep monitoring system in the form of a smart
In this work, a wearable wireless sleep monitoring system in the form of a smart ri
is proposed, which uses reflective optical PPG sensors to capture PPG data and bl
is proposed, which uses reflective optical PPG sensors to capture PPG data and blo
Biosensors 2023, 13, 483 oxygen saturation. Then, the signal is analyzed by using multiscale entropy and rand
3 of 18
oxygen saturation. Then, the signal is analyzed by using multiscale entropy and rando
forest algorithms to diagnose SAS. The diagnosis algorithm is quick and efficient, us
forest algorithms to diagnose SAS. The diagnosis algorithm is quick and efficient, usi
lower computational resources. The smart ring is worn on a finger, and the signal is tra
lower computational resources.
In this work, a wearable The sleep
wireless smart ring is worn onin athe
finger,
form ofand thering
signalis is tran
mitted wirelessly to a mobile phone or monitoring system
a PC for real-time analysis, a smart
minimizing the c
mitted wirelessly
proposed, whichtouses
a mobile
reflectivephone
optical or
PPGa sensors
PC fortoreal-time
capture PPG analysis,
data and minimizing
blood oxygen the co
plexity of polysomnography
saturation. and providing
Then, the signal isand
analyzed by using a home-based wearable solution for ap
plexity of polysomnography providing a multiscale
home-basedentropy and random
wearable forestfor
solution apn
patients.
algorithms to diagnose SAS. The diagnosis algorithm is quick and efficient, using lower
patients.
computational resources. The smart ring is worn on a finger, and the signal is transmitted
wirelessly Wireless
2. Wearable to a mobileSystem
phone or Design
a PC for real-time analysis, minimizing the complexity of
and Fabrication
2. Wearable Wireless System Design and Fabrication
polysomnography and providing a home-based wearable solution for apnea patients.
The circuit architecture and fabricated hardware of the wearable apnea diagno
The circuitWireless
architecture and fabricated hardware of the wearable apnea diagnos
deviceWearable
2. are shown System1a,b,
in Figure Design and Fabrication
respectively. The flexible device consists of a photoe
device are shown
The circuit in Figure 1a,b,
architecture and respectively.
fabricated The flexible
hardware of the deviceapnea
wearable consists of a photoel
diagnostic
tric pulse wave sensor module (MAX30102, Analog Devices), a Bluetooth transmis
tric pulse
devicewave sensor
are shown module
in Figure (MAX30102,
1a,b, respectively. Analog Devices), a of
Bluetooth transmissi
module (CC2640R2F, TI Instruments) andThe flexible device
a power supply consists
module. a photoelectric
The electronic cir
module (CC2640R2F,
pulse TI Instruments)
wave sensor module and a Devices),
(MAX30102, Analog power supply module.
a Bluetooth The electronic
transmission module circ
of the sensor and
(CC2640R2F, TI Bluetooth module
Instruments) and a are shown
power supply in Figure
module. 2a,b.
The electronic circuit of the
of the sensor and Bluetooth module are shown in Figure 2a,b.
sensor and Bluetooth module are shown in Figure 2a,b.

Figure 1. Circuit
1. Circuitarchitecture ofthe
architecture of the smart ring
smart forapnea
the apnea diagnosis
(a), Photo(a), Photo of the fabric
FigureFigure
1. Circuit architecture of the smartring for the
ring for the diagnosis
apnea diagnosis (a),ofPhoto
the fabricated
of the fabrica
FPC FPC
circuit board
circuit board(b).
(b).
FPC circuit board (b).

Figure 2. The photoelectric sensor module circuit (a); The BLE and MCU module circuit (b).
Biosensors 2023, 13, x FOR PEER REVIEW 4 of 18

Figure 2. The photoelectric sensor module circuit (a); The BLE and MCU module circuit (b).
Biosensors 2023, 13, 483 4 of 18
When a patient wears this device, the physiological characteristic parameters col-
lected by the photoelectric pulse wave sensor module are transmitted to a personal com-
puter (PC) When viaa the Bluetooth
patient Low
wears this Energy
device, (BLE) 5.1 protocol.
the physiological Then,parameters
characteristic the diagnosis by a spe-
collected
cificbyalgorithm
the photoelectric pulse for
developed wave sensor
this work module are comprehensive
and the transmitted to a personal computer
diagnosis by the(PC)
PPG al-
via the Bluetooth Low Energy (BLE) 5.1 protocol. Then, the diagnosis
gorithm and SpO2 algorithm are carried out, from which an apnea-hypopnea index (AHI) by a specific algorithm
developed for
is calculated for classifying
this work and thethe comprehensive
patient’s sleepingdiagnosis
breathingby the PPG algorithm
situation accordingandtoSpO
severity.
2
algorithm are carried out, from which an apnea-hypopnea index (AHI) is calculated for
The photoelectric pulse wave sensor module consists of two light-emitting diodes
classifying the patient’s sleeping breathing situation according to severity.
(LED), red light and infrared light, a photodiode, and an AD converter module. The work-
The photoelectric pulse wave sensor module consists of two light-emitting diodes
ing(LED),
principle of the
red light PPG
and sensor
infrared is shown
light, in Figure
a photodiode, and 3a,b.
an ADWhen the chip
converter MAX30102
module. chooses
The work-
theingSpO principle of the PPG sensor is shown in Figure 3a,b. When the chip MAX30102 chooses by
2 /HR mode, the red light and infrared light alternatively irradiate, controlled
thethedriver.
SpO2To /HR measure
mode, the thered
red light
light and and infrared
infrared lightlight better, we
alternatively must have
irradiate, a reasonable
controlled by
control of theTo
the driver. current
measureintensity
the red and
lightfrequency
and infrared of light
the LED light,
better, according
we must have ato need, by pro-
reasonable
control ofthe
gramming thedriver.
currentA intensity
photodiode and isfrequency of the LED
used to receive the light, according
reflected to need,
lights and by the
convert
programming the driver. A photodiode is used to receive the reflected
light signals into electrical signals. The PPG signal is acquired via a high-precision ADC, lights and convert
andthe thelight signals into electrical signals. The PPG signal is acquired via a high-precision
original analog signal is converted into a digital signal.
ADC, and the original analog signal is converted into a digital signal.

Figure 3. The
Figure system
3. The systemblock
blockdiagram
diagram of the
thesensor
sensor(a);
(a);The
The measurement
measurement principle
principle of a typical
of a typical PPG PPG
signal (b).(b).
signal

AllAll
thethe electroniccomponents
electronic components and
and chips
chipsare
areassembled
assembledon on
a flexible printed
a flexible circuit
printed circuit
Biosensors 2023, 13, x FOR PEER REVIEWboard (FPC), as shown in Figure 1b. The FPC board can be bent and folded without
board (FPC), as shown in Figure 1b. The FPC board can be bent and folded without 5dam- of 18
damaging the electronic components, and can be placed well within the ring shell, which is
aging the electronic components, and can be placed well within the ring shell, which is 3D
3D printed, as shown in Figure 4a.
printed, as shown in Figure 4a.
The FPC board with the assembled components and chips is placed on the inner side
of the ring to form a smart ring that is used to monitor the sleeping breathing situation
when sleeping, as shown in Figure 4b. A mobile phone is used to receive the PPG signal
to show the sleeping situation.
To minimize power consumption, we chose CC2640R2F as the Microcontroller Unit
(MCU) with Bluetooth Low Energy (BLE) 5.1 function. The operating current and power
consumption of these two components are about 9.1 mA and 30.1 mW, respectively. Those
for the MAX30102 device are about 1.2 mA and 6.1 mW, while those for all other parts of
the smart ring are about 2.1 mA and 6.0 mW. The total operating current and power con-
sumption of the smart ring are about 12.8 mA and 43.4 mW during the short period of
sensing and transmission. A 3 V coin cell battery is used to power the smart ring with a
power capacity of 120 mAh, which allows continuous operation of the sleep monitoring
device for about 8.2 h, sufficient for the wireless sleeping monitoring application.

Figure 4. 4.
Figure The photo
The photoofofthe
thefabricated smartring
fabricated smart ring(a);
(a); human
human hand
hand withwith the smart
the smart ring (b).
ring (b).

The graphics user interface of the mobile phone for this application is shown in Fig-
ure 5, clearly showing the complete cyclic process of users’ PPG signal and SpO2 situation
during sleep.
Biosensors 2023, 13, 483 5 of 18

The FPC board with the assembled components and chips is placed on the inner side
of the ring to form a smart ring that is used to monitor the sleeping breathing situation
when sleeping, as shown in Figure 4b. A mobile phone is used to receive the PPG signal to
show the sleeping situation.
To minimize power consumption, we chose CC2640R2F as the Microcontroller Unit
(MCU) with Bluetooth Low Energy (BLE) 5.1 function. The operating current and power
consumption of these two components are about 9.1 mA and 30.1 mW, respectively. Those
for the MAX30102 device are about 1.2 mA and 6.1 mW, while those for all other parts
of the smart ring are about 2.1 mA and 6.0 mW. The total operating current and power
consumption of the smart ring are about 12.8 mA and 43.4 mW during the short period of
sensing and transmission. A 3 V coin cell battery is used to power the smart ring with a
Figure 4. The photo of the fabricated smart ring (a); human hand with the smart ring (b).
power capacity of 120 mAh, which allows continuous operation of the sleep monitoring
device for about 8.2 h, sufficient for the wireless sleeping monitoring application.
The graphics
The graphicsuser
userinterface
interfaceofofthe
themobile
mobile phone
phone for
for this
this application
application isis shown
showninin Fig-
ureFigure
5, clearly showing
5, clearly the complete
showing cycliccyclic
the complete process of users’
process PPGPPG
of users’ signal andand
signal SpOSpO
2 situation
2
during sleep.
situation during sleep.

Figure 5. App graphics user interface developed to receive the PPG signal from the smart ring dur-
Figure 5. App graphics user interface developed to receive the PPG signal from the smart ring
ing sleep.
during sleep.

3. DiagnosticAlgorithm
3. Diagnostic Algorithm
In In this
this paper,we
paper, weproposed
proposedaacomprehensive
comprehensive algorithm,
algorithm,related
relatedtotothe
thediagnostic
diagnostic re-
result of both the PPG algorithm and the SpO 2 algorithm. This estimates
sult of both the PPG algorithm and the SpO2 algorithm. This estimates the number the numberof res-
of respirations pause of the patients at a specific time, with an AHI that classifies the
pirations pause of the patients at a specific time, with an AHI that classifies the patients
patients according to the degree of severity of the situation. The flowchart of the diagnostic
according
algorithm tofor
thesleep
degree ofisseverity
apnea shown inofFigure
the situation.
6. The flowchart of the diagnostic algo-
rithm for sleep apnea is shown in Figure 6.
3.1. Blood Oxygen Analysis Algorithm
The MCU analyzes the ratio (R) of light intensities of the red and IR lights absorbed
by oxygenated hemoglobin (HbO2 ) and deoxyhemoglobin (Hb) in arterial blood and then
Biosensors 2023, 13, x FOR PEER REVIEW 6 of 18

Biosensors 2023, 13, 483 6 of 18

Sleep apnea
judgment
calculates blood oxygen saturation level using Equation (1), which is the standard formula
for measuring the level of blood oxygenBlood oxygen
saturation.
PPG algorithm Smart ring
algorithm
CHbO2
SpO2 = × 100 (1)
CHbO2 + CHb
Extract sample
Biosensors 2023, 13, x FOR PEER REVIEW Dynamic threshold 6 of 18
Here, C HbO2
entropy features
and CHb represent thejudgment
concentration of HbO2 and Hb in the blood,
respectively.

Sleep apnea
Determine whether
Random forest judgment
apnea or other causes

Blood oxygen
PPG algorithm Smart ring
algorithm
Comprehensive
judgment

Figure 6. Flow
Extract chart of the comprehensiveDynamic
sample judgement algorithm for apnea.
threshold
entropy features judgment
3.1. Blood Oxygen Analysis Algorithm
The MCU analyzes the ratio (R) of light intensities of the red and IR lights absorbed
by oxygenated hemoglobin (HbO2) and deoxyhemoglobin
Determine whether (Hb) in arterial blood and then
Random forest
apneausing
calculates blood oxygen saturation level or other causes (1), which is the standard formula
Equation
for measuring the level of blood oxygen saturation.
𝐶
Comprehensive𝑆𝑝𝑂 = 100 (1)
judgment 𝐶 +𝐶
Here, 𝐶6. Flow
Figure6. and 𝐶 ofrepresent
chart the concentration
thecomprehensive
comprehensive of HbO2 for
judgementalgorithm
algorithm and Hb in the blood, respec-
apnea.
Figure Flow chart of the judgement for apnea.
tively.
Apnea
Apnea
3.1. Blood can be
can
Oxygen beAnalysis
causedAlgorithm
caused by SAS
by SAS or or other
other conditions
conditions and
and can
can be
be distinguished
distinguished by by the
the
oxygen desaturation
oxygen desaturation index
index and
and the
the oxygen
oxygen desaturation
desaturationdegree.
degree. Oxygen
Oxygen desaturation
desaturation isisa
The MCU analyzes the ratio (R) of light intensities of the red and IR lights absorbed
aphenomenon
phenomenon
by
that occurs
oxygenated that occursinin
hemoglobin
apnea,
apnea,
(HbO
which
whichcauses
causesaa decrease
decrease in the SpO
in the
2) and deoxyhemoglobin (Hb) in arterial
SpO22 level.
level. Figure
blood Figure
and then77
shows the SpO level
SpO2 oxygen as a function
level assaturation of
a functionlevel time
of time for a wearer during sleep. The SpO level de-
usingfor a wearer
(1),during
which sleep. The SpOformula
2 level
2 2
calculates blood Equation is the standard
creases to to
decreases less than
less 90%,
than which
90%, whichis abnormal.
is abnormal.
for measuring the level of blood oxygen saturation.
𝐶
𝑆𝑝𝑂 = 100 (1)
𝐶 +𝐶
Here, 𝐶 and 𝐶 represent the concentration of HbO2 and Hb in the blood, respec-
tively.
Apnea can be caused by SAS or other conditions and can be distinguished by the
oxygen desaturation index and the oxygen desaturation degree. Oxygen desaturation is a
phenomenon that occurs in apnea, which causes a decrease in the SpO2 level. Figure 7
shows the SpO2 level as a function of time for a wearer during sleep. The SpO2 level de-
creases to less than 90%, which is abnormal.

Figure 7. SpO22 level


level variation
variation with
with time
time for
for aa wearer
wearer is
is measured
measured by our smart ring. The
The significantly
significantly
low SpO level at the time of 1480 s indicates the sleeping apnea of the wearer.
low SpO2 level at the time of 1480 s indicates the sleeping apnea of the wearer.
2

In general, a decrease inin SpO


SpO22 is not necessarily solely caused by sleep apnea.
apnea. There
are some other factors that maymay affect
affect the
the SpO
SpO22 level, such as a weak PPG signal, whose
low frequency can easily
easily be
be interfered.
interfered. Hardware maymay also
also decrease
decrease the
the SpO
SpO22 level, such
as the loose connection of the electrodes of of the equipment, which will cause mistaken
light intensity obtained by equipment to decrease SpO2 . There are also some contingencies

Figure 7. SpO2 level variation with time for a wearer is measured by our smart ring. The significantly
low SpO2 level at the time of 1480 s indicates the sleeping apnea of the wearer.
Biosensors 2023, 13, 483 7 of 18

that will cause this issue in detection, such as probe loosening, exercise interference, and
weakness perfusion [27]. Therefore, we take the PPG algorithm into consideration with the
SpO2 algorithm to obtain a better result than that for one index as a diagnostic criterion.

3.2. PPG Analysis Algorithm


For the algorithm used to analyze the PPG signal, we propose an improved method
to judge SAS, which combines multivariant multiscale entropy and random forest. This
method requires only a small computational resource. Sample entropy refers to judging
the complexity of nonlinear finite time series signals by calculating the probability of
generating new patterns. Multiscale entropy is to introduce a scale factor on the basis of
sample entropy to estimate the complexity of the signal under different scale factors [28].
The PPG data process flow is as follows:
(1) PPG data preprocessing This paper proposes PPG data preprocessing method in-
cludes three parts, median filter, lowpass filter and signal cutting. The PPG signal is
influenced by noise from the environment and acquisition equipment during collec-
tion, which results in real waveform changes. Therefore, it is necessary to preprocess
PPG data, which can avoid the subsequent influence of the error due to noise. PPG
signal noise includes the following three types.
1) Power-line interference:
Power-line interference, caused by power systems, which is one of the common
interferences in ECG signals, is usually removed by digital signal processing.
2) Electromyography (EMG) interference:
High-frequency noise interference of the PPG signal is mainly caused by EMG inter-
ference. If a person’s muscle or skin has poor contact with the sensor, EMG noise
appears, which causes irregular burr in PPG signals that influence signal quality. A
lowpass filter is a good way to remove it.
3) Baseline drift:
Baseline drift of the PPG signal is mainly caused by the electrode, human body and
acquisition equipment, which can be classified as low-frequency noise. Superimposed
baseline drift will make the PPG signal fluctuation become large, which could result in a
subsequent diagnosis. We propose a fast algorithm that uses a median filter with a sliding
window length of 2.5N to obtain the baseline drift signal from the original signal first; here,
N is the sampling frequency. Then, the filtered signal (baseline drift signal) is subtracted
from the original signal, and the signal without baseline drift is obtained. Therefore, we
can eliminate baseline drift and reduce the feature loss of signal as much as possible.
After the removal of baseline drift, a specific method of a median filter with a sliding
window length of 2N was proposed in this paper to filter out the noise. At first, we define
a dispersed signal sequence Y (t) (t > N ), assume that at a certain time, signal samples
are Y (t − N ), . . . . . . , Y (t − 1), Y (t), . . . .., Y (t + N − 1), then we need to sort it according to
their numerical values. The median value of sorted Y (t − N ), . . . . . . , Y (t − 1), Y (t), . . . ..,
Y (t + N − 1) is output signal by alternating Y (t − 1). The specific formula is shown in
Equation (2)

Y (t − 1) = Med{Y (t − N ), . . . . . . , Y (t − 1), . . . . . . , Y (t − N + 1)} (2)

Then, the signal is passed to a 10-order IIR lowpass filter with a cut-off frequency of
4.8 Hz to inhibit PPG signal noise. Its stopband attenuation is −60 dB, and its passband
ripple is 1 dB. Because of the delay phenomenon in the IIR filter, in order to display the
filtering effect better, we introduce delay compensation which is to eliminate the first M/2
points in the original signal. Here M is the number of filter orders. The original signal and
filtered signal are shown in Figure 8.
Biosensors 2023, 13, x FOR PEER REVIEW 8 of 18

Biosensors 2023, 13, 483 points in the original signal. Here M is the number of filter orders. The original signal8 of
and18
filtered signal are shown in Figure 8.

Figure 8.
Figure 8. Original
Original signal
signal (blue)
(blue) and
and filtered
filtered signal
signal (purple).
(purple).

For the convenience of algorithm research, research, wewe need to cut the signal into one-minute
lengths regardless
lengths regardlessofofhow howit it comes
comes from
from thethe databases
databases andand testing.
testing. In database,
In the the database, the
the total
total length
length of data of isdata is several
several hours,hours,
and theand the unit
label labelofunit of apnea
apnea is one is one minute,
minute, which which
indicatesin-
whether apnea has
dicates whether apneaoccurred during during
has occurred this period of time.
this period of Therefore, we must
time. Therefore, set a data
we must set a
length window
data length windowto cuttothecutPPG
the signal. In measured
PPG signal. data, the
In measured data,length of the of
the length datathewindow
data win- is
an important index that balances all aspects of the data. On the one
dow is an important index that balances all aspects of the data. On the one hand, if the hand, if the length of
the window
length of theiswindow
too short, is the
too selected
short, the data will easily
selected misseasily
data will a complete
miss acycle of apnea.
complete cycleOnof
the contrary,
apnea. On the if the length of
contrary, if the window
length ofisthetoo window
long, the is
selected
too long,datathe
willselected
includedatamultiple
will
cycles
includeofmultiple
apnea, causing
cycles ofa apnea,
specificcausing
weakening of the weakening
a specific PPG signalofand thehigher similarity
PPG signal and
of the extracted feature combination, which will increase the identification
higher similarity of the extracted feature combination, which will increase the identifica- difficulty of
the algorithm.
tion difficulty of the algorithm.
After
After careful
careful consideration,
consideration, we we proposed
proposed aa 60 60 ss window
window length.
length. The
The first
first 60
60 ss PPG
PPG
signal
signal is selected for training, and then, sliding the 60 s window to update the data,
is selected for training, and then, sliding the 60 s window to update the data, the
the
data
data for
for the
the first
first second
second of of the
the data
data sequence
sequence is is deleted
deleted and
and newnew data
data is
is added
added at at the
the end,
end,
which
which increases
increasesthe theaccuracy
accuracy ofof
thethe
algorithm.
algorithm. This processed
This processedPPGPPG
signal will increase
signal fault
will increase
tolerance in algorithm development.
fault tolerance in algorithm development.
(2) multiscale entropy
(2) multiscale entropyandandPRV-feature
PRV-featureextraction
extraction This paper proposes an extraction
scheme that combines both multiscale entropy and PRV-feature extraction to extract
This paper proposes an extraction scheme that combines both multiscale entropy and
PPG signal features. This PPG-related algorithm consists of two parts: sequence
PRV-feature extraction to extract PPG signal features. This PPG-related algorithm consists
coarse-graining and sample entropy calculation [29], including three parameters τ, m
of two parts: sequence coarse-graining and sample entropy calculation [29], including
and r, where τ is the scale factor, m is the embedding dimension, and r is the threshold.
three parameters τ, m and r, where τ is the scale factor, m is the embedding dimension,
The algorithm steps are as follows:
and r is the threshold. The algorithm steps are as follows:
1) Sequence coarse-grained algorithm:
(1) Sequence coarse-grained algorithm:
In order to improve the accuracy of the multiscale algorithm, an improved coarsening
In order to improve the accuracy of the multiscale algorithm, an improved coarsening
extraction algorithm is proposed. The first step of the traditional coarsening method
extraction algorithm is proposed. The first step of the traditional coarsening method is to
is to define a discrete one-dimensional time series, x1 , x2 , . . . . . . x L , and then a new
define a discrete one-dimensional time series, 𝑥 , 𝑥 , … … 𝑥 , and then a new time series
time series after coarsening this series is obtained, as shown in Equation (3):
after coarsening this series is obtained, as shown in Equation (3):

1
y τ =1
𝑦j= τ
∑ 𝑥
xi (3)
(3)
𝜏 i =( j−1)τ +1
( )
The length of the time series is changed to L/τ after coarsening; when τ = 1, it is
The length of the time series is changed to L/τ after coarsening; when τ = 1, it is the
the original time series. The method for obtaining the coarse-grained time series
original time series. The method for obtaining the coarse-grained time series with scales 2
with scales 2 and 3 is shown in Figure 9. It can be clearly seen from Figure 9 that
and 3 is shown in Figure 9. It can be clearly seen from Figure 9 that the traditional coars-
the traditional coarsening begins at the first of the time series, and then divides it
ening begins at the first of the time series, and then divides it according to different scale
according to different scale factors. However, the problem is that it will lose some
factors. However, the problem is that it will lose some data at the end of the time series
data at the end of the time series because there will appear a situation where the
length of one single time series cannot be exactly divisible by the scale factor, which
will decrease the accuracy of the multiscale entropy algorithm. Therefore, in order to
because there will appear a situation where the length of one single time series cannot be
because there will appear a situation where the length of one single time series cannot be
exactly divisible by the scale factor, which will decrease the accuracy of the multiscale
Biosensors 2023, 13, 483 exactly divisible by the scale factor, which will decrease the accuracy of the 9 of multiscale
18
entropy algorithm. Therefore, in order to improve the accuracy of the multiscale algo
entropy algorithm. Therefore, in order to improve the accuracy of the multiscale algo
rithm, an improved coarsening extraction algorithm is proposed, which uses a sliding
rithm, an improved coarsening extraction algorithm is proposed, which uses a sliding
sampling window to sample the original time series and sets the step size to 50% of the
sampling window
improve to sample
the accuracy of the the original time series
multiscale and setscoarsening
the step size to 50% of the
window meanwhile. It not only avoidsalgorithm, an tail
the loss of improved
data caused by extraction
coarsening at al
window meanwhile.
algorithm It not onlyuses
avoids the sampling
loss of tail data caused
sampleby coarsening at al
scales but alsoisdecreases
proposed, which
errors a sliding
in later algorithms. Thewindow
specifictoprocess the originalin Figure
is shown
scales butseries
time also decreases
and sets theerrors in later
step size to 50%algorithms. Themeanwhile.
of the window specific process is shown
It not only avoidsin Figure
10.
10. the loss of tail data caused by coarsening at all scales but also decreases errors in later
algorithms. The specific process is shown in Figure 10.
τ=2 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1
τ=2 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1
...
...

...
...
𝑥 +𝑥
𝑦1 𝑦2 𝑦3 … 𝑦𝑖 = 𝑥 𝑖𝑖 +𝑥 𝑖+1 𝑦𝑖+1
𝑦1 𝑦2 𝑦3 … 𝑦𝑖 = 2 𝑖+1 𝑦𝑖+1
2

τ=3 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1 𝑥𝑖+2


τ=3 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1 𝑥𝑖+2
...
...

...
...
𝑥 +𝑥 +𝑥
𝑦1 𝑦2 … 𝑦𝑖 = 𝑥 𝑖𝑖 +𝑥 𝑖+1 𝑖+2

𝑦1 𝑦2 … 𝑦𝑖 = 3 +𝑥 𝑖+2
𝑖+1
3
Figure9.9.Coarse
Coarse grain sequences for scale 2 and 3.
Figure 9. Coarsegrain
Figure sequences
grain for scale
sequences 2 and2 3.
for scale and 3.

τ=2 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1
τ=2 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1
...
...

...
...
𝑥 +𝑥
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 … 𝑦𝑖 = 𝑥 𝑖𝑖 +𝑥 𝑖+1 𝑦𝑖+1
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 … 𝑦𝑖 = 2 𝑖+1 𝑦𝑖+1
2

τ=3 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1 𝑥𝑖+2


τ=3 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 … 𝑥𝑖 𝑥𝑖+1 𝑥𝑖+2
...
...

...
...
𝑥 +𝑥
𝑦1 𝑦2 𝑦3 … 𝑦𝑖 = 𝑥 𝑖𝑖 +𝑥 𝑖+1 𝑦𝑖+1
𝑦1 𝑦2 𝑦3 … 𝑦𝑖 = 2 𝑖+1 𝑦𝑖+1
2
Figure 10. Improved time series coarsening for scales 2 and 3.
Figure 10. Improved time series coarsening for scales 2 and 3.
Figure 10. Improved time series coarsening for scales 2 and 3.
2) Sample entropy calculation:
(2) Sample entropy calculation:
After coarsening,
(2) Sample the sample
entropy entropy can be calculated. The specific process is as
calculation:
After coarsening, the sample entropy can be calculated. The specific process is as fol
follows:
After coarsening, the sample entropy can be calculated. The specific process is as fol
lows:i. According to the change of the scale factor τ, a new series is obtained, of which
lows: N = τL , thentoanthe
length1.isAccording m-dimensional vector Y (ifactor
) couldτ,bea constructed
change of the scale new seriesasisexpressed
obtained,byof which
1.
Equation According to the change of the scale factor τ, a new series is obtained, of which
length is(4).
𝑁 = , then an m-dimensional vector 𝑌(𝑖) could be constructed as expressed by
length is 𝑁 = , then an m-dimensional vector 𝑌(𝑖) could be constructed as expressed by
Equation (4).
Y (i ) = [y(i ), y(i + 1), . . . , y(i + m − 1)] ( i = 1, 2, . . . , N − m + 1) (4)
Equation (4).
𝑌(𝑖 ) = 𝑦(𝑖 ), 𝑦(𝑖 + 1), … , 𝑦(𝑖 + 𝑚 − 1) ( 𝑖 = 1,2, … , 𝑁 − 𝑚 + 1) (4
𝑌(𝑖 ) = 𝑦(𝑖 ), 𝑦(𝑖 + 1), … , 𝑦(𝑖 + 𝑚 − 1) ( 𝑖 = 1,2, … , 𝑁 − 𝑚 + 1) (4
Biosensors 2023, 13, 483 10 of 18

ii. Define d(Y (i ), Y ( j)) as the maximum absolute value obtained by subtracting
two vectors X (i ) and X ( j) on the scale τ. The formula is shown in Equation (5), where
k = 0, 1, . . . , m − 1; i, j = 1, 2, . . . , N − m + 1; i 6= j.

d(Y (i ), Y ( j)) = max( abs(y(i + k) − y( j + k ))) (5)

iii. After setting a threshold r, for each value of index i, calculate the distance between
Y (i ) and the rest of the vector Y ( j) based on Equation (6), where i, j = 1, 2, . . . , N − m + 1
and i 6= j.
{d(Y (i ), Y ( j)) ≤ r, j 6= i }
Cmr = (6)
N
iv. Calculate the average value of Cmr using Equation (7).

MeanCmr = average(Cmr) (7)

v. Let m = m + 1, repeat 2, 3, and 4 to obtain MeanCmr1, and obtain the multiscale


entropy value MSE(τ) at scale τ as expressed by Equation (8).

average(Cmr1)
MSE(τ ) = − ln (8)
average(Cmr)

Then we can employ the multiscale dividing PPG signal and calculate sample entropy
at each scale according to the above process. Each sample entropy includes information
on the PPG signal, whether large scale or small, which reflects the complexity of the PPG
signals, at their scale size. In this paper, the sample entropy with a scale factor from 1 to 15
is obtained and used as the data source for the following feature extraction.
(3) Feature extraction
After extracting the multiscale entropy features, it is also necessary to extract the
Heart Rate Variability (PRV) parameter features based on the PPG signal. PPG-based
feature parameters are mainly composed of time-based features and their derived features,
such as the mean of peak-to-peak periods and the standard deviation of peak-to-peak
periods. Therefore, it is particularly important to locate the peak points first before selecting
extraction parameters [30].
As mentioned above, the PPG signal has the characteristics of weak and possible
interference. Therefore, a strong anti-interference ability is required for the corresponding
peak point detection algorithm, thus reducing the false detection rate and missed detection
rate of the peak point. The peak point detection algorithm proposed in this paper is to
perform binary wavelet transform on the digital signal. If the intersection points of the
rising and falling edges of a signal are the singular point, it is the modulus maximum of the
smaller scale. Its location is the zero intersection point of positive and negative maximum
pairs of wavelets transform at scale s = 2 j , which is a maximum pair of waveform peaks.
The specific detection process is as follows:
1) To obtain the W23 f (n) value, the Mallat algorithm is used to decompose the input
PPG signal at s = 23 .
2) After detecting the extreme point, diagnose whether the curve between the two
extreme points is monotonic. If not, the extremum point is an orphan that needs to be
removed. If matching, the positive and negative value pair is retained;
3) Retain the extreme value pair of the maximum positive value > th p and the maximum
negative value < thn ;
4) Detect the peak point between positive and negative value pairs that meet the above
conditions, which is the zero-cross point;
5) In order to reduce the false detection rate, the extreme point within 200 ms after the
peak point is ignored, which corresponds better to the heart rate characteristics of
normal people;
sensors 2023, 13, x FOR PEER REVIEW 11 of

Biosensors 2023, 13, 483 11 of 18


(6) In order to reduce the missed detection rate, calculate the average time of the pe
peak cycle at first, then find the segment that has not been detected after 1.5 times
6) In order to reduce the missed detection rate, calculate the average time of the peak-
average time of the wave and then re-detect it after changing the threshold to ∗
peak cycle at first, then find the segment that has not been detected after 1.5 times the
∗ 𝑡ℎ time
and average . Finally,
of the restore
wave andthe threshold
then re-detect itafter the threshold to 45 ∗ th p
completion.
after changing
4
and 5 ∗ thn . Finally, restore the threshold after completion.
The actual detection effect is shown in Figure 11. The constructed features are lis
The actual detection effect is shown in Figure 11. The constructed features are listed in
in Table
Table1.1.

Figure 11. Actual


Figure detection
11. Actual detectioneffect ofpeak
effect of peakpoint
point detection.
detection.

TableTable 1. The
1. The parameterdefinition
parameter definition extracted,
extracted,based on PRV
based analysis.
on PRV analysis.
Parameter Definition of the Parameter
Parameter Definition of the Parameter
PR Pulse beats per minute, reflecting breathing rate
PR
PR The mean value of thePulse beats period,
peak-to-peak per minute,
indicatingreflecting
the averagebreathing
level of PRV rate
SDNNPP TheStandard
mean deviation
value ofofthe peak-to-peak
peak-to-peak period period, indicating th
PR
PPmedian The median periods of the peak-to-peak
average level of PRV
The number of times the difference between two adjacent peak-to-peak intervals
NN50
SDNNPP exceeds 50ms, indicating Standard deviation
the beat-to-beat of peak-to-peak
variability period
of the pulsatile cycle
The number of times the difference between two adjacent peak-to-peak periods
PPmedian exceeds 50ms as a percentage
PNN50 The median periods of the peak-to-peak
of the total number of peak-to-peak periods
SDNNAA The number
Standard of times
deviation the difference
of peak-to-peak amplitudebetween two adjacen
AA The average of peak-to-peak amplitude
NN50 peak-to-peak intervals exceeds 50ms, indicating the beat-t
AAmedian The median of peak-to-peak amplitude
beat variability of the pulsatile cycle
The selection
Finally, we must have feature numberand of times the functions;
evaluation difference between
in this two
research, weadjacen
PNN50 feature selection
select embedded peak-to-peak periods
and a tree model exceedsto50ms
corresponding as a percentage
the embedded feature of th
to evaluate the importance of the feature and mark
total it. Thenof
number keep the higher important
peak-to-peak periods and
more efficient feature to form feature engineering by threshold. This proposal not only has
SDNNAA Standard deviation of peak-to-peak amplitude
better classification ability but also better stability.
AA The average of peak-to-peak amplitude
4. Results and
AAmedian Discussion The median of peak-to-peak amplitude
4.1. Sensing Device Performance Verification
We compared the data from our device with those measured by the commercial
Finally, we must have feature selection and evaluation functions; in this research,
Compumedics Grael PSG 45 system, which is a standard instrument for hospitals, in order
selecttoembedded feature selection
verify the performance andmonitoring
of our sleep a tree model corresponding
system. The schematictodiagram
the embedded
for f
ture to evaluate
clinical the importance
data collection is shownofin the feature
Figure andthe
12. After mark it. Then keep
Compumedics Graelthe
PSGhigher
45 andimport
wearable
and more smart ring
efficient were stabilized,
feature to form the volunteers
feature wore themby
engineering while sleeping for
threshold. a night
This proposal
in a quiet and independent room, and the PPG measurement
only has better classification ability but also better stability. results were recorded and
displayed as graphs simultaneously. Figure 13 shows the pulse waves collected by the
smart ring and the Grael PSG 45 sleep monitoring system, respectively. It can be seen that
4. Results and Discussion
4.1. Sensing Device Performance Verification
We compared the data from our device with those measured by the commercial Co
pumedics Grael PSG 45 system, which is a standard instrument for hospitals, in order
4.8 Hz and a stopband attenuation of −40 dB in our MCU program, so that a cleaner signal
was obtained as shown in Figure 14. Although the problem of signal phase delay m
was obtained as shown in Figure 14. Although the problem of signal phase delay may be
introduced by IIR filters, our research is not very sensitive to the phase of the sign
introduced by IIR filters, our research is not very sensitive to the phase of the signal, and
therefore it will not affect the results. The calculation formula of signal-noise ratio
therefore it will not affect the results. The calculation formula of signal-noise ratio (SNR)
is shown in Equation (9):
is shown in Equation (9):
Biosensors 2023, 13, 483 𝑃 12 of 18
𝑃𝑆𝑁𝑅 = 10 log
𝑆𝑁𝑅 = 10 log 𝑃 (9)
𝑃
where 𝑃 is the power of the signal and 𝑃 is the power of the noise. The SNR of
the PPG𝑃waveforms
where is the powerobtained
of the from
signalthe
and 𝑃 is the
medical instrument
power ofandthe the smart
noise. Thering
SNRareof similar
the un-
filtered signal is 61.49 dB, so our digital IIR filter helps us filter out a lot of noise.
in principle,
filtered with
signal somedB,
is 61.49 differences in a few
so our digital IIRfeatures.
filter helps us filter out a lot of noise.

Figure 12. The subject with the smart ring being placed on the right index finger and the prof
Figure12.
12. The
The subject
subjectwith
withthe
the smart
smartring
ringbeing
beingplaced
placedon
onthe
the rightindex
indexfinger
fingerand
andthe
theprofessional
professional
Figure PSG equipment being placed on the left littleright
finger.
PSG equipment being placed on the left little finger.
PSG equipment being placed on the left little finger.

Figure 13. Pulse waves collected by the smart ring (blue) and a professional polysomnograph
instrument (red), respectively.

It should be noted that there are serval parameters that influenced the measurements.
Because we used a photoelectric sensor, the main parameter that influenced our measure-
ment results was light. However, there are many environmental factors that can cause
changes in light, such as the degree of fitting of the finger to the sensor, which means that
we must choose the appropriate finger size for our device to prevent this from affecting
the measurement during the patient’s shaking of the finger in their sleep. On the other
hand, we inserted a five-order digital IIR filter with a lowpass of the cut-off frequency of
4.8 Hz and a stopband attenuation of −40 dB in our MCU program, so that a cleaner signal
was obtained as shown in Figure 14. Although the problem of signal phase delay may be
introduced by IIR filters, our research is not very sensitive to the phase of the signal, and
therefore it will not affect the results. The calculation formula of signal-noise ratio (SNR) is
shown in Equation (9):
Ps
SNR = 10 log (9)
Pn
where Ps is the power of the signal and Pn is the power of the noise. The SNR of the
unfiltered signal is 61.49 dB, so our digital IIR filter helps us filter out a lot of noise.
Biosensors 2023, 13, x FOR PEER REVIEW

Figure 13. Pulse waves collected by the smart ring (blue) and a professional polysomnograph in-
strument (red), respectively.
Biosensors 2023, 13, 483 Figure 13. Pulse waves collected by the smart ring (blue) and a professional polysomnogr
13 of 18
strument (red), respectively.

Figure 14. Filtered effect of digital IIR filter.

Figure
Figure 14. Filtered effect14. FilteredIIR
of digital effect of digital IIR filter.
filter.
4.2. Algorithm Verification
4.2. Algorithm Verification
In order to verify
4.2. the reliability
Algorithm of the algorithms, we performed the algorithm first
Verification
withInpublic
orderdata fromthe
to verify thereliability
MIT-BIHof Polysomnographic
the algorithms, weDatabase
performed provided by Boston’s
the algorithm first
In order to verify the reliability of the algorithms, we performed the algorith
Bethpublic
with Israel data
Hospital
from[31,32]. The database
the MIT-BIH contained records
Polysomnographic Database from 16 volunteers
provided by Boston’sagedBeth
be-
with public data from the MIT-BIH Polysomnographic Database provided by B
tweenHospital
Israel 32–56 years old (average
[31,32]. age 43contained
The database years) and weighing
records from89–152 kg (average
16 volunteers agedweight
between119
Beth Israel Hospital [31,32]. The database contained records from 16 volunteers ag
kg), including
32–56 years oldECG, EEG,age
(average pulse pressure,
43 years) andrespiratory signalskg
weighing 89–152 and PPG signals,
(average weightobtained
119 kg),
tween 32–56 years old (average age 43 years) and weighing 89–152 kg (average wei
including ECG,The
during sleep. EEG, pulse
data pressure,
recorded everyrespiratory
30 s weresignals and PPG
accompanied bysignals, obtained
the relevant sleepduring
stage
kg), including ECG, EEG, pulse pressure, respiratory signals and PPG signals, ob
sleep. The marks
and apnea data recorded
provided every 30 s were
by medical accompanied
experts. Figure 15by the relevant
shows a typical sleep
partialstage
PPGand
sig-
during sleep. The data recorded every 30 s were accompanied by the relevant slee
apnea marksof
nal diagram provided by medical experts. Figure 15 shows a typical partial PPG signal
the dataset.
and apnea marks provided by medical experts. Figure 15 shows a typical partial PP
diagram of the dataset.
nal diagram of the dataset.

Figure 15.
Figure 15. A
A partial
partial PPG
PPG signal
signal diagram
diagram of
ofthe
thedataset.
dataset.

In Figure 15. Alearning


partial PPG signal diagram of the dataset.
In terms
terms ofof machine
machine learning algorithm algorithm selection,
selection, by bycomparing
comparingbetter better performance
performance
supervised
supervised algorithms, the random forest classifier was finally selected as
algorithms, the random forest classifier was finally selected as the
the core
core model
model
of In terms of machine learning algorithm selection, by comparing better perfor
of the automatic screening
the automatic screening systemsystemfor forapnea
apneadiagnosis.
diagnosis.Random Random forest
forest is aissupervised
a supervised en-
ensemble supervised algorithms,
machine-learning algorithmproposed the random
proposed forest classifier
byBreiman
Breiman [33]. The
Thewas finally selected
algorithm generates as the core
semble machine-learning algorithm by [33]. algorithm generates
multiple of the automatic screening system for apnea diagnosis. Random forest is a supervi
multiple decision
decisiontrees
treesat atthe
the same
same time time forfor the
the input
input training
training model;
model; each
each tree
tree has
has aa weak
weak
classifier, semble machine-learning algorithm proposed by Breiman [33]. The algorithm ge
classifier, and finally, the
and finally, the results
resultsof ofthethedecision
decisiontree treeareare voted
voted on,on,
or or bagging
bagging methods
methods are
are used multiple
to improve decision trees at the same time for the input training model; each tree has
used to improve the the accuracy
accuracy of the of prediction
the prediction model model
[34].[34].
SinceSince
each each
decisiondecision
tree istree
in-
is classifier, and finally, the resultsthe of the decision treealgorithm
are voted on, or bagging meth
dependent and then combined together, the random forest algorithm can processprocess
independent and then combined together, random forest can overfit-
overfitting used to improve
problems the accuracy of the prediction model
with[34].
highSince each decision tre
ting problems better better
and isand ableistoable to be processed
be processed in parallel
in parallel with high classification
classification accu-
accuracy and dependent
fast training and
speed. then It combined
is currently together,
the mostthe random
researched forest
and algorithm
used can process o
machine
racy and fast training speed. It is currently the most researched and used machine learning
learning algorithmting problems
in academia better and
and industry. is able to be processed in parallel with high classification
algorithm in academia and industry. ImprovedImprovedmultivariant multivariant
multiscalemultiscale
entropy was entropy
used
was used to racy and
extractentropy fast
samplefeature training
entropy speed.
feature It is currently the most researched and used machine le
to extract sample vectors ofvectors
different of scales
differentfrom scales fromsignal
the PPG the PPG thatsignal
were
that wereintodividedalgorithm
into…, d1, in academia
d2,which
. . . , d8, and industry. Improved multivariant multiscale entropy wa
divided d1, d2, d8, arewhich are theentropy
the sample samplevalues
entropy values obtained
obtained after the after
PPG
the PPG signal to extract sample
calculated by the entropy feature vectors
sample entropy of different
at different scales. scales
Then, from the PPG signal tha
the multiscale
sample entropydivided feature into
vector d1,wasd2, …, used d8,aswhich
the inputare the sample
of the randomentropy
forest values obtained
algorithm to after th
analyze the PPG signal.
The training and testing process were run on a computer (CPU: Intel i7 10700 2.9GHz;
RAM: 16 GB), and the best model was obtained after repeatedly adjusting parameters.
Biosensors 2023, 13, 483 14 of 18

We compared it with a Support Vector Machine (SVM), K-NearestNeighbor (KNN), and


XGboost in terms of accuracy (%), sensitivity (%), and specificity (%) at the same setting.
The sensitivity reflects the ability of the disease to be identified, as shown in Equation (10).

TP
Se = (10)
TP + FN
The specificity reflects the performance of normal samples not to be misjudged, as
shown in Equation (11).
TN
Sp = (11)
TN + FP
The accuracy represents the performance of this system to make correct judgments, as
shown in Equation (12):
TP + TN
Acc = (12)
TP + FP + TN + FN
where TP is true positives, TN is true negatives, FP is false positives, and FN is false
negatives. The comparison results are summarized in Table 2. Among the four classification
algorithms, the developed random forest algorithm achieved a specificity of 91.8%, a
sensitivity of 89.93%, and an accuracy of 93.88%, much better than those of the other three
classification algorithms, as shown in Table 2. It is also superior to other algorithms in
terms of running speed. It can be seen that the PPG signal analysis method based on
multivariant multiscale entropy and random forest proposed in this paper can effectively
identify apnea and has a high recognition accuracy. The SpO2 analysis algorithm was
used to make additional judgments on whether the decrease of SpO2 is caused by probe
loosening, exercise interference, or other reasons. If SpO2 is decreased due to other reasons,
it is determined that the data are incorrect, and an error warning is issued to remind the
user to check.

Table 2. The performance of sleep apnea judgment under different models.

Models Accuracy (%) Specificity (%) Sensitivity (%) Running Time (s)
Random Forests 91.80 89.93 93.88 0.21
SVM 88.28 91.69 83.94 2.10
KNN 85.06 86.11 83.72 0.36
XGboost 82.05 84.91 78.42 0.54

4.3. Wearable Diagnostic System Verification


In order to verify the reliability of the wearable apnea diagnosis system, 10 volunteers
were selected as subjects to wear both the smart ring and the Grael PSG 45 instrument
to collect data throughout the night’s sleep, and then the results were compared with
each other. The collected data came from the fittest finger with the largest contact area
between the skin and the sensor for both the devices. The ten volunteers were aged between
20–35 years old, some of them were apnea patients, and some were healthy subjects. The
pulse duration obtained was the same for both the instruments, and the SpO2 level was
similar to each other with a relative difference of SpO2 within ±2%, which meets the
requirements for sleep monitoring. The specific information is shown in Table 3. The
volunteers wore the Grael PSG 45 monitoring system for a night in a quiet and independent
room. After confirming that the sensors were well connected and the devices were in a
normal working state, the volunteers were instructed to sleep when collecting and storing
data until the subjects awakened. Then the same procedure was performed with the smart
ring system.
Biosensors 2023, 13, 483 15 of 18

Table 3. Basic information on 10 subjects.

Blood Oxygen Saturation NO of SAS


Age Height Weight
No. Gender Our Relative Determined by Determined by
(Years) (cm) (kg) PSG
System Error (%) the Hospital Our System
1 Male 23 176 60 99 99 0 56 50
2 Male 32 170 78 98 97 1.02 10 17
3 Male 28 169 68 98 98 0 11 5
4 Male 29 175 80 97 98 1.03 15 12
5 Female 48 163 63 97 97 0 81 80
6 Female 52 161 58 98 98 0 79 77
7 Male 47 173 81 97 98 1.03 68 64
8 Male 54 169 72 98 96 2.08 129 116
9 Female 23 159 55 99 98 1.01 12 7
10 Female 36 154 61 97 96 1.03 85 73
average 97.8 97.5 0.31

For the volunteers’ sleep status diagnosed by the smart ring system, we compared
the results with the judgements provided by medical experts. The comparison results are
summarized in Table 4. For the ten subjects: the number of apneas of the first subject was
judged to be 50 times by our wearable smart ring system, while it was judged to be 56 times
by the PSG monitoring expert. The diagnosis accuracy of the system was 86.73%, the
specificity was 85.42%, and the sensitivity was 87.42%, respectively. The second volunteer’s
apnea times were 17, judged by the smart ring system, while that was judged to be 10 times
by the PSG monitoring expert. The system’s accuracy rate was 87.25%, specificity was
90.63%, and sensitivity was 76.34%. The number of apneas in the third subject was 64,
according to the smart ring system, and 68 judged by the PSG monitoring expert. The
accuracy of our device was 82.25%, the specificity was 65.64%, and the sensitivity was
87.42%. The fourth subject was diagnosed as having apnea 12 times by the smart ring and
15 times by the PSG monitoring expert. Our device’s accuracy rate was 86.34%, specificity
was 89.65%, and sensitivity was 79.35%.

Table 4. Comparison of results obtained by system and medical experts.

Subject No. Accuracy (%) Specificity (%) Sensitivity (%)


1 86.73 85.42 87.42
2 87.25 90.63 76.34
3 82.25 65.64 87.42
4 86.34 89.65 79.35
5 89.39 83.47 88.01
6 84.98 83.91 87.11
7 81.87 76.33 86.91
8 85.97 89.25 81.21
9 87.03 81.96 85.23
10 88.08 89.52 80.82

The results of the smart ring system show that the accuracy, specificity and sensitivity
of our device are good for different volunteers, and the final detection results are more
accurate, which meets the basic standards of clinical apnea screening. It should be noted
Biosensors 2023, 13, 483 16 of 18

that the wearable smart ring costs less than USD 22; the precise cost of device components
and FPCB are listed in Table 5. By contrast, a standard polysomnography machine could
cost hundreds of thousands of dollars. The smart ring can be worn on the finger, and
the tests can be performed at home, which is a significant improvement over professional
polysomnography instrument-based testing. These could make the portable diagnosis of
SAS possible at an early stage.

Table 5. Cost of device components (basic elements include resistors and capacitors, etc.).

Component Names Number Cost ($)


MAX30102 1 1.78
CC2640R2F 1 2.24
TPS61099 1 0.63
KIA6206 1 0.71
SC662K 1 0.18
FPCB 1 14.78
Basic components / 0.71
3D print shell 1 1.44

5. Conclusions
A wearable, compact, low-cost, wireless apnea diagnosis device was proposed and
developed in this paper, and its feasibility was investigated in order to solve the problems
of complicated and expensive operation procedures for the clinical detection of sleep apnea,
which affects subjects’ sleep comfort and wellbeing.
A ring shape of the apnea diagnostic device can more conveniently monitor sleep by
wearing it on one’s finger without disturbing patients’ sleep. Physiological data can be
transferred wirelessly to a mobile phone or computer for examination. The gadget system’s
software generates a diagnostic model based on pulse and blood oxygen signals. It is not
only favorable to early detection of apnea, but it also improves the diagnostic rate and
reduces the sudden mortality rate. It also helps to minimize medical costs, according to
its strong prediction capacity and generalization ability. It is of significant scientific and
practical use to apply this technology in the diagnosis of apnea.
Although this study employing the smart ring and polysomnography instrument
model was undertaken for comparative analysis, the number of clinical tests was modest,
and the amount of data was small compared to the complexity of PSG monitoring. As a
result, in the next stage of collecting clinical data with the smart ring device, the system
hardware and software in the application must be improved and optimized on a regular
basis. We have applied the model to test the condition of sleep apnea, but we have not yet
defined the precise forms of sleep apnea in the patient, which will require more complex
classification in the future.

Author Contributions: Conceptualization: S.W. and D.C., Data curation, Y.G.; Investigation: S.W.,
D.C., Y.G. and W.X.; Methodology: S.W., D.C., Y.G. and S.X., Resources, W.X., J.C., S.D. and J.L.;
Software: S.W., D.C. and Y.G.; Validation: S.W., D.C. and Y.G.; Visualization, S.W., D.C. and Y.G.;
Writing—original draft, S.W., D.C., Y.G. and F.L. writing—review and editing: W.X., J.C., S.X., S.D.
and J.L. All authors have read and agreed to the published version of the manuscript.
Funding: This work was funded by the National Natural Science Foundation of China (No. 61827086,
61974037, 81971688), Zhejiang Province Key R & D programs (No. 2023C01192), NSFC-Zhejiang Joint
Fund for the Integration of Industrialization and information (No. U20A20172).
Biosensors 2023, 13, 483 17 of 18

Institutional Review Board Statement: The study was conducted in accordance with the Declaration
of Helsinki, and approved by the Institutional Review Board (or Ethics Committee) of the Forth
affiliated hospital of Zhejiang University school of medicine (protocol code K2021028 and date of
approval 3 March 2021).
Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.
Data Availability Statement: Data are available upon request by contacting the corresponding author.
Acknowledgments: The work was supported by the Fundamental Research Funds for the Provincial
Universities of Zhejiang.
Conflicts of Interest: The authors declare no conflict of interest.

References
1. Hiestand, D.M.; Britz, P.; Goldman, M.; Phillips, B. Prevalence of symptoms and risk of sleep apnea in the US population. Chest
2006, 130, 780–786. [CrossRef]
2. Lu, S.; Zhao, H.; Ju, K.; Shin, K.; Lee, M.; Shelley, K.; Chon, K.H. Can photoplethysmography variability serve as an alternative
approach to obtain heart rate variability information? J. Clin. Monit. Comput. 2008, 22, 23–29. [CrossRef] [PubMed]
3. Gil, E.; Orini, M.; Bailon, R.; Vergara, J.M.; Mainardi, L.; Laguna, P. Photoplethysmography pulse rate variability as a surrogate
measurement of heart rate variability during non-stationary conditions. Physiol. Meas. 2010, 31, 1271. [CrossRef]
4. Poh, M.-Z.; Swenson, N.C.; Picard, R.W. Motion-tolerant magnetic earring sensor and wireless earpiece for wearable photo-
plethysmography. IEEE Trans. Inf. Technol. Biomed. 2010, 14, 786–794. [CrossRef]
5. Ferber, R.; Millman, R.; Coppola, M.; Fleetham, J.; Friederich Murray, C.; Iber, C.; McCall, W.V.; Nino-Murcia, G.; Pressman, M.;
Sanders, M. Portable recording in the assessment of obstructive sleep apnea. Sleep 1994, 41, zsy134. [CrossRef] [PubMed]
6. Collop, N.A.; Anderson, W.M.; Boehlecke, B.; Claman, D.; Goldberg, R.; Gottlieb, D.J.; Hudgel, D.; Sateia, M.; Schwab, R. Clinical
guidelines for the use of unattended portable monitors in the diagnosis of obstructive sleep apnea in adult patients. J. Clin. Sleep
Med. 2007, 3, 737–747. [PubMed]
7. Yildirim, O.; Baloglu, U.B.; Acharya, U.R. A deep learning model for automated sleep stages classification using PSG signals. Int.
J. Environ. Res. Public Health 2019, 16, 599. [CrossRef]
8. Norman, M.B.; Pithers, S.M.; Teng, A.Y.; Waters, K.A.; Sullivan, C.E. Validation of the sonomat against PSG and quantitative
measurement of partial upper airway obstruction in children with sleep-disordered breathing. Sleep 2017, 40, zsx017. [CrossRef]
[PubMed]
9. Fallmann, S.; Chen, L. Computational sleep behavior analysis: A survey. IEEE Access 2019, 7, 142421–142440. [CrossRef]
10. Crivello, A.; Barsocchi, P.; Girolami, M.; Palumbo, F. The meaning of sleep quality: A survey of available technologies. IEEE
Access 2019, 7, 167374–167390. [CrossRef]
11. Cosoli, G.; Spinsante, S.; Scalise, L. Wrist-worn and chest-strap wearable devices: Systematic review on accuracy and metrological
characteristics. Measurement 2020, 159, 107789. [CrossRef]
12. Puranik, S.; Morales, A.W. Heart rate estimation of PPG signals with simultaneous accelerometry using adaptive neural network
filtering. IEEE Trans. Consum. Electron. 2019, 66, 69–76. [CrossRef]
13. Schnelle, J.F.; Alessi, C.A.; Al-Samarrai, N.R.; Fricker, R.D., Jr.; Ouslander, J.G. The nursing home at night: Effects of an intervention
on noise, light, and sleep. J. Am. Geriatr. Soc. 1999, 47, 430–438. [CrossRef] [PubMed]
14. Kinnunen, H.; Rantanen, A.; Kenttä, T.; Koskimäki, H. Feasible assessment of recovery and cardiovascular health: Accuracy of
nocturnal HR and HRV assessed via ring PPG in comparison to medical grade ECG. Physiol. Meas. 2020, 41, 04NT01. [CrossRef]
15. Lee, S.; Kim, D. Effect of color light stimulation using LED on sleep induction time. J. Healthc. Eng. 2017, 2017, 6030268. [CrossRef]
[PubMed]
16. Al-Naggar, N.Q.; Al-Hammadi, H.M.; Al-Fusail, A.M.; Al-Shaebi, Z.A. Design of a remote real-time monitoring system for
multiple physiological parameters based on smartphone. J. Healthc. Eng. 2019, 2019, 5674673. [CrossRef] [PubMed]
17. Hayano, J.; Barros, A.K.; Kamiya, A.; Ohte, N.; Yasuma, F. Assessment of pulse rate variability by the method of pulse frequency
demodulation. Biomed. Eng. Online 2005, 4, 1–12. [CrossRef]
18. Hayano, J.; Yamamoto, H.; Nonaka, I.; Komazawa, M.; Itao, K.; Ueda, N.; Tanaka, H.; Yuda, E. Quantitative detection of sleep
apnea with wearable watch device. PLoS ONE 2020, 15, e0237279. [CrossRef] [PubMed]
19. Wu, S.; Chen, M.; Wei, K.; Liu, G. Sleep apnea screening based on Photoplethysmography data from wearable bracelets using an
information-based similarity approach. Comput. Methods Programs Biomed. 2021, 211, 106442. [CrossRef] [PubMed]
20. Selvakumar, K.; Vinodh Kumar, E.; Sailesh, M.; Varun, M.; Allan, A.; Biswajit, N.; Namrata, P.; Upasana, S. Realtime PPG based
respiration rate estimation for remote health monitoring applications. Biomed. Signal Process. Control. 2022, 77, 103746. [CrossRef]
21. Deviaene, M.; Lázaro, J.; Huysmans, D.; Testelmans, D.; Buyse, B.; Huffel, S.V.; Varon, C. Sleep Apnea Detection Using Pulse
Photoplethysmography. Comput. Cardiol. Conf. (CinC) 2018, 45, 1–4.
22. Dey, D.; Chaudhuri, S.; Munshi, S. Obstructive sleep apnoea detection using convolutional neural network based deep learning
framework. Biomed. Eng. Lett. 2018, 8, 95–100.
Biosensors 2023, 13, 483 18 of 18

23. Lazazzera, R.; Deviaene, M.; Varon, C.; Buyse, B.; Testelmans, D.; Laguna, P.; Gil, E.; Carrault, G. Detection and Classification of
Sleep Apnea and Hypopnea Using PPG and SpO2 Signals. IEEE Trans. Biomed. Eng. 2021, 68, 1496–1506.
24. Wei, K.; Zou, L.; Liu, G.; Wang, C. Sleep apnea detection in PPG using multi-scale block and shadow module one-dimensional
convolutional neural network. Comput. Biol. Med. 2023, 155, 106469. [CrossRef] [PubMed]
25. Yin, C.; Udrescu, M.; Gupta, G.; Cheng, M.; Lihu, A.; Udrescu, L.; Bogdan, P.; Mannino, D.M.; Mihaicuta, S. Fractional Dynamics
Foster Deep Learning of COPD Stage Prediction. Adv. Sci. 2023, 2023, 2203485. [CrossRef] [PubMed]
26. Massie, F.; Vits, S.; Khachatryan, A.; Pee, B.V.; Verbraecken, J.; Bergmann, J. Central Sleep Apnea Detection by Means of Finger
Photoplethysmography. IEEE J. Transl. Eng. Health Med. 2023, 11, 126–136. [CrossRef] [PubMed]
27. Morillo, D.S.; Ojeda, J.L.R.; Foix, L.F.C.; Jiménez, A.L. An Accelerometer-Based Device for Sleep Apnea Screening. IEEE
Transactions on Information Technology in Biomedicine. 2010, 14, 491–499. [CrossRef] [PubMed]
28. Mendonça, F.; Mostafa, S.S.; Morgado-Dias, F.; Ravelo-García, A.G. An oximetry based wireless device for sleep apnea detection.
Sensors 2020, 20, 888. [CrossRef] [PubMed]
29. Costa, M.; Peng, C.K.; Goldberger, A.L.; Hausdorff, J.M. Multiscale entropy analysis of human gait dynamics. Phys. A Stat. Mech.
Its Appl. 2003, 330, 53–60. [CrossRef] [PubMed]
30. Wang, J.; Ning, X.; Ma, Q.; Bian, C.; Xu, Y.; Chen, Y. Multiscale multifractality analysis of a 12-lead electrocardiogram. Physical
Review E 2005, 71, 062902. [CrossRef] [PubMed]
31. Faust, O.; Barika, R.; Shenfield, A.; Ciaccio, E.J.; Acharya, U.R. Accurate detection of sleep apnea with long short-term memory
network based on RR interval signals. Knowl. -Based Syst. 2021, 212, 106591. [CrossRef]
32. Ichimaru, Y.; Moody, G.B. Development of the polysomnographic database on CD-ROM. Psychiatry Clin. Neurosci. 1999, 53,
175–177. [CrossRef] [PubMed]
33. Goldberger, A.L.; Amaral, L.A.N.; 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]
34. Breiman, L. Bagging predictors. Mach. Learn. 1996, 24, 123–140. [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