SAFE-EYE
Real-time violence detection · CNN + LSTM, YOLOv8, Computer Vision
people = yolov8n(frame) # count people clip = last_16_frames # 112×112 p = cnn_lstm(clip) # MobileNetV2 + LSTM if p > 0.75 and people >= 2: alert() violence detected · evidence saved
- Started with a YOLOv8n model trained on a self-curated dataset, then moved to a CNN + LSTM hybrid (MobileNetV2 backbone with an LSTM) that reads 16-frame sequences, because single-frame detection misses motion. YOLOv8n now counts people in the frame.
- Trained on the Real Life Violence Situations and UVFD datasets with a video-level stratified 80/20 split, on Google Colab (Tesla T4).
- Raised the decision threshold from 0.5 to 0.75 and required 2+ people in frame, which cut false positives sharply.
- Built a live OpenCV pipeline with a Flask dashboard that flags violent activity, saves evidence snapshots and works with RTSP/IP cameras.