SciELO - Scientific Electronic Library Online

 
vol.45 número1Análisis Matemático no Lineal Relacionado a un Modelo de Insulina-Células Pancreáticas en Presencia de Epinefrina índice de autoresíndice de materiabúsqueda de artículos
Home Pagelista alfabética de revistas  

Servicios Personalizados

Revista

Articulo

Indicadores

Links relacionados

  • No hay artículos similaresSimilares en SciELO

Compartir


Revista mexicana de ingeniería biomédica

versión On-line ISSN 2395-9126versión impresa ISSN 0188-9532

Rev. mex. ing. bioméd vol.45 no.1 México ene./abr. 2024  Epub 16-Ago-2024

https://doi.org/10.17488/rmib.45.1.1 

Artículos de investigación

Preventive Detection of Driver Drowsiness from EEG Signals using Fuzzy Expert Systems

Detección Preventiva de la Somnolencia del Conductor a partir de Señales EEG Mediante Sistemas Expertos Difusos

Rony Almirón1  * 
http://orcid.org/0000-0002-3488-1761

Bruno Adolfo Castillo1 
http://orcid.org/0000-0003-1135-2688

Andrés Montoya Angulo1 
http://orcid.org/0000-0002-9897-3710

Elvis Supo1 
http://orcid.org/0000-0003-4749-8400

Jesús José Fortunato Talavera Suarez1 
http://orcid.org/0000-0002-8076-5198

Daniel Domingo Yanyachi Aco Cardenas1 
http://orcid.org/0000-0002-8964-5352

1 Universidad Nacional de San Agustín de Arequipa - Perú.


Abstract

Currently, the percentage of traffic accidents has increased, and according to statistics, this percentage will continue to increase every year, so it is necessary to develop new technologies to prevent this kind of accidents. This paper presents a drowsiness detection system based on electroencephalogram (EEG) signals using a pair of channels (Fp1 and Fp2) applied to drivers before entering their vehicles. First, this model detects the relationship between the area under the curve (AUC) of alpha brain waves, an effective parameter for detecting drowsiness. Then, the extracted information is passed to a fuzzy expert system (FES) that classifies the subject's state as "alert" or "sleepy"; the criterion used was a threshold and training with subjective levels. The proposed system was compared with neural network models, such as support vector machine (SVM), K nearest neighbors (KNN), and random forest (RF). Measurements of one hundred and twenty minutes were performed on each of the ten drivers for two days to test the system. The tests confirm that this system is suitable for preventive measures and that the fuzzy system is superior to traditional neural network methods.

Keywords: drive drowsiness; electroencephalogram; expert systems; sleepiness detection

Resumen

Actualmente, el porcentaje de accidentes de tráfico ha aumentado, y según las estadísticas, este porcentaje seguirá aumentando cada año, por lo que es necesario desarrollar nuevas tecnologías para prevenir este tipo de accidentes. Este trabajo presenta un sistema de detección de somnolencia basado en señales de electroencefalograma (EEG) utilizando un par de canales (Fp1 y Fp2) aplicado a los conductores antes de entrar en sus vehículos. En primer lugar, este modelo detecta la relación entre el área bajo la curva (AUC) de las ondas cerebrales alfa, un parámetro eficaz para detectar la somnolencia. A continuación, la información extraída se pasa a un sistema experto difuso (FES) que clasifica el estado del sujeto como "alerta" o "somnoliento"; el criterio utilizado fue un umbral y el entrenamiento con niveles subjetivos. El sistema propuesto se comparó con modelos de redes neuronales, como la máquina de vectores de soporte (SVM), K vecinos más cercanos (KNN) y el bosque aleatorio (RF). Se realizaron mediciones de ciento veinte minutos en cada uno de los diez conductores durante dos días para probar el sistema. Las pruebas confirman que este sistema es adecuado para las medidas preventivas y que el sistema difuso es superior a los métodos tradicionales de redes neuronales.

Palabras clave: electroencefalograma; detección de somnolencia; sistemas expertos; somnolencia en la conducción

Introduction

According to data provided by the World Health Organization (WHO) in the Report on the Global Situation of Road Safety 2018, the number of deaths due to traffic accidents amounted to 1.35 million, being the leading cause of death among people aged 5 - 29 years (more than 300,000 deaths), and the eighth leading cause of death for all age groups[1]. According to the World Report on the Prevention of Injuries Caused by Traffic of the Pan American Health Organization (PAHO) for the year 2020, if road safety actions are not taken, deaths caused by traffic will rise worldwide to 2.34 million, representing 3.4 % of all deaths and road traffic injuries will rank sixth on the list of leading causes of death in the world and third on the list of causes of loss of physical abilities[2].

In Peru, the National Institute of Statistics and Informatics (INEI, by its acronym in Spanish) registered 2,826 fatal victims of traffic accidents in 2017, with more than 2,487 homicide victims[3]. In addition, INEI recorded 174 fatal accidents in the department of Arequipa in the same year and 188 accidents in 2018[3]. Recently, Dr. Helmer Huerta, a public health specialist, wrote that the statistics from the Ministry of Transport and Communications (MTC) of Peru revealed that, after a record of 3,531 deaths on the roads in 2011, 2,965 deaths had been registered in the 2015 and 3,245 deaths in 2018[4]. That is, nine Peruvians die daily in a traffic accident, having one of the highest mortality rates from road accidents in the region, a rate of 10.1 out of every 100,000 inhabitants, exceeding the deaths due to citizen insecurity[5]. This information is supported by the latest calculation of death rates from traffic accidents in 180 countries, made by the WHO in 2018; the average death rate for developed countries is 9.3 deaths per year per 100 thousand inhabitants, while in middle-income countries, the figure doubles, being 18.4 per 100 thousand inhabitants[5]. It is estimated that up to 30 % of road accidents are caused by driver fatigue and drowsiness[6].

