{
  "id": 412951,
  "title": "A 0.05+ lift by reducing confidence",
  "url": "/competitions/google-research-identify-contrails-reduce-global-warming/discussion/412951",
  "author_name": "LUPIN11",
  "post_date": "2023-05-26T04:11:58.989000",
  "votes": 5,
  "comment_count": 2,
  "views": 0,
  "content": "<p>By reducing(or sometimes increasing?) ur model's confidence in contrail predictions, it is highly likely that the Dice coeff will improve.<br>\nMy model is trained by WCE loss function and its performance is not so good (just 0.309), so I'm not sure if doing this would be helpful for a much better model or a model trained by DICE loss.</p>\n<pre><code>k = -0.5 \npred = F.softmax(pred, dim=1)\npred[:, 1, :, :] += k  # reducing confidence in contrail predictions\npred = F.softmax(pred, dim=1)\npred = torch.argmax(pred, dim=1)\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9893459%2Fc022874a97d47b3e642d3c213a8a260c%2Fp.png?generation=1685068320179092&amp;alt=media\" alt=\"\"><br>\nThere is a maximum lift of 0.07, which is quite surprising to me.<br>\nBTW, be aware of the risk of overfitting and consider adjusting k on CV rather than LB.<br>\n<strong>Some possible explanations:</strong></p>\n<ol>\n<li>According to <a href=\"https://storage.googleapis.com/goes_contrails_dataset/20230419/Contrail_Detection_Dataset_Instruction.pdf\" target=\"_blank\">supplementary material</a>, labelers are asked to label contrails more cautiously.</li>\n<li>The performance of model is not so good</li>\n<li>This is a characteristic of DICE coeff and the model doesn't learn it owing to a different loss functions.</li>\n<li>…</li>\n</ol>",
  "messages": [
    {
      "id": 2274513,
      "postDate": "2023-05-26T04:11:58.990Z",
      "content": "<p>By reducing(or sometimes increasing?) ur model's confidence in contrail predictions, it is highly likely that the Dice coeff will improve.<br>\nMy model is trained by WCE loss function and its performance is not so good (just 0.309), so I'm not sure if doing this would be helpful for a much better model or a model trained by DICE loss.</p>\n<pre><code>k = -0.5 \npred = F.softmax(pred, dim=1)\npred[:, 1, :, :] += k  # reducing confidence in contrail predictions\npred = F.softmax(pred, dim=1)\npred = torch.argmax(pred, dim=1)\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9893459%2Fc022874a97d47b3e642d3c213a8a260c%2Fp.png?generation=1685068320179092&amp;alt=media\" alt=\"\"><br>\nThere is a maximum lift of 0.07, which is quite surprising to me.<br>\nBTW, be aware of the risk of overfitting and consider adjusting k on CV rather than LB.<br>\n<strong>Some possible explanations:</strong></p>\n<ol>\n<li>According to <a href=\"https://storage.googleapis.com/goes_contrails_dataset/20230419/Contrail_Detection_Dataset_Instruction.pdf\" target=\"_blank\">supplementary material</a>, labelers are asked to label contrails more cautiously.</li>\n<li>The performance of model is not so good</li>\n<li>This is a characteristic of DICE coeff and the model doesn't learn it owing to a different loss functions.</li>\n<li>…</li>\n</ol>",
      "rawMarkdown": "By reducing(or sometimes increasing?) ur model's confidence in contrail predictions, it is highly likely that the Dice coeff will improve.\nMy model is trained by WCE loss function and its performance is not so good (just 0.309), so I'm not sure if doing this would be helpful for a much better model or a model trained by DICE loss.\n\n```\nk = -0.5 \npred = F.softmax(pred, dim=1)\npred[:, 1, :, :] += k  # reducing confidence in contrail predictions\npred = F.softmax(pred, dim=1)\npred = torch.argmax(pred, dim=1)\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9893459%2Fc022874a97d47b3e642d3c213a8a260c%2Fp.png?generation=1685068320179092&alt=media)\nThere is a maximum lift of 0.07, which is quite surprising to me.\nBTW, be aware of the risk of overfitting and consider adjusting k on CV rather than LB.\n**Some possible explanations:**\n1. According to [supplementary material](https://storage.googleapis.com/goes_contrails_dataset/20230419/Contrail_Detection_Dataset_Instruction.pdf), labelers are asked to label contrails more cautiously.\n2. The performance of model is not so good\n3. This is a characteristic of DICE coeff and the model doesn't learn it owing to a different loss functions.\n4. ...",
      "votes": 4
    },
    {
      "id": 2274536,
      "postDate": "2023-05-26T04:43:35.997Z",
      "content": "<p>Very interesting findings! How exactly did you measure the increase of your metrics? Did you apply the k during training in your network already or did you use it for calculating the performance on the test dataset (or even submission?)</p>",
      "rawMarkdown": "Very interesting findings! How exactly did you measure the increase of your metrics? Did you apply the k during training in your network already or did you use it for calculating the performance on the test dataset (or even submission?)",
      "replies": [
        {
          "id": 2274652,
          "postDate": "2023-05-26T07:03:52.543Z",
          "content": "<p>It doesn't entail training. Just reduce the likelihood of all pixels being classified as 1 during the prediction stage. This can be understood as raising the threshold.</p>",
          "rawMarkdown": "It doesn't entail training. Just reduce the likelihood of all pixels being classified as 1 during the prediction stage. This can be understood as raising the threshold.",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2274536,
      "author_name": "Jan H",
      "author_url": "",
      "post_date": "2023-05-26T04:43:35.997000",
      "content": "<p>Very interesting findings! How exactly did you measure the increase of your metrics? Did you apply the k during training in your network already or did you use it for calculating the performance on the test dataset (or even submission?)</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2274652,
          "author_name": "LUPIN11",
          "author_url": "",
          "post_date": "2023-05-26T07:03:52.543000",
          "content": "<p>It doesn't entail training. Just reduce the likelihood of all pixels being classified as 1 during the prediction stage. This can be understood as raising the threshold.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2274513": "By reducing(or sometimes increasing?) ur model's confidence in contrail predictions, it is highly likely that the Dice coeff will improve.\nMy model is trained by WCE loss function and its performance is not so good (just 0.309), so I'm not sure if doing this would be helpful for a much better model or a model trained by DICE loss.\n\n```\nk = -0.5 \npred = F.softmax(pred, dim=1)\npred[:, 1, :, :] += k  # reducing confidence in contrail predictions\npred = F.softmax(pred, dim=1)\npred = torch.argmax(pred, dim=1)\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F9893459%2Fc022874a97d47b3e642d3c213a8a260c%2Fp.png?generation=1685068320179092&alt=media)\nThere is a maximum lift of 0.07, which is quite surprising to me.\nBTW, be aware of the risk of overfitting and consider adjusting k on CV rather than LB.\n**Some possible explanations:**\n1. According to [supplementary material](https://storage.googleapis.com/goes_contrails_dataset/20230419/Contrail_Detection_Dataset_Instruction.pdf), labelers are asked to label contrails more cautiously.\n2. The performance of model is not so good\n3. This is a characteristic of DICE coeff and the model doesn't learn it owing to a different loss functions.\n4. ...",
    "2274536": "Very interesting findings! How exactly did you measure the increase of your metrics? Did you apply the k during training in your network already or did you use it for calculating the performance on the test dataset (or even submission?)"
  }
}