{
  "id": 215453,
  "title": "Confusion regarding Multiclass vs Multilabel Classification Task",
  "url": "/competitions/ranzcr-clip-catheter-line-classification/discussion/215453",
  "author_name": "Parth Dhameliya",
  "post_date": "2021-01-29T22:10:28.844000",
  "votes": 8,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Difference between Multiclass and Multilabel Classification?</p>\n<p>For eg, we have a chest X-ray diseases classification problem in which we have three labels <br>\n[ cardiomegaly, pneumonia, fibrosis]</p>\n<p><strong>(Multiclass Classification) Use of Softmax Activation:</strong></p>\n<p><strong>Suppose we have 3 images in the dataset and each image(patient) has one disease</strong></p>\n<p>image1 -&gt; [1,0,0]<br>\nimage2 -&gt; [1,0,0]<br>\nimage3 -&gt; [0,1,0]</p>\n<p>In this case, we want to classify only one disease, and <strong>the sum of all labels for each sample will be equal to one.</strong></p>\n<p>Loss Function used here is a categorical cross-entropy loss.</p>\n<p><strong>(Multilabel Classification) Use of Sigmoid Activation:</strong></p>\n<p><strong>Suppose we have 3 images in the dataset and it is possible that each image(patient) has multiple diseases</strong></p>\n<p>image1 -&gt; [1,1,0]<br>\nimage2 -&gt; [1,0,1]<br>\nimage3 -&gt; [1,1,1]</p>\n<p>In this case, we want to classify multiple diseases, and <strong>the sum of all labels for each sample will not be equal to one.</strong></p>\n<p>Loss Function used here is a Binary cross-entropy loss.</p>\n<p>Example notebook for Multilabel Classification: <a href=\"https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification\" target=\"_blank\">https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification</a></p>\n<p>Also, share your view on weighted loss for challenging class imbalance : <br>\n(<a href=\"https://www.kaggle.com/parthdhameliya77/ranzcr-clip-eda-class-imbalance-patient-overlap\" target=\"_blank\">RANZCR CLiP EDA - Class Imbalance, Patient Overlap</a>)</p>",
  "messages": [
    {
      "id": 1176909,
      "postDate": "2021-01-29T22:10:28.843Z",
      "content": "<p>Difference between Multiclass and Multilabel Classification?</p>\n<p>For eg, we have a chest X-ray diseases classification problem in which we have three labels <br>\n[ cardiomegaly, pneumonia, fibrosis]</p>\n<p><strong>(Multiclass Classification) Use of Softmax Activation:</strong></p>\n<p><strong>Suppose we have 3 images in the dataset and each image(patient) has one disease</strong></p>\n<p>image1 -&gt; [1,0,0]<br>\nimage2 -&gt; [1,0,0]<br>\nimage3 -&gt; [0,1,0]</p>\n<p>In this case, we want to classify only one disease, and <strong>the sum of all labels for each sample will be equal to one.</strong></p>\n<p>Loss Function used here is a categorical cross-entropy loss.</p>\n<p><strong>(Multilabel Classification) Use of Sigmoid Activation:</strong></p>\n<p><strong>Suppose we have 3 images in the dataset and it is possible that each image(patient) has multiple diseases</strong></p>\n<p>image1 -&gt; [1,1,0]<br>\nimage2 -&gt; [1,0,1]<br>\nimage3 -&gt; [1,1,1]</p>\n<p>In this case, we want to classify multiple diseases, and <strong>the sum of all labels for each sample will not be equal to one.</strong></p>\n<p>Loss Function used here is a Binary cross-entropy loss.</p>\n<p>Example notebook for Multilabel Classification: <a href=\"https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification\" target=\"_blank\">https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification</a></p>\n<p>Also, share your view on weighted loss for challenging class imbalance : <br>\n(<a href=\"https://www.kaggle.com/parthdhameliya77/ranzcr-clip-eda-class-imbalance-patient-overlap\" target=\"_blank\">RANZCR CLiP EDA - Class Imbalance, Patient Overlap</a>)</p>",
      "rawMarkdown": "Difference between Multiclass and Multilabel Classification?\n\nFor eg, we have a chest X-ray diseases classification problem in which we have three labels \n[ cardiomegaly, pneumonia, fibrosis]\n\n**(Multiclass Classification) Use of Softmax Activation:**\n\n**Suppose we have 3 images in the dataset and each image(patient) has one disease**\n\nimage1 -> [1,0,0]\nimage2 -> [1,0,0]\nimage3 -> [0,1,0]\n\nIn this case, we want to classify only one disease, and **the sum of all labels for each sample will be equal to one.**\n\nLoss Function used here is a categorical cross-entropy loss.\n\n**(Multilabel Classification) Use of Sigmoid Activation:**\n\n**Suppose we have 3 images in the dataset and it is possible that each image(patient) has multiple diseases**\n\nimage1 -> [1,1,0]\nimage2 -> [1,0,1]\nimage3 -> [1,1,1]\n\nIn this case, we want to classify multiple diseases, and **the sum of all labels for each sample will not be equal to one.**\n\nLoss Function used here is a Binary cross-entropy loss.\n\n\nExample notebook for Multilabel Classification: https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification\n\nAlso, share your view on weighted loss for challenging class imbalance : \n([RANZCR CLiP EDA - Class Imbalance, Patient Overlap](https://www.kaggle.com/parthdhameliya77/ranzcr-clip-eda-class-imbalance-patient-overlap))",
      "votes": 8
    },
    {
      "id": 1178517,
      "postDate": "2021-01-30T23:53:32.703Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true,
      "replies": [
        {
          "id": 1178667,
          "postDate": "2021-01-31T04:16:10.750Z",
          "content": "<p>Yes, it is multilabel, I have no confusion about it. I have posted this topic just for making the difference between multiclass vs multilabel and what activation and loss function should be used.</p>",
          "rawMarkdown": "Yes, it is multilabel, I have no confusion about it. I have posted this topic just for making the difference between multiclass vs multilabel and what activation and loss function should be used.",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1178517,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-01-30T23:53:32.703000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 1178667,
          "author_name": "Parth Dhameliya",
          "author_url": "",
          "post_date": "2021-01-31T04:16:10.750000",
          "content": "<p>Yes, it is multilabel, I have no confusion about it. I have posted this topic just for making the difference between multiclass vs multilabel and what activation and loss function should be used.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1176909": "Difference between Multiclass and Multilabel Classification?\n\nFor eg, we have a chest X-ray diseases classification problem in which we have three labels \n[ cardiomegaly, pneumonia, fibrosis]\n\n**(Multiclass Classification) Use of Softmax Activation:**\n\n**Suppose we have 3 images in the dataset and each image(patient) has one disease**\n\nimage1 -> [1,0,0]\nimage2 -> [1,0,0]\nimage3 -> [0,1,0]\n\nIn this case, we want to classify only one disease, and **the sum of all labels for each sample will be equal to one.**\n\nLoss Function used here is a categorical cross-entropy loss.\n\n**(Multilabel Classification) Use of Sigmoid Activation:**\n\n**Suppose we have 3 images in the dataset and it is possible that each image(patient) has multiple diseases**\n\nimage1 -> [1,1,0]\nimage2 -> [1,0,1]\nimage3 -> [1,1,1]\n\nIn this case, we want to classify multiple diseases, and **the sum of all labels for each sample will not be equal to one.**\n\nLoss Function used here is a Binary cross-entropy loss.\n\n\nExample notebook for Multilabel Classification: https://www.kaggle.com/parthdhameliya77/nih-multi-label-chest-x-ray-classification\n\nAlso, share your view on weighted loss for challenging class imbalance : \n([RANZCR CLiP EDA - Class Imbalance, Patient Overlap](https://www.kaggle.com/parthdhameliya77/ranzcr-clip-eda-class-imbalance-patient-overlap))",
    "1178517": ""
  }
}