{
  "id": 354757,
  "title": "[171st solution] How far could I go with the UNeXt50 baseline?",
  "url": "/competitions/hubmap-organ-segmentation/discussion/354757",
  "author_name": "Nghi Huynh",
  "post_date": "2022-09-23T17:04:26.861000",
  "votes": 10,
  "comment_count": 0,
  "views": 0,
  "content": "<p>First of all, I would like to thank the organizers and Kaggle team for hosting this competition, and congratulate to all the winners! I also want to thank <a href=\"https://www.kaggle.com/thedevastator\" target=\"_blank\">@thedevastator</a>, <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a>, <a href=\"https://www.kaggle.com/jamesphoward\" target=\"_blank\">@jamesphoward</a>, <a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a>, <a href=\"https://www.kaggle.com/kingjohnson\" target=\"_blank\">@kingjohnson</a> and many other Kagglers for their discussions and contributions. I've been inspired a lot by their insightful discussions and valuable contributions to this competition.</p>\n<hr>\n<p>I've seen many discussions related to training on tiles vs non-tiles and how it affects the public LB. So, I was curious and decided to do some experiments based on these data settings. I used the <a href=\"https://www.kaggle.com/code/thedevastator/training-fastai-baseline\" target=\"_blank\">UNeXt50 baseline</a> provided by <a href=\"https://www.kaggle.com/thedevastator\" target=\"_blank\">@thedevastator</a> for all my experiments. </p>\n<p>Here is my methodology in detail: <a href=\"https://www.kaggle.com/code/nghihuynh/hubmap-hpa-methodology-submission\" target=\"_blank\">HuBMAP_HPA methodology</a></p>\n<hr>\n<p><strong>Data</strong>: </p>\n<ul>\n<li>Prepare tile dataset using <a href=\"https://www.kaggle.com/code/nghihuynh/wsi-preprocessing-tiling-tissue-segmentation\" target=\"_blank\">Otsu and Triangle thresholding</a> to remove a large portion of background vs non-FTUs tissue.</li>\n<li>Prepare <a href=\"https://www.kaggle.com/code/nghihuynh/wsi-hubmap-dataset-creation-256x256\" target=\"_blank\">non-tile dataset</a> by cropping the tissue area and rescaling to 256x256, and 512x512</li>\n</ul>\n<p><strong>Data augmentation</strong>: heavy data augmentation pipeline including morphology and color changes</p>\n<p><strong>Model architecture</strong>: UNeXt50 baseline</p>\n<p><strong>Training setup</strong>: </p>\n<ul>\n<li>Cross-validation: Stratified K-Fold to select training images based on organs. (4 folds)</li>\n<li>Loss function: asymmetric Lovasz Hinge with the weight of 0.55 for positive prediction, and 0.45 for negative prediction.</li>\n<li>Number of epochs: at least 20 epochs, at most 80 epochs. Most models converged after 60 epochs.</li>\n</ul>\n<p><em>All trainings were done using GPU quota from Kaggle.</em></p>\n<p><strong>Results</strong>:</p>\n<ul>\n<li><p>Worst case prediction: Lung (Average DSC: 0.1925)<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F5a67f6179ac3e0ae91b57c3682a268ec%2Flung_3_wsi_worst.png?generation=1663951851101765&amp;alt=media\" alt=\"\"></p></li>\n<li><p>Best case prediction: Prostate (Average DSC: 0.8017)<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2Fe188e36765bf2c76404a52eac0e9ade0%2Fprostate_0_wsi_best.png?generation=1663951873035576&amp;alt=media\" alt=\"\"></p></li>\n</ul>\n<p><strong>Inference</strong>:</p>\n<ul>\n<li>Tiles: 0.64 (averaging 4 folds)</li>\n<li>Non-tiles: 0.74 (averaging 4 folds)-for experiments only. I used more ensemble models for submitting.</li>\n</ul>\n<p>My public and private LB : <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F686924ea25aae33c0840f7fc678e24ec%2FScreen%20Shot%202022-09-23%20at%2012.58.19%20PM.png?generation=1663952329198584&amp;alt=media\" alt=\"\"></p>\n<hr>\n<p>Other things I tried out but failed:</p>\n<ul>\n<li>Multi-class segmentation: I'm still not quite sure why it gave poorer results, even though the dice soft was much higher than in binary segmentation models. Any insights are really appreciated!</li>\n<li>Fine-tuning on synthetic dataset using Gaussian-Laplacian blending: overfitting might be an issue. </li>\n</ul>\n<hr>\n<p><strong>Conclusion</strong>:<br>\nWith some tweaks, I boosted the UNeXt50 baseline from 0.51322 to 0.73040 in private LB. Training on non-tiles performed better in this case. </p>\n<p>Thanks for reading! </p>",
  "messages": [
    {
      "id": 1952440,
      "postDate": "2022-09-23T17:04:26.863Z",
      "content": "<p>First of all, I would like to thank the organizers and Kaggle team for hosting this competition, and congratulate to all the winners! I also want to thank <a href=\"https://www.kaggle.com/thedevastator\" target=\"_blank\">@thedevastator</a>, <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a>, <a href=\"https://www.kaggle.com/jamesphoward\" target=\"_blank\">@jamesphoward</a>, <a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a>, <a href=\"https://www.kaggle.com/kingjohnson\" target=\"_blank\">@kingjohnson</a> and many other Kagglers for their discussions and contributions. I've been inspired a lot by their insightful discussions and valuable contributions to this competition.</p>\n<hr>\n<p>I've seen many discussions related to training on tiles vs non-tiles and how it affects the public LB. So, I was curious and decided to do some experiments based on these data settings. I used the <a href=\"https://www.kaggle.com/code/thedevastator/training-fastai-baseline\" target=\"_blank\">UNeXt50 baseline</a> provided by <a href=\"https://www.kaggle.com/thedevastator\" target=\"_blank\">@thedevastator</a> for all my experiments. </p>\n<p>Here is my methodology in detail: <a href=\"https://www.kaggle.com/code/nghihuynh/hubmap-hpa-methodology-submission\" target=\"_blank\">HuBMAP_HPA methodology</a></p>\n<hr>\n<p><strong>Data</strong>: </p>\n<ul>\n<li>Prepare tile dataset using <a href=\"https://www.kaggle.com/code/nghihuynh/wsi-preprocessing-tiling-tissue-segmentation\" target=\"_blank\">Otsu and Triangle thresholding</a> to remove a large portion of background vs non-FTUs tissue.</li>\n<li>Prepare <a href=\"https://www.kaggle.com/code/nghihuynh/wsi-hubmap-dataset-creation-256x256\" target=\"_blank\">non-tile dataset</a> by cropping the tissue area and rescaling to 256x256, and 512x512</li>\n</ul>\n<p><strong>Data augmentation</strong>: heavy data augmentation pipeline including morphology and color changes</p>\n<p><strong>Model architecture</strong>: UNeXt50 baseline</p>\n<p><strong>Training setup</strong>: </p>\n<ul>\n<li>Cross-validation: Stratified K-Fold to select training images based on organs. (4 folds)</li>\n<li>Loss function: asymmetric Lovasz Hinge with the weight of 0.55 for positive prediction, and 0.45 for negative prediction.</li>\n<li>Number of epochs: at least 20 epochs, at most 80 epochs. Most models converged after 60 epochs.</li>\n</ul>\n<p><em>All trainings were done using GPU quota from Kaggle.</em></p>\n<p><strong>Results</strong>:</p>\n<ul>\n<li><p>Worst case prediction: Lung (Average DSC: 0.1925)<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F5a67f6179ac3e0ae91b57c3682a268ec%2Flung_3_wsi_worst.png?generation=1663951851101765&amp;alt=media\" alt=\"\"></p></li>\n<li><p>Best case prediction: Prostate (Average DSC: 0.8017)<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2Fe188e36765bf2c76404a52eac0e9ade0%2Fprostate_0_wsi_best.png?generation=1663951873035576&amp;alt=media\" alt=\"\"></p></li>\n</ul>\n<p><strong>Inference</strong>:</p>\n<ul>\n<li>Tiles: 0.64 (averaging 4 folds)</li>\n<li>Non-tiles: 0.74 (averaging 4 folds)-for experiments only. I used more ensemble models for submitting.</li>\n</ul>\n<p>My public and private LB : <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F686924ea25aae33c0840f7fc678e24ec%2FScreen%20Shot%202022-09-23%20at%2012.58.19%20PM.png?generation=1663952329198584&amp;alt=media\" alt=\"\"></p>\n<hr>\n<p>Other things I tried out but failed:</p>\n<ul>\n<li>Multi-class segmentation: I'm still not quite sure why it gave poorer results, even though the dice soft was much higher than in binary segmentation models. Any insights are really appreciated!</li>\n<li>Fine-tuning on synthetic dataset using Gaussian-Laplacian blending: overfitting might be an issue. </li>\n</ul>\n<hr>\n<p><strong>Conclusion</strong>:<br>\nWith some tweaks, I boosted the UNeXt50 baseline from 0.51322 to 0.73040 in private LB. Training on non-tiles performed better in this case. </p>\n<p>Thanks for reading! </p>",
      "rawMarkdown": "First of all, I would like to thank the organizers and Kaggle team for hosting this competition, and congratulate to all the winners! I also want to thank @thedevastator, @hengck23, @jamesphoward, @gunesevitan, @kingjohnson and many other Kagglers for their discussions and contributions. I've been inspired a lot by their insightful discussions and valuable contributions to this competition.\n\n---\n\nI've seen many discussions related to training on tiles vs non-tiles and how it affects the public LB. So, I was curious and decided to do some experiments based on these data settings. I used the [UNeXt50 baseline](https://www.kaggle.com/code/thedevastator/training-fastai-baseline) provided by @thedevastator for all my experiments. \n\nHere is my methodology in detail: [HuBMAP_HPA methodology](https://www.kaggle.com/code/nghihuynh/hubmap-hpa-methodology-submission)\n\n---\n\n**Data**: \n* Prepare tile dataset using [Otsu and Triangle thresholding](https://www.kaggle.com/code/nghihuynh/wsi-preprocessing-tiling-tissue-segmentation) to remove a large portion of background vs non-FTUs tissue.\n* Prepare [non-tile dataset](https://www.kaggle.com/code/nghihuynh/wsi-hubmap-dataset-creation-256x256) by cropping the tissue area and rescaling to 256x256, and 512x512\n\n**Data augmentation**: heavy data augmentation pipeline including morphology and color changes\n\n**Model architecture**: UNeXt50 baseline\n\n**Training setup**: \n* Cross-validation: Stratified K-Fold to select training images based on organs. (4 folds)\n* Loss function: asymmetric Lovasz Hinge with the weight of 0.55 for positive prediction, and 0.45 for negative prediction.\n* Number of epochs: at least 20 epochs, at most 80 epochs. Most models converged after 60 epochs.\n\n*All trainings were done using GPU quota from Kaggle.*\n\n**Results**:\n\n* Worst case prediction: Lung (Average DSC: 0.1925)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F5a67f6179ac3e0ae91b57c3682a268ec%2Flung_3_wsi_worst.png?generation=1663951851101765&alt=media)\n\n* Best case prediction: Prostate (Average DSC: 0.8017)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2Fe188e36765bf2c76404a52eac0e9ade0%2Fprostate_0_wsi_best.png?generation=1663951873035576&alt=media)\n\n**Inference**:\n* Tiles: 0.64 (averaging 4 folds)\n* Non-tiles: 0.74 (averaging 4 folds)-for experiments only. I used more ensemble models for submitting.\n\nMy public and private LB : \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F686924ea25aae33c0840f7fc678e24ec%2FScreen%20Shot%202022-09-23%20at%2012.58.19%20PM.png?generation=1663952329198584&alt=media)\n\n---\n\nOther things I tried out but failed:\n\n* Multi-class segmentation: I'm still not quite sure why it gave poorer results, even though the dice soft was much higher than in binary segmentation models. Any insights are really appreciated!\n* Fine-tuning on synthetic dataset using Gaussian-Laplacian blending: overfitting might be an issue. \n\n---\n**Conclusion**:\nWith some tweaks, I boosted the UNeXt50 baseline from 0.51322 to 0.73040 in private LB. Training on non-tiles performed better in this case. \n\nThanks for reading! ",
      "votes": 10
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1952440": "First of all, I would like to thank the organizers and Kaggle team for hosting this competition, and congratulate to all the winners! I also want to thank @thedevastator, @hengck23, @jamesphoward, @gunesevitan, @kingjohnson and many other Kagglers for their discussions and contributions. I've been inspired a lot by their insightful discussions and valuable contributions to this competition.\n\n---\n\nI've seen many discussions related to training on tiles vs non-tiles and how it affects the public LB. So, I was curious and decided to do some experiments based on these data settings. I used the [UNeXt50 baseline](https://www.kaggle.com/code/thedevastator/training-fastai-baseline) provided by @thedevastator for all my experiments. \n\nHere is my methodology in detail: [HuBMAP_HPA methodology](https://www.kaggle.com/code/nghihuynh/hubmap-hpa-methodology-submission)\n\n---\n\n**Data**: \n* Prepare tile dataset using [Otsu and Triangle thresholding](https://www.kaggle.com/code/nghihuynh/wsi-preprocessing-tiling-tissue-segmentation) to remove a large portion of background vs non-FTUs tissue.\n* Prepare [non-tile dataset](https://www.kaggle.com/code/nghihuynh/wsi-hubmap-dataset-creation-256x256) by cropping the tissue area and rescaling to 256x256, and 512x512\n\n**Data augmentation**: heavy data augmentation pipeline including morphology and color changes\n\n**Model architecture**: UNeXt50 baseline\n\n**Training setup**: \n* Cross-validation: Stratified K-Fold to select training images based on organs. (4 folds)\n* Loss function: asymmetric Lovasz Hinge with the weight of 0.55 for positive prediction, and 0.45 for negative prediction.\n* Number of epochs: at least 20 epochs, at most 80 epochs. Most models converged after 60 epochs.\n\n*All trainings were done using GPU quota from Kaggle.*\n\n**Results**:\n\n* Worst case prediction: Lung (Average DSC: 0.1925)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F5a67f6179ac3e0ae91b57c3682a268ec%2Flung_3_wsi_worst.png?generation=1663951851101765&alt=media)\n\n* Best case prediction: Prostate (Average DSC: 0.8017)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2Fe188e36765bf2c76404a52eac0e9ade0%2Fprostate_0_wsi_best.png?generation=1663951873035576&alt=media)\n\n**Inference**:\n* Tiles: 0.64 (averaging 4 folds)\n* Non-tiles: 0.74 (averaging 4 folds)-for experiments only. I used more ensemble models for submitting.\n\nMy public and private LB : \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6261540%2F686924ea25aae33c0840f7fc678e24ec%2FScreen%20Shot%202022-09-23%20at%2012.58.19%20PM.png?generation=1663952329198584&alt=media)\n\n---\n\nOther things I tried out but failed:\n\n* Multi-class segmentation: I'm still not quite sure why it gave poorer results, even though the dice soft was much higher than in binary segmentation models. Any insights are really appreciated!\n* Fine-tuning on synthetic dataset using Gaussian-Laplacian blending: overfitting might be an issue. \n\n---\n**Conclusion**:\nWith some tweaks, I boosted the UNeXt50 baseline from 0.51322 to 0.73040 in private LB. Training on non-tiles performed better in this case. \n\nThanks for reading! "
  }
}