Comparative Analysis of the Discriminative Capacity of EEG, Two ECG-Derived and Respiratory Signals in Automatic Sleep Staging

. Highly accurate classiﬁcation of sleep stages is possible based on EEG signals alone. However, reliable and high quality acquisition of these signals in the home environment is diﬃcult. Instead, electrocardiogram (ECG) and Respiratory (Res) signals are easier to record and may oﬀer a practical alternative for home monitoring of sleep. Therefore, automatic sleep staging was performed using ECG, Res (thoracic excursion) and EEG signals from 31 nocturnal recordings of the Sleep Heart Health Study (SHHS) polysomnography Database. Feature vectors were extracted from 0.5 min (standard) epochs of sleep data by time-domain, frequency domain, time-frequency and nonlinear methods and optimized by using the Support Vector Machine -Recursive Feature Elimination (SVM-RFE) method. These features were then classiﬁed by using a SVM. Classiﬁcation based upon EEG features produced a Correct Classiﬁcation Ratio CCR = 0.92. In comparison, features derived from ECG signals alone, that is the combination of Heart Rate Variability (HRV), and ECG-Derived Respiration (EDR) signals produced a CCR = 0.54, while those features based on the combination of HRV and (thoracic) Res signals resulted in a CCR = 0.57. Overall comparison of the results based on standard epochs of EEG signals with those obtained from 5-minute (long) epochs of cardiorespiratory signals, revealed that acceptable CCR = 0.81 and discriminative capacity (Accuracy = 89.32 %, Speci-ﬁcity = 92.88 % and Sensitivity = 78.64 %) were also achievable when using optimal feature sets derived from long epochs of the latter signals in sleep staging. In addition, it was observed that the presence of some artifacts (like bigeminy) in the cardiorespiratory signals reduced the accuracy of automatic sleep staging more than the artifacts that contaminated the EEG signals.


