{
  "id": 429352,
  "title": "8th Place Solution: single model with heavy augmentation + tuned threshold",
  "url": "/competitions/hubmap-hacking-the-human-vasculature/discussion/429352",
  "author_name": "rii",
  "post_date": "2023-08-05T06:54:37.551000",
  "votes": 12,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Thanks to Hubmap for hosting such a nice competition and to the many helpful notebooks and discussions.</p>\n<ul>\n<li>Summary<ul>\n<li>Train using all train data with the yolov8x-seg model with strong augmenation</li>\n<li>The threshold for converting mask prob to binary seems to be a key for scores</li></ul></li>\n<li>Training<ul>\n<li>yolov8x-seg model( with settings below) with all train data</li>\n<li>Trained all 3 classes </li>\n<li>2-fold validation <ul>\n<li>fold1: wsi1, 3</li>\n<li>fold2: wsi2, 4</li>\n<li>The key insight for me here was that the optimal value of the mask threshold varies considerably with fold1, 2. For example, in one experiment, the following score were obtained<ul>\n<li>mask_threshold, fold1 val , fold2 val </li>\n<li>0.2, <strong>0.349</strong>, 0.35</li>\n<li>0.5, 0.211, <strong>0.481</strong></li></ul></li>\n<li>Therefore, in final 2 submission, I thought it was a safe bet to choose different thresholds for masks</li></ul></li>\n<li>The yolov8 setup is as follows</li></ul></li>\n</ul>\n<pre><code>\n    \n\n  \n  \n\n  \n  \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n</code></pre>\n<ul>\n<li>Inference<ul>\n<li>image size: 768 (better than 512, why?)</li>\n<li>as noted above, two different thresholds was used<ul>\n<li>thresh 0.5: private <strong>0.56</strong>, public: 0.391</li>\n<li>thresh 0.2: private0.369, public: 0.506</li></ul></li></ul></li>\n<li>Not work for me<ul>\n<li>combined with semantic segmenation</li>\n<li>Training on large image sizes (768, 1024)</li>\n<li>tta(rot90) (a bug in my implementation?)</li></ul></li>\n<li>Did not try<ul>\n<li>Pseudo labeling in instance segmentation model</li>\n<li>Stein augmentation</li>\n<li>WBF</li>\n<li>And many more models</li></ul></li>\n</ul>",
  "messages": [
    {
      "id": 2374685,
      "postDate": "2023-08-05T06:54:37.550Z",
      "content": "<p>Thanks to Hubmap for hosting such a nice competition and to the many helpful notebooks and discussions.</p>\n<ul>\n<li>Summary<ul>\n<li>Train using all train data with the yolov8x-seg model with strong augmenation</li>\n<li>The threshold for converting mask prob to binary seems to be a key for scores</li></ul></li>\n<li>Training<ul>\n<li>yolov8x-seg model( with settings below) with all train data</li>\n<li>Trained all 3 classes </li>\n<li>2-fold validation <ul>\n<li>fold1: wsi1, 3</li>\n<li>fold2: wsi2, 4</li>\n<li>The key insight for me here was that the optimal value of the mask threshold varies considerably with fold1, 2. For example, in one experiment, the following score were obtained<ul>\n<li>mask_threshold, fold1 val , fold2 val </li>\n<li>0.2, <strong>0.349</strong>, 0.35</li>\n<li>0.5, 0.211, <strong>0.481</strong></li></ul></li>\n<li>Therefore, in final 2 submission, I thought it was a safe bet to choose different thresholds for masks</li></ul></li>\n<li>The yolov8 setup is as follows</li></ul></li>\n</ul>\n<pre><code>\n    \n\n  \n  \n\n  \n  \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n</code></pre>\n<ul>\n<li>Inference<ul>\n<li>image size: 768 (better than 512, why?)</li>\n<li>as noted above, two different thresholds was used<ul>\n<li>thresh 0.5: private <strong>0.56</strong>, public: 0.391</li>\n<li>thresh 0.2: private0.369, public: 0.506</li></ul></li></ul></li>\n<li>Not work for me<ul>\n<li>combined with semantic segmenation</li>\n<li>Training on large image sizes (768, 1024)</li>\n<li>tta(rot90) (a bug in my implementation?)</li></ul></li>\n<li>Did not try<ul>\n<li>Pseudo labeling in instance segmentation model</li>\n<li>Stein augmentation</li>\n<li>WBF</li>\n<li>And many more models</li></ul></li>\n</ul>",
      "rawMarkdown": "Thanks to Hubmap for hosting such a nice competition and to the many helpful notebooks and discussions.\n\n- Summary\n  - Train using all train data with the yolov8x-seg model with strong augmenation\n  - The threshold for converting mask prob to binary seems to be a key for scores\n- Training\n    - yolov8x-seg model( with settings below) with all train data\n    - Trained all 3 classes \n    - 2-fold validation \n        - fold1: wsi1, 3\n        - fold2: wsi2, 4\n        - The key insight for me here was that the optimal value of the mask threshold varies considerably with fold1, 2. For example, in one experiment, the following score were obtained\n          - mask_threshold, fold1 val , fold2 val \n          - 0.2, **0.349**, 0.35\n          - 0.5, 0.211, **0.481**\n        - Therefore, in final 2 submission, I thought it was a safe bet to choose different thresholds for masks\n    - The yolov8 setup is as follows\n```yaml\nimgsz=512,\nbatch = 16 * 4\n\nlr0 = 1e-4\nlrf = 1e-2\ncos_lr=True\noptimizer = \"AdamW\"\nclose_mozaic = 10\n\n## augmentations\nhsv_h= 0.015\nhsv_s= 0.7\nhsv_v= 0.4\ndegrees= 45.0\ntranslate= 0.1\nscale= 0.5\nshear= 15.0\nperspective= 0.0\nflipud= 0.5\nfliplr= 0.5\nmosaic= 1.0\nmixup= 1.0/3\ncopy_paste= 1.0/3\n\nmask_ratio=1\n```\n\n- Inference\n  - image size: 768 (better than 512, why?)\n  - as noted above, two different thresholds was used\n        - thresh 0.5: private **0.56**, public: 0.391\n        - thresh 0.2: private0.369, public: 0.506\n- Not work for me\n    - combined with semantic segmenation\n    - Training on large image sizes (768, 1024)\n    - tta(rot90) (a bug in my implementation?)\n- Did not try\n    - Pseudo labeling in instance segmentation model\n    - Stein augmentation\n    - WBF\n    - And many more models\n",
      "votes": 12
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2374685": "Thanks to Hubmap for hosting such a nice competition and to the many helpful notebooks and discussions.\n\n- Summary\n  - Train using all train data with the yolov8x-seg model with strong augmenation\n  - The threshold for converting mask prob to binary seems to be a key for scores\n- Training\n    - yolov8x-seg model( with settings below) with all train data\n    - Trained all 3 classes \n    - 2-fold validation \n        - fold1: wsi1, 3\n        - fold2: wsi2, 4\n        - The key insight for me here was that the optimal value of the mask threshold varies considerably with fold1, 2. For example, in one experiment, the following score were obtained\n          - mask_threshold, fold1 val , fold2 val \n          - 0.2, **0.349**, 0.35\n          - 0.5, 0.211, **0.481**\n        - Therefore, in final 2 submission, I thought it was a safe bet to choose different thresholds for masks\n    - The yolov8 setup is as follows\n```yaml\nimgsz=512,\nbatch = 16 * 4\n\nlr0 = 1e-4\nlrf = 1e-2\ncos_lr=True\noptimizer = \"AdamW\"\nclose_mozaic = 10\n\n## augmentations\nhsv_h= 0.015\nhsv_s= 0.7\nhsv_v= 0.4\ndegrees= 45.0\ntranslate= 0.1\nscale= 0.5\nshear= 15.0\nperspective= 0.0\nflipud= 0.5\nfliplr= 0.5\nmosaic= 1.0\nmixup= 1.0/3\ncopy_paste= 1.0/3\n\nmask_ratio=1\n```\n\n- Inference\n  - image size: 768 (better than 512, why?)\n  - as noted above, two different thresholds was used\n        - thresh 0.5: private **0.56**, public: 0.391\n        - thresh 0.2: private0.369, public: 0.506\n- Not work for me\n    - combined with semantic segmenation\n    - Training on large image sizes (768, 1024)\n    - tta(rot90) (a bug in my implementation?)\n- Did not try\n    - Pseudo labeling in instance segmentation model\n    - Stein augmentation\n    - WBF\n    - And many more models\n"
  }
}