DeepSORT

Also known as: Deep Simple Online and Realtime Tracking

On this page 7

DeepSORT (Deep Simple Online and Realtime Tracking) is a multi-object tracking algorithm that assigns persistent identities to detected objects across video frames by combining Kalman filter motion prediction with deep appearance embeddings. Computer vision teams use it as a classic tracking-by-detection baseline: an object detector finds objects in each frame, and DeepSORT decides which detection belongs to which existing track.

Published in 2017 as an extension of the original SORT tracker, DeepSORT added a re-identification network that describes how each object looks. This single change sharply reduced identity switches, the errors in which a tracker swaps the labels of two people or vehicles, and made the method a standard component in surveillance, retail analytics and traffic monitoring pipelines.

DeepSORT works online, meaning it processes each frame once and never revisits earlier frames. For every frame it receives a set of bounding boxes from a detector such as YOLO or Faster R-CNN, predicts where each existing track should be, and solves an assignment problem that pairs predictions with new detections.

Each track carries an eight-dimensional state: the box center, aspect ratio, height and their velocities. A constant-velocity Kalman filter propagates this state forward and also produces a covariance, which expresses how uncertain the prediction is. Uncertainty grows every frame a track goes unmatched.

The following table summarizes the main stages that run on every frame.

StageWhat happensOutput
DetectionAn external detector proposes boxes with confidence scoresFiltered boxes
Feature extractionA small CNN embeds each box crop into a 128-dimensional vectorAppearance descriptors
PredictionThe Kalman filter projects every track to the current framePredicted boxes and covariance
Matching cascadeTracks are matched by recency using combined motion and appearance costConfirmed pairs
IoU fallbackRemaining young tracks are matched by box overlapAdditional pairs
Track managementNew tracks start, unmatched tracks age and are deletedUpdated track list
Per-frame processing stages in DeepSORT

The association metric and matching cascade

The core of DeepSORT is its combined association cost. The motion term is the Mahalanobis distance between a detection and a predicted track, which accounts for the uncertainty of the Kalman estimate. The appearance term is the smallest cosine distance between the new embedding and a gallery of up to 100 stored embeddings per track.

Both terms act as gates: a pair is admissible only if the Mahalanobis distance stays below the chi-square 95 percent threshold (about 9.49 for four degrees of freedom) and the cosine distance stays below a tuned limit. In the original configuration the final cost relies almost entirely on appearance, while motion mainly rules out physically implausible matches.

The matching cascade gives priority to tracks that were seen most recently. Tracks unmatched for one frame are assigned first, then those missing for two frames, and so on. This ordering prevents an old, highly uncertain track from stealing a detection that clearly belongs to a fresh one. The Hungarian algorithm solves each assignment step optimally.

The key parameters below control how forgiving the tracker is.

ParameterTypical valueEffect when increased
max_age30 framesTracks survive longer occlusions but ghost tracks linger
n_init3 framesFewer false tracks but slower confirmation
max_cosine_distance0.2 to 0.4More appearance matches and more wrong merges
nn_budget100 embeddingsBetter memory of appearance at higher cost
max_iou_distance0.7Looser overlap matching for unconfirmed tracks
Important DeepSORT parameters and their effects

DeepSORT compared with other trackers

DeepSORT sits between purely geometric trackers and modern joint detection and tracking models. Its main advantage over SORT is robustness to occlusion, because appearance features allow a track to be recovered after the object has been hidden for dozens of frames.

MethodAssociation cueMain strengthMain weakness
SORTIoU with Kalman predictionVery fast and simpleFrequent identity switches
DeepSORTMotion gate plus appearance embeddingRecovers objects after occlusionExtra network cost per box
ByteTrackIoU including low-score boxesHigh recall in crowdsNo appearance memory by default
StrongSORTImproved embeddings and camera motion compensationHigher accuracy on benchmarksHeavier pipeline
FairMOTDetection and embedding from one networkSingle-pass efficiencyHarder to swap detectors
How DeepSORT relates to neighboring tracking methods

In benchmark terms, DeepSORT is usually evaluated on the MOT16 and MOT17 datasets with metrics such as MOTA, IDF1 and HOTA. Newer trackers report higher scores, yet DeepSORT remains widely deployed because it is modular, well understood and easy to tune.

Deploying DeepSORT in practice

Tracking quality depends first on the detector, since DeepSORT cannot track what is never detected. A practical rule is to tune the detection confidence threshold together with tracker settings rather than separately, because missed detections and false positives propagate directly into broken or spurious tracks.

The re-identification model should match the target domain. The original network was trained on a pedestrian dataset, so vehicles, animals or products need a retrained embedding network. Running this network on every box adds latency that scales with the number of objects, which matters on edge devices.

SituationRecommended adjustmentReason
Dense crowdsLower max_cosine_distanceReduces merges between similar people
Long occlusionsRaise max_ageKeeps identities alive behind obstacles
Moving cameraAdd camera motion compensationThe Kalman model assumes a static view
Low frame rateRely more on appearanceMotion predictions become unreliable
Limited computeBatch crops and use a lighter embedderCuts per-object latency
Choosing settings for common deployment situations

Limitations and common failure modes

DeepSORT inherits several structural limitations from its design. Experienced practitioners watch for the following problems:

  • Linear motion assumption: sudden turns or camera shake break the constant-velocity model.
  • Similar appearance: people in uniforms or identical vehicles defeat the embedding and cause swaps.
  • Per-box cost: compute grows linearly with the number of objects in the scene.
  • No global optimization: as an online method it cannot correct earlier mistakes using future frames.
  • Single-camera scope: tracking across cameras requires a separate re-identification system.

A frequent misconception is that DeepSORT itself detects objects. It is strictly an association layer, and its results should always be reported together with the detector that feeds it.

Put simply

Imagine watching a busy train station on video. A detector can spot every person in each frame. But it does not know that the person in one frame is the same person a moment later. DeepSORT solves that problem.

It does two things at once. It guesses where each person will move next, like predicting where a rolling ball will go. It also remembers what each person looks like, such as a red coat or a backpack. When someone walks behind a pillar and reappears, DeepSORT can recognize them and keep the same label. The result is a steady number attached to each person for as long as they stay in view.

In practice

A city transport department wants to count how many cyclists cross a busy intersection and how long they wait at red lights. Engineers mount a fixed camera recording at 25 frames per second and run a YOLO detector on a roadside edge computer. DeepSORT links the detections, with max_age set to 50 frames so cyclists hidden briefly behind buses keep their identities.

Because the default embedding network was trained on pedestrians, the team fine-tunes it on a few thousand labeled cyclist crops from their own footage. After this change, identity switches during bus occlusions drop noticeably in a manually checked sample. The department obtains reliable per-cyclist waiting times and uses them to adjust signal timing at peak hours.