{
  "id": 99603,
  "title": "Best size for images",
  "url": "/competitions/aptos2019-blindness-detection/discussion/99603",
  "author_name": "",
  "post_date": "2019-07-12T14:21:31.693416900Z",
  "votes": 13,
  "comment_count": 35,
  "views": 0,
  "content": "<p>Hi all,</p>\n\n<p>What is the best size of image where you get the best LB?</p>\n\n<p>Thanks...</p>",
  "messages": [
    {
      "id": "573631",
      "postDate": "07/12/2019 14:21:31",
      "content": "<p>Hi all,</p>\n\n<p>What is the best size of image where you get the best LB?</p>\n\n<p>Thanks...</p>",
      "rawMarkdown": "Hi all,\n\nWhat is the best size of image where you get the best LB?\n\nThanks...",
      "votes": null
    },
    {
      "id": "573636",
      "postDate": "07/12/2019 14:38:29",
      "content": "<p><code>IMG_SIZE=320</code> worked good for me</p>",
      "rawMarkdown": "`IMG_SIZE=320` worked good for me",
      "votes": null
    },
    {
      "id": "573638",
      "postDate": "07/12/2019 14:42:36",
      "content": "<p>I use 320x320 for image size.</p>",
      "rawMarkdown": "I use 320x320 for image size.",
      "votes": null
    },
    {
      "id": "573693",
      "postDate": "07/12/2019 16:02:26",
      "content": "<p>Thanks for sharing <a href=\"/d46kobayashi\">@d46kobayashi</a> !\nDid you manage to process both training datasets (2015 &amp; 2019) with that size? Cause, when I use that amount of data I have to decrease the size to 224x224... 😅 </p>",
      "rawMarkdown": "Thanks for sharing @d46kobayashi !\nDid you manage to process both training datasets (2015 &amp; 2019) with that size? Cause, when I use that amount of data I have to decrease the size to 224x224... 😅",
      "votes": null
    },
    {
      "id": "573801",
      "postDate": "07/12/2019 19:08:11",
      "content": "<p>Thanks for sharing.\nI used both 224 and 299 for different models but still under 0,757 ! Let's go for other sizes!</p>",
      "rawMarkdown": "Thanks for sharing.\nI used both 224 and 299 for different models but still under 0,757 ! Let's go for other sizes!",
      "votes": null
    },
    {
      "id": "573802",
      "postDate": "07/12/2019 19:08:32",
      "content": "<p>great ! I will try it.</p>",
      "rawMarkdown": "great ! I will try it.",
      "votes": null
    },
    {
      "id": "573811",
      "postDate": "07/12/2019 19:29:59",
      "content": "<p>If you are using <code>pertained = True</code>than it's better to use image size that was used to pretrain the model. For example for pytorch models you can find info here <a href=\"https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html\">https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html</a></p>\n\n<blockquote>\n  <p>Finally, notice that inception_v3 requires the input size to be (299,299), whereas all of the other models expect (224,224)</p>\n</blockquote>",
      "rawMarkdown": "If you are using `pertained = True `than it's better to use image size that was used to pretrain the model. For example for pytorch models you can find info here https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html\n\n&gt; Finally, notice that inception_v3 requires the input size to be (299,299), whereas all of the other models expect (224,224)",
      "votes": null
    },
    {
      "id": "573813",
      "postDate": "07/12/2019 19:34:15",
      "content": "<p>In the case of pre_trained models, I use their specific input size. The issue is that, with this input size, we loss a lot of data as the size of images are very big in compare to theas sizes. \nThanks a lot.</p>",
      "rawMarkdown": "In the case of pre_trained models, I use their specific input size. The issue is that, with this input size, we loss a lot of data as the size of images are very big in compare to theas sizes. \nThanks a lot.",
      "votes": null
    },
    {
      "id": "573815",
      "postDate": "07/12/2019 19:35:57",
      "content": "<p>You are welcome. You can resize the image to keep same aspect ratio. </p>",
      "rawMarkdown": "You are welcome. You can resize the image to keep same aspect ratio.",
      "votes": null
    },
    {
      "id": "573895",
      "postDate": "07/12/2019 23:10:29",
      "content": "<p><a href=\"/raimonds1993\">@raimonds1993</a> Yes. I applied same process to both.</p>",
      "rawMarkdown": "raimonds1993 Yes. I applied same process to both.",
      "votes": null
    },
    {
      "id": "573921",
      "postDate": "07/13/2019 00:39:52",
      "content": "<p>Hi! <a href=\"/esmaeil391\">@esmaeil391</a> I usually follow the recomendation o of the architecture that I'm using, as a start point; after I'm good with this I start playing with the size</p>\n\n<p><a href=\"https://keras.io/applications/\">https://keras.io/applications/</a></p>",
      "rawMarkdown": "Hi! @esmaeil391 I usually follow the recomendation o of the architecture that I'm using, as a start point; after I'm good with this I start playing with the size\n\nhttps://keras.io/applications/",
      "votes": null
    },
    {
      "id": "575454",
      "postDate": "07/15/2019 12:39:51",
      "content": "<p>I tried image sizes of 384,512,768 and 1024. I have to admit that higher image sizes didn't give me a higher score. Now I stick to 384 or 512, which gave the best results yet. I think sizes above 512 wont really carry much more usefull information about the features used for classification</p>",
      "rawMarkdown": "I tried image sizes of 384,512,768 and 1024. I have to admit that higher image sizes didn't give me a higher score. Now I stick to 384 or 512, which gave the best results yet. I think sizes above 512 wont really carry much more usefull information about the features used for classification",
      "votes": null
    },
    {
      "id": "575665",
      "postDate": "07/15/2019 19:34:20",
      "content": "<p>I use 256x256</p>",
      "rawMarkdown": "I use 256x256",
      "votes": null
    },
    {
      "id": "575692",
      "postDate": "07/15/2019 20:58:43",
      "content": "<p><a href=\"/stanislavmalorodov\">@stanislavmalorodov</a>  based on the <a href=\"/cv13j0\">@cv13j0</a>  if you are using pretrained model, it is better to follow the architecture as they have a specific  input. I try to check 384-512 to see what hapen but I am not sure that the result would be better!!!</p>",
      "rawMarkdown": "stanislavmalorodov  based on the @cv13j0  if you are using pretrained model, it is better to follow the architecture as they have a specific  input. I try to check 384-512 to see what hapen but I am not sure that the result would be better!!!",
      "votes": null
    },
    {
      "id": "577122",
      "postDate": "07/16/2019 11:42:32",
      "content": "<p>If you are using almost any pre-trained model the size does not have to match the size model has been trained with. It would only be useful for imagenet like images where different size would mean different  objects scale, but for completely different domain like this competition, I don't see any benefit in sticking to the original image size.</p>",
      "rawMarkdown": "If you are using almost any pre-trained model the size does not have to match the size model has been trained with. It would only be useful for imagenet like images where different size would mean different  objects scale, but for completely different domain like this competition, I don't see any benefit in sticking to the original image size.",
      "votes": null
    },
    {
      "id": "577134",
      "postDate": "07/16/2019 11:56:34",
      "content": "<p>Thanks for the hint, haven't really thought about that ! Makes sense to use the native image size.</p>",
      "rawMarkdown": "Thanks for the hint, haven't really thought about that ! Makes sense to use the native image size.",
      "votes": null
    },
    {
      "id": "577610",
      "postDate": "07/16/2019 20:36:23",
      "content": "<p><a href=\"/d46kobayashi\">@d46kobayashi</a> Thanks! I'm trying to follow your advice.\n<a href=\"https://www.kaggle.com/raimonds1993/aptos19-densenet-trained-with-old-and-new-data\">Here</a> I prepared a kernel showing how I faced memory-related issues due to the 320x320 image size.</p>",
      "rawMarkdown": "d46kobayashi Thanks! I'm trying to follow your advice.\n[Here](https://www.kaggle.com/raimonds1993/aptos19-densenet-trained-with-old-and-new-data) I prepared a kernel showing how I faced memory-related issues due to the 320x320 image size.",
      "votes": null
    },
    {
      "id": "578321",
      "postDate": "07/17/2019 15:52:01",
      "content": "<p>We were thinking about using 400x400, since many of the features that determine diabetic retinopathy are quite small. However, I agree with the other comments that it is efficient to use the image size that was used for the pre-trained model if you are using those.</p>",
      "rawMarkdown": "We were thinking about using 400x400, since many of the features that determine diabetic retinopathy are quite small. However, I agree with the other comments that it is efficient to use the image size that was used for the pre-trained model if you are using those.",
      "votes": null
    },
    {
      "id": "578329",
      "postDate": "07/17/2019 16:02:44",
      "content": "<p>For me, 224x224 giving best LB.</p>",
      "rawMarkdown": "For me, 224x224 giving best LB.",
      "votes": null
    },
    {
      "id": "578790",
      "postDate": "07/18/2019 06:49:36",
      "content": "<p><a href=\"/carlolepelaars\">@carlolepelaars</a>  Do you have any Kernel problem with this size? I tried to use large sizes with Fast AI but it faces to CUDA out of memory error!!!</p>",
      "rawMarkdown": "carlolepelaars  Do you have any Kernel problem with this size? I tried to use large sizes with Fast AI but it faces to CUDA out of memory error!!!",
      "votes": null
    },
    {
      "id": "578808",
      "postDate": "07/18/2019 07:03:54",
      "content": "<p>Using 224, I got ~ 0.71 on LB\nThen I used 256, got ~0.76 on LB\nWhat image size are you using?</p>",
      "rawMarkdown": "Using 224, I got ~ 0.71 on LB\nThen I used 256, got ~0.76 on LB\nWhat image size are you using?",
      "votes": null
    },
    {
      "id": "578930",
      "postDate": "07/18/2019 09:55:33",
      "content": "<p>If you are using any pre-trained model architecture better follow their input shape. Also , when cropping images , make sure to keep the aspect ratio. Otherwise cropped image will get skewed.</p>",
      "rawMarkdown": "If you are using any pre-trained model architecture better follow their input shape. Also , when cropping images , make sure to keep the aspect ratio. Otherwise cropped image will get skewed.",
      "votes": null
    },
    {
      "id": "580164",
      "postDate": "07/19/2019 19:03:40",
      "content": "<p>Is it a good idea to resize all images to the size of the smallest image? because I think, the more we make the image smaller, the more information of the image will be lost. Please correct me if I am wrong !</p>",
      "rawMarkdown": "Is it a good idea to resize all images to the size of the smallest image? because I think, the more we make the image smaller, the more information of the image will be lost. Please correct me if I am wrong !",
      "votes": null
    },
    {
      "id": "580207",
      "postDate": "07/19/2019 20:44:01",
      "content": "<p>I have used 500x600x3 after crop.</p>\n\n<p>Resnet50 with regression, pre-train with old data competition (using this competition data for ES ). Used some simple filters on the images... </p>\n\n<p>\"Fine tunning\" with no cross-validation and no ensemble yet (one test fold only, of 20%). Also no data augmentation yet...  </p>\n\n<p>LB =0.738</p>",
      "rawMarkdown": "I have used 500x600x3 after crop.\n\nResnet50 with regression, pre-train with old data competition (using this competition data for ES ). Used some simple filters on the images... \n\n\"Fine tunning\" with no cross-validation and no ensemble yet (one test fold only, of 20%). Also no data augmentation yet...  \n\nLB =0.738",
      "votes": null
    },
    {
      "id": "580211",
      "postDate": "07/19/2019 20:55:16",
      "content": "<p>Good job. You can increase it and also make your model generalized which is important for this competition. </p>",
      "rawMarkdown": "Good job. You can increase it and also make your model generalized which is important for this competition.",
      "votes": null
    },
    {
      "id": "580268",
      "postDate": "07/19/2019 23:08:26",
      "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  I used different sizes but still no good improvement!\nI think you find some good size and solution :)</p>",
      "rawMarkdown": "rishabhiitbhu  I used different sizes but still no good improvement!\nI think you find some good size and solution :)",
      "votes": null
    },
    {
      "id": "580337",
      "postDate": "07/20/2019 02:34:20",
      "content": "<p>I've gotten 0.81 with 256 :)</p>",
      "rawMarkdown": "I've gotten 0.81 with 256 :)",
      "votes": null
    },
    {
      "id": "580505",
      "postDate": "07/20/2019 08:52:41",
      "content": "<p>Good news!!!\nAny hint for others?</p>",
      "rawMarkdown": "Good news!!!\nAny hint for others?",
      "votes": null
    },
    {
      "id": "580513",
      "postDate": "07/20/2019 09:00:50",
      "content": "<p>Use EfficientNets, pretrain model on previous competition's dataset, fine tune on the given dataset. Avoid overfitting at any cost, use optimized thresholds, and read the discussion forums :) </p>",
      "rawMarkdown": "Use EfficientNets, pretrain model on previous competition's dataset, fine tune on the given dataset. Avoid overfitting at any cost, use optimized thresholds, and read the discussion forums :)",
      "votes": null
    },
    {
      "id": "580810",
      "postDate": "07/20/2019 19:50:43",
      "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  Thanks a lot for hints.\nWish you the best</p>",
      "rawMarkdown": "rishabhiitbhu  Thanks a lot for hints.\nWish you the best",
      "votes": null
    },
    {
      "id": "580812",
      "postDate": "07/20/2019 19:53:04",
      "content": "<p>Thanks :) All the best to you too. :)</p>",
      "rawMarkdown": "Thanks :) All the best to you too. :)",
      "votes": null
    },
    {
      "id": "583355",
      "postDate": "07/24/2019 11:27:50",
      "content": "<p><a href=\"/esmaeil391\">@esmaeil391</a> Have you tried a smaller batch size? It should fit within memory then.</p>",
      "rawMarkdown": "esmaeil391 Have you tried a smaller batch size? It should fit within memory then.",
      "votes": null
    },
    {
      "id": "583712",
      "postDate": "07/24/2019 21:34:04",
      "content": "<p>Yes. In this case the compution time will be increased and as you know, we have kernel running limitation!!!</p>",
      "rawMarkdown": "Yes. In this case the compution time will be increased and as you know, we have kernel running limitation!!!",
      "votes": null
    },
    {
      "id": "583763",
      "postDate": "07/25/2019 00:21:07",
      "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  isn't using optimized thresholds a form of overfitting to the training data?</p>",
      "rawMarkdown": "rishabhiitbhu  isn't using optimized thresholds a form of overfitting to the training data?",
      "votes": null
    },
    {
      "id": "583881",
      "postDate": "07/25/2019 06:01:14",
      "content": "<p>I'm using thresholds optimized on validation set, not on the training set. Your concern is valid, optimized thresholds are not to be trusted upon, I've still got a lot of experiments to do to finally decide what to trust. :/</p>",
      "rawMarkdown": "I'm using thresholds optimized on validation set, not on the training set. Your concern is valid, optimized thresholds are not to be trusted upon, I've still got a lot of experiments to do to finally decide what to trust. :/",
      "votes": null
    },
    {
      "id": "583894",
      "postDate": "07/25/2019 06:13:52",
      "content": "<p>Yes but the validation set is part of the competition training set.  I agree we probably should not trust the optimized thresholds for final model selection :)</p>",
      "rawMarkdown": "Yes but the validation set is part of the competition training set.  I agree we probably should not trust the optimized thresholds for final model selection :)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 573636,
      "author_name": "axel81",
      "author_url": "",
      "post_date": "07/12/2019 14:38:29",
      "content": "<p><code>IMG_SIZE=320</code> worked good for me</p>",
      "votes": null,
      "replies": [
        {
          "id": 573802,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/12/2019 19:08:32",
          "content": "<p>great ! I will try it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 573638,
      "author_name": "d46kobayashi",
      "author_url": "",
      "post_date": "07/12/2019 14:42:36",
      "content": "<p>I use 320x320 for image size.</p>",
      "votes": null,
      "replies": [
        {
          "id": 573693,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/12/2019 16:02:26",
          "content": "<p>Thanks for sharing <a href=\"/d46kobayashi\">@d46kobayashi</a> !\nDid you manage to process both training datasets (2015 &amp; 2019) with that size? Cause, when I use that amount of data I have to decrease the size to 224x224... 😅 </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 573801,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/12/2019 19:08:11",
          "content": "<p>Thanks for sharing.\nI used both 224 and 299 for different models but still under 0,757 ! Let's go for other sizes!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 573895,
          "author_name": "d46kobayashi",
          "author_url": "",
          "post_date": "07/12/2019 23:10:29",
          "content": "<p><a href=\"/raimonds1993\">@raimonds1993</a> Yes. I applied same process to both.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 577610,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/16/2019 20:36:23",
          "content": "<p><a href=\"/d46kobayashi\">@d46kobayashi</a> Thanks! I'm trying to follow your advice.\n<a href=\"https://www.kaggle.com/raimonds1993/aptos19-densenet-trained-with-old-and-new-data\">Here</a> I prepared a kernel showing how I faced memory-related issues due to the 320x320 image size.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 573811,
      "author_name": "drhabib",
      "author_url": "",
      "post_date": "07/12/2019 19:29:59",
      "content": "<p>If you are using <code>pertained = True</code>than it's better to use image size that was used to pretrain the model. For example for pytorch models you can find info here <a href=\"https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html\">https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html</a></p>\n\n<blockquote>\n  <p>Finally, notice that inception_v3 requires the input size to be (299,299), whereas all of the other models expect (224,224)</p>\n</blockquote>",
      "votes": null,
      "replies": [
        {
          "id": 573813,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/12/2019 19:34:15",
          "content": "<p>In the case of pre_trained models, I use their specific input size. The issue is that, with this input size, we loss a lot of data as the size of images are very big in compare to theas sizes. \nThanks a lot.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 573815,
          "author_name": "drhabib",
          "author_url": "",
          "post_date": "07/12/2019 19:35:57",
          "content": "<p>You are welcome. You can resize the image to keep same aspect ratio. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 577122,
          "author_name": "dmytropoplavskiy",
          "author_url": "",
          "post_date": "07/16/2019 11:42:32",
          "content": "<p>If you are using almost any pre-trained model the size does not have to match the size model has been trained with. It would only be useful for imagenet like images where different size would mean different  objects scale, but for completely different domain like this competition, I don't see any benefit in sticking to the original image size.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 573921,
      "author_name": "cv13j0",
      "author_url": "",
      "post_date": "07/13/2019 00:39:52",
      "content": "<p>Hi! <a href=\"/esmaeil391\">@esmaeil391</a> I usually follow the recomendation o of the architecture that I'm using, as a start point; after I'm good with this I start playing with the size</p>\n\n<p><a href=\"https://keras.io/applications/\">https://keras.io/applications/</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 575454,
      "author_name": "stanislavmalorodov",
      "author_url": "",
      "post_date": "07/15/2019 12:39:51",
      "content": "<p>I tried image sizes of 384,512,768 and 1024. I have to admit that higher image sizes didn't give me a higher score. Now I stick to 384 or 512, which gave the best results yet. I think sizes above 512 wont really carry much more usefull information about the features used for classification</p>",
      "votes": null,
      "replies": [
        {
          "id": 575692,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/15/2019 20:58:43",
          "content": "<p><a href=\"/stanislavmalorodov\">@stanislavmalorodov</a>  based on the <a href=\"/cv13j0\">@cv13j0</a>  if you are using pretrained model, it is better to follow the architecture as they have a specific  input. I try to check 384-512 to see what hapen but I am not sure that the result would be better!!!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 577134,
          "author_name": "stanislavmalorodov",
          "author_url": "",
          "post_date": "07/16/2019 11:56:34",
          "content": "<p>Thanks for the hint, haven't really thought about that ! Makes sense to use the native image size.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 575665,
      "author_name": "tanlikesmath",
      "author_url": "",
      "post_date": "07/15/2019 19:34:20",
      "content": "<p>I use 256x256</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 578321,
      "author_name": "carlolepelaars",
      "author_url": "",
      "post_date": "07/17/2019 15:52:01",
      "content": "<p>We were thinking about using 400x400, since many of the features that determine diabetic retinopathy are quite small. However, I agree with the other comments that it is efficient to use the image size that was used for the pre-trained model if you are using those.</p>",
      "votes": null,
      "replies": [
        {
          "id": 578790,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/18/2019 06:49:36",
          "content": "<p><a href=\"/carlolepelaars\">@carlolepelaars</a>  Do you have any Kernel problem with this size? I tried to use large sizes with Fast AI but it faces to CUDA out of memory error!!!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 583355,
          "author_name": "carlolepelaars",
          "author_url": "",
          "post_date": "07/24/2019 11:27:50",
          "content": "<p><a href=\"/esmaeil391\">@esmaeil391</a> Have you tried a smaller batch size? It should fit within memory then.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 583712,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/24/2019 21:34:04",
          "content": "<p>Yes. In this case the compution time will be increased and as you know, we have kernel running limitation!!!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 578329,
      "author_name": "amitkumarjaiswal",
      "author_url": "",
      "post_date": "07/17/2019 16:02:44",
      "content": "<p>For me, 224x224 giving best LB.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 578808,
      "author_name": "rishabhiitbhu",
      "author_url": "",
      "post_date": "07/18/2019 07:03:54",
      "content": "<p>Using 224, I got ~ 0.71 on LB\nThen I used 256, got ~0.76 on LB\nWhat image size are you using?</p>",
      "votes": null,
      "replies": [
        {
          "id": 580268,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/19/2019 23:08:26",
          "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  I used different sizes but still no good improvement!\nI think you find some good size and solution :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 580337,
          "author_name": "rishabhiitbhu",
          "author_url": "",
          "post_date": "07/20/2019 02:34:20",
          "content": "<p>I've gotten 0.81 with 256 :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 580505,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/20/2019 08:52:41",
          "content": "<p>Good news!!!\nAny hint for others?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 580513,
          "author_name": "rishabhiitbhu",
          "author_url": "",
          "post_date": "07/20/2019 09:00:50",
          "content": "<p>Use EfficientNets, pretrain model on previous competition's dataset, fine tune on the given dataset. Avoid overfitting at any cost, use optimized thresholds, and read the discussion forums :) </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 580810,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/20/2019 19:50:43",
          "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  Thanks a lot for hints.\nWish you the best</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 580812,
          "author_name": "rishabhiitbhu",
          "author_url": "",
          "post_date": "07/20/2019 19:53:04",
          "content": "<p>Thanks :) All the best to you too. :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 583763,
          "author_name": "tanlikesmath",
          "author_url": "",
          "post_date": "07/25/2019 00:21:07",
          "content": "<p><a href=\"/rishabhiitbhu\">@rishabhiitbhu</a>  isn't using optimized thresholds a form of overfitting to the training data?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 583881,
          "author_name": "rishabhiitbhu",
          "author_url": "",
          "post_date": "07/25/2019 06:01:14",
          "content": "<p>I'm using thresholds optimized on validation set, not on the training set. Your concern is valid, optimized thresholds are not to be trusted upon, I've still got a lot of experiments to do to finally decide what to trust. :/</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 583894,
          "author_name": "tanlikesmath",
          "author_url": "",
          "post_date": "07/25/2019 06:13:52",
          "content": "<p>Yes but the validation set is part of the competition training set.  I agree we probably should not trust the optimized thresholds for final model selection :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 578930,
      "author_name": "sreejiths0",
      "author_url": "",
      "post_date": "07/18/2019 09:55:33",
      "content": "<p>If you are using any pre-trained model architecture better follow their input shape. Also , when cropping images , make sure to keep the aspect ratio. Otherwise cropped image will get skewed.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 580164,
      "author_name": "hosseinrahmani",
      "author_url": "",
      "post_date": "07/19/2019 19:03:40",
      "content": "<p>Is it a good idea to resize all images to the size of the smallest image? because I think, the more we make the image smaller, the more information of the image will be lost. Please correct me if I am wrong !</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 580207,
      "author_name": "birinhos",
      "author_url": "",
      "post_date": "07/19/2019 20:44:01",
      "content": "<p>I have used 500x600x3 after crop.</p>\n\n<p>Resnet50 with regression, pre-train with old data competition (using this competition data for ES ). Used some simple filters on the images... </p>\n\n<p>\"Fine tunning\" with no cross-validation and no ensemble yet (one test fold only, of 20%). Also no data augmentation yet...  </p>\n\n<p>LB =0.738</p>",
      "votes": null,
      "replies": [
        {
          "id": 580211,
          "author_name": "esmaeil391",
          "author_url": "",
          "post_date": "07/19/2019 20:55:16",
          "content": "<p>Good job. You can increase it and also make your model generalized which is important for this competition. </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "573631": "Hi all,\n\nWhat is the best size of image where you get the best LB?\n\nThanks...",
    "573636": "`IMG_SIZE=320` worked good for me",
    "573638": "I use 320x320 for image size.",
    "573693": "Thanks for sharing @d46kobayashi !\nDid you manage to process both training datasets (2015 &amp; 2019) with that size? Cause, when I use that amount of data I have to decrease the size to 224x224... 😅",
    "573801": "Thanks for sharing.\nI used both 224 and 299 for different models but still under 0,757 ! Let's go for other sizes!",
    "573802": "great ! I will try it.",
    "573811": "If you are using `pertained = True `than it's better to use image size that was used to pretrain the model. For example for pytorch models you can find info here https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html\n\n&gt; Finally, notice that inception_v3 requires the input size to be (299,299), whereas all of the other models expect (224,224)",
    "573813": "In the case of pre_trained models, I use their specific input size. The issue is that, with this input size, we loss a lot of data as the size of images are very big in compare to theas sizes. \nThanks a lot.",
    "573815": "You are welcome. You can resize the image to keep same aspect ratio.",
    "573895": "raimonds1993 Yes. I applied same process to both.",
    "573921": "Hi! @esmaeil391 I usually follow the recomendation o of the architecture that I'm using, as a start point; after I'm good with this I start playing with the size\n\nhttps://keras.io/applications/",
    "575454": "I tried image sizes of 384,512,768 and 1024. I have to admit that higher image sizes didn't give me a higher score. Now I stick to 384 or 512, which gave the best results yet. I think sizes above 512 wont really carry much more usefull information about the features used for classification",
    "575665": "I use 256x256",
    "575692": "stanislavmalorodov  based on the @cv13j0  if you are using pretrained model, it is better to follow the architecture as they have a specific  input. I try to check 384-512 to see what hapen but I am not sure that the result would be better!!!",
    "577122": "If you are using almost any pre-trained model the size does not have to match the size model has been trained with. It would only be useful for imagenet like images where different size would mean different  objects scale, but for completely different domain like this competition, I don't see any benefit in sticking to the original image size.",
    "577134": "Thanks for the hint, haven't really thought about that ! Makes sense to use the native image size.",
    "577610": "d46kobayashi Thanks! I'm trying to follow your advice.\n[Here](https://www.kaggle.com/raimonds1993/aptos19-densenet-trained-with-old-and-new-data) I prepared a kernel showing how I faced memory-related issues due to the 320x320 image size.",
    "578321": "We were thinking about using 400x400, since many of the features that determine diabetic retinopathy are quite small. However, I agree with the other comments that it is efficient to use the image size that was used for the pre-trained model if you are using those.",
    "578329": "For me, 224x224 giving best LB.",
    "578790": "carlolepelaars  Do you have any Kernel problem with this size? I tried to use large sizes with Fast AI but it faces to CUDA out of memory error!!!",
    "578808": "Using 224, I got ~ 0.71 on LB\nThen I used 256, got ~0.76 on LB\nWhat image size are you using?",
    "578930": "If you are using any pre-trained model architecture better follow their input shape. Also , when cropping images , make sure to keep the aspect ratio. Otherwise cropped image will get skewed.",
    "580164": "Is it a good idea to resize all images to the size of the smallest image? because I think, the more we make the image smaller, the more information of the image will be lost. Please correct me if I am wrong !",
    "580207": "I have used 500x600x3 after crop.\n\nResnet50 with regression, pre-train with old data competition (using this competition data for ES ). Used some simple filters on the images... \n\n\"Fine tunning\" with no cross-validation and no ensemble yet (one test fold only, of 20%). Also no data augmentation yet...  \n\nLB =0.738",
    "580211": "Good job. You can increase it and also make your model generalized which is important for this competition.",
    "580268": "rishabhiitbhu  I used different sizes but still no good improvement!\nI think you find some good size and solution :)",
    "580337": "I've gotten 0.81 with 256 :)",
    "580505": "Good news!!!\nAny hint for others?",
    "580513": "Use EfficientNets, pretrain model on previous competition's dataset, fine tune on the given dataset. Avoid overfitting at any cost, use optimized thresholds, and read the discussion forums :)",
    "580810": "rishabhiitbhu  Thanks a lot for hints.\nWish you the best",
    "580812": "Thanks :) All the best to you too. :)",
    "583355": "esmaeil391 Have you tried a smaller batch size? It should fit within memory then.",
    "583712": "Yes. In this case the compution time will be increased and as you know, we have kernel running limitation!!!",
    "583763": "rishabhiitbhu  isn't using optimized thresholds a form of overfitting to the training data?",
    "583881": "I'm using thresholds optimized on validation set, not on the training set. Your concern is valid, optimized thresholds are not to be trusted upon, I've still got a lot of experiments to do to finally decide what to trust. :/",
    "583894": "Yes but the validation set is part of the competition training set.  I agree we probably should not trust the optimized thresholds for final model selection :)"
  },
  "source": "meta"
}