Two interconnected computer vision projects demonstrating end-to-end ML pipeline development: custom CRNN architecture for OCR and multi-model helmet violation detection system.
- CRNN Number Plate Recognition - Custom OCR model built from scratch
- Helmet Detection System - Real-time violation detection using multi-model pipeline
┌─────────────────────────────────────────────────────────────────┐
│ HELMET DETECTION SYSTEM │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────┐
│ Video Input │
└──────────────────┘
│
▼
┌───────────────────────────────┐
│ YOLO Object Detection │
│ (4 Classes) │
│ • Bike │
│ • Person with helmet │
│ • Person without helmet │
│ • Number plate │
└───────────────────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ DeepSort │ │ Violation │
│ Bike Tracking │ │ Detection │
│ (Unique IDs) │ │ (5-frame rule) │
└──────────────────┘ └──────────────────┘
│ │
└─────────┬─────────┘
▼
┌──────────────────┐
│ Number Plate │
│ Detected? │
└──────────────────┘
│ Yes
▼
┌───────────────────────────────┐
│ CRNN OCR Model │
│ (Custom Architecture) │
└───────────────────────────────┘
│
▼
┌──────────────────┐
│ Output │
│ • Annotated │
│ Video │
│ • Evidence │
│ Images │
│ • Plate Text │
└──────────────────┘
Input Image (3, 100, 200)
│
▼
┌─────────────────┐
│ CNN Blocks │ ← Feature Extraction
│ 3 → 64 → 128 │ • 3 Conv blocks
│ → 256 │ • BatchNorm + ReLU
└─────────────────┘ • MaxPooling
│
▼
┌─────────────────┐
│ Reshape to │ ← Prepare for sequence
│ (B, T, C*H) │
└─────────────────┘
│
▼
┌─────────────────┐
│ FC Layer │ ← Dimension reduction
│ 256*H → 128 │ + Dropout (0.5)
└─────────────────┘
│
▼
┌─────────────────┐
│ Bidirectional │ ← Sequence modeling
│ LSTM (2 layers) │ • Hidden: 128
│ │ • Dropout: 0.3
└─────────────────┘
│
▼
┌─────────────────┐
│ Classifier │ ← Character prediction
│ 256 → 63 chars │ (a-z, A-Z, 0-9 + blank)
└─────────────────┘
│
▼
CTC Decoding
│
▼
Output Text
Custom CRNN architecture for number plate OCR.
Features:
- Custom CNN-RNN architecture
- CTC loss for variable-length sequences
- Data augmentation
- ONNX export for deployment
Details:
- Dataset: 456 clean number plate images
- Architecture: 3 CNN blocks + Bi-LSTM + CTC
- Input: 100x200 RGB images
- Output: Alphanumeric text (a-z, A-Z, 0-9)
Results:
- Tested on blurred images
- 56% character accuracy on blur (trained on clean data)
- Demonstrates domain adaptation challenge
Prediction Results:
Sample predictions on test images

Files:
CRNN/
├── model.py
├── train.py
├── test.py
├── export_onnx.py
└── requirements.txt
Usage:
python train.py # Train model
python test.py # Test model
python export_onnx.py # Export to ONNXMulti-model pipeline for automated helmet violation detection.
Features:
- Real-time object detection (4 classes)
- Multi-object tracking
- Violation confirmation (5-frame threshold)
- Evidence collection
- Number plate OCR
Details:
- Detection: YOLO26
- Tracking: DeepSort
- OCR: Custom CRNN
- Classes: Bike, person with/without helmet, number plate
Demo Videos:
Multiple Vehicle Tracking:
DeepSort tracking multiple bikes with unique IDs
output-video-2-al3lbu93-svhofxa2_j1TNeZ7h.1.mp4
output-video-3-23ewmukg_czRNvTTU.mp4
Violation Detection:
Person without helmet detection and tracking
output-video-2-g9jwo6yq-9hdfn38z_uhC742mN.1.mp4
Number Plate OCR:
Real-time number plate recognition
output-video_mvkHB3hx.mp4
System Output:
Evidence collection: bike, person, and number plate crops
Video.Project.2.mp4
Files:
Helmet-Detection/
├── main.py
├── requirements.txt
└── USAGE.md
Usage:
python main.pyOutput:
track_output/HH-MM-SS/
├── bike_1_bike.jpg
├── bike_1_person_no_helmet.jpg
└── bike_1_number_plate.jpg
output_video.mp4 # Annotated video with detections
- Custom CRNN learns clean data effectively
- Multi-model pipeline integration
- DeepSort maintains bike IDs across frames
- ONNX deployment ready
- Domain shift (clean to blur) reduces accuracy
- Small dataset (456 images) limits generalization
- Person-to-bike association needs spatial logic
- CTC loss for variable-length sequences
- Data augmentation strategies
- Multi-model integration
- Domain adaptation importance
- Model deployment (ONNX)
| Category | Technologies |
|---|---|
| Deep Learning | PyTorch, ONNX Runtime, Ultralytics YOLO |
| Computer Vision | OpenCV, PIL, torchvision |
| Tracking | DeepSort |
| ML Tools | scikit-learn, NumPy, matplotlib |
CRNN:
- Train on blurred data for robustness
- Larger dataset (1000+ images)
- Attention mechanisms
- Confidence scores
Helmet Detection:
- Spatial association (distance-based)
- Real-time optimization
- Multi-bike improvements
# Clone repository
git clone https://github.com/Pooja-Vachhad/Helmet_Detection.git
# Install CRNN dependencies
cd CRNN
pip install -r requirements.txt
# Install Helmet Detection dependencies
cd Helmet-Detection
pip install -r requirements.txtMIT License
Note: Experimental project demonstrating CV concepts. Helmet detection uses simplified person-to-bike association for proof-of-concept.