Blinking Eyes Detection to Monitor Drowsy Drivers Due to Fatigue Using MATLAB Cascade Object Detector

Road accidents are incidents that should be avoided. One of the contributing factors of road accidents occurrence is drowsiness while driving due to fatigue. In this project, fatigue and drowsiness of a person can be detected by looking at the eye area. Drowsy situations are dangerous especially when driving a vehicle over long distances. When a person starts to feel drowsy, the eyes will start to blink more frequently. This characteristic can be used to monitor a driver’s fitness level. In this project the ViolaJones algorithm using MATLAB cascade object detector was used to detect the presence of blinking eyes. The algorithm is consisted of three phases which are, selection of Haar-like characteristics, integrating a picture into the whole, and Classifiers in a cascading fashion. A number of 29 samples images consisting of the condition fatigue face and non-fatigue face was used. The obtained results obtained were calculated based on the accuracy value of the detected blinking eye. The result shows that both the total Area Under the Curve (AUC) values for faces with fatigue situations and non-fatigue situations are above acceptable values which is 0.5. This indicates both classifications are acceptable and can be used to detect the presence of blinking eyes which represent drowsiness.


INTRODUCTION
Road accidents are incidents that should be avoided. One contributing factor to the occurrence of accidents is drowsiness while driving due to fatigue. Drowsiness can be described as a condition of people who are almost asleep and difficult to stay awake due to factors such as body fatigue or due to lack of sleep (Bereshpolova, Stoelzel, Zhuang, Amitai, Alonso, & Swadlow, 2011). Drowsy situations can trigger danger especially when performing tasks that require constant concentration, such as driving a vehicle over long distances. Consequences of being in a fatigue state while driving and experiencing a drowsy state, it is feared may result in accidents (Khan & Panchal, 2015). Therefore, a method to help detect drowsiness while driving is needed to prevent accidents.
This study suggested the detection of fatigue and drowsy faces by looking at the eye area. Changes in eye condition are seen as appropriate for estimating the existence of a person's fatigue and drowsiness. According to Wolkoff, Nojgaard, Troiano, and Piccoli (2005), the time between eye blinks will increase when the eye has worked under stressful conditions and within a certain period. This situation exists as driving is a challenging activity and needs to be done with full concentration. Therefore, this study proposes to detect blinking eyes as a method of assessing the existence of fatigue and drowsiness experienced by a driver. The Viola-Jones algorithm using MATLAB cascade object detector will be used to detect the presence of blinking eyes.

LITERATURE REVIEW
Driving over long distances can be dangerous if safety measures are ignored. One of the important safety measures is to keep a driver fresh and energetic. However, fatigue and drowsiness can change the handling style of each driver and increase the risk of accidents to occur. According to a study by Philip et. al. (2005), fatigue and drowsiness will significantly affect the current condition and efficiency of the driver. In another study, Pourabdian, Lotfi, Yazdanirad, Golshiri, and Hassanzadeh (2020) has tested 400 drivers and found that fatigue and unsafe driving habits are closely linked. Furthermore, fatigue and tension tends to exist in a two-way form. In 2011, a study done by Kocalevent, Hinz, Brähler, and Klapp, also shows that fatigue is strongly correlated with perceived stress.
Blinking eye detection can be used to monitor a driver's fitness level. This is because when the driver's fitness level is at a minimum, the eyes will blink. Thus, the blinking eye is a natural protective system that protects the eyes from environmental exposure. For example, when a driver feels fatigue, the driver's fitness level will directly decrease. This causes the driver's metabolic rate and mental ability to also decrease. One of the natural reactions that exist is that the eyes will blink due to feeling fatigue and drowsy. Therefore, the condition of spontaneous blinking eyes is considered as an accurate indication to diagnose the existence of fatigue and drowsiness due to diligent driving activities.
Eye blinking detector is a system that could detects blinking eyes that were resulted from fatigue and drowsiness. Peng, Chen, Ruan, and Kukharev (2005) have proposed an eye detection algorithm which was based on gray intensity images. In the algorithm, point template was stored and later will be matched with existing template. The results obtained give a value of 95.2% accuracy. However, the recommended technique was found not to work well if the detection was performed for spectacle wearers although the average implementation time of the proposed algorithm had shown that the approach performed was quite efficient. Another related work is a face detection algorithm proposed by Sirohey and Rosenfeld (2019) to detecting human face based on eye images. They used Gabor filter or also known as linear filter, and wedge-shaped or nonlinear shape filter for feature extraction. Based on the filters used, a detection rate of 90% was achieved without false alarms.

