{
  "id": 417746,
  "title": "55th silver solution",
  "url": "/competitions/vesuvius-challenge-ink-detection/discussion/417746",
  "author_name": "Aurora_blue",
  "post_date": "2023-06-17T01:44:42.515000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Thank you for organizing interesting competition.<br>\nI joined this competition 3 weeks before close, so I couldn't do much trial and error.<br>\nHowever, reading many discussions and public notebooks helped me to make baseline faster.<br>\nThank you all kagglers for sharing nice contents.</p>\n<h1><strong>Reference</strong></h1>\n<ol>\n<li><a href=\"https://www.kaggle.com/tanakar\" target=\"_blank\">@tanakar</a> 's 2.5d segmentation <a href=\"https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-training\" target=\"_blank\">training</a>, <a href=\"https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-inference\" target=\"_blank\">inference</a></li>\n<li><a href=\"https://www.kaggle.com/yoyobar\" target=\"_blank\">@yoyobar</a> 's <a href=\"https://www.kaggle.com/code/yoyobar/3d-resnet-baseline-inference\" target=\"_blank\">3D ResNet baseline [inference]</a></li>\n<li><a href=\"https://www.kaggle.com/samfc10\" target=\"_blank\">@samfc10</a> 's <a href=\"https://www.kaggle.com/code/samfc10/vesuvius-challenge-3d-resnet-training\" target=\"_blank\">Vesuvius Challenge - 3D ResNet Training</a></li>\n<li><a href=\"https://scrollprize.org/tutorial4\" target=\"_blank\">official tutorial page</a></li>\n<li><a href=\"https://youtu.be/g-7-Xg75CCI?t=6013\" target=\"_blank\">youtube in official tutorial page</a></li>\n</ol>\n<h1><strong>Solution</strong></h1>\n<ul>\n<li>3D ResNet (resnet34) ensemble<br>\nI used 3fold Group fold CV(fragment_id based), chose best model for each fold, and made ensemble model of them.<br>\nThe base model is based on Ref 3, (192, 192, 16) as input size.<br>\nWhy I use 3D ResNet is to capture the feature spreading in z direction, which is caused by ink bleeding.<br>\nAs we can see Ref 4, the information about spatial frequency may be important for model, so not resizing the input image was very very important, I think.🤔 I should have tried <a href=\"https://pytorch.org/docs/stable/fft.html\" target=\"_blank\">fast fourier transformation</a>..😑<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F1c0effbbab9a491994d11cfdb89ffeaa%2Fsem-alpha.png?generation=1686965040652713&amp;alt=media\" alt=\"Ref 4\"></li>\n<li>Data Augmentation based on  Ref 1.<br>\nTo my surprise, blur augmentation was important. Without blur related augmentation, CV goes down by 1~2%.<br>\nThough it is said that adding blur makes more difficult to distinguish for us in Ref 5, some blur made important role.🤔<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F9da9c905c7e480e5ac5bb32665d0a748%2Fink_blured.png?generation=1686963393693952&amp;alt=media\" alt=\"Ref 5\"></li>\n<li>TTA based on Ref 2.</li>\n<li>th=0.50<br>\nI couldn't understand how to optimize for ensemble model, so fixed.</li>\n</ul>\n<h1><strong>environment for computing</strong></h1>\n<ul>\n<li>Google Colab Pro+<br>\nWe can run at most 3 sessions in it, so I ran fold1~3 at the same time.<br>\n1 epoch for batchsize=16 took 30 min with A100.</li>\n</ul>\n<h1><strong>not worked for me</strong></h1>\n<ul>\n<li>larger input<br>\nI tried from 256 to 512. </li>\n<li>reducing label near edge by cv2.erode<br>\nthe picture shown in the most right is obtained by subtracting real label and erosion(shrinked) label<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F3b75e6ea3bc351085102683f77432eb3%2Ferosion1.png?generation=1686964831123283&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F27141862c0e134018f485096ae191500%2Ferosion2.png?generation=1686964854760693&amp;alt=media\" alt=\"\"></li>\n<li>various loss function</li>\n</ul>",
  "messages": [
    {
      "id": 2305904,
      "postDate": "2023-06-17T01:44:42.517Z",
      "content": "<p>Thank you for organizing interesting competition.<br>\nI joined this competition 3 weeks before close, so I couldn't do much trial and error.<br>\nHowever, reading many discussions and public notebooks helped me to make baseline faster.<br>\nThank you all kagglers for sharing nice contents.</p>\n<h1><strong>Reference</strong></h1>\n<ol>\n<li><a href=\"https://www.kaggle.com/tanakar\" target=\"_blank\">@tanakar</a> 's 2.5d segmentation <a href=\"https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-training\" target=\"_blank\">training</a>, <a href=\"https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-inference\" target=\"_blank\">inference</a></li>\n<li><a href=\"https://www.kaggle.com/yoyobar\" target=\"_blank\">@yoyobar</a> 's <a href=\"https://www.kaggle.com/code/yoyobar/3d-resnet-baseline-inference\" target=\"_blank\">3D ResNet baseline [inference]</a></li>\n<li><a href=\"https://www.kaggle.com/samfc10\" target=\"_blank\">@samfc10</a> 's <a href=\"https://www.kaggle.com/code/samfc10/vesuvius-challenge-3d-resnet-training\" target=\"_blank\">Vesuvius Challenge - 3D ResNet Training</a></li>\n<li><a href=\"https://scrollprize.org/tutorial4\" target=\"_blank\">official tutorial page</a></li>\n<li><a href=\"https://youtu.be/g-7-Xg75CCI?t=6013\" target=\"_blank\">youtube in official tutorial page</a></li>\n</ol>\n<h1><strong>Solution</strong></h1>\n<ul>\n<li>3D ResNet (resnet34) ensemble<br>\nI used 3fold Group fold CV(fragment_id based), chose best model for each fold, and made ensemble model of them.<br>\nThe base model is based on Ref 3, (192, 192, 16) as input size.<br>\nWhy I use 3D ResNet is to capture the feature spreading in z direction, which is caused by ink bleeding.<br>\nAs we can see Ref 4, the information about spatial frequency may be important for model, so not resizing the input image was very very important, I think.🤔 I should have tried <a href=\"https://pytorch.org/docs/stable/fft.html\" target=\"_blank\">fast fourier transformation</a>..😑<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F1c0effbbab9a491994d11cfdb89ffeaa%2Fsem-alpha.png?generation=1686965040652713&amp;alt=media\" alt=\"Ref 4\"></li>\n<li>Data Augmentation based on  Ref 1.<br>\nTo my surprise, blur augmentation was important. Without blur related augmentation, CV goes down by 1~2%.<br>\nThough it is said that adding blur makes more difficult to distinguish for us in Ref 5, some blur made important role.🤔<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F9da9c905c7e480e5ac5bb32665d0a748%2Fink_blured.png?generation=1686963393693952&amp;alt=media\" alt=\"Ref 5\"></li>\n<li>TTA based on Ref 2.</li>\n<li>th=0.50<br>\nI couldn't understand how to optimize for ensemble model, so fixed.</li>\n</ul>\n<h1><strong>environment for computing</strong></h1>\n<ul>\n<li>Google Colab Pro+<br>\nWe can run at most 3 sessions in it, so I ran fold1~3 at the same time.<br>\n1 epoch for batchsize=16 took 30 min with A100.</li>\n</ul>\n<h1><strong>not worked for me</strong></h1>\n<ul>\n<li>larger input<br>\nI tried from 256 to 512. </li>\n<li>reducing label near edge by cv2.erode<br>\nthe picture shown in the most right is obtained by subtracting real label and erosion(shrinked) label<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F3b75e6ea3bc351085102683f77432eb3%2Ferosion1.png?generation=1686964831123283&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F27141862c0e134018f485096ae191500%2Ferosion2.png?generation=1686964854760693&amp;alt=media\" alt=\"\"></li>\n<li>various loss function</li>\n</ul>",
      "rawMarkdown": "Thank you for organizing interesting competition.\nI joined this competition 3 weeks before close, so I couldn't do much trial and error.\nHowever, reading many discussions and public notebooks helped me to make baseline faster.\nThank you all kagglers for sharing nice contents.\n\n# **Reference**\n1. @tanakar 's 2.5d segmentation [training](https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-training), [inference](https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-inference)\n2. @yoyobar 's [3D ResNet baseline [inference]](https://www.kaggle.com/code/yoyobar/3d-resnet-baseline-inference)\n3. @samfc10 's [Vesuvius Challenge - 3D ResNet Training](https://www.kaggle.com/code/samfc10/vesuvius-challenge-3d-resnet-training)\n4. [official tutorial page](https://scrollprize.org/tutorial4)\n5. [youtube in official tutorial page](https://youtu.be/g-7-Xg75CCI?t=6013)\n\n# **Solution**\n- 3D ResNet (resnet34) ensemble\n  I used 3fold Group fold CV(fragment_id based), chose best model for each fold, and made ensemble model of them.\n  The base model is based on Ref 3, (192, 192, 16) as input size.\n  Why I use 3D ResNet is to capture the feature spreading in z direction, which is caused by ink bleeding.\n  As we can see Ref 4, the information about spatial frequency may be important for model, so not resizing the input image was very very important, I think.🤔 I should have tried [fast fourier transformation](https://pytorch.org/docs/stable/fft.html)..😑\n![Ref 4](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F1c0effbbab9a491994d11cfdb89ffeaa%2Fsem-alpha.png?generation=1686965040652713&alt=media)\n- Data Augmentation based on  Ref 1.\n  To my surprise, blur augmentation was important. Without blur related augmentation, CV goes down by 1~2%.\n  Though it is said that adding blur makes more difficult to distinguish for us in Ref 5, some blur made important role.🤔\n  ![Ref 5](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F9da9c905c7e480e5ac5bb32665d0a748%2Fink_blured.png?generation=1686963393693952&alt=media)\n- TTA based on Ref 2.\n- th=0.50\n  I couldn't understand how to optimize for ensemble model, so fixed.\n\n# **environment for computing**\n- Google Colab Pro+\n  We can run at most 3 sessions in it, so I ran fold1~3 at the same time.\n  1 epoch for batchsize=16 took 30 min with A100.\n  \n# **not worked for me**\n- larger input\n  I tried from 256 to 512. \n- reducing label near edge by cv2.erode\n  the picture shown in the most right is obtained by subtracting real label and erosion(shrinked) label\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F3b75e6ea3bc351085102683f77432eb3%2Ferosion1.png?generation=1686964831123283&alt=media)\n  ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F27141862c0e134018f485096ae191500%2Ferosion2.png?generation=1686964854760693&alt=media)\n- various loss function\n",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2305904": "Thank you for organizing interesting competition.\nI joined this competition 3 weeks before close, so I couldn't do much trial and error.\nHowever, reading many discussions and public notebooks helped me to make baseline faster.\nThank you all kagglers for sharing nice contents.\n\n# **Reference**\n1. @tanakar 's 2.5d segmentation [training](https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-training), [inference](https://www.kaggle.com/code/tanakar/2-5d-segmentaion-baseline-inference)\n2. @yoyobar 's [3D ResNet baseline [inference]](https://www.kaggle.com/code/yoyobar/3d-resnet-baseline-inference)\n3. @samfc10 's [Vesuvius Challenge - 3D ResNet Training](https://www.kaggle.com/code/samfc10/vesuvius-challenge-3d-resnet-training)\n4. [official tutorial page](https://scrollprize.org/tutorial4)\n5. [youtube in official tutorial page](https://youtu.be/g-7-Xg75CCI?t=6013)\n\n# **Solution**\n- 3D ResNet (resnet34) ensemble\n  I used 3fold Group fold CV(fragment_id based), chose best model for each fold, and made ensemble model of them.\n  The base model is based on Ref 3, (192, 192, 16) as input size.\n  Why I use 3D ResNet is to capture the feature spreading in z direction, which is caused by ink bleeding.\n  As we can see Ref 4, the information about spatial frequency may be important for model, so not resizing the input image was very very important, I think.🤔 I should have tried [fast fourier transformation](https://pytorch.org/docs/stable/fft.html)..😑\n![Ref 4](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F1c0effbbab9a491994d11cfdb89ffeaa%2Fsem-alpha.png?generation=1686965040652713&alt=media)\n- Data Augmentation based on  Ref 1.\n  To my surprise, blur augmentation was important. Without blur related augmentation, CV goes down by 1~2%.\n  Though it is said that adding blur makes more difficult to distinguish for us in Ref 5, some blur made important role.🤔\n  ![Ref 5](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F9da9c905c7e480e5ac5bb32665d0a748%2Fink_blured.png?generation=1686963393693952&alt=media)\n- TTA based on Ref 2.\n- th=0.50\n  I couldn't understand how to optimize for ensemble model, so fixed.\n\n# **environment for computing**\n- Google Colab Pro+\n  We can run at most 3 sessions in it, so I ran fold1~3 at the same time.\n  1 epoch for batchsize=16 took 30 min with A100.\n  \n# **not worked for me**\n- larger input\n  I tried from 256 to 512. \n- reducing label near edge by cv2.erode\n  the picture shown in the most right is obtained by subtracting real label and erosion(shrinked) label\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F3b75e6ea3bc351085102683f77432eb3%2Ferosion1.png?generation=1686964831123283&alt=media)\n  ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4250230%2F27141862c0e134018f485096ae191500%2Ferosion2.png?generation=1686964854760693&alt=media)\n- various loss function\n"
  }
}