Electrophysiological recordings are considered a reliable method of assessing a person’s alertness. Sleep medicine is asked to offer objective methods to measure daytime alertness, tiredness and sleepiness. As EEG signals are nonstationary, the conventional method of frequency analysis is not highly successful in recognition of alertness level. In this paper, EEG signals have been analyzed using wavelet transform as well as discrete wavelet transform and classification using statistical classifiers such as euclidean and mahalanobis distance classifiers and a promising method SVM (Support Vector Machine). As a result of simulation, the average values of accuracies for the Linear Discriminant Analysis (LDA)Quadratic, kNearest Neighbors (kNN)Euclidean, and Linear SVM were 48%, 34.2%, and 86%, respectively. The experimental results show that SVM classification method offer the better performance for reliable classification of the EEG signal in comparison with the other classification methods.
1. INTRODUCTION
One of the important applications of electroencephalogram (EEG) processing is the study of the time course of alertness and vigilance of operators who perform monotonous but attention demanding tasks (air traffic controllers, lorry drivers, etc.)
[1

5]
. The objective is to avoid potential accidents generated by decreased vigilance using a realtime system which can continuously monitor vigilance, thereby preventing accidents caused by attention deficit. So, EEG signals give important information about the vigilance states of any subject. But conventional method of classification of EEG signals using mutually exclusive time and frequency domain representations does not give efficient results.
Therefore, the aim of this study was to establish a method for processing input data from a set of statistical features, which was extracted from discrete wavelet transform (DWT) subbands of EEG recordings, by the use of support vector machine (SVM) that distinguishes between alert, drowsy and sleep states in arbitrary subjects. EEG distinguishes between states of vigilance, that is, wakefulness and sleep, and to some extent between the ‘levels’ of vigilance within a state. The EEG frequency spectrum is subdivided into
δ
(1–4
Hz
),
θ
(4–8
Hz
),
α
(8–13
Hz
),
β
(13–30
Hz
) and
γ
(>30
Hz
) frequency ranges. During wakefulness,
α
and
θ
frequencies in the awake state EEG are of particular interest for research on sleepiness
[6]
.
During active wakefulness (with eyes open),
α
power is usually low unless the subject is severely fatigued. However, in resting conditions (with eyes closed),
α
power is also high when the subject is fully rested. During the transition from resting conditions, with eyes closed, to sleeping a gradual reduction of
α
power and a gradual increase in q power occurs. Reduced a power and increased
θ
power during resting awake periods, with eyes closed, may thus indicate a high motivation for sleeping. Indeed, it was found that subjective sleepiness during awake periods correlates negatively with
α
power and positively with
θ
power in the awake EEG during prolonged wakefulness.
Spontaneous electrical brain activities, that are EEG signals, are dynamic, stochastic, nonlinear and nonstationary
[7

9]
. The EEG recordings depend on the location of the electrodes, their impedance and the state of alertness.
In addition, the EEG recordings vary substantially between healthy subjects.
Recently, some studies
[10
,
11]
concentrated on detecting the information on drowsiness available from a full EEG spectrum.
[12]
used power spectrum analysis of EEG signals for estimating visual attention.
[13]
worked on developing an automatic procedure for arousal detection during sleep.
They tested this on a group of subjects, in different pathological conditions by using wavelet transform.
In numerical analysis and functional analysis, a discrete wavelet transform (DWT) is any wavelet transform for which the wavelets are discretely sampled.
As compared to the conventional method of frequency analysis using Fourier transform or short time Fourier transform, wavelets enable analysis with a course to fine multiresolution perspective of the signal
[14]
. In this work, discrete wavelet transform (DWT) has been applied for the time–frequency analysis of EEG signals and SVM for the classification using wavelet coefficients. EEG signals were decomposed into frequency subbands using discrete wavelet transform (DWT). Then a set of statistical features was extracted from the subbands to represent the distribution of wavelet coefficients.
2. MATERIALS
 2.1 Subjects
In this study, EEG signals were obtained from 20 subjects. The group consisted of 9 females and 11 males with ages ranging from 18 to 65 years and a mean age of 40 years, and a Body Mass Index (BMI) of about 35
Kg
/
m
^{2}
. Subjects with normal intelligence and without mental disorders were included in this study after passing the neurological screening. All recordings were performed in accordance with medically ethical standards.
 2.2 Sleep EEG and Specifications of Stages
