{
  "id": 159820,
  "title": "Tiling methods",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/159820",
  "author_name": "Alex",
  "post_date": "2020-06-18T20:11:14.619000",
  "votes": 29,
  "comment_count": 37,
  "views": 0,
  "content": "<p>As pointed out before, the methods for extracting information from the biopsy images are important. Currently I'm doing some \"simple\"/straight forward tiling (similar to <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87\">this</a> and <a href=\"https://www.kaggle.com/iafoss/panda-concat-tile-pooling-starter-0-79-lb\">this</a>). Gets me to 0.89 LB with a single EfficientNetB0/B1 (using level 1 resolution images). I've also experimented with some more complex tiling, which got me to 0.86 LB (using 960x960 'big images' in comparison with 1536x1536 'big images' of the 0.89 LB submission). I've shared a variant of the tiling method of the 0.86 LB implementation <a href=\"https://www.kaggle.com/akensert/panda-optimized-tiling-tf-data-dataset\">here</a>, to stimulate the discussion a bit :-). Feel free to share me <em>all of your secrets</em> on how to extract information from the biopsy images.</p>",
  "messages": [
    {
      "id": 892340,
      "postDate": "2020-06-18T20:11:14.620Z",
      "content": "<p>As pointed out before, the methods for extracting information from the biopsy images are important. Currently I'm doing some \"simple\"/straight forward tiling (similar to <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87\">this</a> and <a href=\"https://www.kaggle.com/iafoss/panda-concat-tile-pooling-starter-0-79-lb\">this</a>). Gets me to 0.89 LB with a single EfficientNetB0/B1 (using level 1 resolution images). I've also experimented with some more complex tiling, which got me to 0.86 LB (using 960x960 'big images' in comparison with 1536x1536 'big images' of the 0.89 LB submission). I've shared a variant of the tiling method of the 0.86 LB implementation <a href=\"https://www.kaggle.com/akensert/panda-optimized-tiling-tf-data-dataset\">here</a>, to stimulate the discussion a bit :-). Feel free to share me <em>all of your secrets</em> on how to extract information from the biopsy images.</p>",
      "rawMarkdown": "As pointed out before, the methods for extracting information from the biopsy images are important. Currently I'm doing some \"simple\"/straight forward tiling (similar to [this](https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87) and [this](https://www.kaggle.com/iafoss/panda-concat-tile-pooling-starter-0-79-lb)). Gets me to 0.89 LB with a single EfficientNetB0/B1 (using level 1 resolution images). I've also experimented with some more complex tiling, which got me to 0.86 LB (using 960x960 'big images' in comparison with 1536x1536 'big images' of the 0.89 LB submission). I've shared a variant of the tiling method of the 0.86 LB implementation [here](https://www.kaggle.com/akensert/panda-optimized-tiling-tf-data-dataset), to stimulate the discussion a bit :-). Feel free to share me *all of your secrets* on how to extract information from the biopsy images.",
      "votes": 28
    },
    {
      "id": 914994,
      "postDate": "2020-07-04T12:08:37.747Z",
      "content": "<p>I implement a method to filter some tiles which are polluted by green/blue(the color observed by my eyes) ink, and random pick some images, find the result is better than just sort by pixel-sum.\nMy model is runing, if I can boost &gt;= 0.01, I will hint about the filter method here😄 \n*<em>UPDATE:</em>*The model is not so good as what I expect in first 10 epochs... I show the picture below is the tiles after my filter method, it surely filter some polluted tiles, but the variety of tiles decline... original argsort means <a href=\"https://www.kaggle.com/iafoss/panda-16x128x128-tiles\">iafoss's method</a>\nThe image-id from top to bottom is \n'4a3e6e77b42a7e8f8b2dec472667bdbe',\n'51ea992db967a0b925588ee2eee322ab',\n'42482ed25f9001ae44f6148432da91d7',\n'f114a15f4c02900ebed9f638b68f42cb',\n'22c2e58ea58b90066e98d86bfb8a0baf',</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fdc8e06ded7852b66b596cbf210d9d52d%2Ffilter_pollution.png?generation=1593913045180801&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "I implement a method to filter some tiles which are polluted by green/blue(the color observed by my eyes) ink, and random pick some images, find the result is better than just sort by pixel-sum.\nMy model is runing, if I can boost &gt;= 0.01, I will hint about the filter method here😄 \n**UPDATE:**The model is not so good as what I expect in first 10 epochs... I show the picture below is the tiles after my filter method, it surely filter some polluted tiles, but the variety of tiles decline... original argsort means [iafoss's method](https://www.kaggle.com/iafoss/panda-16x128x128-tiles)\nThe image-id from top to bottom is \n'4a3e6e77b42a7e8f8b2dec472667bdbe',\n'51ea992db967a0b925588ee2eee322ab',\n'42482ed25f9001ae44f6148432da91d7',\n'f114a15f4c02900ebed9f638b68f42cb',\n'22c2e58ea58b90066e98d86bfb8a0baf',\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fdc8e06ded7852b66b596cbf210d9d52d%2Ffilter_pollution.png?generation=1593913045180801&amp;alt=media)\n",
      "votes": 3,
      "replies": [
        {
          "id": 1527307,
          "postDate": "2021-09-28T17:00:51.783Z",
          "content": "<p>I also implement this method but I notice that is not 100% of the biopsy. So how can I get the representative tiles for the different categories? The difference is that I'm trying to categorize the gleason score instead of the ISUP grade</p>",
          "rawMarkdown": "I also implement this method but I notice that is not 100% of the biopsy. So how can I get the representative tiles for the different categories? The difference is that I'm trying to categorize the gleason score instead of the ISUP grade"
        }
      ]
    },
    {
      "id": 894373,
      "postDate": "2020-06-20T11:28:47.110Z",
      "content": "<p>I use a NMS-type approach for selecting tiles. It gives a bit of an improvement over the simple approach, but nothing ground breaking. Probably in the order of 0.005 improvement on CV/LB.</p>",
      "rawMarkdown": "I use a NMS-type approach for selecting tiles. It gives a bit of an improvement over the simple approach, but nothing ground breaking. Probably in the order of 0.005 improvement on CV/LB.",
      "votes": 4,
      "replies": [
        {
          "id": 894387,
          "postDate": "2020-06-20T11:43:22.390Z",
          "content": "<p>I think ~0.005 is a hurge improvement. And the NMS you mentioned is refer to Non Maximum Suppression? Thanks in advance.</p>",
          "rawMarkdown": "I think ~0.005 is a hurge improvement. And the NMS you mentioned is refer to Non Maximum Suppression? Thanks in advance."
        },
        {
          "id": 894392,
          "postDate": "2020-06-20T11:49:29.977Z",
          "content": "<p>Yep, non-maximum suppression</p>",
          "rawMarkdown": "Yep, non-maximum suppression",
          "votes": 1
        },
        {
          "id": 894395,
          "postDate": "2020-06-20T11:51:01.903Z",
          "content": "<p>OK, and thanks for your fast reply. :D</p>",
          "rawMarkdown": "OK, and thanks for your fast reply. :D",
          "votes": 1
        },
        {
          "id": 899033,
          "postDate": "2020-06-23T22:58:21.587Z",
          "content": "<p>Anyone care to elaborate on how NMS works this competition?</p>",
          "rawMarkdown": "Anyone care to elaborate on how NMS works this competition?",
          "votes": 2
        },
        {
          "id": 899967,
          "postDate": "2020-06-24T14:52:06.950Z",
          "content": "<p>Think of your proposal boxes as tiles and the information in those tiles as scores...</p>",
          "rawMarkdown": "Think of your proposal boxes as tiles and the information in those tiles as scores...",
          "votes": 1
        },
        {
          "id": 910543,
          "postDate": "2020-07-01T07:48:37.917Z",
          "content": "<p>How to calculate the information score of a tile? </p>",
          "rawMarkdown": "How to calculate the information score of a tile? "
        },
        {
          "id": 910559,
          "postDate": "2020-07-01T08:06:36.660Z",
          "content": "<p>In the simplest case it's just the level of darkness of the tile. You could be a bit more intelligent about it, (maybe something useful <a href=\"https://developer.ibm.com/technologies/data-science/articles/an-automatic-method-to-identify-tissues-from-big-whole-slide-images-pt1/\">here</a>), but I'm not sure if there is that much value in the additional complexity.</p>",
          "rawMarkdown": "In the simplest case it's just the level of darkness of the tile. You could be a bit more intelligent about it, (maybe something useful [here](https://developer.ibm.com/technologies/data-science/articles/an-automatic-method-to-identify-tissues-from-big-whole-slide-images-pt1/)), but I'm not sure if there is that much value in the additional complexity.",
          "votes": 2
        }
      ]
    },
    {
      "id": 892458,
      "postDate": "2020-06-18T22:36:18.780Z",
      "content": "<p>A quick question...\nYou got 0.86 with 36 patches from this method?</p>",
      "rawMarkdown": "A quick question...\nYou got 0.86 with 36 patches from this method?",
      "votes": 1,
      "replies": [
        {
          "id": 892798,
          "postDate": "2020-06-19T06:59:31.593Z",
          "content": "<p>Yes 160 patch size, 6 x 6. But in the implementation that got 0.86, I did not use any <code>_excess_coords_filtering()</code> I just randomly shuffled all coords that were obtained for each image (and took the first 36 from that array/list). Further, I also used heavy augmentation on the big image. </p>",
          "rawMarkdown": "Yes 160 patch size, 6 x 6. But in the implementation that got 0.86, I did not use any `_excess_coords_filtering()` I just randomly shuffled all coords that were obtained for each image (and took the first 36 from that array/list). Further, I also used heavy augmentation on the big image. "
        }
      ]
    },
    {
      "id": 893744,
      "postDate": "2020-06-19T21:08:56.890Z",
      "content": "<p>I wonder if your advanced tiling method is not skipping too much tissue. Are you using the same selection in both cases  ? \nI think the task and discussion needs to be divided in two subtask:\n* The tiling. Making the list of patches.\n=&gt; Simple method just uses a simple grid.\n* The selection. Which ones to send to the model.\n=&gt; Simple method finds the darker ones on average.</p>",
      "rawMarkdown": "I wonder if your advanced tiling method is not skipping too much tissue. Are you using the same selection in both cases  ? \nI think the task and discussion needs to be divided in two subtask:\n* The tiling. Making the list of patches.\n=&gt; Simple method just uses a simple grid.\n* The selection. Which ones to send to the model.\n=&gt; Simple method finds the darker ones on average.\n\n",
      "votes": 2,
      "replies": [
        {
          "id": 893779,
          "postDate": "2020-06-19T22:03:27.227Z",
          "content": "<p>To be honest from the notebook it looks like it's getting pretty much all the tissue. I thought the problem was that the tiles are too small. Imagine having tiny 10x10 tiles and getting all the tissue, the model would likely perform pretty bad because you'd lose too much spatial information. You would get all the tissue but would be destroying all the patterns by breaking it into \"meaningless\" tiles</p>",
          "rawMarkdown": "To be honest from the notebook it looks like it's getting pretty much all the tissue. I thought the problem was that the tiles are too small. Imagine having tiny 10x10 tiles and getting all the tissue, the model would likely perform pretty bad because you'd lose too much spatial information. You would get all the tissue but would be destroying all the patterns by breaking it into \"meaningless\" tiles"
        },
        {
          "id": 893794,
          "postDate": "2020-06-19T22:50:56.920Z",
          "content": "<p>Then just increase the patch size. \nLike as 128x128 for Level 2, Then 512x512 for Level 1. Because Level 1 image is 4 times image from Level 2......</p>",
          "rawMarkdown": "Then just increase the patch size. \nLike as 128x128 for Level 2, Then 512x512 for Level 1. Because Level 1 image is 4 times image from Level 2......",
          "votes": 1
        },
        {
          "id": 893800,
          "postDate": "2020-06-19T23:32:26.633Z",
          "content": "<p>If you generate 16 tiles (as for level 2) and each one is 512x512, the total image will be 2048x2048. You'd run out of memory very quickly</p>",
          "rawMarkdown": "If you generate 16 tiles (as for level 2) and each one is 512x512, the total image will be 2048x2048. You'd run out of memory very quickly"
        },
        {
          "id": 893807,
          "postDate": "2020-06-20T00:06:31.260Z",
          "content": "<p>That is the issue. I don't even have local GPU to train 512x512.\nAnd kaggle have limited resources...\nSo I am trying to set this up in TPU by creating tfrecords of 2048x2048.\nSo we wont have memory issues.</p>",
          "rawMarkdown": "That is the issue. I don't even have local GPU to train 512x512.\nAnd kaggle have limited resources...\nSo I am trying to set this up in TPU by creating tfrecords of 2048x2048.\nSo we wont have memory issues."
        },
        {
          "id": 894322,
          "postDate": "2020-06-20T10:36:14.450Z",
          "content": "<p>Good points, thanks. </p>\n\n<p>Yes this problem could indeed be divided into those two categories. The current kernel is computing the tiles relatively OK I would say, but the selection of the 36 tiles that would go in to the neural net are likely far from optimal. I also recommend changing the parameters a bit and visualize it for yourselves, perhaps even change the code a bit if you have too much free-time ;-). From my experience visualizing this, the algorithm works well when the tissue is big enough and aligned nicely (not L-shaped etc.). Further, one has to be careful with the small/tiny tissues. So try to look at both small, medium and large sized tissues when visualizing the output/results, likewise for your own algorithms that you use.</p>",
          "rawMarkdown": "Good points, thanks. \n\nYes this problem could indeed be divided into those two categories. The current kernel is computing the tiles relatively OK I would say, but the selection of the 36 tiles that would go in to the neural net are likely far from optimal. I also recommend changing the parameters a bit and visualize it for yourselves, perhaps even change the code a bit if you have too much free-time ;-). From my experience visualizing this, the algorithm works well when the tissue is big enough and aligned nicely (not L-shaped etc.). Further, one has to be careful with the small/tiny tissues. So try to look at both small, medium and large sized tissues when visualizing the output/results, likewise for your own algorithms that you use."
        },
        {
          "id": 897088,
          "postDate": "2020-06-22T15:56:10.177Z",
          "content": "<p><a href=\"/arroqc\">@arroqc</a> you mentionned a few days ago a new approach to tilling on the other thread, but isn't \" Simple method finds the darker ones on average.\" what Lafoss approach has been doing since the beginning ?</p>\n\n<p>On my part, I've been working with selecting the tiles based not on the slide, but on the mask. It didn't work well, and there is also the problem that for inference you need to come up with a segmentation model ^^</p>\n\n<p>I've also tried to \"center\" the tiles (as very often the long thin line is split into two half empty tiles). My code produces the indended effect (I do get better tiles) but no improvement on CV -_-</p>",
          "rawMarkdown": "@arroqc you mentionned a few days ago a new approach to tilling on the other thread, but isn't \" Simple method finds the darker ones on average.\" what Lafoss approach has been doing since the beginning ?\n\nOn my part, I've been working with selecting the tiles based not on the slide, but on the mask. It didn't work well, and there is also the problem that for inference you need to come up with a segmentation model ^^\n\nI've also tried to \"center\" the tiles (as very often the long thin line is split into two half empty tiles). My code produces the indended effect (I do get better tiles) but no improvement on CV -_-"
        },
        {
          "id": 897488,
          "postDate": "2020-06-22T22:22:45.743Z",
          "content": "<p><a href=\"/bdubreu\">@bdubreu</a>  What I use is model based but while the initial results were really good for low tile counts (9 and 16) it doesn't give me much benefit for high tile counts (despite better CV). At least I can try faster with these smaller samples... But tbh I'm getting frustrated by the bad correlation between cv and test.</p>",
          "rawMarkdown": "@bdubreu  What I use is model based but while the initial results were really good for low tile counts (9 and 16) it doesn't give me much benefit for high tile counts (despite better CV). At least I can try faster with these smaller samples... But tbh I'm getting frustrated by the bad correlation between cv and test."
        },
        {
          "id": 898001,
          "postDate": "2020-06-23T08:10:28.033Z",
          "content": "<p>There's something else. Slides that have a high isup grade can contain connective tissue or healthy tissue and in the contrary begnin slides can contain cancer tissues.  So we should focus on extracting tiles with cells and glands that are representative to isup grade.\nProbably when selecting more than 16 tiles with your method then you include some non-necessary tissues which skew your model. It' just a supposition, what are your thoughts about this <a href=\"/arroqc\">@arroqc</a> ?</p>",
          "rawMarkdown": "There's something else. Slides that have a high isup grade can contain connective tissue or healthy tissue and in the contrary begnin slides can contain cancer tissues.  So we should focus on extracting tiles with cells and glands that are representative to isup grade.\nProbably when selecting more than 16 tiles with your method then you include some non-necessary tissues which skew your model. It' just a supposition, what are your thoughts about this @arroqc ?"
        },
        {
          "id": 898526,
          "postDate": "2020-06-23T15:13:09.810Z",
          "content": "<p>It's indeed a possibility and my model is skewed by that kind of noise. I guess I can test further if the small changes I also added are actually decreasing performance. What I find really weird is that everything is much better with lower loss and higher kappa but then the performance really degrade on LB. I don't see how there could be data leakage too :/. Anyway I prefer to keep working with 16 since I can at least fit batches of 9 in my gtx 1080.</p>",
          "rawMarkdown": "It's indeed a possibility and my model is skewed by that kind of noise. I guess I can test further if the small changes I also added are actually decreasing performance. What I find really weird is that everything is much better with lower loss and higher kappa but then the performance really degrade on LB. I don't see how there could be data leakage too :/. Anyway I prefer to keep working with 16 since I can at least fit batches of 9 in my gtx 1080.",
          "votes": 1
        },
        {
          "id": 898925,
          "postDate": "2020-06-23T20:55:35.093Z",
          "content": "<p>16 of size 256x256 or 512x512?</p>",
          "rawMarkdown": "16 of size 256x256 or 512x512?"
        },
        {
          "id": 898996,
          "postDate": "2020-06-23T21:59:27.217Z",
          "content": "<p>256</p>",
          "rawMarkdown": "256"
        }
      ]
    },
    {
      "id": 892496,
      "postDate": "2020-06-18T23:41:54.147Z",
      "content": "<p>Did you try to make 1536x1536 images with the more complex method?</p>",
      "rawMarkdown": "Did you try to make 1536x1536 images with the more complex method?",
      "votes": 2,
      "replies": [
        {
          "id": 892791,
          "postDate": "2020-06-19T06:55:03.960Z",
          "content": "<p>Good question. I actually tried it overnight, and I didn't reach the same score as the simple method. So I would say that the simple method works better, somehow. Perhaps the complex method looks good visually (to some extent), but the performance is a bit worse. But then there might be some adjustments that could be made to improve the the complex method.</p>",
          "rawMarkdown": "Good question. I actually tried it overnight, and I didn't reach the same score as the simple method. So I would say that the simple method works better, somehow. Perhaps the complex method looks good visually (to some extent), but the performance is a bit worse. But then there might be some adjustments that could be made to improve the the complex method.",
          "votes": 1
        },
        {
          "id": 893232,
          "postDate": "2020-06-19T13:26:58.437Z",
          "content": "<p>Did you keep same patch size as in simple tiling and this method?</p>",
          "rawMarkdown": "Did you keep same patch size as in simple tiling and this method?"
        }
      ]
    },
    {
      "id": 923008,
      "postDate": "2020-07-10T13:30:09.460Z",
      "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, \nAfter implementing everything you suggested and some other ideas, when i finally got to training, <a href=\"https://www.kaggle.com/c/prostate-cancer-grade-assessment/discussion/165645\">this</a> happened. \nCould you please look into this? \nThanks!! </p>",
      "rawMarkdown": "Hey @akensert, \nAfter implementing everything you suggested and some other ideas, when i finally got to training, [this](https://www.kaggle.com/c/prostate-cancer-grade-assessment/discussion/165645) happened. \nCould you please look into this? \nThanks!! \n"
    },
    {
      "id": 919982,
      "postDate": "2020-07-08T08:29:44.753Z",
      "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, really nice work man. I was trying to experiment with your kernel and what i notice is that it takes way too much time for a single epoch on Kaggle GPU. I wanted to ask, did you use your private rig or kaggle kernel itself. Also, when i tried using TPU with your tf.data.Dataset (after incorporating the targets), TPUs don't really work with py_function. BTW, how much time did it take for you to train your model?. Any ideas or help would be much appreciated.</p>",
      "rawMarkdown": "Hey @akensert, really nice work man. I was trying to experiment with your kernel and what i notice is that it takes way too much time for a single epoch on Kaggle GPU. I wanted to ask, did you use your private rig or kaggle kernel itself. Also, when i tried using TPU with your tf.data.Dataset (after incorporating the targets), TPUs don't really work with py_function. BTW, how much time did it take for you to train your model?. Any ideas or help would be much appreciated.",
      "replies": [
        {
          "id": 920061,
          "postDate": "2020-07-08T09:30:20.537Z",
          "content": "<p>Hello <a href=\"/nikhilbartwal001\">@nikhilbartwal001</a>. Yes, you would need to precompute the coordinates if you're running in the Kaggle kernels. (With &gt;=6 CPU cores (12 threads), it would be possible to compute the coordinates on the fly, but still not ideal.). I suggest you precompute the coordinates for each example, add the coordinates (array of arrays) to a column in your pandas dataframe, and then you can input this together with the image + label (so your input would be, per example, <code>(image, label, coords)</code>. I think that will speed it up the input pipeline significantly (especially when working the Kaggle kernels).</p>\n\n<p>About TPU: Yes you are right, it doesn't seem to work with <code>tf.py_function</code>. You need to avoid that :-(</p>\n\n<p>I guess for me, locally, it would take around 10-30 minutes per epoch using the same pipeline as the public kernel. And it depends on the size of the input (I usually vary it between 1024x1024 and 1536x1536). </p>\n\n<p>Side note: Currently I use the simple approach for computing tiles/patches. Similar to the other public kernels. I haven't had much time/energy to continue experiment with the one I published.</p>",
          "rawMarkdown": "Hello @nikhilbartwal001. Yes, you would need to precompute the coordinates if you're running in the Kaggle kernels. (With &gt;=6 CPU cores (12 threads), it would be possible to compute the coordinates on the fly, but still not ideal.). I suggest you precompute the coordinates for each example, add the coordinates (array of arrays) to a column in your pandas dataframe, and then you can input this together with the image + label (so your input would be, per example, `(image, label, coords)`. I think that will speed it up the input pipeline significantly (especially when working the Kaggle kernels).\n\nAbout TPU: Yes you are right, it doesn't seem to work with `tf.py_function`. You need to avoid that :-(\n\nI guess for me, locally, it would take around 10-30 minutes per epoch using the same pipeline as the public kernel. And it depends on the size of the input (I usually vary it between 1024x1024 and 1536x1536). \n\nSide note: Currently I use the simple approach for computing tiles/patches. Similar to the other public kernels. I haven't had much time/energy to continue experiment with the one I published.\n\n",
          "votes": 1
        },
        {
          "id": 920069,
          "postDate": "2020-07-08T09:48:40.603Z",
          "content": "<p>Thanks for such a quick and insightful reply <a href=\"/akensert\">@akensert</a>. I had some doubts which I thought you might help me clear.\nCan you tell me more about the 'simple' approach that you are talking about as I'm new to image processing and yours was one of the most detailed kernels written in tensorflow.\nAlso have you tried using TPU (with/without tfrec format) in this competition? \nAnother thing that I'm confused about is the choice of loss function and the evaluation metric as people seem to be using classification , regression, ordinal regression etc. \nIt would be really help if you could help me out.\nThanks !!</p>",
          "rawMarkdown": "Thanks for such a quick and insightful reply @akensert. I had some doubts which I thought you might help me clear.\nCan you tell me more about the 'simple' approach that you are talking about as I'm new to image processing and yours was one of the most detailed kernels written in tensorflow.\nAlso have you tried using TPU (with/without tfrec format) in this competition? \nAnother thing that I'm confused about is the choice of loss function and the evaluation metric as people seem to be using classification , regression, ordinal regression etc. \nIt would be really help if you could help me out.\nThanks !!",
          "votes": 1
        },
        {
          "id": 920249,
          "postDate": "2020-07-08T13:05:50.640Z",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> No problem :-)</p>\n\n<p>About the simple approach, <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87\">see here</a>, although it's in PyTorch. I rewrote it for TensorFlow (with some small modifications). </p>\n\n<p>I haven't used TPU yet, however I think there should be some nice TPU + TF2 kernels around to get one started. </p>\n\n<p>Loss function: I suggest either mean squared error (so you would keep your target as it is in the csv file, or ordinal regression (target = 3 would be [1, 1, 1, 0, 0] etc.). Both works equally well for me. Both makes sense because the target data have some order.</p>",
          "rawMarkdown": "@nikhilbartwal001 No problem :-)\n\nAbout the simple approach, [see here](https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87), although it's in PyTorch. I rewrote it for TensorFlow (with some small modifications). \n\nI haven't used TPU yet, however I think there should be some nice TPU + TF2 kernels around to get one started. \n\nLoss function: I suggest either mean squared error (so you would keep your target as it is in the csv file, or ordinal regression (target = 3 would be [1, 1, 1, 0, 0] etc.). Both works equally well for me. Both makes sense because the target data have some order.",
          "votes": 1
        },
        {
          "id": 920275,
          "postDate": "2020-07-08T13:20:14.223Z",
          "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, just one more thing that i had, I've read about QWK for the first time in this competition.\nThere is a QWK metric in sklearn as well as in tf addons, do you think it would work or would I need to write a custom metric for the sane? I don't quite get how to optimize qwk during training.</p>\n\n<p>BTW, you earlier suggested pre computing the coordinates, I was thinking what if I create all the patched images before hand and store it in the output directory and then train the model in a different kernel by just reading and converting the patched image to numpy array and feeding it to the input pipeline. What are your thoughts?\nThanks for the help mate !</p>",
          "rawMarkdown": "Hey @akensert, just one more thing that i had, I've read about QWK for the first time in this competition.\nThere is a QWK metric in sklearn as well as in tf addons, do you think it would work or would I need to write a custom metric for the sane? I don't quite get how to optimize qwk during training.\n\nBTW, you earlier suggested pre computing the coordinates, I was thinking what if I create all the patched images before hand and store it in the output directory and then train the model in a different kernel by just reading and converting the patched image to numpy array and feeding it to the input pipeline. What are your thoughts?\nThanks for the help mate !"
        },
        {
          "id": 921684,
          "postDate": "2020-07-09T13:29:03.873Z",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> Your loss function will be MSE or BCE (or CCE). So you will not optimize for QWK directly (although you could try, but I figure it might be difficult), but rather for MSE/BCE/CCE.</p>\n\n<p>Sure you could do that (even faster then), but then you wouldn't have the patch-level augmentation (the random rotate/flip/transposing/(selection) of each patch before being concatenated to the 'big image'), which could be nice to have. Although you will  have the 'image-level' augmentation :-)</p>\n\n<p>Good luck!</p>",
          "rawMarkdown": "@nikhilbartwal001 Your loss function will be MSE or BCE (or CCE). So you will not optimize for QWK directly (although you could try, but I figure it might be difficult), but rather for MSE/BCE/CCE.\n\nSure you could do that (even faster then), but then you wouldn't have the patch-level augmentation (the random rotate/flip/transposing/(selection) of each patch before being concatenated to the 'big image'), which could be nice to have. Although you will  have the 'image-level' augmentation :-)\n\nGood luck!",
          "votes": 1
        },
        {
          "id": 921728,
          "postDate": "2020-07-09T14:00:48.790Z",
          "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, thanks for the help with the loss function. </p>\n\n<p>Although i didn't understand what you meant that i won't be able to have patch level augs. Isn't it possible to to do the patch level augs before storing the patched images? I'm currently not that deep into image processing so idk about that. </p>",
          "rawMarkdown": "Hey @akensert, thanks for the help with the loss function. \n\nAlthough i didn't understand what you meant that i won't be able to have patch level augs. Isn't it possible to to do the patch level augs before storing the patched images? I'm currently not that deep into image processing so idk about that. "
        },
        {
          "id": 921829,
          "postDate": "2020-07-09T15:31:48.380Z",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> Sure, you could do that, but then your dataset which you're saving to disk will be huge :-) let's say that you wanna train for at least 10 epochs, then \"ideally\" you would want to have 10 versions of each instance (or 'big image'). So over 100k images saved to disk. </p>",
          "rawMarkdown": "@nikhilbartwal001 Sure, you could do that, but then your dataset which you're saving to disk will be huge :-) let's say that you wanna train for at least 10 epochs, then \"ideally\" you would want to have 10 versions of each instance (or 'big image'). So over 100k images saved to disk. "
        },
        {
          "id": 922490,
          "postDate": "2020-07-10T06:12:52.833Z",
          "content": "<p>Woah I definitely wouldn't want that:(\nI guess I'll try experimenting with the precomputed coords only.\nThanks for the help dude!!</p>",
          "rawMarkdown": "Woah I definitely wouldn't want that:(\nI guess I'll try experimenting with the precomputed coords only.\nThanks for the help dude!!"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 914994,
      "author_name": "Shiyuan Zeng",
      "author_url": "",
      "post_date": "2020-07-04T12:08:37.747000",
      "content": "<p>I implement a method to filter some tiles which are polluted by green/blue(the color observed by my eyes) ink, and random pick some images, find the result is better than just sort by pixel-sum.\nMy model is runing, if I can boost &gt;= 0.01, I will hint about the filter method here😄 \n*<em>UPDATE:</em>*The model is not so good as what I expect in first 10 epochs... I show the picture below is the tiles after my filter method, it surely filter some polluted tiles, but the variety of tiles decline... original argsort means <a href=\"https://www.kaggle.com/iafoss/panda-16x128x128-tiles\">iafoss's method</a>\nThe image-id from top to bottom is \n'4a3e6e77b42a7e8f8b2dec472667bdbe',\n'51ea992db967a0b925588ee2eee322ab',\n'42482ed25f9001ae44f6148432da91d7',\n'f114a15f4c02900ebed9f638b68f42cb',\n'22c2e58ea58b90066e98d86bfb8a0baf',</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fdc8e06ded7852b66b596cbf210d9d52d%2Ffilter_pollution.png?generation=1593913045180801&amp;alt=media\" alt=\"\"></p>",
      "votes": 3,
      "replies": [
        {
          "id": 1527307,
          "author_name": "Martin Cervantes",
          "author_url": "",
          "post_date": "2021-09-28T17:00:51.783000",
          "content": "<p>I also implement this method but I notice that is not 100% of the biopsy. So how can I get the representative tiles for the different categories? The difference is that I'm trying to categorize the gleason score instead of the ISUP grade</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 894373,
      "author_name": "fergusoci",
      "author_url": "",
      "post_date": "2020-06-20T11:28:47.110000",
      "content": "<p>I use a NMS-type approach for selecting tiles. It gives a bit of an improvement over the simple approach, but nothing ground breaking. Probably in the order of 0.005 improvement on CV/LB.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 894387,
          "author_name": "Shiyuan Zeng",
          "author_url": "",
          "post_date": "2020-06-20T11:43:22.390000",
          "content": "<p>I think ~0.005 is a hurge improvement. And the NMS you mentioned is refer to Non Maximum Suppression? Thanks in advance.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 894392,
          "author_name": "fergusoci",
          "author_url": "",
          "post_date": "2020-06-20T11:49:29.977000",
          "content": "<p>Yep, non-maximum suppression</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 894395,
          "author_name": "Shiyuan Zeng",
          "author_url": "",
          "post_date": "2020-06-20T11:51:01.903000",
          "content": "<p>OK, and thanks for your fast reply. :D</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 899033,
          "author_name": "Shujun",
          "author_url": "",
          "post_date": "2020-06-23T22:58:21.587000",
          "content": "<p>Anyone care to elaborate on how NMS works this competition?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 899967,
          "author_name": "fergusoci",
          "author_url": "",
          "post_date": "2020-06-24T14:52:06.950000",
          "content": "<p>Think of your proposal boxes as tiles and the information in those tiles as scores...</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 910543,
          "author_name": "Francis Chen",
          "author_url": "",
          "post_date": "2020-07-01T07:48:37.917000",
          "content": "<p>How to calculate the information score of a tile? </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 910559,
          "author_name": "fergusoci",
          "author_url": "",
          "post_date": "2020-07-01T08:06:36.660000",
          "content": "<p>In the simplest case it's just the level of darkness of the tile. You could be a bit more intelligent about it, (maybe something useful <a href=\"https://developer.ibm.com/technologies/data-science/articles/an-automatic-method-to-identify-tissues-from-big-whole-slide-images-pt1/\">here</a>), but I'm not sure if there is that much value in the additional complexity.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 892458,
      "author_name": "Salman",
      "author_url": "",
      "post_date": "2020-06-18T22:36:18.780000",
      "content": "<p>A quick question...\nYou got 0.86 with 36 patches from this method?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 892798,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-06-19T06:59:31.593000",
          "content": "<p>Yes 160 patch size, 6 x 6. But in the implementation that got 0.86, I did not use any <code>_excess_coords_filtering()</code> I just randomly shuffled all coords that were obtained for each image (and took the first 36 from that array/list). Further, I also used heavy augmentation on the big image. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 893744,
      "author_name": "Arnaud Roussel",
      "author_url": "",
      "post_date": "2020-06-19T21:08:56.890000",
      "content": "<p>I wonder if your advanced tiling method is not skipping too much tissue. Are you using the same selection in both cases  ? \nI think the task and discussion needs to be divided in two subtask:\n* The tiling. Making the list of patches.\n=&gt; Simple method just uses a simple grid.\n* The selection. Which ones to send to the model.\n=&gt; Simple method finds the darker ones on average.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 893779,
          "author_name": "Pasquale",
          "author_url": "",
          "post_date": "2020-06-19T22:03:27.227000",
          "content": "<p>To be honest from the notebook it looks like it's getting pretty much all the tissue. I thought the problem was that the tiles are too small. Imagine having tiny 10x10 tiles and getting all the tissue, the model would likely perform pretty bad because you'd lose too much spatial information. You would get all the tissue but would be destroying all the patterns by breaking it into \"meaningless\" tiles</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 893794,
          "author_name": "Salman",
          "author_url": "",
          "post_date": "2020-06-19T22:50:56.920000",
          "content": "<p>Then just increase the patch size. \nLike as 128x128 for Level 2, Then 512x512 for Level 1. Because Level 1 image is 4 times image from Level 2......</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 893800,
          "author_name": "Pasquale",
          "author_url": "",
          "post_date": "2020-06-19T23:32:26.633000",
          "content": "<p>If you generate 16 tiles (as for level 2) and each one is 512x512, the total image will be 2048x2048. You'd run out of memory very quickly</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 893807,
          "author_name": "Salman",
          "author_url": "",
          "post_date": "2020-06-20T00:06:31.260000",
          "content": "<p>That is the issue. I don't even have local GPU to train 512x512.\nAnd kaggle have limited resources...\nSo I am trying to set this up in TPU by creating tfrecords of 2048x2048.\nSo we wont have memory issues.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 894322,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-06-20T10:36:14.450000",
          "content": "<p>Good points, thanks. </p>\n\n<p>Yes this problem could indeed be divided into those two categories. The current kernel is computing the tiles relatively OK I would say, but the selection of the 36 tiles that would go in to the neural net are likely far from optimal. I also recommend changing the parameters a bit and visualize it for yourselves, perhaps even change the code a bit if you have too much free-time ;-). From my experience visualizing this, the algorithm works well when the tissue is big enough and aligned nicely (not L-shaped etc.). Further, one has to be careful with the small/tiny tissues. So try to look at both small, medium and large sized tissues when visualizing the output/results, likewise for your own algorithms that you use.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 897088,
          "author_name": "Benjamin Dubreu",
          "author_url": "",
          "post_date": "2020-06-22T15:56:10.177000",
          "content": "<p><a href=\"/arroqc\">@arroqc</a> you mentionned a few days ago a new approach to tilling on the other thread, but isn't \" Simple method finds the darker ones on average.\" what Lafoss approach has been doing since the beginning ?</p>\n\n<p>On my part, I've been working with selecting the tiles based not on the slide, but on the mask. It didn't work well, and there is also the problem that for inference you need to come up with a segmentation model ^^</p>\n\n<p>I've also tried to \"center\" the tiles (as very often the long thin line is split into two half empty tiles). My code produces the indended effect (I do get better tiles) but no improvement on CV -_-</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 897488,
          "author_name": "Arnaud Roussel",
          "author_url": "",
          "post_date": "2020-06-22T22:22:45.743000",
          "content": "<p><a href=\"/bdubreu\">@bdubreu</a>  What I use is model based but while the initial results were really good for low tile counts (9 and 16) it doesn't give me much benefit for high tile counts (despite better CV). At least I can try faster with these smaller samples... But tbh I'm getting frustrated by the bad correlation between cv and test.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 898001,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-06-23T08:10:28.033000",
          "content": "<p>There's something else. Slides that have a high isup grade can contain connective tissue or healthy tissue and in the contrary begnin slides can contain cancer tissues.  So we should focus on extracting tiles with cells and glands that are representative to isup grade.\nProbably when selecting more than 16 tiles with your method then you include some non-necessary tissues which skew your model. It' just a supposition, what are your thoughts about this <a href=\"/arroqc\">@arroqc</a> ?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 898526,
          "author_name": "Arnaud Roussel",
          "author_url": "",
          "post_date": "2020-06-23T15:13:09.810000",
          "content": "<p>It's indeed a possibility and my model is skewed by that kind of noise. I guess I can test further if the small changes I also added are actually decreasing performance. What I find really weird is that everything is much better with lower loss and higher kappa but then the performance really degrade on LB. I don't see how there could be data leakage too :/. Anyway I prefer to keep working with 16 since I can at least fit batches of 9 in my gtx 1080.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 898925,
          "author_name": "Salman",
          "author_url": "",
          "post_date": "2020-06-23T20:55:35.093000",
          "content": "<p>16 of size 256x256 or 512x512?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 898996,
          "author_name": "Arnaud Roussel",
          "author_url": "",
          "post_date": "2020-06-23T21:59:27.217000",
          "content": "<p>256</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 892496,
      "author_name": "Pasquale",
      "author_url": "",
      "post_date": "2020-06-18T23:41:54.147000",
      "content": "<p>Did you try to make 1536x1536 images with the more complex method?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 892791,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-06-19T06:55:03.960000",
          "content": "<p>Good question. I actually tried it overnight, and I didn't reach the same score as the simple method. So I would say that the simple method works better, somehow. Perhaps the complex method looks good visually (to some extent), but the performance is a bit worse. But then there might be some adjustments that could be made to improve the the complex method.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 893232,
          "author_name": "Salman",
          "author_url": "",
          "post_date": "2020-06-19T13:26:58.437000",
          "content": "<p>Did you keep same patch size as in simple tiling and this method?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 923008,
      "author_name": "Nikhil Bartwal",
      "author_url": "",
      "post_date": "2020-07-10T13:30:09.460000",
      "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, \nAfter implementing everything you suggested and some other ideas, when i finally got to training, <a href=\"https://www.kaggle.com/c/prostate-cancer-grade-assessment/discussion/165645\">this</a> happened. \nCould you please look into this? \nThanks!! </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 919982,
      "author_name": "Nikhil Bartwal",
      "author_url": "",
      "post_date": "2020-07-08T08:29:44.753000",
      "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, really nice work man. I was trying to experiment with your kernel and what i notice is that it takes way too much time for a single epoch on Kaggle GPU. I wanted to ask, did you use your private rig or kaggle kernel itself. Also, when i tried using TPU with your tf.data.Dataset (after incorporating the targets), TPUs don't really work with py_function. BTW, how much time did it take for you to train your model?. Any ideas or help would be much appreciated.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 920061,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-07-08T09:30:20.537000",
          "content": "<p>Hello <a href=\"/nikhilbartwal001\">@nikhilbartwal001</a>. Yes, you would need to precompute the coordinates if you're running in the Kaggle kernels. (With &gt;=6 CPU cores (12 threads), it would be possible to compute the coordinates on the fly, but still not ideal.). I suggest you precompute the coordinates for each example, add the coordinates (array of arrays) to a column in your pandas dataframe, and then you can input this together with the image + label (so your input would be, per example, <code>(image, label, coords)</code>. I think that will speed it up the input pipeline significantly (especially when working the Kaggle kernels).</p>\n\n<p>About TPU: Yes you are right, it doesn't seem to work with <code>tf.py_function</code>. You need to avoid that :-(</p>\n\n<p>I guess for me, locally, it would take around 10-30 minutes per epoch using the same pipeline as the public kernel. And it depends on the size of the input (I usually vary it between 1024x1024 and 1536x1536). </p>\n\n<p>Side note: Currently I use the simple approach for computing tiles/patches. Similar to the other public kernels. I haven't had much time/energy to continue experiment with the one I published.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 920069,
          "author_name": "Nikhil Bartwal",
          "author_url": "",
          "post_date": "2020-07-08T09:48:40.603000",
          "content": "<p>Thanks for such a quick and insightful reply <a href=\"/akensert\">@akensert</a>. I had some doubts which I thought you might help me clear.\nCan you tell me more about the 'simple' approach that you are talking about as I'm new to image processing and yours was one of the most detailed kernels written in tensorflow.\nAlso have you tried using TPU (with/without tfrec format) in this competition? \nAnother thing that I'm confused about is the choice of loss function and the evaluation metric as people seem to be using classification , regression, ordinal regression etc. \nIt would be really help if you could help me out.\nThanks !!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 920249,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-07-08T13:05:50.640000",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> No problem :-)</p>\n\n<p>About the simple approach, <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87\">see here</a>, although it's in PyTorch. I rewrote it for TensorFlow (with some small modifications). </p>\n\n<p>I haven't used TPU yet, however I think there should be some nice TPU + TF2 kernels around to get one started. </p>\n\n<p>Loss function: I suggest either mean squared error (so you would keep your target as it is in the csv file, or ordinal regression (target = 3 would be [1, 1, 1, 0, 0] etc.). Both works equally well for me. Both makes sense because the target data have some order.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 920275,
          "author_name": "Nikhil Bartwal",
          "author_url": "",
          "post_date": "2020-07-08T13:20:14.223000",
          "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, just one more thing that i had, I've read about QWK for the first time in this competition.\nThere is a QWK metric in sklearn as well as in tf addons, do you think it would work or would I need to write a custom metric for the sane? I don't quite get how to optimize qwk during training.</p>\n\n<p>BTW, you earlier suggested pre computing the coordinates, I was thinking what if I create all the patched images before hand and store it in the output directory and then train the model in a different kernel by just reading and converting the patched image to numpy array and feeding it to the input pipeline. What are your thoughts?\nThanks for the help mate !</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 921684,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-07-09T13:29:03.873000",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> Your loss function will be MSE or BCE (or CCE). So you will not optimize for QWK directly (although you could try, but I figure it might be difficult), but rather for MSE/BCE/CCE.</p>\n\n<p>Sure you could do that (even faster then), but then you wouldn't have the patch-level augmentation (the random rotate/flip/transposing/(selection) of each patch before being concatenated to the 'big image'), which could be nice to have. Although you will  have the 'image-level' augmentation :-)</p>\n\n<p>Good luck!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 921728,
          "author_name": "Nikhil Bartwal",
          "author_url": "",
          "post_date": "2020-07-09T14:00:48.790000",
          "content": "<p>Hey <a href=\"/akensert\">@akensert</a>, thanks for the help with the loss function. </p>\n\n<p>Although i didn't understand what you meant that i won't be able to have patch level augs. Isn't it possible to to do the patch level augs before storing the patched images? I'm currently not that deep into image processing so idk about that. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 921829,
          "author_name": "Alex",
          "author_url": "",
          "post_date": "2020-07-09T15:31:48.380000",
          "content": "<p><a href=\"/nikhilbartwal001\">@nikhilbartwal001</a> Sure, you could do that, but then your dataset which you're saving to disk will be huge :-) let's say that you wanna train for at least 10 epochs, then \"ideally\" you would want to have 10 versions of each instance (or 'big image'). So over 100k images saved to disk. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 922490,
          "author_name": "Nikhil Bartwal",
          "author_url": "",
          "post_date": "2020-07-10T06:12:52.833000",
          "content": "<p>Woah I definitely wouldn't want that:(\nI guess I'll try experimenting with the precomputed coords only.\nThanks for the help dude!!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "892340": "As pointed out before, the methods for extracting information from the biopsy images are important. Currently I'm doing some \"simple\"/straight forward tiling (similar to [this](https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87) and [this](https://www.kaggle.com/iafoss/panda-concat-tile-pooling-starter-0-79-lb)). Gets me to 0.89 LB with a single EfficientNetB0/B1 (using level 1 resolution images). I've also experimented with some more complex tiling, which got me to 0.86 LB (using 960x960 'big images' in comparison with 1536x1536 'big images' of the 0.89 LB submission). I've shared a variant of the tiling method of the 0.86 LB implementation [here](https://www.kaggle.com/akensert/panda-optimized-tiling-tf-data-dataset), to stimulate the discussion a bit :-). Feel free to share me *all of your secrets* on how to extract information from the biopsy images.",
    "914994": "I implement a method to filter some tiles which are polluted by green/blue(the color observed by my eyes) ink, and random pick some images, find the result is better than just sort by pixel-sum.\nMy model is runing, if I can boost &gt;= 0.01, I will hint about the filter method here😄 \n**UPDATE:**The model is not so good as what I expect in first 10 epochs... I show the picture below is the tiles after my filter method, it surely filter some polluted tiles, but the variety of tiles decline... original argsort means [iafoss's method](https://www.kaggle.com/iafoss/panda-16x128x128-tiles)\nThe image-id from top to bottom is \n'4a3e6e77b42a7e8f8b2dec472667bdbe',\n'51ea992db967a0b925588ee2eee322ab',\n'42482ed25f9001ae44f6148432da91d7',\n'f114a15f4c02900ebed9f638b68f42cb',\n'22c2e58ea58b90066e98d86bfb8a0baf',\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fdc8e06ded7852b66b596cbf210d9d52d%2Ffilter_pollution.png?generation=1593913045180801&amp;alt=media)\n",
    "894373": "I use a NMS-type approach for selecting tiles. It gives a bit of an improvement over the simple approach, but nothing ground breaking. Probably in the order of 0.005 improvement on CV/LB.",
    "892458": "A quick question...\nYou got 0.86 with 36 patches from this method?",
    "893744": "I wonder if your advanced tiling method is not skipping too much tissue. Are you using the same selection in both cases  ? \nI think the task and discussion needs to be divided in two subtask:\n* The tiling. Making the list of patches.\n=&gt; Simple method just uses a simple grid.\n* The selection. Which ones to send to the model.\n=&gt; Simple method finds the darker ones on average.\n\n",
    "892496": "Did you try to make 1536x1536 images with the more complex method?",
    "923008": "Hey @akensert, \nAfter implementing everything you suggested and some other ideas, when i finally got to training, [this](https://www.kaggle.com/c/prostate-cancer-grade-assessment/discussion/165645) happened. \nCould you please look into this? \nThanks!! \n",
    "919982": "Hey @akensert, really nice work man. I was trying to experiment with your kernel and what i notice is that it takes way too much time for a single epoch on Kaggle GPU. I wanted to ask, did you use your private rig or kaggle kernel itself. Also, when i tried using TPU with your tf.data.Dataset (after incorporating the targets), TPUs don't really work with py_function. BTW, how much time did it take for you to train your model?. Any ideas or help would be much appreciated."
  }
}