To avoid traffic accidents, the driver's drowsiness should be controlled before the accident occurs. In the literature, the most used methods to detect drowsiness are subjective, physiological, vehicle-based, and driver behavior measurements. The subjective measures monitor the subject's state of drowsiness through selfperception. They place scores according to a set range[7], the most widely used being the "Karolinska Sleepiness Scale" (KSS)[8] [9]. Physiological measurements are based on the use of signals; the most used are: Electrocardiogram (ECG), Electroencephalogram (EEG), Electrooculogram (EOG), and Electromyogram (EMG)[10] [11]. Vehicle-based measurements require constant monitoring; any variation could be a sign of drowsiness[12] [13]; some examples are: steering wheel movement, the difference in pedal pressure, deviation of the vehicle's position with respect to the road, etcetera[14]. Driver behavior measurements use a camera to detect drowsiness, which is detected by blinking of the eyes, rolling of the head, yawning, etcetera[15] [16]. Some of us work, for example, that of Tayyaba Azima[17], determine the state of drowsiness of the driver through video cameras installed in the vehicle and a fuzzy expert system that manages to classify between a state of drowsiness and non-drowsiness. These measurements are good, but they determine the driver's drowsiness when it happens, so they do not have time to react to a possible disaster.

Much of the previous work focuses on detecting driver yawning, prolonged eye closures, eyebrow shape, and cameras that invade privacy and tend to make the driver uncomfortable, in addition to the large amount of data required to implement sleep identification algorithms for each system configuration and driver environment, e.g., different vehicles, different lighting, distance to sensor and driver physiology. Another group of works alerts when the driver presents evident drowsiness symptoms, giving a very short time between the correct identification of drowsiness and the alert to the driver in case of a possible traffic accident.

To solve these problems, in this research, we present a novel system for detecting driver drowsiness before getting into the vehicle in order not to disturb the driver while driving, and requiring a reduced database to make the algorithm feasible to train in both new system configurations and new environments where an extensive database is commonly not available. The porposed system is based on fuzzy expert systems for drowsiness classification, using data obtained by EEG. For simplicity, the generated interface shows the classification in only two states: not sleepy (alert) and sleepy. The results obtained by the drowsiness detection system from the EEG signals of the driver before entering the vehicle are contrasted with the driver's drowsiness record while driving. Finally, a success rate analysis of the tests is performed.

The rest of the document is structured as follows: Section 2 presents the works related to our research. Section 3 presents the materials used to perform the data acquisition. Section 4 presents the methods used for the classification of sleepiness. Section 5 shows the results obtained and their respective discussion. Finally, Section 6 contains the conclusions of this document and the projection of future work.

Related work

There are several notable studies that focus on detecting the state of drowsiness in drivers. Some of these studies make use of artificial vision systems, which is a non-intrusive method, to detect patterns in drivers that show the presence of drowsiness; the most used patterns are: yawning, angle of inclination of the eyes, continuous blinking, nodding, drooping of the eyelids, etc. To solve these problems, in this research, we present a novel system for detecting driver drowsiness before getting into the vehicle in order not to disturb the driver while driving, and requiring a reduced database to make it feasible to train the algorithm in both new system configurations and new environments where an extensive database is commonly not available. The system is based on fuzzy expert systems for drowsiness classification, using data obtained by EEG. For simplicity, the generated interface shows the classification in only two states: not sleepy (alert) and sleepy. The results obtained by the drowsiness detection system from the EEG signals of the driver before entering the vehicle are contrasted with the driver's drowsiness record while driving. Finally, a success rate analysis of the tests is performed.

Tayyaba Azima, Arfan Jaffar, and Anwar M. Mirza[17] in their article describe a fatigue detection system based on video analysis of drivers. Their system uses two parameters to classify the state of drowsiness: Duration of ocular closure and yawning. The face is located in that system using the Viola-Jones face detection method. Then, they extract a window from the mouth region; simultaneously, they detect the pupils and their inclination angle. Monitored information from the eyes and mouth is sent to a fuzzy expert system (FES) that classifies the driver's drowsy state. The system shows that it is good at detecting and classifying the level of fatigue. Furthermore, the fuzzy expert system has proved to perform well for a sleepiness classification system.

Vineetha Vijayan and Elizabeth Sherly[18] also propose an architecture based on the measurement of facial movements such as eye blinking, yawning and head rolling, through RGB video and deep neural networks. They successfully compare three neural models, ResNet50, VGG16 and InceptionV3, and a fused architecture of the three models (FFA).

Boon-Giin L., Boon-Leng L. and W. Chung[19] present a sleep detection system with mobile devices, using 8-channel EEG signal and driver's breath. First, they extract the EEG characteristics with the wave packet transform (WPT) method to separate the signals into four frequency bands: alpha, beta, theta, and delta. A mutual information (MI) technique selects the most descriptive characteristics to perform a classification with a support vector machine (SVM). The classification processing is carried out on a mobile device, verifying that this system requires very little computational cost, unlike other similar methods.

Yingying Jiaoa, Yini Denga, Yun Luoa, and Bao-Liang Lu[20] [21] propose a model that detects driver drowsiness based on EEG and EOG signals. This model can track the change in alpha waves and differentiate the alpharelated phenomena: the alpha-blocking phenomenon and the fading-disappearing phenomenon. The LSTM (Long-Short Term Memory) network is used to manage the temporal information of the EEG and EOG signals.