Sleep is a state that does not react to the surrounding environment and reduces feeling. Also, sleep is divided into several sleep stage according to EEG signals (see
Fig. 2
).
Here, let's take a closer look at the four stages of sleep:
• Stage W(Wake) :
It is the stage of alertness through falling into sleep. In this section there may a more clear distinctiveness and little amount of slowness in alpha rhythms. Beta rhythms may be observed and this may continue through the stage 1 of sleep. Especially, this stage of sleep is seen more when the sleep is provided under condition of sedative effects. Stage 1 sleep is light sleep where you drift in and out of sleep and can be awakened easily. In this stage, the eyes move slowly and muscle activity slows. During this stage, many people experience sudden muscle contractions preceded by a sensation of falling.
• Stage 1:
This stage takes start with attenuating alpha rhythms and revealing 27
Hz
slow waves. In early periods of this stage, many peoples’ EEGs have low amplitude and mixed frequency activities. However, midamplitude slow wave drains right after attenuation of alpha rhythms might be encountered on some subjects. Alpha rhythms might be repeated in short time intervals. This is the instant when light stimulus paradoxical alpha rhythms are visualized. Muscle activity gets slower and slow eye movements may occur and last a few seconds.
• Stage 3:
It can be distinguished by high amplitude and slow waves. 2050% of the whole sleep recording period is occupied by the waves which are 2
Hz
and have amplitude above 75 microvolts. Kcomplexes may happen and sleep needles may not. When a person enters stage 3, extremely slow brain waves called delta waves are interspersed with smaller, faster waves.
• Stage R(REM):
This stage can be distinguished by low voltage EEG patterns, rapid eye movements and generally attenuated muscle movements. Dreams are seen in this stage of the sleep. Even though some visual and behavioral patterns of EEG make the experts consider that this stage is a light sleep stage, increase of the auditory stimulants awakening threshold value shows that sleep is deepening in this stage. Therefore this stage is a deep sleep period. In the REM period, breathing becomes more rapid, irregular and shallow, eyes jerk rapidly and limb muscles are temporarily paralyzed. Brain waves during this stage increase to levels experienced when a person is awake. Also, heart rate increases, blood pressure rises, males develop erections and the body loses some of the ability to regulate its temperature. This is the time when most dreams occur, and, if awoken during REM sleep, a person can remember the dreams. Most people experience three to five intervals of REM sleep each night.
 2.3 EEG data acquisition and representation
Silverplated electrodes were used for the recordings, and a C3–A2 standard settlement was applied to the subject of the experiment, according to the 10–20 international electrode placement system (see
Fig. 1
).
The international 1020 system seen from (a) left and (b) above the head.
The EEG data used in this study was taken from GRASS MODEL78 EEG & POLYGRAPH data recording system. The recordings were band pass filtered between 0.3 and 50
Hz
. The EEG recordings were digitalized with 12bit resolution, at a sampling rate of 128
Hz
per channel. Eight channels of the instrument can be used at the same time. Each channel can be gained distinctly and has at most 1000
Hz
sampling rate. Each record was scored by two experts for alertness level staging, with a link to the recording. The system provides realtime data processing. Different EEG epochs have been given in
Fig. 2
. The signals were recorded during the 6∼8hour episodes. Then these EEG recordings were divided into 5second epochs and 75% overlapped, and these epochs are divided into four frequency subbands
α
,
β
,
θ
and
δ
by using discrete wavelet transform (DWT).
Different EEG signals.
3. METHODS
 3.1 Analysis using discrete wavelet transform
Signal processing techniques are part and parcel of EEG analysis. The sleep EEG signal is nonstationarity and wavelet analysis is very useful for analysis of nonstationary signals. Specially, wavelet transform has a good timeanalysis ability for high frequency component, and has a good frequencyanalysis ability for low frequency component. Discrete wavelet transform (DWT) is a efficient tool applied not only to the field of such signal processing as noise elimination and image compression but also in the analysis of disturbances in waveforms owing to its capability to detect discontinuities.
In this section, we used the technique of discrete wavelet transform (DWT) to characterize the various sleep stages associated with human sleep.
 3.1.1 Wavelet transform
