Prevention of Accidents while Drunken Driving

This paper has been proposed to reduce the probability of accidents of drivers who drive under the influence of drugs or alcohol. It proposes and effective model for drowsiness detection, and intelligent control or dimming of headlights when sensing a vehicle from the opposite direction. The proposed model shows an accurate algorithm to detect the Eye Map for eye detection, iris and pupil detection, and analysing the state of the eyes to make the drowsy decision. High precision techniques for location of iris, and pupil localisation helps in taking the important decision to ensure safety of the drivers. Intelligent Control of Headlight is implemented using an effective algorithm which uses SVM classifier for tuning the data to get correct detection of light patches from opposite direction. Finally, the paper shows the required connections for mounting a Raspberry Pi, and getting the model into effect, showing the various connections required for installing in a car.


INTRODUCTION
Driving under the influence (DUI), or driving while intoxicated (DWI), is the crime of driving a motor vehicle while impaired by alcohol or other drugs, to a level that renders the driver incapable of operating a motor vehicle safely. People who receive multiple DUI offences, are often people struggling with alcoholism or alcohol dependence. Traffic accidents are majorly caused by DUI. According to the National Highway Traffic Safety Administration, alcohol-related accidents cause approximately $37 billion in damages annually. Every 51 minutes someone dies from an alcoholrelated crash. Though prohibited by law, drunken driving however, remains a major issue and it is still essential to ensure safety of these drivers. In this paper, an approach is suggested, which tests the drowsiness of the driver, as well as makes sure that the driver isn"t affected by the sudden glare of lights falling on him, from the vehicle coming from the opposite direction. Drunken driving can be detected via various sobriety tests, like Field Sobriety Tests, and Chemical Blood Tests. The field sobriety test usually includes a series of simple physical and mental tests, whereas Chemical Blood Test analyses our breath, blood, or urine to determine our blood-alcohol concentration (BAC). Inspite of the legal measures, drunken driving persists. So, our proposed model tries to reduce the probability of accidents for drivers under the influence of DWI.

EXISTING SYSTEM
In the past few years, several testing methods like sweat sensors, alcohol sensor, eye blinking sensor for drunken driver to test the fatigue condition have been implemented [1]. However, in spite of the accuracy, the complexity of the circuit is often very high. Saab AlcoKey and Shegeyuki Kojima et al designed an algorithm to distinguish between the normal and intoxicated state of a person by measuring bio-signals such as body-trunk plethysmogram and respiration. Hongjie Leng and Yingzi Lin proposed a carbon nanotube (CNT) -based alcohol sensor with a particular focus on the response delay problem presented in CNT -based sensors [14]. Another suggestion was dropped in by Lei Wang et al was evaluation of the integrity of PPG signal and accuracy of heart rate detection [15]. The results showed that with adequate optical shielding and the proposed passive motion cancellation, the device was able to reliably detect heart rate both during rest and moderate exercise. But these devices lead to misreading, inaccurate testing giving false alarms and also high circuit complexity which increases the cost of implementation. A detection technique with a system inbuilt in the helmet, which does not allow you to start your vehicle if drunk test is positive, has been a part of drunk driver safety since a long time but it is reliable only for two wheelers [16].
The distance of eyelid is used to judge whether the driver is drowsy by Wenhui Dong. She proposed that the distance of the eyelid is large when the eye is open and the distance is nearly zero when the eye is closed [5]. However inaccurate results are obtained if driver moves his position with respect to camera. Zheng Pei, Song Zhenghe and Zhou Yiming analyzed eye closing time. The ratio between eye closing time in a certain time can reflect fatigue status of drivers. If the ratio is much larger, the driver is much more tired [11]. Pooneh. R. Tabrizi, Reza. A. Zoroofi suggestion included a four step system i) face detection ii) eye detection iii) eye state analysis and iv) drowsy decision [3]. This system uses their proposed chromatic based algorithm for eye state analysis. The drowsy decision is taken on the basis of PERCLOS (Percentage of Eye Closure Over time) parameter.
The common approach Intelligent Control of Headlights includes, detection of potential light objects and then using machine learning approaches to decide if high beam should be used or not. Since heuristic rules suffers from the drawbacks such as lack of robustness to the change of weather and road conditions, difficult deployment to different geographical regions, as well as expensive system fine-tuning, machine learning method is preferred.
Carsten Schaudel, Gentex GmbH Dave Falb from the Gentex Corporation has designed an application called Smart Beam-a High-Beam Assist which uses a forward-facing CMOS image sensor to acquire images in front of the vehicle, which are then processed to detect the existence of headlamps of oncoming traffic or tail lamps of preceding vehicles [12]. This system fails to consider a scenario of well lit urban areas. Whereas with the similar idea and considering the scenario of well lit urban areas, Mobileye developed an adaptive headlight control system. Ying Li and Sharath Pankanti proposed a three level framework which include various types of image and video content analysis, an SVMbased learning mechanism and a frame-level decision making mechanism [9]. This paper proposes methods for safety of drivers who drive while they are drunk, and ensure prevention of accidents in 2 ways as mentioned below. a) Testing of drowsiness in the driver, and b) controlling the intensity of headlights automatically to prevent accidents due to glaze produced on the eyes by high beam headlights.

