Detection Performance Regarding Sleep Apnea-Hypopnea Episodes with Fuzzy Logic Fusion on Single-Channel Airﬂow Indexes

: Obstructive sleep apnea-hypopnea syndrome (OSAHS) a ﬀ ects more than 936 million people worldwide and is the most common sleep-related breathing disorder; almost 80% of potential patients remain undiagnosed. To treat moderate to severe OSAHS as early as possible, the use of fewer sensing channels is recommended to screen for OSAHS and shorten waiting lists for the gold standard polysomnography (PSG). Hence, an e ﬀ ective out-of-clinic detection method may provide a solution to hospital overburden and associated health care costs. Applying single-channel signals to simultaneously detect apnea and hypopnea remains challenging. Among the various physiological signals used for sleep apnea-hypopnea detection, respiratory signals are relatively easy to apply. In this study, a fusion method using fuzzy logic and two single-channel respiratory indexes was proposed. A total of 12,391 apnea or hypopnea episodes were included. The proposed algorithm successfully fused standard deviation of airﬂow signals (SDA) and amplitude changes of peaks (ACP) indexes to detect apnea-hypopnea events, with overall sensitivity of 74%, speciﬁcity of 100%, and accuracy of 80% for mild to moderate OSAHS. For di ﬀ erent apnea-hypopnea severity levels, the results indicated that the algorithm is superior to other methods; it also provides risk scores as percentages, which are especially accurate for mild hypopnea. The algorithm may provide rapid screening for early diagnosis and treatment.


Introduction
Obstructive sleep apnea-hypopnea syndrome (OSAHS) is a major public health concern characterized by recurrence of airflow reduction (hypopnea) or cessation (apnea) due to upper

Participants
A total of 60 participants with snoring or suspected OSAHS who were arranged for PSG diagnosis between January 2017 and December 2018 were retrospectively enrolled. Enrolment criteria were as follows: age of 20-80 years, conscious, and literate. Subjects were excluded if they had a diagnosis of tuberculosis or major mental illness. Other vulnerable groups (i.e., minors, pregnant women, and indigenous people) were also excluded. Participants were therefore stratified, sampling the subjects with AHI value for our study. The study was approved by the Taichung Veterans General Hospital Institutional Review Board and Ethics Committee (Approval Number: CE19126A).

Physiological Parameters
Sleep-related parameters were collected from the records of a standard PSG (Sandman Elite, Nellcor Puritan Bennett Ltd., Kanata, ON, Canada) and scored by a well-trained medical technologist. After sleep stages were confirmed, apnea and hypopnea were defined as the complete cessation of airflow in the thermocouple for over 10 s or a 30% reduction of breathing in the nasal cannula for over 10 s, accompanied with an arousal or a 4% decrease in SpO 2 [27]. AHI scores were determined by apnea-hypopnea episodes per hour. Participants with more apnea than hypopnea episodes were entered into the apnea-dominant group; otherwise, they were placed in the hypopnea-dominant group. The raw airflow data generated from an oronasal thermal (Th) sensor were exported for analysis with the proposed algorithm to predict AHI.

Statistical Analysis
All data were expressed as mean and standard deviation (SD) for continuous variables or numbers (percentages) for categorical variables. Detection accuracy (Ac), Sn, and Sp for all participants were computed according to the severity of OSAHS on the basis of ACP thresholds. Following the PSG diagnosis, an AHI over the severity threshold was defined as a true positive, and an AHI under the threshold was defined as a true negative. Ac was represented by the ratio of the total number of correct classifications over the total number of subjects. Sn was represented by the ratio of the number of positive measurements over the number of counts of true positives, and Sp was represented by the ratio of the number of negative measurements over the number of true negatives. Statistical significance was set at p < 0.05. Statistical analysis was performed using SPSS version 18.0 (SPSS Inc., Chicago, IL, USA).