Introduction
Generally  [1].Similarly, in the AASM sleep standards, the NREM stage is sub-grouped into three Stages of N1, N2 and N3 [2].Polysomnography (PSG) or "multiple recording of physiological signals during sleep" is widely used as the "gold standard" clinical technique for the evaluation of sleep and diagnosis of its disorders.In PSG signals such as EEG, ECG, EMG, EOG, Respiration (Res) and others are recorded simultaneously during sleep.Among these signals, EEG is the most commonly used for sleep staging [3].
Because of the significant and pivotal roles that EEG signals play in sleep studies, a wide variety of approaches and techniques have been proposed for Automatic Sleep Staging based on these signals [4], [5], [6], [7] and [8].In reference [4], the authors used singlechannel EEG data to perform sleep stage scoring by leveraging a method called Complete Ensemble Empirical Mode Decomposition (EMD) with Adaptive Noise (CEEMDAN).They used bagging to classify the different sleep states.This work achieved an accuracy of 90.69 % in classifying 5 sleep stages.In another study [5], the investigators extracted many spectral features based on the Fast Fourier Transform (FFT) of multichannel PSG data to classify sleep stages by using a rule-based Decision Tree (DT) classifier and achieved an accuracy of 84 %.
A wide range of time-and frequency-domain features have been explored by the authors in reference [6] based on PSG signals that included two EEG channels, two EOG channels and one EMG channel for automatic sleep stage scoring.Their method based on a Dendrogram-SVM (DSVM), resulted in 92 % accuracy, 94 % specificity, and 82 % sensitivity.Kayikcioglu et al. [7] extracted Auto-Regressive (AR) coefficient features from a single channel EEG signal to classify both sleep and wake stages with an accuracy of 91 % using a Partial Least Squares Regression (PLSR) classifier.
Despite being highly accurate in classifying sleep stages automatically, EEG signals do not easily lend themselves to reliable acquisition in the home environment.This is in stark contrast to ECG and Res signals that have proved to be far easier to record in such environments and may suggest a viable alternative to home monitoring of sleep.Moreover, it has been indicated that the Heart Rate Variability (HRV) signal spectral components produce quantitative markers of sympathetic and parasympathetic activities of the Autonomic Nervous System (ANS), which differ significantly during wake and different sleep stages.As such, using HRV signals to extract information for automatic sleep staging is a promising exploration [9] and [10].
Recently, there has been a surge in the number of approaches to sleep scoring based on ECG and Res signals.For instance, Penzel et al. indicated that the dynamics of HRV signals are different in wake and sleep stages by deploying Detrended Fluctuation Analysis (DFA), [10].In addition, they utilized spectral analysis and DFA so as to extract information from HRV signals separately for automatic sleep staging and discovered that in comparison with spectral analysis, DFA is a more verifiable approach [12].Likewise, Redmond et al. [13], [14] and [15] extracted a variety of useful spectral parameters and time-domain features from 0.5-minute epochs of HRV and Res signals.They managed to attain an accuracy of 79 % in an effort to distinguish among Wake, NREM and REM Sleep Stages by a subject-independent classifier.The accuracy in their investigation plummeted to 67 % in a subjectspecific system [13].Additionally, they could achieve an accuracy of 76.1 % for a 3-class (Wake, NREM Sleep and REM) system employing cardiorespiratory signals [14].Andane et al. [16], used HRV signals for sleep analysis, extracted features by using spectral, time-domain, and DFA methods and were able to separate Wake and Sleep Stages (2 classes) attaining an accuracy of 79.99 %.Similarly, Mendez et al. [17], deployed a time-varying autoregressive model to extract features from HRV signals and used a Hidden Markov Model (HMM) for the purpose of classification.They managed to separate REM and NREM sleep (2 classes) with 79 % accuracy.Kesper et al. [18], also utilized spectral parameters of HRV signals and were able to correctly classify (wake, light sleep, deep sleep and REM sleep) with an accuracy of 57.7 % using 0.5-minute epochs separated from 18 overnight PSG recordings.Carskadon et al. [19], explored the application of the Res signal variability in Wake and Sleep Stages in children.They noticed that the respiration rate and its regularity dropped in NREM Sleep compared to Wake State.Along the same line of work, Miyata et al. initially created surrogate data from raw Res signals as a linear stochastic time series so that the Fourier transform of the surrogate data would be the same as that of the raw Res signal.In their work, they computed the correlation dimensions of the original and the surrogate Res signals and discovered that there was a considerable difference between these values.This further proved that Res signals were generated from a nonlinear underlying system [20].Motivated by these findings, a number of nonlinear techniques have been used in sleep analysis based on cardiorespiratory signals alone.For example, the significance of using approximate entropy of Res signals in Wake and Sleep Stages has been researched [21].Having nonlinear characteristics does not generally lead to the conclusion that the signal exhibits fractal characteristics.Some studies, however, have maintained that Res signals could manifest fractal characteristics [21], [22], [23] and [24].Although a growing body of research has demonstrated that cardiorespiratory signals play a pivotal role in automatic sleep staging, more studies and extensive research are required to establish that cardiorespiratory signals could be reliably used to perform automatic sleep staging.The literature shows that a large number of the recent investigations conducted on automatic sleep staging based on cardiorespiratory signals just separate two stages of sleep [13], [14], [15], [16] and [17].Moreover, as no previous stud-ies have compared the results of automatic sleep staging based on EEG and cardiorespiratory signals, we are highly motivated to perform such an exploration and attempt to fill this gap.
In a previous work [25], we evaluated the utility of ECG as well as the combination of ECG and Res signals in automatic sleep staging based on 5-min (long) epochs.It was observed that acceptable discriminative capacity could be achieved when features were extracted from these long segments.As the standard epoch length for sleep scoring is 0.5-minute, it seemed natural to extend the previous study and use the available long segments to investigate the efficacy of standard epochs in automatic sleep staging.Since standard epochs from Stage 1 were also available in the database (continuous long segments for this Sleep Stage were not available), we were able to include Stage 1 in automatic sleep staging in our current study.
In this investigation, automatic sleep staging was performed as follows: • by using EEG signal features, • by combining HRV and EDR signal features, • by combining HRV and Res signals features.
The feature vectors for each approach were extracted from standard epochs of sleep data by timedomain, frequency-domain, time-frequency, and nonlinear methods and then optimized by using the SVM-RFE method.A SVM classifier was then used to perform classification.The results of automatic sleep staging in this study (standard epochs) were compared with those of our previous research, in which features were extracted from long epochs of cardiorespiratory signals [25].Moreover, automatic sleep staging based on cardiorespiratory signals in the presence of some artifacts (like bigeminy in ECG signals) was explored.

Materials and Methods
Figure 1 shows the block diagram of the algorithm used in this study.First, HRV and EDR signals were extracted from ECG signals.Then, feature vectors were extracted from EEG, ECG-derived, and Res signals.
Subsequently, the extracted feature vectors were optimized by the SVM-RFE method.Finally, the classification of Wake and Sleep Stages was performed by using: • EEG, • combined HRV and RS-EDR (ECG) as well, • combined HRV and Res (Cardiorespiratory) signals.Fig. 1: Automatic sleep staging algorithm using EEG, ECG and Res (thoracic excursion) signals.
These 3 states are represented by three switches.

