← Back to Projects

🗡️ Weapon Detection ML Algorithm

A real-time weapon and threat detection system built with YOLOv8 and OpenCV. Designed to identify weapons and suspicious individuals through live webcam or pre-recorded video footage.


🖼️ Project Sample Images

Weapon Detection 1 Weapon Detection 2

🎥 Project Demo Video

Weapon Detection Demo


📋 Architecture & Overview

This system implements a custom-trained YOLOv8 object detection model combined with an OpenCV video processing pipeline. Designed around a three-tier threat classification hierarchy, the architecture prioritizes low-latency analysis and false-positive mitigation using object tracking and dynamic thresholding.


🎯 Threat Classification Matrix

Class Threat Category Alert Level Visual Indicator
🔫 Gun High Threat Critical Red Banner
🔪 Knife Active Threat Warning Red Banner
🎭 Masked Individual Suspicious Activity Caution Yellow Banner

⚙️ Technical Highlights


📊 Model Evaluation & Performance

Core Strengths

Limitations & Edge Cases

Validation Test Matrix

Testing Environment Gun Detection Knife Detection Masked Person
Local Webcam Operational Operational Operational
CCTV Feed Simulation 50% - 60% Confidence 50% - 60% Confidence 50% - 60% Confidence
Low-Illumination Degraded 50% - 60% Confidence Degraded

🔧 Technical Stack

Component Technology / Framework Application
Core Engine Python 3.13 Primary programming environment
Object Detection YOLOv8 (Ultralytics) Real-time bounding box identification
Video Processing OpenCV Frame capture, manipulation, and rendering
Tracking Algorithm ByteTrack Multi-object tracking consistency
Model Training Google Colab / Roboflow Dataset annotation and training pipeline

🚀 Engineering Roadmap


⚠️ Disclaimer & Discretion

Developed strictly for academic research, prototyping, and engineering portfolio demonstration. Not validated for production deployment in commercial security, public safety, or law enforcement infrastructure.