0% found this document useful (0 votes)
109 views6 pages

Traffic Violation Detection Camera

Poor road safety is a crucial developmental issue, a public health concern and a ruling cause of injury and demise in India
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views6 pages

Traffic Violation Detection Camera

Poor road safety is a crucial developmental issue, a public health concern and a ruling cause of injury and demise in India
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Traffic Violation Detection Camera


Adamya Jain Aabhas Deekshit Jagjit Singh
Student of Electronics and Student of Electronics and Student of Electronics and
Telecommunication Department, Telecommunication Department, Telecommunication Department,
Bharati Vidyapeeth Bharati Vidyapeeth Bharati Vidyapeeth
(Deemed to be University) (Deemed to be University) (Deemed to be University)
College of Engineering Pune, India College of Engineering Pune, India College of Engineering Pune, India

Snehal Mane
Assistant Professor of Electronics and
Telecommunication Department,
Bharati Vidyapeeth
(Deemed to be University)
College of Engineering Pune, India

Abstract:- Poor road safety is a crucial developmental road accidents. Road accident is one of the most unwanted
issue, a public health concern and a ruling cause of things to happen to a road user, though they happen quite
injury and demise in India. As per the Report of often. The most unfortunate thing is that we do not
Ministry of Road Transport and Highways on road understand that the reason for these road accidents is
accidents in India 2019 [1], there were 1,51,113 accident- because of our carelessness. Most of the road users are
related deaths in India in 2019. It is a matter of great aware of the general traffic rules and safety
concern that despite the fact that there are so many road measures/precautions for their as well as fellow road user’s
laws introduced by our government for the safety of the safety but it is only the indifference on part of road users,
passengers and drivers, the number of accidents are still which cause accidents and crashes. Main cause of accidents
increasing alarmingly. The main reason behind these and crashes are due to human errors like over speeding,
accidents is that people do not follow the basic traffic triple riding, avoiding safety gears like seat belts and
rules like wearing a seat belt or helmet, over speeding helmets etc.
and triple riding. This paper proposed a method to
monitor these violations and store the information of India’s traffic laws are stricter than those of other
violators to report it to the concerned authorities. Our countries, but these laws are not enforced. India’s
proposed system does not need any human interception enforcement of laws on speeding are rated 3 and 4 out of 10,
which makes it free from human error and bribery. respectively, compared to 8 and 9 in China and 9 in Sri
Lanka, by the Global Road Safety Report 2018, that
Keywords:- AI; Deep Learning; Road accidents; Python; analyzed traffic laws of 175 countries. When it comes to
Raspberry Pi; Machine Learning; Character Recognition. enforcement, we know human behavior is affected by
enforcement and in India, enforcement is largely driven by
I. INTRODUCTION human beings and is prone to corruption.

According to the 2017 WHO Global Health Estimates Our project aims to catch these violators and maintain
one of the most common causes of deaths in India is road a database of their vehicle information so that this database
accidents, it is also the 9th most common cause of premature can be sent to the concerned authority for penalty
deaths and the 10th most common reason for disability. generation. Since our project is fully automated it is free of
corruption and human error. We have used raspberry pi 3
India is one of the busiest countries in the world in module along with its camera module to monitor the traffic
terms of road traffic. The automotive industry across the [2]. In the first phase of our project, our system detects and
south Asian country became the fourth largest in the world divides the traffic into two categories that are- 2-wheeler and
in 2017. There were almost 3 million new car 4-wheeler vehicles. In the second phase if the detected
registrations in the country in 2019. The Indian road vehicle is a 2-wheeler vehicle the system checks for the
network, which is spanning over 5 million kilometers, speed of the vehicle determines whether the driver is
carries approximately 90 percent of the country’s passenger wearing a helmet and checks for tripling riding if any of the
traffic and around 65 percent of the goods. With the rapid mentioned aspects are violated a snap of the video is taken
increase in the number of cars bought by people and the and sent to the third phase of the system. In the third phase
mercilessly congested Indian roads, road safety has turned of the system the license plate of the vehicle is detected and
into a factor of utmost importance for the country’s citizens. the vehicle details along with the violation is stored in a data
India loses almost 1.5 lakh lives every year on account of base.

IJISRT21MAY478 www.ijisrt.com 818


Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
II. DATASET Flow of type of vehicle detection:

As huge numbers of parameter is needed to be tuned


by the algorithm a fair amount of training data is required in
deep learning. The image data set is divided into validation
data, training data and testing data in the deep learning
approach. Then, trained data sets are utilized to train
networks. A sample data set is used to verify, after a
network is trained, if network is properly working or not.
Poor quality images are removed from the data set before
training the network which enhance its performance. In this
research paper, we have utilized 4650 vehicle images from
different sources. After augmenting the image data, we get
5000 vehicle images, including 2570 two-wheeler and 2430
four-wheeler.

