{
  "id": 286553,
  "title": "UNet Strikes Back 🔥 | LB: 0.155+",
  "url": "/competitions/sartorius-cell-instance-segmentation/discussion/286553",
  "author_name": "",
  "post_date": "2021-11-09T17:48:57.756704200Z",
  "votes": 27,
  "comment_count": 14,
  "views": 0,
  "content": "<h2>Goal:</h2>\n<ul>\n<li>Even though the competition is about <strong>Instance Segmentation</strong> we can use <strong>UNet</strong> to do <strong>Semantic Segmentation</strong> and then convert them to individual <strong>Instances</strong>.</li>\n<li>So far this approach achieves <strong>LB</strong>: <code>0.155</code>.  This is the best score so far on the Leaderboard using only <strong>UNet</strong>. </li>\n<li>We can even use <strong>UNet</strong> with <strong>Mask-RCNN</strong> for Ensemble to further boost our score.</li>\n</ul>\n<h2>Notebooks:</h2>\n<p>To demonstrate how to achieve a good score using only <strong>UNet</strong> I have published following notebooks using <strong>PyTorch</strong>:</p>\n<p><strong>UNet</strong>:</p>\n<ul>\n<li>Train: <a href=\"https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-train/\" target=\"_blank\">[PyTorch] Sartorius: UNet Strikes Back [Train] 🔥</a></li>\n<li>Infer: <a href=\"https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-infer/\" target=\"_blank\">[PyTorch] Sartorius: UNet Strikes Back [Infer] 🔥</a></li>\n</ul>\n<p>You can also check out the following notebooks for <strong>Mask-RCNN</strong> using <strong>MMDetection</strong>:</p>\n<p><strong>Mask-RCNN</strong>:</p>\n<ul>\n<li>Train: <a href=\"https://www.kaggle.com/awsaf49/sartorius-mmdetection-train\" target=\"_blank\">Sartorius: MMDetection [Train]</a></li>\n<li>Infer: <a href=\"https://www.kaggle.com/awsaf49/sartorius-mmdetection-infer\" target=\"_blank\">Sartorius: MMDetection [Infer]</a></li>\n</ul>\n<blockquote>\n  <p>Please Upvote if you find these useful :)</p>\n</blockquote>\n<h2>Train Samples:</h2>\n<p><a href=\"https://ibb.co/3mXbjh1\"><img src=\"https://i.ibb.co/1GVNP2Z/sartorius-01.png\" alt=\"sartorius-01\"></a></p>\n<h2>Test Samples:</h2>\n<p><a href=\"https://ibb.co/kGMWPqq\"><img src=\"https://i.ibb.co/df7zHkk/sartorius-02.png\" alt=\"sartorius-02\"></a></p>\n<h2>WandB</h2>\n<p><img src=\"https://raw.githubusercontent.com/wandb/assets/main/wandb-logo-yellow-dots-black-wb.svg\"><br>\nAre you struggling to keep track of your training? Don't worry <strong>WandB</strong> to the rescue 🦸‍♂️. You can try <a href=\"https://wandb.ai/\" target=\"_blank\">WandB</a> to track your DL training. Check out the cool plots below…<br>\n<a href=\"https://ibb.co/nBG40Wt\"><img src=\"https://i.ibb.co/cwBRvmV/w-b-sartorius.png\" alt=\"w-b-sartorius\"></a></p>",
  "messages": [
    {
      "id": "1577041",
      "postDate": "11/09/2021 17:48:57",
      "content": "<h2>Goal:</h2>\n<ul>\n<li>Even though the competition is about <strong>Instance Segmentation</strong> we can use <strong>UNet</strong> to do <strong>Semantic Segmentation</strong> and then convert them to individual <strong>Instances</strong>.</li>\n<li>So far this approach achieves <strong>LB</strong>: <code>0.155</code>.  This is the best score so far on the Leaderboard using only <strong>UNet</strong>. </li>\n<li>We can even use <strong>UNet</strong> with <strong>Mask-RCNN</strong> for Ensemble to further boost our score.</li>\n</ul>\n<h2>Notebooks:</h2>\n<p>To demonstrate how to achieve a good score using only <strong>UNet</strong> I have published following notebooks using <strong>PyTorch</strong>:</p>\n<p><strong>UNet</strong>:</p>\n<ul>\n<li>Train: <a href=\"https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-train/\" target=\"_blank\">[PyTorch] Sartorius: UNet Strikes Back [Train] 🔥</a></li>\n<li>Infer: <a href=\"https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-infer/\" target=\"_blank\">[PyTorch] Sartorius: UNet Strikes Back [Infer] 🔥</a></li>\n</ul>\n<p>You can also check out the following notebooks for <strong>Mask-RCNN</strong> using <strong>MMDetection</strong>:</p>\n<p><strong>Mask-RCNN</strong>:</p>\n<ul>\n<li>Train: <a href=\"https://www.kaggle.com/awsaf49/sartorius-mmdetection-train\" target=\"_blank\">Sartorius: MMDetection [Train]</a></li>\n<li>Infer: <a href=\"https://www.kaggle.com/awsaf49/sartorius-mmdetection-infer\" target=\"_blank\">Sartorius: MMDetection [Infer]</a></li>\n</ul>\n<blockquote>\n  <p>Please Upvote if you find these useful :)</p>\n</blockquote>\n<h2>Train Samples:</h2>\n<p><a href=\"https://ibb.co/3mXbjh1\"><img src=\"https://i.ibb.co/1GVNP2Z/sartorius-01.png\" alt=\"sartorius-01\"></a></p>\n<h2>Test Samples:</h2>\n<p><a href=\"https://ibb.co/kGMWPqq\"><img src=\"https://i.ibb.co/df7zHkk/sartorius-02.png\" alt=\"sartorius-02\"></a></p>\n<h2>WandB</h2>\n<p><img src=\"https://raw.githubusercontent.com/wandb/assets/main/wandb-logo-yellow-dots-black-wb.svg\"><br>\nAre you struggling to keep track of your training? Don't worry <strong>WandB</strong> to the rescue 🦸‍♂️. You can try <a href=\"https://wandb.ai/\" target=\"_blank\">WandB</a> to track your DL training. Check out the cool plots below…<br>\n<a href=\"https://ibb.co/nBG40Wt\"><img src=\"https://i.ibb.co/cwBRvmV/w-b-sartorius.png\" alt=\"w-b-sartorius\"></a></p>",
      "rawMarkdown": "## Goal:\n* Even though the competition is about **Instance Segmentation** we can use **UNet** to do **Semantic Segmentation** and then convert them to individual **Instances**.\n* So far this approach achieves **LB**: `0.155`.  This is the best score so far on the Leaderboard using only **UNet**. \n*  We can even use **UNet** with **Mask-RCNN** for Ensemble to further boost our score.\n\n\n## Notebooks:\nTo demonstrate how to achieve a good score using only **UNet** I have published following notebooks using **PyTorch**:\n\n**UNet**:\n* Train: [[PyTorch] Sartorius: UNet Strikes Back [Train] 🔥](https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-train/)\n* Infer: [[PyTorch] Sartorius: UNet Strikes Back [Infer] 🔥](https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-infer/)\n\nYou can also check out the following notebooks for **Mask-RCNN** using **MMDetection**:\n\n**Mask-RCNN**:\n* Train: [Sartorius: MMDetection [Train]](https://www.kaggle.com/awsaf49/sartorius-mmdetection-train)\n* Infer: [Sartorius: MMDetection [Infer]](https://www.kaggle.com/awsaf49/sartorius-mmdetection-infer)\n\n> Please Upvote if you find these useful :)\n\n## Train Samples:\n<a href=\"https://ibb.co/3mXbjh1\"><img src=\"https://i.ibb.co/1GVNP2Z/sartorius-01.png\" alt=\"sartorius-01\" border=\"0\"></a>\n\n## Test Samples:\n<a href=\"https://ibb.co/kGMWPqq\"><img src=\"https://i.ibb.co/df7zHkk/sartorius-02.png\" alt=\"sartorius-02\" border=\"0\"></a>\n\n## WandB\n<img src=\"https://raw.githubusercontent.com/wandb/assets/main/wandb-logo-yellow-dots-black-wb.svg\" width=300 align=center >\nAre you struggling to keep track of your training? Don't worry **WandB** to the rescue 🦸‍♂️. You can try [WandB](https://wandb.ai/) to track your DL training. Check out the cool plots below...\n<a href=\"https://ibb.co/nBG40Wt\"><img src=\"https://i.ibb.co/cwBRvmV/w-b-sartorius.png\" alt=\"w-b-sartorius\" border=\"0\"></a>",
      "votes": null
    },
    {
      "id": "1577063",
      "postDate": "11/09/2021 18:07:08",
      "content": "<p>I also got LB 0.152 with efnetb0-unet.<br>\nNow we have to deal with the fused cell masks.</p>",
      "rawMarkdown": "I also got LB 0.152 with efnetb0-unet.\nNow we have to deal with the fused cell masks.",
      "votes": null
    },
    {
      "id": "1577067",
      "postDate": "11/09/2021 18:10:45",
      "content": "<p>Yes I just noticed, Great work :)</p>",
      "rawMarkdown": "Yes I just noticed, Great work :)",
      "votes": null
    },
    {
      "id": "1577069",
      "postDate": "11/09/2021 18:11:30",
      "content": "<p>Actually, I didn't see your notebook before hence decided to publish one using <strong>UNet</strong>. Otherwise I wouldn't have …</p>",
      "rawMarkdown": "Actually, I didn't see your notebook before hence decided to publish one using **UNet**. Otherwise I wouldn't have ...",
      "votes": null
    },
    {
      "id": "1577101",
      "postDate": "11/09/2021 19:12:55",
      "content": "<p>Thank you for sharing! So far, I was able to reach 0.183 using U-Nets with similar augmentations. I was able to improve the score of early submissions by applying median filter to predictions, by using test time augmentations and making use of the cell type classifier.</p>\n<p>CoarseDropout augmentation looks interesting. Have you measured how it affects the performance?</p>",
      "rawMarkdown": "Thank you for sharing! So far, I was able to reach 0.183 using U-Nets with similar augmentations. I was able to improve the score of early submissions by applying median filter to predictions, by using test time augmentations and making use of the cell type classifier.\n\nCoarseDropout augmentation looks interesting. Have you measured how it affects the performance?",
      "votes": null
    },
    {
      "id": "1577133",
      "postDate": "11/09/2021 19:34:20",
      "content": "<p>I bet it's <strong>test-time augmentation</strong> it can give some serious boost. I'll add it in my notebooks.</p>",
      "rawMarkdown": "I bet it's **test-time augmentation** it can give some serious boost. I'll add it in my notebooks.",
      "votes": null
    },
    {
      "id": "1577387",
      "postDate": "11/10/2021 03:54:48",
      "content": "<p>you need to train unet target like this.<br>\n(<a href=\"https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516\" target=\"_blank\">https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516</a>)</p>\n<p>intermediate dirty code to generate the barrier:<br>\n<a href=\"https://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing\" target=\"_blank\">https://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing</a><br>\n<img src=\"https://i.ibb.co/Cmr5yqf/Selection-999-306.png\" alt=\"https://i.ibb.co/Cmr5yqf/Selection-999-306.png\"></p>",
      "rawMarkdown": "you need to train unet target like this.\n(https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516)\n\nintermediate dirty code to generate the barrier:\nhttps://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing\n![https://i.ibb.co/Cmr5yqf/Selection-999-306.png](https://i.ibb.co/Cmr5yqf/Selection-999-306.png)",
      "votes": null
    },
    {
      "id": "1577445",
      "postDate": "11/10/2021 05:38:21",
      "content": "<p>Thanks for the tip</p>",
      "rawMarkdown": "Thanks for the tip",
      "votes": null
    },
    {
      "id": "1577595",
      "postDate": "11/10/2021 08:01:07",
      "content": "<p>Hello. You do not separate the masks in any way before serving. I use several variants of the watershed and my result is much worse than yours, but I cannot find the place where you divide the mask into fragments, and in the images the mask goes as a solid sheet.</p>",
      "rawMarkdown": "Hello. You do not separate the masks in any way before serving. I use several variants of the watershed and my result is much worse than yours, but I cannot find the place where you divide the mask into fragments, and in the images the mask goes as a solid sheet.",
      "votes": null
    },
    {
      "id": "1577710",
      "postDate": "11/10/2021 10:31:03",
      "content": "<p>I only do it in prediction</p>",
      "rawMarkdown": "I only do it in prediction",
      "votes": null
    },
    {
      "id": "1579123",
      "postDate": "11/11/2021 15:01:38",
      "content": "<p>Hey, <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> Thank you for sharing! Im planning to work more on this. ^_^</p>",
      "rawMarkdown": "Hey, @awsaf49 Thank you for sharing! Im planning to work more on this. ^_^",
      "votes": null
    },
    {
      "id": "1579244",
      "postDate": "11/11/2021 17:13:36",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> you said, <code>UNet with Mask-RCNN for Ensemble</code> right?<br>\nDo you know any public notebook that shows how to do that? I don't have much experience in Kaggle competitions, so im sorry if i have asked something very silly.</p>\n<p>PS: i tried to search for the same, but most of them were for the ML model and don't cover the DL models.  </p>",
      "rawMarkdown": "Hi @awsaf49 you said, `UNet with Mask-RCNN for Ensemble` right?\nDo you know any public notebook that shows how to do that? I don't have much experience in Kaggle competitions, so im sorry if i have asked something very silly.\n\nPS: i tried to search for the same, but most of them were for the ML model and don't cover the DL models.",
      "votes": null
    },
    {
      "id": "1579675",
      "postDate": "11/12/2021 05:55:11",
      "content": "<p>I don't think there's one. But you can do it by yourself. You can save the prediction of <strong>UNet</strong> &amp; <strong>Mask-RCNN</strong> then simply use <code>max-prob</code> to choose the best <code>mask-instance</code>.</p>",
      "rawMarkdown": "I don't think there's one. But you can do it by yourself. You can save the prediction of **UNet** & **Mask-RCNN** then simply use `max-prob` to choose the best `mask-instance`.",
      "votes": null
    },
    {
      "id": "1579683",
      "postDate": "11/12/2021 06:05:49",
      "content": "<p>for each mask, you can compute bounding box b and score s (e.g. mask iou )<br>\nthen you can use previous kaggle object detection competition code to  ensemble.<br>\nsuch code usually require a list of values:</p>\n<pre><code>model_id, x0,y0,x1,y1,label,score\n</code></pre>\n<p>better still, you should modify such code.<br>\nthe iou matrix of predicted mask can be computed by np.histogram2d instead of the rectangular iou.</p>\n<p>you can also write your own nms code:<br>\n<a href=\"https://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/\" target=\"_blank\">https://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/</a> </p>",
      "rawMarkdown": "for each mask, you can compute bounding box b and score s (e.g. mask iou )\nthen you can use previous kaggle object detection competition code to  ensemble.\nsuch code usually require a list of values:\n\n```\nmodel_id, x0,y0,x1,y1,label,score\n\n\n```\n\nbetter still, you should modify such code.\nthe iou matrix of predicted mask can be computed by np.histogram2d instead of the rectangular iou.\n\nyou can also write your own nms code:\nhttps://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/",
      "votes": null
    },
    {
      "id": "1580016",
      "postDate": "11/12/2021 12:24:52",
      "content": "<p>Thank you for sharing the process <code>^-^</code>, I will try to do that, and let you guys know if that works or not. btw, <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> can you please share anything more on <code>max-prob</code>, i'm hearing this term for the first time 😅</p>",
      "rawMarkdown": "Thank you for sharing the process `^-^`, I will try to do that, and let you guys know if that works or not. btw, @awsaf49 can you please share anything more on `max-prob`, i'm hearing this term for the first time 😅",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1577063,
      "author_name": "drtausamaru",
      "author_url": "",
      "post_date": "11/09/2021 18:07:08",
      "content": "<p>I also got LB 0.152 with efnetb0-unet.<br>\nNow we have to deal with the fused cell masks.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1577067,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/09/2021 18:10:45",
          "content": "<p>Yes I just noticed, Great work :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1577069,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/09/2021 18:11:30",
          "content": "<p>Actually, I didn't see your notebook before hence decided to publish one using <strong>UNet</strong>. Otherwise I wouldn't have …</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1577101,
      "author_name": "danieliusk",
      "author_url": "",
      "post_date": "11/09/2021 19:12:55",
      "content": "<p>Thank you for sharing! So far, I was able to reach 0.183 using U-Nets with similar augmentations. I was able to improve the score of early submissions by applying median filter to predictions, by using test time augmentations and making use of the cell type classifier.</p>\n<p>CoarseDropout augmentation looks interesting. Have you measured how it affects the performance?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1577133,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/09/2021 19:34:20",
          "content": "<p>I bet it's <strong>test-time augmentation</strong> it can give some serious boost. I'll add it in my notebooks.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1577387,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "11/10/2021 03:54:48",
      "content": "<p>you need to train unet target like this.<br>\n(<a href=\"https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516\" target=\"_blank\">https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516</a>)</p>\n<p>intermediate dirty code to generate the barrier:<br>\n<a href=\"https://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing\" target=\"_blank\">https://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing</a><br>\n<img src=\"https://i.ibb.co/Cmr5yqf/Selection-999-306.png\" alt=\"https://i.ibb.co/Cmr5yqf/Selection-999-306.png\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 1577445,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/10/2021 05:38:21",
          "content": "<p>Thanks for the tip</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1577595,
      "author_name": "zaakciiru",
      "author_url": "",
      "post_date": "11/10/2021 08:01:07",
      "content": "<p>Hello. You do not separate the masks in any way before serving. I use several variants of the watershed and my result is much worse than yours, but I cannot find the place where you divide the mask into fragments, and in the images the mask goes as a solid sheet.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1577710,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/10/2021 10:31:03",
          "content": "<p>I only do it in prediction</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1579123,
      "author_name": "soumya9977",
      "author_url": "",
      "post_date": "11/11/2021 15:01:38",
      "content": "<p>Hey, <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> Thank you for sharing! Im planning to work more on this. ^_^</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1579244,
      "author_name": "soumya9977",
      "author_url": "",
      "post_date": "11/11/2021 17:13:36",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> you said, <code>UNet with Mask-RCNN for Ensemble</code> right?<br>\nDo you know any public notebook that shows how to do that? I don't have much experience in Kaggle competitions, so im sorry if i have asked something very silly.</p>\n<p>PS: i tried to search for the same, but most of them were for the ML model and don't cover the DL models.  </p>",
      "votes": null,
      "replies": [
        {
          "id": 1579675,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "11/12/2021 05:55:11",
          "content": "<p>I don't think there's one. But you can do it by yourself. You can save the prediction of <strong>UNet</strong> &amp; <strong>Mask-RCNN</strong> then simply use <code>max-prob</code> to choose the best <code>mask-instance</code>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1579683,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "11/12/2021 06:05:49",
          "content": "<p>for each mask, you can compute bounding box b and score s (e.g. mask iou )<br>\nthen you can use previous kaggle object detection competition code to  ensemble.<br>\nsuch code usually require a list of values:</p>\n<pre><code>model_id, x0,y0,x1,y1,label,score\n</code></pre>\n<p>better still, you should modify such code.<br>\nthe iou matrix of predicted mask can be computed by np.histogram2d instead of the rectangular iou.</p>\n<p>you can also write your own nms code:<br>\n<a href=\"https://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/\" target=\"_blank\">https://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/</a> </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1580016,
          "author_name": "soumya9977",
          "author_url": "",
          "post_date": "11/12/2021 12:24:52",
          "content": "<p>Thank you for sharing the process <code>^-^</code>, I will try to do that, and let you guys know if that works or not. btw, <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> can you please share anything more on <code>max-prob</code>, i'm hearing this term for the first time 😅</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1577041": "## Goal:\n* Even though the competition is about **Instance Segmentation** we can use **UNet** to do **Semantic Segmentation** and then convert them to individual **Instances**.\n* So far this approach achieves **LB**: `0.155`.  This is the best score so far on the Leaderboard using only **UNet**. \n*  We can even use **UNet** with **Mask-RCNN** for Ensemble to further boost our score.\n\n\n## Notebooks:\nTo demonstrate how to achieve a good score using only **UNet** I have published following notebooks using **PyTorch**:\n\n**UNet**:\n* Train: [[PyTorch] Sartorius: UNet Strikes Back [Train] 🔥](https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-train/)\n* Infer: [[PyTorch] Sartorius: UNet Strikes Back [Infer] 🔥](https://www.kaggle.com/awsaf49/pytorch-sartorius-unet-strikes-back-infer/)\n\nYou can also check out the following notebooks for **Mask-RCNN** using **MMDetection**:\n\n**Mask-RCNN**:\n* Train: [Sartorius: MMDetection [Train]](https://www.kaggle.com/awsaf49/sartorius-mmdetection-train)\n* Infer: [Sartorius: MMDetection [Infer]](https://www.kaggle.com/awsaf49/sartorius-mmdetection-infer)\n\n> Please Upvote if you find these useful :)\n\n## Train Samples:\n<a href=\"https://ibb.co/3mXbjh1\"><img src=\"https://i.ibb.co/1GVNP2Z/sartorius-01.png\" alt=\"sartorius-01\" border=\"0\"></a>\n\n## Test Samples:\n<a href=\"https://ibb.co/kGMWPqq\"><img src=\"https://i.ibb.co/df7zHkk/sartorius-02.png\" alt=\"sartorius-02\" border=\"0\"></a>\n\n## WandB\n<img src=\"https://raw.githubusercontent.com/wandb/assets/main/wandb-logo-yellow-dots-black-wb.svg\" width=300 align=center >\nAre you struggling to keep track of your training? Don't worry **WandB** to the rescue 🦸‍♂️. You can try [WandB](https://wandb.ai/) to track your DL training. Check out the cool plots below...\n<a href=\"https://ibb.co/nBG40Wt\"><img src=\"https://i.ibb.co/cwBRvmV/w-b-sartorius.png\" alt=\"w-b-sartorius\" border=\"0\"></a>",
    "1577063": "I also got LB 0.152 with efnetb0-unet.\nNow we have to deal with the fused cell masks.",
    "1577067": "Yes I just noticed, Great work :)",
    "1577069": "Actually, I didn't see your notebook before hence decided to publish one using **UNet**. Otherwise I wouldn't have ...",
    "1577101": "Thank you for sharing! So far, I was able to reach 0.183 using U-Nets with similar augmentations. I was able to improve the score of early submissions by applying median filter to predictions, by using test time augmentations and making use of the cell type classifier.\n\nCoarseDropout augmentation looks interesting. Have you measured how it affects the performance?",
    "1577133": "I bet it's **test-time augmentation** it can give some serious boost. I'll add it in my notebooks.",
    "1577387": "you need to train unet target like this.\n(https://www.kaggle.com/c/sartorius-cell-instance-segmentation/discussion/285516)\n\nintermediate dirty code to generate the barrier:\nhttps://drive.google.com/drive/folders/1KKx88H-CxpU_mzn555jymLrg0VE4cvZ2?usp=sharing\n![https://i.ibb.co/Cmr5yqf/Selection-999-306.png](https://i.ibb.co/Cmr5yqf/Selection-999-306.png)",
    "1577445": "Thanks for the tip",
    "1577595": "Hello. You do not separate the masks in any way before serving. I use several variants of the watershed and my result is much worse than yours, but I cannot find the place where you divide the mask into fragments, and in the images the mask goes as a solid sheet.",
    "1577710": "I only do it in prediction",
    "1579123": "Hey, @awsaf49 Thank you for sharing! Im planning to work more on this. ^_^",
    "1579244": "Hi @awsaf49 you said, `UNet with Mask-RCNN for Ensemble` right?\nDo you know any public notebook that shows how to do that? I don't have much experience in Kaggle competitions, so im sorry if i have asked something very silly.\n\nPS: i tried to search for the same, but most of them were for the ML model and don't cover the DL models.",
    "1579675": "I don't think there's one. But you can do it by yourself. You can save the prediction of **UNet** & **Mask-RCNN** then simply use `max-prob` to choose the best `mask-instance`.",
    "1579683": "for each mask, you can compute bounding box b and score s (e.g. mask iou )\nthen you can use previous kaggle object detection competition code to  ensemble.\nsuch code usually require a list of values:\n\n```\nmodel_id, x0,y0,x1,y1,label,score\n\n\n```\n\nbetter still, you should modify such code.\nthe iou matrix of predicted mask can be computed by np.histogram2d instead of the rectangular iou.\n\nyou can also write your own nms code:\nhttps://learnopencv.com/non-maximum-suppression-theory-and-implementation-in-pytorch/",
    "1580016": "Thank you for sharing the process `^-^`, I will try to do that, and let you guys know if that works or not. btw, @awsaf49 can you please share anything more on `max-prob`, i'm hearing this term for the first time 😅"
  },
  "source": "meta"
}