← back to projects

Multi-Object Tracking under Quantization on Embedded Hardware

Edge AI · Jetson · TensorRT · Computer Vision · Thesis

Master’s thesis project (M.Eng. Electrical Engineering, THI Ingolstadt).

Repository: github.com/Arash-Barabadi/MOT-Quantization

What this project asks

When an AI model is made smaller and faster (a process called quantization, going from FP32 to INT8), it becomes less precise. This project asks a specific question:

Does this loss of precision hurt the tracker’s ability to keep people’s identities straight more than it hurts its ability to find people?

The idea: lower precision makes the boxes drawn around people jitter slightly. That jitter may confuse the part of the tracker that decides “this person in frame 2 is the same as that person in frame 1” — causing the tracker to swap their IDs. This project measures whether that identity confusion is worse than the drop in plain detection would predict.

The hardware and tools

The pipeline

The plan

  1. Run the full-precision (FP32) pipeline and measure it — the “before” picture.
  2. Shrink the detector to INT8 and run the exact same test.
  3. Compare: do the identity scores drop more than the detection scores?
  4. Later: recover the lost accuracy, and integrate into a ROS 2 robotics pipeline.

Phase 0 — Full-precision baseline (done)

The complete FP32 pipeline was run and scored on all seven videos. Combined results:

Metric Value What it means
HOTA 36.4 Overall tracking quality
DetA 31.2 How well it finds people
AssA 42.8 How well it keeps identities straight
MOTA 33.4 Classic accuracy score
IDF1 42.7 Identity consistency
IDSW 594 Number of times an ID was swapped

These numbers are the reference point. Every quantized version gets compared against them.

The scores look low on purpose: YOLOv8n is a small, fast model chosen to fit a low-power device. This project is about how much the scores drop under quantization — not about hitting the highest possible score.

Interesting starting point: at full precision, keeping identities straight (AssA 42.8) scores higher than finding people (DetA 31.2). The key question for the next phase was whether INT8 flips this — dragging identity scores down harder than detection scores.

Phase 1 — INT8 quantization: go/no-go test (done)

The detector was exported to ONNX and compiled into three TensorRT engines covering the full precision ladder: FP32, FP16, and INT8 (post-training quantization, calibrated on 700 frames sampled across all seven videos). Each engine ran the identical pipeline and was scored with TrackEval.

Building the ladder this way isolates two separate effects. Comparing the original PyTorch FP32 against the TensorRT FP32 engine checks whether the conversion to TensorRT changes anything on its own. Comparing FP32 → FP16 → INT8 then shows what each step of precision loss costs, with the engine held constant.

Combined results (all seven videos)

Precision HOTA DetA AssA MOTA IDF1 IDSW
FP32 (PyTorch) 36.4 31.2 42.8 33.4 42.7 594
FP32 (TensorRT) 36.6 31.7 42.6 33.8 43.2 610
FP16 (TensorRT) 36.5 31.7 42.3 33.8 43.0 621
INT8 (TensorRT) 28.4 20.6 39.6 22.0 30.3 400

What the numbers say

The TensorRT conversion is harmless. PyTorch FP32 and TensorRT FP32 are identical within noise. The Phase 0 baseline stands.

FP16 is essentially free. Half precision costs almost nothing — every metric sits on top of FP32.

INT8 degrades sharply, but not where the hypothesis predicted. The original expectation was that identity scores (AssA) would drop harder than detection scores (DetA). The data shows the opposite: detection collapsed (DetA 31.7 → 20.6, a 35% relative drop) while association barely moved (AssA 42.3 → 39.6, a 6% drop).

The cause is visible in the sub-metrics: INT8 became recall-starved. Detection recall fell (33.9 → 21.3) while detection precision slightly rose (73.9 → 75.7). In plain terms, INT8 stopped finding people rather than inventing false ones. On a detector that already found only a third of people at full precision, losing recall is devastating.

The apparent stability of association is partly a mirage: with far fewer detections, there are fewer identity decisions to get wrong. ID switches even dropped (610 → 400) — not because tracking improved, but because you cannot swap the identity of a person you never detected.

What this means

The hypothesis — that INT8 hurts identity association disproportionately via box jitter — is not supported in this post-training-quantization regime. Naive INT8 PTQ primarily destroys detection recall, and that detection collapse dominates and masks any association-specific effect.

This is a result, not a dead end. The association effect may still exist, but it is buried under the detection failure and cannot be seen while detection is breaking. Separating the two requires a detection-controlled experiment: feed the tracker identical full-precision detections while quantizing only the internal arithmetic, and test whether association degrades on its own.

Caveat: this is one PTQ calibration, one tracker (ByteTrack), one weak detector. The honest headline is “an association-specific degradation was not observed in this regime,” not “the hypothesis is false.”

Repository structure

The dataset, model files, TensorRT engines, and visualization videos are not stored in the repo (excluded via .gitignore) — they are large and regenerable.

Status