A. Two-wheeler-dataset
The Two-wheeler-dataset on GitHub is a public bike
and two-wheeler image data collection. The collection
collected 2462 two-wheeler images from different part of
country, including 1248 images of bikes, 978 of
scooties/scooters and 236 of bicycles.

B. Four-wheeler-dataset
Four-wheeler dataset has 2312 images (JPEG) and 2
categories (cars/heavy vehicle). The four-wheeler images in
this dataset is collected from The Ministry of Road
Transport and Highways, India. All vehicle images collected
by the ministry are used as part of routine traffic detection.

III. MTEHODOLOGY
Figure 1.1. FLOW CHART OF TYPE OF VEHICLE
Collecting dataset images
The datasets contain images of different vehicles. The B. Over Speeding
dataset has 4650 vehicle images including 2462 two-wheeler Here to detect the speed of an over speeding vehicle
and 2312 four-wheeler images 64 x 64-pixel(size), RGB we used Doppler radar (HB 100). In this set-up, a continuous
(color model) images were used, images were resized to wave doppler radar is used which provides a velocity output
make all the test images of unform size and shape. The and the Arduino micro is used to calculate the speed of the
dataset was divided into 3 sub datasets, first was used for vehicle. To drive the microcontroller as the sensor output is
training the model, the second one is used for validation of in micro volts and to amplify the voltage level, an amplifier
the system and the third one is used for testing hence the is used. The speed levels can be seen through an LCD
problem of overfitting is avoided. After the refining of the screen. A Doppler radar regulate the frequency shift that
dataset, it was then used in all the three phases of our system occurs in EM waves due to the motion of scatters toward or
mentioned below. away from the observer through measurement of the phase
change that occurs in electromagnetic waves during a series
A. Type of Vehicle of pulses. If the Doppler frequency is negative then the
This is the first phase of our system; we used the objects is receding from the radar. If its Doppler frequency
concept of real time object detection using deep learning and is positive then the object is approaching the radar.[5]
open cv [3] to determine the type of a moving vehicle in a
video. We used our video streaming with a Raspberry Pi Flow of over speeding detection:
camera [4] along with two separate databases of 2 wheelers
and 4 wheelers which we got from internet. The system
divides and iterates through the video frame by frame and
converts these frames to gray images. 2 wheelers and 4
wheelers are detected from these frames and a loop is run to
put a box around the detected vehicle. These frames are then
sent for phase two of our system where the vehicles are
scanned to detect the violators.

IJISRT21MAY478 www.ijisrt.com 819


Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
D. Seatbelt Detection
It is one of the parts of 2nd phase of the project. To
detect the seatbelt, we used the live video from the camera
module which contains full view information of the car
including driver’s body and seatbelt portion. The suggested
method is a two-step method. [7]

In the first step, the location of driver area is taken out


i.e., the borderline of driver where the seatbelt is possibly
located. Vertical and horizontal boundary detection is used
to do that. The top bounds of the area of the driver seat is
used as the horizontal boundary. It is also weighed as the top
edge of windshield. The area where the driver seat is located
is used as the vertical boundary. It is also weighed as the
right edge of the license plate. In the second step, the seat
belt is detected in the driver’s area. Edge detection is used in
this step, by obtaining driver’s region and the final detection.
The dataset contains – images of four-vehicle including 450
positive and 450 negative sample images. In addition to a
Figure 1.2 FLOW CHART OF OVERSPEED DETECTION mixed dataset with arbitrary images taken from the set of all
images. Some images do not clear that standard, hence they
C. Helmet Detection are standardized by resizing them to the required size. If the
The system is trained with YOLO and obtained model detects seat belt violation it immediately transfers the
datasets which gives trained weights for analyzing the video data to 3rd phase for the capture of the licensed number plate.
for helmet detection. The Raspberry pi camera module give
the real time video through which the images are extracted Flow of seatbelt detection:
frame by frame. Which is loaded in the trained model along
with the obtained trained weights. The trained model detects
if a person is wearing a helmet or not. If the person is not
wearing the helmet the snapshot is taken and transferred to
3rd phase for license plate number extraction.[6]

Flow of helmet detection:

Figure 1.4 FLOW CHART OF SEATBELT DETECTION


Figure 1.3 FLOW CHART OF HELMET DETECTION

