COMPUTER AIDED DETECTION OF OBSTRUCTIVE SLEEP APNEA FROM EEG SIGNALS

Sleep Apnea is an anomaly in sleeping characterized by short pause in breathing. Failure to treat sleep apnea leads to fatal complications in both psychological and physiological being of human. Electroencephalogram (EEG) performs an important task in probing for sleep apnea through identifying and recording the brain’s activities while sleeping. In this study, computer aided detection of sleep apnea from EEG signals is developed to optimize and increase the prompt recognition and diagnosis of sleep apnea in patients. The time domain, wavelets, and frequency domain of the EEG signals were computed, and features were extracted from these domains. These features are inputted into two machine learning algorithms: Support Vector Machine and K-Nearest Neighbors of different kernel functions and orders. Evaluation metrics such as specificity, accuracy, and sensitivity are computed and analyzed for the classifiers. The KNN classifier outperforms the SVM in classifying apnea from non-apnea events in patients. The KNN order 3 shows the highest performance sensitivity of 85.92%, specificity of 80% and accuracy of 82.69%.


INTRODUCTION
Sleep is a state of rest and part of a daily rhythm essential for human life which covers about thirty-three percent (33%) of human existence [1].Sleep is an important part of human existence that helps in regulating mental and physical activities [2]. Sleeping leads to decrease in blood pressure, heart rate and body metabolic rate. It also helps in the relaxation of muscles, repair and replacement of dead cells and tissues. Also, sleep gives the brain a chance to organize and fix memories. The significance of a good sleep cannot be overemphasized, yet a lot of people experiences sleep disorders. National Sleep Foundation reveals that two-third of adults reported experiencing sleep disorders at night, a couple of times in a week or more. Furthermore, more than one-third of adults also experiences severe daytime drowsiness at least a few days each month [3].
A sleep disorder is an inability to sleep, thereby, leading to deficiency in body function both physically and mentally. Currently, there are about eighty-four different sleep disorders affecting human like sleep apnea, Parasomnias, Periodic limb movement disorder, insomnia, and narcolepsy [4].
Sleep Apnea (SA) is the disease characterized with pauses or shortness in breathing while asleep [5]. Sleep Apnea is of three types; Obstructive sleep apnea (OSA) is produced by total closure or fall of the human throat while sleeping. It occurs due to the relaxation of the sensitive tissues at the end of the throat. It is the most common kind of sleep apnea, and it also affects all ages of mankind [1]. Central Sleep Apnea (CSA) occurs due to breakdown in the nervous system. The organ responsible for the control of breathing could not maintain the breathing process. As a result, activation signals from the brain could not reach the necessary muscles. It seldomly occurs and it often has a neural cause [1]. Mixed Sleep Apnea (MSA) consists of mixture of obstructive apnea and central apnea.
According to [6] on cases of OSA in America, 22 million people experience sleep apnea with 80% of incidents going undetected on time. It was studied that that 25% of middle-aged men has OSA, about 3% of children suffer from OSA and apnea patients are highly prone to having Stroke. Sleep apnea leading to cardiovascular failure leads to over 38,000 deaths yearly. The total cost of diagnosing and treating sleep apnea is over $65 billion.Polysomnography (PSG) is a sleep disorder diagnostic test, performed in a sleep center where different physiological quantities are measured and documented during sleep. The signals were obtained directly by electrodes and then amplified. The PSG signalswere scored offline by sleep experts [7]. These signals contain of: Electromyogram (EMG); Electrooculogram (EOG), Electrocardiogram (ECG) and Electroencephalogram (EEG) [7].
Polysomnography (PSG) is usually studied and scored manually to detect, but this approach is challenging because of two reasons. Firstly, the high cost of PSG and having patients to sleep in an unaccustomed environment of sleep centers degrades the quality of sleep. Secondly, the physical scoring of OSA consumes time, and its' efficiency is highly dependent on human expertise and experience [8]. Consequently, large datasets can't be handled effectively using the manual detection of OSA. Hence, a computer aided diagnosis of OSA is imperative.
Electroencephalogram (EEG) are recordings of the electrical activities of the brain. It has been studied that sleep apnea can be detected by monitoring brain activities [9]. Many sleep studies show that sleep disorders can be identified and predicted through channels (C3-A2 channel or C4-A1 channel) of the EEG signal [9].In this research, we are going to develop a system that automatically recognizes apnea events in patients using the time domain, wavelets, and frequency domains of EEG signals. Features were extracted from these domains and fed into classifiers.

