{
  "id": 371717,
  "title": "The way how you resize your images impacts the results!",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/371717",
  "author_name": "Michał Choiński",
  "post_date": "2022-12-11T21:51:22.392000",
  "votes": 23,
  "comment_count": 6,
  "views": 0,
  "content": "<p>From my experience, the way of resizing the images sometimes impacts the results severely.</p>\n<p><strong>An example</strong>:<br>\nin the paper <a href=\"https://www.scirp.org/journal/paperinformation.aspx?paperid=113621\" target=\"_blank\">Effect of the Pixel Interpolation Method for Downsampling Medical Images on Deep Learning Accuracy</a> the authors applied several interpolation methods on the Chest X-ray images and measured their impact on the results of the trained Deep Learning models. Although in this case the differences were not that gigantic, some clear patterns were observed:</p>\n<ul>\n<li>lanczos interpolation always led to the worst results </li>\n<li>nearest neighbour interpolation always led to the best results</li>\n</ul>\n<p>I deal with cases when lanczos interpolation is actually superior to the rest, so it really depends on your data. However, it is very important to be aware of the above if you want to take care of every detail and reach the top score.</p>\n<p>Based on the notebook developed by <a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a> I created several datasets that contain png images resized to 256x256 pixels with different interpolation methods (as compared to bilinear that is used in OpenCV). You can find them below and experiment further with other sizes or interpolation methods:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256nearest\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/nearest</a></li>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256bicubic\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/bicubic</a></li>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256lanczos4\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/lanczos4</a></li>\n</ul>\n<p>Generated by the notebooks:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-nearest\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - nearest</a></li>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-bicubic\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - bicubic</a></li>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-lanczos4\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - lanczos4</a></li>\n</ul>\n<p>I hope that you will find this useful and it will help you to achieve better results!</p>",
  "messages": [
    {
      "id": 2062225,
      "postDate": "2022-12-11T21:51:22.393Z",
      "content": "<p>From my experience, the way of resizing the images sometimes impacts the results severely.</p>\n<p><strong>An example</strong>:<br>\nin the paper <a href=\"https://www.scirp.org/journal/paperinformation.aspx?paperid=113621\" target=\"_blank\">Effect of the Pixel Interpolation Method for Downsampling Medical Images on Deep Learning Accuracy</a> the authors applied several interpolation methods on the Chest X-ray images and measured their impact on the results of the trained Deep Learning models. Although in this case the differences were not that gigantic, some clear patterns were observed:</p>\n<ul>\n<li>lanczos interpolation always led to the worst results </li>\n<li>nearest neighbour interpolation always led to the best results</li>\n</ul>\n<p>I deal with cases when lanczos interpolation is actually superior to the rest, so it really depends on your data. However, it is very important to be aware of the above if you want to take care of every detail and reach the top score.</p>\n<p>Based on the notebook developed by <a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a> I created several datasets that contain png images resized to 256x256 pixels with different interpolation methods (as compared to bilinear that is used in OpenCV). You can find them below and experiment further with other sizes or interpolation methods:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256nearest\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/nearest</a></li>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256bicubic\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/bicubic</a></li>\n<li><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256lanczos4\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/256/lanczos4</a></li>\n</ul>\n<p>Generated by the notebooks:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-nearest\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - nearest</a></li>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-bicubic\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - bicubic</a></li>\n<li><a href=\"https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-lanczos4\" target=\"_blank\">RSNA Breast Cancer Dicom -&gt; PNG - lanczos4</a></li>\n</ul>\n<p>I hope that you will find this useful and it will help you to achieve better results!</p>",
      "rawMarkdown": "From my experience, the way of resizing the images sometimes impacts the results severely.\n\n**An example**:\nin the paper [Effect of the Pixel Interpolation Method for Downsampling Medical Images on Deep Learning Accuracy](https://www.scirp.org/journal/paperinformation.aspx?paperid=113621) the authors applied several interpolation methods on the Chest X-ray images and measured their impact on the results of the trained Deep Learning models. Although in this case the differences were not that gigantic, some clear patterns were observed:\n- lanczos interpolation always led to the worst results \n- nearest neighbour interpolation always led to the best results\n\nI deal with cases when lanczos interpolation is actually superior to the rest, so it really depends on your data. However, it is very important to be aware of the above if you want to take care of every detail and reach the top score.\n\nBased on the notebook developed by @theoviel I created several datasets that contain png images resized to 256x256 pixels with different interpolation methods (as compared to bilinear that is used in OpenCV). You can find them below and experiment further with other sizes or interpolation methods:\n\n- [RSNA Breast Cancer Detection - PNG/256/nearest](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256nearest)\n- [RSNA Breast Cancer Detection - PNG/256/bicubic](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256bicubic)\n- [RSNA Breast Cancer Detection - PNG/256/lanczos4](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256lanczos4)\n\nGenerated by the notebooks:\n- [RSNA Breast Cancer Dicom -> PNG - nearest](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-nearest)\n- [RSNA Breast Cancer Dicom -> PNG - bicubic](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-bicubic)\n- [RSNA Breast Cancer Dicom -> PNG - lanczos4](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-lanczos4)\n\nI hope that you will find this useful and it will help you to achieve better results!",
      "votes": 22
    },
    {
      "id": 2062373,
      "postDate": "2022-12-12T03:53:23.553Z",
      "content": "<p>Nice work <a href=\"https://www.kaggle.com/mikecho\" target=\"_blank\">@mikecho</a> </p>",
      "rawMarkdown": "Nice work @mikecho ",
      "votes": 1
    },
    {
      "id": 2062283,
      "postDate": "2022-12-11T23:48:24.263Z",
      "content": "<p>are you planning to create them on 1024?</p>",
      "rawMarkdown": "are you planning to create them on 1024?",
      "votes": 2,
      "replies": [
        {
          "id": 2062288,
          "postDate": "2022-12-12T00:10:47.977Z",
          "content": "<p>I am preparing the other sizes. 1024 is on the way, I will post the links for this size in ~10 hours</p>",
          "rawMarkdown": "I am preparing the other sizes. 1024 is on the way, I will post the links for this size in ~10 hours",
          "votes": 1
        },
        {
          "id": 2062619,
          "postDate": "2022-12-12T09:05:43.777Z",
          "content": "<p><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024nearest\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/1024/nearest</a><br>\n<a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024bicubic\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/1024/bicubic</a></p>",
          "rawMarkdown": "[RSNA Breast Cancer Detection - PNG/1024/nearest](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024nearest)\n[RSNA Breast Cancer Detection - PNG/1024/bicubic](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024bicubic)\n",
          "votes": 3
        }
      ]
    },
    {
      "id": 2062833,
      "postDate": "2022-12-12T13:15:43.070Z",
      "content": "<p>Hi, thanks for sharing! Are the results slightly different in your case?</p>",
      "rawMarkdown": "Hi, thanks for sharing! Are the results slightly different in your case?",
      "replies": [
        {
          "id": 2062844,
          "postDate": "2022-12-12T13:30:11.677Z",
          "content": "<p>I've just started the competition, so I don't know yet how it works on this particular dataset. However, I observed sometimes significant differences on other datasets. Once I get some results, I will post them here. If anyone is quicker, feel free to publish your conclusions in this thread! </p>",
          "rawMarkdown": "I've just started the competition, so I don't know yet how it works on this particular dataset. However, I observed sometimes significant differences on other datasets. Once I get some results, I will post them here. If anyone is quicker, feel free to publish your conclusions in this thread! ",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2062373,
      "author_name": "David Roberts",
      "author_url": "",
      "post_date": "2022-12-12T03:53:23.553000",
      "content": "<p>Nice work <a href=\"https://www.kaggle.com/mikecho\" target=\"_blank\">@mikecho</a> </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2062283,
      "author_name": "moth",
      "author_url": "",
      "post_date": "2022-12-11T23:48:24.263000",
      "content": "<p>are you planning to create them on 1024?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2062288,
          "author_name": "Michał Choiński",
          "author_url": "",
          "post_date": "2022-12-12T00:10:47.977000",
          "content": "<p>I am preparing the other sizes. 1024 is on the way, I will post the links for this size in ~10 hours</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2062619,
          "author_name": "Michał Choiński",
          "author_url": "",
          "post_date": "2022-12-12T09:05:43.777000",
          "content": "<p><a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024nearest\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/1024/nearest</a><br>\n<a href=\"https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png1024bicubic\" target=\"_blank\">RSNA Breast Cancer Detection - PNG/1024/bicubic</a></p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 2062833,
      "author_name": "MIkhail Donskoy",
      "author_url": "",
      "post_date": "2022-12-12T13:15:43.070000",
      "content": "<p>Hi, thanks for sharing! Are the results slightly different in your case?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2062844,
          "author_name": "Michał Choiński",
          "author_url": "",
          "post_date": "2022-12-12T13:30:11.677000",
          "content": "<p>I've just started the competition, so I don't know yet how it works on this particular dataset. However, I observed sometimes significant differences on other datasets. Once I get some results, I will post them here. If anyone is quicker, feel free to publish your conclusions in this thread! </p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2062225": "From my experience, the way of resizing the images sometimes impacts the results severely.\n\n**An example**:\nin the paper [Effect of the Pixel Interpolation Method for Downsampling Medical Images on Deep Learning Accuracy](https://www.scirp.org/journal/paperinformation.aspx?paperid=113621) the authors applied several interpolation methods on the Chest X-ray images and measured their impact on the results of the trained Deep Learning models. Although in this case the differences were not that gigantic, some clear patterns were observed:\n- lanczos interpolation always led to the worst results \n- nearest neighbour interpolation always led to the best results\n\nI deal with cases when lanczos interpolation is actually superior to the rest, so it really depends on your data. However, it is very important to be aware of the above if you want to take care of every detail and reach the top score.\n\nBased on the notebook developed by @theoviel I created several datasets that contain png images resized to 256x256 pixels with different interpolation methods (as compared to bilinear that is used in OpenCV). You can find them below and experiment further with other sizes or interpolation methods:\n\n- [RSNA Breast Cancer Detection - PNG/256/nearest](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256nearest)\n- [RSNA Breast Cancer Detection - PNG/256/bicubic](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256bicubic)\n- [RSNA Breast Cancer Detection - PNG/256/lanczos4](https://www.kaggle.com/datasets/mikecho/rsna-breast-cancer-detection-png256lanczos4)\n\nGenerated by the notebooks:\n- [RSNA Breast Cancer Dicom -> PNG - nearest](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-nearest)\n- [RSNA Breast Cancer Dicom -> PNG - bicubic](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-bicubic)\n- [RSNA Breast Cancer Dicom -> PNG - lanczos4](https://www.kaggle.com/code/mikecho/rsna-breast-cancer-dicom-png-lanczos4)\n\nI hope that you will find this useful and it will help you to achieve better results!",
    "2062373": "Nice work @mikecho ",
    "2062283": "are you planning to create them on 1024?",
    "2062833": "Hi, thanks for sharing! Are the results slightly different in your case?"
  }
}