Back
Case Study02 / 02~4 min readedited 2024-03

CCTV Analytics for Crime & Crowd Management

Built for Smart India Hackathon 2023 — a government problem statement on public safety monitoring. We reached the finals.

result

Finalist

Smart India Hackathon 2023

streams

simultaneous CCTV feeds

alert dedup

Redis

sliding window deduplication

01

The problem statement

The Ministry of Home Affairs wanted a system that could analyse CCTV footage in real time to detect crowd density spikes, suspicious behaviour, and persons of interest — and alert law enforcement without a human watching every feed.

02

Architecture

Django backend with a Celery worker pool for processing video frames off the main thread. MongoDB for event storage (timestamps, bounding boxes, confidence scores, camera IDs). OpenCV for frame extraction, YOLO for person detection, a separate model for anomaly classification.

The hard part wasn't detection — it was the alert pipeline. Twilio for SMS, WhatsApp Business API for operator notifications. Had to make sure duplicate events (same person, multiple cameras) didn't fire duplicate alerts. Solved it with a Redis-based deduplication window.

03

What broke under pressure

Processing four simultaneous streams in real time on a single machine was too slow — frame queue backed up after about 90 seconds.

Fixed it by dropping to 5fps per stream and batching frames through the model instead of one at a time. Lost some precision on fast motion, which was acceptable for crowd monitoring. The tradeoff was worth it — consistent throughput mattered more than per-frame accuracy at low motion speeds.

04

Result

Finalist. Presented to a panel that included government officials. The deduplication logic and alert pipeline were specifically called out in feedback.