# track-lab: from noisy detections to confirmed tracks, measured

Detection and tracking | 2026 | Python, numpy, scipy, JavaScript, Canvas

Targets too faint for any single frame, noise that looks like targets, labels that arrive late. A reference tracker and a simulator that knows the truth, with every decision measured and runnable in the page.

## Evidence

- Simulator with exact truth; Kalman and IMM; gating; GNN and JPDA; M-of-N and SPRT confirmation; track-before-detect; bearing-only fusion
- Browser simulator checked against the Python reference by a test: pd and pfa to 1e-6, assignment cost equal to scipy's
- Evaluation module written before the tracker, including MOTA, IDF1 and HOTA and their rank stability under corrupted labels
- Confirmation frontier measured on 1.3 hours of data per cell: 24 false tracks per hour at 2.2 s lead time for the strictest policy; the amplitude-aided sequential test sits off the frontier, and the page says why

## Links

- [The pipeline, layer by layer](https://fesenko.ai/demos/track-lab)
- [Live tracker](https://fesenko.ai/demos/track-lab/live)
- [Where simple trackers break](https://fesenko.ai/demos/track-lab/cases)
- [The invisible target](https://fesenko.ai/demos/track-lab/tbd)
- [Bearing-only localisation](https://fesenko.ai/demos/track-lab/fusion)
- [Imperfect ground truth](https://fesenko.ai/demos/track-lab/gt)

## The problem

Every sensor product, whether it listens, radiates or looks, has the same middle: detections come in, tracks go out to an operator. That middle is where field systems fail and it is normally invisible. You cannot see a confirmation policy; you can only read about it. And the field never hands you clean labels: an operator marks a target seconds after it appeared and never marks the one they missed, so every metric computed against those labels is biased.

## What I built

A simulator that knows the truth exactly, so each stage can be measured before real data exists. The signal model is one physical knob: a target of amplitude `A = 10^(SNR/20)` in unit noise, a threshold `tau`, and therefore `pd = Q(tau − A)` and `pfa = Q(tau)` in closed form. On top of it a reference tracker: batched Kalman and IMM filters, chi-square gating, global nearest neighbour on the Hungarian algorithm and a cheap JPDA, M-of-N and Wald's sequential test for confirmation. Then the parts that make the difference in weak-signal work: track-before-detect on image frames, bearing-only localisation with the Cramér-Rao bound and an observability test, and an evaluation module written before the tracker, including a study of which metrics keep ranking trackers correctly when labels are dropped, delayed, offset or sparse.

The pages on this site run a browser port of the reference: the detection model, the Kalman filter, the two- and three-mode IMM, gating, global nearest neighbour and the greedy baseline, both confirmation policies, and the track-before-detect integrator. Tests run the JavaScript under node against the Python: the detection model and the IMM agree to one part in a million, the assignment solver returns the same total cost as scipy's, and the default live run is pinned so an engine edit cannot silently change it. The track-before-detect story on the home page is held to experiment E3 the same way: four thousand of its runs must land inside the experiment's 95 percent intervals.

## Two things I would tell a hiring manager

The product number that matters, false tracks per hour, is decided by the track manager, not by the detector. A detector tuned in isolation optimises the wrong number. And with the amplitude in the sequential test, the detection event carries no separate information: adding `log(pd/pfa)` on top of the amplitude likelihood counts the threshold crossing twice and confirms a track on a single clutter hit. That bug existed in the first version of the spec; a test found it.

## What the experiments measured

Eight experiments, each written so it could have come back with the opposite answer. The confirmation frontier at 9 dB: M-of-N and the amplitude-free sequential test lie on one curve, from 24 false tracks per hour at 2.2 s lead time to 134 per hour at 1.3 s; the amplitude-aided test sits above the frontier at every setting, because under a Gaussian amplitude model two strong noise cells look like a weak target. Track-before-detect at 3 dB per frame: the single-frame detector finds the target in 2 percent of trials, sixteen integrated frames in 85 percent, at matched false alarms, and the measured hypothesis-search penalty is a third of the textbook value. Under labels two seconds late, MOTA, IDF1, HOTA and time to confirm keep their ranking; false tracks per hour does not. The reference tracker runs a hundred targets in 2.4 ms per scan with global nearest neighbour and 12.7 ms with joint probabilistic association and an IMM filter, on a laptop.

Two later experiments test the improved methods against their own failure modes, 200 paired runs per cell at 12 dB. Through a turn at 0.3 rad/s, a Kalman filter tuned for straight flight loses the track in every run; raising its process noise keeps it in 99 percent at the price of accuracy (turn error 4.4 m); an IMM whose turn model matches keeps it in all runs with the lowest error, but a two-mode IMM that knows only one turn direction loses every mirrored turn, and only the three-mode design (straight, left, right) keeps both (99.5 percent). At a turn rate it does not model, 0.5 rad/s, the three-mode IMM keeps 67 percent while a high-noise Kalman filter keeps 99: a model is only as good as the motion it expects. At a 10 degree crossing of two targets, the globally optimal assignment swaps their identities in 31.5 percent of runs against 13 percent for the greedy baseline (paired test p = 2e-6), and joint probabilistic association in none; at 45 and 90 degrees the three tie.