LITERATURE REVIEW
Different works has been done in the automatic or computer aided detection of obstructive sleep apneas. Features from different signals such as acoustic speech signal, abdomen effort and thorax signals, nasal air flow, oxygen saturation (Sp02), EEG, and ECG are commonly used as yardsticks for detecting sleep apnea.
The acoustic properties in human are affected by the vocal tract structure and soft tissue found in the throat. It was proposed by [10] that speech signal characteristics of OSA patients were different from the Non-OSA patients. A Gaussian Mixture Model (GMM) system was developed, relying on the vocal tract length and the linear prediction coefficients as features. An 83% Specificity, 79% sensitivity for male patients and 86% specificity, 84% sensitivity for female patients were achieved. In [11], 80.65% sensitivity and 80% specificity were achievedusing the GMM-based system classifier corroborated with a Mel Frequency Cepstral Coefficients (MFCC) feature space.
[12]used the signals of abdominal and thoracic efforts, oral and nasal airflow, and pulse oximetry level to indicate the presence of apnea. Using mean absolute amplitude analysis, the results showed that combining the abdominal and thoracic signals achieved 80% sensitivity and 90% specificity.
Features extracted ECG provide an efficient means of detecting sleep disorders. [7] used the RR-Interval of the ECG signals as features inputted. The results showed that system detected epochs of apnea with an accuracy of 96.5%. A single-lead ECG signal of 1-min segment is disintegratedinto frequency bands using Fast Fourier Transform (FFT) in [13]. The computed mean absolute deviation and entropy were used to classify ECG segments. 92.59% accuracy was gotten when it was implemented on a Gaussian kernel SVM classifier.
Relying on the statistical and spectral features, [8] employed the use of bootstrap aggregating for the classification of a single -lead ECG, the method yielded 84.14% sensitivity, 86.83% specificity, and 85.97% accuracy. In [14], the extracted features of arterial oxygen saturation signal (Sp02) measured in PSG and the ECG are combined to identify apnea episodes. These features are used to train, test, and validate a neural network, a high accuracy of 93.3% was gotten.
The discrete wavelet transform of ECG, EMG, and EEG signals were computed in [15] to achieve a time -frequency bands and the transform was fed into a Multilayer Perceptron (MLP). 96.87% Specificity, 97.41% sensitivity, and 98.9% accuracy were obtained through combining EMG, ECG and EEG signals. The use of fuzzy set turning algorithm was developed by [16] to identify apnea conditions. Though the method performed below MLP in the wekalibrary Weka is an open source, public machine learning workbench, it exceeded other methods in the library.
In the study of [9], the EEG signals were filtered and disintegrated using the Infinite Impulse Response (IIR) Butterworth band-pass filters. The extracted features like the energy and variance were used as the bases for classification on the SVM, artificial neural networks, linear discriminant analysis and naïve bayes. The system developed had the highest accuracy of 97.14% on the SVM. In [17], the EEG signals was filtered by Infinite Impulse Butterworth Band Pass filter and Hilbert Huang Transform. Extracted features like energy, variance and entropy were fed into classifiers like SVM, Artificial Neural Network, and K-Nearest Neighbors.
Entropy of the frequency band-limited EEG signals was the only feature of classifying apnea in [18]. The frequency band-limited signals was gotten by fast Fourier transform (FFT), then entropy of each frequency band limited EEG signals were then extracted, cascaded, and classified using KNN classifier. The result showed a mean accuracy of 87.64% over a database. While improving on this method, [19] proposed the use of subframes from the EEG signals in place of the earlier full frame and the use of temporal variation in the beta band energy is used for classifying the apnea events in the KNN classifier. The performance increased significantly.
Studies has also been done in the area of applying deep learning to EEG signals to automatically detect apnea events, [20] used the concept of dividing frames of EEG signals into subframes. Each subframeis fed into a fully convolutional neural network (FCNN). The feature vectors of each subframeare concatenated together and fed to a dense classifier (deep neural network) to generate the final features for detecting apnea and non-apnea events. A mean accuracy of 77.14% was achieved.

