Journal of Robotics, Networking and Artificial Life
Vol. 7(3); December (2020), pp. 147–151
DOI: https://doi.org/10.2991/jrnal.k.200909.001; ISSN 2405-9021; eISSN 2352-6386
https://www.atlantis-press.com/journals/jrnal

Research Article

EEG based Drowsiness Detection using Relative Band
Power and Short-time Fourier Transform
Pranesh Krishnan1, Sazali Yaacob1, Annapoorni Pranesh Krishnan1, Mohamed Rizon2,*, Chun Kit Ang2Intelligent Automotive Systems Research Cluster, Electrical Electronic and Automation Section, Malaysian Spanish Institute
Universiti Kuala Lumpur, Kulim, Kedah 09000, Malaysia
2
Faculty of Engineering, Technology and Build Environment, UCSI University, No 1, Jalan Menara Gading, Taman Connaught, Kuala Lumpur 56000, Malaysia
1

ARTICLE INFOABSTRACT

Article History

Sleeping on the wheels due to drowsiness is one of the major causes of death tolls all over the world. The objective of this research
article is to classify drowsiness with alertness based on the Electroencephalogram (EEG) signals using spectral and band powerfeatures. A publicly available ULg DROZY database used in this research. Algorithms are developed to extract the five EEG
channels from the raw multimodal signal. By using a higher-order Butterworth low pass filter, the high-frequency components
above 50 Hz are removed. Another bandpass filter bank separates the raw signals into eight sub-bands, namely delta, theta,
low alpha, high alpha, low beta, mid beta, high beta and gamma. During pre-processing step, the signals are segmented into an
equal number of frames. An overlap of 50% and a frame duration of 2 s using a rectangular time windowing approach segments
the signal into frames. Then, the feature extraction algorithm extracts the relative band power features based on the short-time
Fourier transform for each frame. The extracted feature sets are further normalized and labelled as drowsy and alert and then
combined to form the final dataset. K-fold cross-validation method is used. The dataset is trained using K-Nearest Neighboralgorithm (KNN) and support vector machine classifiers, and the results are compared. The KNN classifier produces 96.1%(dataset 1) and 95.5% (dataset 2) classification accuracy.

