{
  "id": 107948,
  "title": "Congrats to all !! 108th place solution | first medal !! ",
  "url": "/competitions/aptos2019-blindness-detection/writeups/rohit-modi-congrats-to-all-108th-place-solution-fi",
  "author_name": "",
  "post_date": "2019-09-11T05:47:25.507Z",
  "votes": 5,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Congrats to the winners and all the participants !!\nI really want to thank <a href=\"/drhabib\">@drhabib</a> and <a href=\"/ratthachat\">@ratthachat</a> and everyone else who shared their insights and work in notebooks and discussion forums, it helped me a lot. \nWell my solution is pretty simple, the two things that really worked for me were : \n1. Test Time Augmentation\n2. Ensembling 5 models</p>\n\n<strong>Overview</strong>\n\n<ul>\n<li>Ensemble 5 models - all EfficientNets B3 with image size 300.</li>\n<li>a lot of augmentation.</li>\n<li>soft TTA.</li>\n<li>Preprocessing - only cropping the black borders.</li>\n<li>using Keras.</li>\n</ul>\n\n<strong>Score</strong>\n\n<ul>\n<li>The model that gave me best results scored 0.810 on the public LB and 0.921 on the private LB.</li>\n<li>Best performing model on Public lb (0.814) gave 0.917 on the Private LB.</li>\n</ul>\n\n<strong>Training</strong> -\n\n<p>i used the Efficientnet B3 with image size 300, pre-trained on the old competition data and then fine-tuned on this competition data. I used a lot of augmentations - zoom_range(0.25-0.35), horizontal and vertical flips, and rotation(360).\nTTA - used a very soft tta - getting predictions on test images, randomly rotating 1-6 degrees and making predictions again and then again rotating original image to 7-12 degrees. Did the same for all 5 models,  and then taking mode of predictions for each type of tta from each model.\nthis gave me three lists of predictions - one for each tta, and then again taking mode of predictions of those three lists.\nModels used for ensembling with TTA, scored - 0.784, 0.790, 0.794, 0.797 and another model with 0.797 on public lb.</p>\n\n<p>TTA gave me a boost of about 0.02 as these above models scored around 0.77-0.78 on public lb.\nEnsembling gave me a huge boost.</p>\n\n<p>Thanks to Kaggle and APTOS for this wonderful competition, it taught me a lot.</p>",
  "messages": [
    {
      "id": "620943",
      "postDate": "09/08/2019 04:58:32",
      "content": "<p>Congrats to the winners and all the participants !!\nI really want to thank <a href=\"/drhabib\">@drhabib</a> and <a href=\"/ratthachat\">@ratthachat</a> and everyone else who shared their insights and work in notebooks and discussion forums, it helped me a lot. \nWell my solution is pretty simple, the two things that really worked for me were : \n1. Test Time Augmentation\n2. Ensembling 5 models</p>\n\n<strong>Overview</strong>\n\n<ul>\n<li>Ensemble 5 models - all EfficientNets B3 with image size 300.</li>\n<li>a lot of augmentation.</li>\n<li>soft TTA.</li>\n<li>Preprocessing - only cropping the black borders.</li>\n<li>using Keras.</li>\n</ul>\n\n<strong>Score</strong>\n\n<ul>\n<li>The model that gave me best results scored 0.810 on the public LB and 0.921 on the private LB.</li>\n<li>Best performing model on Public lb (0.814) gave 0.917 on the Private LB.</li>\n</ul>\n\n<strong>Training</strong> -\n\n<p>i used the Efficientnet B3 with image size 300, pre-trained on the old competition data and then fine-tuned on this competition data. I used a lot of augmentations - zoom_range(0.25-0.35), horizontal and vertical flips, and rotation(360).\nTTA - used a very soft tta - getting predictions on test images, randomly rotating 1-6 degrees and making predictions again and then again rotating original image to 7-12 degrees. Did the same for all 5 models,  and then taking mode of predictions for each type of tta from each model.\nthis gave me three lists of predictions - one for each tta, and then again taking mode of predictions of those three lists.\nModels used for ensembling with TTA, scored - 0.784, 0.790, 0.794, 0.797 and another model with 0.797 on public lb.</p>\n\n<p>TTA gave me a boost of about 0.02 as these above models scored around 0.77-0.78 on public lb.\nEnsembling gave me a huge boost.</p>\n\n<p>Thanks to Kaggle and APTOS for this wonderful competition, it taught me a lot.</p>",
      "rawMarkdown": "Congrats to the winners and all the participants !!\nI really want to thank @drhabib and @ratthachat and everyone else who shared their insights and work in notebooks and discussion forums, it helped me a lot. \nWell my solution is pretty simple, the two things that really worked for me were : \n1. Test Time Augmentation\n2. Ensembling 5 models\n\n##### **Overview** \n- Ensemble 5 models - all EfficientNets B3 with image size 300.\n- a lot of augmentation.\n- soft TTA.\n- Preprocessing - only cropping the black borders.\n- using Keras.\n\n##### **Score** \n- The model that gave me best results scored 0.810 on the public LB and 0.921 on the private LB.\n- Best performing model on Public lb (0.814) gave 0.917 on the Private LB.\n\n##### **Training** -\ni used the Efficientnet B3 with image size 300, pre-trained on the old competition data and then fine-tuned on this competition data. I used a lot of augmentations - zoom_range(0.25-0.35), horizontal and vertical flips, and rotation(360).\nTTA - used a very soft tta - getting predictions on test images, randomly rotating 1-6 degrees and making predictions again and then again rotating original image to 7-12 degrees. Did the same for all 5 models,  and then taking mode of predictions for each type of tta from each model.\nthis gave me three lists of predictions - one for each tta, and then again taking mode of predictions of those three lists.\nModels used for ensembling with TTA, scored - 0.784, 0.790, 0.794, 0.797 and another model with 0.797 on public lb.\n\nTTA gave me a boost of about 0.02 as these above models scored around 0.77-0.78 on public lb.\nEnsembling gave me a huge boost.\n\nThanks to Kaggle and APTOS for this wonderful competition, it taught me a lot.",
      "votes": null
    },
    {
      "id": "620955",
      "postDate": "09/08/2019 05:10:38",
      "content": "<p>Congratulations\nGreat work\nAnd Thanks for sharing your approach and insights.!! <a href=\"/modojj\">@modojj</a> </p>",
      "rawMarkdown": "Congratulations\nGreat work\nAnd Thanks for sharing your approach and insights.!! @modojj",
      "votes": null
    },
    {
      "id": "620960",
      "postDate": "09/08/2019 05:24:08",
      "content": "<p>Hi Rohit, If possible can you please share you Keras kernals.</p>",
      "rawMarkdown": "Hi Rohit, If possible can you please share you Keras kernals.",
      "votes": null
    },
    {
      "id": "620963",
      "postDate": "09/08/2019 05:29:41",
      "content": "<p>Hello <a href=\"/mayank17\">@mayank17</a>, Yes i will share my kernels, actually i have created 3 kernels one for training on old data, another one for training the same model on new data and one for inference.</p>",
      "rawMarkdown": "Hello @mayank17, Yes i will share my kernels, actually i have created 3 kernels one for training on old data, another one for training the same model on new data and one for inference.",
      "votes": null
    },
    {
      "id": "620968",
      "postDate": "09/08/2019 05:39:55",
      "content": "<p>Thanks <a href=\"/modojj\">@modojj</a> .  I asked this for two reasons. </p>\n\n<p>1) I am very new to ML and wanted to learn from others implementation.\n2) I also used keras but couldn't cross  .76. </p>\n\n<p>Thanks for all the help in advance !! :) </p>",
      "rawMarkdown": "Thanks @modojj .  I asked this for two reasons. \n\n1) I am very new to ML and wanted to learn from others implementation.\n2) I also used keras but couldn't cross  .76. \n\nThanks for all the help in advance !! :)",
      "votes": null
    },
    {
      "id": "620975",
      "postDate": "09/08/2019 05:48:20",
      "content": "<p><a href=\"/mayank17\">@mayank17</a> Did you use the old data ? because i was also not able to cross the 0.762 score without using the old data.</p>",
      "rawMarkdown": "mayank17 Did you use the old data ? because i was also not able to cross the 0.762 score without using the old data.",
      "votes": null
    },
    {
      "id": "621028",
      "postDate": "09/08/2019 06:51:50",
      "content": "<p>yes I did use old data also.. but not sure where it went wrong..  May be once I see your then I will be able to find issue with mine.</p>\n\n<p><a href=\"https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474\">https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474</a></p>\n\n<p>I am very new to ML. :)</p>",
      "rawMarkdown": "yes I did use old data also.. but not sure where it went wrong..  May be once I see your then I will be able to find issue with mine.\n\n[https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474](https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474)\n\n\nI am very new to ML. :)",
      "votes": null
    },
    {
      "id": "621056",
      "postDate": "09/08/2019 07:16:13",
      "content": "<p><a href=\"/mayank17\">@mayank17</a> here <a href=\"https://www.kaggle.com/modojj/keras-efficientnetb3-tta\">Keras EfficientNetB3 + TTA</a>, i combined the 2019 data training phase and the inference in a single kernel, note - i couldn't combine the old data training but old data training and configuration is exactly same as in this kernel.</p>",
      "rawMarkdown": "mayank17 here [Keras EfficientNetB3 + TTA](https://www.kaggle.com/modojj/keras-efficientnetb3-tta), i combined the 2019 data training phase and the inference in a single kernel, note - i couldn't combine the old data training but old data training and configuration is exactly same as in this kernel.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 620955,
      "author_name": "veeralakrishna",
      "author_url": "",
      "post_date": "09/08/2019 05:10:38",
      "content": "<p>Congratulations\nGreat work\nAnd Thanks for sharing your approach and insights.!! <a href=\"/modojj\">@modojj</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 620960,
      "author_name": "mayank17",
      "author_url": "",
      "post_date": "09/08/2019 05:24:08",
      "content": "<p>Hi Rohit, If possible can you please share you Keras kernals.</p>",
      "votes": null,
      "replies": [
        {
          "id": 620963,
          "author_name": "modojj",
          "author_url": "",
          "post_date": "09/08/2019 05:29:41",
          "content": "<p>Hello <a href=\"/mayank17\">@mayank17</a>, Yes i will share my kernels, actually i have created 3 kernels one for training on old data, another one for training the same model on new data and one for inference.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 620968,
          "author_name": "mayank17",
          "author_url": "",
          "post_date": "09/08/2019 05:39:55",
          "content": "<p>Thanks <a href=\"/modojj\">@modojj</a> .  I asked this for two reasons. </p>\n\n<p>1) I am very new to ML and wanted to learn from others implementation.\n2) I also used keras but couldn't cross  .76. </p>\n\n<p>Thanks for all the help in advance !! :) </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 620975,
          "author_name": "modojj",
          "author_url": "",
          "post_date": "09/08/2019 05:48:20",
          "content": "<p><a href=\"/mayank17\">@mayank17</a> Did you use the old data ? because i was also not able to cross the 0.762 score without using the old data.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 621028,
          "author_name": "mayank17",
          "author_url": "",
          "post_date": "09/08/2019 06:51:50",
          "content": "<p>yes I did use old data also.. but not sure where it went wrong..  May be once I see your then I will be able to find issue with mine.</p>\n\n<p><a href=\"https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474\">https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474</a></p>\n\n<p>I am very new to ML. :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 621056,
          "author_name": "modojj",
          "author_url": "",
          "post_date": "09/08/2019 07:16:13",
          "content": "<p><a href=\"/mayank17\">@mayank17</a> here <a href=\"https://www.kaggle.com/modojj/keras-efficientnetb3-tta\">Keras EfficientNetB3 + TTA</a>, i combined the 2019 data training phase and the inference in a single kernel, note - i couldn't combine the old data training but old data training and configuration is exactly same as in this kernel.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "620943": "Congrats to the winners and all the participants !!\nI really want to thank @drhabib and @ratthachat and everyone else who shared their insights and work in notebooks and discussion forums, it helped me a lot. \nWell my solution is pretty simple, the two things that really worked for me were : \n1. Test Time Augmentation\n2. Ensembling 5 models\n\n##### **Overview** \n- Ensemble 5 models - all EfficientNets B3 with image size 300.\n- a lot of augmentation.\n- soft TTA.\n- Preprocessing - only cropping the black borders.\n- using Keras.\n\n##### **Score** \n- The model that gave me best results scored 0.810 on the public LB and 0.921 on the private LB.\n- Best performing model on Public lb (0.814) gave 0.917 on the Private LB.\n\n##### **Training** -\ni used the Efficientnet B3 with image size 300, pre-trained on the old competition data and then fine-tuned on this competition data. I used a lot of augmentations - zoom_range(0.25-0.35), horizontal and vertical flips, and rotation(360).\nTTA - used a very soft tta - getting predictions on test images, randomly rotating 1-6 degrees and making predictions again and then again rotating original image to 7-12 degrees. Did the same for all 5 models,  and then taking mode of predictions for each type of tta from each model.\nthis gave me three lists of predictions - one for each tta, and then again taking mode of predictions of those three lists.\nModels used for ensembling with TTA, scored - 0.784, 0.790, 0.794, 0.797 and another model with 0.797 on public lb.\n\nTTA gave me a boost of about 0.02 as these above models scored around 0.77-0.78 on public lb.\nEnsembling gave me a huge boost.\n\nThanks to Kaggle and APTOS for this wonderful competition, it taught me a lot.",
    "620955": "Congratulations\nGreat work\nAnd Thanks for sharing your approach and insights.!! @modojj",
    "620960": "Hi Rohit, If possible can you please share you Keras kernals.",
    "620963": "Hello @mayank17, Yes i will share my kernels, actually i have created 3 kernels one for training on old data, another one for training the same model on new data and one for inference.",
    "620968": "Thanks @modojj .  I asked this for two reasons. \n\n1) I am very new to ML and wanted to learn from others implementation.\n2) I also used keras but couldn't cross  .76. \n\nThanks for all the help in advance !! :)",
    "620975": "mayank17 Did you use the old data ? because i was also not able to cross the 0.762 score without using the old data.",
    "621028": "yes I did use old data also.. but not sure where it went wrong..  May be once I see your then I will be able to find issue with mine.\n\n[https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474](https://www.kaggle.com/mayank17/efficientnet-old-data?scriptVersionId=19874474)\n\n\nI am very new to ML. :)",
    "621056": "mayank17 here [Keras EfficientNetB3 + TTA](https://www.kaggle.com/modojj/keras-efficientnetb3-tta), i combined the 2019 data training phase and the inference in a single kernel, note - i couldn't combine the old data training but old data training and configuration is exactly same as in this kernel."
  },
  "source": "meta"
}