You are on page 1of 5

1

A Deep Learning Based Approach to Detect Suspicious Weapons


1
Prof. Palak Girdhar, 2Prashant Varshney, 3Harsh Tyagi, 4Nikhil Lohia, 5Abhishek Kajla
Computer Science & Engineering Department,
Bhagwan Parshuram Institute of Technology New Delhi, India.

Abstract – Over the past few decades, the interpret and understand visual data
world has witnessed a lot of terrorist and (images or videos).
criminal activities. Public Surveillance
system has gained a lot of importance as a B. DIGITAL IMAGE PROCESSING
response to counter these activities.
Various state governments has started to Digital Image Processing (DIP) deals with
install cameras in their densly populated the manipulation of digital data (images or
and busy cities in order to safeguard their video) with the help of digital computer and
citizens. some sort of Image Processing Algorithms
In order to cover a complete city like Canny-Edge Detection, Error
under surveillance system there’s a need of Diffusion, Hough Transformation, etc. to
thousands of cameras and to monitor their produce digital maps in which specific
live video feed, hundreds of active security feature has been highlighted.
personals are required. Most commonly,
one security personal is monitoring around C. DEEP LEARNING
6 – 8 cameras, checking whether any
Deep learning is an attempt of Computer
person is indulging in any sort of criminal
Scientists to mimic the behaviour of human
activity, carrying any weapon or not
brain. It is a prominent field of Machine
(because most of the criminal activities has
Learning which comprises of multiple
involvement of weapons), which is quite
hidden layers of Artificial Neural Network
monotonous and hectic task. One slip of
(ANN) which are used to extract higher
concentration can cause damage to many
level features from data.
lives. So there’s an efficient way is required
to monitor these video feeds and add an D. OBJECT DETECTION
extra layer of security.
This research paper deals with the Object Detection is a field of Machine
optimised, efficient & fastest way to detect Learning associated with Computer Vision
commonly used weapons like AK47, Hand and Image Processing which deals with
Revolver, Pistol, knife, Grenade, etc. in a detecting instances of an object of certain
live video feed and notifies the security class (like a car, buildings, humans,
personals immediately. weapons, etc.) possessing similar features.
Keywords – Object Detection, Neural Object detection can be implemented either
Network, Deep Learning using ML based algorithms or DL based
algorithms, depending upon the complexity
I. INTRODUCTION of object class.
A. COMPUTER VISION E. METHODS OF OBJECT
DETECTION
Computer Vision is an interdisciplinary
branch of Computer Science and Digital Object Detection methods are generally
Image Processing that enable computers to categorised into either ML based approach
2

or DL based approach depending upon the obtained mAP of 53.3% In contrary, to the
complexity of object class. For Machine results achieved on PASCAL VOC
Learning approaches, it is essential to dataset, an improvement of 30% was
define features beforehand using methods achieved by this model. In this model, the
like Haar Cascade, SIFT, etc. which further whole image is processed with a
uses Support Vector Machine (SVM) Convolution Neural Network to produce a
technique for object classification. Deep feature map and then a fixed length feature
Learning technique uses Artificial Neural vector with a Region of Interest (RoI)
Network to do an end-to-end object pooling layer is extracted from each region
detection without defining features proposal.
specifically.
III. PROPOSED WORK
II. LITERATURE REVIEW
Flowchart
In year 2001, Paul Viola and Michael Jones
proposed first robust, efficient and real time
Machine Learning based Object Detection
Framework in their paper “Rapid Object
Detection using Boosted Cascade of Simple
Features”. This framework can be trained to
detect variety of objects by taking lots of
positive images (images which contains the
object which we want our classifier to
identify) and negative images (exactly same
images but without the object which needs
to be identified) to train the classifier.
However, this approach cannot be used to
detect complex objects in different
orientation and sizes.
The emergence and rapid development in
the field of Deep Learning overcomes these
above mentioned drawbacks through
Artificial Neural Networks. By using Deep
Learning based Object Detection
framework computers are able to learn
more complex features.
Deep Learning based Object Detection
framework mainly consists of two types – Scraping Images of Commonly
used Weapons
a. Region Proposal based framework that
includes models like RCNN, FRCNN In order to build Deep Learning based
and Faster RCNN. object detection model, we scraped almost
5000 images of commonly used weapons
b. Regression based frameworks that like AK47, Hand Pistol, Revolver,
includes models like YOLO and SSD Shotgun, Combat Knife, etc. in various
Region Proposal based algorithms uses sizes and orientations, which is latter pre-
sliding window approach to extract processed for building dataset. These
features from the visual data. In the year images were gathered from different
2014, Ross Girshick presented RCNN sources available on the internet and
model based on this algorithm, which further trained using a software.
3

Building Labelled Dataset Detection Model. It measures how accurate


