{
  "id": 104771,
  "title": "[LB 0.628] simple segmentation approach",
  "url": "/competitions/understanding_cloud_organization/discussion/104771",
  "author_name": "phalanx",
  "post_date": "2019-08-19T04:30:14.771000",
  "votes": 76,
  "comment_count": 17,
  "views": 0,
  "content": "<p>share my solution overview, it is just baseline solution.</p>\n\n<ul>\n<li><p>dataset\ncompetition dataset, no external data\npreprocess: gamma correction\nimage resolution: 320x512</p></li>\n<li><p>model\nvanilla unet\nencoder: resnet34(imagenet pretrained)</p></li>\n<li><p>train\ntrain_ test_ split(train:80%, val:20%)\naugmentation: horizontal flip, random shift, random rotate\nloss: bce\nepochs: 10</p></li>\n<li><p>test\nthreshold: 0.5\nno tta\nremove small mask</p></li>\n</ul>",
  "messages": [
    {
      "id": 602447,
      "postDate": "2019-08-19T04:30:14.773Z",
      "content": "<p>share my solution overview, it is just baseline solution.</p>\n\n<ul>\n<li><p>dataset\ncompetition dataset, no external data\npreprocess: gamma correction\nimage resolution: 320x512</p></li>\n<li><p>model\nvanilla unet\nencoder: resnet34(imagenet pretrained)</p></li>\n<li><p>train\ntrain_ test_ split(train:80%, val:20%)\naugmentation: horizontal flip, random shift, random rotate\nloss: bce\nepochs: 10</p></li>\n<li><p>test\nthreshold: 0.5\nno tta\nremove small mask</p></li>\n</ul>",
      "rawMarkdown": "share my solution overview, it is just baseline solution.\n\n* dataset\ncompetition dataset, no external data\npreprocess: gamma correction\nimage resolution: 320x512\n\n* model\nvanilla unet\nencoder: resnet34(imagenet pretrained)\n\n* train\ntrain_ test_ split(train:80%, val:20%)\naugmentation: horizontal flip, random shift, random rotate\nloss: bce\nepochs: 10\n\n* test\nthreshold: 0.5\nno tta\nremove small mask",
      "votes": 74
    },
    {
      "id": 614917,
      "postDate": "2019-09-01T08:36:06.793Z",
      "content": "<p>Can you give more details for removing small masks ? </p>",
      "rawMarkdown": "Can you give more details for removing small masks ? ",
      "votes": 1,
      "replies": [
        {
          "id": 617209,
          "postDate": "2019-09-03T21:53:55.793Z",
          "content": "<p>I would like to ask this question too.</p>",
          "rawMarkdown": "I would like to ask this question too.",
          "votes": 1
        },
        {
          "id": 618216,
          "postDate": "2019-09-05T01:44:02.230Z",
          "content": "<p>Here is the implementation in Pytorch using using cv2.threshold and cv2.connectedComponents <a href=\"https://www.kaggle.com/rishabhiitbhu/unet-pytorch-inference-kernel\">https://www.kaggle.com/rishabhiitbhu/unet-pytorch-inference-kernel</a>. </p>\n\n<p>It's also possible to adjusted to use with Keras.</p>",
          "rawMarkdown": "Here is the implementation in Pytorch using using cv2.threshold and cv2.connectedComponents https://www.kaggle.com/rishabhiitbhu/unet-pytorch-inference-kernel. \n\nIt's also possible to adjusted to use with Keras.",
          "votes": 6
        },
        {
          "id": 619091,
          "postDate": "2019-09-05T20:12:49.500Z",
          "content": "<p>Thanks a lot :D</p>",
          "rawMarkdown": "Thanks a lot :D"
        },
        {
          "id": 619588,
          "postDate": "2019-09-06T10:25:08.810Z",
          "content": "<p>sorry for late reply\n1. determin threshold for each class.\n2. if mask.sum() &lt; threshold:  mask*= 0</p>",
          "rawMarkdown": "sorry for late reply\n1. determin threshold for each class.\n2. if mask.sum() &lt; threshold:  mask*= 0",
          "votes": 6
        }
      ]
    },
    {
      "id": 607703,
      "postDate": "2019-08-25T18:41:52.903Z",
      "content": "<p>Would vertical flip augmentation also work for this kind of data?</p>",
      "rawMarkdown": "Would vertical flip augmentation also work for this kind of data?",
      "votes": 1,
      "replies": [
        {
          "id": 617227,
          "postDate": "2019-09-03T22:48:20.427Z",
          "content": "<p>Thanks for your question! The <code>vertical flip augmentation</code> should indeed work for this kind of dataset. </p>\n\n<p>If you scroll through the images, you probably wouldn't observe specific orientations for most of the patterns. However, one exception is probably the 'Fish'-pattern which often seems to be oriented in east-west-direction (right to left).</p>\n\n<p>One reasonable factor that might influence the orientation of patterns is the mean wind direction. Because this dataset contains data from the trade-wind regime, the background-wind is predominantly coming from the east with a slightly northern component (blowing to the southwest) on the northern hemisphere and a slightly southern component (blowing to the northwest) on the southern hemisphere.\nSo a <code>vertical flip augmentation</code> might be similar to switching the hemispheres.​​</p>\n\n<p>For patterns like 'Sugar' or 'Gravel' I wouldn't expect any specific orientation and <code>rotation augmentation</code> might be applied to the images as well.</p>",
          "rawMarkdown": "Thanks for your question! The `vertical flip augmentation` should indeed work for this kind of dataset. \n\nIf you scroll through the images, you probably wouldn't observe specific orientations for most of the patterns. However, one exception is probably the 'Fish'-pattern which often seems to be oriented in east-west-direction (right to left).\n\nOne reasonable factor that might influence the orientation of patterns is the mean wind direction. Because this dataset contains data from the trade-wind regime, the background-wind is predominantly coming from the east with a slightly northern component (blowing to the southwest) on the northern hemisphere and a slightly southern component (blowing to the northwest) on the southern hemisphere.\nSo a `vertical flip augmentation` might be similar to switching the hemispheres.​​\n\nFor patterns like 'Sugar' or 'Gravel' I wouldn't expect any specific orientation and `rotation augmentation` might be applied to the images as well.",
          "votes": 12
        },
        {
          "id": 618773,
          "postDate": "2019-09-05T13:34:02.743Z",
          "content": "<p>WoW for this \"So a vertical flip augmentation might be similar to switching the hemispheres.​​\"🙌 </p>",
          "rawMarkdown": "WoW for this \"So a vertical flip augmentation might be similar to switching the hemispheres.​​\"🙌 "
        },
        {
          "id": 619454,
          "postDate": "2019-09-06T08:02:52.430Z",
          "content": "<p>Thanks Hauke, I appreciate your answer!</p>",
          "rawMarkdown": "Thanks Hauke, I appreciate your answer!"
        }
      ]
    },
    {
      "id": 602691,
      "postDate": "2019-08-19T11:52:16.900Z",
      "content": "<p>thanks <a href=\"/phalanx\">@phalanx</a> , what lib you use for the data augmentation?</p>",
      "rawMarkdown": "thanks @phalanx , what lib you use for the data augmentation?",
      "votes": 1,
      "replies": [
        {
          "id": 602698,
          "postDate": "2019-08-19T11:56:48.063Z",
          "content": "<p>albumentations</p>",
          "rawMarkdown": "albumentations",
          "votes": 2
        }
      ]
    },
    {
      "id": 608680,
      "postDate": "2019-08-27T04:21:48.233Z",
      "content": "<p>How can you use resnet weights on a unet architecture? Aren't they different architectures? </p>",
      "rawMarkdown": "How can you use resnet weights on a unet architecture? Aren't they different architectures? ",
      "replies": [
        {
          "id": 611279,
          "postDate": "2019-08-29T07:43:11.687Z",
          "content": "<p>There is unet implement on resnet architecture\n<code>from segmentation_models import Unet</code>\n<code>ResUnet34 = Unet('resnet34', classes, input_shape, activation)</code></p>",
          "rawMarkdown": "There is unet implement on resnet architecture\n`from segmentation_models import Unet `\n`ResUnet34 = Unet('resnet34', classes, input_shape, activation)`\n",
          "votes": 2
        },
        {
          "id": 611325,
          "postDate": "2019-08-29T08:02:10.767Z",
          "content": "<p>Or you can use regular resnet model as decoder then do the upsampling part in unet(which is encoder part) by yourself.</p>",
          "rawMarkdown": "Or you can use regular resnet model as decoder then do the upsampling part in unet(which is encoder part) by yourself.",
          "votes": 1
        }
      ]
    },
    {
      "id": 604142,
      "postDate": "2019-08-21T04:50:15.670Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 602621,
      "postDate": "2019-08-19T09:28:55.633Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 602835,
      "postDate": "2019-08-19T14:47:22.917Z",
      "content": "<p>Thanks for your share! </p>",
      "rawMarkdown": "Thanks for your share! "
    }
  ],
  "comments": [
    {
      "id": 614917,
      "author_name": "Mohamed Ramzy",
      "author_url": "",
      "post_date": "2019-09-01T08:36:06.793000",
      "content": "<p>Can you give more details for removing small masks ? </p>",
      "votes": 1,
      "replies": [
        {
          "id": 617209,
          "author_name": "Yirun Zhang",
          "author_url": "",
          "post_date": "2019-09-03T21:53:55.793000",
          "content": "<p>I would like to ask this question too.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 618216,
          "author_name": "Kenneh Hansawattana",
          "author_url": "",
          "post_date": "2019-09-05T01:44:02.230000",
          "content": "<p>Here is the implementation in Pytorch using using cv2.threshold and cv2.connectedComponents <a href=\"https://www.kaggle.com/rishabhiitbhu/unet-pytorch-inference-kernel\">https://www.kaggle.com/rishabhiitbhu/unet-pytorch-inference-kernel</a>. </p>\n\n<p>It's also possible to adjusted to use with Keras.</p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 619091,
          "author_name": "Mohamed Ramzy",
          "author_url": "",
          "post_date": "2019-09-05T20:12:49.500000",
          "content": "<p>Thanks a lot :D</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 619588,
          "author_name": "phalanx",
          "author_url": "",
          "post_date": "2019-09-06T10:25:08.810000",
          "content": "<p>sorry for late reply\n1. determin threshold for each class.\n2. if mask.sum() &lt; threshold:  mask*= 0</p>",
          "votes": 6,
          "replies": []
        }
      ]
    },
    {
      "id": 607703,
      "author_name": "mtszkw",
      "author_url": "",
      "post_date": "2019-08-25T18:41:52.903000",
      "content": "<p>Would vertical flip augmentation also work for this kind of data?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 617227,
          "author_name": "Hauke Schulz",
          "author_url": "",
          "post_date": "2019-09-03T22:48:20.427000",
          "content": "<p>Thanks for your question! The <code>vertical flip augmentation</code> should indeed work for this kind of dataset. </p>\n\n<p>If you scroll through the images, you probably wouldn't observe specific orientations for most of the patterns. However, one exception is probably the 'Fish'-pattern which often seems to be oriented in east-west-direction (right to left).</p>\n\n<p>One reasonable factor that might influence the orientation of patterns is the mean wind direction. Because this dataset contains data from the trade-wind regime, the background-wind is predominantly coming from the east with a slightly northern component (blowing to the southwest) on the northern hemisphere and a slightly southern component (blowing to the northwest) on the southern hemisphere.\nSo a <code>vertical flip augmentation</code> might be similar to switching the hemispheres.​​</p>\n\n<p>For patterns like 'Sugar' or 'Gravel' I wouldn't expect any specific orientation and <code>rotation augmentation</code> might be applied to the images as well.</p>",
          "votes": 12,
          "replies": []
        },
        {
          "id": 618773,
          "author_name": "CBR",
          "author_url": "",
          "post_date": "2019-09-05T13:34:02.743000",
          "content": "<p>WoW for this \"So a vertical flip augmentation might be similar to switching the hemispheres.​​\"🙌 </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 619454,
          "author_name": "mtszkw",
          "author_url": "",
          "post_date": "2019-09-06T08:02:52.430000",
          "content": "<p>Thanks Hauke, I appreciate your answer!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 602691,
      "author_name": "DimitreOliveira",
      "author_url": "",
      "post_date": "2019-08-19T11:52:16.900000",
      "content": "<p>thanks <a href=\"/phalanx\">@phalanx</a> , what lib you use for the data augmentation?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 602698,
          "author_name": "phalanx",
          "author_url": "",
          "post_date": "2019-08-19T11:56:48.063000",
          "content": "<p>albumentations</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 608680,
      "author_name": "Spencer Kraisler",
      "author_url": "",
      "post_date": "2019-08-27T04:21:48.233000",
      "content": "<p>How can you use resnet weights on a unet architecture? Aren't they different architectures? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 611279,
          "author_name": "Tsai29",
          "author_url": "",
          "post_date": "2019-08-29T07:43:11.687000",
          "content": "<p>There is unet implement on resnet architecture\n<code>from segmentation_models import Unet</code>\n<code>ResUnet34 = Unet('resnet34', classes, input_shape, activation)</code></p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 611325,
          "author_name": "Tsai29",
          "author_url": "",
          "post_date": "2019-08-29T08:02:10.767000",
          "content": "<p>Or you can use regular resnet model as decoder then do the upsampling part in unet(which is encoder part) by yourself.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 604142,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-08-21T04:50:15.670000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 602621,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-08-19T09:28:55.633000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 602835,
      "author_name": "Strideradu",
      "author_url": "",
      "post_date": "2019-08-19T14:47:22.917000",
      "content": "<p>Thanks for your share! </p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "602447": "share my solution overview, it is just baseline solution.\n\n* dataset\ncompetition dataset, no external data\npreprocess: gamma correction\nimage resolution: 320x512\n\n* model\nvanilla unet\nencoder: resnet34(imagenet pretrained)\n\n* train\ntrain_ test_ split(train:80%, val:20%)\naugmentation: horizontal flip, random shift, random rotate\nloss: bce\nepochs: 10\n\n* test\nthreshold: 0.5\nno tta\nremove small mask",
    "614917": "Can you give more details for removing small masks ? ",
    "607703": "Would vertical flip augmentation also work for this kind of data?",
    "602691": "thanks @phalanx , what lib you use for the data augmentation?",
    "608680": "How can you use resnet weights on a unet architecture? Aren't they different architectures? ",
    "604142": "",
    "602621": "",
    "602835": "Thanks for your share! "
  }
}