METHOD
The proposed model consists of accurate methods for drowsiness detection, and intelligent control of headlights. The most important step in drowsy decision is the precise detection of the eyes, and hence the iris. A reliable eye detection algorithm helps calculate the fraction of skin covering the eye, and thus determining the drowsy condition of the driver. Reliable results of the automatic control of headlights to reduce the glare on the eyes of the vehicle coming from the opposite direction using the algorithm proposed help reduce the probability of accidents.

Drowsiness Detection
The proposed model detects the centre of the iris of the individual"s eyes, taking different frames of the real time video, and then suggests the drowsy state of the person calculating the Fraction of Coverage (FC).

Detection of Iris
As suggested in [3], this method involves five stages, which are: face detection, eye detection, iris detection, detection of the centre of the iris, and precision making. Face Detection, and eye detection has been done using the Haar Classifier. Trained data, for positive as well as negative samples to detect the region of interest (face and eye) have been used to detect precise areas.
Eye Map technique helps to find the exact location of the eyes, followed by the detection of iris and pupil under different light conditions [8]. This involves construction of two different types of eye maps -Luminance (EyeMapL) and chrominance (EyeMapC), the two components of the YCbCr color space for skin detection. Centre of the iris is the centre of the pupil of the eye. Hence, after applying the Otsu filter on the obtained EyeMap image, the estimated centre is detected. Inter-pupillary Distance is the distance between the centers of the pupils of each eye. Radius of the iris is calculated as one-tenth of the interpupillary distance. Thus, once the estimated radius is calculated using the estimated center, a technique to improve precision is applied.

Figure2. Applying Otsu Filter to EyeMap in figure 1(a)
We know that iris is the part of the eye where the intensity contrast is highest as compared to the other regions. Thus, we keep moving the estimated circle drawn with estimated radius of the iris and the estimated center of the pupil, till we get a region with the highest pixel intensity contrast [3].

Analysis of Eye
To get the working area minimized, draw a minimum fitting square circumscribing the obtained circle, and apply threshold. This enables to get the exact contour of the iris.
A person when feeling drowsy tends to close his eyes. Thus, by studying the fraction of the eye covered by the eyelid, we can determine the drowsiness state of a person. To determine this, the distance (Iris Coverage) between the topmost point of the eye, and the bottommost from where skin is detected is calculated, as shown in the figure [4].

Figure4. (a) Left Eye Region. (b) Threshold to image (a).(c) Right Eye Region. (b) Threshold to image (c). (e) Detection of points where skin cuts Iris
Therefore, Fraction of Coverage (FC) = Iris Coverage/Diameter of Eye The value obtained can be studied over different frames for final drowsy decision,

Drowsy Decision
A real-time video consists of a number of frames. Approximate test results show about 120-130 frames per 5 seconds. A decision stating the drowsy state of a person must be taken with utmost precision, and accuracy. To detect, drowsiness, if the frequency of the FC obtained for each frame is less than half the maximum FC, then it is considered to be frame in the data set of drowsy state. If the number of drowsy frame states in data set are more than half the number of total frames, a person can be confirmed to be in drowsy state.
If drowsiness results are positive, the driver will be asked to stop the vehicle through an alarm. If the driver continues to drive inspite repeated beeps, the car will be immobilised.

Intelligent Control of Headlights
For intelligent control of headlights, the system automatically switches the beam states (i.e. high beam and low beam) when a vehicle passes by, and in a well-lit area of street lights,. Our model first applies a blob detection algorithm to detect the white blob of headlight, then this data is trained by SVM classification algorithm to create tested data which is applied to the video input frames [13].

