{
  "id": 358490,
  "title": "52'nd place - My approach",
  "url": "/competitions/mayo-clinic-strip-ai/discussion/358490",
  "author_name": "Karthik",
  "post_date": "2022-10-08T06:03:28.827000",
  "votes": 8,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Thanks to Kaggle and Mayo Clinic, for this competition. Congratulations to all winners!</p>\n<p>I expected a shakeup given 93% of test set was hidden but not a massive shakeup like we see.  I had jumped 500 places to rank 52, winning my first medal (bronze), in a competition . </p>\n<p>My approach relied a lot on augmentations. Further details are below:</p>\n<p><strong>Augmentations</strong>:<br>\nTrain set: </p>\n<ul>\n<li>512 resized RGB image</li>\n<li>RandomHorizontalFlip</li>\n<li>RandomRotation</li>\n<li>FiveCrop</li>\n<li>Normalization using ImageNet  stats</li>\n</ul>\n<p>Val/Test sets:</p>\n<ul>\n<li>512 resized RGB image</li>\n<li>Normalization using ImageNet stats</li>\n</ul>\n<p><strong>Training</strong>:<br>\nPytorch EfficientNetB5 model<br>\nCrossEntropyLoss<br>\nAdam Optimizer. + CosineAnnealingLR<br>\n5 fold Stratified Split<br>\n10 Epochs per fold. For every fold, save the model based on the lowest loss</p>\n<p><strong>Inference</strong>:<br>\nFor each image, average the prediction from the 5 models obtained during the training phase) </p>",
  "messages": [
    {
      "id": 1977615,
      "postDate": "2022-10-08T06:03:28.827Z",
      "content": "<p>Thanks to Kaggle and Mayo Clinic, for this competition. Congratulations to all winners!</p>\n<p>I expected a shakeup given 93% of test set was hidden but not a massive shakeup like we see.  I had jumped 500 places to rank 52, winning my first medal (bronze), in a competition . </p>\n<p>My approach relied a lot on augmentations. Further details are below:</p>\n<p><strong>Augmentations</strong>:<br>\nTrain set: </p>\n<ul>\n<li>512 resized RGB image</li>\n<li>RandomHorizontalFlip</li>\n<li>RandomRotation</li>\n<li>FiveCrop</li>\n<li>Normalization using ImageNet  stats</li>\n</ul>\n<p>Val/Test sets:</p>\n<ul>\n<li>512 resized RGB image</li>\n<li>Normalization using ImageNet stats</li>\n</ul>\n<p><strong>Training</strong>:<br>\nPytorch EfficientNetB5 model<br>\nCrossEntropyLoss<br>\nAdam Optimizer. + CosineAnnealingLR<br>\n5 fold Stratified Split<br>\n10 Epochs per fold. For every fold, save the model based on the lowest loss</p>\n<p><strong>Inference</strong>:<br>\nFor each image, average the prediction from the 5 models obtained during the training phase) </p>",
      "rawMarkdown": "Thanks to Kaggle and Mayo Clinic, for this competition. Congratulations to all winners!\n\nI expected a shakeup given 93% of test set was hidden but not a massive shakeup like we see.  I had jumped 500 places to rank 52, winning my first medal (bronze), in a competition . \n\nMy approach relied a lot on augmentations. Further details are below:\n\n**Augmentations**:\nTrain set: \n- 512 resized RGB image\n- RandomHorizontalFlip\n- RandomRotation\n- FiveCrop\n- Normalization using ImageNet ~~weights ~~ stats\n\nVal/Test sets:\n- 512 resized RGB image\n- Normalization using ImageNet ~~weights ~~stats\n\n**Training**:\nPytorch EfficientNetB5 model\nCrossEntropyLoss\nAdam Optimizer. + CosineAnnealingLR\n5 fold Stratified Split\n10 Epochs per fold. For every fold, save the model based on the lowest loss\n\n**Inference**:\nFor each image, average the prediction from the 5 models obtained during the training phase) ",
      "votes": 8
    },
    {
      "id": 1978629,
      "postDate": "2022-10-08T20:33:20.993Z",
      "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> congrats on you results and you seemed to have made a simple approach work very well. Could you elaborate a bit what you mean by normalizing dataset using imagenet weights in augmentations? </p>",
      "rawMarkdown": "@karthikrg congrats on you results and you seemed to have made a simple approach work very well. Could you elaborate a bit what you mean by normalizing dataset using imagenet weights in augmentations? ",
      "replies": [
        {
          "id": 1979260,
          "postDate": "2022-10-09T09:03:51.200Z",
          "content": "<p>I meant to say Imagenet Stats: ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).</p>",
          "rawMarkdown": "I meant to say Imagenet Stats: ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).\n"
        },
        {
          "id": 1979667,
          "postDate": "2022-10-09T15:51:03.957Z",
          "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> I'm sorry but I still do not understand… are these predictions from imagenet weight model that you used in some fashion? Thanks for your patience with my slowness :)</p>",
          "rawMarkdown": "@karthikrg I'm sorry but I still do not understand... are these predictions from imagenet weight model that you used in some fashion? Thanks for your patience with my slowness :)"
        },
        {
          "id": 1980698,
          "postDate": "2022-10-10T10:25:28.827Z",
          "content": "<p>I used these stats to normalize images and see how the results are. I have updated my original post.</p>\n<p>There are opinions to the contrary, like discussion <a href=\"https://discuss.pytorch.org/t/discussion-why-normalise-according-to-imagenet-mean-and-std-dev-for-transfer-learning/115670/5\" target=\"_blank\">here</a>.</p>",
          "rawMarkdown": "I used these stats to normalize images and see how the results are. I have updated my original post.\n\nThere are opinions to the contrary, like discussion [here](https://discuss.pytorch.org/t/discussion-why-normalise-according-to-imagenet-mean-and-std-dev-for-transfer-learning/115670/5).\n",
          "votes": 1
        },
        {
          "id": 1981070,
          "postDate": "2022-10-10T15:08:40.610Z",
          "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> thanks, I get it now.</p>",
          "rawMarkdown": "@karthikrg thanks, I get it now."
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1978629,
      "author_name": "tdiceman",
      "author_url": "",
      "post_date": "2022-10-08T20:33:20.993000",
      "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> congrats on you results and you seemed to have made a simple approach work very well. Could you elaborate a bit what you mean by normalizing dataset using imagenet weights in augmentations? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 1979260,
          "author_name": "Karthik",
          "author_url": "",
          "post_date": "2022-10-09T09:03:51.200000",
          "content": "<p>I meant to say Imagenet Stats: ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1979667,
          "author_name": "tdiceman",
          "author_url": "",
          "post_date": "2022-10-09T15:51:03.957000",
          "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> I'm sorry but I still do not understand… are these predictions from imagenet weight model that you used in some fashion? Thanks for your patience with my slowness :)</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1980698,
          "author_name": "Karthik",
          "author_url": "",
          "post_date": "2022-10-10T10:25:28.827000",
          "content": "<p>I used these stats to normalize images and see how the results are. I have updated my original post.</p>\n<p>There are opinions to the contrary, like discussion <a href=\"https://discuss.pytorch.org/t/discussion-why-normalise-according-to-imagenet-mean-and-std-dev-for-transfer-learning/115670/5\" target=\"_blank\">here</a>.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1981070,
          "author_name": "tdiceman",
          "author_url": "",
          "post_date": "2022-10-10T15:08:40.610000",
          "content": "<p><a href=\"https://www.kaggle.com/karthikrg\" target=\"_blank\">@karthikrg</a> thanks, I get it now.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1977615": "Thanks to Kaggle and Mayo Clinic, for this competition. Congratulations to all winners!\n\nI expected a shakeup given 93% of test set was hidden but not a massive shakeup like we see.  I had jumped 500 places to rank 52, winning my first medal (bronze), in a competition . \n\nMy approach relied a lot on augmentations. Further details are below:\n\n**Augmentations**:\nTrain set: \n- 512 resized RGB image\n- RandomHorizontalFlip\n- RandomRotation\n- FiveCrop\n- Normalization using ImageNet ~~weights ~~ stats\n\nVal/Test sets:\n- 512 resized RGB image\n- Normalization using ImageNet ~~weights ~~stats\n\n**Training**:\nPytorch EfficientNetB5 model\nCrossEntropyLoss\nAdam Optimizer. + CosineAnnealingLR\n5 fold Stratified Split\n10 Epochs per fold. For every fold, save the model based on the lowest loss\n\n**Inference**:\nFor each image, average the prediction from the 5 models obtained during the training phase) ",
    "1978629": "@karthikrg congrats on you results and you seemed to have made a simple approach work very well. Could you elaborate a bit what you mean by normalizing dataset using imagenet weights in augmentations? "
  }
}