0% found this document useful (0 votes)
49 views4 pages

The All-Seeing Eye For Constructive Weapon Detection Using YOLOv8 Object Detection Model-2

This paper presents a gun and weapon detection system utilizing the YOLOv8 object detection model, trained on a custom dataset of 16,000 images, achieving a mean average precision (mAP) of 88.2%. The study highlights the effectiveness of YOLOv8 in real-time applications for security and law enforcement, demonstrating high accuracy in detecting various weapons. Future work aims to enhance the system by expanding the dataset and incorporating features like occlusion handling and motion tracking.

Uploaded by

whosameerarora
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)
49 views4 pages

The All-Seeing Eye For Constructive Weapon Detection Using YOLOv8 Object Detection Model-2

This paper presents a gun and weapon detection system utilizing the YOLOv8 object detection model, trained on a custom dataset of 16,000 images, achieving a mean average precision (mAP) of 88.2%. The study highlights the effectiveness of YOLOv8 in real-time applications for security and law enforcement, demonstrating high accuracy in detecting various weapons. Future work aims to enhance the system by expanding the dataset and incorporating features like occlusion handling and motion tracking.

Uploaded by

whosameerarora
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

The All-Seeing Eye for Constructive Weapon Detection

Using YOLOv8 Object Detection Model


Pravek Sharma Sameer Arora
Amity School of Amity School of
Engineering and Engineering and
Technology, Amity Technology, Amity
University, Haryana, University, Haryana,
India India
pravek23@gmail. sameerar.001@gmail.
com com

ABSTRACT
Gun and weapon detection is a challenging task that has a wide law enforcement. These systems benefit a wide range of individuals
range of applications in security, surveillance, and law and organizations, including security personnel, surveillance
enforcement. In this paper, we present a novel gun and weapon operators, law enforcement officers, and the public. YOLOv8 has
detection system using the YOLOv8 (You Only Look Once) object the potential to significantly improve weapon detection capabilities
detection model. Our system is trained on a custom dataset of and enhance public safety.
16,000 images containing guns, knives, and heavy weapons. We
evaluate our system on a validation dataset of 1,400 images and
achieve a mean average precision (mAP) of 88.2%. The present article is structured as:
• Section I is Introduction,
KEYWORDS
• Section II is The literature review.
Weapon Detection; YOLOv8; Security; Deep Learning; Learning • Section III Illustrates the methodology.
Rate
• Section IV Describes results and discussion.
• Section V Summarizes the conclusions and gives ideas
1. INTRODUCTION for future work.

When it comes to object detection, a lot of previous work has been


done and implemented to an excellent level, providing us with 2. LITERATURE REVIEW
astonishing results. From detection of a cat or a dog in an image at
the beginning of it all to detection of high-speed cars and traffic in In the last few years, deep learning techniques and Convolutional
videos, we have all seen the evolution of algorithms and functional Neural Networks (CNNs) have achieved great results in image
models. The most recent state of the art object detection model is detection, classification, and segmentation, and it’s being used in
YOLO version 8 which when compared to its predecessors is a several applications [1]. The advancements in technology and the
highly advanced and more accurate detection model. The field of latest innovative detection models such as YOLO, Faster R-CNN
object detection has witnessed remarkable progress, with the latest and VGG-16 have achieved satisfactory results [2]. The common
state-of-the-art model, YOLOv8, offering significant challenges that are faced during weapon detection is the increase in
improvements in accuracy and efficiency. Weapon detection is a complexity due to partial or full occlusion of gun [3] deformation
crucial aspect of security, surveillance, and law enforcement, and and loss of information while transmission [4]. The rate of false-
traditional methods often prove ineffective. Deep learning-based negative and false-positive also is an issue in weapon detection
object detection models, such as YOLOv8, provide a more reliable systems due to such sensitive systems being linked to alarms or
and efficient solution. such devices [5]. Weapon Detection systems need Real-time
processing and fast response times due to their critical nature, so
Gun and weapon detection is a critical task for many applications, the research must find and implement techniques that speed the
such as security, surveillance, and law enforcement. However, it is processing time of weapon detection models [3].
also a challenging task due to the wide variety of gun and weapon
types and the complex appearance of many guns and weapons. In It is now easy to set up PCs and construct automated computer-
recent years, deep learning-based object detection models have based systems to distinguish and identify various products on a site
achieved state-of-the-art results on many object detection tasks, with high accuracy thanks to the availability of large datasets, faster
including gun and weapon detection. GPUs, enhanced machine learning algorithms, and superior
computations. Recent research indicates that advanced image
Weapon detection systems offer several benefits, including processing techniques and machine learning have dominated smart
preventing gun violence, monitoring public spaces, and assisting surveillance and security systems [7, 8]. In addition, the popularity
of smart devices and networked cameras has given this field more d. Model Evaluation Metrics: Figure 1 shows types of loss
power. However, since real-time online tracking is computationally while training. Figure 2 shows the confusion matrix for
expensive, human objects or weapon recognition and tracking are knife, heavy weapon, gun, and background. Further,
still carried out at cloud centers. Monitoring robot manipulators that Figure 3 shows the normalized confusion matrix for the
require good control performance in dependability and speed has same set of attributes.
received a lot of attention recently [9]. The researchers have tried
to lessen the uncertainties and enhance the robotic system's
response qualities. Time delay control (TDC) and adaptive terminal
sliding mode control (ATSMC) techniques are incorporated into
the robust model-free controller that has been presented.
Through an extensive literature survey, it can be concluded that
deep learning algorithms and YOLO easily cope with changing
parameters of object detection data and provide convincing results.
The aim of this paper is to study and implement YOLO version 8
over varying feature vectors and visualize comparative analysis
through different representations for better understanding of the
objects detected as weapons that are custom-trained.

