harshil

argus

Spots a fight in CCTV video by watching how people's bodies move, not by looking at the picture.

pre-alphaPython2026-07 → nowsologithub ↗

what
A program that watches security-camera video and raises an alert when one person attacks another.
the hard part
In one still frame, a punch and a high-five look the same. The difference is in the motion, so Argus follows each pair of people over time.
where it is
Early research. It works well in lab tests, but it is not ready for real cameras yet, and the repo says so.

How it works

  1. Find the joints of each person in the frame — wrists, elbows, shoulders, hips. This is called pose estimation — Finding the position of each body joint (wrist, elbow, hip…) of each person in a video frame. The result is a skeleton..
  2. Look at every dyad — A pair of people. Argus scores each pair, because violence is something one person does to another. close enough to touch.
  3. For each pair, measure how they move: how close they are, how fast a hand moves toward the other person’s head or body. All distances are in torso-length (TL) — The distance from mid-shoulder to mid-hip of a person. Argus measures distance and speed in this unit, so a near person and a far person give the same numbers., not pixels, so it works on any camera.
  4. A small model scores each pair, many times per second.
  5. Put the pair scores together into one answer for the scene.

A second, simpler check runs at the same time. It only uses geometry: “will this hand reach that head?”. It fires about 240 ms before a punch lands.

What went wrong

The first trained model scored very well on paper (AUC — A score from 0.5 (random guess) to 1.0 (perfect) for how well a model ranks positive examples above negative ones. 0.970). Then it raised alarms on hugs, handshakes and pats on the back.

I measured why. In the lab dataset I trained on, a hug had a faster wrist than a punch. The actors in that lab held back their punches and swung their arms wide for hugs. So the model learned “a hand moving toward a person = violence”.

I did not change the numbers to fit the lab. I checked real data instead. In motion capture (mocap) — Recordings of body motion from markers or sensors on a real person. More accurate than joints found in video. and in 60 real CCTV clips, punches were fast and calm movement was slow, as expected. Then I trained the model a little more on motion capture. False alarms on calm pairs of people dropped from 50% to 5%.

The full story: In my training data, a hug was faster than a punch.

Design choices

  • Score pairs of people, not frames. Violence is something one person does to another, so the question is “is this person attacking that person?”.
  • A forecast never raises an alarm by itself. People argue and push without fighting. A “fight soon” guess only makes the system watch more closely.
  • Keep skeletons, not video. A skeleton does not show a face. No face recognition, on purpose.
  • Do not tune numbers on fake data. A number tuned until a scripted scene passes proves nothing.

numbers

valuewhatsource
0.970AUC in lab tests (NTU-60). In plain words - it ranks a fight above a normal clip 97 times in 100.README
88.1%of fights caught when false alarms are kept at 3% or less. The goal is 92%, so it is not there yet.README
~240 mshow early the fast check fires, before the punch landsREADME
18.7 vs 8.2how fast wrists move in real CCTV - fights vs normal scenes (torso-lengths per second, median)DECISIONS D19
50% → 5%false alarms on calm pairs of people, after extra training on motion-capture dataDECISIONS D18
344automated testsREADME

explore the code

Explorer 8 parts · tap one
argus/core/pose.py

Finds each person's joints (wrists, elbows, hips…) in every frame, and keeps the same name on the same person from frame to frame. source ↗

argus/core/normalize.py

Measures everything in "torso-lengths" instead of pixels, so a person far from the camera gives the same numbers as a person close to it. source ↗

argus/core/dyad.py

Looks at every pair of people who are close enough to hit each other, and measures 53 things about them, for example how fast a wrist moves toward the other person's head. source ↗

argus/core/heuristic.py

Gives each pair a score with simple fixed rules, no training needed. The browser demo uses this. source ↗

argus/core/model.py

The trained model. It answers two questions for each pair - "is this violence now?" and "will it be in about 3 seconds?". source ↗

argus/core/scene.py

Puts the pair scores together into one answer for the whole scene - a one-on-one fight, a brawl, or a group attacking one person. source ↗

argus/core/params.py

Every number the system depends on, each marked as measured, from physics, or still a guess. source ↗

docs/DECISIONS.md

Every design decision, why it was made, and what would change it. source ↗

read the code

keys

This page reads like any web page. If you use vim, it also works like vim.

move
j / knext / previous line
gg / Gtop / bottom
Ctrl-d / Ctrl-uhalf a page down / up
]] / [[next / previous heading
H / Lprevious / next project or post
act
Enter or gfopen the link on the current line
Kexplain the term on the current line
/ then n / Nsearch this page
:command line: a page name, help, q
Spacemenu: f find, p projects, w writing
Space a / Ctrl-e / Alt-1…4pin a page, list pins, jump to a pin
Ctrl-oback
Escclose, clear search