Weapon Detection
Weapon Detection
BENGALURU-560091
(Affiliated to Visvesvaraya Technological University, Belgaum, Karnataka)
“WEAPON DETECTION”
MASTERS OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING
We have focused on the specific task of automated detection and recognition of dangerous situations applicable in
general for any CCTV system. The problem we are tackling is the automated detection of dangerous weapons—
knives and firearms, the most frequently used and deadly weapons. The appearance of such objects held in a hand
is an example of a sign of danger to which the human operator must be alerted.
Introduction (Contd…)
Closed circuit television systems (CCTV) are becoming more and more popular and are being deployed in many
offices, housing estates and in most public spaces. There are a million of CCTV cameras that are currently in
operation in India. This makes for an enormous load for the CCTV operators, as the number of camera views a
single operator can monitor is limited by human factors. The task of the CCTV operator is to monitor and control,
detect, observe, recognize and identify individuals and situations that are potentially harmful to other people and
property but it becomes harder to monitor when there are a lot of CCTV cameras.
A solution to the problem of overloading the human operator is to apply automated image-understanding
algorithms, which, rather than substituting the human operator, alert them if a potentially dangerous situation is at
hand.
Problem Statement
To design and implement a system to detect the weapon and militant in the given image and
algorithm .
• After identification if any weapon and militants are found that will be detected.
Output: Display weapon and militant type when weapon and militant are detected it intimates the
Detection of segment containing the weapon in the detected image segment containing human
Design of a neural network based classifier to classify a single type of weapon verses non-
weapon
Computation image required to detect the weapon directly in a image as compared to detection
DRAWBACKS:
The processing speed of the existing system and accuracy will be low .
Problem Statement
Detection and getting details about the detection is logically hard to get implement with efficient output.There
are lots of techniques to detect the different types of anomaly detection in surveillance. Conventional methods
of detecting intrusion in naked eye observation in live time detection.
Proposed System
Here we proposes a system for militant and military object detection using YOLOv5 and Python.
The project involves collecting a large dataset of annotated images of military objects and militants,
splitting the dataset into training, validation, and testing sets, and converting the annotated images
into YOLOv5 format. The YOLOv5 model is then trained on the annotated dataset and evaluated
using various metrics such as precision, recall, and map. Once the model is trained and evaluated, it
is deployed to detect militants and military objects in real-time images or videos using Python
libraries like OpenCV or PyTorch. The proposed system can also be integrated with additional
features such as object tracking, alert notifications, or automatic response mechanisms to enhance
its functionality. The project demonstrates the potential of deep learning-based object detection for
military and defense applications and serves as a basis for further research in this area.
System Design
The system architecture for the
proposed system. The input image is
preprocessed and converted to gray
scale image to get the clear vision of
the image. Then it will be converted
into binary values. In the next step
identifies the part which needs to
proceed further. Then required feature
are extracted by In the CNN
convolution layer. By passing those
features into different layer of CNN
we get compressed image, that feature
is used for detection of weapon and
militant using SoftMax activation
function.
Convolutional Neural Network(YOLO)
Data Flow Diagram
A data flow diagram (DFD) is graphic representation of the
"flow" of data through an information system.
A data flow diagram can also be used for the visualization of
data processing (structured design).
It is common practice for a designer to draw a context level
DFD first which shows the interaction between the system
and outside entities.
This level of preprocessing shows that the image is given as input.
As we giving the color image so that RGB image is converted into gray scale
values to reduce complexity in the image.
For efficient feature extraction gray scale values are converted into binary
values.
Then the image with reduced complexity is send to the next process.
The figure of identification shows that the image with
reduced complexity is considered as input.
Here the region with the value of one is considered as
black that region is considered for next process.
class
diagra
m
• Class diagram describes the attributes and operations of a class and alsotheconstraints imposed on the
system. The class diagrams are widely used in the modelingofobject oriented systems because they are
the only UML diagrams, which can be mappeddirectly with object-oriented languages.
• The purpose of fig is to model the static view of an application by using class diagramare the only
diagram which can be directly mapped with object–oriented languages andthus widely used at the time
of construction.
Modules
1.Image Pre Processing.
2.Identification
3.Feature Extraction
4.Weapon and militant Recognition
5.Militant Detection
6.Intimation
Image Preprocessing
Image processing is a mechanism that focuses on
the manipulation of images in different ways in
order to enhance the image quality. Images are
taken as the input and output for image
processing techniques. It is the analysis of image-
to-image transformation which is used for the
enhancement of image
Identification
In this stage identify the region which needs to proceed for further process,
it is involved in the identification of the particular region of the image that
is used for the further process like feature extraction and classification of
the images. The output of the pre-processing step is given as the input for
the identification process. This process is based on the binary values
obtained in the pre-processing step. The region with black is considered a
region of interest. The region of interest obtained by the pre-processing of
the images. That region is considered as proceeding part of the image from
which weapon and militant will be identified. The identified weapon and
militant images are given to the feature extraction process
Feature Extraction
In this stage extract the required feature from the
identified region which is obtained from the previous
step. That region is compressed by converting a
reduced size matrix to control over fitting. The
reduction of the matrix size helps in reducing the
memory size of the images. Then the flattening process
is applied to the reduced matrix, in which the reduced
matrix is converted to a one-dimension array, which is
used for final detection.
Weapon and Militant Recognition
In this stage one-dimension array is used for the final classification process. The output image
obtained from feature extraction is given as input to this process. Where continuous
classification of all the features obtained from the previous stage. Artificial neural networks are
applied in this process.
Each node of the input layer has a value from a onedimension array which represents the feature
from the extracted region.
That is sent to the hidden layer. Multiple features are getting from the input layer and undergo
multiple iteration in the hidden layer.
Finally get the predictive values by applying SoftMax activation function to it. Finally, get some
output values from this process and these values undergo further process.
The highest value in the predictive value is considered as output identified as weapon and
militant. By using these methods, the weapon and militant will be detected by considering
highest accuracy values.
Intimation
Telebot is a bot framework for Telegram Bot API. This package provides the best of its kind API
for command routing, inline query requests and keyboards, as well as callbacks.
Bots have legitimate uses on the popular chat apps, but are being exploited by
cybercriminals. Cybercriminals are using bots deployed in popular messaging apps Discord and