The wavelet transform specifically permits to discrimination of nonstationary signals with different frequency features
[15]
. A signal is stationary if it does not change much over time. Fourier transform can be applied to the stationary signals. However, like EEG, plenty of signals may contain nonstationary or transitory characteristics. Thus it is not ideal to directly apply Fourier transform to such signals. The wavelet transform decomposes a signal into a set of basic functions called wavelets. These basic functions are obtained by dilations, contractions and shifts of a unique function called wavelet prototype. Continuous wavelets are functions generated from one single function
j
by dilations and translations
[16

19]
.
Where
b
is real valued and called the shift parameter. The function set
is called a wavelet family. Since the parameters (
a
,
b
) are continuous valued, the transform is called continuous wavelet transform. The definition of classical wavelets as dilates of one function means that high frequency wavelets correspond to
a
< 1 or narrow width, while low frequency wavelets have
a
> 1 or wider width. In the wavelet transform,
f
(
t
) is expressed as linear combination of scaling and wavelet functions. Both scaling functions and the wavelet functions are complete sets
[16]
. However, it is common to employ both wavelet and scaling functions in the transform representation. In general, the scale and shift parameters of the discrete wavelet family are given by
where
j
and
k
are integers. The function family with discretized parameters becomes
is called the discrete wavelet transform (DWT) basis. Although it is called DWT, the time variable of the transform is still continuous. The discrete wavelet transform (DWT) coefficients of a continuous time function are similarly defined as
When the Discrete Wavelet Transform(DWT) set
is complete, the wavelet representation of a function
f_{w}
(
t
) is expressed as
In general, a function can be completely represented by using Lfinite resolutions of wavelet, and the scaling function with parameters value of
a
_{0}
= 2 and
b
_{0}
= 1 as
where scaling coefficients
C_{L,K}
are similarly defined as
and
 3.1.2 Subband decomposition of discrete wavelet transform (DWT)
The Discrete Wavelet Transform (DWT), which is based on subband coding, is found to yield a fast computation of wavelet transform. It is easy to implement and reduces the computation time and resources required. The Discrete Wavelet Transform (DWT) of a sequence x[n] is calculated by passing it through a series of half band high pass and low pass filters.
Fig. 3
shows Subband decomposition of discrete wavelet transform (DWT) implementation. The low pass filter is denoted by g[n] while the high pass filter is denoted by h[n].
Subband decomposition of DWT implementation; h[n] is the highpass filter, g[n] is the lowpass filter.
Selection of suitable wavelet and the number of levels of decomposition is very important in analysis of signals using discrete wavelet transform (DWT). The typical way is to visually inspect the data first, and if the data are kind of discontinuous, Haar or other sharp wavelet functions are applied; otherwise a smoother wavelet can be employed. Usually, tests are performed with different types of wavelets and the one which gives maximum efficiency is selected for the particular application. The number of levels of decomposition is chosen based on the dominant frequency components of the signal. The levels are chosen such that those parts of the signal that correlate well with the frequencies required for classification of the signal are retained in the wavelet coefficients. Since the EEG signals do not have any useful frequency components above 30
Hz
, the number of levels was chosen to be 4. Thus the signal is decomposed into the details D1–D4 and one final approximation, A4. The ranges of various frequency bands are shown in
Table 1
. Daubechies order 2 wavelet transform was applied to the stage1, stage3, stage R and stage W signals.
Fig. 4
shows four different levels of approximation (identified by A1–A4 and displayed in the left column) and details (identified by D1–D4 and displayed in the right column) of an EEG signal.
Frequencies corresponding to different levels of decomposition for Daubechies order 2 wavelet with a sampling frequency of 128Hz.
Frequencies corresponding to different levels of decomposition for Daubechies order 2 wavelet with a sampling frequency of 128 Hz.
Daubechies order 2 wavelet transform of stage EEG signal, respectively.
These approximation and detail records are reconstructed from the wavelet coefficients. Approximation A3 is obtained by superimposing details D4 on approximation A4. Approximation A2 is obtained by superimposing details D3 on approximation A3. Finally, the original signal is obtained by superimposing details D1 on approximation A1. Wavelet transform acts like a mathematical microscope, zooming into small scales to reveal compactly spaced events in time and zooming out into large scales to exhibit the global waveform patterns
[20]
.
4. CLASSIFICATION ALGORITHMS
After selecting the most discriminatory features, we apply Linear Discriminant Analysis (LDA), kNearest Neighbors (kNN), and Support Vector Machine (SVM) to obtain accuracy on our testing samples. The classification results of these algorithms can be used to compare the effectiveness of various feature selection methods.
•
LDA
uses the distance between cluster centers and data to assign data to the accurate group. The types of discriminant function: linear, quadratic, and mahalanobis.
•
kNN
is a typical instancebased prediction model. By kNN, the class label of a new testing sample is decided by the majority class of its
k
closest neighbors based on their Euclidean distance. The types of discriminant function: euclidean, correlation, and cosine.
•
SVM
is a kind of blend of linear modeling and instancebased learning. A SVM selects a small number of critical boundary samples from each class and builds a linear discriminant function that separates them as widely as possible. In the case that no linear separation is possible, the technique of "kernel" will be used to automatically inject the training samples into a higherdimensional space, and to learn a separator in that space. The types of discriminant function: linear SVM, Radial basis function(RBF), and polynomial.
5. RESULTS
EEG signals were obtained from 20 subjects. The group consisted of 9 females and 11 males with ages ranging from 18 to 65 years and a mean age of 40 years, and a Body Mass Index (BMI) of about 35
Kg
/
m
^{2}
. Performances of classifiers were tested using the data recorded in 10 healthy subjects. EEG signals of the Other 10 subjects were used to train the classifiers we utilized when realising the project. In this work, discrete wavelet transform (DWT) has been applied for the time–frequency analysis of EEG signals and SVM for the classification using wavelet coefficients. EEG signals were decomposed into frequency subbands using discrete wavelet transform (DWT). Then a set of statistical features was extracted from the subbands to represent the distribution of wavelet coefficients.
We applied Linear Discriminant Analysis (LDA), kNearest Neighbors (kNN), and Support Vector Machine (SVM) to obtain accuracy on our testing samples. Here, totally 7200 feature vectors are gone through a classification process.
Tables 2
∼
10
shows result of LDA, kNN, and SVM, respectively. Each table is organized is as follows: in each row the is represented by an specific sleep stage, each column represents the results of the classification.
 5.1 LDA Classifiers
