| Literature DB >> 34943539 |
Marek Piorecky1,2, Martin Bartoň1,2, Vlastimil Koudelka1, Jitka Buskova1, Jana Koprivova1, Martin Brunovsky1,3, Vaclava Piorecka1,2.
Abstract
Sleep disorders are diagnosed in sleep laboratories by polysomnography, a multi-parameter examination that monitors biological signals during sleep. The subsequent evaluation of the obtained records is very time-consuming. The goal of this study was to create an automatic system for evaluation of the airflow and SpO2 channels of polysomnography records, through the use of machine learning techniques and a large database, for apnea and desaturation detection (which is unusual in other studies). To that end, a convolutional neural network (CNN) was designed using hyperparameter optimization. It was then trained and tested for apnea and desaturation. The proposed CNN was compared with the commonly used k-nearest neighbors (k-NN) method. The classifiers were designed based on nasal airflow and blood oxygen saturation signals. The final neural network accuracy for apnea detection reached 84%, and that for desaturation detection was 74%, while the k-NN classifier reached accuracies of 83% and 64% for apnea detection and desaturation detection, respectively.Entities:
Keywords: CNN; apnea; sleep EEG records
Year: 2021 PMID: 34943539 PMCID: PMC8700500 DOI: 10.3390/diagnostics11122302
Source DB: PubMed Journal: Diagnostics (Basel) ISSN: 2075-4418
Example of marker identification and their number from real PSG.
| Tag ID | Dfile Tag | Tag Numbers | Dfile Text |
|---|---|---|---|
| 130 | O+ | 225 | start OSAS |
| 131 | O− | 225 | stop OSAS |
| 132 | A+ | 10 | start CAS |
| 133 | A− | 10 | stop CAS |
| 138 | D+ | 159 | start desaturation |
| 139 | D− | 159 | stop desaturation |
Figure 1Block diagram of pre-processing pipeline.
Figure 2Demonstration of SpO decline response in apnea.
Numbers of segments and subjects in data sets for NN apnea detection.
| Number of Segments | Number of Subjects | |
|---|---|---|
| Training data set | 351,550 | 175 |
| Validation data set | 87,180 | 38 |
| Testing data set | 88,882 | 42 |
Numbers of segments and subjects in data sets for NN desaturation detection.
| Number of Segments | Number of Subjects | |
|---|---|---|
| Training data set | 777,640 | 174 |
| Validation data set | 193,886 | 36 |
| Testing data set | 198,082 | 45 |
Figure 3Visualization of the optimal NN design for apnea detection.
Figure 4Principle scheme of hyperparameter optimization.
Tested values for convolutional layer kernel sizes.
| Layer | Variable | Values |
|---|---|---|
| First |
| 1, 5, 11, 21, 31, 41, 51 |
| Second |
| 1, 5, 11, 21, 31, 41, 51, 61 |
| Third |
| 1, 5, 11, 21, 31, 41, 51, 61, 71 |
NN structure for kernel size optimization.
| Layer Name | Parameter |
|---|---|
| 2D CL | K (1 × |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| 2D CL | K (2 × |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| 2D CL | K (1 × |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| Flatten | |
| Dense | N 256 |
| Dropout | D 0.5 |
| Dense | N 64 |
| Dropout | D 0.5 |
| Dense | N 1 |
Tested values of filter number and number of neurons.
| Layer | Variable | Tested Values |
|---|---|---|
| First, convolutional |
| 1, 30, 60, 120, 300, 500 |
| Second, convolutional |
| 1, 30, 60, 120, 300, 500 |
| Third, convolutional |
| 1, 30, 60, 120, 300, 500 |
| Fourth, fully connected |
| 1, 30, 100, 500 |
| Fifth, fully connected |
| 1, 30, 100, 500 |
NN structure for optimization of number of filters and number of neurons.
| Layer Name | Parameter |
|---|---|
| 2D CL | K (1 × 1), F |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| 2D CL | K (2 × 15), F |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| 2D CL | K (1 × 45), F |
| MaxPool | M (1,2) |
| Dropout | D 0.5 |
| Flatten | |
| Dense | N |
| Dropout | D 0.5 |
| Dense | N |
| Dropout | D 0.5 |
| Dense | N 1 |
Figure 5Parallel graph of all combinations and their results, in terms of accuracy. Generated using the Weights and Biases software.
Results for top five combinations of convolutional kernel size. The same values of convolutional kernel length were achieved with different sweep.
| Length of Convolution Kernel | Classification Evaluation | |||
|---|---|---|---|---|
|
|
|
|
|
|
| 1 | 11 | 41 | 88.320 | 0.2930 |
| 1 | 11 | 31 | 88.278 | 0.2911 |
| 1 | 11 | 31 | 88.269 | 0.2911 |
| 1 | 21 | 61 | 88.240 | 0.2903 |
| 1 | 21 | 61 | 88.224 | 0.2903 |
Figure 6Parallel graph of all combinations of number of neurons in dense layers and number of filters in convolutional layers. Generated by the Weights and Biases software.
Results of top five combinations considering the number of neurons in dense layers and number of filters in convolutional layers.
| No. Filters | No. Neurons | Classification Evaluation | ||||
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
| 30 | 120 | 120 | 100 | 30 | 86.58 | 0.3349 |
| 120 | 500 | 120 | 30 | 100 | 86.51 | 0.3361 |
| 300 | 300 | 60 | 500 | 100 | 86.47 | 0.3330 |
| 120 | 120 | 120 | 100 | 100 | 86.45 | 0.3339 |
| 300 | 500 | 60 | 100 | 100 | 86.38 | 0.3386 |
Figure 7Different dropout settings and their results in the training and validation of the CNN.
Figure 8The course of testing the final neural network for apnea detection. Different colors represent different divisions into training and validation data sets.
Results of training with different batch sizes.
| Batch Size | Accuracy (%) | Error (-) |
|---|---|---|
| 100 | 82.81 | 0.4183 |
| 250 | 82.58 | 0.4248 |
| 500 | 82.57 | 0.4252 |
| 1000 | 83.23 | 0.4004 |
| 2000 | 82.81 | 0.3973 |
Testing the accuracy with different kernel size in the first layer of the proposed NN.
| Kernel Size | Results | |||
|---|---|---|---|---|
|
|
|
|
|
|
| 1 | 15 | 45 | 88.11 | 0.2947 |
| 2 | 15 | 45 | 87.84 | 0.2988 |
| 3 | 15 | 45 | 87.76 | 0.2992 |
Final structure of a convolutional neural network used for apnea and desaturation detection.
| Layer Name | Parameter | No. of Weights | Data Size |
|---|---|---|---|
| 2D CL | K (1 × 1) F 174 | 384 | 2 × 500 × 174 |
| MaxPool | M (1,2) | 2 × 250 × 174 | |
| Dropout | D 0.6 | ||
| 2D CL | K (2 × 15) F 308 | 1,608,068 | 1 × 236 × 308 |
| MaxPool | M (1,2) | 1 × 118 × 308 | |
| Dropout | D 0.6 | ||
| 2D CL | K (1 × 45) F 96 | 1,330,656 | 1 × 74 × 96 |
| MaxPool | M (1,2) | 1 × 37 × 96 | |
| Dropout | D 0.6 | ||
| Flatten | 3552 | ||
| Dense | N 148 | 525,844 | 148 |
| Dropout | D 0.6 | ||
| Dense | N 86 | 12,814 | 86 |
| Dropout | D 0.6 | ||
| Dense | N 1 | 87 | 1 |
Results of classification by the proposed NN in the content of apnea segments under various thresholds.
| Threshold (-) | Accuracy (%) | Sensitivity (%) | Specificity (%) |
|---|---|---|---|
| 0.3 | 82.21 | 96.22 | 68.21 |
| 0.5 | 84.27 | 88.39 | 80.14 |
| 0.7 | 82.92 | 81.64 | 84.21 |
| AUC (-) | 0.9034 | ||
Results of classification by proposed NN in the content of desaturation segments under various thresholds.
| Threshold (-) | Accuracy (%) | Sensitivity (%) | Specificity (%) |
|---|---|---|---|
| 0.3 | 69.04 | 93.74 | 44.34 |
| 0.5 | 74.19 | 82.62 | 65.76 |
| 0.7 | 74.41 | 67.46 | 81.37 |
| AUC (-) | 0.8264 | ||
Figure 9ROC curve for apnea (top) and desaturation (below) segment analyses.
Results of classification by k-NN in content of apnea and desaturation segments under various k.
| Apnea | Desaturation | |
|---|---|---|
|
|
|
|
| 5 | 83.06 | 55.77 |
| 20 | 84.22 | 57.74 |
| 50 | 84.03 | 59.11 |
| 100 | 83.71 | 59.93 |
| 200 | 82.81 | 60.78 |
| 500 | 80.96 | 61.61 |
| 1000 | 78.91 | 61.37 |
Results of classification by k-NN in content of apnea () and desaturation () segments.
| Apnea | Desaturation | |
|---|---|---|
| Accuracy (%) | 83.39 | 64.33 |
| Sensitivity (%) | 88.31 | 54.05 |
| Specificity (%) | 78.47 | 74.61 |
Figure 10The course of testing the final neural network for desaturation. Different colors represent different divisions into training and validation data sets.
Comparison of different types of classifiers and their accuracies.
| Ref. | Signal | Classifier | Accuracy | Results Sensitivity | Specificity |
|---|---|---|---|---|---|
| [ | CB, AB, SaO | ut. RCNN | 85.7%/81.7% | - | - |
| [ | CB, AB, SaO | ut. RCNN | 78.7%/83.3% | - | - |
| [ | SpO | DBN | 97.64% | 78.75% | 95.89% |
| [ | SpO | DBN | 85.26% | 60.36% | 91.71% |
| [ | SpO | LSTM | 92.1% | 84.7% | - |
| [ | SpO | LSTM | 95.5% | 92.9% | - |
| [ | SpO | CNN2D | 79.6% | - | - |
| [ | SpO | CNN1D | 84.53–92.65% | 56.72–91.64% | 90.19–94.60% |
| [ | SpO | CNN1D | 84.85–94.24% | 58.32–92.04% | 93.32–96.78% |
| [ | NP | CNN | 96.6% | 81.1% | 98.5% |
| [ | THO | CNN | 70.7% | - | - |
| [ | ABD | CNN | 72.3% | - | - |
| [ | NAF | CNN | 77.6% | - | - |
| [ | THO, ABD | CNN | 77.7% | - | - |
| [ | NAF, THO | CNN | 82.0% | - | - |
| [ | NAF, ABD | CNN | 82.6% | - | - |
| [ | NAD, ABD, THO | CNN | 83.5% | - | - |
| [ | NAF | CNN | 74.70 ± 1.43% | - | - |
| [ | ECG | CNN | 98.91% | 97.82% | 99.20% |
| [ | ECG | AB | 87.33% | 81.99% | 90.72% |
| [ | ECG | LS-SVM | 84.74% | 84.71% | 84.69% |
| [ | ECG | BA | 85.97% | 84.14% | 86.83% |
| [ | ECG | SLBP | 89.80% | 88.46% | 90.63% |
| [ | ECG | 1-D CNN | 87.90% | - | - |
| [ | ECG | CNNLSTM | 86.25% | - | - |
| [ | ECG | AlexNet CNN | 86.22% | 90.00% | 83.82% |
| [ | EEG | 75% | 70% | 92% | |
| [ | EEG | SVM (RBF) | 95% | 90% | 100% |
| [ | EEG | SVM (polynomial) | 99% | 100% | 98% |
| [ | EEG | ANN | 86% | 75% | 100% |
| [ | EEG | DFA + SVM | 95.1% | 93.2% | 98.6% |
| [ | EEG | CNN + LSTM | 76.5–84.5% | - | - |