Database
The EEG dataset was gotten from St. Vincent's University Hospital/ University College Dublin Sleep Apnea Database that is publicly accessible through Physionet [21]. This dataset contains the overnight polysomnography collected from 25 adult subjects who have been previously diagnosed with sleep disordered breathing. The PSG has been scored by sleep expert.
In this research, 5 patients of different apnea hypopnea index are considered. The information of these patients is provided in the table below. From the two EEG channels, C3-A2 channel is considered. The EEG signals are converted into 10-second frames, with a frame either containing apnea event or non-apnea event. For testing, equal number of apnea frames and non-apnea frames are used. The patient's information is provided in table 2.

Preprocessing
The mean value of an EEG test frame is subtracted to remove the dc offset as components of other frequencies are of major interest. These EEG signals are in the time domain. The wavelet decomposition of these frames was done by applying a 1D-wavelet transform. The approximation coefficients and the detail coefficients are used for feature extraction. The Fast Fourier Transform of the EEG frames are also computed which also serve as input for the feature extraction.

Feature Extraction
To enable accurate classification of sleep apnea, features are computed from the time domain, wavelet domain and frequency domain. Features used are Energy, Variance, Skewness, Mode, Standard Deviation, Median, geometric mean, Minimum, Kurtosis, Mean, Entropy, and Maximum. Table 3 below shows the formulae of these features.

CLASSIFICATION
The features generated are used to classify between apnea events and non-apnea events. Two classifiers used are Support vector machine (SVM) and K-Nearest Neighbor (KNN) classifiers.

A. Support Vector Machines (SVM)
It is a type of supervised learning algorithms that can be used for classifications of data samples. the objective is to find a hyperplane in a N-dimensional space (N-the number of features) that distinctly classifies the data points by finding a plane that has the maximum margin. This margin is maximized by using suitable techniques provided by the kernel function. In this research, various kernel functions were used ranging from Radial Basis Function (RBF) kernel, Polynomial kernel, Gaussian kernel, and Linear kernel.

B. K-Nearest Neighbor (KNN)
It is another machine learning classifier algorithm that is used for classification and regression predictive problems. the major parameters used for the classifying include number of nearest neighbors and the distance metric. To achieve high performance, Euclidean distance and MahalaNobis distance are usually adopted. The distance function is computed using the KNN patterns developed from the training set and features extracted from the test set of the EEG signals. Based on the K closer patterns' class labels in the train set, the test set is classified. K values from 1 to 5 are used in this research.

Performance Assessment Metrics
The features extracted from the processed EEG signals are imported into the SVM and KNN classifiers. The performance metrics of these classifiers are evaluated using accuracy, sensitivity, and specificity.
The accuracy is defined by the classifier's ability to distinguish the apnea events from non-apnea events correctly. Accuracy is the number of correct predictions over the total number of predictions.
The sensitivity of this system is its ability to determine the Sleep Apnea cases correctly.

= +
The specificity of this system is its ability to determine the Normal cases correctly.

RESULTS AND DISCUSSIONS
A computer aided system that classifies apnea events and non-apnea events using 5 patients was developed. The inputted signals were sampled at 128Hz and divided into 10-second frame. Features were extracted from the time domain, wavelet and frequency domain of these frames as discussed earlier. The performance of these classifiers was assessed using the accuracy, specificity, and sensitivity. 90% of the dataset was used to train the classifiers and 10% is used for testing. The whole process is done on MATLAB2021a environment. Table below shows the performance analysis of the eight classifiers used in this research with training set and testing set. From the performance analysis, it is seen that the KNN classifier performed best in the accurately clssifying the apnea event and non apnea event. With KNN of order 3 providing the best accuracy of 82.69%. The SVM classifiers performed fairly in the classification with SVM of linear kernel showing promising result of 71.15% accuracy.

CONCLUSION
This study is focused on developing an automatic detection of obstructibve sleep apnea using EEG. The EEG signals was gotten from an open source [21] and the time domain, wavelets and frequency domain of the EEG signals are computed. Statistical features are computed from these domains and these features are used as bases for the classification of apnea events and non-apnea events. The KNN based classifiers outperform the SVM based classifiers with various order of the KNN showing high accuracy as opposed the SVM classifiers. The SVM classifier of linear kernel shows the highest accuracy of 71.15% amongst the SVM based classifier. The KNN of order 3 shows the highest accuracy of 82.69% amongst the eight classifiers used.