Security cameras record in 4K, and in a picture that size a knife can be just a few dozen dots across. Checking every dot of every frame is too slow. Shrinking the frame makes the knife vanish.
So the system finds the people first, on a shrunken copy of the frame. Each person is then cut out of the original, sharp frame, and the weapon search runs on those cut-outs only. I tried a bigger model early on and it scored no better, so the model stayed mid-sized and my time went into the training pictures. A mid-sized model is also why this runs smoothly on a modest graphics card.
One-frame scares. A shadow or a phone can look like a gun for a single frame. An alarm now needs the same thing to show up for several frames in a row, and each person is followed for a few seconds so the system remembers what it saw.
Mistakes in the training labels. Some weapons had never been marked, and some were marked as the wrong kind. I let the model point at pictures where it disagreed with the label and went through those by hand. A second small model that sees only the cut-out weapon was better at catching rifles marked as guns.
Lots of guns, few bats. The set had far more guns than baseball bats, so bats were found poorly. After evening out the numbers, bats became the best-detected class.
People holding ordinary things. A phone or an umbrella is held much like a weapon. I collected clips from the real cameras of people carrying everyday things and trained on them as “no weapon”. False alarms dropped.
Heat maps that pointed at nothing. I wanted pictures showing where the model looks. The two usual tools gave stripes and blobs away from the weapon, because they were built for older models. The slow way worked: hide one small patch at a time and see how much the model's confidence drops. The maps below were made that way.