Polysomnographic Data
The  40).Sleep architecture for these data was determined in each subject according to the Rechtschaffen and Kales (R&K) criteria on standard epochs [1].Generally, atrial fibrillation frequently happens in patients with sleep apnea [27], [28], [29], [30], [31] and [32].In our study, the recordings were selected by considering a Respiratory Disturbance Index 3 Percent (RDI3P ) < 5 to have near-normal characteristics.Therefore, we assumed there were no atrial fibrillations in our database.Regarding the analysis of HRV, it has been suggested to use 5-minute ECG signals to perform a "short-term" HRV analysis [33].
Table 2 shows the number of long epochs of Wake and different Sleep Stages except Stage 1 and standard epochs from Wake and all Sleep Stages for all recordings.First, for each recording, continuous parts of EEG, ECG and Res signals in each sleep cycle were separated and then, long segments of different Sleep Stages were selected manually.Some parts of the data (from the end segments of each cycle) were not continuous 5-minute segments.
Typically about 50-60 % of the total duration of sleep is spent in Light Sleep, 15-20 % in Deep Sleep, 20-25 % in REM Sleep, and 5 % or less in Wake [34].In the database, Wake times records are much more than 5 % but we considered just relaxed Wake or the total time between sleep onset and final wake-up.Therefore, we included a small part of the Wake data (8.11% of the total data for this stage), which happens during sleep times.As there were no continuous long (5-min) epochs available for Stage 1 in the database, we could not include this sleep stage in our previous study [25].
However, when we carried out the current investigation, we were able to make use of the 0. As the main goal of this study was to perform the comparative utility and analysis of EEG and cardiorespiratory signals in automatic sleep staging, we excluded continuous long segments polluted with artifacts in the first part of the study so that the results would be independent of artifacts.For example, continuous long segments with bigeminy were not used.The algorithm was tested on the remaining continuous long segments.It is important to note that in the selection of continuous long segments, there were still transition points between Sleep Stages, as some of these segments belonged to the beginning and the end portions of each sleep cycle.

Feature Extraction
As mentioned above, we investigated automatic sleep staging by applying a variety of advanced digital processing methods to EEG, ECG, and Res signals to preprocess and analyze these signals.Then we extracted different sets of features from EEG, ECG (HRV, EDR) and Res (thoracic excursion) signals, the details of which are presented in the following sections.

1) Feature Extraction from EEG Signals
The 0.5-minute (standard) epochs of electroencephalographic signals were acquired from EEG channels C3-A2 and were used for feature extraction.These signals were first normalized based on their means and standard deviations for each subject.They were then filtered by an 8th order elliptic band pass filter with cutoff frequencies of 0.5 and 40 Hz, and subsequently 5-feature sets (a total of 34 features) were extracted from these data.

Time-Frequency Features
The Daubechies10 (db10) mother wavelet was used for analyzing the EEG signals.A Wavelet Packet Transform (WPT) with 7 levels was applied and the frequency domain information of the following 6 bands was selected.In general, the wavelet decomposition of a given signal x(t) is presented by: In wavelet decomposition, Parseval's theorem relates the energy of the signal x(t) to the energy in each one of the components and their wavelet coefficients, provided that the scaling functions (ϕ(t)) and the wavelets (ψ(t)) form an orthonormal basis [35].Parseval's theorem for discrete wavelet transform is given by Eq. ( 2): Subsequently, Shannon entropy in these frequency bands was calculated from wavelet coefficients in standard epochs of EEG signals using Eq. ( 3) below where C(i)s represent wavelet coefficients in each frequency band: Next, the following features were calculated for the frequency bands 1 to 6, which were then used to represent the time-frequency distribution of the EEG signals: • Mean quadratic value or Energy of Wavelet Packet (WP) coefficients for each of the 6 bands (E 1 , E 2 , . . ., E 6 ), • Total Energy (E 7 ), • Ratio of different Energy values (E 8 , E 9 , E 10 ), • Shannon Entropy of wavelet packet (WP) coefficients for each of the 6 bands (Entropy 11 , Entropy 12 , . . ., Entropy 16 ) E i → The total Energy of all 6 bands,

