{
  "id": 371702,
  "title": "Introduction to Tracking with SORT and DeepSORT",
  "url": "/competitions/nfl-player-contact-detection/discussion/371702",
  "author_name": "",
  "post_date": "2022-12-11T18:56:17.279026600Z",
  "votes": 29,
  "comment_count": 2,
  "views": 0,
  "content": "<p>One important aspect of this competition is tracking the player helmets. Most of the top approaches in the previous year's version of this competition used a variation of the SORT algorithm or something similar to it. Here is an overview of this important technique.</p>\n<h1>What is SORT and DeepSORT</h1>\n<p><strong>SORT</strong></p>\n<p>SORT (Simple Online Realtime Tracking) is an approach to object tracking that uses a \"rudimentary combination of familiar techniques such as the Kalman Filter and Hungarian algorithm for the tracking components.\" </p>\n<p>There are 4 main parts to the sort algorithm (I will go into more details later):</p>\n<ol>\n<li>Detection</li>\n<li>Estimation</li>\n<li>Data Association</li>\n<li>Creation and Deletion of Track Identities</li>\n</ol>\n<p>SORT is very effective as it claims to be comparable and even more accurate than state-of-the-art online trackers. Also, it updates at rate of 260 Hz which is over 20x faster than other state-of-the-art trackers.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F7758ea575489f883d516b0aa55bab232%2FSORT%20Algorithm.PNG?generation=1670772980139465&amp;alt=media\" alt=\"\"></p>\n<p><strong>DeepSORT</strong></p>\n<p>DeepSORT is an improvement of the SORT Algorithm. SORT is very precise and accurate; however, it often switches the labels of the objects. DeepSORT is an improvement because it uses a better association metric that allows it to track objects based on appearance, not just velocity and position. In this post I primarily focus on the 4 key elements of SORT listed above as you can always expand a SORT Algorithm to DeepSORT later.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F1e6d2eeae63ea6ab6ba8189cefe77f33%2FDeepSORT%20algorithm.PNG?generation=1670772989944975&amp;alt=media\" alt=\"\"></p>\n<h1>Detection</h1>\n<p>The first step is to detect the objects. For this step, an object detection model is used. </p>\n<p>Common detectors include:</p>\n<ul>\n<li>FrRCNN</li>\n<li>YOLO</li>\n</ul>\n<p>For this competition, it is also important to note that the hosts have stated: \"This year we are also providing baseline helmet detection and assignment boxes for the training and test set. train_baseline_helmets.csv is the output from last year's winning player assignment model.\"</p>\n<p>This means that you can use the provided detections, and they should be very effective already.</p>\n<h1>Estimation Model</h1>\n<p>This step is about propagating a target’s identity into the next frame. Then we can approximate the inter-frame displacements of each object with a linear constant velocity model.</p>\n<p>The state of each target is modelled by the mathematical representation below which uses u (horizontal component) v (vertical component), s (scale area), and r (aspect ratio of the bounding box).</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F5c51b09d9b0dd3bb241ed18c501a5534%2Festimation_model_sort.PNG?generation=1670778266165158&amp;alt=media\" alt=\"\"></p>\n<p>A Kalman Filter can be used to optimize the velocity components.</p>\n<h1>Data Association</h1>\n<p>Using IOU (Intersection over union), a cost matrix is computed by computing the distance between each detected bounding box and the bounding boxes from existing targets. The assignment is solved optimally using the Hungarian algorithm. We also create a threshold IOUmin in which detections are rejected in they are below the threshold.</p>\n<h1>Creation and Deletion of Track Identities</h1>\n<p>The last part is about objects leaving the frame, and new objects coming into frame. Detections with less overlap than IOUmin are considered untracked objects. A parameter Tlost is used to determine the number of frames the object can be beneath IOUmin before being deleted.</p>\n<h1>References</h1>\n<p><a href=\"https://arxiv.org/pdf/1602.00763.pdf\" target=\"_blank\">research paper on SORT</a><br>\n<a href=\"https://learnopencv.com/understanding-multiple-object-tracking-using-deepsort/\" target=\"_blank\">article on SORT and DeepSORT</a><br>\n<a href=\"https://www.mdpi.com/2076-3417/12/3/1319\" target=\"_blank\">images from here</a></p>",
  "messages": [
    {
      "id": "2062139",
      "postDate": "12/11/2022 18:56:17",
      "content": "<p>One important aspect of this competition is tracking the player helmets. Most of the top approaches in the previous year's version of this competition used a variation of the SORT algorithm or something similar to it. Here is an overview of this important technique.</p>\n<h1>What is SORT and DeepSORT</h1>\n<p><strong>SORT</strong></p>\n<p>SORT (Simple Online Realtime Tracking) is an approach to object tracking that uses a \"rudimentary combination of familiar techniques such as the Kalman Filter and Hungarian algorithm for the tracking components.\" </p>\n<p>There are 4 main parts to the sort algorithm (I will go into more details later):</p>\n<ol>\n<li>Detection</li>\n<li>Estimation</li>\n<li>Data Association</li>\n<li>Creation and Deletion of Track Identities</li>\n</ol>\n<p>SORT is very effective as it claims to be comparable and even more accurate than state-of-the-art online trackers. Also, it updates at rate of 260 Hz which is over 20x faster than other state-of-the-art trackers.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F7758ea575489f883d516b0aa55bab232%2FSORT%20Algorithm.PNG?generation=1670772980139465&amp;alt=media\" alt=\"\"></p>\n<p><strong>DeepSORT</strong></p>\n<p>DeepSORT is an improvement of the SORT Algorithm. SORT is very precise and accurate; however, it often switches the labels of the objects. DeepSORT is an improvement because it uses a better association metric that allows it to track objects based on appearance, not just velocity and position. In this post I primarily focus on the 4 key elements of SORT listed above as you can always expand a SORT Algorithm to DeepSORT later.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F1e6d2eeae63ea6ab6ba8189cefe77f33%2FDeepSORT%20algorithm.PNG?generation=1670772989944975&amp;alt=media\" alt=\"\"></p>\n<h1>Detection</h1>\n<p>The first step is to detect the objects. For this step, an object detection model is used. </p>\n<p>Common detectors include:</p>\n<ul>\n<li>FrRCNN</li>\n<li>YOLO</li>\n</ul>\n<p>For this competition, it is also important to note that the hosts have stated: \"This year we are also providing baseline helmet detection and assignment boxes for the training and test set. train_baseline_helmets.csv is the output from last year's winning player assignment model.\"</p>\n<p>This means that you can use the provided detections, and they should be very effective already.</p>\n<h1>Estimation Model</h1>\n<p>This step is about propagating a target’s identity into the next frame. Then we can approximate the inter-frame displacements of each object with a linear constant velocity model.</p>\n<p>The state of each target is modelled by the mathematical representation below which uses u (horizontal component) v (vertical component), s (scale area), and r (aspect ratio of the bounding box).</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F5c51b09d9b0dd3bb241ed18c501a5534%2Festimation_model_sort.PNG?generation=1670778266165158&amp;alt=media\" alt=\"\"></p>\n<p>A Kalman Filter can be used to optimize the velocity components.</p>\n<h1>Data Association</h1>\n<p>Using IOU (Intersection over union), a cost matrix is computed by computing the distance between each detected bounding box and the bounding boxes from existing targets. The assignment is solved optimally using the Hungarian algorithm. We also create a threshold IOUmin in which detections are rejected in they are below the threshold.</p>\n<h1>Creation and Deletion of Track Identities</h1>\n<p>The last part is about objects leaving the frame, and new objects coming into frame. Detections with less overlap than IOUmin are considered untracked objects. A parameter Tlost is used to determine the number of frames the object can be beneath IOUmin before being deleted.</p>\n<h1>References</h1>\n<p><a href=\"https://arxiv.org/pdf/1602.00763.pdf\" target=\"_blank\">research paper on SORT</a><br>\n<a href=\"https://learnopencv.com/understanding-multiple-object-tracking-using-deepsort/\" target=\"_blank\">article on SORT and DeepSORT</a><br>\n<a href=\"https://www.mdpi.com/2076-3417/12/3/1319\" target=\"_blank\">images from here</a></p>",
      "rawMarkdown": "One important aspect of this competition is tracking the player helmets. Most of the top approaches in the previous year's version of this competition used a variation of the SORT algorithm or something similar to it. Here is an overview of this important technique.\n\n# What is SORT and DeepSORT\n\n**SORT**\n\nSORT (Simple Online Realtime Tracking) is an approach to object tracking that uses a \"rudimentary combination of familiar techniques such as the Kalman Filter and Hungarian algorithm for the tracking components.\" \n\nThere are 4 main parts to the sort algorithm (I will go into more details later):\n1. Detection\n2. Estimation\n3. Data Association\n4. Creation and Deletion of Track Identities\n\nSORT is very effective as it claims to be comparable and even more accurate than state-of-the-art online trackers. Also, it updates at rate of 260 Hz which is over 20x faster than other state-of-the-art trackers.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F7758ea575489f883d516b0aa55bab232%2FSORT%20Algorithm.PNG?generation=1670772980139465&alt=media)\n\n**DeepSORT**\n\nDeepSORT is an improvement of the SORT Algorithm. SORT is very precise and accurate; however, it often switches the labels of the objects. DeepSORT is an improvement because it uses a better association metric that allows it to track objects based on appearance, not just velocity and position. In this post I primarily focus on the 4 key elements of SORT listed above as you can always expand a SORT Algorithm to DeepSORT later.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F1e6d2eeae63ea6ab6ba8189cefe77f33%2FDeepSORT%20algorithm.PNG?generation=1670772989944975&alt=media)\n\n# Detection\n\nThe first step is to detect the objects. For this step, an object detection model is used. \n\nCommon detectors include:\n- FrRCNN\n- YOLO\n\nFor this competition, it is also important to note that the hosts have stated: \"This year we are also providing baseline helmet detection and assignment boxes for the training and test set. train_baseline_helmets.csv is the output from last year's winning player assignment model.\"\n\nThis means that you can use the provided detections, and they should be very effective already.\n\n# Estimation Model\n\nThis step is about propagating a target’s identity into the next frame. Then we can approximate the inter-frame displacements of each object with a linear constant velocity model.\n\nThe state of each target is modelled by the mathematical representation below which uses u (horizontal component) v (vertical component), s (scale area), and r (aspect ratio of the bounding box).\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F5c51b09d9b0dd3bb241ed18c501a5534%2Festimation_model_sort.PNG?generation=1670778266165158&alt=media)\n\nA Kalman Filter can be used to optimize the velocity components.\n\n# Data Association\n\nUsing IOU (Intersection over union), a cost matrix is computed by computing the distance between each detected bounding box and the bounding boxes from existing targets. The assignment is solved optimally using the Hungarian algorithm. We also create a threshold IOUmin in which detections are rejected in they are below the threshold.\n\n# Creation and Deletion of Track Identities\n\nThe last part is about objects leaving the frame, and new objects coming into frame. Detections with less overlap than IOUmin are considered untracked objects. A parameter Tlost is used to determine the number of frames the object can be beneath IOUmin before being deleted.\n\n# References\n[research paper on SORT](https://arxiv.org/pdf/1602.00763.pdf)\n[article on SORT and DeepSORT](https://learnopencv.com/understanding-multiple-object-tracking-using-deepsort/)\n[images from here](https://www.mdpi.com/2076-3417/12/3/1319)",
      "votes": null
    },
    {
      "id": "2064174",
      "postDate": "12/13/2022 15:06:39",
      "content": "<p>A great post and good to have the references as well. The images you added are very useful. Thank you for sharing!</p>",
      "rawMarkdown": "A great post and good to have the references as well. The images you added are very useful. Thank you for sharing!",
      "votes": null
    },
    {
      "id": "2085692",
      "postDate": "01/04/2023 10:32:59",
      "content": "<p>Thank you for your clear demonstrations!</p>",
      "rawMarkdown": "Thank you for your clear demonstrations!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2064174,
      "author_name": "marshuu",
      "author_url": "",
      "post_date": "12/13/2022 15:06:39",
      "content": "<p>A great post and good to have the references as well. The images you added are very useful. Thank you for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2085692,
      "author_name": "h0ngxuanli",
      "author_url": "",
      "post_date": "01/04/2023 10:32:59",
      "content": "<p>Thank you for your clear demonstrations!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2062139": "One important aspect of this competition is tracking the player helmets. Most of the top approaches in the previous year's version of this competition used a variation of the SORT algorithm or something similar to it. Here is an overview of this important technique.\n\n# What is SORT and DeepSORT\n\n**SORT**\n\nSORT (Simple Online Realtime Tracking) is an approach to object tracking that uses a \"rudimentary combination of familiar techniques such as the Kalman Filter and Hungarian algorithm for the tracking components.\" \n\nThere are 4 main parts to the sort algorithm (I will go into more details later):\n1. Detection\n2. Estimation\n3. Data Association\n4. Creation and Deletion of Track Identities\n\nSORT is very effective as it claims to be comparable and even more accurate than state-of-the-art online trackers. Also, it updates at rate of 260 Hz which is over 20x faster than other state-of-the-art trackers.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F7758ea575489f883d516b0aa55bab232%2FSORT%20Algorithm.PNG?generation=1670772980139465&alt=media)\n\n**DeepSORT**\n\nDeepSORT is an improvement of the SORT Algorithm. SORT is very precise and accurate; however, it often switches the labels of the objects. DeepSORT is an improvement because it uses a better association metric that allows it to track objects based on appearance, not just velocity and position. In this post I primarily focus on the 4 key elements of SORT listed above as you can always expand a SORT Algorithm to DeepSORT later.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F1e6d2eeae63ea6ab6ba8189cefe77f33%2FDeepSORT%20algorithm.PNG?generation=1670772989944975&alt=media)\n\n# Detection\n\nThe first step is to detect the objects. For this step, an object detection model is used. \n\nCommon detectors include:\n- FrRCNN\n- YOLO\n\nFor this competition, it is also important to note that the hosts have stated: \"This year we are also providing baseline helmet detection and assignment boxes for the training and test set. train_baseline_helmets.csv is the output from last year's winning player assignment model.\"\n\nThis means that you can use the provided detections, and they should be very effective already.\n\n# Estimation Model\n\nThis step is about propagating a target’s identity into the next frame. Then we can approximate the inter-frame displacements of each object with a linear constant velocity model.\n\nThe state of each target is modelled by the mathematical representation below which uses u (horizontal component) v (vertical component), s (scale area), and r (aspect ratio of the bounding box).\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6537187%2F5c51b09d9b0dd3bb241ed18c501a5534%2Festimation_model_sort.PNG?generation=1670778266165158&alt=media)\n\nA Kalman Filter can be used to optimize the velocity components.\n\n# Data Association\n\nUsing IOU (Intersection over union), a cost matrix is computed by computing the distance between each detected bounding box and the bounding boxes from existing targets. The assignment is solved optimally using the Hungarian algorithm. We also create a threshold IOUmin in which detections are rejected in they are below the threshold.\n\n# Creation and Deletion of Track Identities\n\nThe last part is about objects leaving the frame, and new objects coming into frame. Detections with less overlap than IOUmin are considered untracked objects. A parameter Tlost is used to determine the number of frames the object can be beneath IOUmin before being deleted.\n\n# References\n[research paper on SORT](https://arxiv.org/pdf/1602.00763.pdf)\n[article on SORT and DeepSORT](https://learnopencv.com/understanding-multiple-object-tracking-using-deepsort/)\n[images from here](https://www.mdpi.com/2076-3417/12/3/1319)",
    "2064174": "A great post and good to have the references as well. The images you added are very useful. Thank you for sharing!",
    "2085692": "Thank you for your clear demonstrations!"
  },
  "source": "meta"
}