Received 06 November 2019
Accepted 16 April 2020
Keywords
Drowsinesspolysomnography
band power
short-time Fourier transform© 2020 The Authors. Published by Atlantis Press B.V.
This is an open access article distributed under the CC BY-NC 4.0 license (http://creativecommons.org/licenses/by-nc/4.0/).

1. INTRODUCTION
Amongst the various drowsiness detection techniques, the physiology-based methods involve the physiological signals. The
Electroencephalogram (EEG) method yields high accuracy and isreferred to as the gold standard. Thus, the physiology-based process produces high efficiency and reliability in detecting drowsiness at an early stage. The EEG signal, which is the most preferred
physiological signal, has the closest association with sleepiness. The
drawbacks of the EEG signals are that, as they have high temporal
resolution and can be easily interfered by Electromyogram (EMG),
eye blink and electromagnetic noise [1,2].
Drowsy driving is a vital issue and hence need to be identified at theearliest. Drowsiness has subsequent effects. (a) Driver’s reduced
attention to surroundings, (b) considerable delay in reaction time, and(c) affect the driver’s capability to make decisions. The literature study
attempts to review all the previous approaches in detecting drowsiness. Drivers involved in sleep-related crashes rate their quality ofsleep was either inadequate or fair [3]. Missing an hour of sleep canlead to car crash risk. The only antidote for drowsiness is sleep [4].
The effects of sleepiness on wheels have been widely studied in
the literature [5–8]. Few researcehers have attempted to use single
channel EEG approach to classify drowsiness [9–16].
Corresponding author. Email: MohdRizon@ucsiuniversity.edu.my*

The remainder of this paper is organized as follows: Section 2 presents the multimodal DROZY database. Section 3 describes the feature extraction and modelling of drowsiness detection. The results
are presented and discussed in detail in Sections 4 and 5, respectively. Section 6 presents the conclusions presented in this paper.

2. DROZY DATABASEThe ULg multimodality drowsiness (DROZY) database is considered in this research as it contains multimodal approach. The complete details of the multimodal data collection, data description andthe protocol are represented in Figure 1 [17].
The database contains physiology related signals, i.e., EEG,
Electrooculogram (EOG), Electrocardiogram (ECG), and EMG.
By using the Embla Titanium system, the signals were recorded
from EEG channels Fz, Pz, Cz, C3, and C4 referenced at A1 in theinternational 10–20 system. The vertical and horizontal EOG signals, EMG and ECG signals were also recorded at a sampling rate of
512 Hz. Along with these signals, video signals were also recorded.
The drowsiness and alert signals were recorded from 14 male andfemale subjects. The test was conducted in a controlled environment in three trials. Before the first trial, the subjects were asked
to have a good sleep pattern for the past week. In the first trial, thesubjects were asked to perform an action watching the screen. Afterthe first trial, the subjects were asked to stay awake for 36–38 h

P. Krishnan et al. / Journal of Robotics, Networking and Artificial Life 7(3) 147–151

148

Figure 1 | Protocol design during the data collection [17].

eye blink and electromagnetic noise [18]. The EEG, along with the
EMG, ECG, and EOG signals, remains the European data format.
A MATLAB function is used to extract only the EEG signals, which
is of the interest in this research. The experiment was conducted
for 10 min, and the EEG signal contains information up to 600 s.
The signals are recorded at 512 Hz sampling frequency. The signals
include both EOG and EMG, which contribute toward the drowsiness detection. Hence the eye blink artefacts and the EMG artefacts
which are removed in conventional biosignal processing is avoided
in this research. The raw signal is processed directly without any
artefact’s removal. However, a Butterworth low pass filter with acut-off frequency of 50 Hz is designed, and the high-frequency
components are eliminated.

3.3. Sub-Banding of EEG Signals

Figure 2 | Multimodal electrode placement during the trials.

to keep them sleep-deprived. In the second and third trials, thesubjects performed the same previous experiment. Post the final
test, and the subjects were asked to take a sound sleep before they
drive back home.

3. METHODOLOGY
3.1. Data Description
The experiment was conducted in three trials in 2 days, as mentioned in the protocol. The authors conducted a widely used tool
to measure the performance impairments due to drowsiness using
a 10-min psychomotor vigilance test. This test gives the reaction
time to visual or auditory stimuli that occur at the random inter-­stimulus interval. The database contains PSG signals from 11 electrophysiological signals (five EEG, two EOG, one ECG and one
EMG) are considered. The five EEG channels are recorded from
C3, C4, Cz, Pz, and Fz locations present in the central lobe of thebrain. The placement of the EEG channels is depicted in Figure 2.
The sensors placed around C3, C4 and Cz locations deal with thesensory and motor functions. C3 and C4 gave the best seizure
detection performance. This research uses monopolar montage
with C3 as a reference. The vertical and horizontal EOG signals arerecorded from above and at the side of the right eye to capture theeye blinks. An ECG channel is recorded from the electrode placedon the chest. An EMG signal is recorded from the electrode placed on
the neck of the participant.

3.2. EEG Signal Processing
Electroencephalogram signals are the non-invasive physiologicalmeans of measuring brain activity. It has the closest relationshipwith drowsiness. The EEG has a neural domain signal information
has high temporal resolution but can be easily interfered by EMG,

From the literature, the specific frequency ranges from the EEG
signals such as alpha, beta, theta, gamma and delta are extractedusing a suitable bandpass filter [19–21]. A Butterworth bandpass
filter bank with eight frequency bands is designed and used to
extract the sub-bands of the EEG signals. The details of the eight
sub-bands are listed in Table 1.

3.4. Frame Analysis and Overlap
The raw signal is recorded for 10 min. It is difficult to apply any
feature extraction methods to the whole signal. Hence the signal is
divided using a time window. Signal epoch: Specific time windows are
extracted from the continuous EEG signal. These time windows
are called epochs. On a trial and error method, the time windows are
selected based on the performance metrics. In this approach, a 2-s
sliding window is chosen to segment the raw EEG signal.

4. FEATURE EXTRACTION
Dimensionality reduction plays an essential role in classifier performance. Dimensionality reduction is achieved either by feature extraction or feature selection. For both feature extraction
and feature selection approach, feature evaluation criterion, thedimensionality of the feature space and optimization procedure
are required. Feature extraction is the transformation of the original data to a data set with the selected number of variables whichcontains the most discriminatory information. Feature extraction,on the other hand, considers the whole original data and maps theuseful information into a lower-dimensional space.
Table 1 | EEG subband filtering
Wave type

Frequency (Hz)NatureOptimal

Delta
Theta
Low AlphaHigh Alpha
Low beta
Mid beta
High beta
Gamma

0.1–4
4–8
8–9
9–12
12–16
16–20
20–30
30–50

Very slow
Slow
Moderate
Moderate
High
High
High
Very highDeep sleep
Depression
Relaxation
Relaxation
Conscious
Blinking
Agitation
Cognition

P. Krishnan et al. / Journal of Robotics, Networking and Artificial Life 7(3) 147–151

149

4.1. Windowing and Short-time
Fourier Transform

Table 2 | Average classification accuracy

During each trial of the experiment is recorded for an average of
10 min which is approximately 600 s. All the signals are read, and the
maximum length of the signal is calculated and taken as reference. For
those signals where the length is short, zeros are padded at the end tolengthen the signal so as to make all signals even. The raw EEG signal
is segmented into 2 s pulses. After segmenting the signals into framesof 2 s with the windowing technique, the original raw signal grows to
300 per each subject per each trial, thereby enhancing the data.

KNN
SVM

For each frame, the average relative power (power in the specificband over total power) in the low alpha, high alpha and delta bands
are calculated from the EEG power spectrum, computed using a
Short-time Fourier Transform (STFT) using Eq. (1) [18]¥	   Sx(w ) (t , f ) = ò éëx(t )w * (t - t ²)ùû.e - j 2pft dt (1)-¥Short-time Fourier transform is a frequently used feature extraction
technique in which separation of stationary signals is performed
into small fragments. The process is computed to extract the features from both alert and drowsy databases.

5. DATA PROCESSING
Finally, the output class is mapped according to the state of alertness or drowsiness. The database contained one trial for alert and
two trials for drowsy situations. The extracted feature sets were further normalized and marked as ‘1’ for the features from the drowsy
trial, and ‘0’ for the features extracted from the alert trial. The mixture of trial 1 (alert) and trial 2 (drowsy1) formed the final dataset
1 while the trial 1 (alert) and trial 3 (drowsy2) formed the final
dataset 2. The dataset is split into training and testing using the
K-fold cross-validation method. The final dataset was rescaled
based on the bipolar normalization method between 0 and 1.

6. CLASSIFICATION MODEL
k-Nearest Neighbor algorithm (k-NN) is implemented using‘fitcknn’ function in MATLAB. The K factor, training error rate
and validation error rate and adjusted accordingly. The number ofneighbor’s value was set to 3 while ‘minkowski’ method is used as a
distance metric to classify the two classes ‘alert’ and ‘drowsy’.
Support Vector Machine (SVM) classifies between classes by finding
the hyperplanes, which are a very crucial task in SVM. The ‘fitcsvm’
function in MATLAB is used to model the SVM. ‘Radial basis
function’ kernel is used to classify between drowsy and alert classes.

7. RESULTSClassifiers are evaluated based on the ease to interpret output, calculation time and prediction power. In order to develop a binaryclassification, the trial 1 data are labelled as alert while the trial 2 and3 data are labelled as drowsy. Once the feature set is extracted, theoutput class is labelled accordingly, and the final dataset is processed.

Dataset 1 (%)

Dataset 2 (%)

96.1
93.7

95.5
94.9

8. DISCUSSION
The anomaly in the delta and alpha sub-bands are extracted using
the entropy and band power features. The hypothesis, during thisstudy, is to evaluate the alpha and delta activities. The alpha activity is inversely proportional to the delta activity during drowsiness. Microsleep is a temporary occurrence of sleep or sleepiness
which may last from a fraction of a second to 2 min. Microsleeps
occur while the person’s eyes are open. It is a straight result of sleep
deprivation. Frequent blinking, sudden body jerk, a blank stare,head dropping are the results of microsleep. Also called as daytime
drowsiness. During microsleep, there is an increase in theta andalpha waves for more than 3 s [8].

9. CONCLUSION
This study presented a method for detection and classification of
drowsiness based on the EEG signal using STF transformation
technique. The publicly available DROZY database from ULg
was considered for the reason that it contains multimodal signals.
Five EEG channels (C3, C4, Cz, Pz, Fz) were extracted from thedatabase. The high-frequency components are not of the interest for this research, and they are removed using a higher-order
low pass filter with a cut-off frequency at 50 Hz. The low passfiltered signal was further divided into eight sub-bands, namely
delta, theta, low alpha, high alpha, low beta, mid beta, high beta
and gamma using a Butterworth bandpass filter. The signal wasrecorded for 600 s (10 min) which is tedious to analyze the whole
signal, and hence the raw signal was divided into frames using a
rectangular window with an overlap of 50%. The STFT was computed for all the sub-bands on a frame-by-frame analysis. The
database contained one trial for alert and two trials for drowsy
situations. The extracted feature sets were further normalized andlabelled as 1 for the features from the drowsy trial, and ‘0’ forthe features extracted from the alert trial. The mixture of trial 1(alert) and trial 2 (drowsy1) formed the final dataset 1 while thetrial 1 (alert) and trial 3 (drowsy2) formed the final dataset 2. The
dataset is split into training and testing using the K-fold cross-­
validation method. KNN and SVM models are trained using thedatasets. The performance of the model to classify drowsiness isreported. KNN achieved better classification accuracy than the
SVM model (96.1% in dataset 1 and 95.5% in dataset 2) (Table 2).

CONFLICTS OF INTEREST
The authors declare they have no conflicts of interest.

ACKNOWLEDGMENTS
The authors would like to thank the Ministry of Higher Education
for the financial support provided for this project (FRGS/1/2019/

P. Krishnan et al. / Journal of Robotics, Networking and Artificial Life 7(3) 147–151

150

TK08/UNIKL/02/3). The authors would also thank the members of the Intelligent Automotive Systems research cluster
and the post-graduate students of Malaysian Spanish Institute
University Kuala Lumpur for their constructive and critical suggestions during the preparation of this manuscript.

REFERENCES[1] J.C. Stutts, J.W. Wilkins, B.V. Vaughn, Why do people have drowsy
driving crashes: input from those who just did, 1999, pp. 1–81.
[2] E. Leefeldt, Losing an hour of sleep can heighten car crash risk:
AAA warns, CBC News; 2019.
[3] L.A. Reyner, J.A. Horne, Falling asleep whilst driving: are drivers
aware of prior sleepiness?, Int. J. Legal Med. 111 (1998), 120–123.
[4] J. Horne, L. Reyner, Vehicle accidents related to sleep: a review,
Occup. Environ. Med. 56 (1999), 289–294.
[5] S. Nordbakke, F. Sagberg, Sleepy at the wheel: knowledge, symptoms and behaviour among car drivers, Transp. Res. Part F 10
(2007), 1–10.
[6] A. Williamson, R. Friswell, J. Olivier, R. Grzebieta, Are drivers
aware of sleepiness and increasing crash risk while driving?,
Accid. Anal. Prev. 70 (2014), 225–234.
[7] S.S. Hashemi Nazari, A. Moradi, K. Rahmani, A systematic
review of the effect of various interventions on reducing fatigue
and sleepiness while driving, Chin. J. Traumatol. 20 (2017),
249–258.
[8] G.R. Poudel, C.R.H. Innes, P.J. Bones, R. Watts, R.D. Jones, Losing
the struggle to stay awake: divergent thalamic and cortical activity during microsleeps, Hum. Brain Mapp. 35 (2014), 257–269.
[9] W. Li, Q.C. He, X.M. Fan, Z.M. Fei, Evaluation of driver fatigue on
two channels of EEG data, Neurosci. Lett. 506 (2012), 235–239.
[10] I. Belakhdar, W. Kaaniche, R. Djemal, B. Ouni, Single-channelbased automatic drowsiness detection architecture with areduced number of EEG features, Microprocess. Microsyst. 58(2018), 13–23.
[11] H. Albalawi, X. Li, Single-channel real-time drowsiness detection
based on electroencephalography, Proceedings of the Annual
International Conference of the IEEE Engineering in Medicine

and Biology Society (EMBC), IEEE, Honolulu, HI, USA, 2018,
pp. 98–101.
[12] F. Sauvet, C. Bougard, M. Coroenne, L. Lely, P. Van Beers, M.
Elbaz, et al., In-flight automatic detection of vigilance statesusing a single EEG channel, IEEE Trans. Biomed. Eng. 61(2014), 2840–2847.
[13] M. Pathak, A.K. Jayanthy, Designing of a single channel
EEG acquisition system for detection of drowsiness, 2017
International Conference on Wireless Communications, Signal
Processing and Networking (WiSPNET), IEEE, Chennai, India,
2017, pp. 1364–1368.
[14] M. Pathak, A.K. Jayanthy, Development of a real-time single
channel brain-computer interface system for detection of drowsiness, Biomed. Eng. Appl. Basis Commun. 29 (2017), 1750019.
[15] T.L.T. da Silveira, A.J. Kozakevicius, C.R. Rodrigues, Automateddrowsiness detection through wavelet packet analysis of a single
EEG channel, Expert Syst. Appl. 55 (2016), 559–565.
[16] M. Ogino, Y. Mitsukura, Portable drowsiness detection throughthe use of a prefrontal single-channel electroencephalogram,
Sensors (Basel) 18 (2018), 4477.
[17] Q. Massoz, T. Langohr, C. François, J.G. Verly, The ULg multimodality drowsiness database (called DROZY) and examples of use, 2016 IEEE Winter Conference on Applications ofComputer Vision (WACV), IEEE, Lake Placid, NY, USA, 2016,
pp. 1–7.
[18] U. Ha, H.J. Yoo, An EEG-NIRS ear-module SoC for wearable
drowsiness monitoring system, 2016 IEEE Asian Solid-State Circuits
Conference (A-SSCC), IEEE, Toyama, Japan, 2016, pp. 193–196.
[19] H. Göksu, BCI oriented EEG analysis using log energy entropyof wavelet packets, Biomed. Signal Process. Control 44 (2018),
101–109.
[20] S. Aydin, H.M. Saraoğlu, S. Kara, Log energy entropy-based EEGclassification with multilayer neural networks in seizure, Ann.
Biomed. Eng. 37 (2009), 2626–2630.
[21] R. Foong, K.K. Ang, C. Quek, C. Guan, A.A.P. Wai, An analysis on driver drowsiness based on reaction time and EEG band
power, 2015 37th Annual International Conference of the IEEE
Engineering in Medicine and Biology Society (EMBC), IEEE,
Milan, Italy, 2015, pp. 7982–7985.

AUTHORS INTRODUCTION
Dr. Pranesh Krishnan
He completed his Masters (Mechatronics)
and PhD (Mechanical) from Universiti
Malaysia Perlis, Malaysia. He obtained
his Bachelors (Information Technology)
degree from Anna University, India. He
is a member of the IEEE and a Graduate
Technologist from MBOT. His researchinterests include Signal Processing, Driver
Drowsiness and Machine Learning.

Prof. Dr Sazali Yaacob
He completed his PhD and MS degrees
from the University of Southampton andthe University of Surrey, United Kingdom
respectively. He has published over 300
articles in conferences and journals. He isa life member of the Institute of Engineers
and recipient of several awards.

P. Krishnan et al. / Journal of Robotics, Networking and Artificial Life 7(3) 147–151

Mrs. Annapoorni Pranesh Krishnan
She received her Master’s degree inTechnology Management and Bachelor’s
degree in Electronics and Instrumentationfrom Anna University, India. She is currently doing her PhD at Universiti Kuala
Lumpur, Malaysia. Her interests include
signal processing, operations research andautomotive supply chain.

Dr. Mohamed Rizon
He graduated Doctor of Engineering at
Department of Computer Science andIntelligence Systems at Oita University,
Japan. He was a Professor of Biomedical
Technology at King Saud University,
Saudi Arabia in 2010. He served at
MIEC, Fuzhou University, China in 2019.
Currently, he is a Professor at Department
of Electrical and Electronics, UCSI University, Malaysia. MIET,MIEM member.

151

Dr. Chun Kit Ang
He received his Bachelor of Engineering
Degree with First Class Honors in
Mechatronic Engineering from the
University of UCSI, Malaysia in theyear 2010. By the end of the year 2010,
he was attached with Universiti Putra
Malaysia for his PhD in Mechanicaland Manufacturing Engineeringand graduated in the year 2014.
Currently, he is the Dean for Facultyof Engineering Technology and Built
Environment, UCSI University. He
is interested in artificial intelligence, soft computing, robotics,
and mechatronics. He has published many papers related to theapplication of Artificial Intelligence in recent years.