Frequency-Domain and Time-Domain Features
Frequency-domain and time-domain features included: the relative spectral energy in 6 frequency bands, the power value and frequency related to the peak point of the power spectrum, the harmonic parameters and Hjorth parameters, as well as the mean absolute value of EEG amplitude, which will be defined in the following section.In order to extract all these features (except the mean absolute value of EEG amplitude), it was necessary to calculate the power spectrum of the EEG signals.Among the many different methods for the calculation of power spectrum, the AutoRegressive (AR) modeling-based method was used as it offers better accuracy, smoother spectra, and higher spectral resolution compared to other methods.For the selection of an appropriate order for the AR model, the Minimum Description Length (MDL) and Akaike methods were used.Here we implemented a 10 th -order AR model for 10-second long EEG segments [36], [37] and [38].The AR coefficients were estimated by the Burg method.These features were extracted in three 10-second segments in each standard epoch and the average of three feature vectors formed the final one.
• Relative Spectral Energies The power spectrum of EEG signals was first estimated and the total power was then calculated in the frequency interval 0.5-40 Hz.Then power in 6 frequency bands, as described in section a (above), were calculated and rounded up to the upper integer (Delta: 0.5-4Hz, Theta: 4-8 Hz, Alpha: 8-12 Hz, Spindle: 12-16 Hz, Beta1: 16-24 Hz, Beta2: 24-40 Hz).Finally, these power values were normalized with respect to the total power in order to obtain the relative spectral energies.

• Power Value and Frequency at Power Spectrum Peak
There were several peaks and valleys in the power spectrum of the EEG signals.First, a peak with the maximum power value was selected.Then, the peak power value and the related frequency were selected as 2 features.

• Harmonic Parameters
Harmonic parameters are defined as follows: In Eq. ( 4), Eq. ( 5), and Eq. ( 6), p(f ) is signal power spectrum, and f L and f H are minimum and maximum frequencies, respectively.The f (c) and f (σ) in Eq. ( 4) and Eq. ( 5) are similar to normalized values of mean frequency and standard deviation of frequency.

• Hjorth Parameters
The n-order spectral moment is defined in Eq. ( 7): where p(f ) is the power spectrum.The power spectrum is the Fourier transform of the autocorrelation function.In the following, R(τ ) is the autocorrelation function, and R(0) is the variance of the signal: Therefore, a 0 is the signal's variance, a 2 is the variance of the derivative of the signal, and a 4 is the variance of the second derivative of the signal.In addition, there is a relationship between the signal and its spectral moment: a 2n = σ 2 n .Based on these spectral moments, Hjorth parameters were calculated as follows: In these equations, all a parameters were first estimated by Eq. ( 12), and then Hjorth parameters were calculated: As sleep EEG is a nonstationary signal, its spectral moments are variable with time.Therefore, these features can be useful in sleep EEG analysis [37], [38] and [39].

• Mean Absolute Value of EEG Signal Amplitude
The amplitudes of EEG signals are different in Wake and various Sleep Stages.For example, the amplitude of these signals increases in Deep Sleep and decreases in REM Sleep.Therefore, the mean absolute value of the EEG signal amplitude was considered as a feature for further analysis.

Nonlinear Features
The nonlinear dynamic features included DFA-based features and entropy measures.The DFA-based feature extraction consisted of five steps.First, the profile of a zero-mean normalized time series of length N was determined: Then, the profile was divided into N n = N/n nonoverlapping segments.Subsequently, a local trend for each segment of the data was calculated (by using a first-degree polynomial) and then subtracted from the profile: z n (j) = Y (j) − P n (j, s), Afterwards, the variance of the detrended time series Z n (j) was calculated for each segment: Finally, the square root of the average over all N n segments was calculated to obtain the DFA fluctuation function as follows: For calculation of α feature of the DFA in standard epochs of EEG signals, 30 values for n in the interval {4.30 × f s(3750)} were considered [40].The value of α was then calculated as the slope of the (logF (n)) versus log(n) for different scale values n: where: In the above equations (X i , X j ) are m-dimensional pattern vectors, whose components are time-delayed versions of the elements in the original time series with delay τ , a multiple of the sampling period, as follows: and d |X i , X j | is a measure of the distance between X i and X j .For large values of N , the ApEn is given by: where A i is the number of X i s within tolerance r of X j s for the (m + 1) -dimensional pattern vector and B i is the number of X i s with tolerance r of X i s in the m-dimensional pattern vector.
Sample Entropy (SampEn) is another measure of complexity [41], which is very similar to ApEn.The main difference between these two measures is how selfcounting is handled in their computation.In ApEn calculation, self-counting is included at each iteration to prevent computing the natural logarithm of zero.However, in the calculation of SampEn, the natural logarithm is computed once and self-counting is excluded by requiring that i = j in Eq. (20).SampEn is computed by modifying the ApEn formula given in Eq. ( 20) to: The calculation of ApEn and SampEn of EEG signals requires a priori specification of some unknown parameters as: m, the Embedding Dimension (ED)−r, a tolerance value and τ , the time delay.For our investigation the following values were selected: m = 2, r = 0.5 times the standard deviation of the data [21], [41] and τ = 11 samples (0.09 second), [21].The time delay was determined as the lag at the point for which the autocorrelation function of the signal was near zero for the first time.

