{
  "id": 71525,
  "title": "9th Place - Solution",
  "url": "/competitions/inclusive-images-challenge/writeups/giba-9th-place-solution",
  "author_name": "",
  "post_date": "2018-11-22T19:33:55.143Z",
  "votes": 38,
  "comment_count": 6,
  "views": 0,
  "content": "<p>My solution is simple. \nI downloaded only train_00.zip and train_08.zip due internet speed restrictions.</p>\n\n<p>Merging datasets brings more than 343,042 images and 1,983,191 labels associated. Then I dropped labels with frequency less than 50 decreasing the number of labels to around ~ 1.6M.  This way the unique number of labels in my dataset decreased to 3862.</p>\n\n<p>I used Keras NASNetLarge to train the model from scratch using 224x224x3 images. During training I monitored a custom f@2 metric after each epoch.</p>\n\n<p>Augmentation was made using albumentations lib:</p>\n\n<pre><code>def augment_flips_color(p=.5):\n  return Compose([\n      CLAHE(),\n      HorizontalFlip(.5),\n      ShiftScaleRotate(shift_limit=0.075, scale_limit=0.15, rotate_limit=10, p=.75 ),\n      Blur(blur_limit=3, p=.33),\n      OpticalDistortion(p=.33),\n      GridDistortion(p=.33),\n      HueSaturationValue(p=.33)\n  ], p=p)\n</code></pre>\n\n<p>Model trained for several epochs until I got a f@2 of around 0.63 in one small validation set.\nUsing 4xTTA my validation improved to around 0.64 only.</p>\n\n<p>Searching for the best threshold to cut the predicted labels I found the value 0.049 that brings f@2 to 0.68 in the validation set. It means my final solution predicts all categories with prob &gt;= 0.049 for each image.</p>\n\n<p>I tried the same approach using a Xception and a VGG-16 architecture. Both scored less than the NASNet, but when I blended the three models in stage 1, it improved the LB score around +0.01. For stage 2 I used only the NASNet in the solution.</p>\n\n<p>Giba</p>",
  "messages": [
    {
      "id": "420983",
      "postDate": "11/14/2018 12:34:38",
      "content": "<p>My solution is simple. \nI downloaded only train_00.zip and train_08.zip due internet speed restrictions.</p>\n\n<p>Merging datasets brings more than 343,042 images and 1,983,191 labels associated. Then I dropped labels with frequency less than 50 decreasing the number of labels to around ~ 1.6M.  This way the unique number of labels in my dataset decreased to 3862.</p>\n\n<p>I used Keras NASNetLarge to train the model from scratch using 224x224x3 images. During training I monitored a custom f@2 metric after each epoch.</p>\n\n<p>Augmentation was made using albumentations lib:</p>\n\n<pre><code>def augment_flips_color(p=.5):\n  return Compose([\n      CLAHE(),\n      HorizontalFlip(.5),\n      ShiftScaleRotate(shift_limit=0.075, scale_limit=0.15, rotate_limit=10, p=.75 ),\n      Blur(blur_limit=3, p=.33),\n      OpticalDistortion(p=.33),\n      GridDistortion(p=.33),\n      HueSaturationValue(p=.33)\n  ], p=p)\n</code></pre>\n\n<p>Model trained for several epochs until I got a f@2 of around 0.63 in one small validation set.\nUsing 4xTTA my validation improved to around 0.64 only.</p>\n\n<p>Searching for the best threshold to cut the predicted labels I found the value 0.049 that brings f@2 to 0.68 in the validation set. It means my final solution predicts all categories with prob &gt;= 0.049 for each image.</p>\n\n<p>I tried the same approach using a Xception and a VGG-16 architecture. Both scored less than the NASNet, but when I blended the three models in stage 1, it improved the LB score around +0.01. For stage 2 I used only the NASNet in the solution.</p>\n\n<p>Giba</p>",
      "rawMarkdown": "My solution is simple. \nI downloaded only train_00.zip and train_08.zip due internet speed restrictions.\n\nMerging datasets brings more than 343,042 images and 1,983,191 labels associated. Then I dropped labels with frequency less than 50 decreasing the number of labels to around ~ 1.6M.  This way the unique number of labels in my dataset decreased to 3862.\n\nI used Keras NASNetLarge to train the model from scratch using 224x224x3 images. During training I monitored a custom f@2 metric after each epoch.\n\nAugmentation was made using albumentations lib:\n\n    def augment_flips_color(p=.5):\n      return Compose([\n          CLAHE(),\n          HorizontalFlip(.5),\n          ShiftScaleRotate(shift_limit=0.075, scale_limit=0.15, rotate_limit=10, p=.75 ),\n          Blur(blur_limit=3, p=.33),\n          OpticalDistortion(p=.33),\n          GridDistortion(p=.33),\n          HueSaturationValue(p=.33)\n      ], p=p)\n\nModel trained for several epochs until I got a f@2 of around 0.63 in one small validation set.\nUsing 4xTTA my validation improved to around 0.64 only.\n\nSearching for the best threshold to cut the predicted labels I found the value 0.049 that brings f@2 to 0.68 in the validation set. It means my final solution predicts all categories with prob &gt;= 0.049 for each image.\n\nI tried the same approach using a Xception and a VGG-16 architecture. Both scored less than the NASNet, but when I blended the three models in stage 1, it improved the LB score around +0.01. For stage 2 I used only the NASNet in the solution.\n\nGiba",
      "votes": null
    },
    {
      "id": "421208",
      "postDate": "11/14/2018 18:08:38",
      "content": "<p>Unbelievable gold medal using only 20% training data ...</p>",
      "rawMarkdown": "Unbelievable gold medal using only 20% training data ...",
      "votes": null
    },
    {
      "id": "421253",
      "postDate": "11/14/2018 19:42:56",
      "content": "<p>Congratulations @Giba and thanks for sharing.</p>",
      "rawMarkdown": "Congratulations @Giba and thanks for sharing.",
      "votes": null
    },
    {
      "id": "422025",
      "postDate": "11/15/2018 17:32:40",
      "content": "<p>First time to see NASnet is so powerful! Amazing!</p>",
      "rawMarkdown": "First time to see NASnet is so powerful! Amazing!",
      "votes": null
    },
    {
      "id": "423838",
      "postDate": "11/19/2018 06:01:42",
      "content": "<p>Congratulations! I cannot believe that dropping data seems to be helpful?</p>",
      "rawMarkdown": "Congratulations! I cannot believe that dropping data seems to be helpful?",
      "votes": null
    },
    {
      "id": "424387",
      "postDate": "11/20/2018 03:03:31",
      "content": "<p>Thank you for sharing your idea. Now I'm going to see the NASnet paper.</p>",
      "rawMarkdown": "Thank you for sharing your idea. Now I'm going to see the NASnet paper.",
      "votes": null
    },
    {
      "id": "426135",
      "postDate": "11/22/2018 17:39:23",
      "content": "<p>Congratulations <a href=\"/titericz\">@titericz</a>! Ninth indeed. I would also love to try NASNet for future competitions.</p>",
      "rawMarkdown": "Congratulations @titericz! Ninth indeed. I would also love to try NASNet for future competitions.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 421208,
      "author_name": "wowfattie",
      "author_url": "",
      "post_date": "11/14/2018 18:08:38",
      "content": "<p>Unbelievable gold medal using only 20% training data ...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 421253,
      "author_name": "sheriytm",
      "author_url": "",
      "post_date": "11/14/2018 19:42:56",
      "content": "<p>Congratulations @Giba and thanks for sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 422025,
      "author_name": "ldong87",
      "author_url": "",
      "post_date": "11/15/2018 17:32:40",
      "content": "<p>First time to see NASnet is so powerful! Amazing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 423838,
      "author_name": "kokecacao",
      "author_url": "",
      "post_date": "11/19/2018 06:01:42",
      "content": "<p>Congratulations! I cannot believe that dropping data seems to be helpful?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 424387,
      "author_name": "frankiezhang",
      "author_url": "",
      "post_date": "11/20/2018 03:03:31",
      "content": "<p>Thank you for sharing your idea. Now I'm going to see the NASnet paper.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 426135,
      "author_name": "shujian",
      "author_url": "",
      "post_date": "11/22/2018 17:39:23",
      "content": "<p>Congratulations <a href=\"/titericz\">@titericz</a>! Ninth indeed. I would also love to try NASNet for future competitions.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "420983": "My solution is simple. \nI downloaded only train_00.zip and train_08.zip due internet speed restrictions.\n\nMerging datasets brings more than 343,042 images and 1,983,191 labels associated. Then I dropped labels with frequency less than 50 decreasing the number of labels to around ~ 1.6M.  This way the unique number of labels in my dataset decreased to 3862.\n\nI used Keras NASNetLarge to train the model from scratch using 224x224x3 images. During training I monitored a custom f@2 metric after each epoch.\n\nAugmentation was made using albumentations lib:\n\n    def augment_flips_color(p=.5):\n      return Compose([\n          CLAHE(),\n          HorizontalFlip(.5),\n          ShiftScaleRotate(shift_limit=0.075, scale_limit=0.15, rotate_limit=10, p=.75 ),\n          Blur(blur_limit=3, p=.33),\n          OpticalDistortion(p=.33),\n          GridDistortion(p=.33),\n          HueSaturationValue(p=.33)\n      ], p=p)\n\nModel trained for several epochs until I got a f@2 of around 0.63 in one small validation set.\nUsing 4xTTA my validation improved to around 0.64 only.\n\nSearching for the best threshold to cut the predicted labels I found the value 0.049 that brings f@2 to 0.68 in the validation set. It means my final solution predicts all categories with prob &gt;= 0.049 for each image.\n\nI tried the same approach using a Xception and a VGG-16 architecture. Both scored less than the NASNet, but when I blended the three models in stage 1, it improved the LB score around +0.01. For stage 2 I used only the NASNet in the solution.\n\nGiba",
    "421208": "Unbelievable gold medal using only 20% training data ...",
    "421253": "Congratulations @Giba and thanks for sharing.",
    "422025": "First time to see NASnet is so powerful! Amazing!",
    "423838": "Congratulations! I cannot believe that dropping data seems to be helpful?",
    "424387": "Thank you for sharing your idea. Now I'm going to see the NASnet paper.",
    "426135": "Congratulations @titericz! Ninth indeed. I would also love to try NASNet for future competitions."
  },
  "source": "meta"
}