Research Paper
Procedia Computer Science 34 ( 2014 ) 400 – 409
1877-0509 © 2014 Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/). Selection and peer-review under responsibility of Conference Program Chairs doi: 10.1016/j.procs.2014.07.045
ScienceDirect Available online at www.sciencedirect.com
The 11th International Conference on Mobile Systems and Pervasive Computing (MobiSPC-2014)
Drowsy Driving Detection by EEG Analysis Using Wavelet Transform and K-Means Clustering
Nikita Gurudath, H. Bryan Riley* School of Electrical Engineering and Computer Science, Ohio University, Athens, Ohio 45701, USA
Abstract
This research aims to develop a driver drowsiness monitoring system by analyzing the electroencephalographic (EEG) signals in a software scripted environment and using a driving simulator. These signals are captured by a multi-channel electrode system. Any muscle movement impacts the EEG signal recording which translates to artifacts. Therefore, noise from the recording is eliminated by subtracting the noisy signal from the original EEG recording. The actual EEG signals are then subjected to band pass filtering with cut-off frequencies 0.5 Hz and 100 Hz. The filtered signals are analyzed using a time-frequency technique known as the Discrete Wavelet Transform (DWT). A third order Debauchies’ wavelet and five level decomposition is utilized to segregate the signal into five sub-bands, namely, delta (0.5 – 4 Hz), theta (4 – 8 Hz), alpha (8 – 12 Hz), beta (12 – 30 Hz) and gamma (> 30 Hz). First order statistical moments such as mean, median, variance, standard deviation and mode of the sub-bands are calculated and stored as features. These features serve as an input to the next stage of system classification. Unsupervised learning through K-means clustering is employed since the classes of the signals are unknown. This provides a strong decision making tool for a real-time drowsiness detection system. The algorithm developed in this work has been tested on twelve samples from the Physionet sleep-EDF database. © 2014 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the Program Chairs of MobiSPC-2014.
Keywords: Driver health monitoring; EEG signal analysis; discrete wavelet transform; Debauchies’ wavelet; K- means clustering
* Tel.: +1-740-597-3173
E-mail address: [email protected]
© 2014 Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/). Selection and peer-review under responsibility of Conference Program Chairs
401 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
1. Introduction
The National Highway Transportation and Safety Administration (NHTSA) states that drowsy driving accounts for 1550 deaths, 40000 injuries and more than 56000 crashes every year in the United States [1]. This varies between 2.2% - 2.6% of the fatal crashes. A study by researchers in Australia has proven that being awake for 18 hours produces an impairment equivalent to a Blood Alcoholic Concentration (BAC) OF 5% and 10% after 24 hours [2]. With 8% of BAC being considered as legally drunk, this study provides alarming statistics. Drowsiness hampers driving by causing slower reaction times, vision impairment and major lapses in judgment [3, 4]. This reiterates the need to investigate various methods that can classify drowsiness by monitoring the awareness state of the driver.
Drowsy driving detection is an important issue in today’s society because falling asleep while driving is clearly dangerous, while the propensity to be sleepy affects one’s ability to drive safely even if the person does not fall asleep. Drowsiness has the following effects • Decrease driver’s attention to surroundings • Slow down reaction time considerably • Affect a driver's ability to make decisions Fig. 1 below summarizes a drowsy driving study conducted by the Center for Disease Control and Prevention (CDCP).
Fig.1. Statistics of adults falling asleep while driving (from [4]).
1.1. Electroencephalographic signals EEG signals are the indication of brain activity in a high level organism. It is a graph of low voltage levels versus
time. The brain is made up of neurons which communicate via electrical impulses. It is analogous to a network with nodes corresponding to different activity centers, and meshes corresponding to various pathways. The voltage measured is extremely small (up to the order of microvolts) and is susceptible to artifacts and disturbances. These signals are non-stationary in nature. This means that they have different frequency components existing at different intervals of time. The five primary frequency bands in a typical EEG signal are defined as [3]: • Delta – (0.5 – 4) Hz • Theta – (4 – 8) Hz • Alpha – (8 – 12) Hz • Beta – (12 – 30) Hz • Gamma – >30 Hz
The Theta, Alpha and Beta sub-bands are of interest for drowsy driving identification. Alpha activity is predominant when a person is resting or closing his eyes. During the transition from awake to sleep or drowsy state,
402 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
alpha decreases and theta increases gradually [5]. It has also been proven that beta waves are significantly high when a person is taking sedative and hypnotic drugs such as benzodiazepines and/or barbiturates [6]. EEG signals are measured by placing electrodes on the human scalp. The position of the electrodes is given by a standardized system known as the 10-20 montage [7]. Fig. 2 illustrates a configuration of electrodes utilized by neurologists and related healthcare professionals.
Fig.2. Mapping of electrode placements for EEG data collection (from [7]). The regions marked by English letters F, P, T, O and C in Fig. 2 correspond to the frontal lobe, parietal lobe, temporal lobe, occipital lobe and central lobe respectively. A1 and A2 represent the regions where reference electrodes are placed. Fpz is the frontal polar region and Pz represents the nasopharyngeal position. 1.2. Background and literature review
Increased focus on safe driving has made driver health monitoring an important aspect in the automotive industry. There are two ways to monitor the vigilance of a driver: • Image processing techniques that track facial and/or head movements and eye gaze monitoring • Signal processing techniques that utilize information from physiological signals from EEG, Electrocardiography (ECG), Electrooculography (EOG) and Electromyography (EMG) recordings.
Academic researchers and automobile manufacturing companies have recognized the importance of evaluating drowsy driving and have implemented systems to detect drowsiness for the safety of drivers and passengers. [8] illustrates comprehensive parameters of the human body that could be used to monitor the health of the driver.
Existing vehicles have state-of-the-art systems installed [9]. For example, the 2013 Mercedes Benz 5000 series model consists of the Attention Assist system which creates the driver’s profile by monitoring the driving during the first five minutes of the drive and then uses this as a reference to monitor driver input and vehicle parameters such as vehicle speed, angle of steering wheel, longitudinal and lateral acceleration. Volvo has incorporated a driver alert control system that monitors drowsiness based on the car’s progress on the road. Delphi manufactures commercial products such as Driver State Monitor and Driver Fatigue Monitor that determine drowsiness by eye blink detection algorithms. These expensive systems have not been robustly tested under low illumination conditions (night time driving) and heavily rely on inputs from the vehicle.
Literature reports that EEG data provides the best descriptors of sleep [10]. Kerkeni et al. described automatic classification of different sleep stages using frequency domain analysis. The Fast Fourier Transform (FFT) of the EEG signal was computed after certain pre-processing [11]. The spectral power of each of the resulting five sub-bands was calculated. These five values were used as an input for the three layered neural network employed as the classifier. A low classification accuracy of 76% indicated the ineffectiveness of using frequency analysis for non- stationary signals such as the EEG signals. When electing to deal with life threatening situations, a more robust system is required to be developed. The analysis of spatial and temporal aspect is required to evaluate non-stationary data such as EEG signals [12, 13]. In order to account for the non-stationary property, [13] suggested a time- frequency analysis using the wavelet transform. The work described by the method in [14] provides 93%
403 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
classification accuracy. The use of other classifiers such as support vector regression or fuzzy neural networks provide higher classification accuracy (97%) as indicated by [15]. However, this increases the complexity of the system and requires a large feature set.
The number of channels used to record the EEG signals plays a major role. More information is obtained when many channels are used [16]. However, this increases the cost and computation time. When a single or double channel is used, the cost and time are manageable but the reliability decreases. This triggers the need for a trade-off between complexity and reliability. [17] indicates that recordings from 5 channels, Fp1, Fp2, Cz, O1 and O2 as shown in [7], provide a good description of drowsiness.
1.3. Specific objectives of this research
In this work, the aim is to implement classification of driver drowsiness. We intend to use data from a publically available Sleep-EDF database at Physionet [18]. The EEG signals collected would be analyzed by DWT that employs third order Debauchies’ wavelet and level five decomposition, resulting in the five sub-bands. The mean, median, variance, standard deviation and mode from each of the sub-bands would be calculated and stored as a set of features. Since the class of the EEG signals is unknown, K means clustering would be used to determine the classes of the data. The classes predicted from K-means clustering would be used as a priori information for classification via three layer neural net consisting of input layer, hidden layer and output layer. The three classes considered are awake, drowsy and asleep (class 1, class 2 and class 3). 2. Description of the method
The algorithm in this research has been developed taking into account the non-stationary property of EEG signals. A well-established mathematical theory (i.e. Wavelet) is implemented on a digital computer to analyze time and frequency (or scale) components simultaneously in a signal.
2.1. Pre-Filtering and artefact removal
The EEG signals obtained from [18] are recorder from two channels- Fpz - Cz and Pz- Oz. It also consists of recordings from the eyelids (Electrooculography/EOG signals). These are considered as noise and must be subtracted from the EEG recordings in order to be able to use them for further processing. The signals are filtered at a frequency of 100Hz. Using this information, epochs of 30s is extracted and stored.
2.2. Non-stationary signal analysis using discrete wavelet transform
A signal contains information about the physical world. In order to extract useful data from these signals, they are required to be transformed from one domain (say, time) to another domain (say, frequency) to gain further insights. Applicable transforms for such purposes include the: [19] • Fourier transform • Radon transform • Hilbert transform • Wigner transform • Short-time Fourier transforms • Wavelet transform Fourier transforms are widely used for analysis of stationary signals. When a signal consists of different frequency components for various time intervals, short-time Fourier transform (STFT) provides valuable information. The STFT is computed by sliding a window function over the entire length of the original signal [19]. The width of the window depends on the time, for which a single frequency component exits in the signal, i.e., the interval of time for which the signal is stationary. It is given as:
(1)
404 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
where x(t) is the signal, W(t) is the window function, f is the frequency in hertz and t is the time in seconds. The time-frequency resolution of the signal is dependent on the window function. A narrow window provides excellent time resolution but poor frequency resolution and vice versa. This arises due to the fact that a non-stationary signal is approximated to be a stationary signal over a specific time period.
Multiresolution analysis by the wavelet transform is an effective method to study the various components of a non-stationary signal. This method utilizes a mother wavelet in order to measure the similarity between the basis function and the signal in terms of the frequency content [20]. The discrete wavelet transform is useful for evaluation and reconstruction of signals. In this research, the discrete wavelet transform coefficients are obtained by choosing the third order Debauchies’ wavelet family. The EEG signal, x[n], is passed through, h[n] and g[n], low pass and high pass filters respectively derived from the wavelet. The output from each of these filters is decimated by a factor of 2. This reduces the number of points in the filtered signal by half but doubles the scale (or frequency). (2)
(3)
where y1[n] and y2[n] are the outputs from the low pass and high pass filters respectively. The highest frequency component present in the signal is half the highest frequency present in the original signal. The coefficients y2[n] form the Level 1 DWT coefficients. The output of the low pass filter is passed through the same set of filters and the desired number of coefficients is extracted. The low pass filters and high pass filters utilized to achieve the DWT coefficients of the clean EEG signal has been illustrated in Fig. 3.
Fig.3. Low pass and high pass filters of Deubauchies third order wavelet family.
The frequency spectrum of each of the coefficients has been evaluated. They correspond to the five sub-bands of an EEG signal namely, gamma, beta, alpha, theta and delta. 2.3. Feature extraction In any pattern recognition system it is essential to isolate those attributes which are specific to a particular class. In this work, five first order features have been extracted from each of the sub-bands or DWT coefficients. They are: mean, median, standard deviation, variance and mode. If the number of data points in a sample containing si values is N, then the arithmetic mean is given as
405 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
(4) The median is the mid value of the sample. If N is odd, then the median is the value of the sample. If N is even, then the median is the average of and value in the sample. Standard deviation is defined as:
(5)
Variance is given by:
(6)
Mode is defined as the most frequently occurring point in the sample. If there are multiple points having the same frequency of occurrence, then the smallest of the values is chosen. These features are utilized as input to the neural network for classification.
2.4. Classification
Learning can be divided into two categories: supervised and unsupervised. Supervised learning involves use of a feedback-based algorithm such as backpropagation, where error responsibility is calculated at each node. Unsupervised learning, often using the Hebbian algorithm, finds correlations between input data and divides it into related sets [21]. In this research the classes of the EEG data is assumed to be unknown. In any real time drowsiness detection system using EEG signals, it is difficult to know the class to which a particular feature belongs. In order to determine which class each signal belongs to, a well-known clustering technique called K-means clustering is employed [22]. This method utilizes the mean of similar data points in order to group the signals together. It is an iterative procedure carried out to minimize within-class sum of squares. For n feature vectors, , that fall into k clusters (k<n) the objective/cost function to be minimized is given as
(7)
is the mean of vectors in cluster i and the term inside the summation is a chosen distance measure between data
point and cluster center . The algorithm for K-means clustering [23] is Step 1: Start Step 2: Initialize 1, 2, …, k Step 3: While no change in mean Step 4: Classify samples into clusters using estimated means Step 5: For i running from 1 to k Step 6: Calculate the distance between each feature and the initialize cluster mean Step 7: If the criterion in equation 7 is satisfied proceed to Step 9 else go to Step 8. Step 8: Replace i with mean of all samples for cluster i Step 9: End for Step 10: End while Step 11: Stop
Once the classes of the samples have been determined, training would be accomplished using Artificial Neural Networks (ANN). An ANN emulates the human brain’s ability to learn and recognize patterns. All neural nets consist of neurons as the basic processing nodes, and synapses which store a weight value to connect together the layers of neurons. A three layered ANN would be employed to classify the EEG signals into drowsy, awake or sleep states. The input, hidden and output layers would be trained using the back propagation algorithm [24]. The set of 15 features obtained from DWT form the inputs to the neural net. The output layer consists of three neurons corresponding to the three desired states. The number of hidden layers would be determined empirically after successive trials.
406 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
3. Experimental results
In this research, 12 EEG samples have been used from the Physionet sleep-EDF database [18]. The files are in EDF/EDF+ (European Data Format) format which can be viewed using the Polyman software. Fig. 4 illustrates the EEG and EOG data from one sample.
Fig.4. An EEG and EOG sample from Physionet database [18] displayed using Polyman software.
It is essential to remove artifacts from the EEG data before the DWT can be applied for the purpose of analysis. This is achieved by subtracting the EOG data from the EEG data. The processed signals are subjected to a DWT with third order Debauchies’ wavelet and five level decomposition to obtain five sub-bands.
The mean, median, standard deviation, variance and mode for each of the five sub-bands are calculated. In order to determine the best set of classes for the EEG signals, K-means clustering for each of these features is conducted on all the sub-bands. The K-means clustering plots for channel 1and channel 2 and for standard deviation and variance is as shown in Figs. 5 and 6 respectively.
(a)
407 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
(b) Fig. 5. Results of Kmeans clustering using standard deviation and variance as input from Fpz – Cz channel.
(a)
(b) Fig.6. Clusters obtained using standard deviation and variance from Pz- Oz channel of EEG recording.
408 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
4. Conclusion and future work
This research aims to develop an automatic system for drowsy driving identification or detection by analyzing EEG signals of the driver. The wavelet transform is an effective tool to analyze the time as well as frequency components hidden in such non-stationary signals. The first order statistical features are tractable and have low memory requirements. In real world driving scenarios where manual scoring of EEG signals is impossible and impractical, the K-means clustering technique is a strong decision making tool in order to determine to which sleep related state: (i.e., awake, drowsy or asleep) each sample belongs. It is concluded that classes obtained by clustering the variance data provides the best separation of clusters when visually inspected. This would be utilized to input the features into a three layer ANN and conduct classification. Acknowledgements
We wish to thank Dr. Shinichi Amano and Dr. S. Lee Hong for their guidance and suggestions during this research period. Dr. Amano is postdoctorial fellow in the Ohio Musculoskeletal and Neurological Institute (OMNI) College of Osteopathic Medicine. He earned a PhD degree in biobehavioural science from the University of Florida and currently is a researcher at Ohio University in Athens, Ohio. Dr. Hong earned a PhD in Kinesiology, with an emphasis on motor control, and currently is an associate professor in the Department of Biomedical Sciences at Ohio University. His research interest include the study of dynamic patterns in brain, behavior, and physiology.
References 1. NHTSA, "Drowsy driver detection and warning system for commercial vehicle drivers: Field proportional test design, analysis, and
progress," http://www.nhtsa.dot.gov/. Accessed on January 30th, 2014. 2. National Sleep Foundation, “Facts and Stats,” http://drowsydriving.org/about/facts-and-stats/. Accessed on January 30th, 2014. 3. L. Chin Teng, W. Ruei-Cheng, S.-F. Liang, W.-H. Chao, Y.-J. Chen and T.-P. Jung, "EEG based drowsiness estimation for safety driving
using independent component analysis," IEEE Transactions on [Circuits and Systems I: Fundamental Theory and Applications], vol. 52, no. 12, pp. 2726 – 2738, 2005.
4. Centres for Disease Control and Prevention (CDC). Drowsy driving - 19 states and the District of Columbia, 2009-2010. MMWR.2013; 61:1033-7, Accessed January 4, 2013
5. Lin C T, "Assessment of driver's driving performance and alertness using EEG-based fuzzy neural networks Circuits and Systems," IEEE International Symposium on Circuits and Systems, vol. 1, pp. 152-155, 2005.
6. The McGill Physiology Virtual Lab, “Biomedical signal acquisition,” http://www.medicine.mcgill.ca/physio/vlab/biomed_signals/eeg_n.htm. Accessed on March 7th, 2014.
7. Immrama Institute, “The International 10-20 System of Electrode Placement,” http://www.immrama.org/eeg/electrode.html. Accessed on February 2nd, 2014.
8. A car that takes your pulse, "Designing vehicles to monitor brain waves, sleepiness,” http://online.wsj.com/news/articles/SB10001424127887324352004578131083891595840.,November 5th, 2013.
9. Y. Dong, Z. Hu, K. Uchimura, and N. Murayama, “Driver inattention monitoring system for intelligent vehicles: A review,” IEEE Trans. Intell. Transp. Syst., vol. 12, no. 2, pp. 596–614, Jun. 2011.
10. "Monitoring driver attentiveness to improve safety," Automotive Engineering Online, 2013. 11. B. O. Peters, G. Pfurtscheller and H. Flyvbjerg, "Automatic differentiation of multichannel EEG signals.," IEEE Transactions on Biomedical
Engineering, vol. 48, pp. 111-116, 2001. 12. N. Kerkeni, F. Alexandre, M. H. Bedoui, L. Bougrain and M. Dogui, "Automatic classification of sleep stages on a EEG signal by artificial
neural networks," in Proceedings of the 5th WSEAS international conference on Signal, speech and image processing (SSIP'05), Stevens Point, Wisconsin, 2005.
13. A. Picot, S. Charbonnier and A. Caplier, "On-line automatic detection of driver drowsiness using a single electroencephalographic channel," in 30th Annual International Conference of the IEEE EMBS, 2008.
14. Arjunan S. P, "Changes in Decibel Scale Wavelength Properties of EEG with Alertness Levels While Performing Sustained Attention Tasks." 31st Annual International Conference of the IEEE EMBS, Minnesota, 2009.
409 Nikita Gurudath and H. Bryan Riley / Procedia Computer Science 34 ( 2014 ) 400 – 409
15. F. Ebrahimi, M. Mikaeili, E. Estrada and H. Nazeran, "Automatic Sleep Stage Classification Based on EEG Signals by Using Neural Networks and Wavelet Packet Coefficients," in 30th Annual International IEEE EMBS Conference, Vancouver, British Columbia, Ca nada, 2008.
16. F.C. Lin, L.W. Ko, C.H. Chuang, T.P. Su and C.T. Lin, "Generalized EEG-Based Drowsiness Prediction System by Using a Self- Organizing Neural Fuzzy System," IEEE Transactions on Circuits and Systems—I: Regular papers, vol. 59, no. 9, pp. 2044-2055, 2012.
17. S. Makeig, A. J. Bell, T. P. Jung and T. J. Sejnowski, "Independent Component Analysis of Electroencephalographic Data," in Advances in Neural Information Processing Systems, Cambridge,MA, MIT Press, 1996, p. 145–151.
18. R. Broughton and J. Hasan, "Quantitative Topographic Electroencephalographic Mapping During Drowsiness and Sleep Onset," Journal of Clinical Neurophysiology, vol. 12, no. 4, pp. 372-386, 1995.
19. Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh, Mark RG, Mietus JE, Moody GB, Peng C-19. K, Stanley HE, “PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals,” Circulation , vol. 101, no. 23 :e215-e220 [Circulation Electronic Pages; http://circ.ahajournals.org/cgi/content/full/101/23/e215]; 2000.
20. R. Polikar, “The Wavelet Tutorial,” featured by the Science Magazine’s NetWatch Department, Science, vol. 300, no. 561, pp. 873, May 2003.
21. G. Kaiser, A Friendly Guide to Wavelets, Birkhauser 2011. 22. C. Donalek, “Supervised and Unsupervised learning,” http://www.astro.caltech.edu/~donalek/Teaching.html. Accessed 21st April, 2014. 23. MATLAB Cookbook, “How do I perform K-means clustering?,” http://www.matlab-cookbook.com/recipes/0100_Statistics/150_K-
means_clustering.html. Accessed on 21st April, 2014. 24. A. Subasi, "Automatic recognition of alertness level from EEG by using neural network and wavelet coefficients," Expert Systems with
Applications, pp. 1-11, 2004.