{
  "id": 374194,
  "title": "Upsampling vs Downsampling",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/374194",
  "author_name": "Naman Makkar",
  "post_date": "2022-12-26T00:34:49.099000",
  "votes": 4,
  "comment_count": 11,
  "views": 0,
  "content": "<p>What has worked well so far for people, upsampling the cancer data or under sampling the 'no-cancer' data ?</p>",
  "messages": [
    {
      "id": 2075838,
      "postDate": "2022-12-26T00:34:49.100Z",
      "content": "<p>What has worked well so far for people, upsampling the cancer data or under sampling the 'no-cancer' data ?</p>",
      "rawMarkdown": "What has worked well so far for people, upsampling the cancer data or under sampling the 'no-cancer' data ?",
      "votes": 4
    },
    {
      "id": 2079554,
      "postDate": "2022-12-29T12:15:53.553Z",
      "content": "<p>The majority of scientific papers which cover this topic suggest using oversampling over undersampling mostly due to the fact of removing data is not very productive.</p>\n<p>e.g: <a href=\"https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results\" target=\"_blank\">https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results</a></p>\n<p>Achieved way better results using oversampling instead of undersampling.</p>",
      "rawMarkdown": "The majority of scientific papers which cover this topic suggest using oversampling over undersampling mostly due to the fact of removing data is not very productive.\n\ne.g: https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results\n\nAchieved way better results using oversampling instead of undersampling.",
      "votes": 1
    },
    {
      "id": 2077286,
      "postDate": "2022-12-27T12:30:32.617Z",
      "content": "<p>\"upsampling the cancer data\" == \"under sampling the no-cancer data\"</p>",
      "rawMarkdown": "\"upsampling the cancer data\" == \"under sampling the no-cancer data\"",
      "votes": 1
    },
    {
      "id": 2079942,
      "postDate": "2022-12-29T18:15:29.713Z",
      "content": "<p>Neither of them worked for me in my previous experiences. I probably wasn't adjusting the training config into new sampled training set. If you can make them work, please share your secret :D</p>",
      "rawMarkdown": "Neither of them worked for me in my previous experiences. I probably wasn't adjusting the training config into new sampled training set. If you can make them work, please share your secret :D"
    },
    {
      "id": 2077278,
      "postDate": "2022-12-27T12:15:33.117Z",
      "content": "<p>Maybe I am wrong, but I've always thought if you uniformly under- or over-sample, then there is effectively no difference between them, except the undersampled dataset has fewer steps per epoch. In other words, if you were to train with the undersampled dataset <code>len(oversampled)/len(undersampled)</code> times as many epochs as the oversampled dataset, there should be no difference.</p>",
      "rawMarkdown": "Maybe I am wrong, but I've always thought if you uniformly under- or over-sample, then there is effectively no difference between them, except the undersampled dataset has fewer steps per epoch. In other words, if you were to train with the undersampled dataset `len(oversampled)/len(undersampled)` times as many epochs as the oversampled dataset, there should be no difference."
    },
    {
      "id": 2076242,
      "postDate": "2022-12-26T09:23:17.297Z",
      "content": "<p>Oversampling the positive data points has worked better for me. Though, I managed to train the model with undersampling the negative data points. But I believe that using undersampling, it is harder to achieve superior model to that of oversampling.</p>",
      "rawMarkdown": "Oversampling the positive data points has worked better for me. Though, I managed to train the model with undersampling the negative data points. But I believe that using undersampling, it is harder to achieve superior model to that of oversampling.",
      "replies": [
        {
          "id": 2076975,
          "postDate": "2022-12-27T04:33:58.517Z",
          "content": "<p>Do you use the loss function with weight? Is this better than the upsample method? And I found that I was limited to LB 0.16. Do you have some suggestions? Thank you very much!</p>",
          "rawMarkdown": "Do you use the loss function with weight? Is this better than the upsample method? And I found that I was limited to LB 0.16. Do you have some suggestions? Thank you very much!\n",
          "replies": [
            {
              "id": 2077183,
              "postDate": "2022-12-27T10:16:32.590Z",
              "content": "<p>Yes, I use loss function with weight. Even with oversampling, you need to penalize wrong predictions on positive data points (cancer) more than that of negatives. So, you need a combination of both, oversampling and loss weighting. Also, try different models, not all models work equally in this competition according to my experience so far.</p>",
              "rawMarkdown": "Yes, I use loss function with weight. Even with oversampling, you need to penalize wrong predictions on positive data points (cancer) more than that of negatives. So, you need a combination of both, oversampling and loss weighting. Also, try different models, not all models work equally in this competition according to my experience so far.",
              "votes": 2
            },
            {
              "id": 2079862,
              "postDate": "2022-12-29T16:58:35.563Z",
              "content": "<p>Thank you so much! I will try that.</p>",
              "rawMarkdown": "Thank you so much! I will try that.",
              "votes": 1
            },
            {
              "id": 2080157,
              "postDate": "2022-12-29T23:13:41.487Z",
              "content": "<p>One more question.</p>\n<p>I found that I only could get LB0.16.</p>\n<p>I used efficientnetb4, weighted loss, balanced sampler, and augmentation. But I only could get 0.16 on LB best on 512*512 no ROI dataset. Do you have some suggestions? Do I miss something? 😭😭</p>\n<p>Thank you so much.</p>",
              "rawMarkdown": "One more question.\n\nI found that I only could get LB0.16.\n\nI used efficientnetb4, weighted loss, balanced sampler, and augmentation. But I only could get 0.16 on LB best on 512*512 no ROI dataset. Do you have some suggestions? Do I miss something? 😭😭\n\nThank you so much."
            },
            {
              "id": 2080204,
              "postDate": "2022-12-30T00:19:44.720Z",
              "content": "<p>You can try other models (like ResNext), higher resolutions (1024), Yolov5 based ROI extraction, training with auxiliary loss and label smoothing. We are all here to learn new things :)</p>",
              "rawMarkdown": "You can try other models (like ResNext), higher resolutions (1024), Yolov5 based ROI extraction, training with auxiliary loss and label smoothing. We are all here to learn new things :)",
              "votes": 2
            },
            {
              "id": 2080211,
              "postDate": "2022-12-30T00:26:54.573Z",
              "content": "<p>Thank you very much! I will try that.</p>",
              "rawMarkdown": "Thank you very much! I will try that."
            }
          ]
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2079554,
      "author_name": "Ali Abdin",
      "author_url": "",
      "post_date": "2022-12-29T12:15:53.553000",
      "content": "<p>The majority of scientific papers which cover this topic suggest using oversampling over undersampling mostly due to the fact of removing data is not very productive.</p>\n<p>e.g: <a href=\"https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results\" target=\"_blank\">https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results</a></p>\n<p>Achieved way better results using oversampling instead of undersampling.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2077286,
      "author_name": "Chenglu",
      "author_url": "",
      "post_date": "2022-12-27T12:30:32.617000",
      "content": "<p>\"upsampling the cancer data\" == \"under sampling the no-cancer data\"</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2079942,
      "author_name": "Gunes Evitan",
      "author_url": "",
      "post_date": "2022-12-29T18:15:29.713000",
      "content": "<p>Neither of them worked for me in my previous experiences. I probably wasn't adjusting the training config into new sampled training set. If you can make them work, please share your secret :D</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2077278,
      "author_name": "James Howard",
      "author_url": "",
      "post_date": "2022-12-27T12:15:33.117000",
      "content": "<p>Maybe I am wrong, but I've always thought if you uniformly under- or over-sample, then there is effectively no difference between them, except the undersampled dataset has fewer steps per epoch. In other words, if you were to train with the undersampled dataset <code>len(oversampled)/len(undersampled)</code> times as many epochs as the oversampled dataset, there should be no difference.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2076242,
      "author_name": "Rasoul Mojtahedzadeh",
      "author_url": "",
      "post_date": "2022-12-26T09:23:17.297000",
      "content": "<p>Oversampling the positive data points has worked better for me. Though, I managed to train the model with undersampling the negative data points. But I believe that using undersampling, it is harder to achieve superior model to that of oversampling.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2076975,
          "author_name": "ChenxiangSun@NJU",
          "author_url": "",
          "post_date": "2022-12-27T04:33:58.517000",
          "content": "<p>Do you use the loss function with weight? Is this better than the upsample method? And I found that I was limited to LB 0.16. Do you have some suggestions? Thank you very much!</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2077183,
              "author_name": "Rasoul Mojtahedzadeh",
              "author_url": "",
              "post_date": "2022-12-27T10:16:32.590000",
              "content": "<p>Yes, I use loss function with weight. Even with oversampling, you need to penalize wrong predictions on positive data points (cancer) more than that of negatives. So, you need a combination of both, oversampling and loss weighting. Also, try different models, not all models work equally in this competition according to my experience so far.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2079862,
              "author_name": "ChenxiangSun@NJU",
              "author_url": "",
              "post_date": "2022-12-29T16:58:35.563000",
              "content": "<p>Thank you so much! I will try that.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2080157,
              "author_name": "ChenxiangSun@NJU",
              "author_url": "",
              "post_date": "2022-12-29T23:13:41.487000",
              "content": "<p>One more question.</p>\n<p>I found that I only could get LB0.16.</p>\n<p>I used efficientnetb4, weighted loss, balanced sampler, and augmentation. But I only could get 0.16 on LB best on 512*512 no ROI dataset. Do you have some suggestions? Do I miss something? 😭😭</p>\n<p>Thank you so much.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2080204,
              "author_name": "Rasoul Mojtahedzadeh",
              "author_url": "",
              "post_date": "2022-12-30T00:19:44.720000",
              "content": "<p>You can try other models (like ResNext), higher resolutions (1024), Yolov5 based ROI extraction, training with auxiliary loss and label smoothing. We are all here to learn new things :)</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2080211,
              "author_name": "ChenxiangSun@NJU",
              "author_url": "",
              "post_date": "2022-12-30T00:26:54.573000",
              "content": "<p>Thank you very much! I will try that.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2075838": "What has worked well so far for people, upsampling the cancer data or under sampling the 'no-cancer' data ?",
    "2079554": "The majority of scientific papers which cover this topic suggest using oversampling over undersampling mostly due to the fact of removing data is not very productive.\n\ne.g: https://www.researchgate.net/publication/340978368_Machine_Learning_with_Oversampling_and_Undersampling_Techniques_Overview_Study_and_Experimental_Results\n\nAchieved way better results using oversampling instead of undersampling.",
    "2077286": "\"upsampling the cancer data\" == \"under sampling the no-cancer data\"",
    "2079942": "Neither of them worked for me in my previous experiences. I probably wasn't adjusting the training config into new sampled training set. If you can make them work, please share your secret :D",
    "2077278": "Maybe I am wrong, but I've always thought if you uniformly under- or over-sample, then there is effectively no difference between them, except the undersampled dataset has fewer steps per epoch. In other words, if you were to train with the undersampled dataset `len(oversampled)/len(undersampled)` times as many epochs as the oversampled dataset, there should be no difference.",
    "2076242": "Oversampling the positive data points has worked better for me. Though, I managed to train the model with undersampling the negative data points. But I believe that using undersampling, it is harder to achieve superior model to that of oversampling."
  }
}