Real-Time Detection of Human Drowsiness via a Portable Brain-Computer Interface

In this paper, we proposed a new concept: depth of drowsiness, which can more precisely describe the drowsiness than existing binary description. A set of effective markers for drowsiness: normalized band norm was successfully developed. These markers are invariant from voltage amplitude of brain waves, eliminating the need for calibrating the voltage output of the brain-computer interface devices. A new polling algorithm was designed and implemented for computing the depth of drowsiness. The time cost of data acquisition and processing for each estimate is about one second, which is well suited for realtime applications. Test results with a portable brain-computer interface device show that the depth of drowsiness computed by the method in this paper is generally invariant from ages of test subjects and sensor channels (P3 and C4). The comparison between experiment and computing results indicate that the new method is noticeably better than one of the recent methods in terms of accuracy for predicting the drowsiness.


Introduction
Human drowsiness refers to a physiological state of reduced mental or physical performance resulting from insufficient sleep, long duty periods or irregular work hours.It is attributed to millions of car crashes [1], 4% -7% of civil aviation incidents [2], and 3% of maritime accidents [3].Detecting the operator's drowsiness in real-time is a key to prevent such kinds of tragedies.
Conventional optical methods for detecting fatigued driving are unreliably sensitive to lighting conditions [4] and difficult to be extended for drug and alcohol use.Existing studies in sleep science and psychology [5] [6] [7] are not suited to real-time applications in transportation.To classify the drowsiness, traditional machine learning [8] requires a large amount of training data to tune the weights of an artificial neural network.The training data are dependent upon changes due to different test subjects.There is an urgent need to develop a formula (or algorithm) that is relatively invariant with test subjects and does not need a significant amount of training data such that it is ready to be used in real time for any random driver or operator.Another problem of existing methods is the low accuracy of predicting drowsiness [5] [9]- [14].
The main goal of this paper is to design a new polling algorithm for real-time determination of human drowsiness via an affordable brain-computer interface with the following features: 1) Real-time data acquisition: data sampling window is controlled within one second for computing drowsiness.
2) Real-time data processing: execution time of the algorithm alone is controlled within one millisecond.
3) General algorithm: a general-purposed polling formula is designed and is approximately invariant with test subjects.It does not need the tuning from training data, overcoming a major drawback of existing methods.4) Affordability: the brain-computer interface is controlled under $200, excluding the cost of computer.
The rest of this paper is organized as follows.In Section 2, the materials and methods related to this study are provided.Next, experimental and computing results are given in Section 3 together with discussion.In Section 4, some conclusions and future work are presented.

Materials
In this study, two types of brain-computer interface devices were used: 1) A product from Open BCI (data sampling rate: 250 Hz).
Both companies sell products under $200, which are affordable to regular users, as shown in Figure 1.In details, the following main materials were used, as shown in Figure 1: 1) Gold-coated electrodes and conductive paste (Open BCI).

Methods
The outline of our approach is given in Figure 2(b).First, a brain-computer interface device was used to get the brain wave data of test subjects, as illustrated in Figure 2(a).Then, the data was input into the MATLAB software.In MATLAB, a general-purpose polling algorithm was implemented for computing the depth of drowsiness.Last, the computed depth of drowsiness was compared with the inquired depth of drowsiness and with one of the existing methods [5]. 10 -20 system is an internationally recognized method to specify the location of scalp electrodes for electroencephalography (EEG) test [15].In this paper, two   Brain waves contain much random information that is difficult to be analyzed in time domain (Figure 3(b)).Fourier transform was used to convert the waves to frequency domain (Figure 3(c)) by using Equation (1).It is a tool to break a brain wave into a set of sine or cosine functions with different amplitudes and frequencies: • ( ) f x is a brain wave (time function) In frequency domain, the norm of different frequency bands (delta, theta, alpha, beta and gamma) is defined as biometric markers for drowsiness: where k AS is the normalized amplitude of Fourier transform of the brain wave at frequency k .The normalization is done by a division from sampling fre- quency F s (128 or 250 Hz in this paper).Normalized band norms are defined as A general-purpose polling formula was designed to predict the human drowsiness: 1) Traditionally, the drowsiness is quantified by a binary variable: Yes or No, which is not accurate enough to describe such a complex process.A real number variable, depth of drowsiness, is proposed to precisely describe the different le- 2) In computer graphics [16], millions of different colors are represented by a linear combination of three basic components: RGB, where R, G, B represent red, green, and blue components, respectively.Inspired by this treatment, the drowsiness is represented by a linear combination of several basic frequency components.
3) In sleep science, different frequency channels are often used to investigate sleep patterns.In signal processing, Fourier transform [17] is an effective tool to convert signals from time domain to frequency domain, and the norm of frequency bands can be used as basic components to quantify human drowsiness.
Thus, the norm of frequency bands of brain waves is considered as biometric markers for drowsiness in this paper.
4) Inspired by political voting, a new polling scheme, i.e., judging the drowsiness on the basis of the vote of frequency bands, is designed to express the relation between the depth of drowsiness and the norm of frequency bands: where N δ , N θ , N α , N β , N γ are normalized band norms for δ, θ, α, β, and γ channels, respectively.k δ , k θ , k α , k β are the corresponding weights.
The derivation of the above formula is given in Appendix A.

Testing
For calibrating the sampling rate of the hardware, A stopwatch and the data acquisition software of the devices were used.Table 1 shows the test data of stop- 2) Design and development of the biometric algorithm (i.e., a polling scheme) as well as the setup of the brain-computer interface device.
3) Collection of brain wave data by wearing a brain-computer interface device.
Measurement last for about 6 -7 seconds at a sampling frequency (F s = 250 Hz).

