scieee AI-readable full text Open interactive document viewer

A 2D convolutional neural network to detect sleep apnea in children using airflow and oximetry

Jimenez García, Jorge,García, María,Gutierrez Tobal, Gonzalo César,Kheirandish Gozal, Leila,Vaquerizo Villar, Fernando,Álvarez González, Daniel,Campo Matias, Félix del,Gozal, David,Hornero Sánchez, Roberto

Abstract

Producción Científica

Full text

Computers in Biology and Medicine 147 (2022) 105784 Available online 28 June 2022 0010-4825/© 2022 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/bync-nd/4.0/). A 2D convolutional neural network to detect sleep apnea in children using airflow and oximetry Jorge Jim´ enez-García a , b , * , María García a , b , Gonzalo C. Guti´ errez-Tobal a , b , Leila Kheirandish-Gozal c , Fernando Vaquerizo-Villar a , b , Daniel ´ Alvarez a , b , d , F´ elix del Campo a , b , d , David Gozal c , e , Roberto Hornero a , b a Biomedical Engineering Group, University of Valladolid, Valladolid, Spain b CIBER-BBN, Centro de Investigaci´ on Biom´ edica en Red en Bioingeniería, Biomateriales y Nanomedicina, Instituto de Salud Carlos III, Valladolid, Spain c Department of Child Health and Child Health Research Institute, The University of Missouri School of Medicine, Columbia, MO, USA d Sleep-Ventilation Unit, Pneumology Department, Río Hortega University Hospital, Valladolid, Spain e Department of Medical Pharmacology and Physiology, The University of Missouri School of Medicine, Columbia, MO, USA ARTICLE INFO Keywords: Obstructive sleep apnea Children Airflow Oximetry Convolutional neural network Deep learning ABSTRACT The gold standard approach to diagnose obstructive sleep apnea (OSA) in children is overnight in-lab polysomnography (PSG), which is labor-intensive for clinicians and onerous to healthcare systems and families. Simplification of PSG should enhance availability and comfort, and reduce complexity and waitlists. Airflow (AF) and oximetry (SpO 2 ) signals summarize most of the information needed to detect apneas and hypopneas, but automatic analysis of these signals using deep-learning algorithms has not been extensively investigated in the pediatric context. The aim of this study was to evaluate a convolutional neural network (CNN) architecture based on these two signals to estimate the severity of pediatric OSA. PSG-derived AF and SpO 2 signals from the Childhood Adenotonsillectomy Trial (CHAT) database (1638 recordings), as well as from a clinical database (974 recordings), were analyzed. A 2D CNN fed with AF and SpO 2 signals was implemented to estimate the number of apneic events, and the total apnea-hypopnea index (AHI) was estimated. A training-validation-test strategy was used to train the CNN, adjust the hyperparameters, and assess the diagnostic ability of the algorithm, respectively. Classification into four OSA severity levels (no OSA, mild, moderate, or severe) reached 4-class accuracy and Cohen’s Kappa of 72.55% and 0.6011 in the CHAT test set, and 61.79% and 0.4469 in the clinical dataset, respectively. Binary classification accuracy using AHI cutoffs 1, 5 and 10 events/h ranged between 84.64% and 94.44% in CHAT, and 84.10%–90.26% in the clinical database. The proposed CNN-based architecture achieved high diagnostic ability in two independent databases, outperforming previous approaches that employed SpO 2 signals alone, or other classical feature-engineering approaches. Therefore, analysis of AF and SpO 2 signals using deep learning can be useful to deploy reliable computer-aided diagnostic tools for childhood OSA. 1. Introduction Obstructive Sleep Apnea (OSA) syndrome is a common sleep disorder in which the increased resistance within the upper airway induces decreases and cessation of respiratory airflow during sleep [1,2]. When OSA affects children and remains untreated, several negative consequences arise, including neurocognitive and behavioral deficits, and cardiovascular and metabolic morbidities [2]. The prevalence of OSA ranges between approximately 1-5% in the pediatric population, and it is likely that many additional cases remain undiagnosed due to the lack of resources and extensive waitlists in sleep laboratories [1]. The standard approach to diagnose OSA consist in overnight in-lab polysomnography (PSG) testing, a complex multichannel recording during which sleep stages are characterized, and cardiorespiratory and other physiological parameters are concurrently measured [1,3]. These signals are subsequently analyzed, and the number of respiratory flow interruptions (apnea) and airflow reductions (hypopnea) during sleep is computed to provide an estimate of the disease severity if such is present * Corresponding author. Biomedical Engineering Group, E.T.S. Ingenieros de Telecomunicaci´ on, Universidad de Valladolid, Campus Miguel Delibes, Paseo Bel´ en 15, 47011, Valladolid, Spain. E-mail address: [email protected] (J. Jim´ enez-García). Contents lists available at ScienceDirect Computers in Biology and Medicine journal homepage: www.elsevier.com/locate/compbiomed https://doi.org/10.1016/j.compbiomed.2022.105784 Received 12 January 2022; Received in revised form 19 April 2022; Accepted 26 June 2022 Computers in Biology and Medicine 147 (2022) 105784 2 [3]. When evaluating children, the American Academy of Sleep Medicine (AASM) guidelines define apneas as a decrease ≥90% in the airflow (AF) signal during at least two respiratory cycles, while hypopneas are defined as a decrease ≥30% in AF accompanied by a reduction of at least 3% in the blood oxygen saturation (SpO 2 ) signal or an electroencephalographic arousal [3]. The severity of OSA is primarily determined by the Apnea Hypopnea Index (AHI), which is the rate of apnea and hypopnea events per hour of sleep (e/h). Despite the fact that the PSG is the preferred and gold standard diagnostic method in children with symptoms suggestive of OSA, simpler alternatives like nocturnal oximetry and respiratory polygraphy have been proposed to simplify the assessments and to reduce costs [4–6]. These alternatives mainly focus on AF and/or SpO 2 signals, which provide the most relevant information to detect respiratory events and the associated oxyhemoglobin desaturations [7]. In addition, the analysis of cardiorespiratory signals to automatically detect pediatric OSA using feature-engineering approaches has gained relevance and popularity in the last several years [7,8]. Most of these approaches have assessed AF, SpO 2 , electrocardiogram (ECG), pulse rate variability (PRV), and heart rate variability (HRV) signals among others, and applied temporal, spectral, and nonlinear methods to objectively quantify and characterize them while deriving their unique and distinguishable characteristics in the context of OSA. Typically, these analyses were then followed by application of a variety of machine-learning (ML) algorithms to enable detection of OSA severity [8]. Classical ML algorithms encompassed logistic regression [9–13], ensemble learning [10, 14], and neural networks [15–19]. However, the latest approaches such as deep learning (DL) have been scarcely investigated in the context of childhood OSA despite their successful application in the adult population [8,20,21]. Feature-engineering approaches require an exhaustive characterization of the signals to obtain relevant features, whereas DL methods automatically extract the relevant contextual information from the signals to detect OSA [21]. DL applications in adult OSA primarily focused on the analysis of ECG, SpO 2 , and AF signals [21]. Convolutional neural networks (CNN), recurrent neural networks (RNN), and a combination of CNN and RNN have been primarily used to detect OSA using the ECG signal [22–24]. In addition, spectrograms and scalograms obtained from the ECG were used to evaluate bidimensional (2D) CNN models [22,25]. Other approaches encompassed the analysis of HRV and ECG-derived respiration using deep architectures [26]. Regarding respiration signals, CNN and RNN-based approaches have been also investigated using oronasal AF or thoracic/abdominal sensors [27–32]. The SpO 2 signal has been employed to detect OSA by means of deep neural networks (DNN) [33] and CNNs [34–36]. In the same regard, other studies combined AF and SpO 2 signals using these DL algorithms [37,38]. These DL-based methodologies have been developed and tested for the adult population and may not be suited for the particularities of pediatric OSA. The main differences between adult and pediatric OSA are related to the symptoms, negative consequences, and the PSG findings, where both the scoring of apneas and hypopneas and the criteria to assess OSA severity are more restrictive for children [2,3]. Among the numerous DL algorithms that have been developed, the use of CNNs has emerged as a relevant and useful DL technique in image and signal analysis, including the medical field [21,39,40]. Despite CNN success in biomedical applications, only one recent study proposed a CNN architecture for detection of pediatric OSA using SpO 2 signals to estimate AHI [20]. AF and SpO 2 signals have not been jointly evaluated using DL approaches despite the complementarity of these signals as shown in previous studies using feature-engineering approaches [14,18,19]. Here, we propose the joint use of AF and SpO 2 signals to detect pediatric OSA using a CNN-based approach. The main novelty of this study relies on the combination of AF and SpO 2 data to derive a CNN model aimed at estimating pediatric OSA severity. We hypothesized that a CNN can take advantage of the complementarity of the information from AF and SpO 2 signals to estimate pediatric OSA severity. That information can then be useful to improve the automated identification of apneas and hypopneas with a reduced subset of signals. Accordingly, the objective of this study was to evaluate a trained CNN model with these two overnight signals to estimate the AHI. The major contributions of our proposal are (i) the combination of AF and SpO 2 signals to evaluate a DL algorithm aimed at detecting OSA in children, and (ii) the use of a 2D CNN approach to automatically estimate the total sleep AHI from these two signals jointly. 2. Subjects and signals Two databases, one public and one private, were used in this study. The first one, the Childhood Adenotonsillectomy Trial (CHAT) database, comprises 1638 PSG recordings from 1232 subjects recruited between 2007 and 2012 (Number of Clinical Trial: NCT00560859) [41,42]. This database is publicly available through the National Sleep Research Resource website (https://sleepdata.org/datasets/chat) under request. The sleep studies were divided into three subgroups: baseline (453 subjects), follow-up (406 subjects) and nonrandomized (779 subjects). Sleep studies from each of the 3 subgroups were randomly split into training (60%), validation (20%), and test (20%) sets (Table 1). The division conducted was subject-wise, so that no subject was represented in two sets simultaneously. The sets assigned to the subjects in the baseline group were transferred to the follow-up subgroup, so each follow-up subject has both baseline and follow-up recordings in the same training/validation/test set. No statistically significant differences were found in age, sex, body mass index (BMI), and AHI between the sets (p ≥ 0.01, Mann-Whitney U test for numeric variables, Chi-square test for sex). PSG data from CHAT database included annotations of the beginning and duration of apneic events according to the AASM guidelines in Ref. [43], which is needed to train the proposed DL algorithm. A second private database from the University of Chicago Medicine (UofC) includes PSG data from 974 pediatric subjects referred for polysomnographic evaluation between 2012 and 2014. The legal caretakers were informed and gave their consent, and the Ethics Committee of the UofC approved the study protocol (see Ethical Approval section). The PSGs of the subjects in the UofC database were evaluated according to the current AASM guidelines [3]. Since this database did not contain annotations of individual time stamp of respiratory events, no data from UofC were used during the training stage of the CNN. However, subjects in the UofC database were used to validate and test the AHI estimation algorithm, so each subject was labeled with the PSG-derived AHI. The 974 subjects in the UofC database were randomly split into the validation (60%) and test (40%) sets, with no statistically significant differences in age, sex, BMI and AHI among them (p ≥0.01, Mann-Whitney U test for numeric variables, Chi-square test for sex). Table 1 summarizes the demographic and clinical data of the subjects involved in this study. Statistically significant differences were observed in age, sex, and AHI between CHAT and UofC sets, which were noted in Table 1. As these differences may affect the generalizability of the proposed model, a joint validation set was formed in order to minimize the chances of overfitting towards the CHAT training and validation data. The subjects from CHAT and UofC validation sets were merged to form a larger, heterogeneous, and generic validation set involving 910 subjects. This set was used to find the optimal hyperparameters of the CNN and the AHI estimation algorithms. Finally, the test sets were used to evaluate the diagnostic ability of the proposed algorithm. AF signals were obtained from the PSG and were recorded using an oronasal thermistor with sampling frequencies (f s ) ranging 20–512 Hz, whereas SpO 2 signals were recorded with a pulse oximeter finger probe with f s in the range 1–512 Hz. Fig. 1 shows an example of AF and SpO 2 signals with apnea/hypopnea events and their respective desaturations. As can be seen in the AF signal, the apneas and hypopneas produce reductions of the amplitude of AF, as well as sudden drops in the oxyhemoglobin saturation due to reduced or interrupted gas exchange. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 3 3. Methods In this study, AF and SpO 2 signals were analyzed by means of a CNN aimed at estimating the AHI. Fig. 2 summarizes the workflow of the methodology, including the methods that have been developed and applied to process the overnight AF and SpO 2 . The signals were minimally preprocessed and were segmented into 5-min epochs before feeding the CNN. The AHI was estimated by counting the number of apneic events detected throughout the segments. In addition, the datasets employed in this study are also represented in Fig. 2. The CHAT- Training and CHAT-Validation datasets were used to train and monitor the convergence of the proposed CNN at segment level, while the joint validation set was used to derive the optimal hyperparameters of the CNN as well as to train and validate the AHI estimation algorithm at subject level. Finally, both test sets were used to evaluate the diagnostic performance of the proposed CNN-based algorithm. 3.1. Signal preprocessing and segmentation The signals were preprocessed to normalize their characteristics before they were presented to the CNN. Both AF and SpO 2 were resampled to a common f s =10 Hz to ensure that the signals had the same length and to reduce the computational cost. Afterwards, the AF signal was low-pass filtered to reduce noise. This was achieved using a Kaiser window finite impulse response (FIR) filter. The application of a FIR filter ensures linear phase filtering, and the Kaiser window low-pass filter allowed us to establish a trade-off between the main-lobe width and the side-lobe amplitude, independently defining the transition bandwidth and the stopband attenuation. The design parameters of the filter were: cutoff frequency 1.5 Hz, stop frequency 2 Hz, and stopband attenuation 100 dB. The amplitude of AF was adaptively normalized as in previous studies [14,44]. Then, both signals were standardized prior to being presented to the CNN [36]. The signals were joined and segmented into 5-min epochs (300 s), so segments were shaped as 2D tensors of size 3000 ×2 (Fig. 2). The length of the segments was selected as a tradeoff between a period that encompasses consecutive apneic events and their respective desaturations and the number of available segments to train and validate the CNN. Data augmentation was performed in the training stage by using 50% overlapped segments, so the total number of training instances was increased. In addition, overlapped segments can enhance the detection of those apneic events truncated at the beginning or the end of a segment. The annotation of each segment is the number of apneic events that begin and end in the period that encompasses the segment, which was obtained from the PSG annotations in the CHAT database [20,33,36]. The number of extracted segments from each database is specified in Table 1. Table 1 Demographic and clinical characteristics of the children in the CHAT and UofC databases. CHAT-Training CHAT-Validation UofC-Validation CHAT-Test UofC-Test Subjects (n) 1006 (61.42%) 326 (19.90%) 584 (59.96%) 306 (18.68%) 390 (40.04%) Age (years) 7 [6; 8] (a,b) 7 [6; 8] (c,d) 6 [3; 8] (a,c,e) 6.9 [6; 8] (e,f) 5.5 [3; 9] (b,d,f) Females (n) 520 (51.7%) (a,b) 168 (51.5%) (d) 238 (40.8%) (a,e) 168 (54.9%) (e,f)) 137 (35.1%) (b,d,f) Males (n) 471 (46.8%) (a,b) 156 (47.9%) (d) 346 (59.2%) (a,e) 134 (43.8%) (e,f) 253 (64.9%) (b,d,f) BMI (kg/m 2 ) 17.4 [15.6; 21.7] 17.1 [15.4; 21.8] 17.7 [16.1; 22.7] 17.6 [15.7; 21.7] 18.2 [16.0; 21.9] AHI (events/h) 2.6 [1.1; 5.9] (a) 2.4 [1.2; 5.8] (c) 4.1 [1.7; 10.0] (a,c,e) 2.3 [1.1; 6.2] (e) 3.3 [1.4; 7.9] No OSA (g) (n) 219 (21.8%) 69 (21.2%) 96 (16.4%) 67 (21.9%) 75 (19.2%) Mild OSA (h) (n) 496 (49.3%) 168 (51.5%) 229 (39.2%) 148 (48.4%) 169 (43.3%) Moderate OSA (i) (n) 160 (15.9%) 44 (13.5%) 113 (19.4%) 49 (16.0%) 63 (16.2%) Severe OSA (j) (n) 131 (13.0%) 45 (13.8%) 146 (25.0%) 42 (13.7%) 83 (21.3%) Segments (n) 227,101 73,451 114,588 68,727 76,896 Data presented as median [interquartile range] or n (%). BMI =body mass index, AHI =apnea-hypopnea index; OSA =Obstructive Sleep Apnea. a Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Training and UofC-Validation. b Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Training and UofC-Test. c Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Validation and UofC-Validation. d Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Validation and UofC-Test. e Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Test and UofC-Validation. f Statistically significant differences (p <0.01, Bonferroni correction) between CHAT-Test and UofC-Test. g AHI<1 event/h. h 1 ≤AHI<5 events/h. i 5 ≤AHI<10 events/h. j AHI≥10 events/h. Fig. 1. Example of 5-min segments of airflow (AF) and oximetry (SpO 2 ) signals with apneas, hypopneas, and desaturations associated to apneic events. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 4 3.2. Design of the CNN architecture In this study, a CNN model was trained and validated with the extracted segments of AF and SpO 2 signals to estimate the number of apneic events. The CNN architecture was arranged into Nlay stacked convolutional blocks that sequentially processed the input data (Fig. 3). Each convolutional block was composed of 5 consecutive layers: convolution, batch normalization, activation, max pooling, and dropout. First, a convolutional layer generated 3D feature maps using the 2D convolution operation [39,45]: xj i[m,n] = ∑ ksize k=1∑ 2 l=1 wj i[k,l]⋅ai[m−k+1,n−l+1] + bj i,(1) where xj i is the feature map generated in the convolutional block i (i =1, …, Nlay), with the filter with weights wj i and bias bj i (j =1, …, Nfilt) and ai as the input to the i-th convolutional block. The convolutional layer was composed of a bank of Nfilt 2D filters with kernel size ksize ×2, stride 1, and zero padding to ensure that the input and output lengths are the same. Next, the batch normalization layer applied a normalization of the Nfilt feature maps generated by the previous layer [46]. The rectified linear unit (ReLU) activation was then applied [45]: ReLU(xj i)=max(0,xj i),(2) where xj i is the value of each sample of the feature map. ReLU activation is standard in deep architectures to accelerate the training process of the CNN without using previously optimized weights [39]. Dimensionality reduction was applied to the activations using a max pooling layer with a pool factor 2 ×1 to reduce the length of the feature maps while the width and depth are kept. The last layer of the convolutional blocks is a dropout layer that randomly removed a small fraction of the activations during each training batch to reduce overfitting. In this study, we have tested drop probabilities ranging from P =0 to P =0.5 [20]. Next to the convolutional blocks, a flattening layer was employed to reshape the 3D feature maps into 1D feature vectors. The output layer was a linear activation unit that yielded the estimation of the number of apneic events present in each epoch [36]. 3.3. CNN training and optimization The training stage of the CNN was initialized with random weights in all layers. The optimizer employed in this study was the adaptive momentum estimation (Adam). The initial learning rate was sought among various values between 5.0⋅10 −5 and 0.02, while the momentum-related parameters were set to their default values β1 =0.9 and β2 =0.999 [45, 47]. Training data was divided into mini-batches, which were shuffled before each training epoch to ensure independence between consecutive batches and improve convergence [45]. The size of the mini-batches was sought between 64 and 512. The loss function used in the Adam optimizer was the Huber loss, that is widely used for robust regression if large outliers are present [48]. The delta (δ) parameter of the Huber loss was fixed to δ =1, an intermediate value that is suitable for arbitrary data distributions [48]. The validation set was used during the learning stage to monitor the convergence of the CNN optimization process with the validation loss. The learning rate was reduced by a factor of 2 during training when the loss in the validation set did not improve in the last 10 epochs [45,49]. In addition, an early stopping criterion was applied to avoid overfitting. The training was stopped after 30 epochs with no reduction of the loss in the validation set, restoring the weights to those obtained in the epoch with minimum validation loss [45,49]. Otherwise, the maximum number of epochs was 100. Keras 2.3 framework with Tensorflow-gpu 2.0 backend was used to implement, train, and evaluate the CNN models [49]. 3.4. Apnea-hypopnea index estimation After the estimated number of apneic events in each 5-min segment was obtained, the rate of respiratory events was calculated as the sum of the detected apneic and hypopneic events divided by the total recording Fig. 2. Workflow of the methodology and databases employed in this study. Preprocessing of overnight airflow (AF) and oximetry (SpO 2 ) signals from polysomnography (PSG) was performed prior to the application of the Convolutional Neural Network (CNN) based apnea-hypopnea index (AHI) estimation algorithm. The Childhood Adenotonsillectomy Trial (CHAT) and the University of Chicago (UofC) databases were employed to train, validate, and test the proposed methodology. LPF: low-pass filter; TRT: total recording time; SVR: Support Vector Regression; S n : segment n; y n : label n. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 5 Fig. 3. Block diagram of the Convolutional Neural Network developed in this study. Conv2D: bidimensional (2D) convolution layer; Nfil: number of filters in the convolution layer; ksize: kernel size of the convolution filters; ReLU: Rectified Linear Unit activation function; Nlay: number of blocks of convolutional layers. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 6 time (Fig. 2). This rate underestimates the actual AHI, since the total recording time is usually larger than the total sleep time. To correct this tendency, the final estimated AHI was calculated by means of a Support Vector Regression (SVR) model [50,51]. This method conducts a more robust regression than ordinary least squares in presence of noisy data [51]. The SVR optimization method finds the optimal coefficients of the linear equation f(x) = a0+a1⋅x that minimizes the error function. This error function is a ε -insensitive loss [50]: L(y,f(x)) = {0,|y−f(x)| ≤ ε |y−f(x)| − ε ,|y−f(x)| ≥ ε .(3) The margin ε ≥0 has to be fixed to define a zone around f(x) where the difference between the actual AHI and the estimated AHI does not contribute to the error. In the present work, this positive margin was empirically set to ε =0.25 to minimize misclassifications into different OSA severity levels, assuming that an error in the AHI estimation lower than the margin is very unlikely to contribute to the misclassification of OSA severity. Therefore, the margin was chosen to be lower than the most restrictive AHI cutoff that define the presence of OSA. Three accepted and child-specific AHI cutoffs were used to classify the severity of OSA into four levels: no OSA (AHI<1 e/h), mild OSA (1 ≤AHI<5 e/ h), moderate OSA (5 ≤AHI<10 e/h) and severe OSA (AHI≥10 e/h) [2, 4]. 3.5. Hyperparameter search and algorithm evaluation Three CNN hyperparameters were optimized in this study: Nlay, Nfilt, and ksize. These hyperparameters are directly involved in controlling the size of the network and the number of trainable weights. We evaluated the performance of the CNNs with varying values of Nlay = {5, 6, 7, 8, 9}, Nfilt ={8, 16, 32, 64, 96}, and ksize ={3, 5, 7, 9, 17, 33}. Based on preliminary analyses, these values were selected to define a CNN with intermediate complexity, i.e., lower values led to underfitting, and higher values resulted in a CNN that was hard to train and prone to overfitting. The optimal hyperparameters were those that maximized the 4-class Cohen’s Kappa coefficient (κ) when classifying OSA severity in the validation set using stratified 10-fold cross-validation. The Cohen’s kappa is a measure of agreement useful in classification tasks when the classes are not equally distributed, because it considers the probability of agreement by chance and is less biased towards the majority class as the accuracy is [52]. A search over the hyperparameter values was performed by training the CNNs and evaluating them with the validation data. 3.6. Statistical analysis The agreement between the AHI estimated using the proposed methodology and the actual AHI derived from the PSG was evaluated by means of the intraclass correlation coefficient (ICC), scatter plots, and Bland-Altman plots [53]. The classification into the four severity levels was assessed using confusion matrices, 4-class accuracy (Acc 4 ), and κ [52]. The diagnostic ability of the algorithm in the AHI cutoffs (1, 5 and 10 e/h) was evaluated by means of sensitivity (Se), specificity (Sp), accuracy (Acc), positive and negative predictive values (PPV, NPV), and positive and negative likelihood ratios (LR+, LR−). Fig. 4. Evolution of the Huber Loss in the training and validation sets during the CNN optimization alongside the training epochs. Table 2 Results of the CNN hyperparameters optimization process in the validation set. Nlay Nfilt ksize Cohen’s κ 5 8 3 0.2561 5 8 5 0.3759 5 16 5 0.3784 6 16 5 0.4132 6 32 7 0.4457 6 32 9 0.4697 7 32 9 0.4533 7 32 17 0.4702 8 32 9 0.4711 8 64 9 0.4673 8 64 17 0.4807 8 64 33 0.4697 8 96 17 0.4624 9 64 17 0.4533 9 64 33 0.4387 9 96 17 0.4617 Nlay =Number of convolutional layers, Nfilt =Number of filters in each convolutional layer, ksize =length of the filters, κ =Cohen’s kappa coefficient. Fig. 5. Scatter plot and regression function of the Apnea-Hypopnea Index (AHI) from the rate of apneic events in the total recording time (TRT) in the validation set. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 7 Fig. 6. Scatter plots of the actual Apnea-Hypopnea Index (AHI) vs. the estimated AHI in (a) CHAT and (b) UofC test sets. Fig. 7. Bland-Altman plots of actual and estimated Apnea-Hypopnea Index (AHI) in (a) CHAT and (b) UofC test sets. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 8 4. Results 4.1. Optimum CNN architecture In this study, a CNN model was trained and evaluated, and the optimal combination of the hyperparameters Nlay, Nfilt and ksize was sought. The result of the optimization carried out during the training stage is shown in Fig. 4, where it can be seen that the Huber loss decreases alongside the training epochs. It can also be observed that the training was halted 30 epochs after the minimum validation loss was reached. At that epoch, the validation loss is minimum and similar to the training loss, indicating that the CNN does not overfit the training data. Table 2 shows the Cohen’s κ values estimated in the validation set, with subjects from both CHAT and UofC databases. For the sake of simplicity, only the configurations that sensibly differ from similar combinations of hyperparameters are shown. The configuration that reached the highest κ =0.4807 was Nlay =8, Nfilt =64, and ksize =17 (Table 2). This optimum model was obtained with the following hyperparameters in the training stage: drop probability P =0.1, learning rate 0.01, and batch size 128. Fig. 5 shows the scatter plot of the estimated rate of respiratory events per hour of recording against the actual AHI using the optimal CNN configuration, and the regression function derived from the SVR model to estimate the AHI in the validation set. The equation corrects the tendency to underestimate the AHI when using the total recording time instead of the total sleep time. 4.2. Diagnostic ability in the test set Once the optimal configuration of the algorithm was achieved from data in the training and validation sets, the model was applied to the test dataset. The scatter plots shown in Fig. 6 reveal that the agreement between the actual and estimated AHI is higher in the CHAT test set in comparison with the UofC data. Similarly, Fig. 7 Bland-Altman plots show that the difference between actual and estimated AHI is more dispersed in the UofC test set. The proposed algorithm showed a slight tendency to underestimate the AHI in the CHAT test set, contrarily to that observed in the UofC test set. Fig. 8 shows the confusion matrices obtained in both test sets, and Tables 3 and 4 display the diagnostic performances of our proposed CNN-based approach. In accordance with the tendencies shown in the Bland-Altman plots (Fig. 7), the results of binary classification show that Sp and PPV were higher in the CHAT test set at the cost of reducing Se, which was higher in the UofC test set. Overall, the highest Acc and LR +values were achieved in CHAT test set. Fig. 8. Confusion matrices of the predicted OSA severity against the actual OSA severity in CHAT and UofC test sets. 0: no OSA; 1: mild; 2: moderate; 3: severe. Table 3 Performance of the proposed algorithm in the test sets of the CHAT and UofC databases. Test set (n) ICC Acc 4 (%) Cohen’s κ CHAT-baseline (n¼86) 0.8793 66.28 0.4978 CHAT-followup (n¼78) 0.9786 78.21 0.6711 CHAT-nonrandomized (n¼142) 0.9537 73.24 0.5652 CHAT-all (n¼306) 0.9546 72.55 0.6011 UofC (n¼390) 0.8821 61.79 0.4469 n =Number of subjects in the set, ICC =intra-class correlation coefficient, Acc 4 =four-class accuracy, κ =Cohen’s kappa coefficient, CHAT =Childhood Adenotonsillectomy Trial, UofC =University of Chicago. Table 4 Diagnostic ability of the algorithm for the AHI cutoffs 1, 5, and 10 events/h in the test sets of CHAT and UofC databases. AHI cutoff Test set Se (%) Sp (%) Acc (%) PPV (%) NPV (%) LR+LR- 1 e/h CHAT 82.43 92.54 84.64 97.52 59.62 11.0452 0.1899 UofC 95.24 37.33 84.10 86.46 65.12 1.5198 0.1276 5 e/h CHAT 80.22 99.07 93.46 97.33 92.21 86.2363 0.1997 UofC 82.19 85.25 84.10 76.92 88.89 5.5708 0.2089 10 e/h CHAT 71.43 98.11 94.44 85.71 95.57 37.7143 0.2912 UofC 78.31 93.49 90.26 76.47 94.10 12.0211 0.2320 AHI =apnea-hypopnea index, Se =sensitivity, Sp =specificity, Acc =accuracy, PPV =positive predictive value, NPV =negative predictive value, LR+ = positive likelihood ratio, LR- =negative likelihood ratio, e/h =events/hour CHAT =Childhood Adenotonsillectomy Trial, UofC =University of Chicago. J. Jim´ enez-García et al. Computers in Biology and Medicine 147 (2022) 105784 9 Table 5 Diagnostic performance of state-of-the-art approaches in the childhood OSA context. Study Signal Methods (Extraction/Selection/Classification/Validation) Nº Subjects Cutoff (events/h) Se (%) Sp (%) Acc (%) Choi et al. (2018) [30] AF CNN/Holdout 179 (adults) 5 100.0 84.6 96.2 15 98.1 86.5 92.3 30 96.2 96.2 96.2 Nikkonen et al. (2019) [33] SpO 2 ANN/Holdout 1959 (adults) 5 96.1 87.5 92.1 15 94.7 97.0 96.4 30 88.2 99.1 97.5 Wu et al. (2017) [9] – Clinical Parameters/-/Stepwise LR/Holdout 311 5 94.8 25.0 78.2 Garde et al. (2014) [11] SpO 2 , PRV Time statistics, spectral, nonlinear/AUC optimization/LDA/Four-fold cross validation 146 5 88.4 83.6 84.9 Garde et al. (2019) [12] SpO 2 , PRV Time statistics, spectral, ODI (SpO 2 ), spectral (PRV)/Stepwise LR/Binary LR (for each cutoff)/Holdout 207 1 68.0 86.0 71.0 5 58.0 89.0 78.0 10 90.0 87.0 88.0 Alvarez et al. (2018) [13] SpO 2 Time statistics, ODI, symbolic dynamics/FSLR/LR/Bootstrap 142 5 73.5 89.5 83.3 Calder´ on et al. (2020) [10] SpO 2 Oxygen desaturations, ODI/-/LR/15-fold cross validation 453 (CHAT) 5 62.0 96.0 79.0 Hornero et al. (2017) [15] SpO 2 Time statistics, spectral, nonlinear, ODI/FCBF/MLP regression/Holdout 4191 1 84.0 53.2 75.2 5 68.2 87.2 81.7 10 68.7 94.1 90.2 Xu et al. (2019) [16] SpO 2 ODI and M3f/FCBF/MLP regression/Direct validation 432 1 95.3 19.1 79.6 5 77.8 80.5 79.4 10 73.5 92.7 88.2 Vaquerizo-Villar et al. (2018) [17] SpO 2 DFA, ODI/FCBF/MLP regression/Holdout 981 (UofC) 1 97.1 23.3 82.7 5 78.8 83.7 81.9 10 77.1 94.8 91.1 Barroso-García (2021a) [18] AF, SpO 2 Bispectral (AF), ODI (SpO 2 )/FCBF/MLP regression/Bootstrap 946 (UofC) 1 98.0 15.3 82.2 5 81.6 83.0 82.5 10 72.3 95.0 90.2 Barroso-García (2021b) [19] AF, SpO 2 Wavelet (AF), ODI (SpO 2 )/FCBF/BY-MLP regression/Bootstrap 946 (UofC) 1 91.2 43.3 82.0 5 79.3 83.8 82.1 10 74.9 95.0 90.7 Jim´ enez-García et al. (2020) [14] AF, SpO 2 Time statistics, spectral, nonlinear, ODI/FCBF/Multiclass AdaBoost/Holdout 974 (UofC) 1 92.1 36.0 81.3 5 76.0 85.7 82.1 10 62.7 97.7 90.3 Vaquerizo-Villar et al. (2021) [20] SpO 2 CNN/Holdout 1638 (CHAT) 1 71.2 81.8 77.6 5 83.7 100.0 97.4 10 83.9 99.3 97.8 980 (UofC) 1 90.8 36.4 80.1 5 76.0 88.6 83.9 10 79.5 95.8 92.3 This study AF, SpO 2 CNN/Holdout 1638 (CHAT) 1 82.4 92.5 84.6 5 80.2 99.1 93.5 10 71.4 98.1 94.4 974 (UofC) 1 95.2 37.3 84.1 5 82.2 85.3 84.1 10 78.3 93.5 90.3 Acc =Accuracy, AF =Airflow signal, ANN =Artificial Neural Network, AUC =Area under the receiver operating characteristic curve, BY-MLP =Multilayer perceptron neural network with Bayesian approach, CHAT = Childhood Adenotonsillectomy Trial, CNN =Convolutional neural network, DFA =Detrended fluctuation analysis, FCBF =Fast correlation-based filter, FSLR =Forward stepwise logistic regression, LDA =Linear discriminant analysis, LR =Logistic regression, M3f =3rd order statistical moment in the frequency band, MLP =Multilayer perceptron neural network, ODI =Oxygen desaturation index, PRV =Pulse rate variability Se = Sensitivity, Sp =Specificity, SpO 2 =Oxygen saturation signal, UofC =University of Chicago. J. Jim´ enez-García et al.