{'fraction_non_alphanumeric': 0.025338012178759417, 'fraction_numerical': 0.009237279388997833, 'mean_word_length': 4.716519174041298, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The System for Driver Fatigue Monitoring Using Decision Tree via Wireless Sensor Network for Intelligent Transport System

Researchers propose new algorithm to monitor fatigue of driver by tracking the movements of the eyes. This can classify the opening and closing eyes by using Haar-Like Features and Region of Interest techniques. The fatique can be classified by decision tree classification. The system works in real time and sends message to the mobile phone to alert the driver via Line Application. The results showed that the program can detect face and classify opening and closing eyes accurately at 99.93 percent in which it yielded higher accuracy than other algorithms. Keywords— Fatigue, Region of Interest, Decision tree


Introduction
Improvement of safety system for people and reduction of accidents are important goals for Intelligent Transportation System (ITS). Key factor causing accidents on highways is fatigue and tiredness while driving. Fatigue reduces ability to control a car. The study showed that a driver can drive a car 2-3 hours straight. After that, a driver will be tired after lunch, in the afternoon, after midnight, after drinking alcohol and taking medicine that causes drowsiness reducing driving performance [1] [2]. From psychologists and physiologists' points of view, fatigue, drowsiness and distraction are different. However, from the view of Intelligent Transportation System (ITS), fatigue, drowsiness and distraction have the same definitions. In terms of science, no criteria can measure fatigue accurately [3] [5]. There are 3 types of fatigue; 1) Sensory Fatigue; 2) Muscle Fatigue and; 3) Cognitive Fatigue. Sensory Fatigue and Muscle Fatigue are measurable but Cognitive Fatigue is not. Certain meaning is not identified. However, a relation between fatigue, drowsiness, body temperature, eye movement, respiratory rate, heart rate and brain function is found [2][5] [6] [7]. The most effective way to measure fatigue and drowsiness is to measure brain function. This method requires signal from brain and electron wires must be connected to the head of an examined person which disturbs and intrudes upon a person. After brain function examination, fatigue will appear in eyes. According to research studies, visual stimulation and response is key measure to examine consciousness called Psychomotor Vigilance Task (PVT). Therefore, this research shows that PVT is related to movement of eyelids at a certain period of time and percentage of eyelid closing at PERCLOS [4].
Based on previous studies, technologies have been applied to manage fatigue and drowsiness in the field of Intelligent Transport system (ITS) [2] to examine a driver's tiredness which causes drowsiness while driving, leading to accidents on highways. Scientific technologies are used to measure fatigue but it cannot give accurate and precise results [6] [7]. At present, there are plenty of research studies and development methods to measure fatigue, eye functions and eye blinking. According to related research, measuring and tracking fatigue in soldiers still has problem with accuracy in monitoring and timely tracking of fatigue which possibly causes accidents. Moreover, fatigue cannot be predictable in advance so it cannot reduce any losses. Therefore, the researcher is interested in developing driver fatigue monitoring algorithm using position detection and eye movement techniques to measure fatigue. The researcher also utilizes Haar -Like and Region of Interest (ROI) to detect position and movement of eyes to analyze fatigue through Decision Tree algorithm and to monitor fatigue.

Related Research
The study of Hoang Le, Thanh Dang and Feng Liu [8] proposes eye blinking detection by intelligent glasses that classified features of eye blinking, eye opening and eye closing, using Gradient Boosting (GB) for data training. Then, a comparison of images captured by the intelligent glasses was carried out. However, it found that images were sometimes dark so the system could not classify the data. The researchers added eye position technique by using Haar Cascade from OpenCV to increase data processing efficiency. The results were satisfied.
YenWei Chen and Kenji Kubo [9] studied and developed face detection and quick eye movement through a webcam, using Gabor Filter technique. This technique combined a filter with color data to detect face area in geometric shape on human facial structure. Then, Gabor Filter detected all facial movement positions. The system performed detection continuously and showed results of face areas detected on a monitor. The results showed that the system could detect face accurately.
Sung-Uk Jung and Jang-Hee Yoo [10] proposes a way to increase eye detection efficiency by eliminating disturbance by using SQI. In addition, a conversion of image into 3D-format could identify position of eyes accurately. Using AdaBoost to analyze data also identified eye position effectively.
The study of Ziad O [11] was developed to assist patients or disable persons. The study develop a communication system through eye control, using Matlab version 6.5 to calculate positions expected to be eyes. Images were compared to those in the program's database to examine image detection, using special algorithm of Matlab. After eye movement was detected, an image was shown on a monitor of the program as cartoon or different positions. The system compared eye movement with position on a monitor where eyes stared on. Then, a sound or a message showing meaning of image would appear. The accuracy of results was at 96.11 % and the accuracy of repeated performance after the first time was at 94.44%. However, there are many factors affecting the system performance in actual system development. For instance, a camera shot angle should cover a focus range or other movements not related to eye movements such as head movement of an examined person should be reduced etc.
Vidas Raudonis, Rimvydas Simutis and Gintautas Narvydas [12] developed a measurement tool. They connected a pair of glasses to a web-camera to have more convenience and to reduce distance that enables more effective eye movement detection. Artificial Neural Network and MATLAB were applied to classify features of eyes in each group to detect eye position. The results showed that the tool worked effectively. It could classify elements for eye tracking development. However, there were some limitations. The system had slow response when a user changed eye direction too quickly. The outside factors such as light affected data analysis.
Gerald Fritz and Lucas Paletta [13] investigated the use of Eye Tracking technology to analyze marketing research about creating advertising media or videos that would keep people interested in the advertisements. They studied behavior in looking and paying attention to different billboards at public transportation areas. The researchers used an eye tracking program to identify the most frequently looked points. The data was collected at public transportation areas in Graze, Austria. The study investigated behavior and interest in the most frequently looked points when using public transportation. The most frequently looked points were at televisions, moving points or advertisement images or at 77%. N.M.Mohd Hassan and W.Mansor [14] studied about eye movement detection to control TV-switching on and off from the distance through an analysis of EOG (Electro Oculography). This technique applies electrical potential measurement of retina. A signal from the measurement is called Electro Oculogram. The researchers carried out the experiment with 9 normal visual ability volunteers. Five electrodes around an eye were connected (4 points on the right and 1 point on the left). The other ends were connected to a computer to record signals and for processing. The results showed that the accuracy was at 90.44%. However, this method required hardware with microcontroller system which could be connected to a television.
The study of Mehrube [15] investigated algorithm development for increasing eye tracking efficiency to control in-house safety systems for patients. The study developed a program on smart camera through OpenCV which was Open source and Visual C. The results showed that the program could work effectively. It could track eye movements accurately. Nevertheless, when images moved or had obstructions, for example, there were glasses or some parts of a face were missing or a distance between eyes and a camera was not proper, the processing would reduce.

Decision Tree Generation
After generating a decision tree, it can be used to classify categories of the data recorded (which consists of different attributes but data categories cannot identified) by comparing attributes in the particular record. A comparison begins from root nodes to left nodes. When reaching leaf nodes, data categories being considered are identified.
During late 1970s, the researcher about machine learning named J. Ross Quinlan invented decision tree generation algorithm known as ID3 (Iterative Dichotomiser).
After that, he developed ID3 to be C4.5 which became foundation algorithm used for comparing algorithm performance efficiency of Supervised Learning.
ID3 and C4.5 apply greedy approach to generate a tree under the concept of "topdown recursive divide-and-conquer", considering training data (training data, record set of data consisting of set of attributes and attributes indicating data categories of record set of data) by partitioning data into small parts while generating a tree .

Proposed Method
Elements of fatigue detection tool.

Driver Fatigue Monitoring Hardware
The structure of the driver fatigue monitoring system consists of 2 main parts including a camera module and a Raspberry PI 3 model B board. This board is powered by 5volt power supply as shown in this flowchart.    Fig.3. shows the driver fatigue monitoring system for public drivers in charge of transferring passengers on public buses. There is a camera on a bus to receive real-time motion pictures of a driver. Then, the motion pictures are transmitted to the Raspberry Pi board that controls the camera and the processing of the driver fatigue monitoring system when a public driver is tired and drowsy. The system monitors and tracks eye functioning. When a driver's two eyes including a left eye and a right eye are closed, the system will send an alert to inform a monitor that a driver is drowsy. The Monitoring System will monitor, track, make a plan and change a public driver to reduce accidents promptly.

Flow Chart: Eye Tracking Process & Fatigue
Eye movement detection process is as follows. Input Image from Webcam. When a user put glasses on, a camera will detect a user's eye image by using HighGUI command.
Gray-scale (Image Pre-processing). An RGB image is converted to a gray-scale image as follows. Circular radius(r) = .(x − Center_x) 5 + (y − Center_y) 5 (1) Tracking Eye by Template Matching. It is a process to track eye movements to monitor fatigue through eye opening and eye closing. It can be calculated to identify a starting coordinate for movement as follows. When a starting coordinate is identified, a distance created by changing positions of the starting coordinate by a user will affect cursor movements. The distance can be calculated by using the equation below.
This research combines MatchTemplate of OpenCV with MotionEvent on Android. Resizing eyes. An image from the previous step is resized to the standard size because an image captured by the camera come in different sizes. It is required to resize sizes of eyes to be at the same standard for precise extraction of key features of the eye in the next process. In this study, the image standard size is 24*24 pixels.
Tree Classification. Classifying data by using decision tree is a process of creating a tree for making decision based on data with data categories. A decision tree consists of different nodes (which are non-leaf nodes) used to display a certain condition or an attribute of data. Each branch of node refers to possible value from the test carried out with the particular attribute. The tree also consists of left node with data categories are stored. A sample of decision tree is shown in Fig. 10. Sample of a decision tree for open eye and close eye classification.

Data transmission
When the system begins to work, the camera will work with the Raspberry Pi board to monitor a public driver's fatigue by algorithm of fatigue monitoring. When the system detects a public driver's fatigue, the Raspberry Pi board will send an alert to the Monitoring System. The researcher has designed the system that can send data through Line Messages, SMS Text Messages and GPS, using Application Programming Interface to work with the Raspberry Pi and 4G Shield GPS, which connects to 4G as shown in Fig.11.   Fig. 11.Data transmission of fatigue monitoring system Fig.11. shows that the system will connect to 4G mobile network that works with the Raspberry Pi board to monitor a driver's fatigue and send data via 4G to a server.
When the system sends the data of a driver's fatigue to the server, the server will keep the data in a database. The data is pictures of a driver with fatigue while driving. A system monitor can then monitor the data via data management program and monitor program. A monitor program will display a bus location and an alert of fatigue.
The data from the system detects a driver's fatigue and is transmitted to the server. The data is stored and processed when a driver's fatigue is detected. Then, the system sends an alert to the Monitoring System where a monitor will change and inform a driver to reduce accidents.

Network processor
A network processor of fatigue monitoring system has a module to create a network system via 4G and it is installed in each public bus to monitor a driver's fatigue. The system processes the data to monitor a driver's fatigue and sends the data to a server as shown in Fig 12.  Fig. 12.An overview of a driver fatigue monitoring system for public drivers 4 Experimental Results

Eye Detection Testing
Eye detection testing processes the image receiving and location tracking procedures while starting the program

Eye Movement Testing
Eye movement testing verifies the directions of the eye movement including, • The system tracks at the left side when the eyes turn left.
• The system tracks at the right side when the eyes turn right.
• The system tracks at the topside when the eyes move to above.
• The system tracks at the bottom side when the eyes move to below.

Face Detection Testin
Face detection testing performs the system when users move their head. Its performance testing for analyzing the accuracy is shown in equation (8) = h9 h × 100 (8) A is percentage of accuracy. Nc is number of accurate processing. N is number of all the experiments. The experiment is divided into two types; performance testing for the eye detection and eye tracking. The results are shown as below.  From the experiments that have tested for 100 times, we found the accuracy of the eye detection and eye tracking performances are described as follow; The accuracies from the eye detection capability when the eyes view straight on, look at the top, look at the bottom, turn to the left, and turn to the right are 96, 87, 89, 96, 95, and 93 percent respectively. The accuracies from the eye tracking capability when the eyes look at the top, look at the bottom, turn to the left, turn to the right, and view straight on are 73,76,69, 98, and 78 percent respectively.  According to Table 3, the most accurate method was Decision Tree method. The accuracy was at 98.68%, the Precision was at 99%, the Recall was at 99% and the F-Measure was at 99%. The lowest accurate method was ZeroR and Vote. The accuracy was at .38 25 %, the Precision was at 12.9%, the Recall was at 25.4% and the F-Measure was 13.7%. Therefore, the Decision Tree method was the most accurate method for analyzing fatigue by classifying eye-closing and eye-opening performance. The classification covered the left-eye closing image, the right-eye closing image, the left-eye opening image and the right-eye opening image shown as follows. Figure 15-16 show eye-closing and eye-opening performance which indicate fatigue. It considers the closing and opening performance of the eyes. When the system detects eye-closing, it alerts that there is fatigue. On the other hand, when the system detects both eye-opening, it informs that there is no fatigue. The system will send a notification to a mobile phone through Line Message. It is found from the experiments that the system can detect eye movement from all face positions. Figure 17 shows a notification through Line Message.

Installation and Testing
The researcher installed the device and modeled an actual use, using the researcher's car. Installation details are as follows. 1) Camera Logitech is positioned in the front part of the car and a driver seat. The distance from a driver is 70 centimeters to detect a driver's face. 2). Raspberry PI 3 is positioned on a car's console and is connected to power supply and USB Car to test (Figure 18). To test the device, the researcher closed the eyes and drove the car. The system detected and sent a notification to the center and to the driver's smartphone and a control center.

