{
  "id": 320678,
  "title": "Starter code for Luminide (LB score 85%)",
  "url": "/competitions/sorghum-id-fgvc-9/discussion/320678",
  "author_name": "",
  "post_date": "2022-04-22T21:33:47.803176500Z",
  "votes": 10,
  "comment_count": 5,
  "views": 0,
  "content": "<p>There is a new template available in <a href=\"https://www.luminide.com/\" target=\"_blank\">Luminide</a> that is customized for this challenge. In order to comply with the rules, I have copied the source code to a <a href=\"https://github.com/luminide/example-sorghum\" target=\"_blank\">public repo</a>. While some of the code is specifically for use with Luminide, I hope this helps everyone improve their solutions.</p>\n<h3>Summary</h3>\n<ul>\n<li>The published solution divides each image into multiple overlapping patches with a common label. For each test image, predictions are averaged over all patches.</li>\n<li>An additional transform tries to filter out non-green pixels from random images while training.</li>\n<li>Training-validation split is done based on timestamps (to approximate the training-test split that is based on location).</li>\n</ul>\n<h3>About Luminide</h3>\n<p>Luminide is a newly released cloud-based IDE, specifically built for AI model development. It has built-in support for:</p>\n<ul>\n<li>Hyperparameter tuning</li>\n<li>Experiment tracking</li>\n<li>1-click connect to cloud GPU servers</li>\n</ul>\n<h4>For more details, <a href=\"https://www.luminide.com/automate\" target=\"_blank\">see our blog</a>.</h4>",
  "messages": [
    {
      "id": "1764815",
      "postDate": "04/22/2022 21:33:47",
      "content": "<p>There is a new template available in <a href=\"https://www.luminide.com/\" target=\"_blank\">Luminide</a> that is customized for this challenge. In order to comply with the rules, I have copied the source code to a <a href=\"https://github.com/luminide/example-sorghum\" target=\"_blank\">public repo</a>. While some of the code is specifically for use with Luminide, I hope this helps everyone improve their solutions.</p>\n<h3>Summary</h3>\n<ul>\n<li>The published solution divides each image into multiple overlapping patches with a common label. For each test image, predictions are averaged over all patches.</li>\n<li>An additional transform tries to filter out non-green pixels from random images while training.</li>\n<li>Training-validation split is done based on timestamps (to approximate the training-test split that is based on location).</li>\n</ul>\n<h3>About Luminide</h3>\n<p>Luminide is a newly released cloud-based IDE, specifically built for AI model development. It has built-in support for:</p>\n<ul>\n<li>Hyperparameter tuning</li>\n<li>Experiment tracking</li>\n<li>1-click connect to cloud GPU servers</li>\n</ul>\n<h4>For more details, <a href=\"https://www.luminide.com/automate\" target=\"_blank\">see our blog</a>.</h4>",
      "rawMarkdown": "There is a new template available in [Luminide](https://www.luminide.com/) that is customized for this challenge. In order to comply with the rules, I have copied the source code to a [public repo](https://github.com/luminide/example-sorghum). While some of the code is specifically for use with Luminide, I hope this helps everyone improve their solutions.\n\n### Summary\n- The published solution divides each image into multiple overlapping patches with a common label. For each test image, predictions are averaged over all patches.\n- An additional transform tries to filter out non-green pixels from random images while training.\n- Training-validation split is done based on timestamps (to approximate the training-test split that is based on location).\n\n### About Luminide\nLuminide is a newly released cloud-based IDE, specifically built for AI model development. It has built-in support for:\n- Hyperparameter tuning\n- Experiment tracking\n- 1-click connect to cloud GPU servers\n\n#### For more details, [see our blog](https://www.luminide.com/automate).",
      "votes": null
    },
    {
      "id": "1767931",
      "postDate": "04/25/2022 19:47:14",
      "content": "<p>The distribution of predictions looks strange. The images below are from the report generated by Luminide.</p>\n<p>It is unclear if the model is prone to skewed predictions or if the test set distribution is just naturally unbalanced.</p>\n<p><img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution1.png\" alt=\"Predicted distribution on test set\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution2.png\" alt=\"Predicted distribution on test set\"></p>",
      "rawMarkdown": "The distribution of predictions looks strange. The images below are from the report generated by Luminide.\n\nIt is unclear if the model is prone to skewed predictions or if the test set distribution is just naturally unbalanced.\n\n![Predicted distribution on test set](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution1.png)\n![Predicted distribution on test set](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution2.png)",
      "votes": null
    },
    {
      "id": "1767934",
      "postDate": "04/25/2022 19:53:45",
      "content": "<p>A few class activation maps on images sampled from the training set below. Good to see that the model is in fact looking at the leaves and not the soil.<br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam1.png\" alt=\"cam1\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam2.png\" alt=\"cam2\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam3.png\" alt=\"cam3\"></p>",
      "rawMarkdown": "A few class activation maps on images sampled from the training set below. Good to see that the model is in fact looking at the leaves and not the soil.\n![cam1](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam1.png)\n![cam2](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam2.png)\n![cam3](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam3.png)",
      "votes": null
    },
    {
      "id": "1770411",
      "postDate": "04/28/2022 08:36:19",
      "content": "<p>any code example on how you generated these heatmaps ?</p>",
      "rawMarkdown": "any code example on how you generated these heatmaps ?",
      "votes": null
    },
    {
      "id": "1771109",
      "postDate": "04/28/2022 22:26:10",
      "content": "<p>The class activation maps are generated with <a href=\"https://arxiv.org/abs/1710.11063\" target=\"_blank\">gradcam++</a>. For source code, see the file called <code>report.ipynb</code> in the public repo that is linked in the original post. The code expects a pretrained model called model.pth. Also <a href=\"https://github.com/jacobgil/pytorch-grad-cam\" target=\"_blank\">grad-cam</a> must be installed. If you are using Luminide, run report.sh as an experiment and these maps would be available inside report.html.</p>",
      "rawMarkdown": "The class activation maps are generated with [gradcam++](https://arxiv.org/abs/1710.11063). For source code, see the file called `report.ipynb` in the public repo that is linked in the original post. The code expects a pretrained model called model.pth. Also [grad-cam](https://github.com/jacobgil/pytorch-grad-cam) must be installed. If you are using Luminide, run report.sh as an experiment and these maps would be available inside report.html.",
      "votes": null
    },
    {
      "id": "1775145",
      "postDate": "05/02/2022 18:30:02",
      "content": "<p>I tried Luminide with the template for this competition and it worked great.  The hyperparameter optimization feature was especially easy to use.  I set it to run 30 trials, and I got better results on trials 1, 10, 16, and 23.  The hyperparameters which led to the best result (score of 0.858) were the following:</p>\n<pre><code>%YAML 1.1\n---\n# this can be any network from the timm library\narch: 'seresnext50_32x4d'  # updated (trial 1)\npretrained: true\ndropout_rate: 0.75 # updated (trial 23)\nimage_size: 264 # updated (trial 23)\ncrop_size: 0.96 # updated (trial 23)\noptim: adam\nlr: 0.0005995437664447224 # updated (trial 23)\nweight_decay: 0.01 # updated (trial 25)\nbatch_size: 96\n\n# scheduler settings\ngamma: 0.96\n\n# data augmentation\naug_prob: 0.584551128800228 # updated (trial 23)\nstrong_aug: false\nmax_cutout: 10 # updated (trial 23)\nsegment_green: 0.09549084428723903 # updated (trial 23)\nequalize_hist: false\n</code></pre>",
      "rawMarkdown": "I tried Luminide with the template for this competition and it worked great.  The hyperparameter optimization feature was especially easy to use.  I set it to run 30 trials, and I got better results on trials 1, 10, 16, and 23.  The hyperparameters which led to the best result (score of 0.858) were the following:\n\n```\n%YAML 1.1\n---\n# this can be any network from the timm library\narch: 'seresnext50_32x4d'  # updated (trial 1)\npretrained: true\ndropout_rate: 0.75 # updated (trial 23)\nimage_size: 264 # updated (trial 23)\ncrop_size: 0.96 # updated (trial 23)\noptim: adam\nlr: 0.0005995437664447224 # updated (trial 23)\nweight_decay: 0.01 # updated (trial 25)\nbatch_size: 96\n\n# scheduler settings\ngamma: 0.96\n\n# data augmentation\naug_prob: 0.584551128800228 # updated (trial 23)\nstrong_aug: false\nmax_cutout: 10 # updated (trial 23)\nsegment_green: 0.09549084428723903 # updated (trial 23)\nequalize_hist: false\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1767931,
      "author_name": "anlthms",
      "author_url": "",
      "post_date": "04/25/2022 19:47:14",
      "content": "<p>The distribution of predictions looks strange. The images below are from the report generated by Luminide.</p>\n<p>It is unclear if the model is prone to skewed predictions or if the test set distribution is just naturally unbalanced.</p>\n<p><img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution1.png\" alt=\"Predicted distribution on test set\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution2.png\" alt=\"Predicted distribution on test set\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1767934,
      "author_name": "anlthms",
      "author_url": "",
      "post_date": "04/25/2022 19:53:45",
      "content": "<p>A few class activation maps on images sampled from the training set below. Good to see that the model is in fact looking at the leaves and not the soil.<br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam1.png\" alt=\"cam1\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam2.png\" alt=\"cam2\"><br>\n<img src=\"https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam3.png\" alt=\"cam3\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 1770411,
          "author_name": "mithilsalunkhe",
          "author_url": "",
          "post_date": "04/28/2022 08:36:19",
          "content": "<p>any code example on how you generated these heatmaps ?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1771109,
          "author_name": "anlthms",
          "author_url": "",
          "post_date": "04/28/2022 22:26:10",
          "content": "<p>The class activation maps are generated with <a href=\"https://arxiv.org/abs/1710.11063\" target=\"_blank\">gradcam++</a>. For source code, see the file called <code>report.ipynb</code> in the public repo that is linked in the original post. The code expects a pretrained model called model.pth. Also <a href=\"https://github.com/jacobgil/pytorch-grad-cam\" target=\"_blank\">grad-cam</a> must be installed. If you are using Luminide, run report.sh as an experiment and these maps would be available inside report.html.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1775145,
      "author_name": "drluke",
      "author_url": "",
      "post_date": "05/02/2022 18:30:02",
      "content": "<p>I tried Luminide with the template for this competition and it worked great.  The hyperparameter optimization feature was especially easy to use.  I set it to run 30 trials, and I got better results on trials 1, 10, 16, and 23.  The hyperparameters which led to the best result (score of 0.858) were the following:</p>\n<pre><code>%YAML 1.1\n---\n# this can be any network from the timm library\narch: 'seresnext50_32x4d'  # updated (trial 1)\npretrained: true\ndropout_rate: 0.75 # updated (trial 23)\nimage_size: 264 # updated (trial 23)\ncrop_size: 0.96 # updated (trial 23)\noptim: adam\nlr: 0.0005995437664447224 # updated (trial 23)\nweight_decay: 0.01 # updated (trial 25)\nbatch_size: 96\n\n# scheduler settings\ngamma: 0.96\n\n# data augmentation\naug_prob: 0.584551128800228 # updated (trial 23)\nstrong_aug: false\nmax_cutout: 10 # updated (trial 23)\nsegment_green: 0.09549084428723903 # updated (trial 23)\nequalize_hist: false\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1764815": "There is a new template available in [Luminide](https://www.luminide.com/) that is customized for this challenge. In order to comply with the rules, I have copied the source code to a [public repo](https://github.com/luminide/example-sorghum). While some of the code is specifically for use with Luminide, I hope this helps everyone improve their solutions.\n\n### Summary\n- The published solution divides each image into multiple overlapping patches with a common label. For each test image, predictions are averaged over all patches.\n- An additional transform tries to filter out non-green pixels from random images while training.\n- Training-validation split is done based on timestamps (to approximate the training-test split that is based on location).\n\n### About Luminide\nLuminide is a newly released cloud-based IDE, specifically built for AI model development. It has built-in support for:\n- Hyperparameter tuning\n- Experiment tracking\n- 1-click connect to cloud GPU servers\n\n#### For more details, [see our blog](https://www.luminide.com/automate).",
    "1767931": "The distribution of predictions looks strange. The images below are from the report generated by Luminide.\n\nIt is unclear if the model is prone to skewed predictions or if the test set distribution is just naturally unbalanced.\n\n![Predicted distribution on test set](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution1.png)\n![Predicted distribution on test set](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-predicted-distribution2.png)",
    "1767934": "A few class activation maps on images sampled from the training set below. Good to see that the model is in fact looking at the leaves and not the soil.\n![cam1](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam1.png)\n![cam2](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam2.png)\n![cam3](https://raw.githubusercontent.com/anlthms/image-repo/main/sorghum-cam3.png)",
    "1770411": "any code example on how you generated these heatmaps ?",
    "1771109": "The class activation maps are generated with [gradcam++](https://arxiv.org/abs/1710.11063). For source code, see the file called `report.ipynb` in the public repo that is linked in the original post. The code expects a pretrained model called model.pth. Also [grad-cam](https://github.com/jacobgil/pytorch-grad-cam) must be installed. If you are using Luminide, run report.sh as an experiment and these maps would be available inside report.html.",
    "1775145": "I tried Luminide with the template for this competition and it worked great.  The hyperparameter optimization feature was especially easy to use.  I set it to run 30 trials, and I got better results on trials 1, 10, 16, and 23.  The hyperparameters which led to the best result (score of 0.858) were the following:\n\n```\n%YAML 1.1\n---\n# this can be any network from the timm library\narch: 'seresnext50_32x4d'  # updated (trial 1)\npretrained: true\ndropout_rate: 0.75 # updated (trial 23)\nimage_size: 264 # updated (trial 23)\ncrop_size: 0.96 # updated (trial 23)\noptim: adam\nlr: 0.0005995437664447224 # updated (trial 23)\nweight_decay: 0.01 # updated (trial 25)\nbatch_size: 96\n\n# scheduler settings\ngamma: 0.96\n\n# data augmentation\naug_prob: 0.584551128800228 # updated (trial 23)\nstrong_aug: false\nmax_cutout: 10 # updated (trial 23)\nsegment_green: 0.09549084428723903 # updated (trial 23)\nequalize_hist: false\n```"
  },
  "source": "meta"
}