3. METHODOLOGY
In this paper, proposed is a gun and weapon detection system using
the YOLOv8 object detection model. YOLOv8 is a state-of-the-art Figure 1: Types of Loss while Training
object detection model that is known for its speed and accuracy. It
is a single-stage object detector, which means that it can detect
objects in a single pass through the image.
The YOLOv8 model is trained on a custom dataset of 16,000
images containing guns, knives, and heavy weapons (Link to
dataset: https://universe.roboflow.com/yolov7test-u13vc/weapon-
detection-m7qso/dataset/16/images). The dataset was collected
from a variety of sources, including the internet, public domain
datasets, and private datasets. The images were carefully annotated
to ensure the accuracy of the ground truth labels. Trained the
YOLOv8 model on a custom dataset of 16,000 images containing
guns, knives, and heavy weapons. The dataset was collected from
a variety of sources, including the internet, public domain datasets,
and private datasets. The images were carefully annotated to ensure
the accuracy of the ground truth labels.
This model is developed in four major steps.
a. Extracting Data: In the context of this research, the
needed data ranges from representative points of view,
angles, and types of guns. Such data was mined from
reputable websites like Robo-flow and Kaggle and used
in this study. A total of 16,000 images as data was used
to move further with the project.
b. Data Cleaning and Pre-processing: Since semi-
structured and structured data was gathered for the scope
of this study, the cleaning process accommodates the Figure 2: Confusion Matrix
removal of outliers, inconsistent data, and other data
abnormalities in the form of very large files, empty
images, burr images, etc.
c. Feature Selection: To uncover key factors affecting
object detection, the proposed model YOLO model
computes correlations among boundary boxes and the
related data stored previously in model memory. This
finally led to the identification and isolation of important
features for further detection of objects such as a knife or
a gun or any harmful weapon.
to choose a confidence threshold that balances precision and recall
for each model. For example, if a high precision is required, then a
higher confidence threshold should be used. However, this will also
increase the number of false negatives.

Figure 3: Normalized Confusion Matrix


Figure 5: Precision-Confidence Curve
In Figure 4; the gun detection model has a high F1 score at a
confidence threshold of 0.399. The F1 score drops significantly at
In Figure 6; the gun detection model has a higher precision and
higher confidence thresholds. The model can identify most firearms
recall than the knife detection model and the heavy weapon
in the images with high precision and recall at a confidence
detection model at all recall levels. The precision of all three
threshold of 0.399, but it misses more of the guns at higher
models decreases as the recall increases. This information can be
confidence thresholds. The model could be used in applications
used to choose a recall level that balances precision and recall for
where it is more important to minimize false positives than to
each model. The figure signifies the knowledge with the machine
maximize recall, such as in security systems.
(precision) is approximately 100 percent through training. But with
the increase in epochs and the learning of the model, the universal
knowledge (recall) tends to be 100%. Signifying the false positives
tending to nil.
For example, if a high precision is required, then a lower recall level
should be used. However, this will also miss more of the weapons
in the images.

Figure 4: F1-Confidence Curve

