نظام ذكي لاكتشاف مخالفات الخوذة ولوحات المركبات
Helmet Violation Detection & Number Plate Recognition using YOLO12 + Gemini AI
A real-time traffic safety AI system that detects riders without helmets and extracts vehicle number plates
using YOLO12 and Google Gemini, logging violations and generating structured data for enforcement.
Project Overview
HelmetSecure AI is an advanced traffic monitoring system that combines YOLO12 object detection with Google
Gemini’s vision-language capabilities. The system detects helmet violations, tracks riders in real-time, and
extracts vehicle number plates automatically, enabling smart enforcement and AI-driven road safety solutions.
Key Features
YOLO12 Object Detection
- 🪖 Detects helmet and no-helmet violations accurately.
- 🔴 Detects vehicle number plates in real-time.
Track-by-ID System
- 🆔 Assigns persistent IDs to riders and plates.
- 🔁 Prevents duplicate processing of the same object.
Gemini AI Number Plate Extraction
- 🧠 Uses Gemini Vision Language Model for OCR.
- 📸 Extracts plate text from cropped image regions.
Smart Logging & Performance
- 📝 Logs number plates with timestamps and track IDs.
- ⏱️ Interval-based inference to reduce redundant calls.
- 🧵 Multithreaded Gemini inference for smooth video processing.
Visual Alerts
- 🟡 Yellow Box – No Helmet
- 🔴 Red Box – Number Plate
- 🟢 Green Box – Other detections
Technology Stack
- 🐍 Programming Language: Python
- 🎥 Computer Vision: OpenCV
- 🧠 Object Detection & Tracking: Ultralytics YOLO12
- 🤖 AI OCR & Analysis: LangChain + Gemini Pro
- 🧵 Parallel Processing: Threading
- 🖥️ Visualization & UI: cvzone
- 🔐 Image Encoding: Base64
Use Cases
- 🚔 Traffic Law Enforcement – Detect helmet violations and log plates automatically.
- 📹 Smart Surveillance – Analyze live CCTV feeds for road safety.
- 📊 Traffic Analytics – Maintain structured violation logs.
- 🪖 Helmet Compliance Monitoring – Identify non-compliant riders in real-time.
Conclusion
HelmetSecure AI seamlessly combines real-time object detection with AI-powered number plate extraction. By
integrating YOLO12 and Google Gemini, it delivers a scalable, intelligent, and automated solution for traffic
safety enforcement and smart city surveillance systems.