2)
Feature Extraction from HRV, ECG-Derived Respiration (EDR) and Res Signals In this section we describe the processing of the ECG and Res signals listed in Tab. 2. First, HRV and RS-EDR signals were derived from ECG signals and then features were extracted.

HRV and ECG-Derived Respiration (EDR) Signals
The selected ECG segments were filtered by using a FIR band pass filter with low and high cut-off frequencies of 8 and 20 Hz, respectively [42].In order to extract HRV signals, QRS complexes were first detected by using an Enhanced Hilbert Transform (EHT) algorithm [43] and then were assessed manually for correcting the missing beats.The details of our HRV signal derivation algorithm from ECG segments are reported elsewhere [44].
For the extraction of the EDR signal, some studies in the literature have used 2 leads of ECG signals [45], [46], [47] and [48], while others took advantage of more than 2 leads [46].In our investigation, however, we made use of ECG lead II alone as this lead seems to be very popular in the most recent literature [50], [51], [52], [53], [54], [55], [56], [57] and [58].Therefore, the EDR signals were extracted from lead II ECG signals by using the RSampl or RS-EDR method [56].The procedure for the extraction of RS-EDR signal from ECG segments is explained in detail in our previous work [25].

Feature Extraction from HRV, Res and RS-EDR Signals
• HRV Signals A 4-feature set was extracted from the HRV signals using standard epochs as follows: • The time-domain features including: the median, the Inter-Quartile Range (IQR), the Mean Absolute Difference (MAD), the mean, the standard deviation and the range.
• The nonlinear dynamics features including: DFAbased feature α, which represents the slope of the logF (n) versus log(n) in the range 10 ≤ n ≤ 30 (before DFA feature extraction, a 1 Hz re-sampling was applied to HRV data) and entropy measures (Shannon entropy, ApEn and SampEn).
• DWT-based features including: the normalized values of energy in the VLF, LF, and HF bands (Waves 1:3), the energies in LF/HF (Wave 4), Shannon entropy in VLF, LF, and HF bands (Waves 5:7), the ratio of entropies in the LF and HF bands (Wave 8).
• The Empirical Mode Decomposition-based (EMDbased) features consisting of: normalized values of energy in the VLF, LF, and HF bands computed by the Hilbert energy spectrum (EMD 1:3), the ratio of energies in the LF and HF bands (EMD 4), harmonic parameters such as the central frequency, the deviation of central frequency and the energy in central frequency were extracted from the Hilbert amplitude spectrum (EMD 5-7), ApEn (EMD 8) and SampEn (EMD 9) were calculated from the most significant IMF of the standard epochs.To calculate ApEn and SampEn from HRV signals, m = 2, r = 0.2 times the standard deviation of the data and τ = 1 sample were selected [59].
When exploring the utility of the DFA and EMD methods in feature extraction from HRV signals using long and standard epochs, we had to make some provisions in our approach.In long epochs of HRV we extracted 10 Intrinsic Mode Functions (IMFs) by the EMD method and the ApEn and SampEn from the 4 most important IMFs were calculated, while in standard epochs we could only extract 2 IMFs and the most important IMF was used in calculation of entropies.
In summary, 34 features were extracted from long epochs, and 27 features from standard epochs of HRV signals.Also, 11 features were extracted from Res signals, which will be explained in the following sections.Automatic sleep staging was then performed using features extracted from a combination of HRV and Res signals in standard and long epoch lengths.