Brain Waves and Normalized Frequency Bands
As shown in Figure 4, plot( ) function in MATLAB was used to draw brain waves in both time and frequency domains.Bar( ) function was used to draw the normalized band norms of five frequency bands (Delta, Theta, Alpha, Beta, and Gamma).

Impact of Sensor Channels
Our biometric markers for drowsiness are roughly invariant between C4 and P3 channels, as illustrated in Figure 5.This is an important feature that eliminates

Data Repetition
The depth of drowsiness varies more severely in waking stage than in drowsy stage.This may be due to the fact that test subjects are more likely influenced from environment during the waking stage.Even with the variation in the waking stage, there is a clear-cut between the two stages, as shown in Figure 6.This figure plots the drowsiness measured five times on a test subject.

Execution Time
The execution time of the MATLAB code is within 1 millisecond (not including the data acquisition time, which is 1 second for each estimate), as listed in Fig-

Age Effect
The computed depth of drowsiness is also generally invariant from ages of test subjects, as illustrated in Figure 8.This avoids the need of a large amount of training data in existing methods.

Accuracy Comparison
Figure 9 provides a comparison of our method with one recent study [5] and indicates that our algorithm provides a more accurate clear-cut between drowsy and waking stages.In details, Table 3 shows the results of some tests in this study.The thresholds 0.65 and 0.5 were used to determine the state predictions (w: waking; d: drowsy) in the fourth and sixth columns, respectively.Red color in the table represents the failed cases.Table 4 is a summary of the comparison, indicating 82% and 70% accuracy for our method and the recent method [5], respectively.Furthermore, the threshold is not sensitive to our method because any value between 0.65 and 0.75 generates a similar accuracy.

Conclusions
The following concluding remarks can be drawn from this study: 1) In this paper, we proposed a new concept: depth of drowsiness, which can more precisely describe the drowsiness than existing binary description.Table 3. Accuracy comparison between our method and one recent method [5].2) After many attempts, we found a set of effective biometric markers for drowsiness: normalized band norms.These markers do not change with scaling the voltage amplitude of brain waves, eliminating the need for calibrating the voltage output of the brain-computer interface devices.
3) We designed and implemented a new polling algorithm for computing the depth of drowsiness.The time cost of data acquisition and processing for each estimate is about one second, which is well suited for real-time applications.

4) Test results
show that the depth of drowsiness computed by the new method is generally invariant from ages of test subjects and sensor channels (P3 and C4).
This eliminates the need of training data required by existing methods.Therefore, our method is better suited to a random driver than existing methods.
5) The cost of the brain-computer interface devices (not including the computer) can be under $200, which is affordable to regular users.

6)
In comparison with a recent study [5], our method increases the success rate of separating drowsy and waking stages from 70% to 82%.
Possible future work may include: 1) Apply the method to a large-scale investigation.
2) Investigate an optimal way to place scalp electrodes.
3) Test the impact of environment such as vehicle vibration.( ) ( ) f k is called the Fourier coefficient.Assume that be- cause of some errors in signal magnification, N samples ( ) f n were multiplied by a scaling factor s, leading to another Fourier coefficient: The substitution of k AS in Equation ( 2) with ( ) f k and ( )
ear positions (A1 and A2) were used as a reference and a bias position.Based on the previous studies in sleep science, P3 and C4 (or P7 and F4) were chosen as measurement points for obtaining brain waves of test subjects.Five frequency bands (delta, theta, alpha, beta and gamma) of brain waves are defined by Figure 3(b).

Figure 2 .
Figure 2. Outline of our approach.(a) A brain-computer interface; (b) Overall approach of our method.
watch and acquisition software of Open BCI.The timing data are quite close to each other.Table 2 is the time acquisition result of Emotiv device in a period of 0.5 second.It indicates that the sampling rate is 128 Hz and sampling time is quite accurate.The absolute value of voltage does not matter in this study because our formula needs only the normalized band norm, which is invariant from voltage amplitude (Appendix B).A Human Participant Form was approved by a local IRB in 2015 and each participant gave his/her permission before the experiment.Ten human subjects were measured with names replaced by pseudo identification numbers, with four of them tested only in waking states.The main test steps of this study are: 1) Assembling and calibration of the brain-computer interface devices.

Table 1 .
Calibration of sampling rate of the OpenBCI device.

Figure 5 .
Figure 5. Influence of sensor channels on the normalized frequency bands.

ure 7 .
The sum of these two costs supports real-time applications in transportation control.

Figure 6 .
Figure 6.Fluctuation of depth of drowsiness of a test subject.

Figure 7 .
Figure 7. Execution time of our algorithm without counting data acquisition and storage.

4 )
Extend our polling algorithm to include signals from electromyography (EMG) and electrocardiogram (EKG or ECG).5) Study on alcohol and drug influence, blackout, road rage, and medical emergency.
i δ = , θ, α, β, γ based on Equations (A11) and (A13), the computed depth of drowsiness in Equation (A8) remains unchanged due to the scaling factor s.Submit or recommend next manuscript to SCIRP and we will provide best service for you:Accepting pre-submission inquiries through Email, Facebook, LinkedIn, Twitter, etc.A wide selection of journals (inclusive of 9 subjects, more than 200 journals) Providing 24-hour high-quality service User-friendly online submission system Fair and swift peer-review system Efficient typesetting and proofreading procedure Display of the result of downloads and visits, as well as the number of cited articles Maximum dissemination of your research work Submit your manuscript at: http://papersubmission.scirp.org/Or contact ojapps@scirp.org

Table 2 .
Time acquisition result of Emotiv device for a period of 0.5 second.

Table 4 .
Summary of comparing our method with one existing method based on the results of 50 test cases.