Additionally, the Generative Adversary Network (GAN) is used in this paper to augment the training data set. The results show that their model has great precision when classifying the driver's condition. The same authors[22] also wrote another article in which they checked the phenomena of alpha. They used alpha's power spectrum density (PSD) to determine the phenomenon visually. Furthermore, it is observed that the attenuation-disappearance phenomenon takes a short time to appear, around ten seconds.

Another author who does an article on alpha-related phenomena is Arcady Putilov. Putilov associates the alpha attenuation-disappearance with drowsiness. In addition, he indicates in his document that this phenomenon appears when the participant closes his eyes and keeps them closed[23].

Materials and methods

Measuring devices

The tests were carried out on real vehicles, Figure 1 shows the instruments inside the vehicles of “San Cristóbal del Sur” company and “Transportes Libertad” company respectively.

Figure 1 Tests carried out on real vehicles. a) San Cristóbal del Sur company b) Transportes Libertad company. 

EEG brain signals were recorded with the InteraXon Muse electroencephalogram. This device has four channels, uses Bluetooth to send data and has dry electrodes in order to be less invasive in data collection. According to the international convention for the placement of electrodes[24], the Muse electrodes are located at Fp1, Pp2, A1 and A2, with A2 being the reference electrode used, see Figure 2.

Figure 2 Location of the electrodes on the head. 

Data register

EEG signals recorded by the two selected channels, with a sampling rate of 256 Hz, were subjected to lowpass and high-pass filters (0.5 and 40 Hz, respectively), sampled, and stored in .csv files. The raw signals are visualized in real-time with a Python graphical interface (see Figure 3). All statistical analyses and data preprocessing were performed in Python with their respective scientific library.

Figure 3 Graphical interface showing measurements. 

Alpha wave

Alpha waves originate in the occipital lobe and are seen in relaxed wakefulness during eye closure[25]. These waves correspond to the frequency range between 8 - 12 Hz[26]. In[27], it is mentioned that the range of the waves is generally between 0.5 and 100uV, in addition, in the literature it has been shown that there is an amplitude difference between the normal state and the drowsy state in alpha waves[28].

Alpha blocking phenomenon

Alpha waves are produced when the eyes are closed in relaxed wakefulness and quickly fade when the eyes are reopened[20]. This phenomenon, known as alphablocking, indicates that the person has no trace of drowsiness[21]; for this reason, it serves as an indicator that the person is in an alert state.

Phenomenon of attenuation-disappearance of alpha waves

The attenuation of the alpha rhythm serves as a reliable EEG marker of sleep onset[20] [29] [30] [31], it is considered the most valuable marker of sleep on-set during sleep[21]. Furthermore, objective assessment of sleepiness in permanently awake individuals could be facilitated by probing for alpha attenuation immediately after closing the eyes[32]. In this way, EEG tests can be performed in closed eyes for one minute.

Experimental procedure

A total of 10 volunteer subjects were evaluated. The age of the seven men ranged from 22 to 34 years (28 ± 6), and the three women ranged from 20 to 29 years (24.5 ± 4.5). All participants are heavy vehicle transport workers with at least one year of experience. The study volunteers did not report any mental or physical health problems and had no history of psychiatric or sleep disorders. The participants were evaluated at the beginning of their duties so that each one had at least eight hours of sleep, and it was ensured that none of them had ingested caffeinated beverages, medicines, or any food that could induce drowsiness. Written informed consent was obtained from each participant in the study.

Pre-test preparation

Before each EEG recording session, the participants were asked to use the modified Karolinska scale to indicate their level of alertness/sleepiness[7], this modification of the scale consisted of discarding the even levels, leaving the new scale as follows:

  1. Very alert.

  2. Alert.

  3. Neither drowsy nor Alert.

  4. Sleepy, easy to stay awake.

  5. Sleepy, great difficulty staying awake.

After registering the data, it is recorded that there were no level 1 values, so this scale was discarded, leaving levels 3, 5, 7 and 9. The classification of alertness/sleepiness is represented in Figure 4:

Figure 4 Modified Karolinska scale. 

These subjective values were used as references of the real state of drowsiness of the participants, the precision values were obtained by comparing them with the value extracted from the system.

Open-closed-open eyes experiment

To visualize the phenomenon of alpha attenuationdisappearance, a comparison was made between measurements of 15 seconds with eyes open (reference), 1 minute with eyes closed (detection test), and finally, measurements of 15 seconds with eyes open (reference). See Figure 5.

Figure 5 Alpha attenuation-disappearance phenomenon. 

For data collection, the participants were in comfortable chairs, and a supervisor asked them to avoid any movement or distraction during the experiment. In addition, they indicated to the participants the exact moments when to close or open their eyes and not to blink during periods with eyes open. See Figure 6.

Figure 6 Environment for driving tests. 

Test drive after analysis

After conducting the evaluation, the drivers began their working day (accompanied by a copilot for greater safety). Whether or not the driver showed drowsiness was recorded for a later analysis of the success rate of the tests. This test demonstrates the success of prevention of the level of drowsiness.

Methods

When the two phenomena related to alpha waves are observed, two different patterns are distinguished; the key to detecting if the driver is in a state of acute drowsiness is to distinguish which of these two phenomena is most closely related to the measurements. Therefore, the proposed model compares the alpha waves measured to the conductors with the waves that served as training for the model. The eye closure point (P1) is recognized as the point used to compare both samples. Figure 7 shows the flow diagram that the model follows in order to recognize an acute level of drowsiness (KSS = 9).

Figure 7 Proposed System flow diagram. 

