{
  "id": 413746,
  "title": "How shoule we define the competition task, semantic segmantation or instance segmentation?",
  "url": "/competitions/hubmap-hacking-the-human-vasculature/discussion/413746",
  "author_name": "",
  "post_date": "2023-05-30T01:32:17.030944400Z",
  "votes": 2,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Which Task should we define this competition:</p>\n<ol>\n<li>Using UNet to predict one class mask segmentation and split the instance according to connected region.</li>\n<li>Directly using instance segmentation model to get all components we need in <code>prediction_string</code>.</li>\n</ol>\n<p>I use Unet-Efficientnet at first but only get lb=0.001. then I use MaskRCNN-resnet50( lb=0.273 ).<br>\nIs there another method can we use ?</p>",
  "messages": [
    {
      "id": "2280227",
      "postDate": "05/30/2023 01:32:17",
      "content": "<p>Which Task should we define this competition:</p>\n<ol>\n<li>Using UNet to predict one class mask segmentation and split the instance according to connected region.</li>\n<li>Directly using instance segmentation model to get all components we need in <code>prediction_string</code>.</li>\n</ol>\n<p>I use Unet-Efficientnet at first but only get lb=0.001. then I use MaskRCNN-resnet50( lb=0.273 ).<br>\nIs there another method can we use ?</p>",
      "rawMarkdown": "Which Task should we define this competition:\n1. Using UNet to predict one class mask segmentation and split the instance according to connected region.\n2. Directly using instance segmentation model to get all components we need in `prediction_string`.\n\nI use Unet-Efficientnet at first but only get lb=0.001. then I use MaskRCNN-resnet50( lb=0.273 ).\nIs there another method can we use ?",
      "votes": null
    },
    {
      "id": "2283222",
      "postDate": "06/01/2023 06:11:14",
      "content": "<p>According to my understanding, the task is semantic segmentation as the participants are asked to segment the images to distinguish and delineate blood vessels from the background. If it was instance segmentation task, we would have to further distinguish blood vessel instances. Perhaps, something like blood-vessel-1, blood-vessel-2, blood-vessel-3,….</p>\n<p>About the methods, I am not sure if you have done it already or not, but you can try tuning the hyperparameters before moving on to exploring other architectures.</p>",
      "rawMarkdown": "According to my understanding, the task is semantic segmentation as the participants are asked to segment the images to distinguish and delineate blood vessels from the background. If it was instance segmentation task, we would have to further distinguish blood vessel instances. Perhaps, something like blood-vessel-1, blood-vessel-2, blood-vessel-3,....\n\n\nAbout the methods, I am not sure if you have done it already or not, but you can try tuning the hyperparameters before moving on to exploring other architectures.",
      "votes": null
    },
    {
      "id": "2286624",
      "postDate": "06/03/2023 15:35:30",
      "content": "<p>Hi my friend!</p>\n<p>I think our task here is more towards panoptic segmentation. Yes, our main job is to delineate blood vessels, but the submission format will require separating different instances of blood vessels (as far as I know). In <a href=\"https://www.kaggle.com/competitions/hubmap-hacking-the-human-vasculature/overview/evaluation\" target=\"_blank\">the evaluation section of the overview page</a> it says:</p>\n<blockquote>\n  <p>Separate prediction strings <strong>multiple instance masks for the same image</strong> with a space, like so:<br>\n  id,height,width,prediction_string<br>\n  72e40acccadf,512,512,0 1.0 eNoLTDAwyrM3yI/PMwcAE94DZA== 0 0.5 eAndnnDS1A/mdmkE35Ek9d</p>\n</blockquote>\n<p>And <a href=\"https://www.kaggle.com/huanghuangzhang\" target=\"_blank\">@huanghuangzhang</a>, I think you're right. If someone is going to use a model that is only trained to output a segmentation mask, I think it's safe to go with your first approach. One could use <a href=\"https://scikit-image.org/docs/stable/api/skimage.measure.html\" target=\"_blank\">scikit-image's measure module</a> for example to label the different blobs of the output mask and RLE encode each labeled region separately.</p>",
      "rawMarkdown": "Hi my friend!\n\nI think our task here is more towards panoptic segmentation. Yes, our main job is to delineate blood vessels, but the submission format will require separating different instances of blood vessels (as far as I know). In [the evaluation section of the overview page](https://www.kaggle.com/competitions/hubmap-hacking-the-human-vasculature/overview/evaluation) it says:\n> Separate prediction strings **multiple instance masks for the same image** with a space, like so:\nid,height,width,prediction_string\n72e40acccadf,512,512,0 1.0 eNoLTDAwyrM3yI/PMwcAE94DZA== 0 0.5 eAndnnDS1A/mdmkE35Ek9d\n\nAnd @huanghuangzhang, I think you're right. If someone is going to use a model that is only trained to output a segmentation mask, I think it's safe to go with your first approach. One could use [scikit-image's measure module](https://scikit-image.org/docs/stable/api/skimage.measure.html) for example to label the different blobs of the output mask and RLE encode each labeled region separately.",
      "votes": null
    },
    {
      "id": "2286669",
      "postDate": "06/03/2023 16:26:57",
      "content": "<p>Hi Mohamed,</p>\n<p>After seeing the evaluation section, I felt the same but to be honest I was kinda not sure if I was going in the right direction. Thanks for confirming.</p>\n<p>About the first method, if we go that way, though we will be able to produce multiple instance masks for the same image, <strong>what about the confidence score?</strong> Inferring from the evaluation section of the overview page, given an image, our model should produce a list of instance masks with corresponding confidence scores. </p>\n<p><strong>Analysing FCNs and mask-RCNN outputs</strong></p>\n<p>If we go with mask-RCNN, we will get confidence score (from which also label), bounding box, and segmentation mask for each object. Later, when we format the outputs as specified in the evaluation section, we can use only confidence scores and instance masks, and we can exclude bounding boxes just to follow the format. On the other hand, U-net produces only a single segmentation mask which we can convert into multiple instance segmentation masks, but filling the confidence scores is still a question. For that matter, not only just U-net, it's the same with any Fully Convolutional Network (FCN) model in general. <br>\nAny thoughts……?</p>",
      "rawMarkdown": "Hi Mohamed,\n\nAfter seeing the evaluation section, I felt the same but to be honest I was kinda not sure if I was going in the right direction. Thanks for confirming.\n\nAbout the first method, if we go that way, though we will be able to produce multiple instance masks for the same image, **what about the confidence score?** Inferring from the evaluation section of the overview page, given an image, our model should produce a list of instance masks with corresponding confidence scores. \n\n**Analysing FCNs and mask-RCNN outputs**\n\nIf we go with mask-RCNN, we will get confidence score (from which also label), bounding box, and segmentation mask for each object. Later, when we format the outputs as specified in the evaluation section, we can use only confidence scores and instance masks, and we can exclude bounding boxes just to follow the format. On the other hand, U-net produces only a single segmentation mask which we can convert into multiple instance segmentation masks, but filling the confidence scores is still a question. For that matter, not only just U-net, it's the same with any Fully Convolutional Network (FCN) model in general. \nAny thoughts......?",
      "votes": null
    },
    {
      "id": "2286826",
      "postDate": "06/03/2023 20:13:06",
      "content": "<p>I assume the output of your CNN model will output a non-binary mask where each pixel has a value that represents the probability of whether or not that pixel belongs to a blood vessel? That should be the case if your final activation is a sigmoid. If so, you'll need to pick a threshold (say 0.5) above which you're going to RLE encode the mask to instances of blood vessels. The confidence score can be the average values of the output mask pixels that belong to each instance (before applying the threshold).</p>\n<p>Btw, I'm still brainstorming on the approach I'm going to take for this competition (not a good idea, I know 👀) and I'm still a beginner, so don't take my words too seriously :)<br>\nI would be happy to offer help though.</p>",
      "rawMarkdown": "I assume the output of your CNN model will output a non-binary mask where each pixel has a value that represents the probability of whether or not that pixel belongs to a blood vessel? That should be the case if your final activation is a sigmoid. If so, you'll need to pick a threshold (say 0.5) above which you're going to RLE encode the mask to instances of blood vessels. The confidence score can be the average values of the output mask pixels that belong to each instance (before applying the threshold).\n\nBtw, I'm still brainstorming on the approach I'm going to take for this competition (not a good idea, I know 👀) and I'm still a beginner, so don't take my words too seriously :)\nI would be happy to offer help though.",
      "votes": null
    },
    {
      "id": "2287546",
      "postDate": "06/04/2023 16:11:07",
      "content": "<p>I tuned some hyper parameters of mask segmentation Unet and lb=0.244. In my opinion, I think these two task has no gap in the end but the data-based augmentation or postprocess determine the result.<br>\nI will try other instance segmentation method in this competition by implementation of mmdetection/detectron2/yolov8 with the competition's dataset.</p>",
      "rawMarkdown": "I tuned some hyper parameters of mask segmentation Unet and lb=0.244. In my opinion, I think these two task has no gap in the end but the data-based augmentation or postprocess determine the result.\nI will try other instance segmentation method in this competition by implementation of mmdetection/detectron2/yolov8 with the competition's dataset.",
      "votes": null
    },
    {
      "id": "2303568",
      "postDate": "06/15/2023 11:00:52",
      "content": "<p>I am currently attempting this approach.</p>",
      "rawMarkdown": "I am currently attempting this approach.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2283222,
      "author_name": "gunturuashok",
      "author_url": "",
      "post_date": "06/01/2023 06:11:14",
      "content": "<p>According to my understanding, the task is semantic segmentation as the participants are asked to segment the images to distinguish and delineate blood vessels from the background. If it was instance segmentation task, we would have to further distinguish blood vessel instances. Perhaps, something like blood-vessel-1, blood-vessel-2, blood-vessel-3,….</p>\n<p>About the methods, I am not sure if you have done it already or not, but you can try tuning the hyperparameters before moving on to exploring other architectures.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2286624,
          "author_name": "momakmd",
          "author_url": "",
          "post_date": "06/03/2023 15:35:30",
          "content": "<p>Hi my friend!</p>\n<p>I think our task here is more towards panoptic segmentation. Yes, our main job is to delineate blood vessels, but the submission format will require separating different instances of blood vessels (as far as I know). In <a href=\"https://www.kaggle.com/competitions/hubmap-hacking-the-human-vasculature/overview/evaluation\" target=\"_blank\">the evaluation section of the overview page</a> it says:</p>\n<blockquote>\n  <p>Separate prediction strings <strong>multiple instance masks for the same image</strong> with a space, like so:<br>\n  id,height,width,prediction_string<br>\n  72e40acccadf,512,512,0 1.0 eNoLTDAwyrM3yI/PMwcAE94DZA== 0 0.5 eAndnnDS1A/mdmkE35Ek9d</p>\n</blockquote>\n<p>And <a href=\"https://www.kaggle.com/huanghuangzhang\" target=\"_blank\">@huanghuangzhang</a>, I think you're right. If someone is going to use a model that is only trained to output a segmentation mask, I think it's safe to go with your first approach. One could use <a href=\"https://scikit-image.org/docs/stable/api/skimage.measure.html\" target=\"_blank\">scikit-image's measure module</a> for example to label the different blobs of the output mask and RLE encode each labeled region separately.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2286669,
              "author_name": "gunturuashok",
              "author_url": "",
              "post_date": "06/03/2023 16:26:57",
              "content": "<p>Hi Mohamed,</p>\n<p>After seeing the evaluation section, I felt the same but to be honest I was kinda not sure if I was going in the right direction. Thanks for confirming.</p>\n<p>About the first method, if we go that way, though we will be able to produce multiple instance masks for the same image, <strong>what about the confidence score?</strong> Inferring from the evaluation section of the overview page, given an image, our model should produce a list of instance masks with corresponding confidence scores. </p>\n<p><strong>Analysing FCNs and mask-RCNN outputs</strong></p>\n<p>If we go with mask-RCNN, we will get confidence score (from which also label), bounding box, and segmentation mask for each object. Later, when we format the outputs as specified in the evaluation section, we can use only confidence scores and instance masks, and we can exclude bounding boxes just to follow the format. On the other hand, U-net produces only a single segmentation mask which we can convert into multiple instance segmentation masks, but filling the confidence scores is still a question. For that matter, not only just U-net, it's the same with any Fully Convolutional Network (FCN) model in general. <br>\nAny thoughts……?</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2286826,
                  "author_name": "momakmd",
                  "author_url": "",
                  "post_date": "06/03/2023 20:13:06",
                  "content": "<p>I assume the output of your CNN model will output a non-binary mask where each pixel has a value that represents the probability of whether or not that pixel belongs to a blood vessel? That should be the case if your final activation is a sigmoid. If so, you'll need to pick a threshold (say 0.5) above which you're going to RLE encode the mask to instances of blood vessels. The confidence score can be the average values of the output mask pixels that belong to each instance (before applying the threshold).</p>\n<p>Btw, I'm still brainstorming on the approach I'm going to take for this competition (not a good idea, I know 👀) and I'm still a beginner, so don't take my words too seriously :)<br>\nI would be happy to offer help though.</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2303568,
                      "author_name": "bent1e",
                      "author_url": "",
                      "post_date": "06/15/2023 11:00:52",
                      "content": "<p>I am currently attempting this approach.</p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2287546,
      "author_name": "huanghuangzhang",
      "author_url": "",
      "post_date": "06/04/2023 16:11:07",
      "content": "<p>I tuned some hyper parameters of mask segmentation Unet and lb=0.244. In my opinion, I think these two task has no gap in the end but the data-based augmentation or postprocess determine the result.<br>\nI will try other instance segmentation method in this competition by implementation of mmdetection/detectron2/yolov8 with the competition's dataset.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2280227": "Which Task should we define this competition:\n1. Using UNet to predict one class mask segmentation and split the instance according to connected region.\n2. Directly using instance segmentation model to get all components we need in `prediction_string`.\n\nI use Unet-Efficientnet at first but only get lb=0.001. then I use MaskRCNN-resnet50( lb=0.273 ).\nIs there another method can we use ?",
    "2283222": "According to my understanding, the task is semantic segmentation as the participants are asked to segment the images to distinguish and delineate blood vessels from the background. If it was instance segmentation task, we would have to further distinguish blood vessel instances. Perhaps, something like blood-vessel-1, blood-vessel-2, blood-vessel-3,....\n\n\nAbout the methods, I am not sure if you have done it already or not, but you can try tuning the hyperparameters before moving on to exploring other architectures.",
    "2286624": "Hi my friend!\n\nI think our task here is more towards panoptic segmentation. Yes, our main job is to delineate blood vessels, but the submission format will require separating different instances of blood vessels (as far as I know). In [the evaluation section of the overview page](https://www.kaggle.com/competitions/hubmap-hacking-the-human-vasculature/overview/evaluation) it says:\n> Separate prediction strings **multiple instance masks for the same image** with a space, like so:\nid,height,width,prediction_string\n72e40acccadf,512,512,0 1.0 eNoLTDAwyrM3yI/PMwcAE94DZA== 0 0.5 eAndnnDS1A/mdmkE35Ek9d\n\nAnd @huanghuangzhang, I think you're right. If someone is going to use a model that is only trained to output a segmentation mask, I think it's safe to go with your first approach. One could use [scikit-image's measure module](https://scikit-image.org/docs/stable/api/skimage.measure.html) for example to label the different blobs of the output mask and RLE encode each labeled region separately.",
    "2286669": "Hi Mohamed,\n\nAfter seeing the evaluation section, I felt the same but to be honest I was kinda not sure if I was going in the right direction. Thanks for confirming.\n\nAbout the first method, if we go that way, though we will be able to produce multiple instance masks for the same image, **what about the confidence score?** Inferring from the evaluation section of the overview page, given an image, our model should produce a list of instance masks with corresponding confidence scores. \n\n**Analysing FCNs and mask-RCNN outputs**\n\nIf we go with mask-RCNN, we will get confidence score (from which also label), bounding box, and segmentation mask for each object. Later, when we format the outputs as specified in the evaluation section, we can use only confidence scores and instance masks, and we can exclude bounding boxes just to follow the format. On the other hand, U-net produces only a single segmentation mask which we can convert into multiple instance segmentation masks, but filling the confidence scores is still a question. For that matter, not only just U-net, it's the same with any Fully Convolutional Network (FCN) model in general. \nAny thoughts......?",
    "2286826": "I assume the output of your CNN model will output a non-binary mask where each pixel has a value that represents the probability of whether or not that pixel belongs to a blood vessel? That should be the case if your final activation is a sigmoid. If so, you'll need to pick a threshold (say 0.5) above which you're going to RLE encode the mask to instances of blood vessels. The confidence score can be the average values of the output mask pixels that belong to each instance (before applying the threshold).\n\nBtw, I'm still brainstorming on the approach I'm going to take for this competition (not a good idea, I know 👀) and I'm still a beginner, so don't take my words too seriously :)\nI would be happy to offer help though.",
    "2287546": "I tuned some hyper parameters of mask segmentation Unet and lb=0.244. In my opinion, I think these two task has no gap in the end but the data-based augmentation or postprocess determine the result.\nI will try other instance segmentation method in this competition by implementation of mmdetection/detectron2/yolov8 with the competition's dataset.",
    "2303568": "I am currently attempting this approach."
  },
  "source": "meta"
}