Methods
The proposed apnea/hypopnea detection algorithm involved using the oronasal thermal airflow signals with a sampling rate of 51.2 Hz, including annotations by clinicians ( Figure 1). The algorithm scans airflow signals by applying a windowing function, W: where rect represents a rectangular pulse − T 2 < t < T 2 and T is 130 s. Generally, in apnea/hypopnea episodes, the drop in blood oxygen level lasts from 10 s to 1 min or even longer [28,29]. Due to the fact that apnea/hypopnea events can last as long as 120 s [30], a 130 s window frame is an appropriate choice for clear observation of apnea/hypopnea episodes [25,[30][31][32]. The observing window frame shifts 5 s each time as W(t − 5n), n ∈ Z. Next, it finds all the peaks of airflow signals within a 130 s window. Then, fuzzy logic is applied to compute the risk scores by fusing the SD of airflow signals (SDAs) and ACP [25] indexes. The AHI value is determined according to risk scores. The details of each block are as follows.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 4 of 12 (SDAs) and ACP [25] indexes. The AHI value is determined according to risk scores. The details of each block are as follows.

Find Peaks
Within the windowing function, a fourth-order Butterworth filter was applied for noise cancellation. Then, the first derivative was used to find local maximum peaks, representing the end of exhalation processes. The intervals between two adjacent peak points indicate a complete breath cycle. However, the cycles stop when breathing stops. Each amplitude of peaks within W(t) is stored to generate additional indexes, including ACP [25] and SDA indexes. The window W(t) is shifted every 5 s, and the indexes are updated with each shift. The methods used to compute the ACP and SDP indexes are described as follows.

ACP Indexes
Through the use of a respiration signal to detect apneas, Kim's method provides better overall sensitivity, specificity [25], and accuracy than those of Vàrady et al. [33] and Fontenla-Romero et al. [34]. However, Kim's method was developed using 20 individuals from a population with severe OSAHS, so it is not suitable for use with healthy populations and those with mild and moderate OSAHS. Their algorithm computes ACP indexes, so-called Pc, to detect events. It is summarized as follows.
The ACP method first separates 130 s into two window frames: a 120 s window as a baseline window (Wp) and a 10 s window as a metric window (Wm). The baseline values ( and ) of the Wp and Wm are first computed using the following formulas: where is the number of peaks, excluding peak widths of less than 0.9375 s; the top 45% of amplitudes are taken from the sorted peak list within Wp; where is the number of peaks and is the amplitude of the jth peak within Wm; the ACP indexes for apnea detection are then expressed as

Find Peaks
Within the windowing function, a fourth-order Butterworth filter was applied for noise cancellation. Then, the first derivative was used to find local maximum peaks, representing the end of exhalation processes. The intervals between two adjacent peak points indicate a complete breath cycle. However, the cycles stop when breathing stops. Each amplitude of peaks within W(t) is stored to generate additional indexes, including ACP [25] and SDA indexes. The window W(t) is shifted every 5 s, and the indexes are updated with each shift. The methods used to compute the ACP and SDP indexes are described as follows.

ACP Indexes
Through the use of a respiration signal to detect apneas, Kim's method provides better overall sensitivity, specificity [25], and accuracy than those of Vàrady et al. [33] and Fontenla-Romero et al. [34]. However, Kim's method was developed using 20 individuals from a population with severe OSAHS, so it is not suitable for use with healthy populations and those with mild and moderate OSAHS. Their algorithm computes ACP indexes, so-called Pc, to detect events. It is summarized as follows.
The ACP method first separates 130 s into two window frames: a 120 s window as a baseline window (Wp) and a 10 s window as a metric window (Wm). The baseline values (Bw p and Bw m ) of the Wp and Wm are first computed using the following formulas: where L f is the number of peaks, excluding peak widths of less than 0.9375 s; the top 45% of amplitudes P i are taken from the sorted peak list within Wp; where L p is the number of peaks and P j is the amplitude of the jth peak within Wm; the ACP indexes for apnea detection are then expressed as In Kim's method, when Pc is larger than the suggested threshold (equal to 0.55), the apnea event is identified.

SDA Indexes with Dynamic Threshold
Higher Pc values provide higher sensitivity to apnea/hypopnea events. However, the imperfect nature of human respiration signals creates Pc values with high false alarm rates in healthy patients and those with mild apnea-hypopnea. Hence, our proposed SDA indexes are designed to balance Pc values to provide a more robust fusion system for distinguishing apnea-hypopnea events. Normal breath cycles are stable because inhalation and exhalation patterns are regular. The SD of amplitudes is applied to quantize the stability. Unlike Pc values, the SDA indexes are computed using the entire 130 s window.
Without the identification of cycle peaks, the proposed algorithm is applied on the whole airflow signal x i in the window (Wp plus Wm), where i = 1 . . . N, and N is equal to sampling frequency times 130 s. The SDA indexes are obtained as follows: where x is the average value of sample points of the x vector. The SDA index is updated every 5 s, described as W(t − 5n), n ∈ Z. Due to variant breath patterns in patients, a dynamic threshold is necessary as a baseline to classify the SDA risk level: where n represents the current window time, and Th changes dynamically when W(t) updates. If SDA indexes are higher than the dynamic threshold, the risk of apnea is lower; if they are lower than the dynamic threshold, the risk is higher. Hence, when a patient breathes normally, the SDA index stays in a certain range, and when breathing stops the deviation should be close to zero.

Fuzzy Logic Fusion Method and Decision Making
The proposed fusion method provides the AHI risk score as a percentage for each moving window by combining the ACP and SDA indexes. All ACP and SDA values are mapped to the percentage scale from 0 to 1. The center values for ACP and SDA indexes are 0.55 and Threshold(n), and the ranges are (0.4, 0.7) and (0.75*Threshold(n), 1.25*Threshold(n)), respectively. The fuzzy logic of the mapping relationship is illustrated in Figure 2.
lues to provide a more robust fusion system for distinguishing apnea-hypopnea events. Norm eath cycles are stable because inhalation and exhalation patterns are regular. The SD of amplitud applied to quantize the stability. Unlike Pc values, the SDA indexes are computed using the enti 0 s window.
Without the identification of cycle peaks, the proposed algorithm is applied on the whole airflo gnal in the window (Wp plus Wm), where i = 1…N, and N is equal to sampling frequency tim 0 s. The SDA indexes are obtained as follows: here ̅ is the average value of sample points of the x vector. The SDA index is updated every 5 scribed as W(t − 5n), n ∈ Z. Due to variant breath patterns in patients, a dynamic threshold cessary as a baseline to classify the SDA risk level: Threshold(n + 2) = Threshold(n + 1) * 0.75 + Threshold(n) * 0.25 (7 here n represents the current window time, and Th changes dynamically when W(t) updates. A indexes are higher than the dynamic threshold, the risk of apnea is lower; if they are lower tha e dynamic threshold, the risk is higher. Hence, when a patient breathes normally, the SDA ind ays in a certain range, and when breathing stops the deviation should be close to zero.

Fuzzy Logic Fusion Method and Decision Making
The proposed fusion method provides the AHI risk score as a percentage for each movin indow by combining the ACP and SDA indexes. All ACP and SDA values are mapped to th rcentage scale from 0 to 1. The center values for ACP and SDA indexes are 0.55 and Threshold(n d the ranges are (0.4, 0.7) and (0.75*Threshold(n), 1.25*Threshold(n)), respectively. The fuzzy log the mapping relationship is illustrated in Figure 2.   After mapping, the AHI risk score can be computed using the following formula, which changes over time: Risk The optimal values of the F c parameters are addressed in a subsequent section. If the maximum risk score reaches 80% in the observation window, the window is marked as an AHI event. Figure 3 represents a signal channel airflow waveform with ACP and SDA values/ranges and details how the AHI-related event is identified.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 6 of 12 After mapping, the AHI risk score can be computed using the following formula, which changes over time: The optimal values of the parameters are addressed in a subsequent section. If the maximum risk score reaches 80% in the observation window, the window is marked as an AHI event. Figure 3 represents a signal channel airflow waveform with ACP and SDA values/ranges and details how the AHI-related event is identified. Notably, our method is independent from signal DC shift and its absolute values of amplitudes. The dynamic threshold is designed to adapt to different breathing patterns without prior knowledge, so the algorithm is robust for variant patterns and peak amplitudes and can be applied on sensors with different voltage levels.

Results
A total of 60 participants, most of whom were male (N = 57, 95%), were enrolled. The age of the participants was 45.2 ± 12.2 years, and the AHI score was 40.8 ± 31.8 ( Table 1). The body mass index, neck circumference, and waist circumference were 29.7 ± 6.3 kg/m 2 , 40.0 ± 3.8 cm, and 100.1 ± 11.4 cm, respectively. Apnea and hypopnea indexes were 21.5 ± 26.3 and 19.3 ± 15.2, respectively. There were a total of 12,391 episodes, with apnea events of 6445 and hypopnea events of 5946. Figure 3 offers a standard example to describe the warming and no-warming situations. The top plot depicts a single channel airflow waveform containing two apnea events; the middle plot depicts ACP index curves and two horizontal thresholds (dashed lines), which is updated every 5 s; and the bottom plot depicts SDA index curves and two horizontal thresholds (dashed lines), also updated every 5 s. In the AHI warning areas, the fuzzy combination risk of ACP and SDA was over 80% with weights Fc and 1-Fc (Equation (7)), respectively. However, in the center of the no warning area, the high ACP indexes were balanced out by SDA indexes in our algorithm, because SDA provides the variation of airflow signals and ACP. The ACP is sensitive to slight changes in the amplitude of peaks, which may be influenced by noise and unstable breath patterns. By contrast, the SDA with dynamic threshold better distinguishes quiet and active breathing patterns.  Notably, our method is independent from signal DC shift and its absolute values of amplitudes. The dynamic threshold is designed to adapt to different breathing patterns without prior knowledge, so the algorithm is robust for variant patterns and peak amplitudes and can be applied on sensors with different voltage levels.

Results
A total of 60 participants, most of whom were male (N = 57, 95%), were enrolled. The age of the participants was 45.2 ± 12.2 years, and the AHI score was 40.8 ± 31.8 ( Table 1). The body mass index, neck circumference, and waist circumference were 29.7 ± 6.3 kg/m 2 , 40.0 ± 3.8 cm, and 100.1 ± 11.4 cm, respectively. Apnea and hypopnea indexes were 21.5 ± 26.3 and 19.3 ± 15.2, respectively. There were a total of 12,391 episodes, with apnea events of 6445 and hypopnea events of 5946. Figure 3 offers a standard example to describe the warming and no-warming situations. The top plot depicts a single channel airflow waveform containing two apnea events; the middle plot depicts ACP index curves and two horizontal thresholds (dashed lines), which is updated every 5 s; and the bottom plot depicts SDA index curves and two horizontal thresholds (dashed lines), also updated every 5 s. In the AHI warning areas, the fuzzy combination risk of ACP and SDA was over 80% with weights Fc and 1-Fc (Equation (7)), respectively. However, in the center of the no warning area, the high ACP indexes were balanced out by SDA indexes in our algorithm, because SDA provides the variation of airflow signals and ACP. The ACP is sensitive to slight changes in the amplitude of peaks, which may be influenced by noise and unstable breath patterns. By contrast, the SDA with dynamic threshold better distinguishes quiet and active breathing patterns. The results revealed that a lower Fc value was related to a lower AHI value, whereas a higher Fc value coincided with a higher AHI value ( Table 2). When Fc was at 40%, the predicted value was 25.7 ± 20.7, and the difference to AHI was −15.2 ± 17.7; when Fc was at 100%, predicted and difference values were 75.3 ± 19.1 and 34.4 ± 36.8, respectively. Detection values presented two extremes with the Fc filter. Noticeably, when Fc was between 50% and 70%, the detection difference was relatively small. As applied for determining OSAHS severity, Sp could not classify normal breathing or OSAHS of any severity with any Fc (Table 3). However, Sn and Sp were 74% and 100%, respectively, at the AHI threshold of >15, and 71% and 97% for the detection of severe OSAHS (AHI ≥ 30) with Fc at 50% (Table 3). Although the detection performances of Fc at 60% or 70% were almost the same as Fc at 50%, Sp was 0% for an AHI of >15 among apnea-dominant participants ( Table 4). As a result, Fc at 50% offered optimal airflow detection for mild to severe OSAHS. However, Sn of 54% and Sp of 100% were observed for an AHI of >15 and Sn of 38% and Sp of 100% were detected for an AHI of ≥30 among hypopnea-dominant participants ( Table 5). The results indicate that a higher Fc resulted in a higher Sn and lower Sp for OSAHS of any severity (Figure 4).

Discussion
In this research, a method was designed to analyze airflow signals for scoring apnea and hypopnea. According to the results, if only ACP (Fc = 1) is applied, the system provides considerably high sensitivity and low specificity, especially in patients with hypopnea. If SDA (Fc = 0) is applied, Detection results of all subjects by sensitivity and specificity plots listed as: (a) description of overall performance of all subjects; (b) description detection performance of subjects with apnea-dominant episodes; (c) description detection performance of subjects with hypopnea-dominant episodes.

Discussion
In this research, a method was designed to analyze airflow signals for scoring apnea and hypopnea. According to the results, if only ACP (Fc = 1) is applied, the system provides considerably high sensitivity and low specificity, especially in patients with hypopnea. If SDA (Fc = 0) is applied, the system is highly influenced by noise such as body movement or sensor drops. As Figure 5 indicates, the dynamic threshold moves up when noise occurs, and this causes false alarms. Hence, using pure ACP (Fc = 1) or SDA (1−Fc = 0) may not be the correct decision, even with similar AHI numbers; 50% ACP and 50% SDA can provide the most reliable performances for scoring apnea and hypopnea when considering sensitivity, specificity, and accuracy. By contrast, pure SDA (Fc = 1) may be influenced by noise caused by leads being dropped or body movements, suddenly changing the dynamic threshold. Moreover, this method can be used with an embedded real-time system because it effectively reduces computational power requirements by focusing on time-domain features within 130 s window frames, requiring less signal processing in feature extraction, applying a dynamic threshold to adapt to real-time signal changes, and, most importantly, shortening the time required to build a fuzzy logic model without a training process. Reports have indicated that portable monitors measuring three or more physiological parameters (level 3 and level 2 monitoring) offer accurate results in comparison with laboratory results [35][36][37][38][39]. Due to the fact that discomfort and inconvenience are barriers to the prevalence of PSG among the public, a single-channel airflow signal is one of the most applicable solutions for real-time monitoring [32,37,38].
Appl. Sci. 2020, 10, x FOR PEER REVIEW 9 of 12 the system is highly influenced by noise such as body movement or sensor drops. As Figure 5 indicates, the dynamic threshold moves up when noise occurs, and this causes false alarms. Hence, using pure ACP (Fc = 1) or SDA (1−Fc = 0) may not be the correct decision, even with similar AHI numbers; 50% ACP and 50% SDA can provide the most reliable performances for scoring apnea and hypopnea when considering sensitivity, specificity, and accuracy. By contrast, pure SDA (Fc = 1) may be influenced by noise caused by leads being dropped or body movements, suddenly changing the dynamic threshold. Moreover, this method can be used with an embedded real-time system because it effectively reduces computational power requirements by focusing on time-domain features within 130 s window frames, requiring less signal processing in feature extraction, applying a dynamic threshold to adapt to real-time signal changes, and, most importantly, shortening the time required to build a fuzzy logic model without a training process. Reports have indicated that portable monitors measuring three or more physiological parameters (level 3 and level 2 monitoring) offer accurate results in comparison with laboratory results [35][36][37][38][39]. Due to the fact that discomfort and inconvenience are barriers to the prevalence of PSG among the public, a single-channel airflow signal is one of the most applicable solutions for real-time monitoring [32,37,38]. OSAHS has serious and life-shortening consequences including cardiovascular disease, diabetes, poor quality of life, depression, and automobile accidents caused by falling asleep [39]. However, waiting times for PSG diagnosis in the United States and United Kingdom were estimated to be 2-10 and 7-60 months, respectively [40]. A study reported a median waiting time of 152 days in 2009 to 92 days in 2012 (p < 0.0001) by home based PM [41]. A reliable PM may be used for general population screening as a result. Our study provides an airflow sensing algorithm with overall sensitivity of 74%, specificity of 100%, and accuracy of 80.0% for mild to moderate OSAHS. If the airflow in the PM screening of a patient represents an AHI of >15, the physician could preferentially arrange a PSG follow-up. Moreover, when applied to the airflow sensed by an oronasal thermal sensor under the mask, our algorithm may provide an accuracy of 85% and therefore assist with determining patients with an AHI >5 and conducting PAP titration. However, the main limitation of the proposed system is that when fc = 0.5, it has low sensitivities of 54% and 38% at the thresholds of   OSAHS has serious and life-shortening consequences including cardiovascular disease, diabetes, poor quality of life, depression, and automobile accidents caused by falling asleep [39]. However, waiting times for PSG diagnosis in the United States and United Kingdom were estimated to be 2-10 and 7-60 months, respectively [40]. A study reported a median waiting time of 152 days in 2009 to 92 days in 2012 (p < 0.0001) by home based PM [41]. A reliable PM may be used for general population screening as a result. Our study provides an airflow sensing algorithm with overall sensitivity of 74%, specificity of 100%, and accuracy of 80.0% for mild to moderate OSAHS. If the airflow in the PM screening of a patient represents an AHI of >15, the physician could preferentially arrange a PSG follow-up. Moreover, when applied to the airflow sensed by an oronasal thermal sensor under the mask, our algorithm may provide an accuracy of 85% and therefore assist with determining patients with an AHI >5 and conducting PAP titration. However, the main limitation of the proposed system is that when fc = 0.5, it has low sensitivities of 54% and 38% at the thresholds of AHI >15 and AHI ≥30 among hypopnea-dominant individuals, respectively. We suggest if patients are tested as normal by this method, but combined with snoring and daytime lethargy, physicians should further confirm with their PSG results. The characteristics of the proposed detection method are summarized in Table 6. Dynamic threshold is applied to adapt to real-time signal changes. 5.

Detection of Sleep Apnoea
Fuzzy logic model without training. 6.
Specificity of 100% and accuracy of 80% for mild to moderate OSAHS.

2.
System sensitivity can be improved; PSG should be used for normal patients with snoring and daytime lethargy.

3.
Dynamic threshold of SDA increases because of noise from movement, causing a false alarm.

Conclusions
The study proposed an algorithm using 50% ACP and 50% SDA that can provide optimal performance for scoring apnea and hypopnea episodes. It provided an overall sensitivity of 74%, a specificity of 100%, and an accuracy of 80.0% for mild to moderate OSAHS. The method potentially provides fast screening for early diagnosis and treatment and can be applied on an embedded real-time system for portable monitoring as a reference for PAP titration with an accuracy of 85% when determining AHI >5. In the future, system sensitivity should be further improved, especially for hypopnea-dominant individuals with AHI >15. Sensor or data fusion, signal transformation, decision trees, and deep learning methods are promising approaches to increasing system sensitivity.