{
  "id": 95247,
  "title": "[Update] 1st place solution with code",
  "url": "/competitions/imaterialist-fashion-2019-FGVC6/writeups/ods-ai-miras-amir-dsmlkz-update-1st-place-solution",
  "author_name": "",
  "post_date": "2019-09-10T15:24:29.290Z",
  "votes": 153,
  "comment_count": 43,
  "views": 0,
  "content": "<p>Hi Kagglers,</p>\n\n<p>My solution is based on the COCO challenge 2018 winners article: <a href=\"https://arxiv.org/abs/1901.07518\">https://arxiv.org/abs/1901.07518</a>. </p>\n\n<h1>Code:</h1>\n\n<p><a href=\"https://github.com/amirassov/kaggle-imaterialist\">https://github.com/amirassov/kaggle-imaterialist</a></p>\n\n<h1>Model:</h1>\n\n<p><a href=\"https://github.com/open-mmlab/mmdetection/blob/master/configs/htc/htc_dconv_c3-c5_mstrain_400_1400_x101_64x4d_fpn_20e.py\">Hybrid Task Cascade with ResNeXt-101-64x4d-FPN backbone</a>. This model has a metric Mask mAP = 43.9 on COCO dataset. This is SOTA for instance segmentation.</p>\n\n<h1>Validation:</h1>\n\n<p>For validation, I used 450 training samples splitted using <a href=\"https://github.com/trent-b/iterative-stratification\">https://github.com/trent-b/iterative-stratification</a>.</p>\n\n<h1>Preprocessing:</h1>\n\n<p>I applied light augmentatios from the <a href=\"https://github.com/albu/albumentations\">albumentations</a> library to the original image. Then I use multi-scale training: in each iteration, the scale of short edge is randomly sampled\nfrom [600, 1200], and the scale of long edge is fixed as 1900.\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/preproc.png\" alt=\"preprocessing\"></p>\n\n<h1>Training details:</h1>\n\n<ul>\n<li>pre-train from COCO</li>\n<li>optimizer: <code>SGD(lr=0.03, momentum=0.9, weight_decay=0.0001)</code></li>\n<li>batch_size: 16 = 2 images per gpu x 8 gpus Tesla V100</li>\n<li>learning rate scheduler:\n<code>if iterations &amp;lt; 500:\nlr = warmup(warmup_ratio=1 / 3)\nif epochs == 10:\nlr = lr ∗ 0.1\nif epochs == 18:\nlr = lr ∗ 0.1\nif epochs &amp;gt; 20:\nstop</code></li>\n<li>training time: ~3 days.</li>\n</ul>\n\n<h1>Parameter tuning:</h1>\n\n<p>After the 12th epoch with the default parameters, the metric on LB was <strong>0.21913</strong>. Next, I tuned postprocessing thresholds using validation data:\n* <code>score_thr=0.5</code>\n* <code>nms={type: 'nms', iou_thr: 0.3}</code>\n* <code>max_per_img=100</code>\n* <code>mask_thr_binary=0.45</code></p>\n\n<p>This improved the metric on LB: <strong>0.21913 -&gt; 0.30011.</strong></p>\n\n<h1>Test time augmentation:</h1>\n\n<p>I use 3 scales as well as horizontal flip at test time and ensemble the results. Testing scales are (1000, 1600), (1200, 1900), (1400, 2200). </p>\n\n<p>I drew a TTA scheme for Mask R-CNN, which is implemented in mmdetection library. For Hybrid Task Cascade R-CNN, I rewrote this code. </p>\n\n<p>This improved the metric on LB: <strong>0.30011 -&gt; 0.31074.</strong>\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/tta.png\" alt=\"TTA\"></p>\n\n<h1>Ensemble:</h1>\n\n<p>I ensemble the 3 best checkpoints of my model. The ensemble scheme is similar to TTA. </p>\n\n<p>This improved the metric on LB: <strong>0.31074 -&gt; 0.31626.</strong>\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png\" alt=\"ensemble\"></p>\n\n<h1>Attributes:</h1>\n\n<p>I didn't use attributes at all: they were difficult to predict and the removal of classes with attributes greatly improved the metric. </p>\n\n<p>During the whole competition, I deleted classes with attributes: <code>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}</code> U <code>{27, 28, 33}</code>. But two days before the end I read [the discussion] (<a href=\"https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137\">https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137</a>) and added back classes <code>{27, 28, 33 }</code>. </p>\n\n<p>This improved the metric on LB: <strong>0.31626 -&gt; 0.33511.</strong></p>\n\n<h1>Postprocessing for masks</h1>\n\n<p>My post-processing algorithm for avoid intersections of masks of the same class:\n<code>def hard_overlaps_suppression(binary_mask, scores):\n    not_overlap_mask = []\n    for i in np.argsort(scores)[::-1]:\n        current_mask = binary_mask[..., i].copy()\n        for mask in not_overlap_mask:\n            current_mask = np.bitwise_and(current_mask, np.invert(mask))\n        not_overlap_mask.append(current_mask)\n    return np.stack(not_overlap_mask, -1)</code></p>\n\n<h1>Small postprocessing:</h1>\n\n<p>I deleted objects with an area of less than 20 pixels. </p>\n\n<p>This improved the metric on LB: <strong>0.33511 -&gt; 0.33621.</strong></p>",
  "messages": [
    {
      "id": "549786",
      "postDate": "06/11/2019 03:13:40",
      "content": "<p>Hi Kagglers,</p>\n\n<p>My solution is based on the COCO challenge 2018 winners article: <a href=\"https://arxiv.org/abs/1901.07518\">https://arxiv.org/abs/1901.07518</a>. </p>\n\n<h1>Code:</h1>\n\n<p><a href=\"https://github.com/amirassov/kaggle-imaterialist\">https://github.com/amirassov/kaggle-imaterialist</a></p>\n\n<h1>Model:</h1>\n\n<p><a href=\"https://github.com/open-mmlab/mmdetection/blob/master/configs/htc/htc_dconv_c3-c5_mstrain_400_1400_x101_64x4d_fpn_20e.py\">Hybrid Task Cascade with ResNeXt-101-64x4d-FPN backbone</a>. This model has a metric Mask mAP = 43.9 on COCO dataset. This is SOTA for instance segmentation.</p>\n\n<h1>Validation:</h1>\n\n<p>For validation, I used 450 training samples splitted using <a href=\"https://github.com/trent-b/iterative-stratification\">https://github.com/trent-b/iterative-stratification</a>.</p>\n\n<h1>Preprocessing:</h1>\n\n<p>I applied light augmentatios from the <a href=\"https://github.com/albu/albumentations\">albumentations</a> library to the original image. Then I use multi-scale training: in each iteration, the scale of short edge is randomly sampled\nfrom [600, 1200], and the scale of long edge is fixed as 1900.\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/preproc.png\" alt=\"preprocessing\"></p>\n\n<h1>Training details:</h1>\n\n<ul>\n<li>pre-train from COCO</li>\n<li>optimizer: <code>SGD(lr=0.03, momentum=0.9, weight_decay=0.0001)</code></li>\n<li>batch_size: 16 = 2 images per gpu x 8 gpus Tesla V100</li>\n<li>learning rate scheduler:\n<code>if iterations &amp;lt; 500:\nlr = warmup(warmup_ratio=1 / 3)\nif epochs == 10:\nlr = lr ∗ 0.1\nif epochs == 18:\nlr = lr ∗ 0.1\nif epochs &amp;gt; 20:\nstop</code></li>\n<li>training time: ~3 days.</li>\n</ul>\n\n<h1>Parameter tuning:</h1>\n\n<p>After the 12th epoch with the default parameters, the metric on LB was <strong>0.21913</strong>. Next, I tuned postprocessing thresholds using validation data:\n* <code>score_thr=0.5</code>\n* <code>nms={type: 'nms', iou_thr: 0.3}</code>\n* <code>max_per_img=100</code>\n* <code>mask_thr_binary=0.45</code></p>\n\n<p>This improved the metric on LB: <strong>0.21913 -&gt; 0.30011.</strong></p>\n\n<h1>Test time augmentation:</h1>\n\n<p>I use 3 scales as well as horizontal flip at test time and ensemble the results. Testing scales are (1000, 1600), (1200, 1900), (1400, 2200). </p>\n\n<p>I drew a TTA scheme for Mask R-CNN, which is implemented in mmdetection library. For Hybrid Task Cascade R-CNN, I rewrote this code. </p>\n\n<p>This improved the metric on LB: <strong>0.30011 -&gt; 0.31074.</strong>\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/tta.png\" alt=\"TTA\"></p>\n\n<h1>Ensemble:</h1>\n\n<p>I ensemble the 3 best checkpoints of my model. The ensemble scheme is similar to TTA. </p>\n\n<p>This improved the metric on LB: <strong>0.31074 -&gt; 0.31626.</strong>\n<img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png\" alt=\"ensemble\"></p>\n\n<h1>Attributes:</h1>\n\n<p>I didn't use attributes at all: they were difficult to predict and the removal of classes with attributes greatly improved the metric. </p>\n\n<p>During the whole competition, I deleted classes with attributes: <code>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}</code> U <code>{27, 28, 33}</code>. But two days before the end I read [the discussion] (<a href=\"https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137\">https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137</a>) and added back classes <code>{27, 28, 33 }</code>. </p>\n\n<p>This improved the metric on LB: <strong>0.31626 -&gt; 0.33511.</strong></p>\n\n<h1>Postprocessing for masks</h1>\n\n<p>My post-processing algorithm for avoid intersections of masks of the same class:\n<code>def hard_overlaps_suppression(binary_mask, scores):\n    not_overlap_mask = []\n    for i in np.argsort(scores)[::-1]:\n        current_mask = binary_mask[..., i].copy()\n        for mask in not_overlap_mask:\n            current_mask = np.bitwise_and(current_mask, np.invert(mask))\n        not_overlap_mask.append(current_mask)\n    return np.stack(not_overlap_mask, -1)</code></p>\n\n<h1>Small postprocessing:</h1>\n\n<p>I deleted objects with an area of less than 20 pixels. </p>\n\n<p>This improved the metric on LB: <strong>0.33511 -&gt; 0.33621.</strong></p>",
      "rawMarkdown": "Hi Kagglers,\n\nMy solution is based on the COCO challenge 2018 winners article: https://arxiv.org/abs/1901.07518. \n\n# Code: \nhttps://github.com/amirassov/kaggle-imaterialist\n\n# Model: \n[Hybrid Task Cascade with ResNeXt-101-64x4d-FPN backbone](https://github.com/open-mmlab/mmdetection/blob/master/configs/htc/htc_dconv_c3-c5_mstrain_400_1400_x101_64x4d_fpn_20e.py). This model has a metric Mask mAP = 43.9 on COCO dataset. This is SOTA for instance segmentation.\n\n# Validation:\nFor validation, I used 450 training samples splitted using https://github.com/trent-b/iterative-stratification.\n\n# Preprocessing:\nI applied light augmentatios from the [albumentations](https://github.com/albu/albumentations) library to the original image. Then I use multi-scale training: in each iteration, the scale of short edge is randomly sampled\nfrom [600, 1200], and the scale of long edge is fixed as 1900.\n![preprocessing](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/preproc.png)\n\n# Training details:\n* pre-train from COCO\n* optimizer: `SGD(lr=0.03, momentum=0.9, weight_decay=0.0001)`\n* batch_size: 16 = 2 images per gpu x 8 gpus Tesla V100\n* learning rate scheduler:\n```if iterations &lt; 500:\n   lr = warmup(warmup_ratio=1 / 3)\nif epochs == 10:\n   lr = lr ∗ 0.1\nif epochs == 18:\n   lr = lr ∗ 0.1\nif epochs &gt; 20:\n   stop```\n* training time: ~3 days.\n\n# Parameter tuning:\nAfter the 12th epoch with the default parameters, the metric on LB was **0.21913**. Next, I tuned postprocessing thresholds using validation data:\n* `score_thr=0.5`\n* `nms={type: 'nms', iou_thr: 0.3}`\n* `max_per_img=100`\n* `mask_thr_binary=0.45`\n\nThis improved the metric on LB: **0.21913 -&gt; 0.30011.**\n\n# Test time augmentation:\nI use 3 scales as well as horizontal flip at test time and ensemble the results. Testing scales are (1000, 1600), (1200, 1900), (1400, 2200). \n\nI drew a TTA scheme for Mask R-CNN, which is implemented in mmdetection library. For Hybrid Task Cascade R-CNN, I rewrote this code. \n\nThis improved the metric on LB: **0.30011 -&gt; 0.31074.**\n![TTA](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/tta.png)\n\n# Ensemble:\nI ensemble the 3 best checkpoints of my model. The ensemble scheme is similar to TTA. \n\nThis improved the metric on LB: **0.31074 -&gt; 0.31626.**\n![ensemble](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png)\n\n# Attributes:\nI didn't use attributes at all: they were difficult to predict and the removal of classes with attributes greatly improved the metric. \n\nDuring the whole competition, I deleted classes with attributes: `{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}` U `{27, 28, 33}`. But two days before the end I read [the discussion] (https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137) and added back classes `{27, 28, 33 }`. \n\nThis improved the metric on LB: **0.31626 -&gt; 0.33511.**\n\n# Postprocessing for masks\nMy post-processing algorithm for avoid intersections of masks of the same class:\n```def hard_overlaps_suppression(binary_mask, scores):\n    not_overlap_mask = []\n    for i in np.argsort(scores)[::-1]:\n        current_mask = binary_mask[..., i].copy()\n        for mask in not_overlap_mask:\n            current_mask = np.bitwise_and(current_mask, np.invert(mask))\n        not_overlap_mask.append(current_mask)\n    return np.stack(not_overlap_mask, -1)```\n\n# Small postprocessing:\nI deleted objects with an area of less than 20 pixels. \n\nThis improved the metric on LB: **0.33511 -&gt; 0.33621.**",
      "votes": null
    },
    {
      "id": "549788",
      "postDate": "06/11/2019 03:16:54",
      "content": "<p>Wow, I was so close..... I had exactly the same pipeline as yours, except the part of nms threshold....</p>",
      "rawMarkdown": "Wow, I was so close..... I had exactly the same pipeline as yours, except the part of nms threshold....",
      "votes": null
    },
    {
      "id": "549798",
      "postDate": "06/11/2019 03:48:14",
      "content": "<p>Setting: \n* <code>score_thr=0.5</code>\n* <code>nms={type: 'nms', iou_thr: 0.3}</code>\n* <code>max_per_img=100</code>\n* <code>mask_thr_binary=0.45</code></p>\n\n<p>Seriously improves from 0.21913 to 0.30011? That was ... incredible.\nI only tried tuning the score_thr, and the improvement is only around 0.02</p>\n\n<p>Have you tried Soft-NMS? lowering the nms threshold seems to have a similar goal on preserving more proposals.</p>\n\n<p>Thanks for the sharing, and big congrats !</p>",
      "rawMarkdown": "Setting: \n* `score_thr=0.5`\n* `nms={type: 'nms', iou_thr: 0.3}`\n* `max_per_img=100`\n* `mask_thr_binary=0.45`\n\nSeriously improves from 0.21913 to 0.30011? That was ... incredible.\nI only tried tuning the score_thr, and the improvement is only around 0.02\n\nHave you tried Soft-NMS? lowering the nms threshold seems to have a similar goal on preserving more proposals.\n\nThanks for the sharing, and big congrats !",
      "votes": null
    },
    {
      "id": "549799",
      "postDate": "06/11/2019 03:49:19",
      "content": "<p>Many thanks for sharing your solutions. Looking forward to your source code! Congratulations! :-)</p>",
      "rawMarkdown": "Many thanks for sharing your solutions. Looking forward to your source code! Congratulations! :-)",
      "votes": null
    },
    {
      "id": "549808",
      "postDate": "06/11/2019 03:54:43",
      "content": "<p>This setting also adds little to my score.</p>",
      "rawMarkdown": "This setting also adds little to my score.",
      "votes": null
    },
    {
      "id": "549823",
      "postDate": "06/11/2019 04:07:31",
      "content": "<p>Soft-nms increased my score by like 0.0001....</p>",
      "rawMarkdown": "Soft-nms increased my score by like 0.0001....",
      "votes": null
    },
    {
      "id": "549824",
      "postDate": "06/11/2019 04:09:23",
      "content": "<p>Thank you for your sharing!</p>",
      "rawMarkdown": "Thank you for your sharing!",
      "votes": null
    },
    {
      "id": "549827",
      "postDate": "06/11/2019 04:20:05",
      "content": "<p>I think it depends on the post-processing algorithm to avoid intersections of masks of the same class.</p>\n\n<p>By default, <code>score_threshold = 0.001.</code> My post-processing algorithm for masks did not delete the masks. The result was a lot of masks with small scores. This greatly degraded the metric.\nI added this algorithm to the solution description.</p>\n\n<p>Soft-nms didn't increase my score.</p>",
      "rawMarkdown": "I think it depends on the post-processing algorithm to avoid intersections of masks of the same class.\n\nBy default, `score_threshold = 0.001.` My post-processing algorithm for masks did not delete the masks. The result was a lot of masks with small scores. This greatly degraded the metric.\nI added this algorithm to the solution description.\n\n\nSoft-nms didn't increase my score.",
      "votes": null
    },
    {
      "id": "549844",
      "postDate": "06/11/2019 04:47:37",
      "content": "<p>Looking forward to seeing your code!</p>",
      "rawMarkdown": "Looking forward to seeing your code!",
      "votes": null
    },
    {
      "id": "549873",
      "postDate": "06/11/2019 05:26:02",
      "content": "<p>Congratulations :)  Looking forward to your code. Thank you very much.</p>",
      "rawMarkdown": "Congratulations :)  Looking forward to your code. Thank you very much.",
      "votes": null
    },
    {
      "id": "549882",
      "postDate": "06/11/2019 05:36:35",
      "content": "<p>Thanks！</p>",
      "rawMarkdown": "Thanks！",
      "votes": null
    },
    {
      "id": "549923",
      "postDate": "06/11/2019 06:31:35",
      "content": "<p>Congratulations with 1st and Competitions Master!\nLooking forward to your code!\nThank you very much!</p>",
      "rawMarkdown": "Congratulations with 1st and Competitions Master!\nLooking forward to your code!\nThank you very much!",
      "votes": null
    },
    {
      "id": "549936",
      "postDate": "06/11/2019 06:40:07",
      "content": "<p>TOP!</p>",
      "rawMarkdown": "TOP!",
      "votes": null
    },
    {
      "id": "549975",
      "postDate": "06/11/2019 07:28:20",
      "content": "<p>Congratulations and thank you for your sharings!</p>",
      "rawMarkdown": "Congratulations and thank you for your sharings!",
      "votes": null
    },
    {
      "id": "549986",
      "postDate": "06/11/2019 07:40:07",
      "content": "<p>Pretty good! Waiting for the code!</p>",
      "rawMarkdown": "Pretty good! Waiting for the code!",
      "votes": null
    },
    {
      "id": "550002",
      "postDate": "06/11/2019 07:59:30",
      "content": "<p>Good job) </p>",
      "rawMarkdown": "Good job)",
      "votes": null
    },
    {
      "id": "550102",
      "postDate": "06/11/2019 09:54:39",
      "content": "<p>Thank you!</p>",
      "rawMarkdown": "Thank you!",
      "votes": null
    },
    {
      "id": "550116",
      "postDate": "06/11/2019 10:07:42",
      "content": "<p>Thanks</p>",
      "rawMarkdown": "Thanks",
      "votes": null
    },
    {
      "id": "550160",
      "postDate": "06/11/2019 11:15:07",
      "content": "<p>Congratulations.</p>\n\n<p>It seems that discarding classes with attributes is the key to win a gold.\nBy simply removing ClassId in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, we could get 0.31662/0.30403 .</p>\n\n<p>According to <a href=\"https://github.com/visipedia/imat_comp\">https://github.com/visipedia/imat_comp</a>, there are 10K images with both segmentation and fine-grained attributes. We have 6696 in train, so probably all of the test data are with fine-grained attributes.</p>\n\n<p>It was close...</p>",
      "rawMarkdown": "Congratulations.\n\nIt seems that discarding classes with attributes is the key to win a gold.\nBy simply removing ClassId in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, we could get 0.31662/0.30403 .\n\nAccording to https://github.com/visipedia/imat_comp, there are 10K images with both segmentation and fine-grained attributes. We have 6696 in train, so probably all of the test data are with fine-grained attributes.\n\nIt was close...",
      "votes": null
    },
    {
      "id": "550168",
      "postDate": "06/11/2019 11:27:24",
      "content": "<p>Congratulations and thanks for sharing!</p>",
      "rawMarkdown": "Congratulations and thanks for sharing!",
      "votes": null
    },
    {
      "id": "550495",
      "postDate": "06/11/2019 17:09:02",
      "content": "<p>Thank you for sharing the details</p>",
      "rawMarkdown": "Thank you for sharing the details",
      "votes": null
    },
    {
      "id": "550552",
      "postDate": "06/11/2019 18:33:16",
      "content": "<p>Awesome!</p>",
      "rawMarkdown": "Awesome!",
      "votes": null
    },
    {
      "id": "550755",
      "postDate": "06/12/2019 02:18:41",
      "content": "<p>Hi <a href=\"/amiras\">@amiras</a>  Thank you for sharing your solution! Will you attend CVPR2019 this year? <a href=\"https://sites.google.com/view/fgvc6/program?authuser=0\">Schedule of our upcoming FGVC workshop can be found here</a>.</p>\n\n<p>As one of top 3 teams, you are invited to present your solution in our upcoming FGVC workshop at CVPR.</p>\n\n<ol>\n<li>Could you be able to send me 1-2 pages of google slides (or pdf) describing your method? So I can include it in my presentation of this challenge.</li>\n<li>You will also have access to a 4 foot x 4 foot poster board in our FGVC workshop if you want to present your method at the workshop. (If you couldn't make it to the workshop, another option is that you can send your poster to me before June 14. I can help you print it and hang in the board that day)</li>\n</ol>\n\n<p>Thank you!</p>",
      "rawMarkdown": "Hi @amiras  Thank you for sharing your solution! Will you attend CVPR2019 this year? [Schedule of our upcoming FGVC workshop can be found here](https://sites.google.com/view/fgvc6/program?authuser=0).\n\nAs one of top 3 teams, you are invited to present your solution in our upcoming FGVC workshop at CVPR.\n\n1. Could you be able to send me 1-2 pages of google slides (or pdf) describing your method? So I can include it in my presentation of this challenge.\n2. You will also have access to a 4 foot x 4 foot poster board in our FGVC workshop if you want to present your method at the workshop. (If you couldn't make it to the workshop, another option is that you can send your poster to me before June 14. I can help you print it and hang in the board that day)\n\nThank you!",
      "votes": null
    },
    {
      "id": "550887",
      "postDate": "06/12/2019 05:53:18",
      "content": "<p>Congrats！Thank you for sharing the details.</p>",
      "rawMarkdown": "Congrats！Thank you for sharing the details.",
      "votes": null
    },
    {
      "id": "551038",
      "postDate": "06/12/2019 09:21:16",
      "content": "<p>Congratulations :)  Looking forward to seeing your code!</p>",
      "rawMarkdown": "Congratulations :)  Looking forward to seeing your code!",
      "votes": null
    },
    {
      "id": "551098",
      "postDate": "06/12/2019 10:38:40",
      "content": "<p>Thank you for sharing!</p>",
      "rawMarkdown": "Thank you for sharing!",
      "votes": null
    },
    {
      "id": "551973",
      "postDate": "06/13/2019 11:04:37",
      "content": "<p>If a line's classid is 3 4 7 8 10 11 45,  you means to delete this line or just remove the attribute?</p>",
      "rawMarkdown": "If a line's classid is 3 4 7 8 10 11 45,  you means to delete this line or just remove the attribute?",
      "votes": null
    },
    {
      "id": "552021",
      "postDate": "06/13/2019 12:23:46",
      "content": "<p>I just deleted the lines.</p>\n\n<p>Actually, I think the instruction of LB evaluation metric might be incorrect.\n&gt; The score returned by the competition metric is the mean taken over the individual average precisions of each image and each ClassId in the test dataset.</p>\n\n<p>How many ClassIds do we have? It's 46 * (2^92). In train, it is 6371. Taking an average over ClassIds would be...</p>\n\n<p>Here is my guess. The metric used might be a mean taken over the average precision of each image. And for each image, an overall AP is calculated. There is no ClassId in  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} in the test set, so all those predictions would be FP.</p>",
      "rawMarkdown": "I just deleted the lines.\n\nActually, I think the instruction of LB evaluation metric might be incorrect.\n&gt; The score returned by the competition metric is the mean taken over the individual average precisions of each image and each ClassId in the test dataset.\n\nHow many ClassIds do we have? It's 46 * (2^92). In train, it is 6371. Taking an average over ClassIds would be...\n\nHere is my guess. The metric used might be a mean taken over the average precision of each image. And for each image, an overall AP is calculated. There is no ClassId in  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} in the test set, so all those predictions would be FP.",
      "votes": null
    },
    {
      "id": "552092",
      "postDate": "06/13/2019 13:55:31",
      "content": "<p>Thank you for sharing，when I remvoe it, I get 0.31802 / 0.33214 ,  I am a loser of this game.</p>",
      "rawMarkdown": "Thank you for sharing，when I remvoe it, I get 0.31802 / 0.33214 ,  I am a loser of this game.",
      "votes": null
    },
    {
      "id": "552482",
      "postDate": "06/14/2019 03:24:26",
      "content": "<p>thanks for sharing</p>",
      "rawMarkdown": "thanks for sharing",
      "votes": null
    },
    {
      "id": "552612",
      "postDate": "06/14/2019 07:47:34",
      "content": "<p>Thanks for sharing!</p>",
      "rawMarkdown": "Thanks for sharing!",
      "votes": null
    },
    {
      "id": "552767",
      "postDate": "06/14/2019 13:58:55",
      "content": "<p>Awesome codes!! Thank you :) </p>",
      "rawMarkdown": "Awesome codes!! Thank you :)",
      "votes": null
    },
    {
      "id": "552829",
      "postDate": "06/14/2019 15:58:53",
      "content": "<p>Thanks! Keep it up.</p>",
      "rawMarkdown": "Thanks! Keep it up.",
      "votes": null
    },
    {
      "id": "553688",
      "postDate": "06/16/2019 06:28:01",
      "content": "<p>Congrats! and also thanks a lot for sharing this</p>",
      "rawMarkdown": "Congrats! and also thanks a lot for sharing this",
      "votes": null
    },
    {
      "id": "553775",
      "postDate": "06/16/2019 09:53:02",
      "content": "<p>Congrats! Thank you for sharing your detailed descriptions and awesome codes !</p>",
      "rawMarkdown": "Congrats! Thank you for sharing your detailed descriptions and awesome codes !",
      "votes": null
    },
    {
      "id": "556784",
      "postDate": "06/20/2019 16:38:30",
      "content": "<p>Thanks for the heads up. </p>",
      "rawMarkdown": "Thanks for the heads up.",
      "votes": null
    },
    {
      "id": "567841",
      "postDate": "07/04/2019 04:36:52",
      "content": "<p>Thank you for sharing</p>",
      "rawMarkdown": "Thank you for sharing",
      "votes": null
    },
    {
      "id": "614614",
      "postDate": "08/31/2019 19:04:12",
      "content": "<p>Congratulations for the 1st place!\nThank you for sharing.</p>",
      "rawMarkdown": "Congratulations for the 1st place!\nThank you for sharing.",
      "votes": null
    },
    {
      "id": "623510",
      "postDate": "09/11/2019 03:26:40",
      "content": "<p>AMAZING WORK. thanks for sharing </p>",
      "rawMarkdown": "AMAZING WORK. thanks for sharing",
      "votes": null
    },
    {
      "id": "626271",
      "postDate": "09/14/2019 05:27:00",
      "content": "<p><a href=\"/amiras\">@amiras</a> How do you do ensembling? For example what if one model predict an object but another model don't?</p>\n\n<p>Thanks.</p>",
      "rawMarkdown": "amiras How do you do ensembling? For example what if one model predict an object but another model don't?\n\nThanks.",
      "votes": null
    },
    {
      "id": "626701",
      "postDate": "09/14/2019 17:40:53",
      "content": "<p>The ensemble is made using the nms algorithm. In the simple case, let one algorithm predict bboxes1, the second algorithm predict bboxes2. Next, we concatenate these answers and get bboxes = bboxes1 + bboxes2. Next we apply the nms algorithm. As a result, we get the ensemble_bboxes = nms(bboxes). For a more detailed information, see the scheme <img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png\" alt=\"ensemble scheme\">  and the code.</p>",
      "rawMarkdown": "The ensemble is made using the nms algorithm. In the simple case, let one algorithm predict bboxes1, the second algorithm predict bboxes2. Next, we concatenate these answers and get bboxes = bboxes1 + bboxes2. Next we apply the nms algorithm. As a result, we get the ensemble_bboxes = nms(bboxes). For a more detailed information, see the scheme ![ensemble scheme](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png)  and the code.",
      "votes": null
    },
    {
      "id": "786868",
      "postDate": "03/26/2020 09:31:17",
      "content": "<p>Great job! Thanks for sharing.</p>",
      "rawMarkdown": "Great job! Thanks for sharing.",
      "votes": null
    },
    {
      "id": "815119",
      "postDate": "04/21/2020 09:06:16",
      "content": "<p>Hi so how do you predict ClassIds {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} if you delete all lines with this class and thus dont train on it? Those are the very basic classes that are the biggest part of the dataset. </p>",
      "rawMarkdown": "Hi so how do you predict ClassIds {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} if you delete all lines with this class and thus dont train on it? Those are the very basic classes that are the biggest part of the dataset.",
      "votes": null
    },
    {
      "id": "2454079",
      "postDate": "09/24/2023 15:06:31",
      "content": "<p>What a great work!</p>",
      "rawMarkdown": "What a great work!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2454079,
      "author_name": "peterthegenius",
      "author_url": "",
      "post_date": "09/24/2023 15:06:31",
      "content": "<p>What a great work!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549788,
      "author_name": "alexanderliao",
      "author_url": "",
      "post_date": "06/11/2019 03:16:54",
      "content": "<p>Wow, I was so close..... I had exactly the same pipeline as yours, except the part of nms threshold....</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549798,
      "author_name": "lzhbrian",
      "author_url": "",
      "post_date": "06/11/2019 03:48:14",
      "content": "<p>Setting: \n* <code>score_thr=0.5</code>\n* <code>nms={type: 'nms', iou_thr: 0.3}</code>\n* <code>max_per_img=100</code>\n* <code>mask_thr_binary=0.45</code></p>\n\n<p>Seriously improves from 0.21913 to 0.30011? That was ... incredible.\nI only tried tuning the score_thr, and the improvement is only around 0.02</p>\n\n<p>Have you tried Soft-NMS? lowering the nms threshold seems to have a similar goal on preserving more proposals.</p>\n\n<p>Thanks for the sharing, and big congrats !</p>",
      "votes": null,
      "replies": [
        {
          "id": 549808,
          "author_name": "hesene",
          "author_url": "",
          "post_date": "06/11/2019 03:54:43",
          "content": "<p>This setting also adds little to my score.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 549823,
          "author_name": "alexanderliao",
          "author_url": "",
          "post_date": "06/11/2019 04:07:31",
          "content": "<p>Soft-nms increased my score by like 0.0001....</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 549827,
          "author_name": "amiras",
          "author_url": "",
          "post_date": "06/11/2019 04:20:05",
          "content": "<p>I think it depends on the post-processing algorithm to avoid intersections of masks of the same class.</p>\n\n<p>By default, <code>score_threshold = 0.001.</code> My post-processing algorithm for masks did not delete the masks. The result was a lot of masks with small scores. This greatly degraded the metric.\nI added this algorithm to the solution description.</p>\n\n<p>Soft-nms didn't increase my score.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 549799,
      "author_name": "projdev",
      "author_url": "",
      "post_date": "06/11/2019 03:49:19",
      "content": "<p>Many thanks for sharing your solutions. Looking forward to your source code! Congratulations! :-)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549824,
      "author_name": "hesene",
      "author_url": "",
      "post_date": "06/11/2019 04:09:23",
      "content": "<p>Thank you for your sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549844,
      "author_name": "manyfoldcv",
      "author_url": "",
      "post_date": "06/11/2019 04:47:37",
      "content": "<p>Looking forward to seeing your code!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549873,
      "author_name": "nasimkh",
      "author_url": "",
      "post_date": "06/11/2019 05:26:02",
      "content": "<p>Congratulations :)  Looking forward to your code. Thank you very much.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549882,
      "author_name": "timmmmmms",
      "author_url": "",
      "post_date": "06/11/2019 05:36:35",
      "content": "<p>Thanks！</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549923,
      "author_name": "golubev",
      "author_url": "",
      "post_date": "06/11/2019 06:31:35",
      "content": "<p>Congratulations with 1st and Competitions Master!\nLooking forward to your code!\nThank you very much!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549936,
      "author_name": "nuller",
      "author_url": "",
      "post_date": "06/11/2019 06:40:07",
      "content": "<p>TOP!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549975,
      "author_name": "mathurinache",
      "author_url": "",
      "post_date": "06/11/2019 07:28:20",
      "content": "<p>Congratulations and thank you for your sharings!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 549986,
      "author_name": "brunhs",
      "author_url": "",
      "post_date": "06/11/2019 07:40:07",
      "content": "<p>Pretty good! Waiting for the code!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550002,
      "author_name": "almakhann",
      "author_url": "",
      "post_date": "06/11/2019 07:59:30",
      "content": "<p>Good job) </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550102,
      "author_name": "azimovsh",
      "author_url": "",
      "post_date": "06/11/2019 09:54:39",
      "content": "<p>Thank you!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550116,
      "author_name": "veegalinova",
      "author_url": "",
      "post_date": "06/11/2019 10:07:42",
      "content": "<p>Thanks</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550160,
      "author_name": "tascj0",
      "author_url": "",
      "post_date": "06/11/2019 11:15:07",
      "content": "<p>Congratulations.</p>\n\n<p>It seems that discarding classes with attributes is the key to win a gold.\nBy simply removing ClassId in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, we could get 0.31662/0.30403 .</p>\n\n<p>According to <a href=\"https://github.com/visipedia/imat_comp\">https://github.com/visipedia/imat_comp</a>, there are 10K images with both segmentation and fine-grained attributes. We have 6696 in train, so probably all of the test data are with fine-grained attributes.</p>\n\n<p>It was close...</p>",
      "votes": null,
      "replies": [
        {
          "id": 551973,
          "author_name": "hesene",
          "author_url": "",
          "post_date": "06/13/2019 11:04:37",
          "content": "<p>If a line's classid is 3 4 7 8 10 11 45,  you means to delete this line or just remove the attribute?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 552021,
          "author_name": "tascj0",
          "author_url": "",
          "post_date": "06/13/2019 12:23:46",
          "content": "<p>I just deleted the lines.</p>\n\n<p>Actually, I think the instruction of LB evaluation metric might be incorrect.\n&gt; The score returned by the competition metric is the mean taken over the individual average precisions of each image and each ClassId in the test dataset.</p>\n\n<p>How many ClassIds do we have? It's 46 * (2^92). In train, it is 6371. Taking an average over ClassIds would be...</p>\n\n<p>Here is my guess. The metric used might be a mean taken over the average precision of each image. And for each image, an overall AP is calculated. There is no ClassId in  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} in the test set, so all those predictions would be FP.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 552092,
          "author_name": "hesene",
          "author_url": "",
          "post_date": "06/13/2019 13:55:31",
          "content": "<p>Thank you for sharing，when I remvoe it, I get 0.31802 / 0.33214 ,  I am a loser of this game.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 815119,
          "author_name": "kka217",
          "author_url": "",
          "post_date": "04/21/2020 09:06:16",
          "content": "<p>Hi so how do you predict ClassIds {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} if you delete all lines with this class and thus dont train on it? Those are the very basic classes that are the biggest part of the dataset. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 550168,
      "author_name": "anushkasharma",
      "author_url": "",
      "post_date": "06/11/2019 11:27:24",
      "content": "<p>Congratulations and thanks for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550495,
      "author_name": "mrudul",
      "author_url": "",
      "post_date": "06/11/2019 17:09:02",
      "content": "<p>Thank you for sharing the details</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550552,
      "author_name": "kevinrosalesdev",
      "author_url": "",
      "post_date": "06/11/2019 18:33:16",
      "content": "<p>Awesome!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550755,
      "author_name": "makeitworkjml",
      "author_url": "",
      "post_date": "06/12/2019 02:18:41",
      "content": "<p>Hi <a href=\"/amiras\">@amiras</a>  Thank you for sharing your solution! Will you attend CVPR2019 this year? <a href=\"https://sites.google.com/view/fgvc6/program?authuser=0\">Schedule of our upcoming FGVC workshop can be found here</a>.</p>\n\n<p>As one of top 3 teams, you are invited to present your solution in our upcoming FGVC workshop at CVPR.</p>\n\n<ol>\n<li>Could you be able to send me 1-2 pages of google slides (or pdf) describing your method? So I can include it in my presentation of this challenge.</li>\n<li>You will also have access to a 4 foot x 4 foot poster board in our FGVC workshop if you want to present your method at the workshop. (If you couldn't make it to the workshop, another option is that you can send your poster to me before June 14. I can help you print it and hang in the board that day)</li>\n</ol>\n\n<p>Thank you!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 550887,
      "author_name": "chrisluu",
      "author_url": "",
      "post_date": "06/12/2019 05:53:18",
      "content": "<p>Congrats！Thank you for sharing the details.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 551038,
      "author_name": "kongcraft",
      "author_url": "",
      "post_date": "06/12/2019 09:21:16",
      "content": "<p>Congratulations :)  Looking forward to seeing your code!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 551098,
      "author_name": "koyyy0",
      "author_url": "",
      "post_date": "06/12/2019 10:38:40",
      "content": "<p>Thank you for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 552482,
      "author_name": "mauroban",
      "author_url": "",
      "post_date": "06/14/2019 03:24:26",
      "content": "<p>thanks for sharing</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 552612,
      "author_name": "rrishabhporwal",
      "author_url": "",
      "post_date": "06/14/2019 07:47:34",
      "content": "<p>Thanks for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 552767,
      "author_name": "junhoning",
      "author_url": "",
      "post_date": "06/14/2019 13:58:55",
      "content": "<p>Awesome codes!! Thank you :) </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 552829,
      "author_name": "rhhridoy",
      "author_url": "",
      "post_date": "06/14/2019 15:58:53",
      "content": "<p>Thanks! Keep it up.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 553688,
      "author_name": "arjun21",
      "author_url": "",
      "post_date": "06/16/2019 06:28:01",
      "content": "<p>Congrats! and also thanks a lot for sharing this</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 553775,
      "author_name": "haradataman",
      "author_url": "",
      "post_date": "06/16/2019 09:53:02",
      "content": "<p>Congrats! Thank you for sharing your detailed descriptions and awesome codes !</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 556784,
      "author_name": "ksajan12",
      "author_url": "",
      "post_date": "06/20/2019 16:38:30",
      "content": "<p>Thanks for the heads up. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567841,
      "author_name": "wordbe",
      "author_url": "",
      "post_date": "07/04/2019 04:36:52",
      "content": "<p>Thank you for sharing</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 614614,
      "author_name": "zecach",
      "author_url": "",
      "post_date": "08/31/2019 19:04:12",
      "content": "<p>Congratulations for the 1st place!\nThank you for sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 623510,
      "author_name": "marcovasquez",
      "author_url": "",
      "post_date": "09/11/2019 03:26:40",
      "content": "<p>AMAZING WORK. thanks for sharing </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 626271,
      "author_name": "bopengiowa",
      "author_url": "",
      "post_date": "09/14/2019 05:27:00",
      "content": "<p><a href=\"/amiras\">@amiras</a> How do you do ensembling? For example what if one model predict an object but another model don't?</p>\n\n<p>Thanks.</p>",
      "votes": null,
      "replies": [
        {
          "id": 626701,
          "author_name": "amiras",
          "author_url": "",
          "post_date": "09/14/2019 17:40:53",
          "content": "<p>The ensemble is made using the nms algorithm. In the simple case, let one algorithm predict bboxes1, the second algorithm predict bboxes2. Next, we concatenate these answers and get bboxes = bboxes1 + bboxes2. Next we apply the nms algorithm. As a result, we get the ensemble_bboxes = nms(bboxes). For a more detailed information, see the scheme <img src=\"https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png\" alt=\"ensemble scheme\">  and the code.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 786868,
      "author_name": "daulmsk",
      "author_url": "",
      "post_date": "03/26/2020 09:31:17",
      "content": "<p>Great job! Thanks for sharing.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "549786": "Hi Kagglers,\n\nMy solution is based on the COCO challenge 2018 winners article: https://arxiv.org/abs/1901.07518. \n\n# Code: \nhttps://github.com/amirassov/kaggle-imaterialist\n\n# Model: \n[Hybrid Task Cascade with ResNeXt-101-64x4d-FPN backbone](https://github.com/open-mmlab/mmdetection/blob/master/configs/htc/htc_dconv_c3-c5_mstrain_400_1400_x101_64x4d_fpn_20e.py). This model has a metric Mask mAP = 43.9 on COCO dataset. This is SOTA for instance segmentation.\n\n# Validation:\nFor validation, I used 450 training samples splitted using https://github.com/trent-b/iterative-stratification.\n\n# Preprocessing:\nI applied light augmentatios from the [albumentations](https://github.com/albu/albumentations) library to the original image. Then I use multi-scale training: in each iteration, the scale of short edge is randomly sampled\nfrom [600, 1200], and the scale of long edge is fixed as 1900.\n![preprocessing](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/preproc.png)\n\n# Training details:\n* pre-train from COCO\n* optimizer: `SGD(lr=0.03, momentum=0.9, weight_decay=0.0001)`\n* batch_size: 16 = 2 images per gpu x 8 gpus Tesla V100\n* learning rate scheduler:\n```if iterations &lt; 500:\n   lr = warmup(warmup_ratio=1 / 3)\nif epochs == 10:\n   lr = lr ∗ 0.1\nif epochs == 18:\n   lr = lr ∗ 0.1\nif epochs &gt; 20:\n   stop```\n* training time: ~3 days.\n\n# Parameter tuning:\nAfter the 12th epoch with the default parameters, the metric on LB was **0.21913**. Next, I tuned postprocessing thresholds using validation data:\n* `score_thr=0.5`\n* `nms={type: 'nms', iou_thr: 0.3}`\n* `max_per_img=100`\n* `mask_thr_binary=0.45`\n\nThis improved the metric on LB: **0.21913 -&gt; 0.30011.**\n\n# Test time augmentation:\nI use 3 scales as well as horizontal flip at test time and ensemble the results. Testing scales are (1000, 1600), (1200, 1900), (1400, 2200). \n\nI drew a TTA scheme for Mask R-CNN, which is implemented in mmdetection library. For Hybrid Task Cascade R-CNN, I rewrote this code. \n\nThis improved the metric on LB: **0.30011 -&gt; 0.31074.**\n![TTA](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/tta.png)\n\n# Ensemble:\nI ensemble the 3 best checkpoints of my model. The ensemble scheme is similar to TTA. \n\nThis improved the metric on LB: **0.31074 -&gt; 0.31626.**\n![ensemble](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png)\n\n# Attributes:\nI didn't use attributes at all: they were difficult to predict and the removal of classes with attributes greatly improved the metric. \n\nDuring the whole competition, I deleted classes with attributes: `{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}` U `{27, 28, 33}`. But two days before the end I read [the discussion] (https://www.kaggle.com/c/imaterialist-fashion-2019-FGVC6/discussion/94811#latest548137) and added back classes `{27, 28, 33 }`. \n\nThis improved the metric on LB: **0.31626 -&gt; 0.33511.**\n\n# Postprocessing for masks\nMy post-processing algorithm for avoid intersections of masks of the same class:\n```def hard_overlaps_suppression(binary_mask, scores):\n    not_overlap_mask = []\n    for i in np.argsort(scores)[::-1]:\n        current_mask = binary_mask[..., i].copy()\n        for mask in not_overlap_mask:\n            current_mask = np.bitwise_and(current_mask, np.invert(mask))\n        not_overlap_mask.append(current_mask)\n    return np.stack(not_overlap_mask, -1)```\n\n# Small postprocessing:\nI deleted objects with an area of less than 20 pixels. \n\nThis improved the metric on LB: **0.33511 -&gt; 0.33621.**",
    "549788": "Wow, I was so close..... I had exactly the same pipeline as yours, except the part of nms threshold....",
    "549798": "Setting: \n* `score_thr=0.5`\n* `nms={type: 'nms', iou_thr: 0.3}`\n* `max_per_img=100`\n* `mask_thr_binary=0.45`\n\nSeriously improves from 0.21913 to 0.30011? That was ... incredible.\nI only tried tuning the score_thr, and the improvement is only around 0.02\n\nHave you tried Soft-NMS? lowering the nms threshold seems to have a similar goal on preserving more proposals.\n\nThanks for the sharing, and big congrats !",
    "549799": "Many thanks for sharing your solutions. Looking forward to your source code! Congratulations! :-)",
    "549808": "This setting also adds little to my score.",
    "549823": "Soft-nms increased my score by like 0.0001....",
    "549824": "Thank you for your sharing!",
    "549827": "I think it depends on the post-processing algorithm to avoid intersections of masks of the same class.\n\nBy default, `score_threshold = 0.001.` My post-processing algorithm for masks did not delete the masks. The result was a lot of masks with small scores. This greatly degraded the metric.\nI added this algorithm to the solution description.\n\n\nSoft-nms didn't increase my score.",
    "549844": "Looking forward to seeing your code!",
    "549873": "Congratulations :)  Looking forward to your code. Thank you very much.",
    "549882": "Thanks！",
    "549923": "Congratulations with 1st and Competitions Master!\nLooking forward to your code!\nThank you very much!",
    "549936": "TOP!",
    "549975": "Congratulations and thank you for your sharings!",
    "549986": "Pretty good! Waiting for the code!",
    "550002": "Good job)",
    "550102": "Thank you!",
    "550116": "Thanks",
    "550160": "Congratulations.\n\nIt seems that discarding classes with attributes is the key to win a gold.\nBy simply removing ClassId in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, we could get 0.31662/0.30403 .\n\nAccording to https://github.com/visipedia/imat_comp, there are 10K images with both segmentation and fine-grained attributes. We have 6696 in train, so probably all of the test data are with fine-grained attributes.\n\nIt was close...",
    "550168": "Congratulations and thanks for sharing!",
    "550495": "Thank you for sharing the details",
    "550552": "Awesome!",
    "550755": "Hi @amiras  Thank you for sharing your solution! Will you attend CVPR2019 this year? [Schedule of our upcoming FGVC workshop can be found here](https://sites.google.com/view/fgvc6/program?authuser=0).\n\nAs one of top 3 teams, you are invited to present your solution in our upcoming FGVC workshop at CVPR.\n\n1. Could you be able to send me 1-2 pages of google slides (or pdf) describing your method? So I can include it in my presentation of this challenge.\n2. You will also have access to a 4 foot x 4 foot poster board in our FGVC workshop if you want to present your method at the workshop. (If you couldn't make it to the workshop, another option is that you can send your poster to me before June 14. I can help you print it and hang in the board that day)\n\nThank you!",
    "550887": "Congrats！Thank you for sharing the details.",
    "551038": "Congratulations :)  Looking forward to seeing your code!",
    "551098": "Thank you for sharing!",
    "551973": "If a line's classid is 3 4 7 8 10 11 45,  you means to delete this line or just remove the attribute?",
    "552021": "I just deleted the lines.\n\nActually, I think the instruction of LB evaluation metric might be incorrect.\n&gt; The score returned by the competition metric is the mean taken over the individual average precisions of each image and each ClassId in the test dataset.\n\nHow many ClassIds do we have? It's 46 * (2^92). In train, it is 6371. Taking an average over ClassIds would be...\n\nHere is my guess. The metric used might be a mean taken over the average precision of each image. And for each image, an overall AP is calculated. There is no ClassId in  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} in the test set, so all those predictions would be FP.",
    "552092": "Thank you for sharing，when I remvoe it, I get 0.31802 / 0.33214 ,  I am a loser of this game.",
    "552482": "thanks for sharing",
    "552612": "Thanks for sharing!",
    "552767": "Awesome codes!! Thank you :)",
    "552829": "Thanks! Keep it up.",
    "553688": "Congrats! and also thanks a lot for sharing this",
    "553775": "Congrats! Thank you for sharing your detailed descriptions and awesome codes !",
    "556784": "Thanks for the heads up.",
    "567841": "Thank you for sharing",
    "614614": "Congratulations for the 1st place!\nThank you for sharing.",
    "623510": "AMAZING WORK. thanks for sharing",
    "626271": "amiras How do you do ensembling? For example what if one model predict an object but another model don't?\n\nThanks.",
    "626701": "The ensemble is made using the nms algorithm. In the simple case, let one algorithm predict bboxes1, the second algorithm predict bboxes2. Next, we concatenate these answers and get bboxes = bboxes1 + bboxes2. Next we apply the nms algorithm. As a result, we get the ensemble_bboxes = nms(bboxes). For a more detailed information, see the scheme ![ensemble scheme](https://raw.githubusercontent.com/amirassov/kaggle-imaterialist/master/figures/ensemble.png)  and the code.",
    "786868": "Great job! Thanks for sharing.",
    "815119": "Hi so how do you predict ClassIds {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} if you delete all lines with this class and thus dont train on it? Those are the very basic classes that are the biggest part of the dataset.",
    "2454079": "What a great work!"
  },
  "source": "meta"
}