The following algorithms show the primary step sequences used in the model. First, Welch's method is applied to calculate the Alpha power spectrum (Algorithm 1)[33]. Then, it passes a filter to separate the wave by epoch, improving the model's precision. Then, the strategy to detect the beginning and end of the alpha wave when closing and opening the eyes, respectively, is presented. Finally, the fuzzy expert system (FES) used in this model is described.

Algorithm 1 Calculation of the potency of alpha. 

Obtaining the alpha wave energy threshold

We will start by estimating the power spectral density to calculate the absolute power in the alpha band. The most widely used method to do this is the Welch periogram[34]. Welch's method makes it possible to drastically reduce the variations produced by the constant variation of the spectral content of EEG signals[35]. Frequency resolution is defined by:

Fres=FsN=Fst*Fs=1t=160 (1)

Where Fs is the signal sampling frequency, N is the total number of samples and t is the duration, in seconds.

Algorithm 1 shows the procedure used to determine the alpha power using the "scipy" library.

Separation of energy in epochs

By having a length of the data (1 minute = 60 seconds), the final frequency resolution would be: 1/60 = 0.0167 Hz, which is 60 frequency bits per Hertz. A window long enough is taken to span at least two complete cycles of the lowest frequency of interest[36]. In this case, the lowest frequency of interest corresponding to the alpha band (8 Hz to 12 Hz) is 8 Hz, so it is chosen a window of 2/8 = 0.25 seconds, see the Algorithm 2.

Algorithm 2 Calculation of the potency of alpha. 

Before calculating the absolute alpha band power (average), it is necessary to find the frequency intervals that intersect the Alpha range. For this purpose, it is defined the upper and lower frequency limits corresponding to this band (8 Hz to 12 Hz). Normalized measurements are used at all times to ensure that any sample is outside the range. The formula used is:

Alphanormalized=Alpha-AlphaminAlphamax-Alphamin (2)

These calculated alpha values will be used to obtain the ratio of the area under the curve (AUC), see Algorithm 3.

Algorithm 3 Calculation of AUC. 

Classification of levels using FES

The purpose of this classifier is to determine the starting point of eye closure, the point that initiates the phenomenon of fading-disappearance of alpha waves.

For this, the model must autonomously recognize when this phenomenon starts in the measurements made.

Feature extraction

Feature extraction algorithms are an important element in all machine learning models. The first step in developing this fatigue detection system is to determine the number of variables or characteristics involved, according to the criteria of the experts. The algorithm extracts the characteristics of the measurement during the test minute; the values of the measurements with the eyes open serve as a reference to have knowledge of the low alpha values of each individual. The characteristics chosen after conducting an adequate study of our system are: Initial point ratio (P1), End point ratio (P2), Eye condition, Area under curve 1 (AUC1), Area under curve 2 (AUC2) and fatigue level. Table 1 shows the characteristics and associated linguistic terms.

Table 1 Details of the input and output variables used by the expert system. 

Variable Type Range Linguistic Terms
Ratio P1 Input X Level A1, level A2
Ratio P2 Input X Level A1, level A2
Eye condition Output [0 - 1] Open, closed
AUC 1 Input X Level B1, level B2
AUC 2 Input X Level B1, level B2
Fatigue level Output [0 - 1] Low, high

The area under curve 1 is taken from the first 30 seconds of the closed-eye tests, while AUC2 is taken from the remaining 30 seconds. Because the system is proposed as adaptive (to any gender, ethnicity, etc.), A1, A2, B1 and B2 levels of the input characteristics are determined according to the alpha values obtained during the first 15 seconds of the tests with open eyes.

Detection of start and end points of alpha wave

As can be seen in Figure 8, to obtain the alpha energy value curve, it is applied the Welch periodogram, then a sharp change between two consecutive signals was detected. The largest in the entire measurement marks the point P1; then this information is passed to the trained model to make its classification.

Figure 8 Alpha energy graph. 

FES classifier

FES uses fuzzy logic through functions and rules instead of Boolean logic to reason about input data. These systems can be seen as an attempt to formalize two human capacities[17]. Fuzzy logic intends to solve a problem relying on IF X AND Y THEN Z to solve a control problem instead of trying to obtain a mathematical model of the process. The model is empirically based on the operator's experience rather than his technical comprehension of the underlying system[37]. One of the most significant advantages of FES is that it generally does not require an extensive training set[17]. Since there is not a large amount of data to train, this classifier was chosen.

In this step, it is determined whether the driver's state of drowsiness is acute. If the fatigue level value is higher than 0.55, the system informs with a message ("with drowsiness") that indicates the driver is not fit to drive. The system can detect drowsiness regardless of the driver's ethnicity, gender, etc. Hence, the system takes the first 15 seconds of measurement (during the eye-open portion of the test) to determine the range of the alpha-level input. Based on the selected variables, rules have been declared to express the behavior of the system in a comprehensible and logical way. Different rules are enunciated to express the behavior that the system follows from the variables mentioned in section 4.3.1.

We got a total of 18 understandable rules. According to these rules, the state of the eyes and the level of the characteristics play a significant role in detecting the state of the driver. Of the set of rules, ten are listed in Table 2, and the rest follow a similar pattern. In addition, the rules follow a hierarchy (added weight) according to their relevance when the system classifies.

Table 2 Rules for the expert system. 