For
Table. 2
, the highest accuracy is 68% and the lowest is 6%. The average accuracy rate of LDALinear classifier was about 43.7%.
Results for LDALinear Classifier
Results for LDALinear Classifier
For
Table 3
, the highest accuracy is 82% and the lowest is 2%. The average accuracy rate of LDAQuadratic classifier was about 48%.
Results for LDAQuadratic Classifier
Results for LDAQuadratic Classifier
For
Table 4
, the highest accuracy is 73% and the lowest is 15%. The average accuracy rate of LDAMahalanobis classifier was about 37.7%.
Results for LDAMahalanobis Classifier
Results for LDAMahalanobis Classifier
 5.2 kNN Classifiers
For
Table 5
, the highest accuracy is 46% and the lowest is 25%. The average accuracy rate of kNNEuclidean classifier was about 29.5%.
Results for kNNEuclidean Classifier
Results for kNNEuclidean Classifier
For
Table 6
, the highest accuracy is 34% and the lowest is 21%. The average accuracy rate of kNNCorrelation classifier was about 29%.
Results for kNNCorrelation Classifier
Results for kNNCorrelation Classifier
For
Table 7
, the highest accuracy is 34% and the lowest is 22%. The average accuracy rate of kNNCosine classifier was about 29.5%.
Results for kNNCosine Classifier
Results for kNNCosine Classifier
 5.3 SVM Classifiers
