{
  "id": 110423,
  "title": "Quick and dumb 87'th place solution",
  "url": "/competitions/recursion-cellular-image-classification/writeups/ods-ai-daniil-barysevich-quick-and-dumb-87-th-plac",
  "author_name": "",
  "post_date": "2019-09-27T14:19:35.744032Z",
  "votes": 8,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I think it's probably the most effortless and dumbest solution posted. I lazily started doing something 5 days before the deadline mostly because I got triggered by the word \"Arcface\" and wanted to try it.</p>\n\n<p><strong>Data Loading</strong>: For each image in my training dataset I randomly chose between site 1 and site 2, created 6-channel image from .png's and normalized with np.mean() and np.std()\n<strong>Model</strong>: Single 512x512 resnet50 from torchvision, adapted to work with 6 channels as in this <a href=\"https://www.kaggle.com/yhn112/resnet18-baseline-pytorch-ignite\">kernel</a> \n<strong>Training</strong>: 50 epochs, same starting parameters as in the kernel above. it took maybe 8-9 hours with single 1080Ti. \n<strong>Augmentations</strong>: I used D4 group augmentations from <a href=\"https://github.com/albu/albumentations\">albumentations</a> library (HorizotalFlip, VerticalFlip, Transpose, RandomRotate90)\n<strong>Validation</strong>: stratified split by sirna's with 0.05 left for validation (very smart)\n<strong>Prediction</strong>: d4_tta from <a href=\"https://github.com/BloodAxe/pytorch-toolbelt\">pytorch toolbelt</a> sor each site, then average sites and apply leak from [this kernel] (<a href=\"https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/\">https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/</a>) (~40 min test prediction time on single 1080Ti).</p>\n\n<p>And that's it. I obtained my LB solution in the first day (it was supposed to be just a baseline) and for the rest 4 days tried to do something smart with arcface, but it simply didn't work (even after applying batchnorm in the beginning I could not get &gt;10% training accuracy).</p>\n\n<p>Without leak and TTA, my model scores 0.52. Now I wonder if I could achieve higher results with the same straightforward approach. </p>",
  "messages": [
    {
      "id": "635432",
      "postDate": "09/27/2019 14:19:35",
      "content": "<p>I think it's probably the most effortless and dumbest solution posted. I lazily started doing something 5 days before the deadline mostly because I got triggered by the word \"Arcface\" and wanted to try it.</p>\n\n<p><strong>Data Loading</strong>: For each image in my training dataset I randomly chose between site 1 and site 2, created 6-channel image from .png's and normalized with np.mean() and np.std()\n<strong>Model</strong>: Single 512x512 resnet50 from torchvision, adapted to work with 6 channels as in this <a href=\"https://www.kaggle.com/yhn112/resnet18-baseline-pytorch-ignite\">kernel</a> \n<strong>Training</strong>: 50 epochs, same starting parameters as in the kernel above. it took maybe 8-9 hours with single 1080Ti. \n<strong>Augmentations</strong>: I used D4 group augmentations from <a href=\"https://github.com/albu/albumentations\">albumentations</a> library (HorizotalFlip, VerticalFlip, Transpose, RandomRotate90)\n<strong>Validation</strong>: stratified split by sirna's with 0.05 left for validation (very smart)\n<strong>Prediction</strong>: d4_tta from <a href=\"https://github.com/BloodAxe/pytorch-toolbelt\">pytorch toolbelt</a> sor each site, then average sites and apply leak from [this kernel] (<a href=\"https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/\">https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/</a>) (~40 min test prediction time on single 1080Ti).</p>\n\n<p>And that's it. I obtained my LB solution in the first day (it was supposed to be just a baseline) and for the rest 4 days tried to do something smart with arcface, but it simply didn't work (even after applying batchnorm in the beginning I could not get &gt;10% training accuracy).</p>\n\n<p>Without leak and TTA, my model scores 0.52. Now I wonder if I could achieve higher results with the same straightforward approach. </p>",
      "rawMarkdown": "I think it's probably the most effortless and dumbest solution posted. I lazily started doing something 5 days before the deadline mostly because I got triggered by the word \"Arcface\" and wanted to try it.\n\n**Data Loading**: For each image in my training dataset I randomly chose between site 1 and site 2, created 6-channel image from .png's and normalized with np.mean() and np.std()\n**Model**: Single 512x512 resnet50 from torchvision, adapted to work with 6 channels as in this [kernel](https://www.kaggle.com/yhn112/resnet18-baseline-pytorch-ignite) \n**Training**: 50 epochs, same starting parameters as in the kernel above. it took maybe 8-9 hours with single 1080Ti. \n**Augmentations**: I used D4 group augmentations from [albumentations](https://github.com/albu/albumentations) library (HorizotalFlip, VerticalFlip, Transpose, RandomRotate90)\n**Validation**: stratified split by sirna's with 0.05 left for validation (very smart)\n**Prediction**: d4_tta from [pytorch toolbelt](https://github.com/BloodAxe/pytorch-toolbelt) sor each site, then average sites and apply leak from [this kernel] (https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/) (~40 min test prediction time on single 1080Ti).\n\nAnd that's it. I obtained my LB solution in the first day (it was supposed to be just a baseline) and for the rest 4 days tried to do something smart with arcface, but it simply didn't work (even after applying batchnorm in the beginning I could not get &gt;10% training accuracy).\n\nWithout leak and TTA, my model scores 0.52. Now I wonder if I could achieve higher results with the same straightforward approach.",
      "votes": null
    },
    {
      "id": "635456",
      "postDate": "09/27/2019 15:12:58",
      "content": "<p>Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights…!! <a href=\"/devvindan\">@devvindan</a> </p>",
      "rawMarkdown": "Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights…!! @devvindan",
      "votes": null
    },
    {
      "id": "635527",
      "postDate": "09/27/2019 18:59:50",
      "content": "<p>great!</p>",
      "rawMarkdown": "great!",
      "votes": null
    },
    {
      "id": "635587",
      "postDate": "09/27/2019 21:57:35",
      "content": "<p>Nice solution!\nDid you have problems with <code>model.eval()</code> during validation and inference? I wasn't able to use it because my model's accuracy just drops to random guessing</p>",
      "rawMarkdown": "Nice solution!\nDid you have problems with `model.eval()` during validation and inference? I wasn't able to use it because my model's accuracy just drops to random guessing",
      "votes": null
    },
    {
      "id": "635599",
      "postDate": "09/27/2019 22:26:13",
      "content": "<p>I experienced the problem when my model accuracy was ~0 during model.eval(), but it happened simply because I forgot to normalize input</p>",
      "rawMarkdown": "I experienced the problem when my model accuracy was ~0 during model.eval(), but it happened simply because I forgot to normalize input",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 635456,
      "author_name": "veeralakrishna",
      "author_url": "",
      "post_date": "09/27/2019 15:12:58",
      "content": "<p>Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights…!! <a href=\"/devvindan\">@devvindan</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 635527,
      "author_name": "krishnakatyal",
      "author_url": "",
      "post_date": "09/27/2019 18:59:50",
      "content": "<p>great!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 635587,
      "author_name": "rafailfridman",
      "author_url": "",
      "post_date": "09/27/2019 21:57:35",
      "content": "<p>Nice solution!\nDid you have problems with <code>model.eval()</code> during validation and inference? I wasn't able to use it because my model's accuracy just drops to random guessing</p>",
      "votes": null,
      "replies": [
        {
          "id": 635599,
          "author_name": "devvindan",
          "author_url": "",
          "post_date": "09/27/2019 22:26:13",
          "content": "<p>I experienced the problem when my model accuracy was ~0 during model.eval(), but it happened simply because I forgot to normalize input</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "635432": "I think it's probably the most effortless and dumbest solution posted. I lazily started doing something 5 days before the deadline mostly because I got triggered by the word \"Arcface\" and wanted to try it.\n\n**Data Loading**: For each image in my training dataset I randomly chose between site 1 and site 2, created 6-channel image from .png's and normalized with np.mean() and np.std()\n**Model**: Single 512x512 resnet50 from torchvision, adapted to work with 6 channels as in this [kernel](https://www.kaggle.com/yhn112/resnet18-baseline-pytorch-ignite) \n**Training**: 50 epochs, same starting parameters as in the kernel above. it took maybe 8-9 hours with single 1080Ti. \n**Augmentations**: I used D4 group augmentations from [albumentations](https://github.com/albu/albumentations) library (HorizotalFlip, VerticalFlip, Transpose, RandomRotate90)\n**Validation**: stratified split by sirna's with 0.05 left for validation (very smart)\n**Prediction**: d4_tta from [pytorch toolbelt](https://github.com/BloodAxe/pytorch-toolbelt) sor each site, then average sites and apply leak from [this kernel] (https://www.kaggle.com/zaharch/keras-model-boosted-with-plates-leak/) (~40 min test prediction time on single 1080Ti).\n\nAnd that's it. I obtained my LB solution in the first day (it was supposed to be just a baseline) and for the rest 4 days tried to do something smart with arcface, but it simply didn't work (even after applying batchnorm in the beginning I could not get &gt;10% training accuracy).\n\nWithout leak and TTA, my model scores 0.52. Now I wonder if I could achieve higher results with the same straightforward approach.",
    "635456": "Congratulations\nGreat Write-Up\nThanks for Sharing your Approach &amp; Insights…!! @devvindan",
    "635527": "great!",
    "635587": "Nice solution!\nDid you have problems with `model.eval()` during validation and inference? I wasn't able to use it because my model's accuracy just drops to random guessing",
    "635599": "I experienced the problem when my model accuracy was ~0 during model.eval(), but it happened simply because I forgot to normalize input"
  },
  "source": "meta"
}