Countculture
White paper summary · August 2024

Counting by tracking, revisited

A follow-up to Neural networks vs computer vision for counting. It covers how detections are joined into paths, how objects are classified, and why a light computing load matters for solar-powered sites.

Counting starts with paths

To count bikes, scooters and walkers on a shared path, a system follows each object through the area of interest. For every new frame it detects the visible objects, matches them to the paths already in progress, starts new paths and closes finished ones. It also has to cope with objects that are missed in a frame or detected more than once. This framework is decades old and has nothing to do with AI.

Detection without per-site training

A neural network has to be trained to recognise objects at each new location, which means collecting and labelling many images by hand. Even a network trained across many locations is not guaranteed to work well at the next one. Transfer learning and fine tuning reduce the labelling, but the up-front work remains.

Background subtraction keeps an image of the empty scene and finds objects as the difference from it. It configures itself and does not depend on what kind of object is moving, so it works out of the box. A short calibration sets most of the remaining parameters.

Matching detections to paths

Many trackers, including SORT, DeepSORT and StrongSORT, treat matching as a linear sum assignment problem and solve it with the Hungarian algorithm or the Jonker and Volgenant method. That gives a solution, not the only solution. Alternatives include the bottleneck assignment problem and the greedy algorithm, which takes the cheapest pairing first and repeats.

Greedy matching is much faster as the number of objects grows and still gives good results. Countculture’s tracker uses it, and the open-source norfair package has recently moved to it too. More advanced methods keep several hypotheses open or match across several frames, which helps with objects that are hidden, camouflaged against the background or split into fragments.

Classifying what moves

A neural network classifies objects as part of detection. With background subtraction, the object is found first and classified afterwards. Classifying a single object is a much simpler problem than finding every object in a frame, so a small machine learning model is enough. Detection plus classification uses less computing power in total than one network doing both.

Power and hardware

Many neural network methods need GPUs drawing hundreds of watts, which rules them out for solar-powered sites. Quantisation and pruning cut the load at some cost to accuracy, and new AI co-processors use less power for the same work. None comes close to background subtraction with a small classifier: the deployment described in the paper draws about 6 watts in total.

Detection that works for any object means less work before a site goes live, and a load light enough to run on solar.

Read the full white paper.

Get the PDF