• Res (Thoracic Respiratory) Signals
For this investigation, the Res signals (thoracic excursion) recorded by inductive plethysmography bands and sampled at 10 Hz were used.First, Res signals were filtered by a 10 th order Butterworth low pass filter with a 0.8 Hz cut-off frequency in order to remove high frequency noise and variations above the respiratory frequency.Then, a 6-point moving average filtering method was used to smooth out the Res signals and to remove additional peaks.Finally, since the signal was not calibrated in terms of absolute Tidal Volume (TV), we normalized it for each subject and considered only relative differences.The thoracic Res signals were normalized by first detecting the turning points and then calculating the differences between sequential peaks and troughs.The median peak-to-trough amplitude over the entire record was subsequently determined and the signal was normalized by dividing into this value, resulting in median peak-to-trough amplitude equal to unity [39].The median was more robust to outliers and did not move (change) unless more than half of the signal was contaminated with noise, which in the plethysmogram can be extreme and create very large peak-to-trough values, and can skew the mean.
The steps involved for feature extraction from 0.5minute epochs of Res signals in Wake and different Sleep Stages were as follows.First, peaks and valleys of thoracic Res signals were detected.Then the missed peaks were corrected by the procedure explained in our previous work [25].Finally, the TV and the Respiration Rate (ResR) were calculated as the amplitude difference between a successive peak and valley, and the number of breaths per minute, respectively.Typically, the Tidal Volume is the volume of air exhaled during a breath.Therefore, the TV by definition is the difference between the maximum and minimum volume or the integral of the area under the expiratory flow.ResR is the breathing frequency per minute.In this study, the mean, standard deviation and coefficient of variation (standard deviation • 100/mean) of the TV and ResR were computed as features.Other features, such as ApEn, SampEn and Shannon Entropy, were extracted from Res signals.We chose m = 2, r = 0.2 times the standard deviation of the data, and τ = 11 sample (1.1 second), [18] for this purpose.Finally, the peak frequency of Res signals and the power value in peak frequency were extracted.The Power Spectral Densities (PSDs) of Res signals were estimated by using the nonparametric method and a 1024-point FFT (Fast Fourier Transform).Totally, 11 features were extracted from the 0.5-minute epochs of thoracic Res signals.

• RS-EDR Signals
The procedure for the feature extraction from RS-EDR signals was the same as that used for Res signals.First, peaks and valleys were detected by the method explained in our previous work [25].Then, the mean, standard deviation and coefficient of the variation of the TV and ResR were computed.The Shannon Entropy, ApEn, SampEn, peak frequency and power value at peak frequency were calculated from RS-EDR signals too.Therefore, the feature extraction procedure in 0.5-minute epochs of Res and RS-EDR signals was the same as the feature extraction procedure in 5-minute epochs.