Number Rules Weight
1 IF (eyes is open) AND (auc1 is level1)
AND (auc2 is level1) AND (P1 is level1) THEN (“low fatigue”)
1.0
2 IF (eyes is open) AND (auc1 is level2)
AND (auc2 is level1) AND (P1 is level1) THEN (“low fatigue”)
0.5
3 IF (eyes is open) AND (auc1 is level2)
AND (auc2 is level1) AND (P1 is level1) THEN (“low fatigue”)
0.4
4 IF (eyes is open) AND (auc1 is level2)
AND (auc2 is level2) AND (P1 is level1) THEN (“low fatigue”)
1.0
5 IF (eyes is open) AND (auc1 is level2)
AND (auc2 is level2) AND (P1 is level2) THEN (“high fatigue”)
0.8
6 IF (eyes is close) AND (auc1 is level1)
AND (auc2 is level1) AND (P1 is level1) THEN (“low fatigue”)
1.0
7 IF (eyes is close) AND (auc1 is level2)
AND (auc2 is level1) AND (P1 is level1) THEN (“high fatigue”)
0.8
8 IF (eyes is close) AND (auc1 is level2)
AND (auc2 is level1) AND (P1 is level2) THEN (“high fatigue”)
1.0
9 IF (eyes is close) AND (auc1 is level1)
AND (auc2 is level2) AND (P1 is level1) THEN (“low fatigue”)
0.7
10 IF (eyes is close) AND (auc1 is level1)
AND (auc2 is level2) AND (P1 is level2) THEN (“low fatigue”)
0.5

The variables and rules were declared correctly, for this reason, now the fuzzy expert system process can follow the following steps[17]:

  1. Return sharp input values to fuzzy

  2. Evaluation of all If-Then rules in parallel.

  3. Adding of the consequents through the rules.

  4. Converting the fuzzy response to a sharp value.

Results and discussion

To corroborate the performance of this model, a laptop was used, it was composed by Windows operative system, 6th Gen Intel (R) Core (TM) i5 processor, quad core, 8GB RAM, and an NVIDIA 840 with 2GB memory (GPU not accelerated). Each driver performed the open- closed-open eyes test once before getting into their vehicle, for a total of 20 sessions per driver.

The results are displayed in the graphical user interface. Then, different combinations were tried of window size and epoch length, to get the one that give the best results. Next, it is tested the eye opening and closing based on alpha measurements. For the FES system, it was tested its performance by comparing it with RNN, SVM and K-NN using training and testing each subject.

Result in the graphical interface

Figure 9 shows two levels of sleepiness found for the four most descriptive extracted features of the EEG signals. The upper part of the graph (blue signal) corresponds to the EEG signals without processing and in real time (a sampling frequency of 250 Hz), they were obtained from the derivative of Fp1 and Fp2. The middle part of the graph shows two signals, the first one in green corresponds to the entire signal captured during the test minute and the yellow signal corresponds to the signal after filtering. The lower part indicates the state of the driver, being "Drowsiness" or "Not Drowsy".

Figure 9 Results in the graphical interface. 

Different combinations of window size and epochs

The performance of the system was compared for different combinations of window size and sliding step size on the Welch periodogram. For this purpose, 120 samples of a single person with different configurations were used. Among the configurations that were tested, there was no overlap of sliding windows in the 0.25 s window size configuration with the 0.25 s sliding step. In all the other combinations, an overlap was considered. The total time coverage of each window was 2 s (epochs) for each configuration so the information contained in all configurations was the same. In Table 3, it can be seen that every window featuring overlap performed better than the window without any overlap.

Table 3 Comparison of epochs used. 

Subject Window
= 0.25
Sliding
=0.1
Window
= 0.4
Sliding
=0.125
Window
= 0.5
Sliding
=0.125
Window
= 0.5
Sliding
=0.25
1 81.67 83.33 87.50 85.00
2 79.17 80.00 85.83 80.83
3 75.00 77.50 85.00 81.67
4 77.50 78.33 84.17 79.17
5 76.67 75.83 85.00 84.17
6 79.17 80.00 85.83 83.33
7 75.00 79.17 82.50 81.67
8 81.67 80.83 81.67 82.50
9 78.33 78.33 85.83 85.00
10 76.67 77.50 85.00 80.83
Prom 78.08 79.08 84.8 82.42

In Table 3, it can be seen that the 0.5 s window with 0.125 s sliding step size was the best. Therefore, this combination was chosen to be our window setup for extracting features from the EEG signal. Alpha waves start and end point detection performance.

As shown in Figure 8, the detection of start and end points relies only on Alpha waves; this generates a deviation at the exact moment. For this reason, the detection of these points was considered correct if they corresponded to the range of [I (s) ± 0.5s] and [F (s) ± 0.75s], a greater range was considered for the endpoint because in the attenuation-disappearance phenomenon, so it was more challenging to differentiate Alpha levels.

In Table 4, it is observed that the average of the percentages of successes of the start and end points is 79.48 % and 76.31 %, respectively, for drivers in state of alert. For drowsy drivers the average is 81.50 % and 78.94 %. These values confirm that the system adequately detects the start and end points of the eyes closed event using only EEG measurement.

Table 4 Detection performance #A and #D. 

N #A Start
(%)
End
(%)
#D Start
(%)
End
(%)
1 62 75.81 72.58 58 81.03 77.59
2 65 81.54 73.85 55 81.82 80.00
3 71 84.51 74.65 49 83.67 81.63
4 70 75.71 72.86 50 80.00 82.00
5 63 77.78 82.54 57 85.96 78.95
6 69 78.26 72.46 51 82.35 80.39
7 72 80.56 83.33 48 77.08 79.17
8 66 77.27 74.24 54 79.63 81.48
9 59 81.36 76.27 61 78.69 77.05
10 61 81.97 80.33 59 84.75 71.19
P 79.48 76.1 81.50 78.94
SD 2.78 3.98 2.63 3.03

Classifier comparison

