Authors: Stephen Danny Leo Xavier, K R Sumana, Dr. H. D. Phaneendra
Certificate: View Certificate
Driver drowsiness is one of the major causes of road accidents. Furthermore the existing technologies to detect drowsiness in a driver lack in terms of classifying the stages of drowsiness in a driver, which fails to prevent drowsiness at its initial stages. The Proposed system detects drowsiness in a driver through stage-wise classification. Hence drowsiness is detected in three stages. On stage one, the system rings a vocal alert to the driver. On Stage two, the system sounds an alert and on stage three, the system sends a whats app message, an email to the given emergency email-id and the location of the driver to the supporting android application. The system also consists of theft prevention system, where when activated the system performs facial recognition on the driver. If the driver is a registered driver, the system continues to monitor, else the system sends a notification to the driver on the supporting mobile application.
The most frequently occurring accidents are accidents caused due to drowsy driving. Drowsy driving not only causes danger to the driver but also to others on the road. Hence alerting a driver when he/she is drowsy is a major requirement. Many methods exist to detect drowsiness in a driver. However the major drawback with such methods is that it uses an invasive form of detection, meaning the driver is required to wear a device during driving. The proposed system uses facial landmark predictor to detect drowsiness which is a non-invasive method to detect drowsiness in a driver.
The proposed system uses frontal face detector. After which the facial landmarks are discovered using the landmark predictor. This facial landmark predictor returns 68 (x,y) coordinates representing different regions in a face. However, only the eyes and mouth region is extracted and used. The eyes and mouth region is monitored in each frame of the video streaming and the Eye Aspect Ratio and the Mouth Aspect Ratio is compared with the threshold values.
The drowsiness in a driver is divided into three stages by the system. On the first stage where the driver is identified to be yawning, the system plays a gentle tone. On the second stage where the drivers Eye Aspect Ratio are detected to be in a drowsy state, the system sounds an alarm. On the final stage of drowsiness where the driver’s eyes are identified to be closed, the system sounds an alarm, sends an email and a whats app message to the given contact and also sends the GPS location of the driver through the android application to the given contact.
Theft of vehicle leads to loss of property for a driver and often complex security systems are expensive to be installed and are often omitted. The proposed system further extends its functionalities by providing a theft prevention system.
The proposed system allows the driver to register in the list of authorized users of the vehicle. When the theft service of the system is running, the system monitors in real-time through a camera and analyses each frame. When a face is detected, using python’s facial recognition, the face encodings are compared with the list of known face encodings. If the face is unrecognized, then the driver is alerted on his/her mobile application.
The system provides flexibility to the driver by allowing the driver to use the existing camera in his/her phone to monitor in real-time thereby further reducing the cost to deployment. The driver can also calibrate the system for each stages of drowsiness since each person have a different Eye Aspect Ratio.
II. LITERATURE SURVEY
III. PROPOSED WORK
The proposed system is designed to detect drowsiness in a driver through three stages. Detecting drowsiness through stages prevents the driver from getting into a drowsy state at initial stages. The system goes one step further to prevent accidents from taking place where on stage three, the system alerts the emergency contacts as provided by the driver during the registration.
Furthermore the system extends its functionalities by providing theft prevention system where the driver activates the system when the vehicle is parked. The system performs facial recognition on the person who enters the vehicle and alerts the authorized person of the unknown driver in the vehicle.
The proposed system uses Flask Framework for the web application, DLIB library for facial encodings, facial_recognition library for theft detection and MySql for data storage. The proposed system has three users. The admin, who can view the accounts and history. The user, who is the driver and the main user of the system and the sub-user, who is the emergency contact set by the user. Following are the modules of the proposed system.
A. Admin Module
In the admin module, the admin has an existing account created already by the system developer. Using the existing account the admin can view the list of user accounts. He/she can also view the records of all the drowsy alerts sent to the user along with the EAR and MAR values. The admin can also view all of the theft alerts made to the user
B. User Module
In the user module, the user initially creates their account. After which the user is redirected to the system dashboard. Using the dashboard the user can navigate to any part of the software. After the first login the user is required to perform certain basic settings on the system. In settings, the user sets the IP address of the phone camera which is used by the system to connect to a phone camera through the LAN network.
The user also sets the emergency email –Id and phone number which is used by the system to send to that user the email and whats app messages. The user also can change his/her login password. Furthermore the driver can create a list of sub-user accounts, which can be used to log into the android application to access the GPS location of the driver. The user is then required to calibrate the threshold values of the system for each stage of drowsiness detection. As required by the theft prevention service, the user uploads his and the other list of drivers of the vehicle and then sets a name for each of the user image uploaded. After all this initial setup has been done, using the dashboard for navigation, the user can access the system services.
C. Drowsiness Detection Module
After the initial settings have been performed, the user can then start the drowsiness detection service. In this service the user has the flexibility to detect drowsiness in two either two ways, one is to use the on-board camera of the system, or the second option is to use the camera of his/her phone. After the driver makes his choice, the system starts the camera and starts monitoring the driver.
The below figure Fig 1 shows the overview of the functionalities performed by the drowsiness detection module. When the driver starts the service, the system monitors the driver in real-time. The system monitors the eyes and mouth of the driver. When a driver yawns, the system considers that the driver is entering a sleepy stage, and hence plays a vocal sound asking the driver to take a break. This is considered as the first stage of drowsiness by the system. If the driver continues to be in a drowsy state, and if his eyes become dull, the system based on the threshold set by the driver immediately sounds an alarm that would wake up the driver. However if the driver is still not alerted and continues his drowsy state, and his eyes closes entirely, the system goes into the third stage. In third stage the system starts a background process and calls the alert module, android alert module, and history module to perform its tasks. All these modules perform their task in the background and hence the drowsiness detection module can continue to monitor the driver.
D. Theft Detection Module
The below figure Fig 2 shows the overview of how the theft detection module works. After the driver has uploaded the list of driver images in settings, the images are stored in system folder and the path stored in the database. The driver when the vehicle is parked can start the service.
The system starts the camera and starts monitoring in real-time all the drivers that enter the vehicle. The system first retrieves from the database the list of driver images along with their assigned names and extracts the face encodings in those images. The system then compares the real-times user’s face-encodings with the list. If the face-encodings match, the system labels the real-time user with the assigned name. However if the persons face being monitored doesn’t match with any of the face-encodings retrieved, the system labels that person as unknown and when a the system reaches a threshold time of an unknown face being detected, the system accesses the vehicles latitude and longitudinal coordinates, clicks an image of the unknown person and stores it in the database and sends an alert to the driver on the supporting mobile application along with the unknown persons image.
E. History Module
History module is a backend module that runs in the background and is focused on storing the history of the drowsiness and theft. When drowsiness is being detected by the system, the history module is called in the background and provided parameters of the image, type of drowsiness and the EAR and MAR values. The history module then takes these parameters, stores the image in a given path, and the rest of the values in the database. The history module also has a GUI in the dashboard where the user can use to see the history of alerts sent by the system.
F. Alerts Module
Similarly to history module, alerts module is also a background module which is responsible to carry out all the functionalities of alerting the driver and the emergency contact. When the drowsiness module or the theft module needs to alert the driver, the alerts module is called and given its parameters, the alerts module runs in the background thread and plays the required alerting sounds. The alerting module on stage 3 of the drowsiness module, retrieves from the database the emergency contact, and email and through Google’s SMTP server sends an email to the given email address, It also automatically opens the drivers whatsapp and sends an emergency message to the given emergency contact number.
G. Android Alerts Module
Unlike the before mentioned alerts module, android alerts module takes an additional precautionary step. It consists of an android application where the registered sub-user can log into. When drowsiness is being detected by the system, the module extracts the location of the driver and sends a notification to the sub-user on the android application. The user can then log into the application and view the location of the driver in real-time. On click of a button the android application redirects the user to Google maps with the directions to the driver’s location.
Drowsiness being one of the major contributors of road accidents is a rising issue. The proposed system aims at solving that issue by providing an easy to deploy and flexible solution. By dividing the detection of drowsiness in stages, the system aims to prevent drowsiness at early stages of its occurrence. However when the driver still gets drowsy the system aims at taking steps to ensure help is received to the driver as soon as possible. Security systems in cars being an expensive solution, the proposed system aims at eradicating that by providing an inexpensive solution. The system being developed in a micro-architecture means it can be deployed on any low powered system, hence alerting the driver in the event of a theft. The development of the system on flask framework which is a micro architecture framework makes it possible for the proposed system to be integrated into the existing car systems with very few modifications. The proposed system provides flexibility to the user by allowing the user to use the mobile camera for the service thereby reducing the cost to deployment.
 Amin Azizi Suhaiman; Zazilah May; Noor A’in A.Rahman. (2020). Development of an intelligent drowsiness detection system for drivers using image processing technique. doi:10.1109/SCOReD50371.2020.9250948.  Igor Lashkov; Alexey Kashevnik; Nikolay Shilov; Vladimir Parfenov; Anton Shabaev. (2019). Driver Dangerous State Detection Based on OpenCV & Dlib Libraries Using Mobile Video Processing. doi:10.1109/CSE/EUC.2019.00024.  Maliha Khan; Sudeshna Chakraborty; Rani Astya; Shaveta Khepra.(2019) Face Detection and Recognition Using OpenCV doi:10.1109/ICCCIS48478.2019.8974493.  K. Satish; A. Lalitesh; K. Bhargavi; M.Sishir Prem; T Anjali.. (2020). Driver Drowsiness Detection. doi:10.1109/ICCSP48568.2020.9182237.
Copyright © 2022 Stephen Danny Leo Xavier, K R Sumana, Dr. H. D. Phaneendra. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.