{
  "id": 208413,
  "title": "Loss functions for image segmentation",
  "url": "/competitions/hubmap-kidney-segmentation/discussion/208413",
  "author_name": "Bessenyei Szilárd",
  "post_date": "2021-01-03T11:06:09.091000",
  "votes": 40,
  "comment_count": 19,
  "views": 0,
  "content": "<p>Hi! Couple of days earlier I found this site: <a href=\"https://github.com/JunMa11/SegLoss\" target=\"_blank\">https://github.com/JunMa11/SegLoss</a> where they summarize the segmentation loss types. It was useful for me, I hope it can help to others as well.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4367831%2F717956da11a8953a81ec75a79495929c%2FLossOverview.jpg?generation=1609672056006545&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 1136713,
      "postDate": "2021-01-03T11:06:09.093Z",
      "content": "<p>Hi! Couple of days earlier I found this site: <a href=\"https://github.com/JunMa11/SegLoss\" target=\"_blank\">https://github.com/JunMa11/SegLoss</a> where they summarize the segmentation loss types. It was useful for me, I hope it can help to others as well.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4367831%2F717956da11a8953a81ec75a79495929c%2FLossOverview.jpg?generation=1609672056006545&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi! Couple of days earlier I found this site: https://github.com/JunMa11/SegLoss where they summarize the segmentation loss types. It was useful for me, I hope it can help to others as well.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4367831%2F717956da11a8953a81ec75a79495929c%2FLossOverview.jpg?generation=1609672056006545&alt=media)",
      "votes": 40
    },
    {
      "id": 1217160,
      "postDate": "2021-02-24T19:57:21.173Z",
      "content": "<p>Thank you for posting this, really helpful!</p>",
      "rawMarkdown": "Thank you for posting this, really helpful!",
      "votes": 1,
      "replies": [
        {
          "id": 1217177,
          "postDate": "2021-02-24T20:15:30.847Z",
          "content": "<p>I glad if you enjoyed it Great! 🙂</p>",
          "rawMarkdown": "I glad if you enjoyed it Great! 🙂"
        }
      ]
    },
    {
      "id": 1217140,
      "postDate": "2021-02-24T19:32:02.810Z",
      "content": "<p>Bookmarking this! Very helpful. Thanks for sharing!</p>",
      "rawMarkdown": "Bookmarking this! Very helpful. Thanks for sharing!",
      "votes": 1,
      "replies": [
        {
          "id": 1217178,
          "postDate": "2021-02-24T20:16:12.170Z",
          "content": "<p>Great! Thanks for your feedback 🙂</p>",
          "rawMarkdown": "Great! Thanks for your feedback 🙂"
        }
      ]
    },
    {
      "id": 1216903,
      "postDate": "2021-02-24T15:43:11.103Z",
      "content": "<p>It's really a great job, thank you</p>",
      "rawMarkdown": "It's really a great job, thank you",
      "votes": 1,
      "replies": [
        {
          "id": 1217179,
          "postDate": "2021-02-24T20:16:37.937Z",
          "content": "<p>You are welcome</p>",
          "rawMarkdown": "You are welcome"
        }
      ]
    },
    {
      "id": 1152081,
      "postDate": "2021-01-13T19:27:19.703Z",
      "content": "<p>This is cool stuff. Thanks for sharing <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> </p>",
      "rawMarkdown": "This is cool stuff. Thanks for sharing @bessenyeiszilrd ",
      "votes": 1,
      "replies": [
        {
          "id": 1217180,
          "postDate": "2021-02-24T20:17:06.797Z",
          "content": "<p>I am happy if it was useful</p>",
          "rawMarkdown": "I am happy if it was useful"
        }
      ]
    },
    {
      "id": 1151969,
      "postDate": "2021-01-13T17:10:12.047Z",
      "content": "<p>And yes it helps me ! Thanks for sharing <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> </p>",
      "rawMarkdown": "And yes it helps me ! Thanks for sharing @bessenyeiszilrd ",
      "votes": 1,
      "replies": [
        {
          "id": 1217183,
          "postDate": "2021-02-24T20:17:35.253Z",
          "content": "<p>Great! Happy to hear it 🙂</p>",
          "rawMarkdown": "Great! Happy to hear it 🙂"
        }
      ]
    },
    {
      "id": 1144095,
      "postDate": "2021-01-08T08:24:57.327Z",
      "content": "<p><a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> Must say I didn't know more than half of them. Thanks for sharing!</p>",
      "rawMarkdown": "@bessenyeiszilrd Must say I didn't know more than half of them. Thanks for sharing!",
      "votes": 1,
      "replies": [
        {
          "id": 1144113,
          "postDate": "2021-01-08T08:39:30.233Z",
          "content": "<p>For me, the most interesting in this image, how the losses relate to each other.</p>",
          "rawMarkdown": "For me, the most interesting in this image, how the losses relate to each other.",
          "votes": 1
        },
        {
          "id": 1144125,
          "postDate": "2021-01-08T08:48:27.677Z",
          "content": "<p>Exactly !! It's like a lot of information packed in one image.</p>",
          "rawMarkdown": "Exactly !! It's like a lot of information packed in one image.",
          "votes": 1
        }
      ]
    },
    {
      "id": 1139822,
      "postDate": "2021-01-05T16:33:48.447Z",
      "content": "<p>What loss are the best? What loss works better in which situation?</p>",
      "rawMarkdown": "What loss are the best? What loss works better in which situation?",
      "votes": 1,
      "replies": [
        {
          "id": 1139838,
          "postDate": "2021-01-05T16:47:34.670Z",
          "content": "<p>I saw different approaches. The BCE is the most simple, lot of people uses Lovasz and Jaccard loss as well.</p>\n<ul>\n<li>SIIM-ACR Pneumothorax Segmentation 1st place [<a href=\"https://github.com/SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions/blob/master/selim_sef/training/losses.py\" target=\"_blank\">combo loss]</a> combinations of BCE, dice and focal <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107824\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107824</a></li>\n<li>SIIM-ACR Pneumothorax Segmentation 2nd place used <code>dice loss</code> only <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/108009\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/108009</a></li>\n<li>SIIM-ACR Pneumothorax Segmentation 3rd place Lovasz Loss <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107981\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107981</a></li>\n</ul>\n<p>You can find more winning solutions here: <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/200767\" target=\"_blank\">https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/200767</a></p>",
          "rawMarkdown": "I saw different approaches. The BCE is the most simple, lot of people uses Lovasz and Jaccard loss as well.\n* SIIM-ACR Pneumothorax Segmentation 1st place [[combo loss\\]](https://github.com/SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions/blob/master/selim_sef/training/losses.py) combinations of BCE, dice and focal https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107824\n* SIIM-ACR Pneumothorax Segmentation 2nd place used `dice loss` only https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/108009\n* SIIM-ACR Pneumothorax Segmentation 3rd place Lovasz Loss https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107981\n\nYou can find more winning solutions here: https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/200767\n",
          "votes": 1
        },
        {
          "id": 1144172,
          "postDate": "2021-01-08T09:24:44.697Z",
          "content": "<p>Thanks for sharing!</p>",
          "rawMarkdown": "Thanks for sharing!",
          "votes": 1
        }
      ]
    },
    {
      "id": 1147905,
      "postDate": "2021-01-10T19:47:24.777Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> Nice overview! Especially interresting to see how some losses relate to each other.</p>\n<p>I've tried multiple combinations with BCE, Dice, Jaccard and Focal loss….but for now kept using BCE as al the other losses worked less for me. </p>",
      "rawMarkdown": "Hi @bessenyeiszilrd Nice overview! Especially interresting to see how some losses relate to each other.\n\nI've tried multiple combinations with BCE, Dice, Jaccard and Focal loss....but for now kept using BCE as al the other losses worked less for me. ",
      "votes": 2,
      "replies": [
        {
          "id": 1175739,
          "postDate": "2021-01-29T10:05:52.077Z",
          "content": "<p>Me too. I tried various ones, but currently I'm focusing on BCE loss.</p>",
          "rawMarkdown": "Me too. I tried various ones, but currently I'm focusing on BCE loss.",
          "votes": 2
        }
      ]
    },
    {
      "id": 1138174,
      "postDate": "2021-01-04T13:18:20.210Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1217160,
      "author_name": "Mohammed Hamdy",
      "author_url": "",
      "post_date": "2021-02-24T19:57:21.173000",
      "content": "<p>Thank you for posting this, really helpful!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1217177,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-02-24T20:15:30.847000",
          "content": "<p>I glad if you enjoyed it Great! 🙂</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1217140,
      "author_name": "Dhruvil Dave",
      "author_url": "",
      "post_date": "2021-02-24T19:32:02.810000",
      "content": "<p>Bookmarking this! Very helpful. Thanks for sharing!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1217178,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-02-24T20:16:12.170000",
          "content": "<p>Great! Thanks for your feedback 🙂</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1216903,
      "author_name": "Hanson0910",
      "author_url": "",
      "post_date": "2021-02-24T15:43:11.103000",
      "content": "<p>It's really a great job, thank you</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1217179,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-02-24T20:16:37.937000",
          "content": "<p>You are welcome</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1152081,
      "author_name": "Saurabh Shahane",
      "author_url": "",
      "post_date": "2021-01-13T19:27:19.703000",
      "content": "<p>This is cool stuff. Thanks for sharing <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1217180,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-02-24T20:17:06.797000",
          "content": "<p>I am happy if it was useful</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1151969,
      "author_name": "Saurav Agarwal",
      "author_url": "",
      "post_date": "2021-01-13T17:10:12.047000",
      "content": "<p>And yes it helps me ! Thanks for sharing <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1217183,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-02-24T20:17:35.253000",
          "content": "<p>Great! Happy to hear it 🙂</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1144095,
      "author_name": "Izzy Adesanya",
      "author_url": "",
      "post_date": "2021-01-08T08:24:57.327000",
      "content": "<p><a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> Must say I didn't know more than half of them. Thanks for sharing!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1144113,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-01-08T08:39:30.233000",
          "content": "<p>For me, the most interesting in this image, how the losses relate to each other.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1144125,
          "author_name": "Izzy Adesanya",
          "author_url": "",
          "post_date": "2021-01-08T08:48:27.677000",
          "content": "<p>Exactly !! It's like a lot of information packed in one image.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1139822,
      "author_name": "ZavodRobotov",
      "author_url": "",
      "post_date": "2021-01-05T16:33:48.447000",
      "content": "<p>What loss are the best? What loss works better in which situation?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1139838,
          "author_name": "Bessenyei Szilárd",
          "author_url": "",
          "post_date": "2021-01-05T16:47:34.670000",
          "content": "<p>I saw different approaches. The BCE is the most simple, lot of people uses Lovasz and Jaccard loss as well.</p>\n<ul>\n<li>SIIM-ACR Pneumothorax Segmentation 1st place [<a href=\"https://github.com/SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions/blob/master/selim_sef/training/losses.py\" target=\"_blank\">combo loss]</a> combinations of BCE, dice and focal <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107824\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107824</a></li>\n<li>SIIM-ACR Pneumothorax Segmentation 2nd place used <code>dice loss</code> only <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/108009\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/108009</a></li>\n<li>SIIM-ACR Pneumothorax Segmentation 3rd place Lovasz Loss <a href=\"https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107981\" target=\"_blank\">https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/107981</a></li>\n</ul>\n<p>You can find more winning solutions here: <a href=\"https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/200767\" target=\"_blank\">https://www.kaggle.com/c/hubmap-kidney-segmentation/discussion/200767</a></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1144172,
          "author_name": "ZavodRobotov",
          "author_url": "",
          "post_date": "2021-01-08T09:24:44.697000",
          "content": "<p>Thanks for sharing!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1147905,
      "author_name": "Robin Smits",
      "author_url": "",
      "post_date": "2021-01-10T19:47:24.777000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/bessenyeiszilrd\" target=\"_blank\">@bessenyeiszilrd</a> Nice overview! Especially interresting to see how some losses relate to each other.</p>\n<p>I've tried multiple combinations with BCE, Dice, Jaccard and Focal loss….but for now kept using BCE as al the other losses worked less for me. </p>",
      "votes": 2,
      "replies": [
        {
          "id": 1175739,
          "author_name": "cool_rabbit",
          "author_url": "",
          "post_date": "2021-01-29T10:05:52.077000",
          "content": "<p>Me too. I tried various ones, but currently I'm focusing on BCE loss.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1138174,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-01-04T13:18:20.210000",
      "content": "",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1136713": "Hi! Couple of days earlier I found this site: https://github.com/JunMa11/SegLoss where they summarize the segmentation loss types. It was useful for me, I hope it can help to others as well.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4367831%2F717956da11a8953a81ec75a79495929c%2FLossOverview.jpg?generation=1609672056006545&alt=media)",
    "1217160": "Thank you for posting this, really helpful!",
    "1217140": "Bookmarking this! Very helpful. Thanks for sharing!",
    "1216903": "It's really a great job, thank you",
    "1152081": "This is cool stuff. Thanks for sharing @bessenyeiszilrd ",
    "1151969": "And yes it helps me ! Thanks for sharing @bessenyeiszilrd ",
    "1144095": "@bessenyeiszilrd Must say I didn't know more than half of them. Thanks for sharing!",
    "1139822": "What loss are the best? What loss works better in which situation?",
    "1147905": "Hi @bessenyeiszilrd Nice overview! Especially interresting to see how some losses relate to each other.\n\nI've tried multiple combinations with BCE, Dice, Jaccard and Focal loss....but for now kept using BCE as al the other losses worked less for me. ",
    "1138174": ""
  }
}