• Home
  • Submit Paper
  • Check Paper Status
  • Download Certificate/Paper
  • FAQs
  • Contact Us
Email: ijraset@gmail.com
IJRASET Logo
Journal Statistics & Approval Details
Recent Published Paper
Our Author's Feedback
 •  ISRA Impact Factor 7.894       •  SJIF Impact Factor: 7.538       •  Hard Copy of Certificates to All Authors       •  DOI by Crossref for all Published Papers       •  Soft Copy of Certificates- Within 04 Hours       •  Authors helpline No: +91-8813907089(Whatsapp)       •  No Publication Fee for Paper Submission       •  Hard Copy of Certificates to all Authors       •  UGC Approved Journal: IJRASET- Click here to Check     
  • About Us
    • About Us
    • Aim & Scope
  • Editorial Board
  • Impact Factor
  • Call For Papers
    • Submit Paper Online
    • Current Issue
    • Special Issue
  • For Authors
    • Instructions for Authors
    • Submit Paper
    • Download Certificates
    • Check Paper Status
    • Paper Format
    • Copyright Form
    • Membership
    • Peer Review
  • Past Issue
    • Monthly Issue
    • Special Issue
  • Pay Fee
    • Indian Authors
    • International Authors
  • Topics
ISSN: 2321-9653
Estd : 2013
IJRASET - Logo
  • Home
  • About Us
    • About Us
    • Aim & Scope
  • Editorial Board
  • Impact Factor
  • Call For Papers
    • Submit Paper Online
    • Current Issue
    • Special Issue
  • For Authors
    • Instructions for Authors
    • Submit Paper
    • Download Certificates
    • Check Paper Status
    • Paper Format
    • Copyright Form
    • Membership
    • Peer Review
  • Past Issue
    • Monthly Issue
    • Special Issue
  • Pay Fee
    • Indian Authors
    • International Authors
  • Topics

Ijraset Journal For Research in Applied Science and Engineering Technology

  • Home / Ijraset
  • On This Page
  • Abstract
  • Introduction
  • Conclusion
  • References
  • Copyright

Safety for Drivers using OpenCV in Python

Authors: Mattupalli Nikitha, Adhina Roy, Shreya Agrawal

DOI Link: https://doi.org/10.22214/ijraset.2022.47254

Certificate: View Certificate

Abstract

Majority of accidents happening in the country is mainly due to the usage of cell-phones or drowsiness. Travelling long distance or driving trucks and taxis for a long time every day and night can cause the driver to be sleep deprived and drowsy which can lead to accidents. With this project, we will be building a system using python and OpenCV that will detect the age and gender of the person and detect if there is any mobile phone in the vicinity. It also detects if the person is sleeping or not and will alarm the driver accordingly. With this project, we would like to reduce the number of accidents happening around us.

Introduction

I. INTRODUCTION

The goal of this paper is to develop a python code for safety of drivers, that detects the person’s age and gender. It detects if the person is sleeping by checking if the eyes are closed for a few seconds or using a mobile phone so as to ensure the safety of the driver by alarming the person.

Terms used in the project:

  1. OpenCV: It is an open-source Computer Vision and Machine Learning library. This library is capable of processing real-time image and video. It supports the Deep Learning frameworks TensorFlow, Caffe, and PyTorch.
  2. Face Recognition and object detection with OpenCV: A computer vision technology is face recognition. We discover and show human faces in any digital image using face recognition and detection. It is a subdomain of Object Detection, where we try to observe objects. These objects are of particular class such as humans, vehicles, animals etc.
  3. CNN: A Convolutional Neural Network is a deep neural network widely used for the purposes of image recognition, image processing and NLP.
  4. Gender and Age Detection: We will use Deep Learning to accurately identify the gender and age of a person from a single image of a face. We will use the models trained by Tal Hassner and Gil Levi. The predicted gender may be one of ‘Male’ and ‘Female’, and the predicted age may be one of the following ranges- (0 – 2), (4 – 6), (8 – 12), (15 – 20), (25 – 32), (38 – 43), (48 – 53), (60 – 100).
  5. Numpy: Large, multi-dimensional arrays and matrices are supported in scientific computing via the Python software library known as NumPy. Numerous open-source software interfaces and contributors are present in NumPy.

Additionally, it includes the following:

a. A robust array object with N dimensions;

b. Broadcasting capabilities;

c. The ability to use tools to merge C/C++ and FORTRAN code.

For mathematical computations like linear algebra, the Fourier transform, etc., NumPy is helpful. Data size and type can be properly defined in numPy. NumPy allows provide quick integration with a variety of databases. Additionally, it is BSD-licensed, although with some limitations.

II. PROCEDURE

A. Gender and Age Detection

Two custom CNN layers are used for age group and gender estimation. The age group classification and gender classification trains the CNN layer over many images. These CNN layers can be implemented over OpenCV and can detect age and gender on live camera. The CNN using a Caffe deep learning framework