To simplify the comparison of classifiers, only the samples that exceed the 25 detected values were taken, avoiding possible misrepresentations. We compared our FES classifier with SVM, KNN and RF using an independent assessment of each subject. Table 5 shows that in each evaluation, the model obtains the best accuracy of hits, being the highest detected 87.50 %. As indicated in Section 3.4.1, the KSS values of the subjects were used to determine if the person is in a state of alert or in a state of drowsiness, this determines the hit rate.

Table 5 Accuracy (%) of SVM, KNN, RF and FES to classify conductor states. 

Subject SVM (%) KNN (%) RF(%) FES (%)
1 78.33 79.17 83.33 87.50
2 80.00 83.33 80.83 85.83
3 80.83 77.50 80.83 85.00
4 75.83 76.67 84.17 84.17
5 75.83 75.00 85.00 85.00
6 76.67 75.83 84.17 85.83
7 79.17 74.17 81.67 82.50
8 79.17 73.33 80.83 81.67
9 80.83 76.67 82.50 85.83
10 78.33 75.83 83.33 85.00
Prom 78.50 76.75 82.67 84.83
SD 1.78 2.70 1.48 1.61

Prevention hit rate

In Section 3.4.3 it was noted about the proof test that the system predicts the drowsy state of the driver. The tests consisted of determining if the driver during the journey showed signs of drowsiness (through the perception of the copilot and self-perception) and then comparing them with what the system had predicted. Table 6 shows the total hit rate of the prediction of drowsiness, due to there were 60 tests for each person.

Table 6 System prediction hit rate. 

Subject Number of
drowsiness
Accuracy (%)
1 2 80.00
2 1 83.33
3 2 91.67
4 0 88.33
5 3 86.67
6 1 83.33
7 1 81.67
8 3 86.67
9 1 85.00
10 0 86.67

Conclusions

This document proposes a new system to detect driver drowsiness from EEG signals. This model aims to detect the change in alpha waves captured by the pair of electrodes located in the right frontal area (F2) and to detect the beginning and end of the samples during tests with eyes closed in order to detect the drowsy state of the driver before getting into the vehicle. The proposed model uses the Welch periodogram to extract the power of the alpha waves, a filter to improve the wave shape, and FES to classify the states of the conductors. The results have shown that our model can detect the driver's condition with an average accuracy of 84.8 %. These tests were compared with classifier models such as RNN, KNN, and SVM. The percentage of success obtained for the other learning methods was SVM = 78.5 %, KNN = 76.8 %, and RF = 82.6 %, making this model much superior to the others. Since this model only places two electrodes on the subject, it is practical for routine use in real-life scenarios; this has been proven in the preventive detection of drowsiness in drivers.

Future work will focus on strengthening the weakest points when detecting drowsiness. The implemented system works as a good base, but it can be noted that it has problems during the tests with the eyes open; future works will focus on filtering out the blinks that interfere with the alpha measurements. In addition, one more state will be added; there will be three states: alert, low drowsiness, and acute drowsiness. In addition, this system would complement a real-time detection system obtained from vehicle measurements.

Ethical Statement

In this article, all of the subject were advised about the complete procedures and methods before the test. It was obtained the consent of each participant.

Conflict of interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Author contributions

R.A. conceptualization, methodology, data curation, software, visualization. B.A.C. data curation, software, visualization, methodology, validation. A.M.A. investigation, validation, methodology, writing original draft. E.S. project administration, methodology, conceptualization, writing original draft, review and editing. J.J.F.T.S. project administration, methodology, supervision, writing review and editing. D.D.Y.A.C. methodology, writing review and editing, supervision. All authors reviewed and approved the final version of the manuscript.

Acknowledgements

We thank the Escuela Profesional de Ingeniería electrónica (EPIE) of the Universidad Nacional de San Agustín de Arequipa for the academic training. In addition, we thank the companies “San Cristóbal del Sur.” and “Transportes Libertad” for providing vehicles where the tests were carried out. Finally, this work has been part of the project: “Desarrollo de un codificador de los movimientos oculares en tiempo real basado en electrooculografía para contribuir en mejorar la calidad de vida de personas con discapacidad" financing contract No. 33-2017 UNSA.

References

[1] World Health Organization, “Global status report on road safety 2018,” WHO. France, 2018 Accessed: Dec. 21, 2023. [Online]. Available: Available: https://www.who.int/publications/i/item/9789241565684Links ]

[2] Pan American Health Organization, World Health Organization, “Road Safety,” PAHO/WHO. Accessed: Dec. 21, 2023. [Online]. Available: Available: https://www.paho.org/en/topics/road-safetyLinks ]

[3] D. Carhuavilca, Perú: Natalidad, Mortalidad y Nupcialidad, 2019, Lima, Perú: Instituto Nacional de Informática y Estadística, 2020. [Online]. Available: https://www.inei.gob.pe/media/MenuRecursivo/publicaciones_digitales/Est/Lib1766/libro.pdfLinks ]

[4] Policía Nacional del Perú, “Muertos por Accidentes de Tránsito 2006 - 2017,” Ministerio de transportes y Comunicaciones. Accessed: Dec. 21, 2023. [Online]. Available: Available: https://www.mtc.gob.pe/cnsv/documentos/muertosAccidenteTransito_2006-2017.pdf . [ Links ]

[5] E. Huerta. “La preocupante cifra de muertes por accidentes de tránsito en el Perú y sus principales causas.” El Comercio Perú. https://elcomercio.pe/tecnologia/actualidad/preocupante-cifra-muertes-accidentes-transito-peru-principales-causas-ecpm-noticia-651076-noticia/ (accessed Dec. 21, 2023). [ Links ]

