{
  "id": 74147,
  "title": "Which loss function do you choose? ",
  "url": "/competitions/human-protein-atlas-image-classification/discussion/74147",
  "author_name": "",
  "post_date": "2018-12-09T07:51:16.664042Z",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Which loss function do you choose as the criterion?</p>",
  "messages": [
    {
      "id": "435984",
      "postDate": "12/09/2018 07:51:16",
      "content": "<p>Which loss function do you choose as the criterion?</p>",
      "rawMarkdown": "Which loss function do you choose as the criterion?",
      "votes": null
    },
    {
      "id": "436333",
      "postDate": "12/10/2018 06:26:18",
      "content": "<p>I use binary-crossentropy</p>",
      "rawMarkdown": "I use binary-crossentropy",
      "votes": null
    },
    {
      "id": "436423",
      "postDate": "12/10/2018 09:17:54",
      "content": "<p>I am using binary_crossentropy in R -&gt; Keras -&gt; Tensorflow.  I have also tried a loss based on Michal Haltuf's kernel \"Best loss function for F1-score metric\" which I converted from Python to R, as well as a linear combination of that with binary_crossentropy..</p>",
      "rawMarkdown": "I am using binary_crossentropy in R -&gt; Keras -&gt; Tensorflow.  I have also tried a loss based on Michal Haltuf's kernel \"Best loss function for F1-score metric\" which I converted from Python to R, as well as a linear combination of that with binary_crossentropy..",
      "votes": null
    },
    {
      "id": "437150",
      "postDate": "12/11/2018 13:06:40",
      "content": "<p>There are some loss functions you can use in R or Keras. Since this is a multi-class problem, I think \"categorical_crossentropy\" should be used. </p>",
      "rawMarkdown": "There are some loss functions you can use in R or Keras. Since this is a multi-class problem, I think \"categorical_crossentropy\" should be used.",
      "votes": null
    },
    {
      "id": "437234",
      "postDate": "12/11/2018 15:34:36",
      "content": "<p>In this case, I thought you shouldn't use categorical_crossentropy, because categorical_crossentropy is used in muti-class and single-label problems, while it's muti-label in here.</p>",
      "rawMarkdown": "In this case, I thought you shouldn't use categorical_crossentropy, because categorical_crossentropy is used in muti-class and single-label problems, while it's muti-label in here.",
      "votes": null
    },
    {
      "id": "437260",
      "postDate": "12/11/2018 16:22:38",
      "content": "<p>I think that binary_crossentropy should be used...</p>",
      "rawMarkdown": "I think that binary_crossentropy should be used...",
      "votes": null
    },
    {
      "id": "437369",
      "postDate": "12/11/2018 19:26:20",
      "content": "<p>I'am using binary crossentropy. So far the best results with that one. I'am also trying Focal Loss....but until now not really good results. I'am trying to get some good parameters chosen for it ... but sofar not found a good combination.</p>",
      "rawMarkdown": "I'am using binary crossentropy. So far the best results with that one. I'am also trying Focal Loss....but until now not really good results. I'am trying to get some good parameters chosen for it ... but sofar not found a good combination.",
      "votes": null
    },
    {
      "id": "437813",
      "postDate": "12/12/2018 14:44:41",
      "content": "<p>binary crossentropy + F1 loss</p>",
      "rawMarkdown": "binary crossentropy + F1 loss",
      "votes": null
    },
    {
      "id": "437916",
      "postDate": "12/12/2018 18:50:09",
      "content": "<p>I've had the most success with BCE. I'd really like to get focal loss performing well as it seems like a conceptually clean and easy way to deal with the class imbalance. </p>\n\n<p>What alpha and gamma parameters have worked for people that are successfully using focal loss? I started with gamma=2 and alpha=0.25 as recommended by the focal loss paper. This increases the raw probabilities of my model on the rare classes which seems promising since my model using BCE is under-predicting the rare classes. However, BCE is still out-performing Focal Loss for me.</p>",
      "rawMarkdown": "I've had the most success with BCE. I'd really like to get focal loss performing well as it seems like a conceptually clean and easy way to deal with the class imbalance. \n\nWhat alpha and gamma parameters have worked for people that are successfully using focal loss? I started with gamma=2 and alpha=0.25 as recommended by the focal loss paper. This increases the raw probabilities of my model on the rare classes which seems promising since my model using BCE is under-predicting the rare classes. However, BCE is still out-performing Focal Loss for me.",
      "votes": null
    },
    {
      "id": "437936",
      "postDate": "12/12/2018 19:38:25",
      "content": "<p>I tried to read the paper carefully, they are actually using alpha=0.25 to decrease positive class weights.\nDon't we need to actually increase its weight?</p>",
      "rawMarkdown": "I tried to read the paper carefully, they are actually using alpha=0.25 to decrease positive class weights.\nDon't we need to actually increase its weight?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 436333,
      "author_name": "benchur",
      "author_url": "",
      "post_date": "12/10/2018 06:26:18",
      "content": "<p>I use binary-crossentropy</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 436423,
      "author_name": "dslate",
      "author_url": "",
      "post_date": "12/10/2018 09:17:54",
      "content": "<p>I am using binary_crossentropy in R -&gt; Keras -&gt; Tensorflow.  I have also tried a loss based on Michal Haltuf's kernel \"Best loss function for F1-score metric\" which I converted from Python to R, as well as a linear combination of that with binary_crossentropy..</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 437150,
      "author_name": "sanjoybijoy",
      "author_url": "",
      "post_date": "12/11/2018 13:06:40",
      "content": "<p>There are some loss functions you can use in R or Keras. Since this is a multi-class problem, I think \"categorical_crossentropy\" should be used. </p>",
      "votes": null,
      "replies": [
        {
          "id": 437234,
          "author_name": "benchur",
          "author_url": "",
          "post_date": "12/11/2018 15:34:36",
          "content": "<p>In this case, I thought you shouldn't use categorical_crossentropy, because categorical_crossentropy is used in muti-class and single-label problems, while it's muti-label in here.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 437260,
      "author_name": "susnato",
      "author_url": "",
      "post_date": "12/11/2018 16:22:38",
      "content": "<p>I think that binary_crossentropy should be used...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 437369,
      "author_name": "rsmits",
      "author_url": "",
      "post_date": "12/11/2018 19:26:20",
      "content": "<p>I'am using binary crossentropy. So far the best results with that one. I'am also trying Focal Loss....but until now not really good results. I'am trying to get some good parameters chosen for it ... but sofar not found a good combination.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 437813,
      "author_name": "crilinux",
      "author_url": "",
      "post_date": "12/12/2018 14:44:41",
      "content": "<p>binary crossentropy + F1 loss</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 437916,
      "author_name": "pjbutcher",
      "author_url": "",
      "post_date": "12/12/2018 18:50:09",
      "content": "<p>I've had the most success with BCE. I'd really like to get focal loss performing well as it seems like a conceptually clean and easy way to deal with the class imbalance. </p>\n\n<p>What alpha and gamma parameters have worked for people that are successfully using focal loss? I started with gamma=2 and alpha=0.25 as recommended by the focal loss paper. This increases the raw probabilities of my model on the rare classes which seems promising since my model using BCE is under-predicting the rare classes. However, BCE is still out-performing Focal Loss for me.</p>",
      "votes": null,
      "replies": [
        {
          "id": 437936,
          "author_name": "spsancti",
          "author_url": "",
          "post_date": "12/12/2018 19:38:25",
          "content": "<p>I tried to read the paper carefully, they are actually using alpha=0.25 to decrease positive class weights.\nDon't we need to actually increase its weight?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "435984": "Which loss function do you choose as the criterion?",
    "436333": "I use binary-crossentropy",
    "436423": "I am using binary_crossentropy in R -&gt; Keras -&gt; Tensorflow.  I have also tried a loss based on Michal Haltuf's kernel \"Best loss function for F1-score metric\" which I converted from Python to R, as well as a linear combination of that with binary_crossentropy..",
    "437150": "There are some loss functions you can use in R or Keras. Since this is a multi-class problem, I think \"categorical_crossentropy\" should be used.",
    "437234": "In this case, I thought you shouldn't use categorical_crossentropy, because categorical_crossentropy is used in muti-class and single-label problems, while it's muti-label in here.",
    "437260": "I think that binary_crossentropy should be used...",
    "437369": "I'am using binary crossentropy. So far the best results with that one. I'am also trying Focal Loss....but until now not really good results. I'am trying to get some good parameters chosen for it ... but sofar not found a good combination.",
    "437813": "binary crossentropy + F1 loss",
    "437916": "I've had the most success with BCE. I'd really like to get focal loss performing well as it seems like a conceptually clean and easy way to deal with the class imbalance. \n\nWhat alpha and gamma parameters have worked for people that are successfully using focal loss? I started with gamma=2 and alpha=0.25 as recommended by the focal loss paper. This increases the raw probabilities of my model on the rare classes which seems promising since my model using BCE is under-predicting the rare classes. However, BCE is still out-performing Focal Loss for me.",
    "437936": "I tried to read the paper carefully, they are actually using alpha=0.25 to decrease positive class weights.\nDon't we need to actually increase its weight?"
  },
  "source": "meta"
}