{
  "id": 587410,
  "title": "6th place solution - Ultralytics YOLO ",
  "url": "/competitions/byu-locating-bacterial-flagellar-motors-2025/writeups/yuan-high-tech-6th-place-solution-ultralytics-yolo",
  "author_name": "",
  "post_date": "2025-07-01T01:54:04.657Z",
  "votes": 7,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Thanks to kaggle and everyone. I start by host's sample code, and train several Ultralytics' YOLO models by different configs.</p>\n<h1>Summary</h1>\n<ul>\n<li>Ultralytics YOLO models</li>\n<li>Apply filter for denoise</li>\n<li>More data augmentation</li>\n<li>Thresholding strategy</li>\n<li>External data by <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> </li>\n</ul>\n<h1>Data process</h1>\n<ul>\n<li>Use [z-3, z, z+3] slices as RGB channels input.</li>\n<li>Use hamming window to filter data along the z-axis to perform denoise.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8777d7dbedc2e89fb9abcfe106c6fcbe%2F2025-07-01%20092426.jpg?generation=1751333082738327&amp;alt=media\" alt=\"\"></li>\n</ul>\n<h1>Augmentation</h1>\n<p>Modify ultralytics/data/base.py for more augmentation, like gamma and random size.</p>\n<h1>Thresholding</h1>\n<p>Two strategy, both perform well:</p>\n<ul>\n<li>Thresholding by 56 percentile</li>\n<li>Auto Threshold：<br>\n<code>\ns = np.sort(confidence_score)\n</code><br>\n<code>\nr = [ ( s[i-50] + s[i+50] - 2*s[i] ) for i in range(50, len(s)-200) ]\n</code><br>\n<code>\nconfidence_threshold = s[ np.argmax(r) + 50 ]\n</code></li>\n</ul>\n<h1>Ensemble</h1>\n<p>The private LB score is ensemble by 4 models:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8c7f0c2d11c8eccd6a78c2b7b6afe5f0%2F2025-07-01%20092617.jpg?generation=1751333257096816&amp;alt=media\" alt=\"\"></p>\n<p>Thanks again.</p>",
  "messages": [
    {
      "id": "3237241",
      "postDate": "07/01/2025 01:47:43",
      "content": "<p>Thanks to kaggle and everyone. I start by host's sample code, and train several Ultralytics' YOLO models by different configs.</p>\n<h1>Summary</h1>\n<ul>\n<li>Ultralytics YOLO models</li>\n<li>Apply filter for denoise</li>\n<li>More data augmentation</li>\n<li>Thresholding strategy</li>\n<li>External data by <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> </li>\n</ul>\n<h1>Data process</h1>\n<ul>\n<li>Use [z-3, z, z+3] slices as RGB channels input.</li>\n<li>Use hamming window to filter data along the z-axis to perform denoise.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8777d7dbedc2e89fb9abcfe106c6fcbe%2F2025-07-01%20092426.jpg?generation=1751333082738327&amp;alt=media\" alt=\"\"></li>\n</ul>\n<h1>Augmentation</h1>\n<p>Modify ultralytics/data/base.py for more augmentation, like gamma and random size.</p>\n<h1>Thresholding</h1>\n<p>Two strategy, both perform well:</p>\n<ul>\n<li>Thresholding by 56 percentile</li>\n<li>Auto Threshold：<br>\n<code>\ns = np.sort(confidence_score)\n</code><br>\n<code>\nr = [ ( s[i-50] + s[i+50] - 2*s[i] ) for i in range(50, len(s)-200) ]\n</code><br>\n<code>\nconfidence_threshold = s[ np.argmax(r) + 50 ]\n</code></li>\n</ul>\n<h1>Ensemble</h1>\n<p>The private LB score is ensemble by 4 models:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8c7f0c2d11c8eccd6a78c2b7b6afe5f0%2F2025-07-01%20092617.jpg?generation=1751333257096816&amp;alt=media\" alt=\"\"></p>\n<p>Thanks again.</p>",
      "rawMarkdown": "Thanks to kaggle and everyone. I start by host's sample code, and train several Ultralytics' YOLO models by different configs.\n\n# Summary\n- Ultralytics YOLO models\n- Apply filter for denoise\n- More data augmentation\n- Thresholding strategy\n- External data by @brendanartley \n\n# Data process\n- Use [z-3, z, z+3] slices as RGB channels input.\n- Use hamming window to filter data along the z-axis to perform denoise.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8777d7dbedc2e89fb9abcfe106c6fcbe%2F2025-07-01%20092426.jpg?generation=1751333082738327&alt=media)\n\n# Augmentation\nModify ultralytics/data/base.py for more augmentation, like gamma and random size.\n\n# Thresholding\nTwo strategy, both perform well:\n- Thresholding by 56 percentile\n- Auto Threshold：\n`\ns = np.sort(confidence_score)\n`\n`\nr = [ ( s[i-50] + s[i+50] - 2*s[i] ) for i in range(50, len(s)-200) ]\n`\n`\nconfidence_threshold = s[ np.argmax(r) + 50 ]\n`\n\n# Ensemble\nThe private LB score is ensemble by 4 models:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8c7f0c2d11c8eccd6a78c2b7b6afe5f0%2F2025-07-01%20092617.jpg?generation=1751333257096816&alt=media)\n\nThanks again.",
      "votes": null
    },
    {
      "id": "3239102",
      "postDate": "07/02/2025 13:39:53",
      "content": "<p>Hello, congratulations on your position. I have a question: what is the difference between V12M-3 and V12M-2? Is it just augmentation?</p>",
      "rawMarkdown": "Hello, congratulations on your position. I have a question: what is the difference between V12M-3 and V12M-2? Is it just augmentation?",
      "votes": null
    },
    {
      "id": "3239778",
      "postDate": "07/03/2025 06:16:36",
      "content": "<p>Yes, the difference:</p>\n<p><strong>V12M-2</strong><br>\n    mixup = 0.4,<br>\n    perspective = 0.001,              <br>\n    scale = 0.5,                      <br>\n    box = 2,<br>\n    cls = 1, </p>\n<p><strong>V12M-3</strong><br>\n    mixup = 0.5,<br>\n    perspective = 0.0001,              <br>\n    scale = 0.7,<br>\n    hsv_v = 0.2,                      <br>\n    box = 1,<br>\n    cls = 1, <br>\n    dfl = 1,</p>\n<p>Thanks.</p>",
      "rawMarkdown": "Yes, the difference:\n\n**V12M-2**\n    mixup = 0.4,\n    perspective = 0.001,              \n    scale = 0.5,                      \n    box = 2,\n    cls = 1, \n\n**V12M-3**\n    mixup = 0.5,\n    perspective = 0.0001,              \n    scale = 0.7,\n    hsv_v = 0.2,                      \n    box = 1,\n    cls = 1, \n    dfl = 1,\n\nThanks.",
      "votes": null
    },
    {
      "id": "3246110",
      "postDate": "07/10/2025 10:41:34",
      "content": "<p>Hi, </p>\n<p>Thank you so much for sharing the solution.<br>\nMay I ask what brings you to the idea of the denoising filter ? And how did it improve the result ?</p>\n<p>Best <br>\nLeo</p>",
      "rawMarkdown": "Hi, \n\nThank you so much for sharing the solution.\nMay I ask what brings you to the idea of the denoising filter ? And how did it improve the result ?\n\nBest \nLeo",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3239102,
      "author_name": "justforfun44",
      "author_url": "",
      "post_date": "07/02/2025 13:39:53",
      "content": "<p>Hello, congratulations on your position. I have a question: what is the difference between V12M-3 and V12M-2? Is it just augmentation?</p>",
      "votes": null,
      "replies": [
        {
          "id": 3239778,
          "author_name": "outrunner",
          "author_url": "",
          "post_date": "07/03/2025 06:16:36",
          "content": "<p>Yes, the difference:</p>\n<p><strong>V12M-2</strong><br>\n    mixup = 0.4,<br>\n    perspective = 0.001,              <br>\n    scale = 0.5,                      <br>\n    box = 2,<br>\n    cls = 1, </p>\n<p><strong>V12M-3</strong><br>\n    mixup = 0.5,<br>\n    perspective = 0.0001,              <br>\n    scale = 0.7,<br>\n    hsv_v = 0.2,                      <br>\n    box = 1,<br>\n    cls = 1, <br>\n    dfl = 1,</p>\n<p>Thanks.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3246110,
      "author_name": "yxyyxy",
      "author_url": "",
      "post_date": "07/10/2025 10:41:34",
      "content": "<p>Hi, </p>\n<p>Thank you so much for sharing the solution.<br>\nMay I ask what brings you to the idea of the denoising filter ? And how did it improve the result ?</p>\n<p>Best <br>\nLeo</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3237241": "Thanks to kaggle and everyone. I start by host's sample code, and train several Ultralytics' YOLO models by different configs.\n\n# Summary\n- Ultralytics YOLO models\n- Apply filter for denoise\n- More data augmentation\n- Thresholding strategy\n- External data by @brendanartley \n\n# Data process\n- Use [z-3, z, z+3] slices as RGB channels input.\n- Use hamming window to filter data along the z-axis to perform denoise.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8777d7dbedc2e89fb9abcfe106c6fcbe%2F2025-07-01%20092426.jpg?generation=1751333082738327&alt=media)\n\n# Augmentation\nModify ultralytics/data/base.py for more augmentation, like gamma and random size.\n\n# Thresholding\nTwo strategy, both perform well:\n- Thresholding by 56 percentile\n- Auto Threshold：\n`\ns = np.sort(confidence_score)\n`\n`\nr = [ ( s[i-50] + s[i+50] - 2*s[i] ) for i in range(50, len(s)-200) ]\n`\n`\nconfidence_threshold = s[ np.argmax(r) + 50 ]\n`\n\n# Ensemble\nThe private LB score is ensemble by 4 models:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F933653%2F8c7f0c2d11c8eccd6a78c2b7b6afe5f0%2F2025-07-01%20092617.jpg?generation=1751333257096816&alt=media)\n\nThanks again.",
    "3239102": "Hello, congratulations on your position. I have a question: what is the difference between V12M-3 and V12M-2? Is it just augmentation?",
    "3239778": "Yes, the difference:\n\n**V12M-2**\n    mixup = 0.4,\n    perspective = 0.001,              \n    scale = 0.5,                      \n    box = 2,\n    cls = 1, \n\n**V12M-3**\n    mixup = 0.5,\n    perspective = 0.0001,              \n    scale = 0.7,\n    hsv_v = 0.2,                      \n    box = 1,\n    cls = 1, \n    dfl = 1,\n\nThanks.",
    "3246110": "Hi, \n\nThank you so much for sharing the solution.\nMay I ask what brings you to the idea of the denoising filter ? And how did it improve the result ?\n\nBest \nLeo"
  },
  "source": "meta"
}