[6] J. Rey de Castro, “Drowsy drivers on the roads of Peru: findings and proposals,” Rev. Med. Hered., vol. 22, no. 4, pp. 155-156, Oct. 2011. [Online]. Available: http://www.scielo.org.pe/scielo.php?script=sci_arttext&pid=S1018-130X2011000400001Links ]

[7] A. A. Putilov and O. G. Donskaya, “Construction and validation of the EEG analogues of the Karolinska sleepiness scale based on the Karolinska drowsiness test,” Clin. Neurophysiol., vol. 124, no. 7, pp. 1346-1352, Jul. 2013, doi: https://doi.org/10.1016/j. clinph.2013.01.018 [ Links ]

[8] V. Riethmeister, R. W. Matthews, D. Dawson, M. R. de Boer, S. Brouwer, and U. Bültmann, “Time-of-day and days-on-shift predict increased fatigue over two-week offshore day-shifts,” Appl. Ergon., vol. 78, pp. 157-163, Jul. 2019, doi: https://doi.org/10.1016/j.apergo.2019.02.010 [ Links ]

[9] A. Sahayadhas, K. Sundaraj, and M. Murugappan, “Detecting Driver Drowsiness Based on Sensors: A Review,” Sensors, vol. 12, no. 12, pp. 16937-16953, Dec. 2012, doi: https://doi.org/10.3390/s121216937 [ Links ]

[10] V. Bajaj, S. Taran, S. K. Khare, and A. Sengur, “Feature extraction method for classification of alertness and drowsiness states EEG signals,” Appl. Acoust., vol. 163, art. no. 107224, Jun. 2020, doi: https://doi.org/10.1016/j.apacoust.2020.107224 [ Links ]

[11] U. Budak, V. Bajaj, Y. Akbulut, O. Atila, and A. Sengur, “An Effective Hybrid Model for EEG-Based Drowsiness Detection,” IEEE Sens. J., vol. 19, no. 17, pp. 7624-7631, Sep. 2019, doi: https://doi.org/10.1109/jsen.2019.2917850 [ Links ]

[12] M. Fernandes, “Driver drowsiness detection using non-intrusive eletrocardiogram and steering wheel angle signals,” M. S. thesis, Univ. Porto, Porto, Portugal, 2019. [Online]. Available: https://repositorio-aberto.up.pt/bitstream/10216/122936/2/358726.pdfLinks ]

[13] S. Arefnezhad, S. Samiee, A. Eichberger, and A. Nahvi, “Driver Drowsiness Detection Based on Steering Wheel Data Applying Adaptive Neuro-Fuzzy Feature Selection,” Sensors, vol. 19, no. 4, art. no. 943, Feb. 2019, doi: https://doi.org/10.3390/s19040943 [ Links ]

[14] M. Chai, S.-W. Li, W.-C. Sun, M.-Z. Guo, and M.-Y. Huang, “Drowsiness monitoring based on steering wheel status,” Transp. Res. D Transp. Environ., vol. 66, pp. 95-103, Jan. 2019, doi: https://doi.org/10.1016/j.trd.2018.07.007 [ Links ]

[15] C. Fors, C. Ahlström, P. Sörner, J. Kovaceva, et al., “Camera-based sleepiness detection Final report of the project SleepEYE,” Virtual Prototyping and Assessment by Simulation, 2011. Accessed: Aug. 23, 2023. [Online]. Available: Available: https://www.diva-portal.org/smash/get/diva2:674103/FULLTEXT01.pdfLinks ]

[16] Mohamed Hedi Baccour, Frauke Driewer, Enkelejda Kasneci, and W. Rosenstiel, “Camera-Based Eye Blink Detection Algorithm for Assessing Driver Drowsiness,” Jun. 2019, doi: https://doi.org/10.1109/ivs.2019.8813871 [ Links ]

[17] T. Azim, M. A. Jaffar, and A. M. Mirza, “Fully automated real time fatigue detection of drivers through Fuzzy Expert Systems,” Appl. Soft Comput., vol. 18, pp. 25-38, May 2014, doi: https://doi.org/10.1016/j.asoc.2014.01.020 [ Links ]

[18] V. Vijayan and E. Sherly, “Real time detection system of driver drowsiness based on representation learning using deep neural networks,” J. Intell. Fuzzy Syst., vol. 36, no. 3, pp. 1977-1985, Mar. 2019, doi: https://doi.org/10.3233/jifs-169909 [ Links ]

[19] B.-G. Lee, B.-L. Lee, and W.-Y. Chung, “Mobile Healthcare for Automatic Driving Sleep-Onset Detection Using Wavelet-Based EEG and Respiration Signals,” Sensors, vol. 14, no. 10, pp. 17915-17936, Sep. 2014, doi: https://doi.org/10.3390/s141017915 [ Links ]

[20] Y. Jiao, Y. Deng, Y. Luo, and B.-L. Lu, “Driver sleepiness detection from EEG and EOG signals using GAN and LSTM networks,” Neurocomputing, vol. 408, pp. 100-111, Sep. 2020, doi: https://doi.org/10.1016/j.neucom.2019.05.108 [ Links ]

[21] Y. Jiao and B.-L. Lu, “Detecting driver sleepiness from EEG alpha wave during daytime driving,” in 2017 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), Kansas City, MO, USA, 2017, pp. 728-731, doi: https://doi.org/10.1109/BIBM.2017.8217744 [ Links ]

[22] Y. Jiao and B.-L. Lu, “An alpha wave pattern from attenuation to disappearance for predicting the entry into sleep during simulated driving,” in 2017 8th International IEEE/EMBS Conference on Neural Engineering (NER), Shanghai, China, 2017, pp. 21-24, doi: https://doi.org/10.1109/NER.2017.8008282 [ Links ]

