TriNetra: Real-Time Violence Detection System

A CCTV monitoring system that watches live video streams and raises an alert the moment physical violence is detected, with a mobile app for security staff.

Overview

CCTV operators cannot watch every camera at once. TriNetra turns an ordinary RTSP camera feed into an active monitoring system: frames are analysed by a hybrid deep learning model, and anything that looks like physical violence is pushed to a mobile client within seconds.

How it works

  1. Stream ingestion. Cameras connect over RTSP and are pulled with FFmpeg, so no extra hardware is needed on site.
  2. Frame buffering. Extracted frames are queued in Redis, which decouples video ingestion from inference and keeps the pipeline responsive under load.
  3. Spatial features. MobileNetV2 encodes each frame into a compact feature vector.
  4. Temporal modelling. A Bi-LSTM reads the sequence of frame features in both directions and classifies the clip as violent or non-violent.
  5. Alerting. Detections are stored in PostgreSQL and delivered to the React Native app so staff can verify the event.

Architecture

The system is split into four independent microservices: ingestor, inference worker, API and notification service. Each one is packaged as a Docker container, so inference can be scaled horizontally without touching the camera-facing side.

Tech stack

  • ML: TensorFlow, MobileNetV2 (transfer learning), Bi-LSTM
  • Backend: Python, FastAPI, Redis queues, PostgreSQL
  • Video: RTSP, FFmpeg
  • Client: React Native
  • Infrastructure: Docker

Highlights

  • Real-time detection instead of after-the-fact review of recordings.
  • Works with existing IP cameras over RTSP.
  • Queue-based design absorbs bursts of frames without dropping alerts.

TriNetra: Real-Time Violence Detection System

undefined

Author

Bibit Kunwar Chhetri

Posted on

2025-08-01

Licensed under