Classification
A Support Vector Machine (SVM) classifier was used for automatic sleep staging.The SVM separating hyperplane was calculated by solving the quadratic optimization problem.The Radial Basis Function (RBF) kernel k(x, y) = e −γ x−y d , and the one-against-one method were used for the SVM multi-class classification.The details of classifier training and test procedure are reported in our previous work [25].
The dataset was divided into the training and test sets.It can be seen in Tab. 2 that the Wake Stage has the minimum number of epochs.In staging 0.5-minute epochs, 30 % of the clean epochs in the Wake Stage (0.30 • 790 = 237) were randomly selected for training.In order to get comparable results for all Sleep Stages, equal number of epochs in other Stages was used for training.In staging 5, 4, 3, 2, 1-minute epochs, 80 % of clean epochs in each Stage, were randomly used for training.The performance of the classifier was tested on the remaining epochs in each Stage.
The SVM Recursive Feature Elimination (RFE) method was used for feature selection.This method was developed by Guyon, et al. and has been used in gene selection for cancer classification [61].In the SVM-RFE method, the effect of removing a feature on an objective function is used as a ranking criterion.Guyon and co-workers used the margin [61] or Total Error Rate (TER), [16] as objective function.In our study here, Correct Classification Ratio (CCR) was used as ranking criterion.We optimized 3 sets of features, which were extracted from 0.5-minute epochs of: • EEG (34 features), • HRV and Res signals (38

Results
In the first phase of this study, we automatically classified the Wake, Stage 1, Stage 2, SWS and REM Sleep by using EEG, combined HRV and RS-EDR, as well as combined HRV and Res features.Feature vectors were extracted from 0.5-minute (standard) epochs.We used a SVM classifier and the optimal parameters for this classifier were found by the procedure described in the Classification section.The SVM-RFE ranking method was applied to 34 features extracted from EEG signals.
The best results were obtained when using 25 features.
The discriminative capacity (classification results) for the best 25  Similarly, the SVM-RFE ranking method was applied to the 38 features (extracted from HRV and RS-EDR signals).The best results were obtained when using 24 features.
The classification results for the best 24 features derived from the HRV and RS-EDR signals are presented in Tab. 4.
Finally, the SVM-RFE ranking method was applied to the 38 features (extracted from HRV and Res sig- In our previous work, we performed automatic sleep staging to distinguish between Wake, Stage 2, SWS and REM Sleep by using combined HRV and RS-EDR, as well as combined HRV and Res features based on feature vectors extracted from 5-minute (long) epochs.The results are presented here for comparison.The classification results for the best 35 features derived from the combination of HRV and RS-EDR signals are presented in Tab.6, [25].
Similarly, the classification results for the best 27 features derived from the combined HRV and thoracic Res signals are presented in Tab. 7, [25].

Discussion
The The feature vectors were extracted intelligently to appropriately satisfy the requirements of a research study focused on performing automatic sleep staging.Our careful review of the sleep physiology literature revealed that heart and respiration rates varied considerably during Wake and different Sleep Stages.The time-domain and time-frequency methods were used for measuring the variations of the heart rate in Wake and different Sleep Stages [9], [33] and [62] as well as their manifestations in the Autonomic Nervous System (ANS) activity.In addition, some of the features were extracted by nonlinear dynamics system analysis methods.This approach seemed plausible, as it has been shown in the literature that both the linear and nonlinear characteristics of physiologic systems like the one underlying the generation of HRV signals should be considered simultaneously [63].It should be mentioned that the EMD method was used for the extraction of some new features in our investigation.This method is more compatible with nonlinear characteristics of physiological systems than the DWT (and it does not have the limitation of having to choose the mother wavelet).Ordinarily, the respiration rate and depth are different in Wake and Sleep Stages.These differences were measured by the calculation of the mean, standard deviation, and the Coefficient of Variation (COV) of Respiration Rate and Tidal Volume.Calculating entropy and deploying the DFA method enabled us to evaluate the regularity and fractal characteristics of Respiratory Signals.For performing automatic sleep staging based on EEG signals, we extracted different features to analyze the amplitude and frequency variability and nonlinear characteristics of these signals.
Different sets of features were extracted from HRV, RS-EDR, Thoracic Respiratory and EEG signals.The significance of most of these features was evaluated by applying popular statistical methods (ANOVA and ttest) and was reported in our previous works [25] and [44].The SVM-RFE method was used for the selection of sub-optimal feature sets and the classification of Sleep Stages was achieved by using a SVM classi-fier.Automatic sleep staging was performed based on features extracted from 0.5-minute (standard) epochs of EEG signals and by combining features from HRV and Respiratory (reference or RS-EDR) signals derived from both 0.5-minute (standard) and 5-minute (long) epochs of these cardiorespiratory signals.In automatic sleep staging of Wake, Stage 1, Stage 2, SWS and REM Sleep we were able to generate the following results: • an accuracy of 95.89 % with a CCR = 0.92 when we used 0.5-minute epochs of EEG signals, • an accuracy of 76.02 % with a CCR = 0.54, when features were derived from standard epoch lengths of a HRV + RS-EDR signals, • an accuracy of 78.87 % with a CCR = 0.57 when features were extracted from standard epoch lengths of a combination of HRV + Res signals.
It should be pointed out that we used the same labels in training for classifications based on the EEG, HRV + RS-EDR, as well as HRV + Res signals.We also tested our algorithm by using the same label of data samples so that the results would be comparable.We achieved excellent results by performing sleep staging using the standard epoch length of EEG signals and showed that cardiorespiratory signals would not produce acceptable outcomes based on this short epoch length.
As HRV and Respiratory signals are signals with slow dynamic and as "short-term" HRV analysis requires a recommended epoch length of 5 minutes [33] to perform automatic sleep staging by cardiorespiratory signals, we also extracted feature vectors based on 5-minute epochs of these signals.With these feature vectors we were able to distinguish among Wake, Stage 2, SWS and REM Sleep with the following results: • an accuracy of 89.32 % with a CCR = 0.81 based on HRV + Res signals, • an accuracy of 83.85 % with a CCR = 0.7 by using HRV + RS-EDR signals [25].
In summary, we observed that automatic sleep staging results when using 0.5-minute (standard) epochs of EEG signals were comparable with results obtained based on HRV + Res signals in 5-minute epochs.In addition, sleep staging results based on HRV + RS-EDR signals (or ECG signal alone) were also acceptable when classification was done in 5-minute epochs.
It is important to emphasize that the abovementioned results were obtained when features were extracted from artifact-free (clean) signals listed in Tab. 2. However, when we applied our algorithm to the entire 0.5-minute epochs of EEG data (both clean and with artifact), to discriminate among Wake, Stage 1, Stage 2, SWS and REM Sleep Stages, the accuracy decreased from 95.8 % with a CCR = 0.92 to 92.8 % with a CCR = 0.85.In distinguishing between Wake, Stage 2, SWS and REM Sleep, using all 5-minute epochs (both clean and with artifact) based on HRV +Res signals, the accuracy decreased from 89.3 % with a CCR = 0.81 to 81.1 % with a CCR = 0.63.Therefore, when the algorithm was applied to all epochs (clean and artefactual), the reduction of the accuracy of automatic sleep staging by cardiorespiratory signals was more pronounced than the case when noisy EEG signals were used.This happens due to the presence of some artifacts (like bigeminy) in ECG signals.

Conclusion
In this study, we successfully applied a variety of feature extraction methods to derive discriminative and informative features from EEG and cardiorespiratory signals.Sub-optimal feature sets were found by the SVM-RFE method and classified by using a SVM classifier.We observed that the EEG signals could produce excellent outcomes in automatic sleep staging when feature vectors were extracted from 0.5-minute (standard) epochs.We also made the general observation that reasonably good results could be achieved when sleep staging is performed based on features derived from 5-minute epochs of the combination of HRV and Res signals.Moreover, ECG signals alone could produce acceptable results (when feature vectors were extracted in 5-minute epochs).Therefore, the closer the RS-EDR signals resembled the reference respiratory signals, the better the results by ECG signals alone became.
Here we strived to perform a comprehensive investigation into automatic sleep staging based on simultaneous analysis of EEG and cardiorespiratory signals.We demonstrated that automatic classification of Wake and different Sleep Stages is possible by extracting feature vectors from long epochs of cardiorespiratory signals alone.In addition, we observed that the presence of some artifacts (like bigeminy) decreases the classification results based on cardiorespiratory signals more than those achieved from noisy EEG signals.We extracted features by using a combination of linear and nonlinear methods.More features could be added to these extracted features to improve the classification results based on cardiorespiratory signals alone.For example, recent research has shown that current algorithms used to perform spectral analysis of HRV signals are not able to completely separate the sympathetic and parasympathetic components of the HRV signals as manifested in the LF and HF bands [10], [33], [62] and [64].Recently a method called Principal Dynamic Mode (PDM) analysis of HRV signals that allows more precise decomposition of the HRV signal spectral components and hence complete separation of the sympathetic and parasympathetic influences of the ANS activity was presented in the literature [65].In our future work, we envision using the PDM approach in achieving more precise spectral analysis of the HRV signals and investigating the variations of features extracted from them in the Wake and Sleep Stages.Moreover, it has been shown that cardiac and respiratory rhythms could synchronize with different ratios.A pronounced sleep-stage dependency has been observed with the degree of synchronization: low during REM and Wake, higher during Light Sleep, and most pronounced during Deep Sleep [66] and [67].These synchronization ratios could serve as useful features and would inform our future algorithm enhancements in performing automatic sleep staging based on cardiorespiratory signals alone.

Figure 2
Figure 2 show the decomposition of the EEG signals by using Wavelet Packet Transform (WPT) at 7 levels.

Figure 3
Figure 3 shows the CCR values versus the number of best features in a decreasing fashion (from n features to 1 feature) in classification by EEG signals (in 0.5-minute), HRV+EDR signals (in 0.5-minute), HRV+RES signals (in 0.5-minute), HRV+EDR signals (in 5-minute) and HRV+RES signals (in 5-minute).In features with 27 features from HRV and 11 from Res signals), features derived from the EEG signals is (are) presented in Tab. 3.
From right to left, each point in this diagram is the best possible subset (which maximizes CCR) of m features (m is changed from n to 1).When a feature is removed, all possible n-1 combinations of n remaining features is checked, it means that the removed features in previous steps cannot be tested in the subsequent combinations.The best result in 0.5-min was obtained by the combination of 25 features for EEG signal, 24 features for HRV + EDR signals, and 22 features for HRV + RES signals.For comparison, in 5-min epochs, the best results was obtained by the combination of 35 features for HRV + EDR signals, and 27 features for HRV + RES signals.