In Figure 5; the gun detection model has a higher precision than the
knife detection model and the heavy weapon detection model at all
confidence thresholds. The precision of all three models decreases
as the confidence threshold increases. This information can be used Figure 6: Precision-Recall Curve
In Figure 7; the gun detection model has a higher recall than the
heavy weapon detection model and the knife detection model at all
confidence thresholds. The recall of all three models decreases as
the confidence threshold increases. This information can be used to
choose a confidence threshold that balances recall and precision for
each model. For example, if a high recall is required, then a lower
confidence threshold should be used.

Image 1: Custom Detection Result

5. CONCLUSION AND FUTURE WORK

In this paper, the present is a novel gun and weapon detection


system using the YOLOv8 object detection model. The system is
trained on a custom dataset of 16,000 images and achieves a mAP
of 88.2% on a validation dataset. The produced system is fast and
Figure 7: Recall-Confidence Curve can be deployed in real-time applications. In the future, we plan to
improve our gun and weapon detection system by training on a
larger dataset and by incorporating additional features, such as
occlusion handling and motion tracking. We also plan to deploy our
4. RESULTS AND DISCUSSION system on real-world applications, such as security cameras and
surveillance systems.
The results of the evaluation show that the YOLOv8-based gun and
weapon detection system can achieve high accuracy on a diverse REFERENCES
dataset of gun and weapon images. The produced system is also
fast and can be deployed in real-time applications. On custom [1.] M. M. Ghazi, B. Yanikoglu and E. Aptoula, “Plant identification using deep
neural networks via optimization of transfer learning parameters,”
images, the results vary with great accuracy as shown in image 1. Neurocomputing, vol. 235, no. 7, pp. 228–235, 2017
[2.] X. Shu, Y. Cai, L. Yang, L. Zhang and J. Tang, “Computational face reader
based on facial attribute estimation,” Neurocomputing, vol. 236, no. 10, pp.
The results in the form of images, detection in live video inputs and 153–163, 2017.
that of the videos of various surveillances provide us with the [3.] W. Yu, K. Yang, H. Yao, X. Sun and P. Xu, “Exploiting the complementary
acceptable ranges of accuracy and precision over the detected strengths of multi-layer CNN features for image retrieval,” Neurocomputing,
vol. 237, no. 2, pp. 235–241, 2017.
boundary of the objects i.e., weapons of various categories like
[4.] R. K. Tiwari and G. K. Verma, “A computer vision based framework for visual
light weapon, heavy weapon etc. gun detection using harris interest point detector,” Procedia Computer Science,
vol. 54, pp. 703–712, 2015.
[5.] R. Olmos, S. Tabik, A. Lamas, F. Pérez-Hernández and F. Herrera, “A binocular
YOLOv8 demonstrated exceptional accuracy in detecting weapons, image fusion approach for minimizing false positives in handgun detection with
achieving an average precision of 92.5%, indicating that it correctly deep learning,” Information Fusion, vol. 49, no. 2, pp. 271–280, 2019.
identified weapons 92.5% of the time when they were present in an [6.] K.-E. Ko and K.-B. Sim, “Deep convolutional framework for abnormal behavior
detection in a smart surveillance system,” Engineering Applications of Artificial
image. The model also exhibited high sensitivity (92.4%) and Intelligence, vol. 67, pp. 226–234, 2018.
specificity (97.1%), signifying its effectiveness in both identifying [7.] S. Y. Nikouei, Y. Chen, S. Song, R. Xu, B.-Y. Choi, and T. Faughnan, “Smart
weapons and distinguishing between images with and without surveillance as an edge network service: from harr-cascade, SVM to a
weapons. Furthermore, the model's mean intersection over union lightweight CNN,” in Proceedings of the 2018 IEEE 4th International
Conference on Collaboration and Internet Computing (CIC), pp. 256–265,
(IoU) of 53.6% implies that the predicted bounding boxes closely Philadelphia, PA, USA, April 2018.
matched the actual weapon locations. These findings underscore [8.] R. Xu, S. Y. Nikouei, Y. Chen et al., “Real-time human objects tracking for
YOLOv8's potential as a robust weapon detection tool for security smart surveillance at the edge,” in Proceedings of the 2018 IEEE International
applications. Conference on Communications (ICC), pp. 1–6, Kansas City, MO, USA, May
2018.
[9.] S. Ahmed, A. Ahmed, I. Mansoor, F. Junejo, and A. Saeed, “Output feedback
adaptive fractional-order super-twisting sliding mode control of robotic
manipulator,” Iranian Journal of Science and Technology, Transactions of
Electrical Engineering, vol. 45, no. 1, pp. 335–347, 2021.

You might also like