{
  "id": 451902,
  "title": "[My Solution Share] Patch Based",
  "url": "/competitions/UBC-OCEAN/discussion/451902",
  "author_name": "Time Master",
  "post_date": "2023-10-31T01:54:06.660000",
  "votes": 4,
  "comment_count": 7,
  "views": 0,
  "content": "<p>TRAIN:</p>\n<pre><code> each WSI:\n    --&gt;sub_images(,)\n\n each sub_image:\n     to (,)\n     crop to (,)\n\n each TMA:\n     crop to (,)\n</code></pre>\n<p>SUBMIT:</p>\n<pre><code> width&lt; and height&lt; in test dataset, it's TMA, otherwise WSI.\n\n TMA:\n     crop into (,)\n\n WSI：\n     t in times:\n         crop into (,)--&gt; resize to (,)--&gt;crop into (,) as model input.\n</code></pre>\n<p>About Data Augumentaion:</p>\n<ul>\n<li>Stain Augumetation is needed </li>\n</ul>\n<p>My notebooks:</p>\n<ul>\n<li>[0] <a href=\"https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail</a></li>\n<li>[1] <a href=\"https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[2] <a href=\"https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset</a></li>\n<li>[3] <a href=\"https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226</a></li>\n</ul>\n<p>Dataset:</p>\n<ul>\n<li>[1] <a href=\"https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[2] <a href=\"https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook</a></li>\n<li>[3] <a href=\"https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[4] <a href=\"https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook</a><br>\n…<br>\n ps: this dataset is cropped into (1600,1600) to save storage, resize and crop operation could be applyed in training data augumentaion </li>\n</ul>\n<p>Hope it's helpful.</p>",
  "messages": [
    {
      "id": 2505937,
      "postDate": "2023-10-31T01:54:06.660Z",
      "content": "<p>TRAIN:</p>\n<pre><code> each WSI:\n    --&gt;sub_images(,)\n\n each sub_image:\n     to (,)\n     crop to (,)\n\n each TMA:\n     crop to (,)\n</code></pre>\n<p>SUBMIT:</p>\n<pre><code> width&lt; and height&lt; in test dataset, it's TMA, otherwise WSI.\n\n TMA:\n     crop into (,)\n\n WSI：\n     t in times:\n         crop into (,)--&gt; resize to (,)--&gt;crop into (,) as model input.\n</code></pre>\n<p>About Data Augumentaion:</p>\n<ul>\n<li>Stain Augumetation is needed </li>\n</ul>\n<p>My notebooks:</p>\n<ul>\n<li>[0] <a href=\"https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail</a></li>\n<li>[1] <a href=\"https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[2] <a href=\"https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset</a></li>\n<li>[3] <a href=\"https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226</a></li>\n</ul>\n<p>Dataset:</p>\n<ul>\n<li>[1] <a href=\"https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[2] <a href=\"https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook</a></li>\n<li>[3] <a href=\"https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook</a></li>\n<li>[4] <a href=\"https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook</a><br>\n…<br>\n ps: this dataset is cropped into (1600,1600) to save storage, resize and crop operation could be applyed in training data augumentaion </li>\n</ul>\n<p>Hope it's helpful.</p>",
      "rawMarkdown": "TRAIN:\n```\nfor each WSI:\n    WSI-->sub_images(1600,1600)\n\nfor each sub_image:\n    resize to (3201,3021)\n    center crop to (2000,2000)\n\nfor each TMA:\n    center crop to (2000,2000)\n```\n\nSUBMIT:\n```\nIf width<10000 and height<10000 in test dataset, it's TMA, otherwise WSI.\n\nFor TMA:\n    center crop into (2000,2000)\n\nFor WSI：\n    for t in times:\n        random crop into (1600,1600)--> resize to (3021,3021)-->crop into (2000,2000) as model input.\n```\n\nAbout Data Augumentaion:\n- Stain Augumetation is needed \n\nMy notebooks:\n- [0] https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail\n- [1] https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook\n- [2] https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset\n- [3] https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226\n\nDataset:\n- [1] https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook\n- [2] https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook\n- [3] https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook\n- [4] https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook\n...\n     ps: this dataset is cropped into (1600,1600) to save storage, resize and crop operation could be applyed in training data augumentaion \n\nHope it's helpful.",
      "votes": 3
    },
    {
      "id": 2506243,
      "postDate": "2023-10-31T07:10:30.053Z",
      "content": "<p>Thanks for sharing your approach. I have a question…</p>\n<pre><code> each WSI:\n    WSI--&gt;sub_images(,)\n\n each sub_image:\n    resize to (,)\n    center crop to (,)\n\n each TMA:\n    center crop to (,)\n</code></pre>\n<p>You have n images for WSIs but a single image for TMAs. Do you train separate models for them?</p>",
      "rawMarkdown": "Thanks for sharing your approach. I have a question...\n\n```python\nfor each WSI:\n    WSI-->sub_images(1600,1600)\n\nfor each sub_image:\n    resize to (3201,3021)\n    center crop to (2000,2000)\n\nfor each TMA:\n    center crop to (2000,2000)\n```\nYou have n images for WSIs but a single image for TMAs. Do you train separate models for them?",
      "votes": 1,
      "replies": [
        {
          "id": 2506276,
          "postDate": "2023-10-31T07:39:42.327Z",
          "content": "<p>Hi, All in one model, because the number of TMAs is not enough for training.</p>\n<p>My idea is to use a large number of Whole Slide Images (WSI) to simulate TMA, considering that the majority of the test set primarily consists of TMAs.</p>",
          "rawMarkdown": "Hi, All in one model, because the number of TMAs is not enough for training.\n\nMy idea is to use a large number of Whole Slide Images (WSI) to simulate TMA, considering that the majority of the test set primarily consists of TMAs.",
          "replies": [
            {
              "id": 2506281,
              "postDate": "2023-10-31T07:42:14.323Z",
              "content": "<p>If you do that, you will introduce noise to labels. Sub images may not necessarily have characteristics associated with the class. That's the drawback of weak labels.</p>",
              "rawMarkdown": "If you do that, you will introduce noise to labels. Sub images may not necessarily have characteristics associated with the class. That's the drawback of weak labels."
            },
            {
              "id": 2506332,
              "postDate": "2023-10-31T08:18:46.943Z",
              "content": "<p>Yes, normal tissue could exist in any WSI, if sub image is a normal tissue, it will disturb model's training.</p>\n<p>For TMA, I think it's a part of WSI, and there must be  lesion areas present, model could recognize this.(Personal understanding)</p>\n<p>For WSI, do multiple cropping and prediction operations, and ensemble these predictions as the final result.</p>",
              "rawMarkdown": "Yes, normal tissue could exist in any WSI, if sub image is a normal tissue, it will disturb model's training.\n\nFor TMA, I think it's a part of WSI, and there must be  lesion areas present, model could recognize this.(Personal understanding)\n\nFor WSI, do multiple cropping and prediction operations, and ensemble these predictions as the final result."
            },
            {
              "id": 2506336,
              "postDate": "2023-10-31T08:22:26.340Z",
              "content": "<p>Another approach is MIL(Multiple Instance Learning), it's also a weak supervision method:</p>\n<p><a href=\"https://www.kaggle.com/code/rainfalllove/using-mil-prepare-dataset\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/using-mil-prepare-dataset</a></p>",
              "rawMarkdown": "Another approach is MIL(Multiple Instance Learning), it's also a weak supervision method:\n\nhttps://www.kaggle.com/code/rainfalllove/using-mil-prepare-dataset"
            }
          ]
        }
      ]
    },
    {
      "id": 2505967,
      "postDate": "2023-10-31T02:44:18.177Z",
      "content": "<p>Thank you for posting this. I've been struggling on how to deal with WSI, as I'm not very experienced with these types of images. I'll read through your notebooks and try out your ideas.</p>",
      "rawMarkdown": "Thank you for posting this. I've been struggling on how to deal with WSI, as I'm not very experienced with these types of images. I'll read through your notebooks and try out your ideas.",
      "isDeleted": true
    },
    {
      "id": 2507773,
      "postDate": "2023-11-01T08:32:21.277Z",
      "content": "<p>Thanks for sharing your approach!</p>",
      "rawMarkdown": "Thanks for sharing your approach!",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 2506243,
      "author_name": "Gunes Evitan",
      "author_url": "",
      "post_date": "2023-10-31T07:10:30.053000",
      "content": "<p>Thanks for sharing your approach. I have a question…</p>\n<pre><code> each WSI:\n    WSI--&gt;sub_images(,)\n\n each sub_image:\n    resize to (,)\n    center crop to (,)\n\n each TMA:\n    center crop to (,)\n</code></pre>\n<p>You have n images for WSIs but a single image for TMAs. Do you train separate models for them?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2506276,
          "author_name": "Time Master",
          "author_url": "",
          "post_date": "2023-10-31T07:39:42.327000",
          "content": "<p>Hi, All in one model, because the number of TMAs is not enough for training.</p>\n<p>My idea is to use a large number of Whole Slide Images (WSI) to simulate TMA, considering that the majority of the test set primarily consists of TMAs.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2506281,
              "author_name": "Gunes Evitan",
              "author_url": "",
              "post_date": "2023-10-31T07:42:14.323000",
              "content": "<p>If you do that, you will introduce noise to labels. Sub images may not necessarily have characteristics associated with the class. That's the drawback of weak labels.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2506332,
              "author_name": "Time Master",
              "author_url": "",
              "post_date": "2023-10-31T08:18:46.943000",
              "content": "<p>Yes, normal tissue could exist in any WSI, if sub image is a normal tissue, it will disturb model's training.</p>\n<p>For TMA, I think it's a part of WSI, and there must be  lesion areas present, model could recognize this.(Personal understanding)</p>\n<p>For WSI, do multiple cropping and prediction operations, and ensemble these predictions as the final result.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2506336,
              "author_name": "Time Master",
              "author_url": "",
              "post_date": "2023-10-31T08:22:26.340000",
              "content": "<p>Another approach is MIL(Multiple Instance Learning), it's also a weak supervision method:</p>\n<p><a href=\"https://www.kaggle.com/code/rainfalllove/using-mil-prepare-dataset\" target=\"_blank\">https://www.kaggle.com/code/rainfalllove/using-mil-prepare-dataset</a></p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2505967,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-10-31T02:44:18.177000",
      "content": "<p>Thank you for posting this. I've been struggling on how to deal with WSI, as I'm not very experienced with these types of images. I'll read through your notebooks and try out your ideas.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2507773,
      "author_name": "TensorKitty",
      "author_url": "",
      "post_date": "2023-11-01T08:32:21.277000",
      "content": "<p>Thanks for sharing your approach!</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2505937": "TRAIN:\n```\nfor each WSI:\n    WSI-->sub_images(1600,1600)\n\nfor each sub_image:\n    resize to (3201,3021)\n    center crop to (2000,2000)\n\nfor each TMA:\n    center crop to (2000,2000)\n```\n\nSUBMIT:\n```\nIf width<10000 and height<10000 in test dataset, it's TMA, otherwise WSI.\n\nFor TMA:\n    center crop into (2000,2000)\n\nFor WSI：\n    for t in times:\n        random crop into (1600,1600)--> resize to (3021,3021)-->crop into (2000,2000) as model input.\n```\n\nAbout Data Augumentaion:\n- Stain Augumetation is needed \n\nMy notebooks:\n- [0] https://www.kaggle.com/code/rainfalllove/big-difference-between-tma-and-wsi-thumbnail\n- [1] https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-wsi-files/notebook\n- [2] https://www.kaggle.com/code/rainfalllove/maybe-a-better-way-to-handle-tma-in-testset\n- [3] https://www.kaggle.com/code/rainfalllove/solution-cropped-tmas-vs-resized-cropped-wsi-subs/notebook?scriptVersionId=147794226\n\nDataset:\n- [1] https://www.kaggle.com/code/rainfalllove/p1-maybe-a-better-way-to-handle-wsi-files/notebook\n- [2] https://www.kaggle.com/code/rainfalllove/p2-maybe-a-better-way-to-handle-wsi-fp2/notebook\n- [3] https://www.kaggle.com/code/rainfalllove/p3-maybe-a-better-way-to-handle-wsi-files/notebook\n- [4] https://www.kaggle.com/code/rainfalllove/p4-maybe-a-better-way-to-handle-wsi-files/notebook\n...\n     ps: this dataset is cropped into (1600,1600) to save storage, resize and crop operation could be applyed in training data augumentaion \n\nHope it's helpful.",
    "2506243": "Thanks for sharing your approach. I have a question...\n\n```python\nfor each WSI:\n    WSI-->sub_images(1600,1600)\n\nfor each sub_image:\n    resize to (3201,3021)\n    center crop to (2000,2000)\n\nfor each TMA:\n    center crop to (2000,2000)\n```\nYou have n images for WSIs but a single image for TMAs. Do you train separate models for them?",
    "2505967": "Thank you for posting this. I've been struggling on how to deal with WSI, as I'm not very experienced with these types of images. I'll read through your notebooks and try out your ideas.",
    "2507773": "Thanks for sharing your approach!"
  }
}