Deep Learning-based Weapon Detection using Yolov8

Authors

  • Alysha Farhan Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Muhammad Aftab Shafi Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Marwa Gul Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Sara Fayyaz Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Kifayat Ullah Bangash Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Bilal Ur Rehman Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan
  • Humayun Shahid Department of Telecommunication Engineering, University of Engineering & Technology, Taxila, Pakistan
  • Muhammad Kashif Khan Department of Electrical Engineering, Faculty of Electrical and Computer Engineering, University of Engineering & Technology, Peshawar, Pakistan

Keywords:

Weapon detection, Deep Learning, Yolov8, Object Detection, Computer Vision

Abstract

Deep learning (DL), a subset of machine learning (ML), has demonstrated remarkable success in image recognition and object detection tasks. This study presents a deep learning-based approach for offline weapon detection using the YOLOv8m architecture. A custom YOLO-formatted dataset was developed, comprising over 10,000 annotated images spanning two weapon categories: guns (all types of firearms) and knives (all types). The model achieved a Mean Average Precision (mAP@0.5) of 0.852. and mAP@0.5:0.95 of 0.622, with precision and recall scores of 0.89 and 0.80, respectively. The class-wise evaluation revealed strong detection across both weapons, with mAP@0.5 of 0.871 for knives and 0.831 for guns. Despite occasional false positives and class confusion, the system shows promise for offline weapon detection tasks.

References

T. G. Swart, Ibomoiye Domor Mienye, “A Comprehensive Review of Deep Learning: Architectures, Recent Advances, and Applications,” Information, vol. 15, no. 12, p. 755, 2024, doi: https://doi.org/10.3390/info15120755.

W. C. Yibo Sun, Zhe Sun, “The evolution of object detection methods,” Eng. Appl. Artif. Intell., vol. 133, p. 108458, 2024, doi: https://doi.org/10.1016/j.engappai.2024.108458.

M. Sohan, T. Sai Ram, and C. V. Rami Reddy, “A Review on YOLOv8 and Its Advancements,” pp. 529–545, 2024, doi: 10.1007/978-981-99-7962-2_39.

P. P. Khin and N. M. Htaik, “Gun Detection: A Comparative Study of RetinaNet, EfficientDet and YOLOv8 on Custom Dataset,” Proc. 21st IEEE Int. Conf. Comput. Appl. 2024, ICCA 2024, pp. 98–103, 2024, doi: 10.1109/ICCA62361.2024.10532867.

K. P. Ayush Thakur, Akshat Shrivastav, Rohan Sharma, Triyank Kumar, “Real-Time Weapon Detection Using YOLOv8 for Enhanced Safety,” arXiv:2410.19862, 2024, doi: https://doi.org/10.48550/arXiv.2410.19862.

R. Rastogi and Y. Varshney, “A comprehensive study for weapon detection technologies for surveillance under different YoloV8 models on primary data,” Hybrid Inf. Syst. Non-Linear Optim. Strateg. with Artif. Intell., pp. 241–267, Jul. 2024, doi: 10.1515/9783111331133-013/MACHINEREADABLECITATION/RIS.

L. B. Leiji Lu, Hongxia Yu, Hongju Xiao, “Study on the application of transfer learning in small sample image classification of military equipment,” Fifth Int. Conf. Signal Process. Comput. Sci. (SPCS 2024), 2024, Kaifeng, China, vol. 13442, 2025, [Online]. Available: https://www.spiedigitallibrary.org/conference-proceedings-of-spie/13442/1344207/Study-on-the-application-of-transfer-learning-in-small-sample/10.1117/12.3053163.full

M. B. Aref Miri Rekavandi, Lian Xu, Farid Boussaid, Abd-Krim Seghouane, Stephen Hoefs, “A Guide to Image and Video based Small Object Detection using Deep Learning : Case Study of Maritime Surveillance,” arXiv:2207.12926, 2022, doi: https://doi.org/10.48550/arXiv.2207.12926.

A. A. Ahmed Gomaa, “Novel Deep Learning Domain Adaptation Approach for Object Detection Using Semi-Self Building Dataset and Modified YOLOv4,” World Electr. Veh. J., vol. 15, no. 6, p. 255, 2024, doi: https://doi.org/10.3390/wevj15060255.

C. dos S. Satya Prakash Yadav, Muskan Jindal, Preeti Rani, Victor Hugo C. de Albuquerque, “An improved deep learning-based optimal object detection system from images,” Multimed. Tools Appl., vol. 83, pp. 30045–30072, 2024, doi: https://doi.org/10.1007/s11042-023-16736-5.

