{
  "id": 229615,
  "title": "[11th place solution] YOLOv5 + VFNet + EfficientD6",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/229615",
  "author_name": "nvnn",
  "post_date": "2021-03-31T00:34:52.104000",
  "votes": 64,
  "comment_count": 20,
  "views": 0,
  "content": "<p>Congratulation to all and thanks to Vingroup Big Data Institute for this interesting competition.<br>\nSo here are some essential points of my solutions.</p>\n<p><strong>1. Summary</strong></p>\n<ul>\n<li>2 classes classifier: efficientnetB6</li>\n<li>object detection: Yolov5 (yolov5x, yolov5l, yolov5x + ASFF head, yolov5-p6) + EfficientD6 + VFNet</li>\n<li>Preprocessing boxes: WBF(IOU=0.7)</li>\n<li>Post-processing: customized WBF (this customization brings 0.015mAP improvement)</li>\n<li>Train yolov5 with quadruple mean teachers.</li>\n<li>Ensemble</li>\n</ul>\n<p><strong>2. Classification models</strong></p>\n<ul>\n<li>For 2 class classifier, I slightly modify <a href=\"https://www.kaggle.com/solosquad1999/vinbigdata-train-efficientnet-2-classes\" target=\"_blank\">this notebook</a>. Thanks to <a href=\"https://www.kaggle.com/solosquad1999\" target=\"_blank\">@solosquad1999</a> </li>\n<li>I use efficientnetB6, image size 768.</li>\n<li>My 2 class classifier achieves a AUC of 0.992 and AP 0.96.</li>\n</ul>\n<p><strong>3. Detection model</strong></p>\n<ul>\n<li>Yolov5: <ul>\n<li>I use 3 models from <a href=\"https://github.com/ultralytics/yolov5\" target=\"_blank\">yolov5 repo</a> (yolov5x, yolov5l and yolov5-p6) and yolov5_asff from this <a href=\"https://github.com/ultralytics/yolov5\" target=\"_blank\">pull request</a></li>\n<li>I add mosaic2 and mosaic3 and use it together with mosaic4 from yolov5 repo.</li>\n<li>I train each model 60 epochs at image size 640. I didn't test larger image size. </li>\n<li>A single model has CV around 0.42 and LB score ~0.2-0.25</li></ul></li>\n<li>VFNet: <ul>\n<li>I use VFNet (resnet101) model from mmdetection and add more augmentation (Noise, RandomBrightnessContrast, etc). </li>\n<li>My VFNet model works as good as yolov5, CV ~0.42 and LB 0.24.</li></ul></li>\n<li>EfficientD6: I train EfficientD6 at image size 512x512, it gives me better CV (0.43) but lower LB (0.2). I can't use larger image size because of limited GPU VRAM.</li>\n</ul>\n<p><strong>4. Training with mean teachers</strong><br>\n<img src=\"https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\" alt=\"\"></p>\n<p><code>loss = yolov5_loss + alpha*consistency_losses</code><br>\n<code>alpha</code> is calculated using this function</p>\n<pre><code>def sigmoid_rampup(current_epoch, rampup_epoch=5):\n    \"\"\"Exponential rampup from https://arxiv.org/abs/1610.02242\"\"\"\n    if rampup_length == 0:\n        return 0.1\n    else:\n        current = np.clip(current, 0.0, rampup_length)\n        phase = 1.0 - current / rampup_length\n        return 0.1*float(np.exp(-5.0 * phase * phase))\n</code></pre>\n<p>Using mean teachers improve CV ~0.02mAP, However, it does not add much diversity when ensemble.</p>",
  "messages": [
    {
      "id": 1257561,
      "postDate": "2021-03-31T00:34:52.103Z",
      "content": "<p>Congratulation to all and thanks to Vingroup Big Data Institute for this interesting competition.<br>\nSo here are some essential points of my solutions.</p>\n<p><strong>1. Summary</strong></p>\n<ul>\n<li>2 classes classifier: efficientnetB6</li>\n<li>object detection: Yolov5 (yolov5x, yolov5l, yolov5x + ASFF head, yolov5-p6) + EfficientD6 + VFNet</li>\n<li>Preprocessing boxes: WBF(IOU=0.7)</li>\n<li>Post-processing: customized WBF (this customization brings 0.015mAP improvement)</li>\n<li>Train yolov5 with quadruple mean teachers.</li>\n<li>Ensemble</li>\n</ul>\n<p><strong>2. Classification models</strong></p>\n<ul>\n<li>For 2 class classifier, I slightly modify <a href=\"https://www.kaggle.com/solosquad1999/vinbigdata-train-efficientnet-2-classes\" target=\"_blank\">this notebook</a>. Thanks to <a href=\"https://www.kaggle.com/solosquad1999\" target=\"_blank\">@solosquad1999</a> </li>\n<li>I use efficientnetB6, image size 768.</li>\n<li>My 2 class classifier achieves a AUC of 0.992 and AP 0.96.</li>\n</ul>\n<p><strong>3. Detection model</strong></p>\n<ul>\n<li>Yolov5: <ul>\n<li>I use 3 models from <a href=\"https://github.com/ultralytics/yolov5\" target=\"_blank\">yolov5 repo</a> (yolov5x, yolov5l and yolov5-p6) and yolov5_asff from this <a href=\"https://github.com/ultralytics/yolov5\" target=\"_blank\">pull request</a></li>\n<li>I add mosaic2 and mosaic3 and use it together with mosaic4 from yolov5 repo.</li>\n<li>I train each model 60 epochs at image size 640. I didn't test larger image size. </li>\n<li>A single model has CV around 0.42 and LB score ~0.2-0.25</li></ul></li>\n<li>VFNet: <ul>\n<li>I use VFNet (resnet101) model from mmdetection and add more augmentation (Noise, RandomBrightnessContrast, etc). </li>\n<li>My VFNet model works as good as yolov5, CV ~0.42 and LB 0.24.</li></ul></li>\n<li>EfficientD6: I train EfficientD6 at image size 512x512, it gives me better CV (0.43) but lower LB (0.2). I can't use larger image size because of limited GPU VRAM.</li>\n</ul>\n<p><strong>4. Training with mean teachers</strong><br>\n<img src=\"https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\" alt=\"\"></p>\n<p><code>loss = yolov5_loss + alpha*consistency_losses</code><br>\n<code>alpha</code> is calculated using this function</p>\n<pre><code>def sigmoid_rampup(current_epoch, rampup_epoch=5):\n    \"\"\"Exponential rampup from https://arxiv.org/abs/1610.02242\"\"\"\n    if rampup_length == 0:\n        return 0.1\n    else:\n        current = np.clip(current, 0.0, rampup_length)\n        phase = 1.0 - current / rampup_length\n        return 0.1*float(np.exp(-5.0 * phase * phase))\n</code></pre>\n<p>Using mean teachers improve CV ~0.02mAP, However, it does not add much diversity when ensemble.</p>",
      "rawMarkdown": "Congratulation to all and thanks to Vingroup Big Data Institute for this interesting competition.\nSo here are some essential points of my solutions.\n\n**1. Summary**\n- 2 classes classifier: efficientnetB6\n- object detection: Yolov5 (yolov5x, yolov5l, yolov5x + ASFF head, yolov5-p6) + EfficientD6 + VFNet\n- Preprocessing boxes: WBF(IOU=0.7)\n- Post-processing: customized WBF (this customization brings 0.015mAP improvement)\n- Train yolov5 with quadruple mean teachers.\n- Ensemble\n\n**2. Classification models**\n- For 2 class classifier, I slightly modify [this notebook](https://www.kaggle.com/solosquad1999/vinbigdata-train-efficientnet-2-classes). Thanks to @solosquad1999 \n- I use efficientnetB6, image size 768.\n- My 2 class classifier achieves a AUC of 0.992 and AP 0.96.\n\n**3. Detection model**\n- Yolov5: \n    - I use 3 models from [yolov5 repo](https://github.com/ultralytics/yolov5) (yolov5x, yolov5l and yolov5-p6) and yolov5_asff from this [pull request](https://github.com/ultralytics/yolov5)\n   - I add mosaic2 and mosaic3 and use it together with mosaic4 from yolov5 repo.\n   - I train each model 60 epochs at image size 640. I didn't test larger image size. \n   - A single model has CV around 0.42 and LB score ~0.2-0.25\n- VFNet: \n   - I use VFNet (resnet101) model from mmdetection and add more augmentation (Noise, RandomBrightnessContrast, etc). \n   - My VFNet model works as good as yolov5, CV ~0.42 and LB 0.24.\n- EfficientD6: I train EfficientD6 at image size 512x512, it gives me better CV (0.43) but lower LB (0.2). I can't use larger image size because of limited GPU VRAM.\n\n**4. Training with mean teachers**\n![](https://i.ibb.co/jT2RH7S/Untitled-Diagram.png)\n\n`loss = yolov5_loss + alpha*consistency_losses`\n`alpha` is calculated using this function\n```\ndef sigmoid_rampup(current_epoch, rampup_epoch=5):\n    \"\"\"Exponential rampup from https://arxiv.org/abs/1610.02242\"\"\"\n    if rampup_length == 0:\n        return 0.1\n    else:\n        current = np.clip(current, 0.0, rampup_length)\n        phase = 1.0 - current / rampup_length\n        return 0.1*float(np.exp(-5.0 * phase * phase))\n```\nUsing mean teachers improve CV ~0.02mAP, However, it does not add much diversity when ensemble.",
      "votes": 64
    },
    {
      "id": 1257584,
      "postDate": "2021-03-31T01:02:33.230Z",
      "content": "<p>Big Congratulations on solo gold medal and becoming GM, proud of you <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> ^^</p>",
      "rawMarkdown": "Big Congratulations on solo gold medal and becoming GM, proud of you @nvnnghia ^^",
      "votes": 3
    },
    {
      "id": 1260210,
      "postDate": "2021-04-01T23:48:01.003Z",
      "content": "<p>Congrats to <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> , our newly minted competition GM !</p>",
      "rawMarkdown": "Congrats to @nvnnghia , our newly minted competition GM !",
      "votes": 1
    },
    {
      "id": 1259348,
      "postDate": "2021-04-01T10:23:22.190Z",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratulations on Gold and becoming a GM. I like the idea of consistency loss.</p>",
      "rawMarkdown": "@nvnnghia Congratulations on Gold and becoming a GM. I like the idea of consistency loss.",
      "votes": 1
    },
    {
      "id": 1258558,
      "postDate": "2021-03-31T17:54:10.753Z",
      "content": "<p>Congrats on a gold medal and becoming new competitions GM! <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> <br>\n👍</p>",
      "rawMarkdown": "Congrats on a gold medal and becoming new competitions GM! @nvnnghia \n👍",
      "votes": 1
    },
    {
      "id": 1258522,
      "postDate": "2021-03-31T17:25:17.323Z",
      "content": "<p>Thanks for sharing :)<br>\nThis should do the job, Kaggle's image hosting is broken.</p>\n<blockquote>\n  <p>![](<a href=\"https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\" target=\"_blank\">https://i.ibb.co/jT2RH7S/Untitled-Diagram.png</a></p>\n</blockquote>\n<p>Just add <code>)</code> at the end </p>",
      "rawMarkdown": "Thanks for sharing :)\nThis should do the job, Kaggle's image hosting is broken.\n> ![](https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\n\nJust add `)` at the end ",
      "votes": 1,
      "replies": [
        {
          "id": 1259251,
          "postDate": "2021-04-01T09:01:17.283Z",
          "content": "<p>Thank you!!!</p>",
          "rawMarkdown": "Thank you!!!"
        }
      ]
    },
    {
      "id": 1257995,
      "postDate": "2021-03-31T09:08:34.703Z",
      "content": "<p>Congrats a lot ! Good work !</p>",
      "rawMarkdown": "Congrats a lot ! Good work !",
      "votes": 1
    },
    {
      "id": 1257989,
      "postDate": "2021-03-31T09:04:12.767Z",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a>  can you give me some sort of references to \"quadruple mean teachers\" ?</p>",
      "rawMarkdown": "@nvnnghia  can you give me some sort of references to \"quadruple mean teachers\" ?",
      "votes": 1,
      "replies": [
        {
          "id": 1258003,
          "postDate": "2021-03-31T09:19:07.050Z",
          "content": "<p>you can refer to <a href=\"https://arxiv.org/pdf/1703.01780.pdf\" target=\"_blank\">this paper</a>.  In the paper the author uses one mean teacher to train one student. In this competition, I use 4 teachers to train 1 student, so I call it quadruple mean teachers :)).</p>",
          "rawMarkdown": "you can refer to [this paper](https://arxiv.org/pdf/1703.01780.pdf).  In the paper the author uses one mean teacher to train one student. In this competition, I use 4 teachers to train 1 student, so I call it quadruple mean teachers :)).",
          "votes": 1
        }
      ]
    },
    {
      "id": 1257884,
      "postDate": "2021-03-31T07:15:22.987Z",
      "content": "<p>Congratulations. Very good success.</p>",
      "rawMarkdown": "Congratulations. Very good success.",
      "votes": 1
    },
    {
      "id": 1257568,
      "postDate": "2021-03-31T00:45:49.480Z",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratulations on Gold and also for becoming GrandMaster</p>",
      "rawMarkdown": "@nvnnghia Congratulations on Gold and also for becoming GrandMaster",
      "votes": 1
    },
    {
      "id": 1257564,
      "postDate": "2021-03-31T00:40:31.960Z",
      "content": "<p>Congrats to you! Nice work👀 and I'm quite curious about your customized WBF👋👋👋💯✔️</p>",
      "rawMarkdown": "Congrats to you! Nice work👀 and I'm quite curious about your customized WBF👋👋👋💯✔️",
      "votes": 1
    },
    {
      "id": 1257673,
      "postDate": "2021-03-31T03:01:19.030Z",
      "content": "<p>Congrats a lot !</p>",
      "rawMarkdown": "Congrats a lot !",
      "votes": 2
    },
    {
      "id": 1257565,
      "postDate": "2021-03-31T00:42:27.417Z",
      "content": "<p>0.15 mAP: improvement from customized WBF postprocessing!? That's some crazy magic.</p>\n<p>Congratulations on competitions GM!</p>",
      "rawMarkdown": "0.15 mAP: improvement from customized WBF postprocessing!? That's some crazy magic.\n\nCongratulations on competitions GM!",
      "votes": 2,
      "replies": [
        {
          "id": 1257572,
          "postDate": "2021-03-31T00:48:26.820Z",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/stanleyjzheng\" target=\"_blank\">@stanleyjzheng</a> . Actually, I just reimplemented WBF paper. I think the author's implementation is not exactly same as describing in the paper. </p>",
          "rawMarkdown": "Thanks @stanleyjzheng . Actually, I just reimplemented WBF paper. I think the author's implementation is not exactly same as describing in the paper. ",
          "votes": 6
        },
        {
          "id": 1258005,
          "postDate": "2021-03-31T09:20:14.237Z",
          "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Probably 0.<strong>0</strong>15 ?</p>",
          "rawMarkdown": "@nvnnghia Probably 0.**0**15 ?",
          "votes": 1
        },
        {
          "id": 1258010,
          "postDate": "2021-03-31T09:23:46.313Z",
          "content": "<p>thanks <a href=\"https://www.kaggle.com/sergeyzlobin\" target=\"_blank\">@sergeyzlobin</a> you are right, it's 0.015.</p>",
          "rawMarkdown": "thanks @sergeyzlobin you are right, it's 0.015."
        }
      ]
    },
    {
      "id": 1259256,
      "postDate": "2021-04-01T09:10:12.530Z",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratz, </p>\n<pre><code> I think the author's implementation is not exactly same as describing in the paper. \n</code></pre>\n<p>could please tell us the difference between <strong>paper</strong> and <strong>implementation</strong> ?</p>",
      "rawMarkdown": "@nvnnghia Congratz, \n```\n I think the author's implementation is not exactly same as describing in the paper. \n```\ncould please tell us the difference between **paper** and **implementation** ?",
      "replies": [
        {
          "id": 1259308,
          "postDate": "2021-04-01T09:56:33.380Z",
          "content": "<p><a href=\"https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/master/ensemble_boxes/ensemble_boxes_wbf.py#L193\" target=\"_blank\">here</a> the author updates weighted_boxes every time it founds a matching box.  But I think we should update weighted_boxes only once after iterating over all boxes. I modified that and get better result in this competition, and also better result on the provided benchmark (Open Images Dataset), author's implementation got 0.5982, mine got 0.60xx (I don't remember exactly).</p>",
          "rawMarkdown": "[here](https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/master/ensemble_boxes/ensemble_boxes_wbf.py#L193 ) the author updates weighted_boxes every time it founds a matching box.  But I think we should update weighted_boxes only once after iterating over all boxes. I modified that and get better result in this competition, and also better result on the provided benchmark (Open Images Dataset), author's implementation got 0.5982, mine got 0.60xx (I don't remember exactly).\n",
          "votes": 2
        }
      ]
    },
    {
      "id": 1319668,
      "postDate": "2021-05-23T12:31:19.327Z",
      "content": "<p>Congrats. Thanks for sharing</p>",
      "rawMarkdown": "Congrats. Thanks for sharing"
    }
  ],
  "comments": [
    {
      "id": 1257584,
      "author_name": "KhanhVD",
      "author_url": "",
      "post_date": "2021-03-31T01:02:33.230000",
      "content": "<p>Big Congratulations on solo gold medal and becoming GM, proud of you <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> ^^</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1260210,
      "author_name": "Sidney Ng",
      "author_url": "",
      "post_date": "2021-04-01T23:48:01.003000",
      "content": "<p>Congrats to <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> , our newly minted competition GM !</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1259348,
      "author_name": "Mohammed Rizin V K",
      "author_url": "",
      "post_date": "2021-04-01T10:23:22.190000",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratulations on Gold and becoming a GM. I like the idea of consistency loss.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1258558,
      "author_name": "Heroseo",
      "author_url": "",
      "post_date": "2021-03-31T17:54:10.753000",
      "content": "<p>Congrats on a gold medal and becoming new competitions GM! <a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> <br>\n👍</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1258522,
      "author_name": "Theo Viel",
      "author_url": "",
      "post_date": "2021-03-31T17:25:17.323000",
      "content": "<p>Thanks for sharing :)<br>\nThis should do the job, Kaggle's image hosting is broken.</p>\n<blockquote>\n  <p>![](<a href=\"https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\" target=\"_blank\">https://i.ibb.co/jT2RH7S/Untitled-Diagram.png</a></p>\n</blockquote>\n<p>Just add <code>)</code> at the end </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1259251,
          "author_name": "nvnn",
          "author_url": "",
          "post_date": "2021-04-01T09:01:17.283000",
          "content": "<p>Thank you!!!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1257995,
      "author_name": "Javier Reinoso Velasco",
      "author_url": "",
      "post_date": "2021-03-31T09:08:34.703000",
      "content": "<p>Congrats a lot ! Good work !</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1257989,
      "author_name": "Liam Nguyen",
      "author_url": "",
      "post_date": "2021-03-31T09:04:12.767000",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a>  can you give me some sort of references to \"quadruple mean teachers\" ?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1258003,
          "author_name": "nvnn",
          "author_url": "",
          "post_date": "2021-03-31T09:19:07.050000",
          "content": "<p>you can refer to <a href=\"https://arxiv.org/pdf/1703.01780.pdf\" target=\"_blank\">this paper</a>.  In the paper the author uses one mean teacher to train one student. In this competition, I use 4 teachers to train 1 student, so I call it quadruple mean teachers :)).</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1257884,
      "author_name": "Selman",
      "author_url": "",
      "post_date": "2021-03-31T07:15:22.987000",
      "content": "<p>Congratulations. Very good success.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1257568,
      "author_name": "Tensor Girl",
      "author_url": "",
      "post_date": "2021-03-31T00:45:49.480000",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratulations on Gold and also for becoming GrandMaster</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1257564,
      "author_name": "kidd",
      "author_url": "",
      "post_date": "2021-03-31T00:40:31.960000",
      "content": "<p>Congrats to you! Nice work👀 and I'm quite curious about your customized WBF👋👋👋💯✔️</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1257673,
      "author_name": "Wonho Song",
      "author_url": "",
      "post_date": "2021-03-31T03:01:19.030000",
      "content": "<p>Congrats a lot !</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1257565,
      "author_name": "Stanley Zheng",
      "author_url": "",
      "post_date": "2021-03-31T00:42:27.417000",
      "content": "<p>0.15 mAP: improvement from customized WBF postprocessing!? That's some crazy magic.</p>\n<p>Congratulations on competitions GM!</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1257572,
          "author_name": "nvnn",
          "author_url": "",
          "post_date": "2021-03-31T00:48:26.820000",
          "content": "<p>Thanks <a href=\"https://www.kaggle.com/stanleyjzheng\" target=\"_blank\">@stanleyjzheng</a> . Actually, I just reimplemented WBF paper. I think the author's implementation is not exactly same as describing in the paper. </p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 1258005,
          "author_name": "Sergey Zlobin",
          "author_url": "",
          "post_date": "2021-03-31T09:20:14.237000",
          "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Probably 0.<strong>0</strong>15 ?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1258010,
          "author_name": "nvnn",
          "author_url": "",
          "post_date": "2021-03-31T09:23:46.313000",
          "content": "<p>thanks <a href=\"https://www.kaggle.com/sergeyzlobin\" target=\"_blank\">@sergeyzlobin</a> you are right, it's 0.015.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1259256,
      "author_name": "Awsaf",
      "author_url": "",
      "post_date": "2021-04-01T09:10:12.530000",
      "content": "<p><a href=\"https://www.kaggle.com/nvnnghia\" target=\"_blank\">@nvnnghia</a> Congratz, </p>\n<pre><code> I think the author's implementation is not exactly same as describing in the paper. \n</code></pre>\n<p>could please tell us the difference between <strong>paper</strong> and <strong>implementation</strong> ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1259308,
          "author_name": "nvnn",
          "author_url": "",
          "post_date": "2021-04-01T09:56:33.380000",
          "content": "<p><a href=\"https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/master/ensemble_boxes/ensemble_boxes_wbf.py#L193\" target=\"_blank\">here</a> the author updates weighted_boxes every time it founds a matching box.  But I think we should update weighted_boxes only once after iterating over all boxes. I modified that and get better result in this competition, and also better result on the provided benchmark (Open Images Dataset), author's implementation got 0.5982, mine got 0.60xx (I don't remember exactly).</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1319668,
      "author_name": "Ss Lim",
      "author_url": "",
      "post_date": "2021-05-23T12:31:19.327000",
      "content": "<p>Congrats. Thanks for sharing</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1257561": "Congratulation to all and thanks to Vingroup Big Data Institute for this interesting competition.\nSo here are some essential points of my solutions.\n\n**1. Summary**\n- 2 classes classifier: efficientnetB6\n- object detection: Yolov5 (yolov5x, yolov5l, yolov5x + ASFF head, yolov5-p6) + EfficientD6 + VFNet\n- Preprocessing boxes: WBF(IOU=0.7)\n- Post-processing: customized WBF (this customization brings 0.015mAP improvement)\n- Train yolov5 with quadruple mean teachers.\n- Ensemble\n\n**2. Classification models**\n- For 2 class classifier, I slightly modify [this notebook](https://www.kaggle.com/solosquad1999/vinbigdata-train-efficientnet-2-classes). Thanks to @solosquad1999 \n- I use efficientnetB6, image size 768.\n- My 2 class classifier achieves a AUC of 0.992 and AP 0.96.\n\n**3. Detection model**\n- Yolov5: \n    - I use 3 models from [yolov5 repo](https://github.com/ultralytics/yolov5) (yolov5x, yolov5l and yolov5-p6) and yolov5_asff from this [pull request](https://github.com/ultralytics/yolov5)\n   - I add mosaic2 and mosaic3 and use it together with mosaic4 from yolov5 repo.\n   - I train each model 60 epochs at image size 640. I didn't test larger image size. \n   - A single model has CV around 0.42 and LB score ~0.2-0.25\n- VFNet: \n   - I use VFNet (resnet101) model from mmdetection and add more augmentation (Noise, RandomBrightnessContrast, etc). \n   - My VFNet model works as good as yolov5, CV ~0.42 and LB 0.24.\n- EfficientD6: I train EfficientD6 at image size 512x512, it gives me better CV (0.43) but lower LB (0.2). I can't use larger image size because of limited GPU VRAM.\n\n**4. Training with mean teachers**\n![](https://i.ibb.co/jT2RH7S/Untitled-Diagram.png)\n\n`loss = yolov5_loss + alpha*consistency_losses`\n`alpha` is calculated using this function\n```\ndef sigmoid_rampup(current_epoch, rampup_epoch=5):\n    \"\"\"Exponential rampup from https://arxiv.org/abs/1610.02242\"\"\"\n    if rampup_length == 0:\n        return 0.1\n    else:\n        current = np.clip(current, 0.0, rampup_length)\n        phase = 1.0 - current / rampup_length\n        return 0.1*float(np.exp(-5.0 * phase * phase))\n```\nUsing mean teachers improve CV ~0.02mAP, However, it does not add much diversity when ensemble.",
    "1257584": "Big Congratulations on solo gold medal and becoming GM, proud of you @nvnnghia ^^",
    "1260210": "Congrats to @nvnnghia , our newly minted competition GM !",
    "1259348": "@nvnnghia Congratulations on Gold and becoming a GM. I like the idea of consistency loss.",
    "1258558": "Congrats on a gold medal and becoming new competitions GM! @nvnnghia \n👍",
    "1258522": "Thanks for sharing :)\nThis should do the job, Kaggle's image hosting is broken.\n> ![](https://i.ibb.co/jT2RH7S/Untitled-Diagram.png\n\nJust add `)` at the end ",
    "1257995": "Congrats a lot ! Good work !",
    "1257989": "@nvnnghia  can you give me some sort of references to \"quadruple mean teachers\" ?",
    "1257884": "Congratulations. Very good success.",
    "1257568": "@nvnnghia Congratulations on Gold and also for becoming GrandMaster",
    "1257564": "Congrats to you! Nice work👀 and I'm quite curious about your customized WBF👋👋👋💯✔️",
    "1257673": "Congrats a lot !",
    "1257565": "0.15 mAP: improvement from customized WBF postprocessing!? That's some crazy magic.\n\nCongratulations on competitions GM!",
    "1259256": "@nvnnghia Congratz, \n```\n I think the author's implementation is not exactly same as describing in the paper. \n```\ncould please tell us the difference between **paper** and **implementation** ?",
    "1319668": "Congrats. Thanks for sharing"
  }
}