{
  "id": 432335,
  "title": "152nd solution (single model)",
  "url": "/competitions/google-research-identify-contrails-reduce-global-warming/discussion/432335",
  "author_name": "teyosan1229",
  "post_date": "2023-08-17T02:21:03.962000",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Congratulations, all winners.</p>\n<p>And thank you for holding a competition with a lot of learning. This was my first time doing a segmentation task.</p>\n<p>Not great results, but public notebooks helped me learn the basics.</p>\n<p>I made various models with <a href=\"https://www.kaggle.com/stgkrtua\" target=\"_blank\">@stgkrtua</a> , but I made a mistake in the ensemble code, so the result was a single model :)</p>\n<p>A simple solution is given below.</p>\n<ul>\n<li>model<ul>\n<li><code>Unet</code> (segmentation_models_pytorch)</li>\n<li>backbone<ul>\n<li><code>'timm-resnest26d'</code></li></ul></li></ul></li>\n<li>image size<ul>\n<li>512*512</li></ul></li>\n<li>fold<ul>\n<li>5</li></ul></li>\n<li>use validation data on training</li>\n<li>Ash color</li>\n<li>Use only one target frame</li>\n<li>threshold<ul>\n<li>0.3</li></ul></li>\n<li>CV 0.688, Public0.66273, Private0.66321</li>\n</ul>\n<h3>If the ensemble was successful</h3>\n<ul>\n<li>Public 0.67199, Private 0.67366(119th not medal…)</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>model</th>\n<th>backbone</th>\n<th>img_size</th>\n<th>weight</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Unet</td>\n<td>timm-resnest26d</td>\n<td>512</td>\n<td>0.4</td>\n</tr>\n<tr>\n<td>UnetPlusPlus</td>\n<td>timm-efficientnet-b2</td>\n<td>512</td>\n<td>0.1</td>\n</tr>\n<tr>\n<td>DeepLabV3Plus</td>\n<td>timm-efficientnet-b4</td>\n<td>512</td>\n<td>0.15</td>\n</tr>\n<tr>\n<td>Unet</td>\n<td>tu-tf_efficientnetv2_s</td>\n<td>512</td>\n<td>0.15</td>\n</tr>\n<tr>\n<td>SegModel (Details below)</td>\n<td>tf_efficientnet_b6</td>\n<td>512</td>\n<td>0.2</td>\n</tr>\n</tbody>\n</table>\n<pre><code> (nn.Module):\n     ():\n        ().__init__()\n        self.encoder = Encoder(CFG)\n        self.model_name = CFG.model_name\n        self.out_indices = CFG.out_indices\n        channel_nums = self.get_channel_nums()\n        self.decoder = Decoder(CFG, channel_nums)\n        self.head = nn.Sequential(\n            nn.Conv2d(\n                channel_nums[-],\n                CFG.out_channels,\n                kernel_size=,\n                stride=,\n                padding=,\n            ),\n        )\n\n     ():\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n        channel_nums = channel_nums[-(self.out_indices):]\n         channel_nums\n\n     ():\n        skip_connection_list = self.encoder(img)\n        emb = self.decoder(skip_connection_list)\n        output = self.head(emb)\n         output\n</code></pre>\n<h3>not work</h3>\n<ul>\n<li>Input a total of 9 channels including the front and rear frames</li>\n<li>Input 9ch as 3ch using 1x1Conv2d</li>\n</ul>",
  "messages": [
    {
      "id": 2394547,
      "postDate": "2023-08-17T02:21:03.963Z",
      "content": "<p>Congratulations, all winners.</p>\n<p>And thank you for holding a competition with a lot of learning. This was my first time doing a segmentation task.</p>\n<p>Not great results, but public notebooks helped me learn the basics.</p>\n<p>I made various models with <a href=\"https://www.kaggle.com/stgkrtua\" target=\"_blank\">@stgkrtua</a> , but I made a mistake in the ensemble code, so the result was a single model :)</p>\n<p>A simple solution is given below.</p>\n<ul>\n<li>model<ul>\n<li><code>Unet</code> (segmentation_models_pytorch)</li>\n<li>backbone<ul>\n<li><code>'timm-resnest26d'</code></li></ul></li></ul></li>\n<li>image size<ul>\n<li>512*512</li></ul></li>\n<li>fold<ul>\n<li>5</li></ul></li>\n<li>use validation data on training</li>\n<li>Ash color</li>\n<li>Use only one target frame</li>\n<li>threshold<ul>\n<li>0.3</li></ul></li>\n<li>CV 0.688, Public0.66273, Private0.66321</li>\n</ul>\n<h3>If the ensemble was successful</h3>\n<ul>\n<li>Public 0.67199, Private 0.67366(119th not medal…)</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>model</th>\n<th>backbone</th>\n<th>img_size</th>\n<th>weight</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Unet</td>\n<td>timm-resnest26d</td>\n<td>512</td>\n<td>0.4</td>\n</tr>\n<tr>\n<td>UnetPlusPlus</td>\n<td>timm-efficientnet-b2</td>\n<td>512</td>\n<td>0.1</td>\n</tr>\n<tr>\n<td>DeepLabV3Plus</td>\n<td>timm-efficientnet-b4</td>\n<td>512</td>\n<td>0.15</td>\n</tr>\n<tr>\n<td>Unet</td>\n<td>tu-tf_efficientnetv2_s</td>\n<td>512</td>\n<td>0.15</td>\n</tr>\n<tr>\n<td>SegModel (Details below)</td>\n<td>tf_efficientnet_b6</td>\n<td>512</td>\n<td>0.2</td>\n</tr>\n</tbody>\n</table>\n<pre><code> (nn.Module):\n     ():\n        ().__init__()\n        self.encoder = Encoder(CFG)\n        self.model_name = CFG.model_name\n        self.out_indices = CFG.out_indices\n        channel_nums = self.get_channel_nums()\n        self.decoder = Decoder(CFG, channel_nums)\n        self.head = nn.Sequential(\n            nn.Conv2d(\n                channel_nums[-],\n                CFG.out_channels,\n                kernel_size=,\n                stride=,\n                padding=,\n            ),\n        )\n\n     ():\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n         self.model_name == :\n            channel_nums = [, , , ]\n        channel_nums = channel_nums[-(self.out_indices):]\n         channel_nums\n\n     ():\n        skip_connection_list = self.encoder(img)\n        emb = self.decoder(skip_connection_list)\n        output = self.head(emb)\n         output\n</code></pre>\n<h3>not work</h3>\n<ul>\n<li>Input a total of 9 channels including the front and rear frames</li>\n<li>Input 9ch as 3ch using 1x1Conv2d</li>\n</ul>",
      "rawMarkdown": "Congratulations, all winners.\n\nAnd thank you for holding a competition with a lot of learning. This was my first time doing a segmentation task.\n\nNot great results, but public notebooks helped me learn the basics.\n\nI made various models with @stgkrtua , but I made a mistake in the ensemble code, so the result was a single model :)\n\nA simple solution is given below.\n\n- model\n    - `Unet` (segmentation_models_pytorch)\n    - backbone\n        - `'timm-resnest26d'`\n- image size\n    - 512*512\n- fold\n    - 5\n- use validation data on training\n- Ash color\n- Use only one target frame\n- threshold\n    - 0.3\n- CV 0.688, Public0.66273, Private0.66321\n\n### If the ensemble was successful\n\n- Public 0.67199, Private 0.67366(119th not medal…)\n\n| model | backbone | img_size | weight |\n| --- | --- | --- | --- |\n| Unet | timm-resnest26d | 512 | 0.4 |\n| UnetPlusPlus | timm-efficientnet-b2 | 512 | 0.1 |\n| DeepLabV3Plus | timm-efficientnet-b4 | 512 | 0.15 |\n| Unet | tu-tf_efficientnetv2_s | 512 | 0.15 |\n| SegModel (Details below)| tf_efficientnet_b6 | 512 | 0.2 |\n\n\n```python\nclass SegModel(nn.Module):\n    def __init__(self, CFG):\n        super().__init__()\n        self.encoder = Encoder(CFG)\n        self.model_name = CFG.model_name\n        self.out_indices = CFG.out_indices\n        channel_nums = self.get_channel_nums()\n        self.decoder = Decoder(CFG, channel_nums)\n        self.head = nn.Sequential(\n            nn.Conv2d(\n                channel_nums[-1],\n                CFG.out_channels,\n                kernel_size=1,\n                stride=1,\n                padding=0,\n            ),\n        )\n\n    def get_channel_nums(self):\n        if self.model_name == \"tf_efficientnet_b0\":\n            channel_nums = [320, 112, 40, 24, 16]\n        elif self.model_name == \"tf_efficientnet_b2\":\n            channel_nums = [352, 120, 48, 24, 16]\n        elif self.model_name == \"tf_efficientnet_b4\":\n            channel_nums = [448, 160, 56, 32, 24]\n        elif self.model_name == \"tf_efficientnet_b6\":\n            channel_nums = [576, 200, 72, 40, 32]\n        elif self.model_name == \"tf_efficientnet_b7\":\n            channel_nums = [640, 224, 80, 48, 32]\n        elif self.model_name == \"convnext_tiny\":\n            channel_nums = [768, 384, 192, 96]\n        elif self.model_name == \"convnextv2_nano\":\n            channel_nums = [640, 320, 160, 80]\n        elif self.model_name == \"convnextv2_tiny\":\n            channel_nums = [768, 384, 192, 96]\n        channel_nums = channel_nums[-len(self.out_indices):]\n        return channel_nums\n\n    def forward(self, img):\n        skip_connection_list = self.encoder(img)\n        emb = self.decoder(skip_connection_list)\n        output = self.head(emb)\n        return output\n```\n\n### not work\n\n- Input a total of 9 channels including the front and rear frames\n- Input 9ch as 3ch using 1x1Conv2d",
      "votes": 1
    },
    {
      "id": 2413899,
      "postDate": "2023-08-29T08:18:40.410Z",
      "content": "<p>May I ask how the weight of your model is determined? Is it manually adjusted?thank you very much if you can answer</p>",
      "rawMarkdown": "May I ask how the weight of your model is determined? Is it manually adjusted?thank you very much if you can answer",
      "replies": [
        {
          "id": 2413918,
          "postDate": "2023-08-29T08:26:52.850Z",
          "content": "<p>weights were determined manually in order of CV</p>",
          "rawMarkdown": "weights were determined manually in order of CV"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2413899,
      "author_name": "kongweihao",
      "author_url": "",
      "post_date": "2023-08-29T08:18:40.410000",
      "content": "<p>May I ask how the weight of your model is determined? Is it manually adjusted?thank you very much if you can answer</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2413918,
          "author_name": "teyosan1229",
          "author_url": "",
          "post_date": "2023-08-29T08:26:52.850000",
          "content": "<p>weights were determined manually in order of CV</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2394547": "Congratulations, all winners.\n\nAnd thank you for holding a competition with a lot of learning. This was my first time doing a segmentation task.\n\nNot great results, but public notebooks helped me learn the basics.\n\nI made various models with @stgkrtua , but I made a mistake in the ensemble code, so the result was a single model :)\n\nA simple solution is given below.\n\n- model\n    - `Unet` (segmentation_models_pytorch)\n    - backbone\n        - `'timm-resnest26d'`\n- image size\n    - 512*512\n- fold\n    - 5\n- use validation data on training\n- Ash color\n- Use only one target frame\n- threshold\n    - 0.3\n- CV 0.688, Public0.66273, Private0.66321\n\n### If the ensemble was successful\n\n- Public 0.67199, Private 0.67366(119th not medal…)\n\n| model | backbone | img_size | weight |\n| --- | --- | --- | --- |\n| Unet | timm-resnest26d | 512 | 0.4 |\n| UnetPlusPlus | timm-efficientnet-b2 | 512 | 0.1 |\n| DeepLabV3Plus | timm-efficientnet-b4 | 512 | 0.15 |\n| Unet | tu-tf_efficientnetv2_s | 512 | 0.15 |\n| SegModel (Details below)| tf_efficientnet_b6 | 512 | 0.2 |\n\n\n```python\nclass SegModel(nn.Module):\n    def __init__(self, CFG):\n        super().__init__()\n        self.encoder = Encoder(CFG)\n        self.model_name = CFG.model_name\n        self.out_indices = CFG.out_indices\n        channel_nums = self.get_channel_nums()\n        self.decoder = Decoder(CFG, channel_nums)\n        self.head = nn.Sequential(\n            nn.Conv2d(\n                channel_nums[-1],\n                CFG.out_channels,\n                kernel_size=1,\n                stride=1,\n                padding=0,\n            ),\n        )\n\n    def get_channel_nums(self):\n        if self.model_name == \"tf_efficientnet_b0\":\n            channel_nums = [320, 112, 40, 24, 16]\n        elif self.model_name == \"tf_efficientnet_b2\":\n            channel_nums = [352, 120, 48, 24, 16]\n        elif self.model_name == \"tf_efficientnet_b4\":\n            channel_nums = [448, 160, 56, 32, 24]\n        elif self.model_name == \"tf_efficientnet_b6\":\n            channel_nums = [576, 200, 72, 40, 32]\n        elif self.model_name == \"tf_efficientnet_b7\":\n            channel_nums = [640, 224, 80, 48, 32]\n        elif self.model_name == \"convnext_tiny\":\n            channel_nums = [768, 384, 192, 96]\n        elif self.model_name == \"convnextv2_nano\":\n            channel_nums = [640, 320, 160, 80]\n        elif self.model_name == \"convnextv2_tiny\":\n            channel_nums = [768, 384, 192, 96]\n        channel_nums = channel_nums[-len(self.out_indices):]\n        return channel_nums\n\n    def forward(self, img):\n        skip_connection_list = self.encoder(img)\n        emb = self.decoder(skip_connection_list)\n        output = self.head(emb)\n        return output\n```\n\n### not work\n\n- Input a total of 9 channels including the front and rear frames\n- Input 9ch as 3ch using 1x1Conv2d",
    "2413899": "May I ask how the weight of your model is determined? Is it manually adjusted?thank you very much if you can answer"
  }
}