our predictions and the number of the
After pre-processing and scaling, we predictions that our model made were
labelled scraped images using “LabelImg” actually correct.
software. This software eases out our work
of labelling all the weapons by simply 𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 =
marking the object manually in the image (𝑇𝑃 + 𝐹𝑃)
using a rectangular box. The software then where,
creates a text (*.txt) file giving us the exact
2D coordinates of the object within the TP = True Positives (Predicted as
image. These files when combined with positive and is correct)
images gives us a complete dataset which FP = False Positives (Predicted as
further can be trained in any desired Deep positive and is incorrect)
Learning Frameworks.
Object detection systems create predictions
Model Training in terms of a bounding box and a class label.
The above extracted dataset is now trained For every bounded box, we will measure an
using different Deep Learning Frameworks overlap between the predicted bounding
and model such as RCNN, SSD and YOLO. box and the ground truth bounding box.
To train the DL Models we’re going to This is measured by IoU (Intersection over
use Google Collab. Google Collab is a Union).
free service offered by google where we 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑂𝑣𝑒𝑟𝑙𝑎𝑝
can run python scripts and use other 𝐼𝑜𝑈 =
𝐴𝑟𝑒𝑎 𝑜𝑓 𝑈𝑛𝑖𝑜𝑛
machine learning libraries taking
advantage of their powerful hardware. In order to evaluate an object detection
It’s for free with the only disadvantage model, we have to find Precision and Recall
that we can use it for 12 hours in a row, using IoU values for a given IoU threshold.
after that we’ll be disconnected and our Taking an example, if IoU threshold is set
files will be deleted. The dataset was to 0.7, and the IoU value for a prediction is
randomly shuffled in the ratio of 80-20. The 0.8 achieved, then the prediction is
model will then train using the 80 percent classified as True Positive (TP). On the
of the dataset and will give us the desired other hand, if IoU is 0.4 achieved, then the
weight. Remaining 20 percent of the dataset prediction is classified as False Positive
will be used for testing purpose. (FP).

IV. EXPERIMENTAL RESULTS

We have trained three different Deep


Learning based Object Detection Models
that is RCNN (Region Convolution Neural
Network), SSD (Single Shot Multibox
Detector) and YOLO (You Only Look
Once) and record their efficiency on test
datasets for further comparison and opting
best Detection Model for our use case. Another important term to understand in
order to evaluate an object detection model
Evaluation Metrics in an Object is Recall. Recall measures how well we find
Detection Model all the positives. For instance, we can find
In computer vision, Mean Average 80 percent of the possible positive cases
Precision (mAP) is used to evaluate Object inside our top K predictions.
4

𝑇𝑃
𝑅𝑒𝑐𝑎𝑙𝑙 =
(𝑇𝑃 + 𝐹𝑁)
where,
TP = True Positives (Predicted as
positive and is correct)
FN = False Negatives (Failed to
Predict an object is present there)
The Average Precision (AP) is the area
under the Precision vs Recall curve. (Mean
Average Precision) mAP is the average of
Average Precision (AP).
Fig: Graph of GPU time vs Accuracy
Analysis of Accuracy Precision
Precision for YOLO Model
(AP) and GPU Time to process
one frame (in ms)
Model mAP GPU
Score Time

RCNN
(Regional
Convolutional 33.325 874
Neural
Network)

SSD (Single
Shot
20.58 86.8
Multibox
Detector)

Fig: Graph of GPU time vs Accuracy YOLO (You


Precision for RCNN Model Only Look 33.1 394
Once)

V. CONCLUSION

We did a comparative study of various deep


learning based object detectors which uses
Artificial Neural Network to classify and
localize visual data. We have tested them
on our custom dataset of commonly used
weapons and also addressed their issues and
performance on a common hardware. We
discovered that SSD amongst all the other
Fig: Graph of GPU time vs Accuracy Deep Learning based Object Detection
Precision for SSD Model Frameworks has the least mAP score of 20,
but the computational time to detect the
5

object was fastest from others. So, it can be around the area which will report a nearby
a better choice if we need fast object hospital to avoid any fatality.
detector in trade-off to accuracy. YOLO D. Another possible application could be the
and RCNN provided us with the similar
detection of fire at any place which upon
mAP score of 33 and 34.2 respectively detection can be reported directly to a fire
which gives us the better accuracy of department ensuring that there is minimum
detecting the object. Although the YOLO
damage around that area.
trained model is comparatively faster as
that to the RCNN model making it an E. One can also monitor through the traffic
efficient and reliable object detection using this system where the cameras will
model. detect all the vehicles breaking any law and
reporting the same to a traffic control
department helping them to resolve traffic
issues.
F. One of the limitations of our project is that
there is no possible solution right now to
detect any weapon which is hidden by the
criminal in either his pocket or suitcases.
We are thinking of a way to overcome this
problem and build a better and safer
environment for citizens.

VII. REFERENCES

[1] Shreejal Trivedi, Object Detection- A


Quick Read, Weblog Available from:
Object detection (Accessed 20th
December 2020)
VI. FUTURE SCOPE
[2] Algorithmia, An Introduction to Deep
A. This research paper is limited to weapons Learning, Weblog Available from:
like AK47, Shotguns, 9mm Hand Pistols, Deep Learning (Accessed 21st
Combat Knives and Hand Grenades which December 2020)
are one of the most commonly used
weapons amongst the criminals. But there [3] Adrian Rosebrock, Region Proposal
are still a large number of dangerous and object detection with OpenCV, Keras,
illegal weapons whose possession by any and TenserFlow,[Online] Available
individual can cause a problem. So our from: RCNN (Accessed 21st December
target will be to add more and more of these 2020)
labelled datasets into our training part to
[4] Shivy Yohanandan, mAP (mean
ensure maximum accuracy.
Average Precision) might confuse you!
B. We can enhance this project to a collision [Online] Available from: Estimating
detection system where all sort of vehicle Deep Learning Model (Accessed 22nd
accidents can be traced and reported to December 2020)
nearby police station to prevent any further
damage.
C. Another application can be to use the
system for detection of any major blood

You might also like