{
  "id": 220632,
  "title": "45th Place - Silver Medal Solution",
  "url": "/competitions/cassava-leaf-disease-classification/writeups/abhinand-45th-place-silver-medal-solution",
  "author_name": "",
  "post_date": "2021-02-20T03:43:58.880Z",
  "votes": 51,
  "comment_count": 22,
  "views": 0,
  "content": "<blockquote>\n  <p><strong>Many congratulations to all the winners in this competition. Huge thanks to all the discussion topics, public notebooks and datasets - most of my learning came from them.</strong></p>\n</blockquote>\n<p>For the first time I am finishing so high in the final leaderboard grabbing a silver medal. I have failed miserably in past competitions, never had a satisfying finish but this time I really feel like I am learning from my mistakes, so yeah it feels great! </p>\n<p><br></p>\n<h2>Final Solution</h2>\n<h4>Dataset:</h4>\n<p><em>Competition Data ONLY. No extra data.</em></p>\n<h4>CV Strategy:</h4>\n<p>5 Fold Stratified CV</p>\n<h4>Models (Pretrained):</h4>\n<ul>\n<li>EfficientNet-B7 NS (Noisy Student)</li>\n<li>ViT Base16</li>\n</ul>\n<h4>Train Setting:</h4>\n<p><strong>Image Size:</strong> 512 for B7 and 384 for ViT<br>\n<strong>Epochs:</strong> 20 <br>\n<strong>Early Stopping:</strong> No (Saved Best Epoch)<br>\n<strong>Loss Function:</strong> Bi-tempered Logistic Loss with Label Smoothing<br>\n<strong>Optimizer:</strong> Good old \"Adam\"<br>\n<strong>LR Scheduler:</strong> Cosine Annealing with Warm Restarts<br>\n<strong>Batch Size:</strong> 32 (with gradient accumulation)<br>\n<strong>Augmentations:</strong> Standard (No CutMix, FMix or SnapMix)</p>\n<pre><code>            - Transpose\n            - HorizontalFlip\n            - VerticalFlip\n            - ShiftScaleRotate\n            - HueSaturationValue\n            - RandomBrightnessContrast\n            - CoarseDropout\n            - Cutout\n</code></pre>\n<blockquote>\n  <p>Edit: Both models didn't use the same augmentations, I did use mix augs for ViT. <br>\n     EfficientNet-B7: Standard Augs<br>\n     ViT Base P16: Standard + FMix + CutMix</p>\n</blockquote>\n<h4>Evaluation:</h4>\n<ul>\n<li>I used the 5 Fold OOF predictions to pick and evaluate the models based on \"Accuracy\".</li>\n<li>Treated the Public Leaderboard Score as an alternative fold (as suggested in the forums)</li>\n</ul>\n<h4>Inference:</h4>\n<p>I experimented a few things here, </p>\n<ul>\n<li>No TTA</li>\n<li>Light TTA (only flips)</li>\n<li>Standard TTA (used for aug)</li>\n</ul>\n<p>I noticed that my OOF predictions were more stable when I used Standard 4xTTA for both ViT and B7 so I went with that for the final submission.</p>\n<h4>Submission:</h4>\n<ul>\n<li>EfficientNet-B7 was my best single model</li>\n<li>I noticed that ViT alone was not enough on CV and LB</li>\n</ul>\n<p>I decided to evenly blend them at first and surprisingly that gave me a boost in OOF (CV) Score from 0.898 --&gt; 0.901 and also a boost in Public LB 0.902 --&gt; 0.905. However a weighted ensemble always seemed to be just short yet better than my single models. This gave me a feeling that an unweighted ensemble can cut it for me so I went with it.  </p>\n<h4>Results:</h4>\n<table>\n<thead>\n<tr>\n<th>Model</th>\n<th>CV</th>\n<th>Public LB</th>\n<th>Private LB</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>EfficientNet-B7 NS</td>\n<td>0.894</td>\n<td>0.900</td>\n<td>0.894</td>\n</tr>\n<tr>\n<td>ViT Base16</td>\n<td>0.888</td>\n<td>-</td>\n<td>-</td>\n</tr>\n<tr>\n<td>EfficientNet-B7 NS 4xTTA</td>\n<td>0.896</td>\n<td>0.902</td>\n<td>0.897</td>\n</tr>\n<tr>\n<td>ViT Base16    4xTTA</td>\n<td>0.891</td>\n<td>0.899</td>\n<td>0.896</td>\n</tr>\n<tr>\n<td>(0.35 * ViT) + (0.65 * B7) weighted ensemble with 4xTTA</td>\n<td>0.898</td>\n<td>0.903</td>\n<td>0.899</td>\n</tr>\n<tr>\n<td>ViT + B7 unweighted ensemble with 4xTTA</td>\n<td>0.901</td>\n<td>0.905</td>\n<td>0.900</td>\n</tr>\n</tbody>\n</table>\n<p>Looking forward to competing more and learning more!</p>",
  "messages": [
    {
      "id": "1209710",
      "postDate": "02/19/2021 02:42:58",
      "content": "<blockquote>\n  <p><strong>Many congratulations to all the winners in this competition. Huge thanks to all the discussion topics, public notebooks and datasets - most of my learning came from them.</strong></p>\n</blockquote>\n<p>For the first time I am finishing so high in the final leaderboard grabbing a silver medal. I have failed miserably in past competitions, never had a satisfying finish but this time I really feel like I am learning from my mistakes, so yeah it feels great! </p>\n<p><br></p>\n<h2>Final Solution</h2>\n<h4>Dataset:</h4>\n<p><em>Competition Data ONLY. No extra data.</em></p>\n<h4>CV Strategy:</h4>\n<p>5 Fold Stratified CV</p>\n<h4>Models (Pretrained):</h4>\n<ul>\n<li>EfficientNet-B7 NS (Noisy Student)</li>\n<li>ViT Base16</li>\n</ul>\n<h4>Train Setting:</h4>\n<p><strong>Image Size:</strong> 512 for B7 and 384 for ViT<br>\n<strong>Epochs:</strong> 20 <br>\n<strong>Early Stopping:</strong> No (Saved Best Epoch)<br>\n<strong>Loss Function:</strong> Bi-tempered Logistic Loss with Label Smoothing<br>\n<strong>Optimizer:</strong> Good old \"Adam\"<br>\n<strong>LR Scheduler:</strong> Cosine Annealing with Warm Restarts<br>\n<strong>Batch Size:</strong> 32 (with gradient accumulation)<br>\n<strong>Augmentations:</strong> Standard (No CutMix, FMix or SnapMix)</p>\n<pre><code>            - Transpose\n            - HorizontalFlip\n            - VerticalFlip\n            - ShiftScaleRotate\n            - HueSaturationValue\n            - RandomBrightnessContrast\n            - CoarseDropout\n            - Cutout\n</code></pre>\n<blockquote>\n  <p>Edit: Both models didn't use the same augmentations, I did use mix augs for ViT. <br>\n     EfficientNet-B7: Standard Augs<br>\n     ViT Base P16: Standard + FMix + CutMix</p>\n</blockquote>\n<h4>Evaluation:</h4>\n<ul>\n<li>I used the 5 Fold OOF predictions to pick and evaluate the models based on \"Accuracy\".</li>\n<li>Treated the Public Leaderboard Score as an alternative fold (as suggested in the forums)</li>\n</ul>\n<h4>Inference:</h4>\n<p>I experimented a few things here, </p>\n<ul>\n<li>No TTA</li>\n<li>Light TTA (only flips)</li>\n<li>Standard TTA (used for aug)</li>\n</ul>\n<p>I noticed that my OOF predictions were more stable when I used Standard 4xTTA for both ViT and B7 so I went with that for the final submission.</p>\n<h4>Submission:</h4>\n<ul>\n<li>EfficientNet-B7 was my best single model</li>\n<li>I noticed that ViT alone was not enough on CV and LB</li>\n</ul>\n<p>I decided to evenly blend them at first and surprisingly that gave me a boost in OOF (CV) Score from 0.898 --&gt; 0.901 and also a boost in Public LB 0.902 --&gt; 0.905. However a weighted ensemble always seemed to be just short yet better than my single models. This gave me a feeling that an unweighted ensemble can cut it for me so I went with it.  </p>\n<h4>Results:</h4>\n<table>\n<thead>\n<tr>\n<th>Model</th>\n<th>CV</th>\n<th>Public LB</th>\n<th>Private LB</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>EfficientNet-B7 NS</td>\n<td>0.894</td>\n<td>0.900</td>\n<td>0.894</td>\n</tr>\n<tr>\n<td>ViT Base16</td>\n<td>0.888</td>\n<td>-</td>\n<td>-</td>\n</tr>\n<tr>\n<td>EfficientNet-B7 NS 4xTTA</td>\n<td>0.896</td>\n<td>0.902</td>\n<td>0.897</td>\n</tr>\n<tr>\n<td>ViT Base16    4xTTA</td>\n<td>0.891</td>\n<td>0.899</td>\n<td>0.896</td>\n</tr>\n<tr>\n<td>(0.35 * ViT) + (0.65 * B7) weighted ensemble with 4xTTA</td>\n<td>0.898</td>\n<td>0.903</td>\n<td>0.899</td>\n</tr>\n<tr>\n<td>ViT + B7 unweighted ensemble with 4xTTA</td>\n<td>0.901</td>\n<td>0.905</td>\n<td>0.900</td>\n</tr>\n</tbody>\n</table>\n<p>Looking forward to competing more and learning more!</p>",
      "rawMarkdown": "> **Many congratulations to all the winners in this competition. Huge thanks to all the discussion topics, public notebooks and datasets - most of my learning came from them.**\n\nFor the first time I am finishing so high in the final leaderboard grabbing a silver medal. I have failed miserably in past competitions, never had a satisfying finish but this time I really feel like I am learning from my mistakes, so yeah it feels great! \n\n<br>\n\n## Final Solution\n\n#### Dataset:\n*Competition Data ONLY. No extra data.*\n\n#### CV Strategy:\n5 Fold Stratified CV\n\n#### Models (Pretrained):\n- EfficientNet-B7 NS (Noisy Student)\n- ViT Base16\n\n#### Train Setting:\n**Image Size:** 512 for B7 and 384 for ViT\n**Epochs:** 20 \n**Early Stopping:** No (Saved Best Epoch)\n**Loss Function:** Bi-tempered Logistic Loss with Label Smoothing\n**Optimizer:** Good old \"Adam\"\n**LR Scheduler:** Cosine Annealing with Warm Restarts\n**Batch Size:** 32 (with gradient accumulation)\n**Augmentations:** Standard (No CutMix, FMix or SnapMix)\n```\n            - Transpose\n            - HorizontalFlip\n            - VerticalFlip\n            - ShiftScaleRotate\n            - HueSaturationValue\n            - RandomBrightnessContrast\n            - CoarseDropout\n            - Cutout\n```\n> Edit: Both models didn't use the same augmentations, I did use mix augs for ViT. \n   EfficientNet-B7: Standard Augs\n   ViT Base P16: Standard + FMix + CutMix\n\n\n#### Evaluation: \n- I used the 5 Fold OOF predictions to pick and evaluate the models based on \"Accuracy\".\n- Treated the Public Leaderboard Score as an alternative fold (as suggested in the forums)\n\n#### Inference:\nI experimented a few things here, \n- No TTA\n- Light TTA (only flips)\n- Standard TTA (used for aug)\n\nI noticed that my OOF predictions were more stable when I used Standard 4xTTA for both ViT and B7 so I went with that for the final submission.\n\n#### Submission:\n- EfficientNet-B7 was my best single model\n- I noticed that ViT alone was not enough on CV and LB\n\nI decided to evenly blend them at first and surprisingly that gave me a boost in OOF (CV) Score from 0.898 --> 0.901 and also a boost in Public LB 0.902 --> 0.905. However a weighted ensemble always seemed to be just short yet better than my single models. This gave me a feeling that an unweighted ensemble can cut it for me so I went with it.  \n\n#### Results:\n\n| Model                            | CV        | Public LB | Private LB | \n| ----------------------- | ------- | ---------  | ---------- |\n| EfficientNet-B7 NS       | 0.894   | 0.900       | 0.894        |\n| ViT Base16                    | 0.888   | -       | -        |\n| EfficientNet-B7 NS 4xTTA      | 0.896   | 0.902       | 0.897        |\n| ViT Base16    4xTTA                | 0.891   | 0.899       | 0.896         |\n| (0.35 * ViT) + (0.65 * B7) weighted ensemble with 4xTTA  | 0.898   | 0.903       | 0.899 |\n| ViT + B7 unweighted ensemble with 4xTTA  | 0.901   | 0.905       | 0.900 |\n\n\nLooking forward to competing more and learning more!",
      "votes": null
    },
    {
      "id": "1209731",
      "postDate": "02/19/2021 02:53:51",
      "content": "<p>great work, congratulations!</p>",
      "rawMarkdown": "great work, congratulations!",
      "votes": null
    },
    {
      "id": "1209735",
      "postDate": "02/19/2021 02:57:16",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/wonjunpark\" target=\"_blank\">@wonjunpark</a> congrats to you too</p>",
      "rawMarkdown": "Thanks @wonjunpark congrats to you too",
      "votes": null
    },
    {
      "id": "1209784",
      "postDate": "02/19/2021 03:33:01",
      "content": "<p>Thank you so much for sharing and congratulations on the silver. Fantastic work!</p>",
      "rawMarkdown": "Thank you so much for sharing and congratulations on the silver. Fantastic work!",
      "votes": null
    },
    {
      "id": "1209788",
      "postDate": "02/19/2021 03:34:40",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/julianbakerphd\" target=\"_blank\">@julianbakerphd</a> </p>",
      "rawMarkdown": "Thanks @julianbakerphd",
      "votes": null
    },
    {
      "id": "1209797",
      "postDate": "02/19/2021 03:40:46",
      "content": "<p>Congrats on a solo silver medal. Great! <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a> </p>",
      "rawMarkdown": "Congrats on a solo silver medal. Great! @abhinand05",
      "votes": null
    },
    {
      "id": "1209798",
      "postDate": "02/19/2021 03:42:01",
      "content": "<p>Thanks, Abhinand for the detailed and useful post. It is encouraging to see that with a simple setup you were able to achieve a silver here. A quick question. Did you use your own hardware for training? Training 20 epochs/5 fold would have run easily for 12+ hours on a GPU, isn't it?. </p>",
      "rawMarkdown": "Thanks, Abhinand for the detailed and useful post. It is encouraging to see that with a simple setup you were able to achieve a silver here. A quick question. Did you use your own hardware for training? Training 20 epochs/5 fold would have run easily for 12+ hours on a GPU, isn't it?.",
      "votes": null
    },
    {
      "id": "1209808",
      "postDate": "02/19/2021 03:48:41",
      "content": "<p>My own hardware wasn't good enough I used it for the baseline b0 model though. I split the process into 10 epochs each every time and used Kaggle Hardware + Google Colab and waited long hours.</p>",
      "rawMarkdown": "My own hardware wasn't good enough I used it for the baseline b0 model though. I split the process into 10 epochs each every time and used Kaggle Hardware + Google Colab and waited long hours.",
      "votes": null
    },
    {
      "id": "1209824",
      "postDate": "02/19/2021 03:59:50",
      "content": "<p>Thank you for sharing these results! Wondering why you chose Efnet B7 first? What were the models you've tested at first? (If you did)</p>",
      "rawMarkdown": "Thank you for sharing these results! Wondering why you chose Efnet B7 first? What were the models you've tested at first? (If you did)",
      "votes": null
    },
    {
      "id": "1209838",
      "postDate": "02/19/2021 04:14:56",
      "content": "<p>Based on my CV score it was always slightly better than my B4 and gave a nice boost in LB and combined well with ViT. Maybe I could have still got similar results with smaller models but was short on time and resources so gave B7 a shot and luckily it paid off.   </p>",
      "rawMarkdown": "Based on my CV score it was always slightly better than my B4 and gave a nice boost in LB and combined well with ViT. Maybe I could have still got similar results with smaller models but was short on time and resources so gave B7 a shot and luckily it paid off.",
      "votes": null
    },
    {
      "id": "1209839",
      "postDate": "02/19/2021 04:16:37",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/piantic\" target=\"_blank\">@piantic</a> congrats on your medal as well </p>",
      "rawMarkdown": "Thanks @piantic congrats on your medal as well",
      "votes": null
    },
    {
      "id": "1209850",
      "postDate": "02/19/2021 04:28:43",
      "content": "<p>Congrats on your silver <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a>  ! Could you please say what you mean by \"unweighted ensemble\" at the last ? And as <em>serigne</em> mentioned is <a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220590\" target=\"_blank\">this</a> thread , many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ? Thanks for the write-up btw ! </p>",
      "rawMarkdown": "Congrats on your silver @abhinand05  ! Could you please say what you mean by \"unweighted ensemble\" at the last ? And as *serigne* mentioned is [this](https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220590) thread , many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ? Thanks for the write-up btw !",
      "votes": null
    },
    {
      "id": "1209876",
      "postDate": "02/19/2021 04:49:10",
      "content": "<blockquote>\n  <p>Could you please say what you mean by \"unweighted ensemble\" at the last </p>\n</blockquote>\n<p>Just the simple average over your predicted probabilities. </p>\n<blockquote>\n  <p>many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ?</p>\n</blockquote>\n<p>The margins are tiny in this competition. Maybe it was just a stroke of luck, my best single model B7 has only scored 0.897. </p>",
      "rawMarkdown": "> Could you please say what you mean by \"unweighted ensemble\" at the last \n\nJust the simple average over your predicted probabilities. \n\n> many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ?\n\nThe margins are tiny in this competition. Maybe it was just a stroke of luck, my best single model B7 has only scored 0.897.",
      "votes": null
    },
    {
      "id": "1209907",
      "postDate": "02/19/2021 05:24:17",
      "content": "<p>Ah, I see thank you! For me, I we tested only a few models such as B4, resnet and se-resnext… Wished we could've tried more. So for your final solution, did you use light or standard TTA? </p>",
      "rawMarkdown": "Ah, I see thank you! For me, I we tested only a few models such as B4, resnet and se-resnext... Wished we could've tried more. So for your final solution, did you use light or standard TTA?",
      "votes": null
    },
    {
      "id": "1209909",
      "postDate": "02/19/2021 05:24:55",
      "content": "<p>Couldn't be done without your support in discussions and notebooks haha</p>",
      "rawMarkdown": "Couldn't be done without your support in discussions and notebooks haha",
      "votes": null
    },
    {
      "id": "1209911",
      "postDate": "02/19/2021 05:27:15",
      "content": "<p>Standard TTA. </p>",
      "rawMarkdown": "Standard TTA.",
      "votes": null
    },
    {
      "id": "1210038",
      "postDate": "02/19/2021 07:03:17",
      "content": "<p>Congratulations.</p>\n<blockquote>\n  <p>Competition Data ONLY. No extra data.</p>\n</blockquote>\n<p>This is impressive!</p>\n<p>Mind to share a code?</p>",
      "rawMarkdown": "Congratulations.\n\n> Competition Data ONLY. No extra data.\n\nThis is impressive!\n\nMind to share a code?",
      "votes": null
    },
    {
      "id": "1210070",
      "postDate": "02/19/2021 07:28:57",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/nroman\" target=\"_blank\">@nroman</a> Will share code soon</p>",
      "rawMarkdown": "Thanks @nroman Will share code soon",
      "votes": null
    },
    {
      "id": "1210177",
      "postDate": "02/19/2021 08:39:53",
      "content": "<p>Congrats! </p>",
      "rawMarkdown": "Congrats!",
      "votes": null
    },
    {
      "id": "1210244",
      "postDate": "02/19/2021 09:37:46",
      "content": "<p>Nice to see different approaches. Congratulations!!</p>",
      "rawMarkdown": "Nice to see different approaches. Congratulations!!",
      "votes": null
    },
    {
      "id": "1210445",
      "postDate": "02/19/2021 12:49:52",
      "content": "<p>Congratulations!!!!!</p>\n<p>Also informative write-up…</p>",
      "rawMarkdown": "Congratulations!!!!!\n\nAlso informative write-up...",
      "votes": null
    },
    {
      "id": "1211467",
      "postDate": "02/20/2021 09:00:49",
      "content": "<p>Thanks for the write-up, Finally someone with great results with no extra data. That's impressive. Congratulations Man.<br>\nWill you be kind enough to share your training code of Vit and efficient models. Will be learning experience for beginners like me.</p>",
      "rawMarkdown": "Thanks for the write-up, Finally someone with great results with no extra data. That's impressive. Congratulations Man.\nWill you be kind enough to share your training code of Vit and efficient models. Will be learning experience for beginners like me.",
      "votes": null
    },
    {
      "id": "1212492",
      "postDate": "02/21/2021 09:14:22",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a> for sharing your solution writeup. </p>",
      "rawMarkdown": "Thanks @abhinand05 for sharing your solution writeup.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1209731,
      "author_name": "wonjunpark",
      "author_url": "",
      "post_date": "02/19/2021 02:53:51",
      "content": "<p>great work, congratulations!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1209735,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 02:57:16",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/wonjunpark\" target=\"_blank\">@wonjunpark</a> congrats to you too</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1209784,
      "author_name": "julianbakerphd",
      "author_url": "",
      "post_date": "02/19/2021 03:33:01",
      "content": "<p>Thank you so much for sharing and congratulations on the silver. Fantastic work!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1209788,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 03:34:40",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/julianbakerphd\" target=\"_blank\">@julianbakerphd</a> </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1209797,
      "author_name": "piantic",
      "author_url": "",
      "post_date": "02/19/2021 03:40:46",
      "content": "<p>Congrats on a solo silver medal. Great! <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a> </p>",
      "votes": null,
      "replies": [
        {
          "id": 1209839,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 04:16:37",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/piantic\" target=\"_blank\">@piantic</a> congrats on your medal as well </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1209909,
          "author_name": "andyjianzhou",
          "author_url": "",
          "post_date": "02/19/2021 05:24:55",
          "content": "<p>Couldn't be done without your support in discussions and notebooks haha</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1209798,
      "author_name": "krisho007",
      "author_url": "",
      "post_date": "02/19/2021 03:42:01",
      "content": "<p>Thanks, Abhinand for the detailed and useful post. It is encouraging to see that with a simple setup you were able to achieve a silver here. A quick question. Did you use your own hardware for training? Training 20 epochs/5 fold would have run easily for 12+ hours on a GPU, isn't it?. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1209808,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 03:48:41",
          "content": "<p>My own hardware wasn't good enough I used it for the baseline b0 model though. I split the process into 10 epochs each every time and used Kaggle Hardware + Google Colab and waited long hours.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1209824,
      "author_name": "andyjianzhou",
      "author_url": "",
      "post_date": "02/19/2021 03:59:50",
      "content": "<p>Thank you for sharing these results! Wondering why you chose Efnet B7 first? What were the models you've tested at first? (If you did)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1209838,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 04:14:56",
          "content": "<p>Based on my CV score it was always slightly better than my B4 and gave a nice boost in LB and combined well with ViT. Maybe I could have still got similar results with smaller models but was short on time and resources so gave B7 a shot and luckily it paid off.   </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1209907,
          "author_name": "andyjianzhou",
          "author_url": "",
          "post_date": "02/19/2021 05:24:17",
          "content": "<p>Ah, I see thank you! For me, I we tested only a few models such as B4, resnet and se-resnext… Wished we could've tried more. So for your final solution, did you use light or standard TTA? </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1209911,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 05:27:15",
          "content": "<p>Standard TTA. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1209850,
      "author_name": "zarif98sjs",
      "author_url": "",
      "post_date": "02/19/2021 04:28:43",
      "content": "<p>Congrats on your silver <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a>  ! Could you please say what you mean by \"unweighted ensemble\" at the last ? And as <em>serigne</em> mentioned is <a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220590\" target=\"_blank\">this</a> thread , many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ? Thanks for the write-up btw ! </p>",
      "votes": null,
      "replies": [
        {
          "id": 1209876,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 04:49:10",
          "content": "<blockquote>\n  <p>Could you please say what you mean by \"unweighted ensemble\" at the last </p>\n</blockquote>\n<p>Just the simple average over your predicted probabilities. </p>\n<blockquote>\n  <p>many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ?</p>\n</blockquote>\n<p>The margins are tiny in this competition. Maybe it was just a stroke of luck, my best single model B7 has only scored 0.897. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1210038,
      "author_name": "nroman",
      "author_url": "",
      "post_date": "02/19/2021 07:03:17",
      "content": "<p>Congratulations.</p>\n<blockquote>\n  <p>Competition Data ONLY. No extra data.</p>\n</blockquote>\n<p>This is impressive!</p>\n<p>Mind to share a code?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1210070,
          "author_name": "abhinand05",
          "author_url": "",
          "post_date": "02/19/2021 07:28:57",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/nroman\" target=\"_blank\">@nroman</a> Will share code soon</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1210177,
      "author_name": "elcaiseri",
      "author_url": "",
      "post_date": "02/19/2021 08:39:53",
      "content": "<p>Congrats! </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1210244,
      "author_name": "saurabh2mishra",
      "author_url": "",
      "post_date": "02/19/2021 09:37:46",
      "content": "<p>Nice to see different approaches. Congratulations!!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1210445,
      "author_name": "subbuvolvosekar",
      "author_url": "",
      "post_date": "02/19/2021 12:49:52",
      "content": "<p>Congratulations!!!!!</p>\n<p>Also informative write-up…</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1211467,
      "author_name": "robertlangdonvinci",
      "author_url": "",
      "post_date": "02/20/2021 09:00:49",
      "content": "<p>Thanks for the write-up, Finally someone with great results with no extra data. That's impressive. Congratulations Man.<br>\nWill you be kind enough to share your training code of Vit and efficient models. Will be learning experience for beginners like me.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1212492,
      "author_name": "suryajrrafl",
      "author_url": "",
      "post_date": "02/21/2021 09:14:22",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/abhinand05\" target=\"_blank\">@abhinand05</a> for sharing your solution writeup. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1209710": "> **Many congratulations to all the winners in this competition. Huge thanks to all the discussion topics, public notebooks and datasets - most of my learning came from them.**\n\nFor the first time I am finishing so high in the final leaderboard grabbing a silver medal. I have failed miserably in past competitions, never had a satisfying finish but this time I really feel like I am learning from my mistakes, so yeah it feels great! \n\n<br>\n\n## Final Solution\n\n#### Dataset:\n*Competition Data ONLY. No extra data.*\n\n#### CV Strategy:\n5 Fold Stratified CV\n\n#### Models (Pretrained):\n- EfficientNet-B7 NS (Noisy Student)\n- ViT Base16\n\n#### Train Setting:\n**Image Size:** 512 for B7 and 384 for ViT\n**Epochs:** 20 \n**Early Stopping:** No (Saved Best Epoch)\n**Loss Function:** Bi-tempered Logistic Loss with Label Smoothing\n**Optimizer:** Good old \"Adam\"\n**LR Scheduler:** Cosine Annealing with Warm Restarts\n**Batch Size:** 32 (with gradient accumulation)\n**Augmentations:** Standard (No CutMix, FMix or SnapMix)\n```\n            - Transpose\n            - HorizontalFlip\n            - VerticalFlip\n            - ShiftScaleRotate\n            - HueSaturationValue\n            - RandomBrightnessContrast\n            - CoarseDropout\n            - Cutout\n```\n> Edit: Both models didn't use the same augmentations, I did use mix augs for ViT. \n   EfficientNet-B7: Standard Augs\n   ViT Base P16: Standard + FMix + CutMix\n\n\n#### Evaluation: \n- I used the 5 Fold OOF predictions to pick and evaluate the models based on \"Accuracy\".\n- Treated the Public Leaderboard Score as an alternative fold (as suggested in the forums)\n\n#### Inference:\nI experimented a few things here, \n- No TTA\n- Light TTA (only flips)\n- Standard TTA (used for aug)\n\nI noticed that my OOF predictions were more stable when I used Standard 4xTTA for both ViT and B7 so I went with that for the final submission.\n\n#### Submission:\n- EfficientNet-B7 was my best single model\n- I noticed that ViT alone was not enough on CV and LB\n\nI decided to evenly blend them at first and surprisingly that gave me a boost in OOF (CV) Score from 0.898 --> 0.901 and also a boost in Public LB 0.902 --> 0.905. However a weighted ensemble always seemed to be just short yet better than my single models. This gave me a feeling that an unweighted ensemble can cut it for me so I went with it.  \n\n#### Results:\n\n| Model                            | CV        | Public LB | Private LB | \n| ----------------------- | ------- | ---------  | ---------- |\n| EfficientNet-B7 NS       | 0.894   | 0.900       | 0.894        |\n| ViT Base16                    | 0.888   | -       | -        |\n| EfficientNet-B7 NS 4xTTA      | 0.896   | 0.902       | 0.897        |\n| ViT Base16    4xTTA                | 0.891   | 0.899       | 0.896         |\n| (0.35 * ViT) + (0.65 * B7) weighted ensemble with 4xTTA  | 0.898   | 0.903       | 0.899 |\n| ViT + B7 unweighted ensemble with 4xTTA  | 0.901   | 0.905       | 0.900 |\n\n\nLooking forward to competing more and learning more!",
    "1209731": "great work, congratulations!",
    "1209735": "Thanks @wonjunpark congrats to you too",
    "1209784": "Thank you so much for sharing and congratulations on the silver. Fantastic work!",
    "1209788": "Thanks @julianbakerphd",
    "1209797": "Congrats on a solo silver medal. Great! @abhinand05",
    "1209798": "Thanks, Abhinand for the detailed and useful post. It is encouraging to see that with a simple setup you were able to achieve a silver here. A quick question. Did you use your own hardware for training? Training 20 epochs/5 fold would have run easily for 12+ hours on a GPU, isn't it?.",
    "1209808": "My own hardware wasn't good enough I used it for the baseline b0 model though. I split the process into 10 epochs each every time and used Kaggle Hardware + Google Colab and waited long hours.",
    "1209824": "Thank you for sharing these results! Wondering why you chose Efnet B7 first? What were the models you've tested at first? (If you did)",
    "1209838": "Based on my CV score it was always slightly better than my B4 and gave a nice boost in LB and combined well with ViT. Maybe I could have still got similar results with smaller models but was short on time and resources so gave B7 a shot and luckily it paid off.",
    "1209839": "Thanks @piantic congrats on your medal as well",
    "1209850": "Congrats on your silver @abhinand05  ! Could you please say what you mean by \"unweighted ensemble\" at the last ? And as *serigne* mentioned is [this](https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220590) thread , many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ? Thanks for the write-up btw !",
    "1209876": "> Could you please say what you mean by \"unweighted ensemble\" at the last \n\nJust the simple average over your predicted probabilities. \n\n> many single models seems to outperform the ensemble of those good models . Could you share your thoughts on this ?\n\nThe margins are tiny in this competition. Maybe it was just a stroke of luck, my best single model B7 has only scored 0.897.",
    "1209907": "Ah, I see thank you! For me, I we tested only a few models such as B4, resnet and se-resnext... Wished we could've tried more. So for your final solution, did you use light or standard TTA?",
    "1209909": "Couldn't be done without your support in discussions and notebooks haha",
    "1209911": "Standard TTA.",
    "1210038": "Congratulations.\n\n> Competition Data ONLY. No extra data.\n\nThis is impressive!\n\nMind to share a code?",
    "1210070": "Thanks @nroman Will share code soon",
    "1210177": "Congrats!",
    "1210244": "Nice to see different approaches. Congratulations!!",
    "1210445": "Congratulations!!!!!\n\nAlso informative write-up...",
    "1211467": "Thanks for the write-up, Finally someone with great results with no extra data. That's impressive. Congratulations Man.\nWill you be kind enough to share your training code of Vit and efficient models. Will be learning experience for beginners like me.",
    "1212492": "Thanks @abhinand05 for sharing your solution writeup."
  },
  "source": "meta"
}