Test of Notification Sent to Smartphone
When the system detects a driver's fatigue, the system will send a notification to a smartphone via Line Application. In this research, the researcher drove a car to test fatigue through closing the eyes for 3 0 times. Each time took 2 seconds or more. The system sent notifications as shown in Table 4.  It was found that the system could send accurate notifications notifying the driver's fatigue through eye closing. The monitoring result was 100 percent accurate. Sample of notification sent is shown in Figure 19.

Conclusion
The researchers proposes new algorithm for fatigue tracking system by using position detection and eye movement to detect fatigue. Haar-Like classifier and Region of Interest were employed to detect position and eye movement and to analyze fatigue through Decision Tree. The experimental results showed that the performance of the algorithm could detect face, eye positions and fatigue accurately. The accuracy was at 99.93 percent. This algorithm can be applied in Real Time usage because the system can send an alert through Line Message. The system detects fatigue and can be used with public drivers. The system has been designed to have a camera to receive pictures to be processed on the Raspberry Pi boards and to have the system connected to 4G network module and installed in each public bus in order to detect a public driver's fatigue. The system tracks a driver's eye functioning. When a driver's left eye and right eye are closed, it demonstrates that a driver is tired. Then, the system will transmit the data to the server via 4G. The data to be transmitted includes pictures of a left eye and a right eye while closing, a public bus location and an alert of fatigue etc. The system also sends an alert via Line message to involving persons including a system monitor, a police officer, a driver etc. in order to use in planning and changing a public driver, which can reduce accidents.