[23] A. A. Putilov and O. G. Donskaya, “Alpha attenuation soon after closing the eyes as an objective indicator of sleepiness,” Clin. Exp. Pharmacol. Physiol., vol. 41, no. 12, pp. 956-964, Dec. 2014, doi: https://doi.org/10.1111/1440-1681.12311 [ Links ]

[24] S.-C. Ng and P. Raveendran, “EEG Peak Alpha Frequency as an Indicator for Physical Fatigue,” in 11th Mediterranean Conference on Medical and Biomedical Engineering and Computing 2007. IFMBE Proceedings, vol 16. Springer, Heidelberg, Germany, 2007, pp. 517-520, doi: https://doi.org/10.1007/978-3-540-73044-6_132 [ Links ]

[25] S. Hanslmayr, J. Gross, W. Klimesch, and K. L. Shapiro, “The role of alpha oscillations in temporal attention,” Brain Res. Rev., vol. 67, no. 1-2, pp. 331-343, Jun. 2011, doi: https://doi.org/10.1016/j.brainresrev.2011.04.002 [ Links ]

[26] J. Katona, I. Farkas, T. Ujbanyi, P. Dukan, and A. Kovari, “Evaluation of the NeuroSky MindFlex EEG headset brain waves data,” in 2014 IEEE 12th International Symposium on Applied Machine Intelligence and Informatics (SAMI), Herl'any, Slovakia, 2014, pp. 91-94, doi: https://doi.org/10.1109/SAMI.2014.6822382 [ Links ]

[27] M. Pathak and A. K. Jayanthy, “Designing of a single channel EEG acquisition system for detection of drowsiness,” in 2017 International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), Chennai, India, 2017, pp. 1364-1368, doi: https://doi.org/10.1109/WiSPNET.2017.8299986 [ Links ]

[28] M. Pathak and A. K. Jayanthy, “Development of a Real- Time Single Channel Brain-Computer Interface System for Detection of Drowsiness,” Biomed. Eng. Appl. Basis Commun., vol. 29, no. 3, art no. 1750019, Jun. 2017, doi: https://doi.org/10.4015/s1016237217500193 [ Links ]

[29] D. L. Schomer, “The Normal EEG in an Adult,” in The Clinical Neurophysiology Primer, A. S. Blum, S. B. Rutkove, Eds., Totowa, NJ, USA: Humana Press eBooks, 2007, ch. 5, pp. 57-71, doi: https://doi.org/10.1007/978-1-59745-271-7_5 [ Links ]

[30] Y. Albadawi, M. Takruri, and M. Awad, “A Review of Recent Developments in Driver Drowsiness Detection Systems,” Sensors, vol. 22, no. 5, art. no. 2069, Mar. 2022, doi: https://doi.org/10.3390/ s22052069 [ Links ]

[31] G. Li and W.-Y. Chung, “Electroencephalogram-Based Approaches for Driver Drowsiness Detection and Management: A Review,” Sensors, vol. 22, no. 3, art. no. 1100, Jan. 2022, doi: https://doi.org/10.3390/s22031100 [ Links ]

[32] S.-H. Hwang, M. Park, J. Kim, Y. Yun, and J. Son, “Driver Drowsiness Detection Using EEG Features,” in HCI International 2018 - Posters' Extended Abstracts. HCI 2018. Communications in Computer and Information Science, vol. 852, Las Vegas, NV, USA, 2018, pp. 367-374, doi: https://doi.org/10.1007/978-3-319-92285-0_49 [ Links ]

[33] C. Dissanayaka, E. Ben-Simon, M. Gruberger, A. Maron-Katz, H. Sharon, T. Hendler, D. Cvetkovic, “Comparison between human awake, meditation and drowsiness EEG activities based on directed transfer function and MVDR coherence methods,” Med. Biol. Eng. Comput., vol. 53, no. 7, pp. 599-607, Jul. 2015, doi: https://doi.org/10.1007/s11517-015-1272-0 [ Links ]

[34] R. Vallat, M. Eskinazi, A. Nicolas, and P. Ruby, “Sleep and dream habits in a sample of French college students who report no sleep disorders,” J. Sleep Res., vol. 27, no. 5, art. no. e12659, Feb. 2018, doi: https://doi.org/10.1111/jsr.12659 [ Links ]

[35] E. Combrisson, R. Vallat, C. O'Reilly, M. Jas, et al., “Visbrain: A MultiPurpose GPU-Accelerated Open-Source Suite for Multimodal Brain Data Visualization,” Front. Neuroinform., vol. 13, art. no. 14, Mar. 2019, doi: https://doi.org/10.3389/fninf.2019.00014 [ Links ]

[36] P. A. M. Kanda, E. F. Oliveira, and F. J. Fraga, “EEG epochs with less alpha rhythm improve discrimination of mild Alzheimer’s,” Comput. Methods Programs Biomed., vol. 138, pp. 13-22, Jan. 2017, doi: https://doi.org/10.1016/j.cmpb.2016.09.023 [ Links ]

[37] J.-D. Wu and T.-R. Chen, “Development of a drowsiness warning system based on the fuzzy logic images analysis,” Expert Syst. Appl., vol. 34, no. 2, pp. 1556-1561, Feb. 2008, doi: https://doi.org/10.1016/j.eswa.2007.01.019 [ Links ]

Received: October 27, 2023; Accepted: January 02, 2024

* Corresponding autor: Rony Almirón. Universidad Nacional de San Agustín de Arequipa. Santa Catalina 117, Arequipa, Arequipa, Perú. Correo electrónico: ralmirona@unsa.edu.pe

Creative Commons License This is an open-access article distributed under the terms of the Creative Commons Attribution License