M S Engineering College: Jnana
M S Engineering College: Jnana
REPORT ON
“Weapon Detection using Artificial Intelligence and Deep
Learning for Security Applications”
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted By
Abstract:
Security is always a main concern in every domain, due to a rise in crime rate in a crowded
event or suspicious lonely areas. Abnormal detection and monitoring have major
applications of computer vision to tackle various problems. Due to growing demand in the
protection of safety, security and personal properties, needs and deployment of video
surveillance systems can recognize and interpret the scene and anomaly events play a vital
role in intelligence monitoring. This paper implements automatic gun (or) weapon
detection using a convolution neural network (CNN) based SSD and Faster RCNN
algorithms. Proposed implementation uses two types of datasets. One dataset, which had
pre-labelled images and the other one is a set of images, which were labelled manually.
Results are tabulated, both algorithms achieve good accuracy, but their application in real
situations can be based on the trade-off between speed and accuracy.
Contents
1. Introduction
1.1 Existing System
1.2 Proposed System
1.2.1 Problem Statement
1.2.2 Objectives
1.2.3 Scope of the Project
1.2.4 Aim of the project
2. Literature review
3. Requirement Specifications
3.1 Details of Software
3.1.1***********
3.1.2***********
3.2 System requirements
3.2.1 Hardware Configuration
3.2.2 Software Configuration
4. System Design
4.1 Data Flow Diagram
4.2 Sequence Diagram
5. System Implementation
5.1 Modular Description
6. Bibliography
CHAPTER-1
INTRODUCTION
Video surveillance system, which plays a vital role in the security area, is derived from
Closed Circuit Television (CCTV), but the data stream mainly flows from the front-end
camera to the control center. It is also called the CCTV system in some literature for this
reason. Surveillance cameras were first introduced into Physical Protecting System (PPS)
in the field of security to substitute the patrol guard for checking the alarm given by the
intrusion detector. Surveillance videos furnished the key clues to identify the suspects and
expose their criminal behavior during the investigation process of the 2005 London
bombings. It was the first time that governments realized the significance of the video
surveillance system to the security of city life. From then on, video surveillance system
becomes one of the essential components of security infrastructures in urban. It obtains a
consensus that video surveillance is effective in crime prevention and also in reducing
certain crimes to a great extent. According to statistics, robbery, serious assault, and
motorcycle theft are the top three types of crime to be monitored and cracked down via
video surveillance. For instance, it is recorded that an around 51% reduction lay on the
crimes after video surveillance equipped in public places, such as parking lot and street.
The existing system consumes more time to detect weapons in real time
surveillances.
The data may contain Missing values which will cause uncertainty.
The most common problems among them were the input size, attributes and
validation
It will consumes less time to train the model and prediction in real time.
1.2.2 Objectives
• The main objective of the proposed system is to provide a new technique for
tracking of objects and event detection in the images of low resolution without the
usage of any super resolution techniques or classifiers.
• To implement an automated system which detect weapon in public places to ensure
risk.
• Design a system for recognizing and detecting a weapon automatically in image,
video or real time through webcam or CCTV.
• Real time and completely computer based. Human operators not required.
• System can be used in public or private facility to restrict weapon access.
Our innovation:
Our system design builds send SMS Alert to the police with the GPS
coordinates if any weapon detected.
1.2.3 Scope of the Project
When we consider the topic of security and terrorism, the first word that comes to our mind
is weapons. All the unwanted attacks have been made possible by the presence of weapons,
be it hijacking or any attack aimed to fill people’s mind with fear. Security is of utmost
importance, not only for us, but also for the people that are around us. Nowadays, there are
various measures that are taken to ensure the safety of the people everywhere. But we can
never be too sure about how secure those measures actually are. Taking airport for example,
smuggling and carrying illegal arms from one place to another is not usual but still there
have been some instances of the same. This is where effecient weapon detection comes into
the picture.
1.2.4 Aim of the project
The aim of this project is to propose a method to detect weapon carried out by
the person in low resolution image such as CCTV image.
CHAPTER-2
LITERATURE SURVEY
A literature survey or a literature review in a project report shows the various
analyses and research made in the field of interest and the results already published,
taking into account the various parameters of the project and the extent of the project.
Literature survey is mainly carried out in order to analyze the background of the current
project which helps to find out flaws in the existing system & guides on which unsolved
problems we can work out. So, the following topics not only illustrate the background of
the project but also uncover the problems and flaws which motivated to propose solutions
and work on this project.
A literature survey is a text of a scholarly paper, which includes the current
knowledge including substantive findings, as well as theoretical and methodological
contributions to a particular topic. Literature reviews use secondary sources, and do not
report new or original experimental work. Most often associated with academic-
oriented literature, such as a thesis, dissertation or a peer-reviewed journal article, a
literature review usually precedes the methodology and results sectional though this is
not always the case. Literature reviews are also common in are search proposal or
prospectus (the document that is approved before a student formally begins a
dissertation or thesis). Its main goals are to situate the current study within the body of
literature and to provide context for the particular reader. Literature reviews are a basis
for researching nearly every academic field. demic field. A literature survey includes
the following:
• Existing theories about the topic which are accepted universally.
• Concentrate on your own field of expertise– Even if another field uses the same
words, they usually mean completely.
• It improves the quality of the literature survey to exclude sidetracks– Remember
to explicate what is excluded.
Before building our application, the following system is taken into consideration:
2.1 Title: Learning efficient single-stage pedestrian detectors by asymptotic
localization fitting
Author: W. Liu, S. Liao, W. Hu, X. Liang, and X. Chen
Year: 2018
Abstract: Though Faster R-CNN based two-stage detectors have witnessed significant
boost in pedestrian detection accuracy, it is still slow for practical applications. One
solution is to simplify this working flow as a single-stage detector. However, current single-
stage detectors (e.g. SSD) have not presented competitive accuracy on common pedestrian
detection benchmarks. This paper is towards a successful pedestrian detector enjoying the
speed of SSD while maintaining the accuracy of Faster R-CNN. Specifically, a structurally
simple but effective module called Asymptotic Localization Fitting (ALF) is proposed,
which stacks a series of predictors to directly evolve the default anchor boxes of SSD step
by step into improving detection results. As a result, during training the latter predictors
enjoy more and better-quality positive samples, meanwhile harder negatives could be
mined with increasing IoU thresholds. On top of this, an efficient single-stage pedestrian
detection architecture (denoted as ALFNet) is designed, achieving stateof-the-art
performance on CityPersons and Caltech, two of the largest pedestrian detection
benchmarks, and hence resulting in an attractive pedestrian detector in both accuracy and
speed.
Advantages:
It is used to detects anchor boxes.
Disadvantages:
In this paper not considers about detection of weapons .
2.2 Title: Report on the Evaluation of 2D Still-Image Face Recognition Algorithms
Author: P. J. Grother, G. W. Quinn, and P. J. Phillips.
Year: 2018
Abstract: The paper evaluates state-of-the-art face identification and verification
algorithms, by applying them to corpora of face images the population of which extends
into the millions. Performance is stated in terms of core accuracy and speed metrics, and
the dependence of these on population size and image properties are reported. One-to-many
search algorithms are evaluated in terms of their use in both investigational and
identification modes. Investigational performance has implications for workload on an
examiner reviewing the results of a search. Identification performance, using a high score
threshold, can support fully automated operation and decision making if some quantified
level of false match is acceptable. In addition, the paper establishes an initial approach
toward calibration of false match accuracy.
Advantages:
It is used to recognise the face.
Disadvantages:
In this paper not considers about detection of weapons.
2.3 Title: Video surveillance systems-current status and future trends
Author: V. Tsakanikas and T. Dagiuklas.
Year: 2018
Abstract: Within this survey an attempt is made to document the present status of video
surveillance systems. The main components of a surveillance system are presented and
studied thoroughly. Algorithms for image enhancement, object detection, object tracking,
object recognition and item re-identification are presented. The most common modalities
utilized by surveillance systems are discussed, putting emphasis on video, in terms of
available resolutions and new imaging approaches, like High Dynamic Range video. The
most important features and analytics are presented, along with the most common
approaches for image / video quality enhancement. Distributed computational
infrastructures are discussed (Cloud, Fog and Edge Computing), describing the advantages
and disadvantages of each approach. The most important deep learning algorithms are
presented, along with the smart analytics that they utilize. Augmented reality and the role
it can play to a surveillance system is reported, just before discussing the challenges and
the future trends of surveillance.
Advantages:
It is used to detect the objects.
Disadvantages:
In this, still security is less.
2.4 Title: PETS 2018: Dataset and challenge
Author: L. Patino, T. Nawaz, T. Cane, and J. Ferryman.
Year: 2018
Abstract: For many years PET centres around the world have developed and optimised
their own analysis pipelines, including a mixture of in-house and independent software,
and have implemented different modelling choices for PET image processing and data
quantification. As a result, many different
methods and tools are available for PET image analysis.
This dataset aims to provide a normative tool to assess the performance and consistency of
PET modelling approaches on the same data for which the ground truth is known.
This dataset was created and released for the NRM2018 PET grand challenge. The
challenge aimed
at evaluating the performances of different PET analysis tools to identify areas and
magnitude of
receptor binding changes in a PET radiolig and neurotransmission study.
Advantages:
It is used to find the problems and challenges in the pest dataset
Disadvantages:
In this, still security is less.
2.5 Title: Weapon Detection in Real-Time CCTV Videos Using Deep Learning
Author: Muhammad Tahir Bhatti; Muhammad Gufran Khan; Masood Aslam.
Year: 2021
Abstract: Security and safety is a big concern for today's modern world. For a country to
be economically strong, it must ensure a safe and secure environment for investors and
tourists. Having said that, Closed Circuit Television (CCTV) cameras are being used for
surveillance and to monitor activities i.e. robberies but these cameras still require human
supervision and intervention. We need a system that can automatically detect these illegal
activities. Despite state-of-the-art deep learning algorithms, fast processing hardware, and
advanced CCTV cameras, weapon detection in real-time is still a serious challenge.
Observing angle differences, occlusions by the carrier of the firearm and persons around it
further enhances the difficulty of the challenge. This work focuses on providing a secure
place using CCTV footage as a source to detect harmful weapons by applying the state of
the art open-source deep learning algorithms. We have implemented binary classification
assuming pistol class as the reference class and relevant confusion objects inclusion
concept is introduced to reduce false positives and false negatives. No standard dataset was
available for real-time scenario so we made our own dataset by making weapon photos
from our own camera, manually collected images from internet, extracted data from
YouTube CCTV videos, through GitHub repositories, data by university of Granada and
Internet Movies Firearms Database (IMFDB) imfdb.org. Two approaches are used i.e.
sliding window/classification and region proposal/object detection. Some of the algorithms
used are VGG16, Inception-V3, Inception-ResnetV2, SSDMobileNetV1, Faster-RCNN
Inception-ResnetV2 (FRIRv2), YOLOv3, and YOLOv4. Precision and recall count the
most rather than accuracy when object detection is performed so these entire algorithms
were tested in terms of them. Yolov4 stands out best amongst all other algorithms and gave
a F1-score of 91% along with a mean average precision of 91.73% higher than previously
achieved.
Advantages:
Accuracy is 91%.
Disadvantages:
• It is suitable for only binary classification.
• It cannot able to implement for multiple weapon.
2.6 Title: Hawk-Eye: An AI-Powered Threat Detector for Intelligent Surveillance
Cameras
Author: Ahmed Abdelmoamen Ahmed; Mathias Echi,
Year: 2021
Abstract: With recent advances in both AI and IoT capabilities, it is possible than ever to
implement surveillance systems that can automatically identify people who might represent
a potential security threat to the public in real-time. Imagine a surveillance camera system
that can detect various on-body weapons, masked faces, suspicious objects and traffic. This
system could transform surveillance cameras from passive sentries into active observers
which would help in preventing a possible mass shooting in a school, stadium or mall. In
this paper, we present a prototype implementation of such systems, Hawk-Eye, an AI-
powered threat detector for smart surveillance cameras. Hawk-Eye can be deployed on
centralized servers hosted in the cloud, as well as locally on the surveillance cameras at the
network edge. Deploying AI-enabled surveillance applications at the edge enables the
initial analysis of the captured images to take place on-site, which reduces the
communication overheads and enables swift security actions. At the cloud side, we built a
Mask R-CNN model that can detect suspicious objects in an image captured by a camera
at the edge. The model can generate a high-quality segmentation mask for each object
instance in the image, along with the confidence percentage and classification time. The
camera side used a Raspberry Pi 3 device, Intel Neural Compute Stick 2 (NCS 2), and
Logitech C920 webcam. At the camera side, we built a CNN model that can consume a
stream of images directly from an on-site webcam, classify them, and displays the results
to the user via a GUI-friendly interface. A motion detection module is developed to capture
images automatically from the video when a new motion is detected. Finally, we evaluated
our system using various performance metrics such as classification time and accuracy. Our
experimental results showed an average overall prediction accuracy of 94% on our dataset.
Advantages:
Our experimental results showed an average overall prediction accuracy of 94% on our
dataset. Disadvantages:
It works only for only for the specific dataset.
2.7 Title: Handgun Detection Using Combined Human Pose and Weapon Appearance
Author: Jesus Ruiz-Santaquiteria; Alberto Velasco-Mata; Noelia Vallez; Gloria
Bueno,
Year: 2021
Abstract: Closed-circuit television (CCTV) systems are essential nowadays to prevent
security threats or dangerous situations, in which early detection is crucial. Novel deep
learning-based methods have allowed to develop automatic weapon detectors with
promising results. However, these approaches are mainly based on visual weapon
appearance only. For handguns, body pose may be a useful cue, especially in cases where
the gun is barely visible. In this work, a novel method is proposed to combine, in a single
architecture, both weapon appearance and human pose information. First, pose keypoints
are estimated to extract hand regions and generate binary pose images, which are the model
inputs. Then, each input is processed in different subnetworks and combined to produce the
handgun bounding box. Results obtained show that the combined model improves the
handgun detection state of the art, achieving from 4.23 to 18.9 AP points more than the best
previous approach.
Advantages:
Accuracy is 91%.
Disadvantages:
• It is suitable for only binary classification.
• It cannot able to implement for multiple weapon.
2.8 Title: Gunshots Localization and Classification Model Based on Wind Noise
Sensitivity Analysis Using Extreme Learning Machine
Author: Shahzad Ahmad Qureshi; Lal Hussain; Haya Mesfer Alshahrani; Syed
Rahat Abbas
Year: 2022
Abstract: The gunshot event localization and classification have numerous real-time
applications. The study is also useful for steering the video camera and guns in the directed
direction. This paper proposes a framework that can be used for a surveillance system to
accurately localize and classify the type of gunshots impregnated with wind noise. The
main contribution of this paper is the localization of the gunshot for the very first time using
Hadamard product with wavelet de-noising in windy conditions. We have evaluated our
framework on airborne gunshots acoustic dataset, and a derived (simulated) sound dataset,
as an offline scenario, using four microphones’ geometry. For localization, the proposed
system outperformed with an accuracy of 99.95%. The other contribution is a sensitivity-
based comprehensive examination of gunshot sound signals, with normal to strong wind
noise of varying SNRs, for machine learning and deep learning classifiers to categorize the
type of gunshots. For classification, it has been found, not known before for the gunshots
dataset, that ELM is robust for original, normal, and strong windy environments with an
accuracy of 93.01%, 91.61%, and 88.11% respectively with the threshold SNR. A
comprehensive comparison of recent techniques with the proposed approach has also been
added.
Advantages:
Accuracy is 91%.
Disadvantages:
• It is suitable for only binary classification.
• It cannot able to implement for multiple weapon.
2.9 Title: Weapon Detection from Surveillance Images using Deep Learning
Author: Anjali Goenka; K. Sitara
Year: 2022
Abstract: Security is the biggest concern in today’s world which needs to be addressed to
save people from critical threats. We need to detect these threats at the earliest to protect
people and take required actions. Security cameras are used almost everywhere now
ranging from our home to shopping malls to banks. Currently, not many surveillance
cameras have an automatic weapon detection system but with the advancement in
technologies, it can be easily equipped. This will help the people in charge concerned to
take the appropriate actions and thus prevent crimes. Deep learning techniques are used
widely to detect objects as the traditional methods of object detection have their own
limitations in certain situations. One such algorithm – Mask RCNN is implemented in this
work to detect guns from surveillance video images. Gaussian deblur technique is used to
enhance the features of handgun for efficient detection especially in blurred images. The
experiment results show that the performance of the model increased with preprocessing.
Advantages:
It works on blurred images.
Disadvantages:
• It is suitable for only binary classification.
• It cannot able to implement for multiple weapon.
2.10 Title: Weapon Detection Using Faster R-CNN Inception-V2 for a CCTV
Surveillance System
Author: Narit Hnoohom; Pitchaya Chotivatunyu; Nagorn Maitrichit; Virach
Sornlertlamvanich
Year: 2022
Abstract: Thailand has faced unrest in recent years, as have other countries around the
world. The continuation of present trends means a tendency for an increase in both crimes
against people and property. Nowadays, CCTV technology is widely used as surveillance
and monitoring tools to help keep people safe. However, most of them still rely primarily
on police personnel to inspect the displays. A weapon detection system can reduce the
screen-reading workload of police officers with a limited workforce. The integration of
weapon detection with CCTV cameras has a role to play in solving the problem. To develop
the weapon detection system, the datasets used in this research were collected from 2 public
datasets: ARMAS Weapon detection dataset and IMFDB Weapon detection system. The
object detection method was used from TensorFlow Object Detection API using 1) SSD
MobileNet-V1, 2) EfficientDet-D0 and 3) Faster R-CNN Inception Resnet-V2. For all
experimental results, the object detection model is the Faster R-CNN Inception V2 using
Dataset 1, ARMAS Weapon detection dataset, with the highest mAP of 0.540 with the
Average Precision with 0.5 IoU and 0.75 IoU at 0.793 and 0.627, respectively.
Advantages:
Accuracy is 71%.
Disadvantages:
• It is suitable for only binary classification.
Literature Summary:
Report on the The paper evaluates state- It is used to In this paper not
Evaluation of of-the-art face recognise the face considers about
2D Still-Image identification and detection of
Face verification algorithms, by weapons.
Recognition applying them to corpora
Algorithms of face images the
P. J. Grother, population of which
G. W. Quinn, extends into the millions.
and P. J. Performance is stated in
Phillips. -2018 terms of core accuracy and
speed metrics, and the
dependence of these on
population size and image
properties are reported.
One-to-many search
algorithms are evaluated in
terms of their use in both
investigational and
identification modes.
Investigational
performance has
implications for workload
on an examiner reviewing
the results of a search.
Identification performance,
using a high score
threshold, can support fully
automated operation and
decision making if some
quantified level of false
match is acceptable. In
addition, the paper
establishes an initial
approach toward
calibration of false match
accuracy.
PETS 2018: This paper indicates the It is used to find In this, still security
Dataset and dataset and challenges the problems and is less.
challenge evaluated under challenges in the
L. Patino, T. PETS2017. In this edition pest dataset
Nawaz, T. PETS continues the
Cane, and J. evaluation theme of on-
Ferryman,2018 board surveillance systems
for protection of mobile
critical assets as set in
PETS 2016. The datasets
include (1) the ARENA
Dataset; an RGB camera
dataset, as used for
PETS2014 to PETS 2016,
which addresses protection
of trucks; and (2) the
IPATCH Dataset; a multi
sensor dataset, as used in
PETS2016, addressing the
application of multi sensor
surveillance to protect a
vessel at sea from piracy.
There are two major Python versions: Python 2 and Python 3. Both are quite different.
1) Finding an Interpreter:
Windows: There are many interpreters available freely to run Python scripts like
IDLE (Integrated Development Environment) that comes bundled with the Python
software downloaded from http://python.org/.
Linux: Python comes preinstalled with popular Linux distros such as Ubuntu and
Fedora. To check which version of Python you’re running, type “python” in the
terminal emulator. The interpreter should start and print the version number.
macOS: Generally, Python 2.7 comes bundled with macOS. You’ll have to manually
install Python 3 from http://python.org/.
GUI Programming
Python supports GUI applications that can be created and ported to many system calls,
libraries, and windows systems, such as Windows, Macintosh, and the X Window system
of Unix. It has libraries like Tkinter, WxPython, etc.
Scalable
Python provides a better structure and support for large programs than shell scripting.
Apart from the above-mentioned features, Python has a big list of good features, few of
them are-
• RAM :8 GB RAM
• Technology : Python
• IDE : PythonIDLE
• Tools : Anaconda
The flow chart for grouping information is as portrayed within the figure . the information
set is collected from a supply and a whole analysis is dispensed. The image is chosen to be
used for training/testing functions provided that it matches our necessities and isn't
recurrent.
4.3 DATA FLOW DIAGRAM:
1. The DFD is also called as bubble chart. It is a simple graphical formalism that can
be used to represent a system in terms of input data to the system, various processing
carried out on this data, and the output data is generated by this system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It is used
to model the system components. These components are the system process, the
data used by the process, an external entity that interacts with the system and the
information flows in the system.
3. DFD shows how the information moves through the system and how it is modified
by a series of transformations. It is a graphical technique that depicts information
flow and the transformations that are applied as data moves from input to output.
4. DFD is also known as bubble chart. A DFD may be used to represent a system at
any level of abstraction. DFD may be partitioned into levels that represent
increasing information flow and functional detail.
4.3.1 DFD-Level-0
0.1
Level: 0 describes the overall process of the project. We are real time camera image as
input. By using the Deep learning algorithm system will identifies weapon in frame.
4.3.2 DFD-Level-1
1.1 1.2
Image frame Preprocess Extract
Features
Features
Level: 1 describes the first step process of the project. We are passing image frames as
input. System will read and preprocess the data and extract the most relevant features.
4.3.3 DFD-Level- 2
Features 2.1
Read the 2.2
features
CNN
2.1
Trained Data
Read data 2.3
NO
Weapon
? exit
YES
Send SMS
and Alarm
Fig4.5 Data flow diagram-Level2
Level: 2 describes the final step process of the project. We are passing extracted features
from level 1 and trained data as input. System will read features and load the trained model
to predict weapon using CNN and send SMS to the administrator.
User System
Capture data
Read
Pre process
3. System Implementation
5.1 List of Modules
We are using the following modules to implement this project.
Dataset
Importing the necessary libraries
Retrieving the images
Splitting the dataset
Building the model
Apply the model and plot the graphs for accuracy and loss
Accuracy on test set
Saving the Trained Model
Detecting weapon and alerting system
4. Bibliography
[1] Wei Liu et al., “SSD: Single Shot MultiBox Detector”, European Conference on
Conputer Vision, Volume 169, pp 20-31 Sep. 2017.
[2] D. Erhan et al., “Scalable Object Detection Using Deep Neural Networks,” IEEE
Conference on Computer Vision and Pattern Recognition(CVPR),2014.
[3] Ruben J Franklin et.al., “Anomaly Detection in Videos for Video Surveillance
Applications Using Neural Networks,” International Conference on Inventive Systems and
Control,2020.
[4] H R Rohit et.al., “A Review of Artificial Intelligence Methods for Data Science and
Data Analytics: Applications and Research Challenges,”2018 2nd International Conference
on I-SMAC (IoT in Social, Mobile, Analytics and Cloud), 2018.
[5] Abhiraj Biswas et. al., “Classification of Objects in Video Records using Neural
Network Framework,” International conference on Smart Systems and Inventive
Technology,2018.