{
  "id": 338456,
  "title": "Segmentation problem regarding binary mask.",
  "url": "/competitions/hubmap-organ-segmentation/discussion/338456",
  "author_name": "",
  "post_date": "2022-07-20T14:19:37.029119500Z",
  "votes": 2,
  "comment_count": 8,
  "views": 0,
  "content": "<p>For segmentation we have:</p>\n<p>[Input] -&gt; [Model] -&gt; [Mask]</p>\n<p>After this, (for this competition) we get a binary mask or at least we are supposed to. The mask that I get, resembles a binary mask but has some values other than 0s or 1s like 0.0001, or 0.789, etc. To counter this I thought of using thresholding but I think that it's degrading my performance. Please let me know if there are any alternatives to it. </p>",
  "messages": [
    {
      "id": "1863811",
      "postDate": "07/20/2022 14:19:37",
      "content": "<p>For segmentation we have:</p>\n<p>[Input] -&gt; [Model] -&gt; [Mask]</p>\n<p>After this, (for this competition) we get a binary mask or at least we are supposed to. The mask that I get, resembles a binary mask but has some values other than 0s or 1s like 0.0001, or 0.789, etc. To counter this I thought of using thresholding but I think that it's degrading my performance. Please let me know if there are any alternatives to it. </p>",
      "rawMarkdown": "For segmentation we have:\n\n[Input] -> [Model] -> [Mask]\n\nAfter this, (for this competition) we get a binary mask or at least we are supposed to. The mask that I get, resembles a binary mask but has some values other than 0s or 1s like 0.0001, or 0.789, etc. To counter this I thought of using thresholding but I think that it's degrading my performance. Please let me know if there are any alternatives to it.",
      "votes": null
    },
    {
      "id": "1864089",
      "postDate": "07/20/2022 18:07:05",
      "content": "<p>You are probably checking your performance with a loss function like BCE, which is sensitive with high confidence predictions, the competition metric is dice score, normally more than 99% of the kaggle uses threshold, if you think that using threshold is degrading your performance, you can tune the threshold to make it optimal, 0.5 is not always the best.</p>",
      "rawMarkdown": "You are probably checking your performance with a loss function like BCE, which is sensitive with high confidence predictions, the competition metric is dice score, normally more than 99% of the kaggle uses threshold, if you think that using threshold is degrading your performance, you can tune the threshold to make it optimal, 0.5 is not always the best.",
      "votes": null
    },
    {
      "id": "1864418",
      "postDate": "07/21/2022 03:58:16",
      "content": "<p>Generally I don't want to mess with threshold and keep it simple (&gt; 0.5). But you can try playing with it to see what kind of CV and LB it produces</p>",
      "rawMarkdown": "Generally I don't want to mess with threshold and keep it simple (> 0.5). But you can try playing with it to see what kind of CV and LB it produces",
      "votes": null
    },
    {
      "id": "1864439",
      "postDate": "07/21/2022 04:11:37",
      "content": "<p>Hello Harshit! Thank you for your response. I am using Dice Loss actually. My validation IoU was 0.90+. I didn't CV. But my score during test time is 0.20 only XD<br>\nI get it, test set is a whole different beast but it kinda made me suspicious of threshold. Thanks for your response again :D</p>",
      "rawMarkdown": "Hello Harshit! Thank you for your response. I am using Dice Loss actually. My validation IoU was 0.90+. I didn't CV. But my score during test time is 0.20 only XD\nI get it, test set is a whole different beast but it kinda made me suspicious of threshold. Thanks for your response again :D",
      "votes": null
    },
    {
      "id": "1864441",
      "postDate": "07/21/2022 04:13:28",
      "content": "<p>Hello Quan!<br>\nMy LB is only 0.20 :(<br>\nHowever during training, my IoU score on the validation set was 0.90+. I have created the folds ut didn't use CV yet. What was your IoU during training?</p>",
      "rawMarkdown": "Hello Quan!\nMy LB is only 0.20 :(\nHowever during training, my IoU score on the validation set was 0.90+. I have created the folds ut didn't use CV yet. What was your IoU during training?",
      "votes": null
    },
    {
      "id": "1864449",
      "postDate": "07/21/2022 04:17:37",
      "content": "<p>How did your IoU get so high? Sorry but I think you may compute IoU incorrectly</p>",
      "rawMarkdown": "How did your IoU get so high? Sorry but I think you may compute IoU incorrectly",
      "votes": null
    },
    {
      "id": "1864460",
      "postDate": "07/21/2022 04:24:53",
      "content": "<p>I was using IoU metric given by Qubvel's \"Segmentation Models PyTorch\" package. But given the test score, I'm inclined to believe what you're saying is right</p>\n<p>Epochs: 100/100, Training — Loss: 0.141, Precision: 0.847, Recall: 0.754, IoU: 0.874, Validation — Loss: 0.075, Precision: 0.919, Recall: 0.862, IoU: 0.934</p>",
      "rawMarkdown": "I was using IoU metric given by Qubvel's \"Segmentation Models PyTorch\" package. But given the test score, I'm inclined to believe what you're saying is right\n\nEpochs: 100/100, Training — Loss: 0.141, Precision: 0.847, Recall: 0.754, IoU: 0.874, Validation — Loss: 0.075, Precision: 0.919, Recall: 0.862, IoU: 0.934",
      "votes": null
    },
    {
      "id": "1917688",
      "postDate": "08/29/2022 01:34:55",
      "content": "<p>Hello! I have the same problem and I'm also puzzled about this. If you have any solution, please give me a suggestion. Thank you!</p>",
      "rawMarkdown": "Hello! I have the same problem and I'm also puzzled about this. If you have any solution, please give me a suggestion. Thank you!",
      "votes": null
    },
    {
      "id": "1922082",
      "postDate": "09/01/2022 08:57:32",
      "content": "<p>I sort of transposed my mask and it gave me slightly better results.</p>",
      "rawMarkdown": "I sort of transposed my mask and it gave me slightly better results.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1864089,
      "author_name": "harshitsheoran",
      "author_url": "",
      "post_date": "07/20/2022 18:07:05",
      "content": "<p>You are probably checking your performance with a loss function like BCE, which is sensitive with high confidence predictions, the competition metric is dice score, normally more than 99% of the kaggle uses threshold, if you think that using threshold is degrading your performance, you can tune the threshold to make it optimal, 0.5 is not always the best.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1864439,
          "author_name": "eddwait",
          "author_url": "",
          "post_date": "07/21/2022 04:11:37",
          "content": "<p>Hello Harshit! Thank you for your response. I am using Dice Loss actually. My validation IoU was 0.90+. I didn't CV. But my score during test time is 0.20 only XD<br>\nI get it, test set is a whole different beast but it kinda made me suspicious of threshold. Thanks for your response again :D</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1864418,
      "author_name": "quandapro",
      "author_url": "",
      "post_date": "07/21/2022 03:58:16",
      "content": "<p>Generally I don't want to mess with threshold and keep it simple (&gt; 0.5). But you can try playing with it to see what kind of CV and LB it produces</p>",
      "votes": null,
      "replies": [
        {
          "id": 1864441,
          "author_name": "eddwait",
          "author_url": "",
          "post_date": "07/21/2022 04:13:28",
          "content": "<p>Hello Quan!<br>\nMy LB is only 0.20 :(<br>\nHowever during training, my IoU score on the validation set was 0.90+. I have created the folds ut didn't use CV yet. What was your IoU during training?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1864449,
          "author_name": "quandapro",
          "author_url": "",
          "post_date": "07/21/2022 04:17:37",
          "content": "<p>How did your IoU get so high? Sorry but I think you may compute IoU incorrectly</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1864460,
          "author_name": "eddwait",
          "author_url": "",
          "post_date": "07/21/2022 04:24:53",
          "content": "<p>I was using IoU metric given by Qubvel's \"Segmentation Models PyTorch\" package. But given the test score, I'm inclined to believe what you're saying is right</p>\n<p>Epochs: 100/100, Training — Loss: 0.141, Precision: 0.847, Recall: 0.754, IoU: 0.874, Validation — Loss: 0.075, Precision: 0.919, Recall: 0.862, IoU: 0.934</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1917688,
      "author_name": "lyyyfu",
      "author_url": "",
      "post_date": "08/29/2022 01:34:55",
      "content": "<p>Hello! I have the same problem and I'm also puzzled about this. If you have any solution, please give me a suggestion. Thank you!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1922082,
          "author_name": "eddwait",
          "author_url": "",
          "post_date": "09/01/2022 08:57:32",
          "content": "<p>I sort of transposed my mask and it gave me slightly better results.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1863811": "For segmentation we have:\n\n[Input] -> [Model] -> [Mask]\n\nAfter this, (for this competition) we get a binary mask or at least we are supposed to. The mask that I get, resembles a binary mask but has some values other than 0s or 1s like 0.0001, or 0.789, etc. To counter this I thought of using thresholding but I think that it's degrading my performance. Please let me know if there are any alternatives to it.",
    "1864089": "You are probably checking your performance with a loss function like BCE, which is sensitive with high confidence predictions, the competition metric is dice score, normally more than 99% of the kaggle uses threshold, if you think that using threshold is degrading your performance, you can tune the threshold to make it optimal, 0.5 is not always the best.",
    "1864418": "Generally I don't want to mess with threshold and keep it simple (> 0.5). But you can try playing with it to see what kind of CV and LB it produces",
    "1864439": "Hello Harshit! Thank you for your response. I am using Dice Loss actually. My validation IoU was 0.90+. I didn't CV. But my score during test time is 0.20 only XD\nI get it, test set is a whole different beast but it kinda made me suspicious of threshold. Thanks for your response again :D",
    "1864441": "Hello Quan!\nMy LB is only 0.20 :(\nHowever during training, my IoU score on the validation set was 0.90+. I have created the folds ut didn't use CV yet. What was your IoU during training?",
    "1864449": "How did your IoU get so high? Sorry but I think you may compute IoU incorrectly",
    "1864460": "I was using IoU metric given by Qubvel's \"Segmentation Models PyTorch\" package. But given the test score, I'm inclined to believe what you're saying is right\n\nEpochs: 100/100, Training — Loss: 0.141, Precision: 0.847, Recall: 0.754, IoU: 0.874, Validation — Loss: 0.075, Precision: 0.919, Recall: 0.862, IoU: 0.934",
    "1917688": "Hello! I have the same problem and I'm also puzzled about this. If you have any solution, please give me a suggestion. Thank you!",
    "1922082": "I sort of transposed my mask and it gave me slightly better results."
  },
  "source": "meta"
}