π Top 15 Finalist β IIT Bombay Techfest 2025 (Safetronics: Road Safety Challenge)
CampusGuard AI is a computer visionβbased system designed to automate traffic monitoring inside university campuses and restricted zones.
Using existing CCTV cameras, the system can:
-
Track vehicles in real time
-
Estimate vehicle speed
-
Detect rule violations such as:
- Over-speeding
- Triple riding on two-wheelers
-
Automatically read license plates
-
Generate violation logs
-
Send SMS alerts to vehicle owners
-
Provide an administrative dashboard for monitoring
The system eliminates the need for expensive hardware such as radar guns or inductive sensors.
Traffic monitoring inside campuses is usually done manually by security personnel.
This creates several issues:
- Human error
- Limited coverage
- High manpower requirement
- Delayed enforcement
- No structured data collection
Most automated traffic systems require overhead cameras or specialized sensors, which are expensive and difficult to install.
CampusGuard AI solves this problem by working with existing side-view CCTV cameras.
The project consists of two independent components:
Processes video feed and detects violations.
Displays results and manages alerts.
Live CCTV Feed
β
βΌ
βββββββββββββββββββββββββββββββ
β CV Engine (Python) β
β YOLOv8 β ByteTrack β
β β β
β Speed Estimation β
β Triple Riding Detection β
β Number Plate Recognition β
βββββββββββββββ¬ββββββββββββββββ
β JSON Log
βΌ
βββββββββββββββββββββββββββββββ
β Django Dashboard β
β Violation records β
β Risk score calculation β
β SMS alerts (Twilio) β
βββββββββββββββββββββββββββββββ
Most traffic systems require overhead cameras. CampusGuard AI works with side-view CCTV using a vector cross-product approach, making it deployable on any existing campus infrastructure.
- Two reference lines
$L_A$ and$L_B$ are defined in the image plane during a one-time calibration - Per frame, the system computes the sign of the cross-product of each tracked vehicle's centroid relative to each line
- A sign change indicates a line-crossing event
- Velocity is then computed as:
where
- Detect all
PersonandMotorcycleinstances per frame via YOLOv8 - Compute the centroid of each
Personbounding box - Check strict spatial containment: is the centroid inside a
Motorcyclebounding box? - If the associated person count exceeds 2 β violation flagged
License plates are detected and read automatically.
Pipeline:
Video Frame
β
YOLOv8 Plate Detection
β
Image Crop + Upscale
β
EasyOCR Text Extraction
β
Regex Validation (Indian format)
β
Plate Number Logged
- Python 3.10+
- OpenCV
- YOLOv8 (Ultralytics)
- ByteTrack (Object tracking)
- EasyOCR
- NumPy
- Django 5.2
- SQLite (development)
- PostgreSQL (scalable deployment)
- Twilio API (SMS alerts)
| Feature | Description |
|---|---|
| Detection model | YOLOv8 (custom trained) |
| Tracking | ByteTrack (maintains vehicle identity) |
| Speed estimation accuracy | ~5.2% error margin |
| Camera requirement | Works with side-view CCTV |
| OCR validation | Indian license plate regex filtering |
| Architecture | Modular & scalable |
Key modules:
speed_estimator.pyβ calculates vehicle speed using geometric crossing logicplate_reader.pyβ extracts license plate text using OCRutils.pyβ risk score calculation and gamification logicmain.pyβ runs real-time CV pipelinedashboard/β Django admin interface
- Python 3.10+
- CUDA-enabled GPU (recommended)
git clone https://github.com/VinitKumarGupta/CampusGuardAI.git
cd campusguardaipip install -r requirements.txtDefine reference lines for speed detection (if using your own test video):
python get_line_coords.pyUpdate generated coordinates inside:
cv_engine/config.py
python cv_engine/main.pycd backend_dashboard
python manage.py runserver- Helmet detection
- Night-time optimization
- Cloud database integration
- Multi-camera synchronization
- Real-time analytics dashboard
- Integration with campus security systems

