02March 2025 to September 2025GitHub ↗

Conflict & Weapon Detection

A real time, three stage vision pipeline

1280 × 720 videoevery third frameYOLOv8sfinds peoplecheap, runs firstSwin Tinyscores conflictheavy, gatedYOLOv8looks for weaponsheavy, gatedno people: the heavystages never runPer frame: 228 → 104 ms on CPU, 59 → 26 ms on GPU38.4 FPS on an RTX 3060Diagram, not a screenshot

A cascaded pipeline over live 1280 by 720 video. YOLOv8s finds people, a Swin Tiny classifier scores conflict, and a YOLOv8 detector looks for weapons, with the heavy stages gated behind the cheap one.

Period
March 2025 to September 2025
Stack
Python, PyTorch, YOLOv8, Swin Transformer, OpenCV, CUDA
Source
github.com/YdvPrashant/Ultimate_Conflict_Detection ↗

What it took

  1. 2.2×lower per frame latency

    228 to 104 ms on CPU and 59 to 26 ms on GPU, 38.4 FPS on an RTX 3060, by gating the heavy stages behind the cheap one and scoring every third frame.

  2. 0.808PR-AUC on 519 held out videos

    The first model reported 98.4 percent accuracy and I did not believe it. A frame wise split had left 98.5 percent of validation clips inside training. Regrouping with StratifiedGroupKFold on source video, and pruning near duplicate frames from 69,797 to 20,075, gave baselines I can defend: PR-AUC 0.808 and 74.8 percent per video accuracy.

  3. 0.023calibration error, down from 0.065

    The threshold comes from the validation PR curve, at 0.669 precision and 0.850 recall. Temperature scaling cut the calibration error, and perceptual hashing exposed 48.6 percent cross split contamination in the weapon dataset.

Measured

  1. Per frame latency

    Conflict detection, before and after gating the heavy stages. Milliseconds, lower is better.

    CPU

    228 ms before

    104 ms after

    GPU, RTX 3060

    59 ms before

    26 ms after

  2. Accuracy, before and after fixing the split

    The reported number came from a frame wise split that leaked 98.5 percent of validation clips into training. The honest one is per video, on 519 videos the model never saw.

    Reported

    98.4% leaked split

    Honest

    74.8% per video

Next project, 03ctximg →Photo search that runs entirely offline← All work