Using Caffe, there are 4 steps to training a CNN:

  1. Step 1: The first step is data preparation, where we clean the photos and store them in a Caffe-compatible format. We'll create a     Python script to take care of the pre-processing and storage of the images.
  2. Step 2: A CNN architecture is selected in this stage, and its parameters are defined in a configuration file with the.prototxt extension.
  3. Step 3: Model optimization is the responsibility of the solver. The solver parameters are specified in a configuration file with the.prototxt extension.
  4. Step4: Training the model entails running a single Caffe command from the terminal. We will receive the trained model in a file with the extension when the model has been trained .caffemodel.

gender_net.caffemodel: It is the pre-trained model weights for gender detection.

deploy_gender.prototxt: is the model architecture for the gender detection model (a plain text file with a JSON-like structure   

containing all the neural network layer’s definitions).

res10_300x300_ssd_iter_140000_fp16.caffemodel: The pre-trained model weights for face detection.

deploy.prototxt.txt: This is the model architecture for the face detection model.

B. Cellphone Detection

cv::dnn::DetectionModel Class is a Deep Neural Network module which we use to detect the cellphone after integrating it with OpenCV.

C. Face and Drowsiness Detection using Haar Classifier

A face detector known as a Haar Cascade classifier is used by OpenCV to identify drowsiness. The algorithm first requires an image with and without faces. The face detector looks at each picture point and labels it as "Face" or "Not Face," which is used to extract features. Two or three adjacent rectangles with varying contrast values combine to form the haar-like features. The camera placed in front of the driver begins to recognise the face and subsequently the eyes. The software will then take data from the webcam and determine whether the eyes are open or closed in order to detect sleepiness. The technology will play a loud alarm sound to rouse the driver up if their eyes are closed. The system will continue repeating the programme if the eyes are opened. Since the landmarks of the eyes are numbers 37 to 48, we used them for eye detection according to the Haar cascade 68 Landmarks pointers. Haar-like features have the potential for great accuracy and low expenditure. Hence with the help of this program, we can recognise whether the driver is drowsy or not and also provide a blaring alarm sound to warn the driver if sleeping.

Conclusion

We have developed a python code that runs successfully which ensures the safety of the drivers. It alarms when the person is sleeping or if it detects a mobile phone. It also displays the gender and the age of the person with about 80% accuracy. Haar-like features have the potential for great accuracy and low expenditure. In the future years, OpenCV will become quite well-known among python programmers in the IT industry.

References

[1] Chandan, G., Ayush Jain, and Harsh Jain. \"Real time object detection and tracking using Deep Learning and OpenCV.\" 2018 International Conference on inventive research in computing applications (ICIRCA). IEEE, 2018. [2] Rajput, Bhumika. \"DRIVER DROWSINESS DETECTION USING PYTHON.\" [3] Emami, Shervin, and Valentin Petrut Suciu. \"Facial recognition using OpenCV.\" Journal of Mobile, Embedded and Distributed Systems 4.1 (2012): 38-43.. [4] P. Reshvanth et al., \"Age Detection from Facial Images Using Python,\" 2021 Fifth International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC), 2021, pp. 1316-1321, doi: 10.1109/I-SMAC52330.2021.9641056. [5] Saxena, Meghna Raj, et al. \"Real-time object detection using machine learning and opencv.\" Int J Inform Sci Appl (IJISA) 11.1 (2019): 0974-225. [6] Khunpisuth, Oraan, et al. \"Driver drowsiness detection using eye-closeness detection.\" 2016 12th International Conference on Signal-Image Technology & Internet-Based Systems (SITIS). IEEE, 2016. [7] Salihbaši?, Alen, and Tihomir Orehova?ki. \"Development of android application for gender, age and face recognition using opencv.\" 2019 42nd International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO). IEEE, 2019.

Copyright

Copyright © 2022 Mattupalli Nikitha, Adhina Roy, Shreya Agrawal. 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.

Download Paper

Authors : Mattupalli Nikitha

Paper Id : IJRASET47254

Publish Date : 2022-10-31

ISSN : 2321-9653

Publisher Name : IJRASET

DOI Link : Click Here

About Us

International Journal for Research in Applied Science and Engineering Technology (IJRASET) is an international peer reviewed, online journal published for the enhancement of research in various disciplines of Applied Science & Engineering Technologies.

Quick links
  • Privacy Policy
  • Refund & Cancellation Policy
  • Shipping Policy
  • Terms & Conditions
Quick links
  • Home
  • About us
  • Editorial Board
  • Impact Factor
  • Submit Paper
  • Current Issue
  • Special Issue
  • Pay Fee
  • Topics
Journals for publication of research paper | Research paper publishers | Paper publication sites | Best journal to publish research paper | Research paper publication sites | Journals for paper publication | Best international journal for paper publication | Best journals to publish papers in India | Journal paper publishing sites | International journal to publish research paper | Online paper publishing journal

© 2022, International Journal for Research in Applied Science and Engineering Technology All rights reserved. | Designed by EVG Software Solutions