{
  "id": 107975,
  "title": "Congrats to all! (67th solution with code)",
  "url": "/competitions/aptos2019-blindness-detection/discussion/107975",
  "author_name": "Qile Tan",
  "post_date": "2019-09-08T07:49:35.135000",
  "votes": 6,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Congrats to all winners and everyone who finished this competition! It has been an amazing learning experience for me as I am still super new to image classification problems. Special thanks to  <a href=\"/drhabib\">@drhabib</a> where I got the inspirition from for my approach and <a href=\"/ratthachat\">@ratthachat</a> for his amazing preprocessing kernels.</p>\n\n<p>So here is my approach, which is quite simple:</p>\n\n<p>The model is EfficientNet B4 in Pytorch with Adam with image size of 256.</p>\n\n<p><strong>Preprocessing:</strong> \nCrop all images using the <code>crop_image_from_gray</code> function. \nFor 2019 validation data only, random center crop (1.1 to 1.3) is applied</p>\n\n<p><strong>Augmentation:</strong>\n <code>\nRandomResizedCrop((256,256), scale=(0.5, 0.9)),\nRandomHorizontalFlip(),\nRandomRotation(360),\nColorJitter(contrast=(0.75,2.2))\n</code></p>\n\n<p><strong>Steps:</strong>\n1.  Pretrain on previous competition data (2015) and validated by current training data (2019). \n     a. Freeze all layers except the last, train for 5 epochs\n     b. Unfreeze all layers and train for 15 epochs</p>\n\n<ol>\n<li>Finetune using 2019 data. CV-5 is used and train for 7 epochs for each fold</li>\n<li>Optimised thresholds (credit goes to <a href=\"/abhishek\">@abhishek</a>)</li>\n<li>For inference, no TTA, and use simple average of the 5 CV models</li>\n</ol>\n\n<p><strong>Other things I tried but did not work for me:</strong>\n- Bigger image size and bigger EfficientNet models\n- Ben's preprocessing\n- CLAHE\n- Circle cropping</p>\n\n<p>Thanks to Kaggle, APTOS and everyone who contributed via Kernels and Discussions. I learned so much from you guys.</p>\n\n<p>Code: <a href=\"https://github.com/qiletan/aptos2019-blindness-detection\">https://github.com/qiletan/aptos2019-blindness-detection</a></p>",
  "messages": [
    {
      "id": 621103,
      "postDate": "2019-09-08T07:49:35.137Z",
      "content": "<p>Congrats to all winners and everyone who finished this competition! It has been an amazing learning experience for me as I am still super new to image classification problems. Special thanks to  <a href=\"/drhabib\">@drhabib</a> where I got the inspirition from for my approach and <a href=\"/ratthachat\">@ratthachat</a> for his amazing preprocessing kernels.</p>\n\n<p>So here is my approach, which is quite simple:</p>\n\n<p>The model is EfficientNet B4 in Pytorch with Adam with image size of 256.</p>\n\n<p><strong>Preprocessing:</strong> \nCrop all images using the <code>crop_image_from_gray</code> function. \nFor 2019 validation data only, random center crop (1.1 to 1.3) is applied</p>\n\n<p><strong>Augmentation:</strong>\n <code>\nRandomResizedCrop((256,256), scale=(0.5, 0.9)),\nRandomHorizontalFlip(),\nRandomRotation(360),\nColorJitter(contrast=(0.75,2.2))\n</code></p>\n\n<p><strong>Steps:</strong>\n1.  Pretrain on previous competition data (2015) and validated by current training data (2019). \n     a. Freeze all layers except the last, train for 5 epochs\n     b. Unfreeze all layers and train for 15 epochs</p>\n\n<ol>\n<li>Finetune using 2019 data. CV-5 is used and train for 7 epochs for each fold</li>\n<li>Optimised thresholds (credit goes to <a href=\"/abhishek\">@abhishek</a>)</li>\n<li>For inference, no TTA, and use simple average of the 5 CV models</li>\n</ol>\n\n<p><strong>Other things I tried but did not work for me:</strong>\n- Bigger image size and bigger EfficientNet models\n- Ben's preprocessing\n- CLAHE\n- Circle cropping</p>\n\n<p>Thanks to Kaggle, APTOS and everyone who contributed via Kernels and Discussions. I learned so much from you guys.</p>\n\n<p>Code: <a href=\"https://github.com/qiletan/aptos2019-blindness-detection\">https://github.com/qiletan/aptos2019-blindness-detection</a></p>",
      "rawMarkdown": "Congrats to all winners and everyone who finished this competition! It has been an amazing learning experience for me as I am still super new to image classification problems. Special thanks to  @drhabib where I got the inspirition from for my approach and @ratthachat for his amazing preprocessing kernels.\n\n\nSo here is my approach, which is quite simple:\n\nThe model is EfficientNet B4 in Pytorch with Adam with image size of 256.\n\n**Preprocessing:** \nCrop all images using the `crop_image_from_gray` function. \nFor 2019 validation data only, random center crop (1.1 to 1.3) is applied\n\n**Augmentation:**\n ```\nRandomResizedCrop((256,256), scale=(0.5, 0.9)),\nRandomHorizontalFlip(),\nRandomRotation(360),\nColorJitter(contrast=(0.75,2.2))\n```\n\n\n**Steps:**\n1.  Pretrain on previous competition data (2015) and validated by current training data (2019). \n     a. Freeze all layers except the last, train for 5 epochs\n     b. Unfreeze all layers and train for 15 epochs\n\n2. Finetune using 2019 data. CV-5 is used and train for 7 epochs for each fold\n3. Optimised thresholds (credit goes to @abhishek)\n3. For inference, no TTA, and use simple average of the 5 CV models\n\n**Other things I tried but did not work for me:**\n- Bigger image size and bigger EfficientNet models\n- Ben's preprocessing\n- CLAHE\n- Circle cropping\n\n\n\nThanks to Kaggle, APTOS and everyone who contributed via Kernels and Discussions. I learned so much from you guys.\n\nCode: https://github.com/qiletan/aptos2019-blindness-detection\n\n\n\n\n\n",
      "votes": 6
    },
    {
      "id": 621949,
      "postDate": "2019-09-09T05:45:51.977Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 621410,
      "postDate": "2019-09-08T13:43:53.490Z",
      "content": "<p>Thanks and see you next time <a href=\"/qiletan\">@qiletan</a> !</p>",
      "rawMarkdown": "Thanks and see you next time @qiletan !"
    },
    {
      "id": 621398,
      "postDate": "2019-09-08T13:34:03.010Z",
      "content": "<p>Congrats and thanks for sharing :)</p>",
      "rawMarkdown": "Congrats and thanks for sharing :)"
    }
  ],
  "comments": [
    {
      "id": 621949,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-09-09T05:45:51.977000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 621410,
      "author_name": "Neuron Engineer",
      "author_url": "",
      "post_date": "2019-09-08T13:43:53.490000",
      "content": "<p>Thanks and see you next time <a href=\"/qiletan\">@qiletan</a> !</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 621398,
      "author_name": "JM100",
      "author_url": "",
      "post_date": "2019-09-08T13:34:03.010000",
      "content": "<p>Congrats and thanks for sharing :)</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "621103": "Congrats to all winners and everyone who finished this competition! It has been an amazing learning experience for me as I am still super new to image classification problems. Special thanks to  @drhabib where I got the inspirition from for my approach and @ratthachat for his amazing preprocessing kernels.\n\n\nSo here is my approach, which is quite simple:\n\nThe model is EfficientNet B4 in Pytorch with Adam with image size of 256.\n\n**Preprocessing:** \nCrop all images using the `crop_image_from_gray` function. \nFor 2019 validation data only, random center crop (1.1 to 1.3) is applied\n\n**Augmentation:**\n ```\nRandomResizedCrop((256,256), scale=(0.5, 0.9)),\nRandomHorizontalFlip(),\nRandomRotation(360),\nColorJitter(contrast=(0.75,2.2))\n```\n\n\n**Steps:**\n1.  Pretrain on previous competition data (2015) and validated by current training data (2019). \n     a. Freeze all layers except the last, train for 5 epochs\n     b. Unfreeze all layers and train for 15 epochs\n\n2. Finetune using 2019 data. CV-5 is used and train for 7 epochs for each fold\n3. Optimised thresholds (credit goes to @abhishek)\n3. For inference, no TTA, and use simple average of the 5 CV models\n\n**Other things I tried but did not work for me:**\n- Bigger image size and bigger EfficientNet models\n- Ben's preprocessing\n- CLAHE\n- Circle cropping\n\n\n\nThanks to Kaggle, APTOS and everyone who contributed via Kernels and Discussions. I learned so much from you guys.\n\nCode: https://github.com/qiletan/aptos2019-blindness-detection\n\n\n\n\n\n",
    "621949": "",
    "621410": "Thanks and see you next time @qiletan !",
    "621398": "Congrats and thanks for sharing :)"
  }
}