In recent years, the rise in violent incidents involving firearms and sharp weapons in public spaces has increased the demand for intelligent surveillance systems capable of identifying threats in real time. Traditional CCTV monitoring systems depend heavily on human operators, which often leads to delayed response, fatigue, and missed detections. This paper presents “SafeVision: AI-Based Real-Time Weapon Detection System,” an intelligent surveillance framework that utilizes Artificial Intelligence (AI), Deep Learning, and Computer Vision techniques for automatic weapon detection from live CCTV or webcam feeds. The proposed system employs the YOLOv8 object detection algorithm to identify weapons such as guns, pistols, rifles, and knives with high accuracy and low latency. The system processes video frames in real time and immediately generates alerts whenever a weapon is detected. A Flask-based web interface is integrated to provide live monitoring, detection visualization, and alert notifications. The system improves surveillance efficiency, minimizes human dependency, and enhances public safety by enabling rapid threat response. Experimental analysis demonstrates that the proposed system achieves efficient detection performance under different environmental conditions. The proposed framework can be deployed in public areas such as airports, railway stations, shopping malls, schools, and government organizations to strengthen modern surveillance infrastructure.
Introduction
SafeVision is an AI-powered surveillance system developed to improve public safety by detecting weapons such as guns, rifles, pistols, and knives in real time. Traditional CCTV systems depend on human operators, making monitoring slow, error-prone, and ineffective during emergencies. SafeVision addresses these limitations through automated threat detection using deep learning and computer vision.
Key Features
Uses the YOLOv8 object detection model for accurate weapon recognition.
Processes live CCTV or webcam video streams in real time.
Displays detected weapons with bounding boxes and confidence scores.
Generates instant alerts when a weapon is identified.
Provides a Flask-based web dashboard for monitoring and visualization.
Stores detection logs for future analysis.
Supports multiple cameras and low-latency processing.
Literature Review
Previous studies have used YOLO-based and anchor-free deep learning models for weapon detection in CCTV footage and X-ray security images. Research shows that advanced models such as YOLOv4, YOLOv8, and YOLOx achieve high accuracy and fast detection speeds. However, many existing systems suffer from limited scalability, delayed alerts, and poor real-time performance. SafeVision combines weapon detection, alert generation, and dashboard visualization into a unified platform.
Problem Statement
Current surveillance systems:
Depend heavily on manual monitoring.
Often fail to detect threats quickly.
Perform poorly in crowded, low-light, or occluded environments.
Primarily support post-incident analysis rather than prevention.
Proposed System Architecture
The system consists of:
Video Acquisition – Captures video from CCTV cameras or webcams.
Preprocessing – Prepares frames for analysis.
Weapon Detection – YOLOv8 identifies weapons and assigns confidence scores.
Alert Generation – Sends immediate notifications when threats are detected.
Dashboard Visualization – Displays results via a Flask web interface.
Database Logging – Stores detection records for monitoring and review.
Technologies Used
Software:
Python
YOLOv8
OpenCV
Flask
HTML, CSS, JavaScript
SQLite/MySQL
Hardware:
Intel i5 or higher processor
8 GB RAM minimum
NVIDIA GTX 1650 or better GPU
CCTV cameras or webcams
Experimental Results
Testing showed that SafeVision:
Achieves high weapon detection accuracy.
Processes video in real time with low latency.
Successfully generates alerts and logs detections.
Performs reliably in crowded and low-light environments.
Provides an interactive and user-friendly dashboard.
Conclusion
In recent years, the increasing number of violent incidents involving firearms and dangerous weapons in public spaces has highlighted the importance of intelligent surveillance and real-time threat detection systems. Traditional CCTV surveillance systems mainly depend on continuous human monitoring, which often leads to delayed responses, reduced efficiency, and missed detections due to fatigue and human limitations. Therefore, there is a growing need for automated and AI-powered security systems capable of detecting suspicious activities accurately and instantly. The proposed system, “SafeVision: AI-Based Real-Time Weapon Detection System,” successfully demonstrates the application of Artificial Intelligence, Deep Learning, and Computer Vision technologies in modern surveillance systems. The system utilizes the YOLOv8 object detection model for identifying dangerous weapons such as pistols, rifles, and knives from live CCTV and webcam video feeds with high accuracy and low latency. The integration of OpenCV and Flask technologies enables smooth real-time video processing, dashboard visualization, and intelligent alert generation. The proposed system effectively reduces dependency on manual monitoring by automatically detecting suspicious weapons and generating instant alerts whenever a threat is identified. Bounding boxes and confidence scores displayed on the dashboard improve surveillance visualization and help security personnel respond quickly during emergency situations. The implementation of a logging mechanism also allows storage of detection records for future analysis, monitoring, and investigation purposes. The experimental and simulation results prove that the system performs efficiently under different environmental conditions such as crowded areas, low-light environments, and continuous video surveillance scenarios. The YOLOv8 deep learning model provides fast and accurate detection performance, making the system suitable for real-time public security applications. The modular architecture of the system also ensures scalability and adaptability for deployment across multiple surveillance environments such as airports, railway stations, educational institutions, shopping malls, banks, and government organizations. Furthermore, the integration of AI-driven surveillance technologies helps improve public safety by enabling proactive threat detection instead of traditional post-incident monitoring approaches. The system minimizes response time during emergencies and enhances overall situational awareness through intelligent automated monitoring mechanisms. Overall, the SafeVision system presents an efficient, scalable, and intelligent surveillance solution capable of improving modern public security infrastructure. The project demonstrates how Artificial Intelligence and Deep Learning technologies can transform conventional surveillance systems into smart automated security platforms for preventing dangerous incidents and ensuring safer environments and multi-camera coordination for further improving accuracy, scalability, and real-time threat analysis capabilities.
References
[1] T. Dong, J. Yang, D. Chen, and L. Tan, “Analysis of the Capture Rate of Barrel Weapon Test Based on Laser Screen Velocity Measurement System,” IEEE Access, vol. 9, 2021, DOI: 10.1109/ACCESS.2021.3050235. Available at: https://ieeexplore.ieee.org/document/9317798/
[2] Liu, J. Li, Y. Wang, Y. Yu, L. Guo, Y. Gao, Y. Chen, and F. Zhang, “A Time-Driven Dynamic Weapon Target Assignment Method,” IEEE Access, 2023, DOI: 0.1109/ACCESS.2023.3332513. Available at: https://ieeexplore.ieee.org/document/10316309/
[3] Y. Huang, X. Fu, and Y. Zeng, “Anchor-Free Weapon Detection for X-Ray Baggage Security Images,” IEEE Access, 2022, DOI: 10.1109/ACCESS.2022.3205593. Available at: https://ieeexplore.ieee.org/document/9885033/
[4] M. T. Bhatti, M. G. Khan, M. Aslam, and M. J. Fiaz, “Weapon Detection in Real-Time CCTV Videos Using Deep Learning,” IEEE Access, 2021, DOI: 10.1109/ACCESS.2021.3059170. Available at: https://ieeexplore.ieee.org/document/9353483/
[5] S. Li, X. He, X. Xu, T. Zhao, C. Song, and J. Li, “Weapon-Target Assignment Strategy in Joint Combat Decision-Making Based on Multi-Head Deep Reinforcement Learning,” IEEE Access, 2023, DOI: 10.1109/ACCESS.2023.3324193. Available at: https://ieeexplore.ieee.org/document/10283838/
[6] J. Ruiz-Santaquiteria, A. Velasco-Mata, N. Vallez, G. Bueno, J. Á. Álvarez-García, and O. Deniz, “Handgun Detection Using Combined Human Pose and Weapon Appearance,” IEEE Access, 2021, DOI: 10.1109/ACCESS.2021.3110335. Available at: https://ieeexplore.ieee.org/document/9529187/
[7] Y. You, J. Wang, Z. Yu, Y. Sun, Y. Peng, S. Zhang, S. Bian, E. Wang, and W. Wu, “A Fine-Grained Detection Network Model for Soldier Targets Adopting Attack Action,” IEEE Access, 2024, DOI: 10.1109/ACCESS.2024.3436709. Available at: https://ieeexplore.ieee.org/document/10620266/
[8] L. Kong, J. Wang, and P. Zhao, “YOLO-G: A Lightweight Network Model for Improving the Performance of Military Targets Detection,” IEEE Access, 2022, DOI: 10.1109/ACCESS.2022.3177628. Available at: https://ieeexplore.ieee.org/document/9780377/
[9] Y. Ouyang, X. Wang, R. Hu, H. Xu, and F. Shao, “Military Vehicle Object Detection Based on Hierarchical Feature Representation and Refined Localization,” IEEE Access, 2022, DOI: 10.1109/ACCESS.2022.3207153. Available at: https://ieeexplore.ieee.org/document/9893824/
[10] Z. Chen, Z. Zhou, L. Zhang, C. Cui, and J. Zhong, “Mission Reliability Modeling and Evaluation for Reconfigurable Unmanned Weapon System-of-Systems Based on Effective Operation Loop,” Journal of Systems Engineering and Electronics, 2023, DOI: 10.23919/JSEE.2023.000082. Available at: https://ieeexplore.ieee.org/document/10185011/