IJISRT21MAY478 www.ijisrt.com 820


Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
E. Triple Riding Flow of license plate detection:
For real-time triple riding detection, precision and
speed is required. Hence You Only Look Once (YOLO) a
Deep Neural Network based model is selected. YOLO is a
clever neural network for doing object detection in real-time.
The Raspberry pi camera module is used as the input device
to receive the live video for object detection in real-time.
The video is then converted into image frames for proper
detection. The glossed images are provided as input to
YOLO model to train for the custom classes. The model is
then loaded with the weights generated after training. Once
this is completed, an image is given as input. The model
detects the triple riding violation and if found violated it
send the data to the 3rd phase of the project to capture
license number plate.

Flow of triple riding detection:

Figure 1.6 FLOW CHART OF LICENSE PLATE


DETECTION

IV. EXPERIMENTAL RESULTS

The project is tested using live video samples from


Raspberry Pi Camera module. Different samples of running
vehicle are taken from traffic signals and roads. These
samples are given input to the raspberry pi in which all the
code is already pre initialized.

1. Phase 1
Phase 1 consist of detection of the type of vehicle
(two-wheeler or four-wheeler) and marks the box and label
them accordingly.
Figure 1.5 FLOW CHART OF TRIPLE RIDING

F. License plate detection


This is the third phase of our system, when a violation
is detected then snap of the video is taken and using that
snap, we detected the license plate number of the vehicle.
The image is converted to gray image then bilateral filtration
and edge detection is performed on that image. The number
plate is then detected using the find contour and draw
contour functions of OpenCV python. [8]

Figure 2.1 OUTPUT OF VEHICLE DETECTION

IJISRT21MAY478 www.ijisrt.com 821


Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
2. Phase II B. Four-wheeler
Phase II consist of main part of the project-detection of
any traffic violation by the vehicle. 1. Seatbelt detection.
In this subpart system checks whether a person is
Phase II is divided into 2 sub-categories according to wearing a seatbelt or not. If violation is detected same
the type of vehicle – Two-wheeler and Four-wheeler. These procedure is followed, a snapshot is taken of a vehicle for
sub-categories are further divided into subparts according to the number plate extraction. Figure 2.4 shows the seatbelt
the type of violation. detection.

A. Two-wheeler.
After a two-wheeler being detected in 1st phase then in
phase ii it is checked if there are any traffic rules being
violated by that two-wheeler. If any violation is detected,
then the snap of that vehicle is captured and send to 3 rd
phase.

1. Helmet Detection.
In this subpart it is checked whether a rider is wearing
a helmet or not and if not then mark the head portion if the
rider and capture a snapshot.

Figure 2.4 OUTPUT OF SEATBELT DETECTION

3. Phase III
In this phase the license number plate is detected,
extracted and stored for further process of imposing penalty
to the driver through online method.

Once any violation is detected the snapshot is taken


Figure 2.2 OUTPUT OF HELMET DETECTION and send to this phase where the position of license number
plate is detected and then extracted and stored.
2. Triple Riding.
In this subpart it is checked whether there are 2 person
the vehicle or more. If more than 2 people are present on the
vehicle then then mark the heads and vehicle and capture a
snapshot.

Figure 2.5 OUTPUT OF LICENSE PLATE DETECTION

V. CONCLUSION

Road accidents leads to major injuries and death. Due


to the careless behavior of driver and breaching the laws
created by government many people lose their lives or lives
Figure 2.3 OUTPUT OF TRIPLE RIDING of their loved ones. The system we proposed in this paper is
an automated system based on different deep learning
models used together to achieve a compiled mechanism to

IJISRT21MAY478 www.ijisrt.com 822


Volume 6, Issue 5, May – 2021 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
detect violators and prevent road accidents. The output and
accuracy of each model has been tested and mentioned.
Through this model we will be able to detect the violators
and charging them a penalty will prevent them from
breaching any laws in future. This model can be useful for
analyzing all vehicles and extract a database of the violators.

REFERENCES

[1]. https://morth.nic.in/road-accident-in-india
[2]. https://randomnerdtutorials.com/video-streaming-with-
raspberry-pi-camera/
[3]. https://www.pyimagesearch.com/2017/09/18/real-
time-object-detection-with-deep-learning-and-opencv/
[4]. https://randomnerdtutorials.com/video-streaming-with-
raspberry-pi-camera/
[5]. https://www.ijtsrd.com/papers/ijtsrd26653.pdf
[6]. https://www.hindawi.com/journals/ace/2020/9703560/
[7]. https://dl.acm.org/doi/10.1016/j.neucom.2016.06.098
[8]. https://www.pyimagesearch.com/2020/09/21/opencv-
automatic-license-number-plate-recognition-anpr-with-
python/

IJISRT21MAY478 www.ijisrt.com 823

You might also like