VigiLense

AI surveillance and incident response across multiple cameras.

VigiLense watches several camera feeds at once, detects people, fire and smoke in real time, ranks incidents by priority, switches the operator to the most important camera, and logs evidence-backed alerts on a live dashboard.

Type
Final Year Project, Bahria University
My role
Detection lead
Team
3 engineers · Supervisor: Dr. Syed Khawar Hussain Shah
Timeline
2026 – 2027 · In progress
Stack
  • Python
  • PyTorch
  • Ultralytics YOLO
  • OpenCV
  • FastAPI
  • SQLite
  • Google Colab
VigiLense

The problem

Security teams in control rooms watch walls of camera feeds, and the moments that matter, a fire starting or someone entering a restricted area, are easy to miss. Existing systems either record passively or raise so many alerts that operators start ignoring them.

The goal: an assistant that watches every feed continuously, recognises dangerous events, and puts the right camera in front of a human at the right time, with evidence attached.

What I built

  • Fire & smoke detection model fine-tuned from YOLO26n on the public D-Fire dataset, trained on Google Colab GPUs.
  • Multi-camera pipeline that reads three or more feeds (video files, RTSP streams or webcams) and runs one batched detection pass for all of them.
  • Priority scoring that ranks each camera by what it sees and automatically promotes the most critical one to the main view.
  • Incident logging to SQLite with a snapshot image per alert, served on a live web dashboard built with FastAPI.

Architecture

Sources Camera 1 RTSP or webcam Camera 2 Camera 3+ Ingest Reader threads newest frame only Detection Person model pretrained YOLO Fire & smoke model fine-tuned on D-Fire Decide Priority score fire 100 · smoke 60 Cooldown no duplicate alerts Output Incident log SQLite + snapshots Live dashboard FastAPI · auto view
VigiLense architecture

Key decisions

Nano model over a larger one

Surveillance means many feeds on modest hardware. A nano YOLO keeps latency low enough for real-time use, and accuracy can be recovered with better data and thresholds.

Process the newest frame, not every frame

Each camera thread keeps only its latest frame. If detection falls behind, stale frames are skipped, so the dashboard always shows what is happening now.

One batched pass for all cameras

Sending every feed through the model together uses the GPU far better than running each camera separately.

Cooldown on repeated alerts

A 10-second cooldown per camera and label stops one fire from producing hundreds of alerts, which is how real alarm systems lose operators' trust.

Security

  • Camera credentials and RTSP URLs kept out of Git in a .env file
  • Evidence snapshots and incident database excluded from version control
  • Feature-branch workflow with pull requests into main

Results

0.780mAP50 on the fire & smoke test set
0.783precision
0.716recall
3+cameras in one batched pass

What I'd improve next

  • Weapon detection model (guns and knives)
  • Person tracking with ByteTrack and cross-camera re-identification
  • React dashboard with alert history and evidence video clips
  • Raising recall: in a safety system a missed fire costs more than a false alarm