09 Chapter 09 — Tracking & Identity: Metrics, ReID, and Role Priors
Why 26 IDs on 4 players matters, which metric tells you the truth, and how role priors repair identity
9.1 Detection Is Easy; Identity Is the Problem
Chapter 8 established that finding players is tractable — the court filter cuts 80 raw detections to 23 on the pickleball fixture. The hard problem is keeping those detections belonging to the same person across a rally of crosses, stacking, occlusion, and rugby collision clusters. The book's E02 measured it bluntly: 26 track IDs produced for 4 players in a 30-second doubles clip (measured, ByteTrack at 53 fps on the M4 Max). That number is not a bug report; it is the field's core challenge.
The rugby baseline is worse, and instructively so. E08 (nrl-001 broadcast clip) found 13.2 persons per frame on average but spawned 295 track IDs for roughly 30 distinct people, with a median inter-frame drift of 9.76 px — and that is the median; sprinting players in 25 fps broadcast footage move 30+ px per frame. Any association rule that assumes frame-to-frame box overlap is structurally broken at sport speeds. Pickleball fails differently: the camera is fixed and the court is small, so motion is predictable, but four players converge on the same two square metres at the non-volley zone, and the net band occludes legs exactly when players are closest together. Same disease — fragmented identity — different mechanism.
Every claim downstream — partner spacing, kitchen occupancy, defensive line speed, rally tempo — depends on knowing who is where. A heatmap built from unidentifiable tracks is a heatmap of fragmentation, not of play. A rally-speed profile computed over a track that silently changes identity at the kitchen line is a profile of two half-rallies stitched together. Identity is the join key of the entire analytics spine (§9.11b); this chapter is about making that key survive contact with real footage.
9.2 MOT Metrics: How You Score Defines What You Optimize
Three metrics, three views of one tracking failure:
| Metric | What It Measures | What It Hides |
|---|---|---|
| MOTA | 1 - (misses + FPs + ID switches) / ground-truth count | Localization quality; fragmentation can look fine if switches are rare |
| IDF1 | Harmonic mean of ID precision/recall — charges both fragments of a split | Localization; the fragmentation-sensitive metric (the one that exposes 26 IDs) |
| HOTA | sqrt(DetA × AssA × LocA): detection, association, localization | Nothing — but it is a geometric mean, so a bad association partially hides under good detection |
MOTA's blind spot is arithmetic. All three error terms share one sum, so identity switches are diluted by frame-scaled detection counts. A tracker producing thousands of correct boxes and a handful of switches posts a MOTA in the high 90s while producing unusable identity streams. MOTA is detection-dominated: report it for legacy comparability with older papers, never as the decision metric.
IDF1's insight is fragmentation. IDF1 finds the best global bipartite matching between predicted tracks and ground-truth tracks, then scores identity precision and recall over the matched frames. One identity switch splits a 900-frame ground-truth trajectory into two 450-frame fragments — and only one fragment can match the truth. The other 450 frames are charged entirely as false identity. MOTA charged exactly one switch for the same event. This is why E09's 14→2 switch reduction moved HOTA by 0.17 while MOTA barely twitched, and why fragmentation — not raw switch count — is what destroys downstream sport statistics.
HOTA is the book's primary metric for four reasons. (1) The geometric mean blocks gaming: you cannot buy HOTA with detection alone or association alone. (2) It decomposes, so a regression diagnoses itself — DetA flat with AssA down means the detector is fine and the associator broke; go look at ReID or motion compensation, not the detector weights. (3) It correlates better with human judgment of tracking quality than MOTA or IDF1 (source-backed: Luiten et al.). (4) It is the benchmark standard on SportsMOT and DanceTrack, so the book's numbers sit next to the literature. The scoring harness throughout is TrackEval (MIT, pure Python, seconds on sport-clip ground truth).
| HOTA sub-metric | Measures | Sport failure it catches |
|---|---|---|
| DetA | Per-frame detection quality, identity-blind | Missed players at net overlap; false positives from line judges, ball boys, crowd |
| AssA | Identity consistency over time per matched detection | AssRe↓ = fragmentation (one player, many IDs — the E08 rugby disease, 295 IDs for ~30 people); AssPr↓ = mergers (one ID drifting across two players) |
| LocA | Box localization precision, integrated over thresholds α | Sloppy boxes feeding bad feet positions into the C06 homography — a localization error becomes a court-position error becomes a tactical-stat error |
The HOTA decomposition deserves the chapter's key structural fact (per the verified definitions): DetA penalizes missed and false detections; AssA penalizes wrong associations of matched detections; LocA scores localization. A tracker can keep DetA high while AssA collapses — exactly E02's 26-ID behavior and E08's 295-ID behavior. In both failures the detector was innocent.
ClusteredIDF1 (book construction). "ClusteredIDF1" appears in some texts as a per-cluster variant of IDF1; no literature standard exists by that name as of 2026-08-30. This book defines it as a diagnostic: IDF1 computed within clusters of ground-truth identities rather than globally — per team, per court side, per role pair. The rationale: global IDF1 lets a tracker bank easy frames (the isolated server standing still) while failing the hard cluster (two same-kit teammates converging at the NVZ). In pickleball doubles, ClusteredIDF1 on the four-player set is the metric that predicts whether shot attribution downstream is trustworthy. In rugby, the natural cluster is the ruck: IDF1 computed only over the players inside the collision zone tells you whether the tracker survives the exact event your defensive-line metrics depend on. Define it once here; the C10 event-attribution chapter reuses it.
Practitioner rule: report HOTA + DetA/AssA + IDF1 + ID-switch count in every experiment; MOTA only when comparing to older papers; ClusteredIDF1 whenever the claim is about distinguishing similar players — which in sport is always the actual claim.
9.3 The Tracker Family: Mechanics and License Reality
All five trackers below are tracking-by-detection: boxes in, track IDs out. They differ only in the association cost and the state model — which is why the detector from chapter 8 stays swappable underneath any of them.
| Tracker | Mechanic | License |
|---|---|---|
| SORT | IoU + Kalman; no appearance | GPL-3.0 |
| ByteTrack | IoU + Kalman; dual-threshold (high + low conf) | MIT |
| BoT-SORT | IoU + Kalman + ReID appearance fusion; camera-motion compensation | MIT repo (AGPL via Ultralytics distribution) |
| OC-SORT | Observation-centric: momentum + orientation corrections | MIT |
| DeepOCCSORT | OCC-SORT + ReID | AGPL via BoxMOT |
The mechanics worth internalizing:
- Pure IoU (SORT) assumes frame-to-frame overlap. Rugby broadcast median drift is 9.76 px/frame and sprints exceed 30 px/frame; pickleball lunges at the kitchen line are comparable. IoU-only association is structurally broken at sport speeds — SORT survives only as a teaching baseline, and its GPL-3.0 license disqualifies it from most products anyway.
- Kalman + IoU predicts through small gaps but accumulates hallucinated state during occlusion: the filter keeps extrapolating a player who no longer exists in the frame, then snaps onto whoever reappears. This is the exact failure OC-SORT's observation-centric re-update was built to fix — on re-appearance, re-anchor the state to the observation rather than the prediction.
- ByteTrack's insight is about detection thresholds, not motion. The two-stage association matches high-confidence boxes first, then matches low-confidence boxes to the leftover tracks. A player half-hidden behind the net post produces a weak detection that most trackers discard — and the track dies, and a new ID spawns on re-emergence. ByteTrack's second pass keeps the ID alive. Teach it as: trust the detector's uncertainty, not just its top end.
- BoT-SORT adds the two components that matter for sport: global motion compensation (GMC) for moving cameras, and a ReID embedding fused into the association cost with an exponentially-updated gallery per track. It won the E09 bake-off on pickleball, and its GMC is the load-bearing piece for broadcast rugby.
- OC-SORT is the motion-only repair: observation-centric re-update (ORU), a direction-momentum term in the association cost (OCM), and a second-chance recovery pass (OCR), at 700+ fps on CPU. It is the right choice when motion is wild and appearance is useless — a ruck of 13 identical jerseys.
- DeepOCCSORT makes the appearance weight adaptive per frame: motion dominates when crops are blurry, appearance dominates when motion is ambiguous. The idea is correct; the BoxMOT distribution is AGPL-3.0, which decides most commercial uses before the benchmark does.
GMC quality is a first-class variable, not a checkbox. E14 measured it directly on the rugby clip: framewarp (dense optical-flow) GMC cut spawned IDs from 295 to 286 (+3.1%) over the E08 baseline, while boxshift (sparse feature-matching) GMC made things worse. Two implementations of the same named component moved the metric in opposite directions. When a vendor datasheet says "camera motion compensation: yes," ask which one.
Note also the layered license reality: BoT-SORT's source repo is MIT, but the Ultralytics-distributed version inherits the AGPL-3.0 umbrella. For a product, the license read must happen at the distribution chain, not the paper.
9.3b The Association Problem: Where Identity Lives or Dies
Strip any of these trackers to its core and you find the same object: a cost matrix C where rows are existing tracks, columns are new detections, and each cell prices how plausible it is that detection j continues track i. The Hungarian algorithm then solves the assignment in polynomial time. Everything that distinguishes the trackers is how C is computed:
C(i,j) = λ · appearance_distance(i,j) + (1−λ) · motion_distance(i,j), with gates that set C to infinity for impossible matches (IoU below floor, court-side violation, embedding distance above threshold).
- Motion distance is IoU between the Kalman-predicted box and the detection — cheap, discriminative at short gaps, useless across occlusion.
- Appearance distance is cosine distance between the detection's ReID embedding and the track's EMA gallery embedding — expensive (one CNN forward pass per detection), discriminative across occlusion, noisy when kits match.
- The fusion weight λ is a calibration decision, not a default: fix it on a validation clip from your venue. BoT-SORT's defaults are a sane start; DeepOCCSORT makes λ adaptive per frame; the role priors of §9.7 enter as additive penalties in exactly this matrix.
- ByteTrack's dual threshold is a second association round over the same matrix with low-confidence detections — the only "trick" that directly treats occlusion-induced detection collapse.
Two failure modes live here. Drift capture: after an unresolved occlusion, the EMA gallery follows the wrong player and locks the error in — every subsequent frame makes the wrong identity more confident. Guards: freeze gallery updates while association ambiguity is high (low margin between best and second-best cost), cap the update rate, and let role priors veto impossible identity jumps. Greedy collapse: Hungarian is globally optimal for the cost matrix it is given, but the matrix is only as honest as its gates; a missing gate (no net-line check, no team-side prior) turns two crossing players into a coin flip that the optimizer then commits to permanently.
9.4 The E09 Case Study: What the Bake-Off Really Showed
The bake-off measured ByteTrack vs BoT-SORT on the pb-003 clip (measured, E09):
| Metric | ByteTrack (motion only) | BoT-SORT (motion + ReID) |
|---|---|---|
| HOTA | 0.642 | 0.814 |
| IDF1 | 0.581 | 0.796 |
| Unique IDs | 26 | 6 |
| ID switches | 14 | 2 |
The decomposition told the story. Both trackers consumed the same detector output, so DetA was near-identical; AssA did all the work. The 14 ByteTrack switches clustered at NVZ crossings — the two moments per rally where players from the same team cross paths within a metre of each other and IoU has nothing to say. BoT-SORT's ReID fusion repaired exactly those events: the embedding still knew a red shirt from a grey one when motion did not.
The honest verdict (C20 discipline): the +0.172 HOTA delta is not significant. The design units are clips, not frames — E09 has n=1 clip, 4 players, 900 frames, and frames within a clip are near-duplicates. Even upgrading the comparison to four directional bake-off cells (one per player), a sign test on 4/4 same-direction deltas gives p = 0.125; our simulated per-player deltas [0.071, −0.023, 0.103, 0.116] include a negative, pushing p to 0.3125 (measured simulation, lab/w2_lab_tracking.py). The direction is consistent and mechanistically explained — ReID should help exactly where it helped — but the honest sentence is strong evidence on this footage, not proof across venues. The proper bake-off is §9.10's protocol: 10+ clips, bootstrap by clip, pre-registered ΔHOTA ≥ 0.02.
9.5 ReID Embeddings in Depth
Appearance embeddings convert a person crop into a vector; distance between vectors is "how similar." The practical options, all verified:
- OSNet-512 (MIT, via torchreid) — M4-friendly default; runs at tracker speed on MPS; the BoT-SORT default family.
- BoT / reid-strong-baseline-2048 (MIT) — the BNNeck training recipe (BNNeck separates triplet-loss from ID-loss geometry; plus warmup, label smoothing, random erasing); the accuracy benchmark. Training on M4 is slow — Colab.
- CLIP-ReID-768 (AAAI 2023) — two-stage: learn per-identity text prompts with a frozen CLIP, then train the image encoder; strongest on occluded and ambiguous crops. No LICENSE file found [verify] — cite, don't vendor.
Practice details that decide whether ReID helps or hurts:
- Cosine, normalized, calibrated. Standard sport-tracker practice is cosine distance on L2-normalized embeddings: bounded on [0, 2], composes cleanly with the motion term in the fused cost, works with EMA galleries. Euclidean after normalization is rank-equivalent, but the scale matters when fusing with IoU/Kalman terms — pick cosine, normalize, and fix the fusion weight on a validation clip.
- Appearance drift across lighting. Indoor/outdoor transitions and shadow bands shift embeddings mid-clip. EMA gallery updates drift slowly — which is the feature — but can drift-capture after an unresolved occlusion (§9.3b). Freeze updates under ambiguity; cap the update rate; let priors veto.
- The uniform problem. Generic ReID models are trained on street datasets (Market-1501, MSMT17) where clothing varies freely. Four pickleball players in club kit, or 26 rugby players in two kits, collapse the appearance space: embeddings cluster by team, not by person. This is why fine-tuning on your own crops moves AssA more than any tracker-hyperparameter week — and it is the motivation for ClusteredIDF1: global metrics hide exactly this failure.
- Gallery enrollment per session. The pickleball tractable case: 4 players per court, known in advance. Ten seconds of each player alone in frame at session start builds the day's gallery; role priors do the binding (§9.7). For rugby, jersey OCR is the stronger signal — appearance alone cannot distinguish 13 players in the same kit (§9.8).
9.5b The ID-Switch Problem: Occlusion Is the Mechanism
Every identity switch has a mechanism, and the taxonomy matters because each mechanism has a different fix. The lab's failure taxonomy, annotated per switch:
- Net occlusion (pickleball). The net band occludes legs precisely when both teams crowd the NVZ. Detection confidence collapses (ByteTrack's second pass helps), motion becomes ambiguous (two players converging), and appearance is the only surviving cue — this was 14 of E09's switches before ReID.
- Ruck occlusion (rugby league). A tackle compresses 4-8 same-kit bodies into one blob for 1-3 seconds. No appearance cue survives; only strong motion priors (OC-SORT's momentum) plus position priors (§9.7) and post-hoc jersey reads (§9.8) repair it. E08's 295 spawned IDs are mostly ruck exits: a player enters the ruck as ID 41 and leaves as ID 117.
- Camera pan (broadcast). A fast pan invalidates every Kalman prediction simultaneously; without GMC the tracker mass-respawns IDs. E14's framewarp result (+3.1% fewer IDs) is the partial fix.
- ReID drift. The gallery follows the wrong player after an unresolved occlusion and locks the error in — the only failure mode that gets more confident over time.
- Net-crossing / line-crossing ambiguity. Two players' trajectories cross; the assignment has a coin-flip cell in the cost matrix and commits permanently. A one-line geometric gate (the net-line constraint) converts the coin flip into a deterministic rejection.
9.6 Tracking-by-Detection vs End-to-End
The end-to-end alternative carries identity inside a DETR-style transformer: track queries propagate across frames, no Hungarian step at all. The line is verified plateaued: no MOTRv4/v5 exists (checked 2026-08-30); MOTRv3 (release-fetch supervision to balance the detection/association label conflict) is the latest release; successor directions are MOTIP (recasting tracking as in-context ID prediction, CVPR 2025) and MATR. MOTRv2's gains came from bootstrapping track queries from an external YOLOX — end-to-end in name only; the external detector was load-bearing.
The book's engineering choice remains tracking-by-detection because the chapter-8 detector stays swappable: RF-DETR, DEIM+D-FINE, or YOLO26 plug straight into ByteTrack/BoT-SORT, while end-to-end bakes detection and identity into one non-portable model that needs retraining per sport. Learned association is the frontier worth watching: CAMELTrack (Apache-2.0) replaces the hand-crafted cost matrix with learned tracklet encoders and group-aware feature fusion — online, TBD-modular, HOTA 80.3 on SportsMOT at research time [verify against live leaderboard]; the offline GTA refinement (global tracklet linking with team classification and jersey recognition) pushes the pipeline figure to 81.04 HOTA [verify exact configuration]. Teach CAMELTrack as "the ceiling," BoT-SORT as "the floor you can ship": CAMELTrack needs CUDA-class training, a sport-domain training set, and forfeits the inspectability that makes BoT-SORT debuggable on a Tuesday night.
9.6b The Rugby League 25-Player Problem
Pickleball tracking is a tractable 4-body problem. Rugby league is a different regime entirely, and it is worth naming precisely why:
- Thirteen plus thirteen, plus churn. 26 players on the field, a bench of 4+ per side, and interchange substitutions that change the active identity set mid-match without any visual announcement. The tracker is not maintaining 26 identities; it is maintaining a time-varying set of identities drawn from a roster of ~34. Every substitution is a guaranteed track birth that pure motion/appearance will instead read as a respawned existing track.
- The jersey-swap problem. Numbers 1-17 bind to positions, but interchange and positional swaps churn the binding — a blood-bin replacement can even reuse a number. Any identity system that hard-codes number→player will be confidently wrong by the second half. Roster fusion (§9.8) must treat the binding as time-indexed state, not a lookup table.
- Uniform collapse. Thirteen players per side in identical kit: appearance separates teams, not people. The discriminative cues are number reads, face (rarely resolved in broadcast), body shape, and role geography — fullback deep, wingers on the edges, hooker at the play-the-ball.
- Periodic locality resets. After each tackle, the play-the-ball resets both defensive and attacking lines roughly every 10 seconds. This is the gift: position priors re-tighten on a clock. A tracker that re-anchors identity at each play-the-ball converts an impossible 80-minute tracking problem into 400-odd ten-second ones.
E08 quantified the disease (295 spawned IDs for ~30 distinct people, measured); E14 showed GMC alone is not the cure (+3.1% fewer IDs). The rugby stack that stands a chance is: strong detector → BoT-SORT with framewarp GMC → OC-SORT-style motion priors in the ruck → position priors at each play-the-ball → tracklet-level jersey OCR against the time-indexed roster. Each layer repairs a failure the layer above cannot see.
9.7 Role Priors: The Differentiated Contribution
The most underused signal in sports tracking is what the sport already tells you about identity. Our lab formalizes role priors as soft association penalties — additive terms in the cost matrix of §9.3b, never hard rules. The distinction is load-bearing: hard rules create confident, silent, wrong identities (a referee, a ball boy, or a legal stacking variant violates every spatial rule you can write); soft priors create recoverable ones, because a strong enough motion or appearance cue can still outvote them.
- Pickleball serve-side rule: the server serves from the right court when their team's score is even, left when odd; partners hold fixed serving order within a side-out. Given score tracking (C10) and feet in court coordinates (C06 homography, measured 3.82–4.65 cm RMSE via E05/E11), the server's identity at serve time is determined, not inferred → a cheap identity constraint for doubles.
- Stacking decay window: teams stack so preferred players start on a chosen side after the serve or return; legal stacking variants create a short post-serve migration window (1–2 s), then free movement. So: hard priors at serve time, decaying to motion/ReID within two seconds.
- Net-line constraint: no player's feet cross the net plane mid-rally; the far-side pair and near-side pair can never swap identities through the net. With a fixed camera this is one homography check per frame — it alone would have killed most of E09's 14 ByteTrack switches.
- Rugby jersey number → position prior: the #7 usually sits in the halves, the #9 at the play-the-ball, the #1 deep; the spatial prior resolves proximity ambiguity in a ruck exit, and the play-the-ball reset re-tightens it every ~10 s (§9.6b). Time-index the binding or interchange will poison it.
Applied to E09, the serve-side + net-line constraints would have killed most of the 14 switches at zero model cost — no embedding, no training, one homography lookup. Role priors are the identity fix that does not need a bigger embedding. They are also the chapter's transfer test: the same formalism (soft penalties derived from rules) covers both sports, but the content of the priors is sport-specific — score parity and net planes in pickleball, play-the-ball resets and position geography in rugby. A prior ported blindly across sports is worse than no prior [concept-transfer].
9.8 Identity Resolution via Jersey OCR and Roster Fusion
The escalation path when appearance fails: read the number, then bind to a known roster. The pro pattern (verified from the SoccerNet Game State Reconstruction lineage): reconstruct every person on a 2D pitch minimap with role, team, and jersey number, evaluated by GS-HOTA. Its jersey-recognition sub-task is tracklet-level majority vote — detect digits (DBNet), recognize them (SAR), then vote across every frame of the tracklet, emitting "unknown" if the number is never visible. One frame lies; twenty frames rarely do. Stronger systems use digit-compositional classifiers with Dirichlet uncertainty so a partially visible "1?" does not commit to 13 over 18.
The Sportlogiq-style roster fusion (visual + roster/lineup data) is a proprietary implementation [INFERENCE]; the public-behavior pattern is that identity becomes an assignment problem over ~34 known names constrained by jersey reads, position priors, and lineup state, with human verification closing the residual. For the book, the analogous pickleball path is deliberately boring: no numbered jerseys, but a roster of 4 known people per court — per-session gallery enrollment (§9.5) replaces the jersey read, and serve-time role priors (§9.7) do the binding. Rugby gets the full version: time-indexed roster, tracklet jersey votes, position priors at each reset.
9.9 SAM 2/3 Video: A DIFFERENT Tool
The 2026 addition — DART (chapter 8.12): the SAM 3-class promptable model was the region tool with an O(N) latency problem; DART's shared-backbone trick turns it into a real-time multi-class detector (55.8 AP, ~20ms class-profile). For the tracking chapter the meaning is precise: DART supplies the class-annotated detections the tracker consumes; the tracker still owns identity. The pipeline stays detector → tracker → ReID → role priors; DART only makes the detector open-vocabulary and fast.
The most common category error: "SAM 3 tracks things, why not use it as my tracker?" SAM video is promptable segmentation — masks propagated from a prompt — excellent for isolating the ball or a paddle, not for maintaining identity across a game of interchangeable players. On occlusion and re-entry it can follow the wrong similar object: propagation has no re-identification semantics. Architecture: SAM masks upstream (segment an object region), tracker downstream (maintain identity of the box). Concretely: SAM 2 on the M4 (Apache-2.0, PYTORCH_ENABLE_MPS_FALLBACK, slow CPU fallback documented) is the ball/paddle mask tool — the ball is nearly undetectable frame-by-frame, but one prompt yields a dense propagated mask for trajectory refinement, and masks distill into boxes that feed the real tracker. SAM 3 (Nov 2025, custom SAM license [verify terms], CUDA/Triton-official → Colab) adds promptable concept segmentation — "track all players in white" — which is genuinely useful for rugby clusters; SAM 3.1 (Mar 2026) doubled video throughput. The recipe: SAM 3 PCS on Colab batch-generates player/ball/paddle masks per clip → export boxes → run the identity stack on the M4. Segmentation upstream, identity downstream, priors across both.
9.10 Lab Output (W2.4): The Honest Bake-Off Analysis
The lab re-analyzes E09 with the C20 discipline (artifact: experiments/c09-tracking-honest/outputs/metrics.json):
| Question | Answer (simulated where noted) |
|---|---|
| What did E09 actually measure? | 1 clip, 4 players, 900 frames — design units are clips, not frames |
| Sign test on 4 paired deltas | p ≈ 0.125-0.31 — NOT significant (simulated per-player deltas include a negative: [0.071, −0.023, 0.103, 0.116], p = 0.3125) |
| Would 10 clips settle it? | Simulated: mean delta +0.041, CI [0.004, 0.078] — borderline; 10 clips is the floor, 20 preferable |
| The honest verdict | BoT-SORT's ReID helps on this fixture; whether it is a real improvement is unmeasured |
The multi-clip protocol that closes the gap, as a checklist:
- Clips: 10 clips, stratified — pickleball indoor/outdoor × skill levels; rugby broadcast halves with distinct camera behavior; 30–60 s each. The clip is the resampling unit.
- Ground truth: every player box + persistent ID per frame. Annotation is the bottleneck — SAM-assisted pre-annotation plus human correction ≈ half a day per clip; budget for it or the protocol dies.
- Trackers: ByteTrack, BoT-SORT (framewarp GMC), OC-SORT, DeepOCCSORT — same detector weights for all, so DetA differences are tracker-induced only.
- Metrics: HOTA primary, DetA/AssA decomposition, IDF1, ID-switch count, ClusteredIDF1 per role cluster (per NVZ pair in pickleball, per ruck in rugby). TrackEval throughout.
- Statistics: paired per-clip ΔHOTA; cluster bootstrap by clip (10k resamples) → 95% CI on the mean difference; sign test as the floor — 10/10 same direction gives p ≈ 0.002, which finally licenses the word "significant." Pre-register ΔHOTA ≥ 0.02 as "meaningful."
- Failure taxonomy: every switch annotated by cause (net occlusion, ruck occlusion, camera pan, ReID drift, line-crossing) — the taxonomy, not the leaderboard, tells you which fix to buy.
9.11 What I Would Measure Next
- 10-clip bake-off with bootstrap by clip + pre-registered ΔHOTA ≥ 0.02 (the §9.10 checklist, executed).
- Role-prior repair post-processor on E09: measure switches and ClusteredIDF1 with and without the serve-side, stacking, and net-line priors — the first real numbers on the priors, which today are rule-derived, not measured.
- ReID fine-tune on per-session gallery (Colab; CAMELTrack as the frontier benchmark) — the AssA ceiling with in-domain embeddings is currently unknown.
- E14 follow-up on rugby: framewarp-GMC BoT-SORT plus play-the-ball position priors on nrl-001 — target: spawned IDs within 2× of headcount, not 10×.
- Tracklet jersey OCR baseline on NRL broadcast footage — the SoccerNet GSR pattern transfers conceptually, but broadcast resolutions and fonts differ; no baseline exists yet.
9.11b The One Spine: Track ID as the Join Key
Zoom out to the book's data architecture and this chapter's output is one column. The analytics spine is a chain of joins: detection (frame, box) → track (track_id, frame) → identity (player, track_id) → event (event_id, player, frame) → stats. Every downstream table — partner spacing, kitchen occupancy, rally tempo, defensive line speed — joins on track_id + frame. A fragmented track does not raise an error in that join; it silently splits one player's contribution across two rows, and every aggregate built on it is wrong in proportion to the fragmentation. This is why the chapter insisted on identity metrics over detection metrics: DetA measures whether the spine has rows; AssA and IDF1 measure whether the rows mean anything. It is also why role priors and jersey reads, which look like tracking hacks, are really join-key repair: they re-stitch the foreign key between a person and their measurements. Keep the spine in mind when budgeting effort — a point of AssA is worth more downstream than a point of DetA, because errors in identity propagate through every join while detection errors stay local to a frame.
9.11c The 10 Use Cases: Applied Framework
The use cases below are the applied bridge from tracker mechanics to the two sports. They follow four categories: A. Keeping Identity on the Field (01-03), B. Surviving Occlusion & Ambiguity (04-06), C. Tracking Into the Product (07-09), and D. Proving It Works (10). Each case pairs a pickleball and a rugby league application so the pipeline transfers, and each carries its evidence label: measured (book experiment), source-backed (paper), or [verify] (practitioner model, not yet established).
| Component | Tool (license) | Pickleball use | Rugby league use |
|---|---|---|---|
| Detector feed | C08 detector — RF-DETR / YOLO26 (varies) | 4 players + ball, fixed camera | 13.2 persons/frame broadcast (E08, measured) |
| Tracker — speed tier | ByteTrack (MIT) | CPU-only rally baseline, 53 fps (E02, measured) | Baseline; 295 spawned IDs is the disease (E08) |
| Tracker — default | BoT-SORT (MIT repo; AGPL via Ultralytics) | E09 winner: HOTA 0.814, 2 switches (measured) | Framewarp GMC against broadcast pans (E14) |
| Tracker — motion-only | OC-SORT (MIT) | NVZ crossings when kits match | Ruck exits: momentum where appearance is dead |
| Tracker — adaptive | DeepOCCSORT (AGPL via BoxMOT) | Blur-adaptive fusion, research tier | Same; license decides most commercial uses |
| ReID | OSNet-512 via torchreid (MIT); CLIP-ReID [verify license] | Per-session gallery enrollment, 4 known players | Separates teams, not people; fine-tune on in-domain crops |
| Learned association | CAMELTrack (Apache-2.0) + GTA offline linking [verify config] | Ceiling benchmark, Colab-only training | SportsMOT SOTA line: 80.3 → 81.04 HOTA with GTA |
| Jersey OCR | SoccerNet sn-jersey pattern (tracklet majority vote) | N/A — no numbered jerseys; gallery enrollment instead | Tracklet-level number vote against time-indexed roster |
| Metrics harness | TrackEval (MIT) | HOTA / IDF1 / ClusteredIDF1 per NVZ pair | HOTA / IDF1 / ClusteredIDF1 per ruck |
| Masks upstream | SAM 2 (Apache-2.0); SAM 3 PCS (custom license [verify]) | Ball and paddle masks → boxes for the tracker | Ball-in-ruck masks; segmentation upstream, identity downstream |
Category A: Keeping Identity on the Field (01-03)
UC 01 — Multi-Player Tracking on a Rally (the Tractable Case)
A doubles rally is 20-40 frames of four players converging on the same two square metres at the kitchen line. The mechanism is the full BoT-SORT flow of §9.3: detections from C08, Kalman prediction, and a fused cost C(i,j) = λ·cosine(e_i, e_j) + (1−λ)·(1 − IoU(x̂_i, x_j)) solved by Hungarian assignment each frame, with ByteTrack's low-confidence second pass rescuing occluded detections. On pb-003 this is the measured E09 result: HOTA 0.814, IDF1 0.796, 2 switches across 900 frames — versus ByteTrack's 14 switches at HOTA 0.642 (measured, one clip; the n=1 caveat of §9.4 stands).
Payoff: coaching — rally-speed and partner-spacing stats are only as real as the identities underneath them; this is the cheapest configuration that makes them trustworthy on fixed-camera footage.
UC 02 — 25-Player Tracking with Substitutions
Rugby league is not a 26-body problem; it is a time-varying set problem: an active identity set A_t of 26 drawn from a roster R of ~34, with interchange events as set deltas that arrive without visual announcement. The mechanism: track birth/death management driven by the roster state machine — every substitution is a guaranteed track birth, so a respawned detection near the sideline is matched against the incoming roster member, not the nearest dead track. The binding number→player must be time-indexed, because interchange and blood-bin replacements churn it (§9.6b). E08 measured the disease the roster cures: 295 spawned IDs for ~30 distinct people; E14 showed GMC alone cuts that only 3.1% (measured).
Payoff: officiating and integrity — interchange count, concussion-return windows, and blood-bin timing are compliance facts; getting them from video requires the identity set to be right, not just the boxes.
UC 03 — Long-Term Tracking: Full-Match Persistence
Eighty minutes at 25 fps is 120,000 frames; no online tracker holds identity that long unaided. The mechanism is structural re-anchoring: rugby's play-the-ball resets both lines every ~10 seconds, and each reset is a locality event where position priors re-tighten (§9.6b) — the tracker converts one impossible 80-minute problem into ~400 ten-second ones, with EMA galleries carrying appearance across the boundaries. The offline complement is global tracklet linking (the GTA pattern): after the online pass, link fragments globally using team classification, jersey reads, and appearance — the configuration on record at 81.04 HOTA on SportsMOT [verify exact configuration]. Pickleball's version is the side-out: every serve is a serve-side identity pin (§9.7).
Payoff: tactical — workload, fatigue decay, and positional drift over a full match are the stats coaches actually buy; all of them are integrals over track lifelines, so fragmentation tax compounds across the whole integral.
Category B: Surviving Occlusion & Ambiguity (04-06)
UC 04 — Occlusion Recovery: Bridging the Gap
A ruck compresses 4-8 same-kit bodies into one blob for 1-3 seconds; the pickleball net band does the same to legs at the exact moment of closest approach. The mechanism has three layers. (1) Through the gap, the Kalman filter extrapolates — but only within a gating distance: the Mahalanobis gate d² = (z − Hx̂)ᵀS⁻¹(z − Hx̂) ≤ χ² rejects re-emergence candidates too far from the prediction. (2) On re-appearance, OC-SORT's observation-centric re-update re-anchors the state to the observation instead of the accumulated hallucination. (3) Appearance anchors on both sides of the gap: the EMA gallery before occlusion and the fresh embedding after, matched by cosine distance — with updates frozen while the best/second-best margin is small, so the gallery cannot drift-capture the wrong body (§9.3b).
Payoff: coaching — ruck speed (peel time, roll-away) and kitchen-exchange win rates are measured through the occlusion, so a tracker that dies at the gap can never produce them.
UC 05 — ID-Switch Prevention at the Crossing
The cheapest identity repair in the book is a gate, not a model. When two trajectories cross, the cost matrix contains a coin-flip cell; the mechanism converts the coin flip into a deterministic rejection with rule-derived gates: C(i,j) = ∞ when the match would cross the net plane (one homography check per frame with the fixed camera) or violate serve-side parity at serve time (§9.7). In rugby the equivalent is the jersey-swap guard: number→player bindings are time-indexed, and a detection whose tracklet jersey vote contradicts its track's current binding pays an additive penalty rather than inheriting the identity silently. Applied to E09, the net-line gate alone would have killed most of ByteTrack's 14 switches at zero model cost [verify — rule-derived, the §9.11 post-processor lab produces the first measured number].
Payoff: officiating — shot attribution and tackle attribution are identity statements; every prevented switch is a stat that stays attached to the right player, with no GPU required.
UC 06 — ReID Across Camera Views
Multi-camera coverage (C14 territory) needs identity to survive a view change: the same player leaves CAM A's frame and enters CAM B's from a different angle, under different lighting. The mechanism is cross-view appearance matching: L2-normalized embeddings compared by cosine distance, with same-identity pairs in this footage sitting near 0.1 and different-identity pairs near 0.9 [verify — thresholds are venue-calibrated practitioner values, not universal constants]. Two guards make it work in sport: per-view galleries (embeddings are view-conditional, so match within-view first) and a homography consistency check (the re-appearing feet position must be reachable from the exit position in the shared court frame, C06/C07). The uniform collapse of §9.5 is worse cross-view — team blobs shift differently per camera — so in-domain fine-tuning matters more here than anywhere.
Payoff: broadcast and product — continuous identity across camera cuts is what makes per-player broadcast graphics and multi-angle replay tagging possible (extends C14).
Category C: Tracking Into the Product (07-09)
UC 07 — Track-to-Event Association: The One-Spine Join
Tracking's output is not a video with boxes; it is a column in the analytics spine (§9.11b): detection (frame, box) → track (track_id, frame) → identity (player, track_id) → event (event_id, player, frame). The mechanism is the join itself: every event detector downstream — contact, shot, tackle, fault (C19) — emits events keyed by track_id + frame, and identity resolution maps track_id to player exactly once per track, not once per event. The failure mode is silent: a fragmented track does not error the join, it splits one player's contribution across two rows, and every aggregate is wrong in proportion to the fragmentation. This is why AssA and IDF1 — not DetA — predict downstream stat quality.
Payoff: everyone downstream — this join is why the chapter exists; C19 eventing, C23 tactical ML, and C28 cockpit all consume track_id, and all inherit its fragmentation tax.
UC 08 — Live HUD Tracking Under a Latency Budget
The C28 cockpit wants identity live, not after the match. The constraint is a glass-to-glass budget under ~100 ms: frame capture ~8 ms, detect ~12 ms, track ~3 ms, render ~16 ms leaves headroom for ReID only where it pays. The mechanism is a budgeted pipeline: BoT-SORT at E02's measured 53 fps on the M4 Max fits the window; the ReID forward pass (one CNN call per detection) is the marginal cost, so the live configuration runs appearance fusion only on ambiguous cells — low IoU margin or a gate near-violation — and pure motion on the rest [verify — selective-fusion scheduling is a practitioner pattern, not a published config]. Fixed-camera pickleball needs no GMC, which is the budget line that broadcast rugby spends on framewarp.
Payoff: coaching in-session — live identity turns the cockpit from a replay tool into a during-play tool; the drill correction arrives while the pattern is still on the court.
UC 09 — Tracking Under Broadcast Camera Motion
A fast broadcast pan invalidates every Kalman prediction simultaneously; without compensation the tracker mass-respawns IDs. The mechanism is global motion compensation between frames — estimate the camera's affine warp, apply it to the Kalman state before association — but the E14 measurement is the real lesson: framewarp (dense optical flow) GMC cut spawned IDs 295 → 286 (+3.1%) on nrl-001, while boxshift (sparse feature matching) made things worse (measured). Two implementations of the same datasheet checkbox moved the metric in opposite directions. The C07 calibration feed provides the static-feature correspondences framewarp needs; player-masked flow (the C10 UC-20 pattern) keeps moving bodies out of the camera estimate.
Payoff: product engineering — when a vendor datasheet says "camera motion compensation: yes," this use case is the question to ask back: which estimator, measured on what footage.
Category D: Proving It Works (10)
UC 10 — Track Quality Metrics in Practice
The operational question is never "is the tracker good" but "did this change help, on my footage." The mechanism is the §9.10 protocol run as routine: TrackEval scoring every experiment with HOTA primary and the DetA/AssA decomposition as the self-diagnosis — DetA flat with AssA down means the associator regressed; AssA flat with DetA down means the detector did. Statistics stay honest: paired per-clip ΔHOTA, cluster bootstrap by clip (10k resamples) for the 95% CI, sign test as the floor, ΔHOTA ≥ 0.02 pre-registered as meaningful. And ClusteredIDF1 (§9.2, book construction) answers the question global metrics hide: can the tracker tell apart the two same-kit players who actually meet — per NVZ pair in pickleball, per ruck in rugby.
Payoff: engineering discipline — every other use case in this section is only as trustworthy as this one; the metric harness is what turns tracker choice from taste into measurement.
9.11d Runnable Implementation
The minimal association loop with the chapter's two load-bearing additions — fused motion+appearance cost (§9.3b) and a geometric role-prior gate (§9.7) — is the starting skeleton; the full lab version lives in lab/w2_lab_tracking.py:
import numpy as np
from scipy.optimize import linear_sum_assignment
class SportTracker:
"""BoT-SORT-style association with sport role priors (sections 9.3b, 9.7)."""
def __init__(self, lam=0.5):
self.lam = lam # appearance vs motion fusion — calibrate per venue
self.tracks = {} # track_id -> {kalman, gallery(EMA), last_frame}
def cost(self, trk, det, feet_court=None):
iou_cost = 1.0 - iou(trk["kalman"].predict(), det["box"])
app_cost = cosine_dist(trk["gallery"], det["embedding"]) # L2-normalized
c = self.lam * app_cost + (1 - self.lam) * iou_cost
if feet_court is not None and net_line_violated(trk, feet_court):
return np.inf # UC 05: identity cannot cross the net plane
return c
def update(self, detections, frame_idx, homography=None):
dets = [d for d in detections if d["score"] > 0.5]
C = np.array([[self.cost(t, d, feet_court(d, homography))
for d in dets] for t in self.tracks.values()])
rows, cols = linear_sum_assignment(C) # Hungarian assignment
# ByteTrack second pass: rematch low-score detections to unmatched tracks
# Gallery guard: freeze EMA update while best/second-best margin is small
...
9.11e What This Adds to the Pipeline
These ten use cases are the identity layer applied across the book's five verbs: watching (UC 01-03 keep the identities that C08's detections merely locate), tagging (UC 04-06 repair identity through the occlusions and camera cuts that C19's event detectors cannot see through), modelling (UC 07 is the join that makes C23's tactical ML and C24's simulation trainable on real tracks), interpreting (UC 08-09 carry identity into the C28 cockpit and the C07 broadcast feed under real budgets), and acting (UC 10 is the measurement discipline that decides which of the other nine to ship). Each extends an existing chapter rather than duplicating it — C06/C07 calibration supplies the homographies the gates consume, C12 ball tracking rides the same association machinery at a harder detection regime, C14 multiview owns the camera-rig geometry behind UC 06, and C28 owns the cockpit UC 08 feeds. The honest labels mark which numbers are measured in the book's lab (E02, E08, E09, E14), which are source-backed (HOTA, IDF1, the tracker papers), and which remain practitioner models awaiting the §9.11 labs.
9.12 Sources
- HOTA: Luiten et al., "HOTA: A Higher Order Metric for Evaluating Multi-Object Tracking," IJCV 2021 — https://arxiv.org/abs/2009.07736 ; TrackEval harness (MIT) — https://github.com/JonathonLuiten/TrackEval ; MOTChallenge — https://motchallenge.net/ .
- MOTA: Bernardin & Stiefelhagen, CLEAR MOT, EURASIP J. Image Video Proc. 2008 — https://link.springer.com/article/10.1155/2008/246309 . IDF1: Ristani et al., ECCVW 2016 — https://arxiv.org/abs/1609.01775 .
- Trackers: SORT (GPL-3.0) https://github.com/abewley/sort ; ByteTrack (MIT) https://arxiv.org/abs/2110.06864 ; BoT-SORT (MIT repo; AGPL-3.0 via Ultralytics) https://arxiv.org/abs/2206.14651 ; OC-SORT (MIT) https://arxiv.org/abs/2203.14360 ; DeepOCCSORT via BoxMOT (AGPL-3.0) https://arxiv.org/abs/2302.11813 — licenses verified via GitHub API 2026-08-30.
- ReID: OSNet / torchreid (MIT) https://arxiv.org/abs/1905.00953 ; reid-strong-baseline (MIT) https://arxiv.org/abs/1906.08332 ; CLIP-ReID (no license file [verify]) https://arxiv.org/abs/2211.13977 .
- End-to-end: MOTR line https://github.com/megvii-research/MOTR (no v4/v5 confirmed 2026-08-30); MOTIP https://github.com/MCG-NJU/MOTIP ; CAMELTrack (Apache-2.0) https://arxiv.org/abs/2505.01257 ; GTA refinement [verify primary source].
- SoccerNet Game State Reconstruction / sn-jersey — https://www.soccer-net.org/tasks/game-state-reconstruction , https://github.com/SoccerNet/sn-jersey .
- Meta SAM 2 (Apache-2.0) https://github.com/facebookresearch/sam2 ; SAM 3 (custom SAM license [verify terms], Nov 2025) https://arxiv.org/abs/2511.16719 ; MPS notes per dossiers.
- Lab:
lab/w2_lab_tracking.py→experiments/c09-tracking-honest/outputs/metrics.json. Book-internal evidence: E01, E02, E05, E08, E09, E11, E14 (measured); C06/C07 calibration; C20 statistics discipline.