Blob Detection
The frames from the video are captured and the current frame is obtained using the "grabbed" reference to the video file. That current frame goes through a series of masking filters after it is converted into an HSV image. The masking operations include-converting to binary image by specifying the lower and upper boundaries of white color in HSL with sensitivity=15, erosion and dilation. Then the contour is detected and an estimated circle is drawn around it.

SVM Classification
The detected blob could be a headlight or reflection of the signs on road or tail lights which makes this inaccurate. This problem is solved by training the data and inputting that in the form of images to the SVM classifier function [9]. The training data will have images of road signs and other things that classify as a possible white blob on road. For creating the training and test sets, the ratio between positive (vehicles) and negative (mainly reflections of traffic signs) must be set to an appropriate value in order not to produce mis-learning or a high percentage of false positive detections (signs classified as vehicles).

Frame Level Decision
The tested data from the SVM classifier is used to classify blobs detected in the current frame and that output will be used for making an informed decision i.e. beam control of the headlight.

Mounting on Raspberry Pi
In our proposed model we are using a Raspberry Pi 1 Model B with 512 MB of RAM, two USB ports and a 100mb Ethernet port [18] [19] [20]. The Raspberry Pi gets the power supply from the 3A car ignition switch. The 3A car supply senses your ignition and safely shuts down the raspberry pi when your car turns off. This unit comes with two USB ports and is wired to the car battery. On the circuit PCB of car ignition switch the two leads are labeled "in" and "out". Connect a micro-USB cable from the circuit's USB port to the power port of Raspberry Pi and when the ignition is turned on the Raspberry Pi gets the power supply. The unit communicates with the Pi over two GPIO wires. Connect the "out" lead to GPIO 23 and "in" lead to GPIO 24. It is not connected to ground or power GPIO pin.
Two cameras used are-Pi camera and USB camera. The Pi camera has a resolution of 5 megapixel, and has a fixed focus lens onboard. In terms of still images, the camera is capable of 2592 x 1944 pixel static images, and also supports 1080p30, 720p60 and 640x480p60/90 video. Wide angle lens are attached on the Pi camera. It is used for the bright spot light detection and is mounted with the help of Pi camera mount on the rear mirror behind the windshield facing the road. It is plugged in to the dedicated Camera Serial Interface on the Pi and the cable length is extended with Pi camera ribbon cable.
Microsoft Life Cam HD-3000 Webcam has maximum video resolution of 1280x720. It can record a video in 720p at up to 30fps and supports USB 2.0 connection. This camera is mounted on the dash of the car and is used to record the live video of the driver for detecting drowsiness.

Figure7. Mounting the two modules on a Raspberry Pi to be installed in the car.
Hardware Components 1.
Raspberry Pi Model B 2.
Wide angle lens 7 Pi camera mount 8.

International Journal of Research Studies in Electrical and Electronics Engineering (IJRSEEE) Page | 32
The USB cable is plugged into the USB port of Raspberry Pi. The piezo buzzer is triggered after detecting that a driver is drowsy. The long pin is connected to GPIO pin 2(5V) and the small pin is connected to the GPIO pin 7 with the help of jumper wires.
The headlight control module is connected to pin 6 (GND) and pin 12 (GPIO 18) and is triggered after sensing a need to change the state of the beam.
The SD card is inserted in the slot provided on the Raspberry Pi. Raspbian OS is installed on the card and all the programs are loaded on it which are coded in Python. Raspberry Pi is then enclosed in the suitable case for it to be safe and secure.

CONCLUSION
In this paper, we proposed a model to enhance safety of drivers in case of drunken driving. It majorly consisted of two modules -drowsiness detection, and intelligent control of headlights. Drowsiness Detection majorly consisted of three steps -Detection of iris, analysis of eye, and drowsy decision. A robust method to detect the eye state analysis using the FC has been proposed. The module Intelligent Control of Headlights used the SVM Classifier to train and differentiate between blobs of light coming from the opposite vehicles, and other kinds of light.
Our proposed system shows in an easy way, how the mounting, and connections on the raspberry pi can be implemented. The power supply needed for the modules has been driven through the engine itself, thus making the model effective, and feasible.

FUTURE WORK
The algorithm proposed for drowsiness detection where EyeMap is used to detect the eye, iris and pupil works well if the position of the driver with respect to the camera is stable. However, if the position keeps changing, the results obtained might not be very accurate. Thus, to improvise the proposed, K-means clustering for image segmentation can be used for eye detection, before we move to analysing the eye.