Countculture
White paper summary · September 2023

Neural networks vs computer vision for counting

Many counting products are sold as AI. This paper looks past the label at how counting systems actually work, and where Countculture’s background subtraction approach differs from neural network detectors.

Every counting system follows paths

To count something, a system needs the path each object took through the field of view, so it can tell whether the object crossed a line or entered a zone. Neural network products and Countculture’s system both work this way. They detect objects in each video frame, then join those detections into paths over time.

The difference between them is the first step: how objects are found in each frame.

Joining detections into paths

Each new frame produces detections that have to be matched to the paths already in progress. This is an assignment problem. A cost is worked out for every possible pairing, and the set of matches with the lowest total cost is chosen. Widely cited systems such as SORT predict where each path should be with a constant velocity model and solve the matching with the Hungarian algorithm. DeepSORT adds a neural network that also scores how similar objects look.

The hard cases are objects arriving and leaving, objects hidden behind others, and partial detections. Countculture’s method handles these directly. This part of the problem comes from control theory and time series statistics, not from AI.

Where the approaches differ

Neural network detectors are trained on large image collections, mostly taken from the height of a standing person or a car. Counting cameras look down from above, so a network usually has to be trained again for each installation. That means collecting video, labelling objects by hand and many hours of GPU time. Performance also drifts as vehicle styles, seasons and weather change, so retraining is ongoing and usually needs its own MLOps pipeline.

Background subtraction learns and maintains an image of the empty scene automatically, and finds objects as the difference from it. It is set with a few parameters chosen from three standard profiles: normal, bright outdoor sun, and queues where people stand still for long periods. A second variant handles changing backgrounds such as automatic doors. The remaining settings are tuned automatically against the manual counts already collected for accuracy reporting, not against hand-drawn boxes.

Judge the counts, not the detector

Research on object detectors usually reports how many detections are correct on competition benchmarks. A buyer needs something different: counts that match what actually happened at their site. Detection errors can be joined into false paths and inflate counts, and missed detections become missed counts. Neural network errors also tend to repeat on similar frames, so seeing an object in more frames does not cancel them out.

The practical advice from the paper is to judge any counting system on counts verified against manual counts at your own sites.

Hardware and power

Neural networks are developed on multiple GPUs. Shrinking them to run on small edge devices, through lower precision, quantisation, pruning or lower image resolution, costs some accuracy along the way. Background subtraction runs at full speed on a low-power single-board computer.

Behind the AI label, most counting systems share the same structure. The real difference is how objects are detected, and what it costs to keep that working.

Read the full white paper.

Get the PDF