C. K. M. Soumya A., Linga Reddy Cenkeramaddi, Vishnu Chalavadi, “Multi-class object classification using deep learning models in automotive object detection scenarios,” Proc. 16th Int. Conf. Mach. Vis. (ICMV 2023), 2023, [Online]. Available: https://openreview.net/forum?id=KpZ2AD6sEa

R. Varghese and M. Sambath, “YOLOv8: A Novel Object Detection Algorithm with Enhanced Performance and Robustness,” 2024 Int. Conf. Adv. Data Eng. Intell. Comput. Syst. ADICS 2024, 2024, doi: 10.1109/ADICS58448.2024.10533619.

J. Kaur and W. Singh, “A systematic review of object detection from images using deep learning,” Multimed. Tools Appl. 2023 834, vol. 83, no. 4, pp. 12253–12338, Jun. 2023, doi: 10.1007/S11042-023-15981-Y.

V. P. Nagendrababu N C , Pruthvi C N, Sharan Kumar B N, Shivani S, “Smart Surveillance: Deep Learning-Based Weapon Detection Using Yolo,” Int. Res. J. Eng. Technol., vol. 12, no. 3, 2025, [Online]. Available: https://www.irjet.net/archives/V12/i3/IRJET-V12I304.pdf

Y. R. P. Amulya Reddy Maligireddy, Manohar Reddy Uppula, Nidhi Rastogi, “Gun Detection Using Combined Human Pose and Weapon Appearance,” arXiv:2503.12215, 2025, doi: https://doi.org/10.48550/arXiv.2503.12215.

P. Werukanjana, N. Permpool, and P. Sa-Nga-Ngam, “Integration of Object Detection in Crime Scene Investigation,” Eng. Access, vol. 11, no. 1, pp. 13–23, Jan. 2025, doi: 10.14456/MIJET.2025.2.

A. P. D. Jayarani, N. Rangarajan, S. C. ReddyBadepalli, S. H. Neella, and S. Kolla, “Weapon Recognition Using Deep Learning for Security Applications,” AIP Conf. Proc., vol. 3237, no. 1, Feb. 2025, doi: 10.1063/5.0247100/3337722.

D. F. D. Shahila, N. Nalini, T. Prabhu, M. Dinesh, N. Sunheriya, and M. Kanan, “A Comparative Study of Weapon Detection in Images Using Deep Learning Algorithms,” Proc. 2024 Int. Conf. Innov. Comput. Intell. Commun. Smart Electr. Syst. ICSES 2024, 2024, doi: 10.1109/ICSES63760.2024.10910663.

News Desk, “Alarming 45% increase in deaths: Pakistan becomes world’s second-most terrorism-affected country,” News Int., 2025, [Online]. Available: https://www.thenews.com.pk/print/1289524-alarming-45pc-increase-in-deaths-pakistan-becomes-world-s-second-most-terrorism-affected-country

R. P. N. Gupta, S. Sarswat, V. Chauhan, “Weapon Detection System Using Deep Learning,” Int. J. Innov. Res. Technol., vol. 10, no. 1, 2022, [Online]. Available: https://ijirt.org/publishedpaper/IJIRT160929_PAPER.pdf

S. M. Keerthana, R. Sujitha, and P. Yazhini, “Weapon Detection for Security Using the Yolo Algorithm with Email Alert Notification,” 2024 Int. Conf. Innov. Challenges Emerg. Technol. ICICET 2024, 2024, doi: 10.1109/ICICET59348.2024.10616365.

M. Pullakandam, K. Loya, P. Salota, R. M. R. Yanamala, and P. K. Javvaji, “Weapon Object Detection Using Quantized YOLOv8,” 5th Int. Conf. Energy, Power, Environ. Towar. Flex. Green Energy Technol. ICEPE 2023, 2023, doi: 10.1109/ICEPE57949.2023.10201506.

Mehmet Cubukcu, “Weapon Detection YOLOv8,” Kaggle, [Online]. Available: https://www.kaggle.com/code/mehmetcubukcu/weapon-detection-yolov8

Downloads

Published

2025-06-30

How to Cite

Farhan, A., Shafi, M. A., Gul, M., Fayyaz, S., Kifayat Ullah Bangash, Rehman, B. U., Shahid, H., & Khan, M. K. (2025). Deep Learning-based Weapon Detection using Yolov8. International Journal of Innovations in Science & Technology, 7(2), 1269–1280. Retrieved from https://journal.50sea.com/index.php/IJIST/article/view/1425

Issue

Section

Articles