METHODOLOGY
The method used in this study demonstrates the use of the Viola-Jones algorithm with Cascade Object Detector technique. According to Chopparapu, Seventline, and Beatrice (2020), the efficiency of the Viola-Janes algorithm can be improved by producing inseparable images, thus help reduce errors in analyzing the captured video. This algorithm uses the concept of a rectangular feature that involves the number of pixels in a rectangular area.
In addition, MATLAB software was used as a method to apply the algorithm on the blinking eye detection system. There are three phases to the algorithm which are; selection of Haar-like characteristics, Integrating a picture into the whole, and Classifiers in a cascading fashion. MATLAB has the vision to do this. The computer toolbox contains the CascadeObjectDetector system object, which uses the Viola-Jones method to recognise faces and objects. There are numerous pre-trained classifiers in vision.CascadeObjectDetector that can recognise frontal faces, profile faces, noses and eyes, as well as the upper body. This code is to define the face Detector object faceDetector = vision.CascadeObjectDetector Using one of the attributes from vision as a second step, MergeThreshold is a CascadeObjectDetector. This data will be utilized to improve detection and accuracy of threats.

faceDetector.MergeThreshold = 4
As a result, the default value is four. Depending on the amount of precision necessary, MergeThreshold can be changed. In other words, face identification accuracy is higher at 3 than it is at 8, and vice versa.
To detect drowsiness, Chopparapu et. al. (2020) recommends measuring the time a person closes his/her eyes, and if the eyes are closed for longer than normal blinking time, the person tends to fall asleep. According to Arceda, Nina, and Fabian (2020), the average human blinking takes around 202.24ms while the drowsy blinking period takes 258.57ms.
The results obtained will be calculated based on the accuracy value of the blinking eye detection. The formula used to calculate the accuracy is based on the following Classification Table as Table 1:

RESULTS
The experiments were performed using hardware such as laptops and webcams. A laptop is required to build the programming code for the system, while the webcam required is a High Definition (HD) type used as a tool to capture a picture of the driver's face. In addition to hardware, software is also required such as MATLAB, Video Cutter, and Third Format Factory Software.
The experiment was conducted on 29 samples of drivers. Each driver was photographed while given a driving assignment. The captured driver's face images were stored in the form of frames that been divided into two, first the driver's with a fatigue face situation and the driver's with non-fatigue face situation.

Accuracy Values for Detecting Blinking Eyes
The data obtained were type-in into two different tables, namely Table 2 and Table 3. Table 2 will display the driver's face data for Fatigue situations, while Table 3 displays the driver's facial data for non-Fatigue situations.  Table 2 displays the data related to the driver's face with the fatigue situation. There are five main columns that need to be observed in Table 2 namely Detectfail and Detectsuccess which is generally a breakdown of the face data captured from observation. In addition, the columns that are important to note are such as False Positive Rate (FPR), True Positive Rate (TPR), and Area Under the Curve (AUC).
Meanwhile, out of 29 driver face samples, the 10th row with 128 frames was selected as the cut-off. Based on the cut-off, the values of FPR, TPR, and Accuracy were obtained as 0.782759, 0.72732, and 0.659991 respectively. This illustration of the relationship of TPR versus FPR is then plotted as a Receiver-Operating Characteristic (ROC) curve as shown in Figure 1.  Figure 1 plots the relationship between TPR and FPR. The curve that exists is known as the ROC curve. Based on the observation of the shape of the curve, it is close to the shape of a straight line directly proportionate from the value of 0 to 1, with only a few insignificant bounces. This situation shows the ROC curve created for this fatigue situation as not good since the value below the curve is far off to reach a higher value approaching 1.0.  Table 3 displays the data related to the driver's face with the non-fatigue situation. In this Table 3, the values are recorded for TPR is 0.71739, FPR value is equivalent to 0.63128, and Accuracy value is 0.68158. The illustration of the relationship of TPR versus FPR for Table 3 is plotted as shown in Figure  2. Based on the observations in Figure 2, the resulting curve is slightly different from that shown in Figure  1. This is because the shape in Figure 2 has a higher upward curve, which shows that the AUC value on the ROC curve for TPR vs FPR in Figure 2 is larger than the ROC curve for TPR vs FPR in Figure 1. This means that the data in Table 3 are better than the data in Table 2.

CONCLUSION
This study is about detecting blinking eyes. The purpose of detecting blinking eyes is to recognize the faces of drivers who drive in a fatigue and drowsy state. Based on the results of the study, two things can be concluded with the first being based on Figure 3. Through Figure 3, a direct comparison between the two ROC curves based on fatigue situation and non-fatigue situation was performed. Based on the comparison, it is found that the ROC curve for non-fatigue situations is more convex upwards than the ROC curve for fatigue situations. This means that the AUC value for non-fatigue situations is larger, and it directly indicates that classification through non-fatigue situations is better. However, this does not mean that the classification based on the fatigue situation is not good, because the AUC value for the ROC curve resulting from the fatigue situation still exceeds the value of 0.5.
Proving that the AUC values for both ROC curves exceed the values of 0.5, Table 2 and Table 3 will be referred. If observed in both tables, the total AUC values for faces with fatigue situations are 0.5010 and the total AUC values for faces with non-fatigue situations are 0.5882. This indicates both classifications are acceptable.
The conclusion that can be made is that the use of Viola-Jones algorithm through MATLAB cascade object detector has successfully provided output to be used to detect the presence of blinking eyes for the purpose of monitoring drowsy drivers due to fatigue.