Driver Drowsiness Detection and Alert System using Python and OpenCV

Driver Drowsiness is the one of the reasons for increase in accident rates. Various facial recognition methods have been proposed to detect and alert the driver in-order to avoid accidents. Hence, this system is proposed to reduce the number of accidents due to drivers fatigue and hence increase the transportation safety. This system deals with automatic driver drowsiness detection based on visual information captured by the system. The driver is lively captured after which the images are further processed, and the fatigue is checked for. It creates an alarm for the driver immediately in case of fatigue detection, also an implementation to alert the vehicles owner and others concerned about the safety are alerted as well. The system enhances the safety measures by which accidents due to drivers drowsiness can be minimized. A vision system for monitoring driver's facial features is discussed here. To begin with, the driver's face is located in the input video sequence. Then it is tracked over the subsequent images. The facial features of eyes, mouth and head are kept detecting in the course of face tracking. Feature detection and tracking are performed in parallel, so that the precise can be improved.


I. Introduction
Driver exhaustion can be a signi cant variable in an expensive number of vehicle accidents. Road Accidents in India cause nancial losses around Rs.9.34 billion every year. It can be seen there are around 2,700 road accidents consistently which is one death per every four hours. It has been gured around 25% of car crashes with driver fatalities are due to driver's drowsiness.
It was uncovered that driving execution quickly drop with expanded tiredness which result in making more than 20% of all vehicle accidents. Less attention and focus while driving, heads the driver to being distracted and the likelihood of street accident goes high. Drowsiness related accidents have all the earmarks of being more serious as the driver isn't capable of taking any preventive measures at that moment. Because of the danger that the drowsiness presents on the road, strategies need to be created for checking in its in uences. Different strategies for driver drowsiness identi cation can be partitioned into two general classi cations. The techniques in the rst gathering recognizes the level of the tiredness focused around the physiological changes of the body. Eye status, speech properties, and the time interval between the eye being closed, head position, sitting carriage, heart rate, and brain signals are This paper proposes a real-time prototype computer vision system for monitoring driver vigilance. The main component include a remotely located video CCD camera, a specially designed hardware system for real-time image acquisition and for controlling the illuminator and the alarm system, and various computer vision algorithms for simultaneously, real-time and non-intrusively monitoring various visual bio-behaviors that typically characterize a driver's level of vigilance. The visual behaviors include eyelid movement, face orientation, and gaze movement (pupil movement). The system was implemented in an environment with subjecting to different ethnic backgrounds, different genders, ages, with/without glasses, and under different illumination conditions, and it was found very robust, reliable and accurate. 2]. Guang-Yuan Zhang, Bo Cheng, Rui-JiaFeng, Jia-Wen Li "Real-time driver eye detection method using Support Vector Machine with Hu invariant moments", International Conference on Machine Learning and Cybernetics.
In the making of advanced vehicle safety systems, monitoring the driver vigilance level and issuing an alert when he is not paying adequate attention to the road is a promising way to prevent or avoid the road accidents. In such a system, developing a reliable real-time driver eye detection method is a crucial part. A

I I I. Proposed Sysytem
The proposed system is a driver face monitoring system that can detect driver fatigue and distraction by processing of eye and face regions. After image acquisition, face detection is the rst stage of processing. Then, the regions of eye and mouth are detected using the DLIB library and the symptoms of fatigue are extracted from those regions. In the proposed system, the main focus and concentration is on the eye status of the individual driving the car. It consists of a parameter called the Eye Aspect Ratio also known as EAR which is an important parameter as it's value plays a key role in the drowsiness detection process. A threshold value is also assigned at the beginning for the Eye Aspect Ratio. It compares the frequency of the eye to the assigned threshold value. If the value is above, an alarm is generated. Similar to the EAR, when the mouth region is detected, a threshold value is set and if the value is above the threshold frequency, again an alarm is generated to alert the driver. Lastly, an alert is sent using an email to the concerned person.
In the EAR graph as shown above, the EAR becomes zero when the eye is closed and remains constant when it is open. The EAR Ratio will have some certain variance among, the population depending on the individuals. It fully varies on the uniform scale of the image and in rotation of the face. The EAR is averaged as both the eyes can blink synchronously.

I V. Experimental Analysis
The Threshold value is set to 0.25, Case I : If the EAR = 0.37, which is clearly above the EAR Threshold value (0.25) set for the system. This means that driver is safe and there is clearly no symptoms of drowsiness.