For
Table 8
, the highest accuracy is 96% and the lowest is 73%. The average accuracy rate of Linear SVM classifier was about 86%.
Results for Linear SVM Classifier
Results for Linear SVM Classifier
For
Table 9
, the highest accuracy is 97% and the lowest is 15%. The average accuracy rate of RBF classifier was about 56%.
Results for RBF Classifier
Results for RBF Classifier
For
Table 10
, the highest accuracy is 100% and the lowest is 41%. The average accuracy rate of Polynomial classifier was about 71.5%.
Results for Polynomial Classifier
Results for Polynomial Classifier
In the case of low accuracy, we can think that mixed up with other sleep stage. For example, classification accuracy for Stage 1 of
Table 3
is only 2%( Stage 1 gets mixed up with Stage R and Stage W). As a result of simulation, the average values of accuracies for the Linear Discriminant Analysis (LDA)Quadratic, kNearest Neighbors (kNN)Euclidean, and Linear SVM were 48%, 34.2%, and 86%, respectively. The experimental results show that SVM classification method offer the better performance for reliable classification of the EEG signal in comparison with the other classification methods.
6. CONCLUSION
A lot of information about brain functions are hidden in EEG signals. EEG signals give important information about the vigilance states of any subject. Specially, One of the important applications of electroencephalogram (EEG) processing is the study of the time course of alertness and vigilance of operators who perform monotonous but attention demanding tasks (air traffic controllers, lorry drivers, etc.). But, Conventional method of classification of EEG signals using mutually exclusive time and frequency domain representations does not give efficient results. In this work, method of sleep stage classification of EEG signals is proposed. We was investigating sleep stage informations of a human EEG by using Wavelet Transformation method for the extraction one of the very important features. In this study, EEG signals were obtained from 20 subjects. The group consisted of 9 females and 11 males with ages ranging from 18 to 65 years and a mean age of 40 years, and a Body Mass Index (BMI) of about 35. Subjects with normal intelligence and without mental disorders were included in this study after passing the neurological screening.
The number of levels of decomposition is chosen based on the dominant frequency components of the signal. The levels are chosen such that those parts of the signal that correlate well with the frequencies required for classification of the signal are retained in the wavelet coefficients. Since the EEG signals do not have any useful frequency components above 30 Hz, the number of levels was chosen to be 4. EEG signals were decomposed into the frequency subbands using wavelet transform in order to find entropy of a EEG signal segment by wavelet coefficients and a set of statistical features. Then these statistical features were used as an input to above mentioned classifiers with four discrete outputs: stage 1, stage 3 stage REM and stage AWAKE.
Features go through a selection so as to find the best approach to purpose of the project. For Classification, We used total 7200 feature vectors.
As a result of simulation, the average values of accuracies for the Linear Discriminant Analysis (LDA)Quadratic, kNearest Neighbors (kNN)Euclidean, and Linear SVM were 48%, 34.2%, and 86%, respectively. Thus, the experimental results show that Support Vector Machine (SVM) classification method offer the better performance for reliable classification of the EEG signal in comparison with the other classification methods. The accuracy of this study is likely to be raised with the improvement of the biomedical signal acquisition tools, with the development of digital filters and of course with the development of more accurate signal processing algorithms. Finally, it can be concluded that method of sleep stage classification of this study will be useful for the neurologists to analyze awakesleep correlations.
BIO
Jinwoo Kim
He received the B.S degree in Electrical Engineering from Myongji University in 1992 and the M.S and Ph.D. degrees in Electronic Engineering and System design Engineering from Fukui National University, Fukui, Japan, in 1996 and 1999, respectively. From 2000 to 2003, he was a contract Professor in the Department of Information Communication and Computer Engineering at Hanbat National University, Daejeon, Korea. Since 2003 he has been with the Department of Information and Communication Engineering at Kyungsung University, Busan, Korea, where he is currently an associate professor. From Dec., 2007 to Mar., 2012, he was a visiting researcher in the Department of Bioengineering at Tokyo University, Japan. His current research interests include image processing, pattern recognition, BrainComputer Interface (BCI), and medical imaging technology.
Johnson R.R
,
Popovic D.P.
,
Olmstead R.E
,
Stikic M.
,
Levendowski D.J
,
Berka C.
2011
"Drowsiness/Alertness Algorithm Development and Validation using Synchronized EEG and Cognitive Performance to Individualize a Generalized Model,"
Biol. Psychol.
87
(2)
241 
250
DOI : 10.1016/j.biopsycho.2011.03.003
Schmidt E.A.
,
Schrauf M.
,
Simon M.
,
Fritzsche M.
,
Buchner A.
,
Kincses W.E.
2009
"Drivers' Misjudgement of Vigilance State during Prolonged Monotonous Daytime Driving,"
Accident Analysis and Prevention
41
(5)
1087 
1093
DOI : 10.1016/j.aap.2009.06.007
Jap B.T
,
Lal S.
,
Fischer P.
2011
"Comparing Combinations of EEG Activity in Train Drivers during Monotonous Driving,"
Expert Syst.
38
(1)
996 
1003
DOI : 10.1016/j.eswa.2010.07.109
Kurt M.B.
,
Sezgin N.
,
Akin M.
,
Kirbas G.
,
Bayram M.
2009
"The ANNbased Computing of Drowsy Level,"
Expert Syst Appl.
36
(2)
2534 
2542
DOI : 10.1016/j.eswa.2008.01.085
Shin S.I.
,
Cho J.H.
,
Kim M.N.
2003
"Proposition for 4 Channel Frontal Lobe Electrode Configuration and Study on EOG Removal from Measured EEG,"
J ournal of Korea Nultimedia Society
6
(1)
167 
175
Yeo V.M.
,
Li X.
,
Shen K.
,
WiderSmith E.P. V.
2009
"Can SVM be used for Automatic EEG Detection of Drowsiness during Car Driving?,"
Saf. Sci.
47
(1)
115 
124
DOI : 10.1016/j.ssci.2008.01.007
Acharya U.R.
,
Faust O.
,
Kannathal N.
,
Chua T.
,
Laxminarayan S.
2005
"Nonlinear Analysis of EEG Signals at Various Sleep Stages,"
Computer Methods Programs Biomed.
80
(1)
37 
45
DOI : 10.1016/j.cmpb.2005.06.011
Liyanage S.R.
,
Guan C.
,
Zhang H.
,
Ang K.
,
Xu J.
,
Lee T.H.
2013
"Dynamically Weighted Ensemble Classification for Nonstationary EEG Processing,"
J. Neural Eng.
10
(3)
1 
10
DOI : 10.1088/17412560/10/3/036007
Yin Y.
,
Zhu Y.
,
Xiong S.
,
Zhang J.
2012
"Drowsiness Detection from EEG Spectrum Analysis,"
Informatics in Control, Automation and Robotics
133
(2012)
753 
759
Lin C.T.
,
Huang K.C.
,
Chuang C.H.
,
Ko L.W.
,
Jung T.P.
2013
"Can Arousing Feedback Rectify Lapses in Driving? Prediction from EEG Power Spectra,"
J. Neural Eng.
10
(5)
1 
10
DOI : 10.1088/17412560/10/5/056024
Ahirwal M.K.
,
londhe N.D
2012
"Power Spectrum Analysis of EEG Signals for Estimating Visual Attention,"
International J ournal of Computer Applications
42
(15)
22 
25
Carli F.D.
,
Nobili L.
,
Gelcich P.
,
Ferrillo F.
1999
"A Method For The Automatic Detection Of Arousals During Sleep,"
Sleep
22
(5)
561 
572
Kandaswamy A.
,
Kumar C.S.
,
Ramanathan R.P.
,
Jayaraman S.
,
Malmurugan N.
2004
"Neural Classification of Lung Sounds using Wavelet Coefficients,"
Computers in Biology and Medicine
34
(6)
523 
537
DOI : 10.1016/S00104825(03)000921
Daubechies I.
1992
Ten Lectures on Wavelets
SIAM
Philadelphia
Rioul O.
,
Vetterli M.
1991
“Wavelets and Signal Processing,”
IEEE Sig. Proc. Magazine
8
(4)
14 
38
DOI : 10.1109/79.91217
Krishnaveni V.
,
Jayaraman S.
,
Aravind S.
,
Hariharasudhan V.
,
Ramadoss K.
2006
"Automatic Identification and Removal of Ocular Artifacts from EEG using Wavelet Transform,"
Measurement Science Review
6
(4)
45 
57
Protopapa F.
,
Mylonas D.
,
Spiliotis K.
,
Siettos C.
,
Smyrnis N.
,
Evdokimidis I.
2011
"Dynamic Analysis of EEG Signals during Spatial Working Memory used for Either Perception Discrimination or Planning of Action,"
Conf Proc IEEE Eng Med Biol Soc.
5896 
5899
Adeli H.
,
Zhou Z.
,
Dadmehr N.
2003
“Analysis of EEG Records in an Epileptic Patient using Wavelet Transform,”
J. Neurosci. Meth.
123
(1)
69 
87
DOI : 10.1016/S01650270(02)003400