{
  "id": 158860,
  "title": "Focal loss testing results - Did you have a similar experience?",
  "url": "/competitions/siim-isic-melanoma-classification/discussion/158860",
  "author_name": "",
  "post_date": "2020-06-15T16:12:31.744507300Z",
  "votes": 3,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I had been using binary cross-entropy as my loss function and I got a score of 0.91. However, when I used the focal loss as my loss function with gamma = 1/2/5 and alpha = 0.25, I found that the public LB score decreased a little bit. </p>\n\n<p>Did you get similar results?</p>",
  "messages": [
    {
      "id": "887346",
      "postDate": "06/15/2020 16:12:31",
      "content": "<p>I had been using binary cross-entropy as my loss function and I got a score of 0.91. However, when I used the focal loss as my loss function with gamma = 1/2/5 and alpha = 0.25, I found that the public LB score decreased a little bit. </p>\n\n<p>Did you get similar results?</p>",
      "rawMarkdown": "I had been using binary cross-entropy as my loss function and I got a score of 0.91. However, when I used the focal loss as my loss function with gamma = 1/2/5 and alpha = 0.25, I found that the public LB score decreased a little bit. \n\nDid you get similar results?",
      "votes": null
    },
    {
      "id": "887419",
      "postDate": "06/15/2020 17:01:03",
      "content": "<p>I think alpha = 0.25 means you're putting more weight towards negative class and less weight for positive class. Which is opposite what we want. I think alpha = .75 is more reasonable...</p>",
      "rawMarkdown": "I think alpha = 0.25 means you're putting more weight towards negative class and less weight for positive class. Which is opposite what we want. I think alpha = .75 is more reasonable...",
      "votes": null
    },
    {
      "id": "887996",
      "postDate": "06/16/2020 03:54:29",
      "content": "<p>Thank you for the suggestion! I will try it out.</p>",
      "rawMarkdown": "Thank you for the suggestion! I will try it out.",
      "votes": null
    },
    {
      "id": "891474",
      "postDate": "06/18/2020 07:43:41",
      "content": "<p>Hey, wondering if you tried weighted BCE loss? Also, did the focal loss seem to help?</p>\n\n<p>I had a similar experience when I tried weighted BCE loss. </p>",
      "rawMarkdown": "Hey, wondering if you tried weighted BCE loss? Also, did the focal loss seem to help?\n\nI had a similar experience when I tried weighted BCE loss.",
      "votes": null
    },
    {
      "id": "891672",
      "postDate": "06/18/2020 11:23:16",
      "content": "<p>Focal loss (gamma 2 and alpha 0.75) increased my model's score from 0.895 to 0.905.</p>",
      "rawMarkdown": "Focal loss (gamma 2 and alpha 0.75) increased my model's score from 0.895 to 0.905.",
      "votes": null
    },
    {
      "id": "891879",
      "postDate": "06/18/2020 14:01:27",
      "content": "<p>That's great. Thanks for sharing this! Appreciate it. :)</p>\n\n<p>I will give it a try too.</p>",
      "rawMarkdown": "That's great. Thanks for sharing this! Appreciate it. :)\n\nI will give it a try too.",
      "votes": null
    },
    {
      "id": "903093",
      "postDate": "06/26/2020 15:07:58",
      "content": "<p>Hi, are you using focal loss with undersampled or oversampled dataset?</p>",
      "rawMarkdown": "Hi, are you using focal loss with undersampled or oversampled dataset?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 887419,
      "author_name": "awsaf49",
      "author_url": "",
      "post_date": "06/15/2020 17:01:03",
      "content": "<p>I think alpha = 0.25 means you're putting more weight towards negative class and less weight for positive class. Which is opposite what we want. I think alpha = .75 is more reasonable...</p>",
      "votes": null,
      "replies": [
        {
          "id": 887996,
          "author_name": "pragyanbo",
          "author_url": "",
          "post_date": "06/16/2020 03:54:29",
          "content": "<p>Thank you for the suggestion! I will try it out.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 891474,
      "author_name": "aroraaman",
      "author_url": "",
      "post_date": "06/18/2020 07:43:41",
      "content": "<p>Hey, wondering if you tried weighted BCE loss? Also, did the focal loss seem to help?</p>\n\n<p>I had a similar experience when I tried weighted BCE loss. </p>",
      "votes": null,
      "replies": [
        {
          "id": 891672,
          "author_name": "pragyanbo",
          "author_url": "",
          "post_date": "06/18/2020 11:23:16",
          "content": "<p>Focal loss (gamma 2 and alpha 0.75) increased my model's score from 0.895 to 0.905.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 891879,
          "author_name": "aroraaman",
          "author_url": "",
          "post_date": "06/18/2020 14:01:27",
          "content": "<p>That's great. Thanks for sharing this! Appreciate it. :)</p>\n\n<p>I will give it a try too.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 903093,
      "author_name": "khizarhussain",
      "author_url": "",
      "post_date": "06/26/2020 15:07:58",
      "content": "<p>Hi, are you using focal loss with undersampled or oversampled dataset?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "887346": "I had been using binary cross-entropy as my loss function and I got a score of 0.91. However, when I used the focal loss as my loss function with gamma = 1/2/5 and alpha = 0.25, I found that the public LB score decreased a little bit. \n\nDid you get similar results?",
    "887419": "I think alpha = 0.25 means you're putting more weight towards negative class and less weight for positive class. Which is opposite what we want. I think alpha = .75 is more reasonable...",
    "887996": "Thank you for the suggestion! I will try it out.",
    "891474": "Hey, wondering if you tried weighted BCE loss? Also, did the focal loss seem to help?\n\nI had a similar experience when I tried weighted BCE loss.",
    "891672": "Focal loss (gamma 2 and alpha 0.75) increased my model's score from 0.895 to 0.905.",
    "891879": "That's great. Thanks for sharing this! Appreciate it. :)\n\nI will give it a try too.",
    "903093": "Hi, are you using focal loss with undersampled or oversampled dataset?"
  },
  "source": "meta"
}