Hello,
Today I'll share how a machine learning project can detect weapons like Pistols, Guns. Knifes etc. This project I developed during my senior design project for my university North South University.
ABSTRACT
In an era where public safety is paramount, the need for rapid and accurate weapon detection systems is critical. This paper presents a model for real-time weapon detection using Convolutional Neural Networks (CNN) and YOLO v8. Aimed at enhancing public safety, the system accurately identifies weapons in real-time video feeds. Extensive testing shows our model's high accuracy and efficiency, making it suitable for deployment in security-sensitive environments.
INTRODUCTION
The increasing security threats worldwide necessitate rapid and accurate weapon detection systems. Traditional
surveillance often fails to provide timely threat identification. Leveraging advancements in deep learning, particularly CNN and the latest YOLO v8, this paper introduces a real-time weapon detection model. Our approach aims to deliver immediate alerts upon weapon identification, enhancing public safety
Interface of Detection
Here you can see how it detect weapon in the interface, Where I'm recording the footage and my friend triggering a gun aside of my head and the system automatically detected it's a weapon.
System Design
Hardware Components:
• Camera: High-resolution IP camera (e.g., Logitech C930e) for capturing video feeds, providing clear images for the detection system.
• Microcontroller: Arduino Uno R3 used to control the motorized camera, trigger alarms, and manage other hardware components.
• Alarm System: Audible alarm, such as a buzzer, to alert nearby individuals and security staff when a weapon is detected.
• GPS Module: To provide location data for the detected weapon, enhancing the information sent in alerts.
• Transmitter: For sending data wirelessly from the detection system to other components or systems.
• LCD Module Display: For displaying real-time status and information from the system.
• Wi-Fi Receiver: Ensures the system can communicate over a network, allowing remote monitoring and alerts.
• Power Supply: A reliable power source to ensure continuous operation of all hardware components.
• PCB Design: A custom-designed printed circuit board to manage connections between all components efficiently.
Software Components:
• Dataset: A diverse collection of weapon and non-weapon images and videos, annotated and augmented for training the model.
• Preprocessing Techniques: Image resizing, normalization, and data augmentation to improve model performance.
• YOLO v8 Model: State-of-the-art object detection model for real-time weapon identification.
• CNN: Convolutional Neural Network for feature extraction and detection.
• SMS Alert System: Integration with messaging API to send alerts to designated contacts.
• Dashboard Interface: Front-end for live monitoring and logging events.
• Programming Languages: Python for model development and integration, and additional languages for the dashboard interface.
• Database Management System: For logging and managing detection events data.
KEY FEATURES
▪ INSTANT WEAPON RECOGNITION:
▪ DETECTS AND IDENTIFIES WEAPONS IMMEDIATELY USING CNN AND YOLO V8.
▪ AUTOMATED ALERT SYSTEM:
▪ SENDS INSTANT MESSAGES WITH CRITICAL DETAILS TO PRE-ASSIGNED CONTACTS, INCLUDING POLICE AND SECURITY PERSONNEL.
▪ ALARM ACTIVATION:
▪ TRIGGERS AN AUDIBLE ALARM TO ALERT NEARBY INDIVIDUALS AND SECURITY STAFF.
▪ MOVABLE CAMERA TRACKING
▪ AUTOMATICALLY TRACKS AND FOCUSES ON THE INDIVIDUAL CARRYING THE WEAPON.
▪ COMPREHENSIVE DASHBOARD:
▪ LOGS DETECTIONS, DISPLAYS ALARM STATUS, AND OFFERS A CONTROL PANEL FOR
SYSTEM MANAGEMENT
How It Works
This is a simple chart to demonstrate the idea how we break down the system using CCTV Cameras by extracting each frame then adding ML algorithm to detect weapons.
Model Training:
This is the main part of the application. How I trained the model for detecting weapons. At first I downloaded so many weapons images from basic Google search and from internets to work on it then images are cropped to have perfect shapes. Since images are downloaded and cropped and resized for train the model Using Yolo V7 so that it has the ability to detect weapons.
How models are made:
A key idea to develop the model.
Resources for Models
All weapons images those downloaded from internet are in one folder. This screenshots taken before putting into model training.
Technologies Behind Our System
RESULT
• Training performance metrics:
• Training accuracy: 98.7%
• Validation accuracy: 97.3%
• Loss curve depicting the convergence of the model during training.