Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Same object, next frame
Detecting objects in every frame of a video is not enough: you also need to know that the car in this frame is the same car as in the last one. A tracker keeps a numbered record for each object and updates it frame by frame. It predicts where each object should be next and pairs the new detections with those predictions. The hard moments are when objects cross, hide behind each other or the detector misses them for a few frames. The demo shows two targets crossing while one is hidden. Without a motion prediction, the tracker can lose it or hand its identity to the other target.
Tracking feeds collision avoidance for cars and drones, counts ships and vehicles over time from satellite video, follows a target spacecraft during approach, and tracks space debris across telescope frames.
- 1. A multi-object tracker must keep…
- 2. Tracking-by-detection runs a detector…
- 3. An identity switch happens when…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Setups. Single-object tracking (SOT): one target given by a box in the first frame (SiamFC 2016, SiamRPN++ 2019, OSTrack 2022; SAM 2 tracks masks). Multi-object tracking (MOT): all objects of given classes, which appear and disappear. Also multi-camera tracking and 3D tracking from LiDAR.
- Tracking-by-detection. For each frame: predict every track forward (Kalman filter with constant velocity, A10-8); compute a cost between predicted tracks and detections (1 − IoU, Mahalanobis distance, appearance embedding distance); solve the assignment (Hungarian or greedy); update matched tracks; start tracks from unmatched confident detections; delete tracks unmatched for max_age frames.
- The SORT family. SORT (Bewley et al. 2016): Kalman + IoU + Hungarian. DeepSORT (Wojke et al. 2017): adds re-identification embeddings and gating. ByteTrack (Zhang et al. 2022): a second association with low-score detections, which are often occluded objects. OC-SORT (Cao et al. 2023): corrects the Kalman state after occlusions. BoT-SORT (2022): camera-motion compensation. End-to-end transformers: TrackFormer and MOTR (2022).
- Datasets. MOT17 and MOT20 (pedestrians, MOT20 very crowded); DanceTrack (2022; similar appearance, erratic motion); KITTI and BDD100K (driving); VisDrone and UAVDT (drone video).
- Metrics. MOTA = 1 − (FN + FP + IDSW)/GT (Bernardin and Stiefelhagen 2008), dominated by detection errors; IDF1 (Ristani et al. 2016), the F1 of identity-consistent matches; HOTA (Luiten et al. 2021) = √(DetA · AssA), balancing detection and association.
- 1. SORT associates detections to tracks with…
- 2. ByteTrack's key idea:
- 3. Which metric is dominated by detection errors?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Building and tuning a tracker
Exercise 1.
- A constant-velocity Kalman filter for one axis: predict and update.
- MOTA and IDF1 from error counts.
Practice.
- Start from a strong detector: tracking quality is capped by detection; fine-tune on your domain and keep low-score detections for ByteTrack-style association.
- Motion model: constant velocity in image coordinates is the default; compensate camera motion (BoT-SORT’s GMC) for moving platforms such as drones.
- Appearance: add re-identification embeddings (DeepSORT, StrongSORT) when objects look different and occlusions are long; skip them when objects look alike (DanceTrack), where motion matters more.
- Tune max_age to the longest occlusion you must bridge (frames), the IoU or Mahalanobis gate to the frame rate and speed, and min_hits to suppress short false tracks.
- Evaluate with TrackEval: report HOTA, IDF1 and MOTA together; inspect ID switches at crossings and after occlusions.
- Tools: Ultralytics trackers (ByteTrack, BoT-SORT), BoxMOT, Roboflow supervision; SAM 2 for mask tracking of a few given objects.
from ultralytics import YOLO
model = YOLO("yolo11s.pt")
for r in model.track(source="drone_video.mp4", tracker="bytetrack.yaml", stream=True, conf=0.1):
ids = r.boxes.id # persistent track ids (None until tracks are confirmed)
boxes = r.boxes.xyxy
# bytetrack.yaml: track_high_thresh 0.25, track_low_thresh 0.1, new_track_thresh 0.25, track_buffer 30, match_thresh 0.8- 1. max_age should cover…
- 2. On a moving drone camera, add…
- 3. When all objects look alike, rely more on…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why a motion model preserves identity. Association compares each detection with where each track is expected to be. Without a motion model the expectation is the last position, which lags a moving target by its displacement since then; after a miss of k frames the lag is k times the speed. Once the lag exceeds the box size, IoU with the right detection drops to zero and a nearby target can take the match. A constant-velocity prediction removes the lag for straight motion; the Kalman covariance grows while a track coasts, which gating can use.
Why MOTA hides identity errors. MOTA counts each identity switch once, while every missed object costs one per frame. With thousands of ground-truth boxes and tens of switches, MOTA is set by detection recall; a tracker that hands identities around can still score well. IDF1 counts the frames in which each true object is followed by the track mapped to it, so one switch in the middle of a trajectory can cost half of it.
Low-score detections. Occluded objects are often detected with low confidence. Discarding everything below a high threshold loses them; admitting all of them adds false tracks. ByteTrack only lets low-score detections continue existing tracks (with a stricter IoU), never start new ones, recovering the frames without the false tracks. Whether identities improve depends on whether those low-score boxes belong to the right track.
- 1. Without a motion model, a coasting track lags the target by…
- 2. An identity switch costs MOTA…
- 3. ByteTrack lets low-score detections…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.What do a motion model and low-score association each contribute to tracking through occlusions?
History.
- K. Bernardin and R. Stiefelhagen, “Evaluating multiple object tracking performance: the CLEAR MOT metrics” (2008).
- A. Bewley et al., “Simple online and realtime tracking” (2016): SORT.
- Y. Zhang et al., “ByteTrack: multi-object tracking by associating every detection box” (2022).
- J. Luiten et al., “HOTA: a higher order metric for evaluating multi-object tracking” (2021).
Exercise 2. 3 sequences of 150 frames, 8 pedestrians (12 × 30-pixel boxes) in a 200 × 200 view, 3600 ground-truth boxes in all.
- Motion: about 1.5 pixels per frame with small random turns, bouncing at the borders; a random depth order decides who occludes whom.
- Detections: visible targets score 0.5–1.0 and are missed 5% of the time; a target more than 30% covered by a nearer one scores 0.1–0.5 and is missed 30% of the time; about one false alarm per frame scores 0.1–0.5; box noise 1.5 pixels.
- Trackers: greedy IoU association (≥ 0.3) of detections scoring at least 0.5. (A) no motion model: tracks are expected where last seen. (B) constant-velocity prediction with a smoothed velocity, a simplified alpha–beta filter in place of SORT’s Kalman filter. (C) as B plus a ByteTrack second pass matching low-score detections to unmatched tracks at IoU ≥ 0.5. Tracks survive 10 missed frames and are reported after 2 hits.
| tracker | MOTA | IDF1 | ID switches | misses | false positives |
|---|---|---|---|---|---|
| A: no motion | 0.859 | 0.606 | 82 | 411 | 16 |
| B: constant velocity | 0.878 | 0.708 | 43 | 380 | 17 |
| C: B + low-score pass | 0.887 | 0.706 | 58 | 333 | 17 |
- The motion model mattered most for identity: ID switches roughly halved (82 to 43) and IDF1 rose by 0.10, while MOTA moved by only 0.019. MOTA alone would have hidden the difference.
- The low-score pass did what it promises for detection: misses fell from 380 to 333 and MOTA rose on all three seeds (by 0.009, 0.006 and 0.014), with no extra false positives.
- It did not reliably help identity: IDF1 0.706 against 0.708 here, 0.788 against 0.798 on seed 1 and 0.735 against 0.695 on seed 2; ID switches rose from 43 to 58. Occluded low-score boxes sit next to the occluder and are sometimes attached to the wrong track: a mixed, honest result.
- Seeds 1 and 2: ID switches 102 and 102 (A), 25 and 43 (B), 27 and 47 (C).
- Caveat: greedy rather than Hungarian assignment, simplified motion filter, IDF1 with a greedy identity mapping, and synthetic straight-line motion that favours constant-velocity models.
Object tracking in AI, robotics and aerospace
- Autonomous vehicles and drones: 2D and 3D multi-object tracking feeds prediction and planning; camera-motion compensation is essential on drones.
- Space situational awareness: detecting and linking faint streaks of satellites and debris across telescope frames, with orbital rather than constant-velocity motion models.
- Earth observation video: vehicle and ship tracking in satellite video (for example SkySat and Jilin-1), where objects are a few pixels across.
- Rendezvous: tracking a target spacecraft’s keypoints or features across frames to filter its pose (G2-5).
References
- K. Bernardin and R. Stiefelhagen (2008). “Evaluating multiple object tracking performance: the CLEAR MOT metrics.” EURASIP Journal on Image and Video Processing.
- E. Ristani, F. Solera, R. Zou, R. Cucchiara and C. Tomasi (2016). “Performance measures and a data set for multi-target, multi-camera tracking.” ECCV Workshops.
- A. Bewley, Z. Ge, L. Ott, F. Ramos and B. Upcroft (2016). “Simple online and realtime tracking.” ICIP.
- N. Wojke, A. Bewley and D. Paulus (2017). “Simple online and realtime tracking with a deep association metric.” ICIP.
- J. Luiten et al. (2021). “HOTA: a higher order metric for evaluating multi-object tracking.” IJCV.
- Y. Zhang et al. (2022). “ByteTrack: multi-object tracking by associating every detection box.” ECCV.
- J. Cao et al. (2023). “Observation-centric SORT: rethinking SORT for robust multi-object tracking.” CVPR.
- P. Sun et al. (2022). “DanceTrack: multi-object tracking in uniform appearance and diverse motion.” CVPR.