{
  "id": 47686,
  "title": "[pytorch starter kit] -LB 0.311",
  "url": "/competitions/data-science-bowl-2018/discussion/47686",
  "author_name": "",
  "post_date": "2018-01-17T18:03:14.726268800Z",
  "votes": 106,
  "comment_count": 67,
  "views": 0,
  "content": "<p>As usual, my starter kit post .... stay tuned .....</p>\n\n<p>(to be updated)</p>\n\n<hr>\n\n<p>code download:  <a href=\"https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di\">https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di</a></p>\n\n<ul>\n<li><p>[version.0] Jan-21:  a basic Unet version. Predict mask and use connected component labelled. Able to achieve LB 0.311. (With train augmentation, fine-tunning etc, it can reach 0.325)</p></li>\n<li><p>[version.0a] ABORTED!:  Predict mask, boundary and centers facilitate labeling for instance segmentation  </p></li>\n<li><p>[version.0b] Feb-20:  Nuclei detection first, then crop and segment. Following 2-stage mask rcnn approach.</p></li>\n</ul>\n\n<p>...</p>\n\n<p>[version.x due] Feb-28: GAN for data generation,  LB score predictor</p>",
  "messages": [
    {
      "id": "270069",
      "postDate": "01/17/2018 18:03:14",
      "content": "<p>As usual, my starter kit post .... stay tuned .....</p>\n\n<p>(to be updated)</p>\n\n<hr>\n\n<p>code download:  <a href=\"https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di\">https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di</a></p>\n\n<ul>\n<li><p>[version.0] Jan-21:  a basic Unet version. Predict mask and use connected component labelled. Able to achieve LB 0.311. (With train augmentation, fine-tunning etc, it can reach 0.325)</p></li>\n<li><p>[version.0a] ABORTED!:  Predict mask, boundary and centers facilitate labeling for instance segmentation  </p></li>\n<li><p>[version.0b] Feb-20:  Nuclei detection first, then crop and segment. Following 2-stage mask rcnn approach.</p></li>\n</ul>\n\n<p>...</p>\n\n<p>[version.x due] Feb-28: GAN for data generation,  LB score predictor</p>",
      "rawMarkdown": "As usual, my starter kit post .... stay tuned .....\n\n(to be updated)\n\n--------------------------------------------------------------------------------\ncode download:  https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di\n\n- [version.0] Jan-21:  a basic Unet version. Predict mask and use connected component labelled. Able to achieve LB 0.311. (With train augmentation, fine-tunning etc, it can reach 0.325)\n\n- [version.0a] ABORTED!:  Predict mask, boundary and centers facilitate labeling for instance segmentation  \n\n- [version.0b] Feb-20:  Nuclei detection first, then crop and segment. Following 2-stage mask rcnn approach.\n\n \n...\n\n\n[version.x due] Feb-28: GAN for data generation,  LB score predictor",
      "votes": null
    },
    {
      "id": "270550",
      "postDate": "01/18/2018 13:47:55",
      "content": "<p>[version.0] due Jan-21:  </p>\n\n<ul>\n<li><p>a preliminary version is found at folder \"[google_drive]/20180116\". It is dirty code and will be clean up soon. Achieved LB=0.311. </p></li>\n<li><p>example of convergence of training iterations: \n<a href=\"https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i\">https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i</a></p>\n\n<p>[train_iter_no]-[batch_no].png</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270550/8298/00000000-014.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270550/8299/00000027-013.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "rawMarkdown": "[version.0] due Jan-21:  \n\n - a preliminary version is found at folder \"[google_drive]/20180116\". It is dirty code and will be clean up soon. Achieved LB=0.311. \n\n - example of convergence of training iterations: \n https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i\n\n \n [train_iter_no]-[batch_no].png\n\n  ![enter image description here][1]\n\n\n  ![enter image description here][2]\n   \n  \n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/270550/8298/00000000-014.png\n\n  [2]:https://kaggle2.blob.core.windows.net/forum-message-attachments/270550/8299/00000027-013.png",
      "votes": null
    },
    {
      "id": "270556",
      "postDate": "01/18/2018 13:57:59",
      "content": "<p>All Useful development tools here</p>\n\n<ul>\n<li><a href=\"https://github.com/PaddlePaddle/visualdl\">https://github.com/PaddlePaddle/visualdl</a></li>\n</ul>",
      "rawMarkdown": "All Useful development tools here\n \n-  https://github.com/PaddlePaddle/visualdl",
      "votes": null
    },
    {
      "id": "270572",
      "postDate": "01/18/2018 14:38:35",
      "content": "<p>Awesome! Nice work. 😎</p>",
      "rawMarkdown": "Awesome! Nice work. 😎",
      "votes": null
    },
    {
      "id": "270685",
      "postDate": "01/18/2018 18:21:10",
      "content": "<p>All GAN resources here!</p>\n\n<ul>\n<li><p><a href=\"https://arxiv.org/pdf/1709.05860.pdf\">https://arxiv.org/pdf/1709.05860.pdf</a></p></li>\n<li><p><a href=\"https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf\">https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf</a></p></li>\n<li><p><a href=\"https://arxiv.org/pdf/1711.11317.pdf\">https://arxiv.org/pdf/1711.11317.pdf</a></p></li>\n<li><p><a href=\"https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images\">https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images</a>.</p></li>\n</ul>\n\n<hr>\n\n<p>\"Unsupervised Histopathology Image Synthesis\"</p>\n\n<p><a href=\"https://arxiv.org/pdf/1712.05021.pdf\">https://arxiv.org/pdf/1712.05021.pdf</a></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270685/8406/gan.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "All GAN resources here!\n\n - https://arxiv.org/pdf/1709.05860.pdf\n\n -  https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf\n\n -  https://arxiv.org/pdf/1711.11317.pdf\n\n -  https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images.\n\n---\n\"Unsupervised Histopathology Image Synthesis\"\n\nhttps://arxiv.org/pdf/1712.05021.pdf\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/270685/8406/gan.png",
      "votes": null
    },
    {
      "id": "270694",
      "postDate": "01/18/2018 18:36:06",
      "content": "<p>All useful domain knowledge here!</p>\n\n<ul>\n<li><p><a href=\"http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk\">http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk</a></p></li>\n<li><p><a href=\"http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/\">http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/</a>, <a href=\"http://www.andrewjanowczyk.com/radhical/\">http://www.andrewjanowczyk.com/radhical/</a>, etc</p></li>\n<li><p><a href=\"https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769\">https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769</a></p></li>\n<li><p><a href=\"https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/\">https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/</a></p></li>\n<li><p><a href=\"https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/\">https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/</a>  (see presentation slides)</p></li>\n<li><p><a href=\"https://grand-challenge.org/All_Challenges/\">https://grand-challenge.org/All_Challenges/</a> </p>\n\n<ul><li><a href=\"https://cs.adelaide.edu.au/~carneiro/multimodal.html\">https://cs.adelaide.edu.au/~carneiro/multimodal.html</a></li></ul></li>\n</ul>",
      "rawMarkdown": "All useful domain knowledge here!\n\n - http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk\n\n - http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/, http://www.andrewjanowczyk.com/radhical/, etc\n\n - https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769\n\n - https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/\n\n - https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/  (see presentation slides)\n\n - https://grand-challenge.org/All_Challenges/ \n \n- https://cs.adelaide.edu.au/~carneiro/multimodal.html",
      "votes": null
    },
    {
      "id": "270738",
      "postDate": "01/18/2018 20:06:54",
      "content": "<p>thank you, can confirm the score :)\nnow I have to learn pytorch, hope it's not too complicated vs. keras</p>",
      "rawMarkdown": "thank you, can confirm the score :)\nnow I have to learn pytorch, hope it's not too complicated vs. keras",
      "votes": null
    },
    {
      "id": "271156",
      "postDate": "01/19/2018 19:44:37",
      "content": "<p>Awesome! Thanks for sharing.</p>",
      "rawMarkdown": "Awesome! Thanks for sharing.",
      "votes": null
    },
    {
      "id": "271379",
      "postDate": "01/20/2018 10:25:09",
      "content": "<p>0.0100   41.9 k  2005.57   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0027  0.0000 |  6 hr 09 min  41929,41929, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.62   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0064  0.0000 |  6 hr 09 min  41930,41930, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.67   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0030  0.0000 |  6 hr 09 min  41931,41931, torch.Size([32, 3, 256, 256])</p>\n\n<p>Something wrong?</p>",
      "rawMarkdown": "0.0100   41.9 k  2005.57   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0027  0.0000 |  6 hr 09 min  41929,41929, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.62   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0064  0.0000 |  6 hr 09 min  41930,41930, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.67   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0030  0.0000 |  6 hr 09 min  41931,41931, torch.Size([32, 3, 256, 256])\n\nSomething wrong?",
      "votes": null
    },
    {
      "id": "271380",
      "postDate": "01/20/2018 10:27:42",
      "content": "<p>what is your submission results?</p>",
      "rawMarkdown": "what is your submission results?",
      "votes": null
    },
    {
      "id": "271408",
      "postDate": "01/20/2018 11:41:28",
      "content": "<p>00044700_model.pth LB 0.293,  00002500_model.pth LB 0.303</p>",
      "rawMarkdown": "00044700_model.pth LB 0.293,  00002500_model.pth LB 0.303",
      "votes": null
    },
    {
      "id": "271479",
      "postDate": "01/20/2018 14:53:16",
      "content": "<p>results seems correct. Adjust iterations, learning rate and threshold at the submit.py() when making run length encoding from raw probability. If you have time you can add train augmentation as well</p>",
      "rawMarkdown": "results seems correct. Adjust iterations, learning rate and threshold at the submit.py() when making run length encoding from raw probability. If you have time you can add train augmentation as well",
      "votes": null
    },
    {
      "id": "271482",
      "postDate": "01/20/2018 15:04:19",
      "content": "<p>Awesome work, Thank you very much!  I've learned a lot from you!</p>",
      "rawMarkdown": "Awesome work, Thank you very much!  I've learned a lot from you!",
      "votes": null
    },
    {
      "id": "271763",
      "postDate": "01/21/2018 11:06:48",
      "content": "<p>[version.0a] due Jan-30:</p>\n\n<ul>\n<li><p>extend to 3 class: predict foreground mask, boundary and center. This will facilitate labeling for instance segmentation.\nPreliminary results is shown below.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/271763/8331/3cls.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "rawMarkdown": "[version.0a] due Jan-30:\n\n - extend to 3 class: predict foreground mask, boundary and center. This will facilitate labeling for instance segmentation.\nPreliminary results is shown below.\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/271763/8331/3cls.png",
      "votes": null
    },
    {
      "id": "271766",
      "postDate": "01/21/2018 11:20:25",
      "content": "<p>this code is dirty, but can run and is not difficult to expand and improve.</p>\n\n<p>i decide not to clean up the code but instead go to the next version (version.0a). This is because I find that even if I get the perfect mask, watershed do not give perfect results. Hence I would like to predict boundary and center and mask and see how i can do a better post processing for instance segmentation.</p>",
      "rawMarkdown": "this code is dirty, but can run and is not difficult to expand and improve.\n\ni decide not to clean up the code but instead go to the next version (version.0a). This is because I find that even if I get the perfect mask, watershed do not give perfect results. Hence I would like to predict boundary and center and mask and see how i can do a better post processing for instance segmentation.",
      "votes": null
    },
    {
      "id": "271841",
      "postDate": "01/21/2018 15:58:01",
      "content": "<p>post processing</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/271841/8332/post_process.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "post processing\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/271841/8332/post_process.png",
      "votes": null
    },
    {
      "id": "271862",
      "postDate": "01/21/2018 17:37:11",
      "content": "<p>it is important to understand the metric score:</p>\n\n<p>below are my measurements based on the train set:</p>\n\n<p>(to be updated)</p>\n\n<p>ground truth:   AP = 1.0</p>\n\n<p>shift 1 pixel up = ...</p>\n\n<p>shift 1 pixel down = ...</p>\n\n<p>shift 2 pixel up = ...</p>\n\n<p>...</p>\n\n<p>expand 1 pixel = ...</p>\n\n<p>...</p>\n\n<p>shrink 1 pixel = ...</p>\n\n<p>...</p>\n\n<p>ground truth, but overlap nuclei are are labelled as single = .... 0.56? ...</p>\n\n<p>....</p>\n\n<p>ground truth, remove 1 (area ...) nuclei = ...</p>\n\n<p>ground truth, remove 2 (area ...) nuclei = ...</p>\n\n<p>....</p>\n\n<p>ground truth, add 1 nuclei (area ...) = ...</p>\n\n<p>ground truth, add 2 nuclei (area ...)  = ...</p>",
      "rawMarkdown": "it is important to understand the metric score:\n\nbelow are my measurements based on the train set:\n\n(to be updated)\n\nground truth:   AP = 1.0\n\nshift 1 pixel up = ...\n\nshift 1 pixel down = ...\n\nshift 2 pixel up = ...\n\n...\n\nexpand 1 pixel = ...\n\n...\n\nshrink 1 pixel = ...\n\n...\n\nground truth, but overlap nuclei are are labelled as single = .... 0.56? ...\n\n....\n\nground truth, remove 1 (area ...) nuclei = ...\n\n\nground truth, remove 2 (area ...) nuclei = ...\n\n\n....\n\nground truth, add 1 nuclei (area ...) = ...\n\n\nground truth, add 2 nuclei (area ...)  = ...",
      "votes": null
    },
    {
      "id": "271991",
      "postDate": "01/22/2018 02:52:59",
      "content": "<p>0.56 is amazing</p>",
      "rawMarkdown": "0.56 is amazing",
      "votes": null
    },
    {
      "id": "272431",
      "postDate": "01/23/2018 03:07:25",
      "content": "<p>Someone just did what i want to do.</p>\n\n<p>Gan for nuclei segmentation</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/272431/8343/IMG_7663.PNG\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/272431/8342/IMG_7664.PNG\" alt=\"enter image description here\"></p>\n\n<p><a href=\"https://arxiv.org/abs/1801.07198\">https://arxiv.org/abs/1801.07198</a></p>",
      "rawMarkdown": "Someone just did what i want to do.\n\nGan for nuclei segmentation\n\n ![enter image description here][1]\n\n ![enter image description here][2]\n\nhttps://arxiv.org/abs/1801.07198\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/272431/8343/IMG_7663.PNG\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/272431/8342/IMG_7664.PNG",
      "votes": null
    },
    {
      "id": "272474",
      "postDate": "01/23/2018 05:12:09",
      "content": "<p>a newbie question: If I want to run the starter code with no GPU support, would the experience be really painful, I mean more painful than installing Nvidia driver on Ubuntu? Seems like Pytorch complains that I don't have the driver installed and I am very hesitate in doing so.</p>\n\n<p>BTW, I am really looking forward to see you GAN implementation, since everyone is talking about GAN nowadays.</p>",
      "rawMarkdown": "a newbie question: If I want to run the starter code with no GPU support, would the experience be really painful, I mean more painful than installing Nvidia driver on Ubuntu? Seems like Pytorch complains that I don't have the driver installed and I am very hesitate in doing so.\n\nBTW, I am really looking forward to see you GAN implementation, since everyone is talking about GAN nowadays.",
      "votes": null
    },
    {
      "id": "272492",
      "postDate": "01/23/2018 05:56:36",
      "content": "<p>you can modify my code without gpu support. but i do not if it will work.</p>",
      "rawMarkdown": "you can modify my code without gpu support. but i do not if it will work.",
      "votes": null
    },
    {
      "id": "272655",
      "postDate": "01/23/2018 12:07:41",
      "content": "<p>Any one try Facebook new library <a href=\"https://github.com/facebookresearch/Detectron\">https://github.com/facebookresearch/Detectron</a>?</p>",
      "rawMarkdown": "Any one try Facebook new library https://github.com/facebookresearch/Detectron?",
      "votes": null
    },
    {
      "id": "272743",
      "postDate": "01/23/2018 16:12:22",
      "content": "<p>thanks, I got the driver running and Pytorch seems happy. </p>\n\n<p>Have you seen this error before: \nOpenCV Error: Assertion failed (ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0) in resize, file /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/resize.cpp, line 3289</p>\n\n<p>Looks like is triggered from train_unet.py line 250 / 251\nfor tensors, masks, indices in train_loader:</p>\n\n<p>I think I set the path in common.py correctly and the PROJECT_PATH shows where the train_unet.py file is.</p>\n\n<p>EDIT: I think I issue is I don't know where to put the stage1_train. I tried to put it under split/ but doesn't work either</p>\n\n<p>EDIT:  I am missing the one_mask.png files now, after I ran the science_processing.py training ran. Now I got RuntimeError: CUDNN_STATUS_INTERNAL_ERROR, but that's for another story</p>",
      "rawMarkdown": "thanks, I got the driver running and Pytorch seems happy. \n\nHave you seen this error before: \nOpenCV Error: Assertion failed (ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0) in resize, file /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/resize.cpp, line 3289\n\nLooks like is triggered from train_unet.py line 250 / 251\nfor tensors, masks, indices in train_loader:\n\nI think I set the path in common.py correctly and the PROJECT_PATH shows where the train_unet.py file is.\n\nEDIT: I think I issue is I don't know where to put the stage1_train. I tried to put it under split/ but doesn't work either\n\nEDIT:  I am missing the one_mask.png files now, after I ran the science_processing.py training ran. Now I got RuntimeError: CUDNN_STATUS_INTERNAL_ERROR, but that's for another story",
      "votes": null
    },
    {
      "id": "272814",
      "postDate": "01/23/2018 19:05:50",
      "content": "<p>Very useful, thanks!\nthe github link seems dead. working from here: <a href=\"https://github.com/Saurabh23\">https://github.com/Saurabh23</a></p>",
      "rawMarkdown": "Very useful, thanks!\nthe github link seems dead. working from here: https://github.com/Saurabh23",
      "votes": null
    },
    {
      "id": "273023",
      "postDate": "01/24/2018 02:57:24",
      "content": "<p>Let's try it!</p>",
      "rawMarkdown": "Let's try it!",
      "votes": null
    },
    {
      "id": "273072",
      "postDate": "01/24/2018 05:00:43",
      "content": "<p>well, thank you for your released code. and I am trying the 3-class , would you share the code that convert the binary mask map to 3-class mask? thank you</p>",
      "rawMarkdown": "well, thank you for your released code. and I am trying the 3-class , would you share the code that convert the binary mask map to 3-class mask? thank you",
      "votes": null
    },
    {
      "id": "273106",
      "postDate": "01/24/2018 06:25:49",
      "content": "<blockquote>\n  <blockquote>\n    <p>ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0 \n    i think image file path is wrong. When openCV reas invalid path,  it return a \"None array\" instead of error.\n    This \"None array\" causes error in future code.</p>\n  </blockquote>\n</blockquote>",
      "rawMarkdown": "&gt;&gt; ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0 \ni think image file path is wrong. When openCV reas invalid path,  it return a \"None array\" instead of error.\nThis \"None array\" causes error in future code.",
      "votes": null
    },
    {
      "id": "274454",
      "postDate": "01/26/2018 16:28:08",
      "content": "<p>you can try some synthetic images to see if your model can cover all angles, aspect and sizes. You can create such samples by distorting the real train images too.</p>\n\n<p>Here, i test if my model can detect the center and estimate a fitting ellipse  (i replaced the box prediction with ellipse prediction in methods like mask-rcnn and faster-rcnn)</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274454/8378/synthetic.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "you can try some synthetic images to see if your model can cover all angles, aspect and sizes. You can create such samples by distorting the real train images too.\n\nHere, i test if my model can detect the center and estimate a fitting ellipse  (i replaced the box prediction with ellipse prediction in methods like mask-rcnn and faster-rcnn)\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274454/8378/synthetic.png",
      "votes": null
    },
    {
      "id": "274492",
      "postDate": "01/26/2018 17:52:18",
      "content": "<p>Great ideal!</p>",
      "rawMarkdown": "Great ideal!",
      "votes": null
    },
    {
      "id": "274880",
      "postDate": "01/27/2018 15:42:48",
      "content": "<p>This is discontinued. Please see [version.0b] due Jan-30 above. </p>",
      "rawMarkdown": "This is discontinued. Please see [version.0b] due Jan-30 above.",
      "votes": null
    },
    {
      "id": "274883",
      "postDate": "01/27/2018 15:46:48",
      "content": "<p>[version.0b] due Feb-20 :</p>\n\n<ul>\n<li>switch to mask rcnn, two stage approach .</li>\n<li><p>you can find a preliminary version at the goggle drive in folder 20180127 (Warning: this is incomplete version, not all files in the project are working. But the \"train.py\" code is working and you can use it to train and produce a model, please see attacment pptx)</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274883/8385/Slide1.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274883/8386/Slide3.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "rawMarkdown": "[version.0b] due Feb-20 :\n\n - switch to mask rcnn, two stage approach .\n - you can find a preliminary version at the goggle drive in folder 20180127 (Warning: this is incomplete version, not all files in the project are working. But the \"train.py\" code is working and you can use it to train and produce a model, please see attacment pptx)\n\n\n  ![enter image description here][1]\n\n  ![enter image description here][2]\n  \n\n    \n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274883/8385/Slide1.png\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274883/8386/Slide3.png",
      "votes": null
    },
    {
      "id": "274889",
      "postDate": "01/27/2018 16:29:19",
      "content": "<p>Awesome! Is this in pytorch?</p>",
      "rawMarkdown": "Awesome! Is this in pytorch?",
      "votes": null
    },
    {
      "id": "274890",
      "postDate": "01/27/2018 16:30:10",
      "content": "<p>yes</p>",
      "rawMarkdown": "yes",
      "votes": null
    },
    {
      "id": "274893",
      "postDate": "01/27/2018 16:42:38",
      "content": "<p>seems that preliminary version [version.0b] is working. I attached some results on LB test set that is not used in training at all! This is at 4.4K iterations with learning rate 0.1. I will need to finetune with later learning rate later.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8397/336d3e4105766f8ad328a7ee9571e743f376f8cbcf6a969ca7e353fe3235c523.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8394/a984e7fb886aa02e29d112766d3ce26a4f78eac540ce7bbdbd42af2761928f6d.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8389/1ef68e93964c2d9230100c1347c328f6385a7bc027879dc3d4c055e6fe80cb3c.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "seems that preliminary version [version.0b] is working. I attached some results on LB test set that is not used in training at all! This is at 4.4K iterations with learning rate 0.1. I will need to finetune with later learning rate later.\n\n ![enter image description here][1]\n\n ![enter image description here][2]\n\n ![enter image description here][3]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8397/336d3e4105766f8ad328a7ee9571e743f376f8cbcf6a969ca7e353fe3235c523.png\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8394/a984e7fb886aa02e29d112766d3ce26a4f78eac540ce7bbdbd42af2761928f6d.png\n  [3]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8389/1ef68e93964c2d9230100c1347c328f6385a7bc027879dc3d4c055e6fe80cb3c.png",
      "votes": null
    },
    {
      "id": "275003",
      "postDate": "01/28/2018 02:07:39",
      "content": "<p>Just realised that there is a bug in estimation of the ellipse angle. The loss of the angle is not correct. Will fix it later.</p>\n\n<p>Current, the ellipse parameters to be predicted are : cx,cy (center), major_r, minor_r (radius) and angle (rotation). The angle should be changed to sin(angle) and cos(angle) instead.</p>\n\n<p>So there should be 6  ellipse parameters instead and all these 6 parameters can use L1_smooth loss (like faster rcnn)</p>",
      "rawMarkdown": "Just realised that there is a bug in estimation of the ellipse angle. The loss of the angle is not correct. Will fix it later.\n\nCurrent, the ellipse parameters to be predicted are : cx,cy (center), major_r, minor_r (radius) and angle (rotation). The angle should be changed to sin(angle) and cos(angle) instead.\n\nSo there should be 6  ellipse parameters instead and all these 6 parameters can use L1_smooth loss (like faster rcnn)",
      "votes": null
    },
    {
      "id": "275018",
      "postDate": "01/28/2018 04:02:01",
      "content": "<p>Thanks for sharing the updated code. Learned a lot from them.</p>",
      "rawMarkdown": "Thanks for sharing the updated code. Learned a lot from them.",
      "votes": null
    },
    {
      "id": "275020",
      "postDate": "01/28/2018 04:09:46",
      "content": "<p>I think there is a science_processing py file where you can find make extra or make more label function. You can search for np.save *.npy</p>",
      "rawMarkdown": "I think there is a science_processing py file where you can find make extra or make more label function. You can search for np.save *.npy",
      "votes": null
    },
    {
      "id": "275279",
      "postDate": "01/28/2018 16:31:32",
      "content": "<p>Hi, I have been trying to write my own Pytorch model, but the loss is not going down. It just keeps fluctuating between some values. I haven't been able to figure out why that's happening for the last three days. Any help is appreciated. I am attaching my jupyter notebook here. The code is pretty clean and the entire pytorch code is in the Pytorch Model Cell.</p>\n\n<p><a href=\"https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing\">https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing</a></p>",
      "rawMarkdown": "Hi, I have been trying to write my own Pytorch model, but the loss is not going down. It just keeps fluctuating between some values. I haven't been able to figure out why that's happening for the last three days. Any help is appreciated. I am attaching my jupyter notebook here. The code is pretty clean and the entire pytorch code is in the Pytorch Model Cell.\n\nhttps://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing",
      "votes": null
    },
    {
      "id": "275520",
      "postDate": "01/29/2018 12:05:04",
      "content": "<p>Awesome, I started with a UNET and cannot get more than 0.303. Thanks for sharing.</p>",
      "rawMarkdown": "Awesome, I started with a UNET and cannot get more than 0.303. Thanks for sharing.",
      "votes": null
    },
    {
      "id": "275571",
      "postDate": "01/29/2018 14:08:04",
      "content": "<p>Can you please share your code?</p>",
      "rawMarkdown": "Can you please share your code?",
      "votes": null
    },
    {
      "id": "275623",
      "postDate": "01/29/2018 16:40:48",
      "content": "<p>Have you actually try it? I am looking into it, but the computational requirement seems pretty high. Are you planning to run it on your local machine or a cloud somewhere?</p>",
      "rawMarkdown": "Have you actually try it? I am looking into it, but the computational requirement seems pretty high. Are you planning to run it on your local machine or a cloud somewhere?",
      "votes": null
    },
    {
      "id": "275646",
      "postDate": "01/29/2018 17:42:18",
      "content": "<p>Hi, I use UNET with VGG16 as feature extractor inspired from this:  <a href=\"https://github.com/ternaus/TernausNet\">https://github.com/ternaus/TernausNet</a></p>\n\n<p>Hope this helps</p>",
      "rawMarkdown": "Hi, I use UNET with VGG16 as feature extractor inspired from this:  https://github.com/ternaus/TernausNet\n\nHope this helps",
      "votes": null
    },
    {
      "id": "275651",
      "postDate": "01/29/2018 17:59:57",
      "content": "<p>I just want to see how you load your data in pytorch. If you look at my code, my loss is not decreasing and I can't figure out why.\n<a href=\"https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing\">https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing</a></p>",
      "rawMarkdown": "I just want to see how you load your data in pytorch. If you look at my code, my loss is not decreasing and I can't figure out why.\n[https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing][1]\n\n\n  [1]: https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing",
      "votes": null
    },
    {
      "id": "275690",
      "postDate": "01/29/2018 20:00:35",
      "content": "<p>hi there, your pytorch model seems fine to me, but there might be something worth improving in the training step.\n1. your learning rate appears to be too high in this case, why don't you try 1e-4 instead?\n2. you might want to use global average loss rather that local loss, otherwise the loss will fluctuate around some big random number.\n3. why not using the naive CrossEntropyLoss provided by PyTorch instead of using self-extended BCELoss? It'd make things way easier for you.\n4. don't forget to split a validation set from your training set to validate the performance of your model.</p>",
      "rawMarkdown": "hi there, your pytorch model seems fine to me, but there might be something worth improving in the training step.\n1. your learning rate appears to be too high in this case, why don't you try 1e-4 instead?\n2. you might want to use global average loss rather that local loss, otherwise the loss will fluctuate around some big random number.\n3. why not using the naive CrossEntropyLoss provided by PyTorch instead of using self-extended BCELoss? It'd make things way easier for you.\n4. don't forget to split a validation set from your training set to validate the performance of your model.",
      "votes": null
    },
    {
      "id": "275729",
      "postDate": "01/29/2018 21:33:59",
      "content": "<p>In fact I use Keras locally. Sorry that I can't help. Do you run on colab ?  <a href=\"https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q&amp;scrollTo=c99EvWo1s9-x\">Here</a> is an example on how to access to your drive from colab notebook. Then you can load data locally and save it into a pickle file, upload to your drive and access it from your notebook.</p>",
      "rawMarkdown": "In fact I use Keras locally. Sorry that I can't help. Do you run on colab ?  [Here][1] is an example on how to access to your drive from colab notebook. Then you can load data locally and save it into a pickle file, upload to your drive and access it from your notebook.\n  [1]: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q&amp;scrollTo=c99EvWo1s9-x",
      "votes": null
    },
    {
      "id": "275814",
      "postDate": "01/30/2018 03:08:47",
      "content": "<p>Nice!</p>",
      "rawMarkdown": "Nice!",
      "votes": null
    },
    {
      "id": "277806",
      "postDate": "02/04/2018 11:59:44",
      "content": "<p>i try to write a pytorch mask-rcnn from scratch.</p>\n\n<p>Here are some results from rpn(red is before nms, white is after)  and rcnn (pink).</p>\n\n<p>original image patch has been contrasted enhanced to improve visibility. But such enhancement has not been used in training and testing.</p>",
      "rawMarkdown": "i try to write a pytorch mask-rcnn from scratch.\n\nHere are some results from rpn(red is before nms, white is after)  and rcnn (pink).\n\noriginal image patch has been contrasted enhanced to improve visibility. But such enhancement has not been used in training and testing.",
      "votes": null
    },
    {
      "id": "277812",
      "postDate": "02/04/2018 12:23:57",
      "content": "<p>Almost results show great performances. Good job. I also used mask-rcnn but tensorflow version (<a href=\"https://github.com/matterport/Mask_RCNN\">https://github.com/matterport/Mask_RCNN</a>) with resnet 50-FPN. But the performance is not so good now. Do you normalize image (from 0 to 1) before feeding to the network. Because I used pre-trained model, so I did not normalize image</p>",
      "rawMarkdown": "Almost results show great performances. Good job. I also used mask-rcnn but tensorflow version (https://github.com/matterport/Mask_RCNN) with resnet 50-FPN. But the performance is not so good now. Do you normalize image (from 0 to 1) before feeding to the network. Because I used pre-trained model, so I did not normalize image",
      "votes": null
    },
    {
      "id": "277855",
      "postDate": "02/04/2018 16:10:50",
      "content": "<p>I try from scratch. I normalise 0,255 to 0,1. The cell nuclei are small. I don't think the mask rcnn can be used directly. Firstly, the amchor box should be made smaller. </p>",
      "rawMarkdown": "I try from scratch. I normalise 0,255 to 0,1. The cell nuclei are small. I don't think the mask rcnn can be used directly. Firstly, the amchor box should be made smaller.",
      "votes": null
    },
    {
      "id": "278120",
      "postDate": "02/05/2018 12:11:37",
      "content": "<p>Are you going to open-source the Pytorch implementation? I am interested in also implementing Mask-RCNN in Pytorch...</p>",
      "rawMarkdown": "Are you going to open-source the Pytorch implementation? I am interested in also implementing Mask-RCNN in Pytorch...",
      "votes": null
    },
    {
      "id": "278134",
      "postDate": "02/05/2018 12:53:19",
      "content": "<p>there is an incomplete version of pytorch mask-rcnn in the folder 20180205 of the google drive. do read the readme! it is used to produce the results shown.</p>\n\n<p>you can start from train.py in the main folder</p>",
      "rawMarkdown": "there is an incomplete version of pytorch mask-rcnn in the folder 20180205 of the google drive. do read the readme! it is used to produce the results shown.\n\nyou can start from train.py in the main folder",
      "votes": null
    },
    {
      "id": "278756",
      "postDate": "02/06/2018 22:37:24",
      "content": "<p>@Heng CherKeng Are you attempting to do the CycleGAN? </p>",
      "rawMarkdown": "Heng CherKeng Are you attempting to do the CycleGAN?",
      "votes": null
    },
    {
      "id": "278982",
      "postDate": "02/07/2018 06:02:26",
      "content": "<p>Thanks for sharing your work !</p>",
      "rawMarkdown": "Thanks for sharing your work !",
      "votes": null
    },
    {
      "id": "279963",
      "postDate": "02/09/2018 02:02:52",
      "content": "<p>@Heng CherKeng Have you try VGG_U-net( <a href=\"https://github.com/ternaus/TernausNet\">https://github.com/ternaus/TernausNet</a>).\nI' ve got 0.351 with only unet, want to try import unet now.</p>",
      "rawMarkdown": "Heng CherKeng Have you try VGG_U-net( https://github.com/ternaus/TernausNet).\nI' ve got 0.351 with only unet, want to try import unet now.",
      "votes": null
    },
    {
      "id": "279969",
      "postDate": "02/09/2018 02:16:20",
      "content": "<p>i suggest you take the appoach:</p>\n\n<p>1) if you are using unet, note that this is semantic segmentation and not instance segmentation. i.e the nuclei will not be separated.</p>\n\n<p>2) what is the best score i can get if i do not separate the nuclei? for a set of validation image, create results for non-separating nuclei from the ground truth. Then measure the the performance metric. (I belive this is about 0.55 from my experiment)</p>\n\n<p>3) Now estimate human performance. e.g. you can re-annotate the traindata ground truth, or you can assume there is about say 0.5 pixel erosion/dilation and measure the results for your assumption. (In my experiment, this is about 0.45)</p>\n\n<p>4) train unet as usual. Measure preformance on validation set. I think the best results is about human performance.</p>\n\n<p>5) make a submission. the difference from LB score to validation score is then the generalisation problem.</p>",
      "rawMarkdown": "i suggest you take the appoach:\n\n1) if you are using unet, note that this is semantic segmentation and not instance segmentation. i.e the nuclei will not be separated.\n\n2) what is the best score i can get if i do not separate the nuclei? for a set of validation image, create results for non-separating nuclei from the ground truth. Then measure the the performance metric. (I belive this is about 0.55 from my experiment)\n\n3) Now estimate human performance. e.g. you can re-annotate the traindata ground truth, or you can assume there is about say 0.5 pixel erosion/dilation and measure the results for your assumption. (In my experiment, this is about 0.45)\n\n4) train unet as usual. Measure preformance on validation set. I think the best results is about human performance.\n\n5) make a submission. the difference from LB score to validation score is then the generalisation problem.",
      "votes": null
    },
    {
      "id": "280618",
      "postDate": "02/10/2018 13:38:58",
      "content": "<p>The run_length_decode function is incorrect as the result is not transposed. </p>\n\n<p>Here is modified one:</p>\n\n<pre><code>def run_length_decode(rel, H, W, fill_value=255):\n    mask = np.zeros((H * W), np.uint8)\n    rel = np.array([int(s) for s in rel.split(' ')]).reshape(-1, 2)\n    for r in rel:\n        start = r[0]\n        end = start + r[1]\n        mask[start : end] = fill_value\n    mask = mask.reshape(W, H).T # H, W need to swap as transposing. \n    return mask\n</code></pre>",
      "rawMarkdown": "The run_length_decode function is incorrect as the result is not transposed. \n\nHere is modified one:\n\n    def run_length_decode(rel, H, W, fill_value=255):\n        mask = np.zeros((H * W), np.uint8)\n        rel = np.array([int(s) for s in rel.split(' ')]).reshape(-1, 2)\n        for r in rel:\n            start = r[0]\n            end = start + r[1]\n            mask[start : end] = fill_value\n        mask = mask.reshape(W, H).T # H, W need to swap as transposing. \n        return mask",
      "votes": null
    },
    {
      "id": "281270",
      "postDate": "02/12/2018 11:36:37",
      "content": "<p>Hello, @tuanphuc. I'm trying to implement TernausNet too. Can I ask what's your performance (LB score) used TernausNet? How much improve compare to simple UNet?</p>",
      "rawMarkdown": "Hello, @tuanphuc. I'm trying to implement TernausNet too. Can I ask what's your performance (LB score) used TernausNet? How much improve compare to simple UNet?",
      "votes": null
    },
    {
      "id": "281653",
      "postDate": "02/12/2018 22:21:39",
      "content": "<p>Hi @ianchan1990, I tried TernausNet and it got me to around 0.330 in LB. In fact I used VGG16 instead of VGG11 as in the paper so the result is with respect to VGG16. I would like to know the score with VGG11 if you will try it.</p>",
      "rawMarkdown": "Hi @ianchan1990, I tried TernausNet and it got me to around 0.330 in LB. In fact I used VGG16 instead of VGG11 as in the paper so the result is with respect to VGG16. I would like to know the score with VGG11 if you will try it.",
      "votes": null
    },
    {
      "id": "284425",
      "postDate": "02/17/2018 04:42:39",
      "content": "<p>Thanks @Heng</p>",
      "rawMarkdown": "Thanks @Heng",
      "votes": null
    },
    {
      "id": "284428",
      "postDate": "02/17/2018 04:54:57",
      "content": "<p>@Heng thanks again these are very useful.</p>",
      "rawMarkdown": "Heng thanks again these are very useful.",
      "votes": null
    },
    {
      "id": "284721",
      "postDate": "02/18/2018 04:25:14",
      "content": "<p>this function is not correct. there is some pixel shift. here is a checking code:</p>\n\n<pre><code>def run_check_run_length_decode():\n\nname = 'b98681c74842c4058bd2f88b06063731c26a90da083b1ef348e0ec734c58752b'\n\nnpy_file = DATA_DIR + '/image/stage1_train/' + name + '/multi_mask.npy'\nmulti_mask = np.load(npy_file)\nH,W = multi_mask.shape[:2]\n\ncvs_EncodedPixels = []\nnum =int( multi_mask.max())\nfor m in range(num):\n    rle = run_length_encode(multi_mask==m+1)\n    cvs_EncodedPixels.append(rle)\n\n\n\n#reference encoding from 'stage1_train_labels.csv'\ndf = pd.read_csv (DATA_DIR + '/__download__/stage1_train_labels.csv')\ndf = df.loc[df['ImageId'] == name]\n\nreference_cvs_EncodedPixels = df['EncodedPixels'].values\nreference_cvs_EncodedPixels.sort()\n\nreference_multi_mask = np.zeros((H, W), np.int32)\nfor rle in reference_cvs_EncodedPixels:\n    thresh = run_length_decode(rle, H, W, fill_value=255)\n    id = cvs_EncodedPixels.index(rle)\n    reference_multi_mask[thresh&gt;128] = id+1\n\n\n\nreference_multi_mask = reference_multi_mask.astype(np.float32)\nreference_multi_mask = reference_multi_mask/reference_multi_mask.max()*255\nmulti_mask = multi_mask.astype(np.float32)\nmulti_mask = multi_mask/multi_mask.max()*255\n\n\nprint((reference_multi_mask!=multi_mask).sum())\n\nimage_show('multi_mask', multi_mask,2)\nimage_show('reference_multi_mask', reference_multi_mask,2)\nimage_show('diff', (reference_multi_mask!=multi_mask)*255,2)\ncv2.waitKey(0)\n</code></pre>",
      "rawMarkdown": "this function is not correct. there is some pixel shift. here is a checking code:\n\n    def run_check_run_length_decode():\n\n    name = 'b98681c74842c4058bd2f88b06063731c26a90da083b1ef348e0ec734c58752b'\n\n    npy_file = DATA_DIR + '/image/stage1_train/' + name + '/multi_mask.npy'\n    multi_mask = np.load(npy_file)\n    H,W = multi_mask.shape[:2]\n\n    cvs_EncodedPixels = []\n    num =int( multi_mask.max())\n    for m in range(num):\n        rle = run_length_encode(multi_mask==m+1)\n        cvs_EncodedPixels.append(rle)\n\n\n\n    #reference encoding from 'stage1_train_labels.csv'\n    df = pd.read_csv (DATA_DIR + '/__download__/stage1_train_labels.csv')\n    df = df.loc[df['ImageId'] == name]\n\n    reference_cvs_EncodedPixels = df['EncodedPixels'].values\n    reference_cvs_EncodedPixels.sort()\n\n    reference_multi_mask = np.zeros((H, W), np.int32)\n    for rle in reference_cvs_EncodedPixels:\n        thresh = run_length_decode(rle, H, W, fill_value=255)\n        id = cvs_EncodedPixels.index(rle)\n        reference_multi_mask[thresh&gt;128] = id+1\n\n\n\n    reference_multi_mask = reference_multi_mask.astype(np.float32)\n    reference_multi_mask = reference_multi_mask/reference_multi_mask.max()*255\n    multi_mask = multi_mask.astype(np.float32)\n    multi_mask = multi_mask/multi_mask.max()*255\n\n\n    print((reference_multi_mask!=multi_mask).sum())\n\n    image_show('multi_mask', multi_mask,2)\n    image_show('reference_multi_mask', reference_multi_mask,2)\n    image_show('diff', (reference_multi_mask!=multi_mask)*255,2)\n    cv2.waitKey(0)",
      "votes": null
    },
    {
      "id": "284722",
      "postDate": "02/18/2018 04:27:34",
      "content": "<p>the correct decoding function should be</p>\n\n<pre><code>def run_length_decode(rle, H, W, fill_value=255):\n\nmask = np.zeros((H * W), np.uint8)\nrle = np.array([int(s) for s in rle.split(' ')]).reshape(-1, 2)\nfor r in rle:\n    start = r[0]-1\n    end = start + r[1]\n    mask[start : end] = fill_value\nmask = mask.reshape(W, H).T # H, W need to swap as transposing.\nreturn mask\n</code></pre>",
      "rawMarkdown": "the correct decoding function should be\n\n    def run_length_decode(rle, H, W, fill_value=255):\n\n    mask = np.zeros((H * W), np.uint8)\n    rle = np.array([int(s) for s in rle.split(' ')]).reshape(-1, 2)\n    for r in rle:\n        start = r[0]-1\n        end = start + r[1]\n        mask[start : end] = fill_value\n    mask = mask.reshape(W, H).T # H, W need to swap as transposing.\n    return mask",
      "votes": null
    },
    {
      "id": "287058",
      "postDate": "02/23/2018 11:56:25",
      "content": "<p>I use the same code, submit several times results in totally diverse result. Best got 0.37, worst got 0.25. Quite wired.</p>",
      "rawMarkdown": "I use the same code, submit several times results in totally diverse result. Best got 0.37, worst got 0.25. Quite wired.",
      "votes": null
    },
    {
      "id": "290564",
      "postDate": "03/04/2018 12:43:45",
      "content": "",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "291911",
      "postDate": "03/07/2018 04:37:51",
      "content": "<p>I have a PyTorch UNET implementation that doesn't seem to perform better than 0.195 LB. Any tips on what I might need to do in order to get it to work? </p>",
      "rawMarkdown": "I have a PyTorch UNET implementation that doesn't seem to perform better than 0.195 LB. Any tips on what I might need to do in order to get it to work?",
      "votes": null
    },
    {
      "id": "302514",
      "postDate": "03/24/2018 08:06:45",
      "content": "<p>Is syntetic data generation working good here? Is it works for another tasks like object detection?</p>",
      "rawMarkdown": "Is syntetic data generation working good here? Is it works for another tasks like object detection?",
      "votes": null
    },
    {
      "id": "307429",
      "postDate": "04/01/2018 15:40:23",
      "content": "<p>Did these guys happen to have published their annotated dataset anywhere?</p>",
      "rawMarkdown": "Did these guys happen to have published their annotated dataset anywhere?",
      "votes": null
    },
    {
      "id": "519950",
      "postDate": "04/19/2019 21:16:18",
      "content": "<p>Thanks. Really useful.</p>",
      "rawMarkdown": "Thanks. Really useful.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 270550,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/18/2018 13:47:55",
      "content": "<p>[version.0] due Jan-21:  </p>\n\n<ul>\n<li><p>a preliminary version is found at folder \"[google_drive]/20180116\". It is dirty code and will be clean up soon. Achieved LB=0.311. </p></li>\n<li><p>example of convergence of training iterations: \n<a href=\"https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i\">https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i</a></p>\n\n<p>[train_iter_no]-[batch_no].png</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270550/8298/00000000-014.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270550/8299/00000027-013.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "votes": null,
      "replies": [
        {
          "id": 271766,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/21/2018 11:20:25",
          "content": "<p>this code is dirty, but can run and is not difficult to expand and improve.</p>\n\n<p>i decide not to clean up the code but instead go to the next version (version.0a). This is because I find that even if I get the perfect mask, watershed do not give perfect results. Hence I would like to predict boundary and center and mask and see how i can do a better post processing for instance segmentation.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 270556,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/18/2018 13:57:59",
      "content": "<p>All Useful development tools here</p>\n\n<ul>\n<li><a href=\"https://github.com/PaddlePaddle/visualdl\">https://github.com/PaddlePaddle/visualdl</a></li>\n</ul>",
      "votes": null,
      "replies": []
    },
    {
      "id": 270572,
      "author_name": "agoodman",
      "author_url": "",
      "post_date": "01/18/2018 14:38:35",
      "content": "<p>Awesome! Nice work. 😎</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 270685,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/18/2018 18:21:10",
      "content": "<p>All GAN resources here!</p>\n\n<ul>\n<li><p><a href=\"https://arxiv.org/pdf/1709.05860.pdf\">https://arxiv.org/pdf/1709.05860.pdf</a></p></li>\n<li><p><a href=\"https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf\">https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf</a></p></li>\n<li><p><a href=\"https://arxiv.org/pdf/1711.11317.pdf\">https://arxiv.org/pdf/1711.11317.pdf</a></p></li>\n<li><p><a href=\"https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images\">https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images</a>.</p></li>\n</ul>\n\n<hr>\n\n<p>\"Unsupervised Histopathology Image Synthesis\"</p>\n\n<p><a href=\"https://arxiv.org/pdf/1712.05021.pdf\">https://arxiv.org/pdf/1712.05021.pdf</a></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/270685/8406/gan.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 272814,
          "author_name": "zeta2191622",
          "author_url": "",
          "post_date": "01/23/2018 19:05:50",
          "content": "<p>Very useful, thanks!\nthe github link seems dead. working from here: <a href=\"https://github.com/Saurabh23\">https://github.com/Saurabh23</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 284428,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "02/17/2018 04:54:57",
          "content": "<p>@Heng thanks again these are very useful.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 270694,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/18/2018 18:36:06",
      "content": "<p>All useful domain knowledge here!</p>\n\n<ul>\n<li><p><a href=\"http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk\">http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk</a></p></li>\n<li><p><a href=\"http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/\">http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/</a>, <a href=\"http://www.andrewjanowczyk.com/radhical/\">http://www.andrewjanowczyk.com/radhical/</a>, etc</p></li>\n<li><p><a href=\"https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769\">https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769</a></p></li>\n<li><p><a href=\"https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/\">https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/</a></p></li>\n<li><p><a href=\"https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/\">https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/</a>  (see presentation slides)</p></li>\n<li><p><a href=\"https://grand-challenge.org/All_Challenges/\">https://grand-challenge.org/All_Challenges/</a> </p>\n\n<ul><li><a href=\"https://cs.adelaide.edu.au/~carneiro/multimodal.html\">https://cs.adelaide.edu.au/~carneiro/multimodal.html</a></li></ul></li>\n</ul>",
      "votes": null,
      "replies": [
        {
          "id": 284425,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "02/17/2018 04:42:39",
          "content": "<p>Thanks @Heng</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 519950,
          "author_name": "logicus",
          "author_url": "",
          "post_date": "04/19/2019 21:16:18",
          "content": "<p>Thanks. Really useful.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 270738,
      "author_name": "steelrose",
      "author_url": "",
      "post_date": "01/18/2018 20:06:54",
      "content": "<p>thank you, can confirm the score :)\nnow I have to learn pytorch, hope it's not too complicated vs. keras</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 271156,
      "author_name": "abnerchou",
      "author_url": "",
      "post_date": "01/19/2018 19:44:37",
      "content": "<p>Awesome! Thanks for sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 271379,
      "author_name": "yyll008",
      "author_url": "",
      "post_date": "01/20/2018 10:25:09",
      "content": "<p>0.0100   41.9 k  2005.57   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0027  0.0000 |  6 hr 09 min  41929,41929, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.62   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0064  0.0000 |  6 hr 09 min  41930,41930, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.67   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0030  0.0000 |  6 hr 09 min  41931,41931, torch.Size([32, 3, 256, 256])</p>\n\n<p>Something wrong?</p>",
      "votes": null,
      "replies": [
        {
          "id": 271380,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/20/2018 10:27:42",
          "content": "<p>what is your submission results?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 271408,
          "author_name": "yyll008",
          "author_url": "",
          "post_date": "01/20/2018 11:41:28",
          "content": "<p>00044700_model.pth LB 0.293,  00002500_model.pth LB 0.303</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 271479,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/20/2018 14:53:16",
          "content": "<p>results seems correct. Adjust iterations, learning rate and threshold at the submit.py() when making run length encoding from raw probability. If you have time you can add train augmentation as well</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 271482,
          "author_name": "yyll008",
          "author_url": "",
          "post_date": "01/20/2018 15:04:19",
          "content": "<p>Awesome work, Thank you very much!  I've learned a lot from you!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 271763,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/21/2018 11:06:48",
      "content": "<p>[version.0a] due Jan-30:</p>\n\n<ul>\n<li><p>extend to 3 class: predict foreground mask, boundary and center. This will facilitate labeling for instance segmentation.\nPreliminary results is shown below.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/271763/8331/3cls.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "votes": null,
      "replies": [
        {
          "id": 273072,
          "author_name": "transwarp",
          "author_url": "",
          "post_date": "01/24/2018 05:00:43",
          "content": "<p>well, thank you for your released code. and I am trying the 3-class , would you share the code that convert the binary mask map to 3-class mask? thank you</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 274880,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/27/2018 15:42:48",
          "content": "<p>This is discontinued. Please see [version.0b] due Jan-30 above. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 271841,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/21/2018 15:58:01",
      "content": "<p>post processing</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/271841/8332/post_process.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 271862,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/21/2018 17:37:11",
      "content": "<p>it is important to understand the metric score:</p>\n\n<p>below are my measurements based on the train set:</p>\n\n<p>(to be updated)</p>\n\n<p>ground truth:   AP = 1.0</p>\n\n<p>shift 1 pixel up = ...</p>\n\n<p>shift 1 pixel down = ...</p>\n\n<p>shift 2 pixel up = ...</p>\n\n<p>...</p>\n\n<p>expand 1 pixel = ...</p>\n\n<p>...</p>\n\n<p>shrink 1 pixel = ...</p>\n\n<p>...</p>\n\n<p>ground truth, but overlap nuclei are are labelled as single = .... 0.56? ...</p>\n\n<p>....</p>\n\n<p>ground truth, remove 1 (area ...) nuclei = ...</p>\n\n<p>ground truth, remove 2 (area ...) nuclei = ...</p>\n\n<p>....</p>\n\n<p>ground truth, add 1 nuclei (area ...) = ...</p>\n\n<p>ground truth, add 2 nuclei (area ...)  = ...</p>",
      "votes": null,
      "replies": [
        {
          "id": 271991,
          "author_name": "wayne999",
          "author_url": "",
          "post_date": "01/22/2018 02:52:59",
          "content": "<p>0.56 is amazing</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 272431,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/23/2018 03:07:25",
      "content": "<p>Someone just did what i want to do.</p>\n\n<p>Gan for nuclei segmentation</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/272431/8343/IMG_7663.PNG\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/272431/8342/IMG_7664.PNG\" alt=\"enter image description here\"></p>\n\n<p><a href=\"https://arxiv.org/abs/1801.07198\">https://arxiv.org/abs/1801.07198</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 278756,
          "author_name": "dskswu",
          "author_url": "",
          "post_date": "02/06/2018 22:37:24",
          "content": "<p>@Heng CherKeng Are you attempting to do the CycleGAN? </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 302514,
          "author_name": "zavodrobotov",
          "author_url": "",
          "post_date": "03/24/2018 08:06:45",
          "content": "<p>Is syntetic data generation working good here? Is it works for another tasks like object detection?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307429,
          "author_name": "thenickname",
          "author_url": "",
          "post_date": "04/01/2018 15:40:23",
          "content": "<p>Did these guys happen to have published their annotated dataset anywhere?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 272474,
      "author_name": "ppirrip",
      "author_url": "",
      "post_date": "01/23/2018 05:12:09",
      "content": "<p>a newbie question: If I want to run the starter code with no GPU support, would the experience be really painful, I mean more painful than installing Nvidia driver on Ubuntu? Seems like Pytorch complains that I don't have the driver installed and I am very hesitate in doing so.</p>\n\n<p>BTW, I am really looking forward to see you GAN implementation, since everyone is talking about GAN nowadays.</p>",
      "votes": null,
      "replies": [
        {
          "id": 272492,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/23/2018 05:56:36",
          "content": "<p>you can modify my code without gpu support. but i do not if it will work.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 272743,
          "author_name": "ppirrip",
          "author_url": "",
          "post_date": "01/23/2018 16:12:22",
          "content": "<p>thanks, I got the driver running and Pytorch seems happy. </p>\n\n<p>Have you seen this error before: \nOpenCV Error: Assertion failed (ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0) in resize, file /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/resize.cpp, line 3289</p>\n\n<p>Looks like is triggered from train_unet.py line 250 / 251\nfor tensors, masks, indices in train_loader:</p>\n\n<p>I think I set the path in common.py correctly and the PROJECT_PATH shows where the train_unet.py file is.</p>\n\n<p>EDIT: I think I issue is I don't know where to put the stage1_train. I tried to put it under split/ but doesn't work either</p>\n\n<p>EDIT:  I am missing the one_mask.png files now, after I ran the science_processing.py training ran. Now I got RuntimeError: CUDNN_STATUS_INTERNAL_ERROR, but that's for another story</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 273106,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/24/2018 06:25:49",
          "content": "<blockquote>\n  <blockquote>\n    <p>ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0 \n    i think image file path is wrong. When openCV reas invalid path,  it return a \"None array\" instead of error.\n    This \"None array\" causes error in future code.</p>\n  </blockquote>\n</blockquote>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 272655,
      "author_name": "hongta",
      "author_url": "",
      "post_date": "01/23/2018 12:07:41",
      "content": "<p>Any one try Facebook new library <a href=\"https://github.com/facebookresearch/Detectron\">https://github.com/facebookresearch/Detectron</a>?</p>",
      "votes": null,
      "replies": [
        {
          "id": 273023,
          "author_name": "wayne999",
          "author_url": "",
          "post_date": "01/24/2018 02:57:24",
          "content": "<p>Let's try it!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275623,
          "author_name": "ppirrip",
          "author_url": "",
          "post_date": "01/29/2018 16:40:48",
          "content": "<p>Have you actually try it? I am looking into it, but the computational requirement seems pretty high. Are you planning to run it on your local machine or a cloud somewhere?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 274454,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/26/2018 16:28:08",
      "content": "<p>you can try some synthetic images to see if your model can cover all angles, aspect and sizes. You can create such samples by distorting the real train images too.</p>\n\n<p>Here, i test if my model can detect the center and estimate a fitting ellipse  (i replaced the box prediction with ellipse prediction in methods like mask-rcnn and faster-rcnn)</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274454/8378/synthetic.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 274492,
          "author_name": "zeta2191622",
          "author_url": "",
          "post_date": "01/26/2018 17:52:18",
          "content": "<p>Great ideal!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 274883,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/27/2018 15:46:48",
      "content": "<p>[version.0b] due Feb-20 :</p>\n\n<ul>\n<li>switch to mask rcnn, two stage approach .</li>\n<li><p>you can find a preliminary version at the goggle drive in folder 20180127 (Warning: this is incomplete version, not all files in the project are working. But the \"train.py\" code is working and you can use it to train and produce a model, please see attacment pptx)</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274883/8385/Slide1.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274883/8386/Slide3.png\" alt=\"enter image description here\"></p></li>\n</ul>",
      "votes": null,
      "replies": [
        {
          "id": 274889,
          "author_name": "dskswu",
          "author_url": "",
          "post_date": "01/27/2018 16:29:19",
          "content": "<p>Awesome! Is this in pytorch?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 274890,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/27/2018 16:30:10",
          "content": "<p>yes</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275003,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/28/2018 02:07:39",
          "content": "<p>Just realised that there is a bug in estimation of the ellipse angle. The loss of the angle is not correct. Will fix it later.</p>\n\n<p>Current, the ellipse parameters to be predicted are : cx,cy (center), major_r, minor_r (radius) and angle (rotation). The angle should be changed to sin(angle) and cos(angle) instead.</p>\n\n<p>So there should be 6  ellipse parameters instead and all these 6 parameters can use L1_smooth loss (like faster rcnn)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275018,
          "author_name": "abnerchou",
          "author_url": "",
          "post_date": "01/28/2018 04:02:01",
          "content": "<p>Thanks for sharing the updated code. Learned a lot from them.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275020,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "01/28/2018 04:09:46",
          "content": "<p>I think there is a science_processing py file where you can find make extra or make more label function. You can search for np.save *.npy</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275814,
          "author_name": "lfraphael",
          "author_url": "",
          "post_date": "01/30/2018 03:08:47",
          "content": "<p>Nice!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 274893,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "01/27/2018 16:42:38",
      "content": "<p>seems that preliminary version [version.0b] is working. I attached some results on LB test set that is not used in training at all! This is at 4.4K iterations with learning rate 0.1. I will need to finetune with later learning rate later.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8397/336d3e4105766f8ad328a7ee9571e743f376f8cbcf6a969ca7e353fe3235c523.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8394/a984e7fb886aa02e29d112766d3ce26a4f78eac540ce7bbdbd42af2761928f6d.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/274893/8389/1ef68e93964c2d9230100c1347c328f6385a7bc027879dc3d4c055e6fe80cb3c.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 275279,
      "author_name": "yashk2810",
      "author_url": "",
      "post_date": "01/28/2018 16:31:32",
      "content": "<p>Hi, I have been trying to write my own Pytorch model, but the loss is not going down. It just keeps fluctuating between some values. I haven't been able to figure out why that's happening for the last three days. Any help is appreciated. I am attaching my jupyter notebook here. The code is pretty clean and the entire pytorch code is in the Pytorch Model Cell.</p>\n\n<p><a href=\"https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing\">https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 275690,
          "author_name": "zhenyuchen",
          "author_url": "",
          "post_date": "01/29/2018 20:00:35",
          "content": "<p>hi there, your pytorch model seems fine to me, but there might be something worth improving in the training step.\n1. your learning rate appears to be too high in this case, why don't you try 1e-4 instead?\n2. you might want to use global average loss rather that local loss, otherwise the loss will fluctuate around some big random number.\n3. why not using the naive CrossEntropyLoss provided by PyTorch instead of using self-extended BCELoss? It'd make things way easier for you.\n4. don't forget to split a validation set from your training set to validate the performance of your model.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 275520,
      "author_name": "tuanphuc",
      "author_url": "",
      "post_date": "01/29/2018 12:05:04",
      "content": "<p>Awesome, I started with a UNET and cannot get more than 0.303. Thanks for sharing.</p>",
      "votes": null,
      "replies": [
        {
          "id": 275571,
          "author_name": "yashk2810",
          "author_url": "",
          "post_date": "01/29/2018 14:08:04",
          "content": "<p>Can you please share your code?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275646,
          "author_name": "tuanphuc",
          "author_url": "",
          "post_date": "01/29/2018 17:42:18",
          "content": "<p>Hi, I use UNET with VGG16 as feature extractor inspired from this:  <a href=\"https://github.com/ternaus/TernausNet\">https://github.com/ternaus/TernausNet</a></p>\n\n<p>Hope this helps</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275651,
          "author_name": "yashk2810",
          "author_url": "",
          "post_date": "01/29/2018 17:59:57",
          "content": "<p>I just want to see how you load your data in pytorch. If you look at my code, my loss is not decreasing and I can't figure out why.\n<a href=\"https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing\">https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 275729,
          "author_name": "tuanphuc",
          "author_url": "",
          "post_date": "01/29/2018 21:33:59",
          "content": "<p>In fact I use Keras locally. Sorry that I can't help. Do you run on colab ?  <a href=\"https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q&amp;scrollTo=c99EvWo1s9-x\">Here</a> is an example on how to access to your drive from colab notebook. Then you can load data locally and save it into a pickle file, upload to your drive and access it from your notebook.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 281270,
          "author_name": "ianchan1990",
          "author_url": "",
          "post_date": "02/12/2018 11:36:37",
          "content": "<p>Hello, @tuanphuc. I'm trying to implement TernausNet too. Can I ask what's your performance (LB score) used TernausNet? How much improve compare to simple UNet?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 281653,
          "author_name": "tuanphuc",
          "author_url": "",
          "post_date": "02/12/2018 22:21:39",
          "content": "<p>Hi @ianchan1990, I tried TernausNet and it got me to around 0.330 in LB. In fact I used VGG16 instead of VGG11 as in the paper so the result is with respect to VGG16. I would like to know the score with VGG11 if you will try it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 277806,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "02/04/2018 11:59:44",
      "content": "<p>i try to write a pytorch mask-rcnn from scratch.</p>\n\n<p>Here are some results from rpn(red is before nms, white is after)  and rcnn (pink).</p>\n\n<p>original image patch has been contrasted enhanced to improve visibility. But such enhancement has not been used in training and testing.</p>",
      "votes": null,
      "replies": [
        {
          "id": 277812,
          "author_name": "john1231983",
          "author_url": "",
          "post_date": "02/04/2018 12:23:57",
          "content": "<p>Almost results show great performances. Good job. I also used mask-rcnn but tensorflow version (<a href=\"https://github.com/matterport/Mask_RCNN\">https://github.com/matterport/Mask_RCNN</a>) with resnet 50-FPN. But the performance is not so good now. Do you normalize image (from 0 to 1) before feeding to the network. Because I used pre-trained model, so I did not normalize image</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 277855,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "02/04/2018 16:10:50",
          "content": "<p>I try from scratch. I normalise 0,255 to 0,1. The cell nuclei are small. I don't think the mask rcnn can be used directly. Firstly, the amchor box should be made smaller. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 278120,
          "author_name": "timjoseph",
          "author_url": "",
          "post_date": "02/05/2018 12:11:37",
          "content": "<p>Are you going to open-source the Pytorch implementation? I am interested in also implementing Mask-RCNN in Pytorch...</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 278134,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "02/05/2018 12:53:19",
          "content": "<p>there is an incomplete version of pytorch mask-rcnn in the folder 20180205 of the google drive. do read the readme! it is used to produce the results shown.</p>\n\n<p>you can start from train.py in the main folder</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 287058,
          "author_name": "zjucor",
          "author_url": "",
          "post_date": "02/23/2018 11:56:25",
          "content": "<p>I use the same code, submit several times results in totally diverse result. Best got 0.37, worst got 0.25. Quite wired.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 278982,
      "author_name": "haroldlee",
      "author_url": "",
      "post_date": "02/07/2018 06:02:26",
      "content": "<p>Thanks for sharing your work !</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 279963,
      "author_name": "yyll008",
      "author_url": "",
      "post_date": "02/09/2018 02:02:52",
      "content": "<p>@Heng CherKeng Have you try VGG_U-net( <a href=\"https://github.com/ternaus/TernausNet\">https://github.com/ternaus/TernausNet</a>).\nI' ve got 0.351 with only unet, want to try import unet now.</p>",
      "votes": null,
      "replies": [
        {
          "id": 279969,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "02/09/2018 02:16:20",
          "content": "<p>i suggest you take the appoach:</p>\n\n<p>1) if you are using unet, note that this is semantic segmentation and not instance segmentation. i.e the nuclei will not be separated.</p>\n\n<p>2) what is the best score i can get if i do not separate the nuclei? for a set of validation image, create results for non-separating nuclei from the ground truth. Then measure the the performance metric. (I belive this is about 0.55 from my experiment)</p>\n\n<p>3) Now estimate human performance. e.g. you can re-annotate the traindata ground truth, or you can assume there is about say 0.5 pixel erosion/dilation and measure the results for your assumption. (In my experiment, this is about 0.45)</p>\n\n<p>4) train unet as usual. Measure preformance on validation set. I think the best results is about human performance.</p>\n\n<p>5) make a submission. the difference from LB score to validation score is then the generalisation problem.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 280618,
      "author_name": "abnerchou",
      "author_url": "",
      "post_date": "02/10/2018 13:38:58",
      "content": "<p>The run_length_decode function is incorrect as the result is not transposed. </p>\n\n<p>Here is modified one:</p>\n\n<pre><code>def run_length_decode(rel, H, W, fill_value=255):\n    mask = np.zeros((H * W), np.uint8)\n    rel = np.array([int(s) for s in rel.split(' ')]).reshape(-1, 2)\n    for r in rel:\n        start = r[0]\n        end = start + r[1]\n        mask[start : end] = fill_value\n    mask = mask.reshape(W, H).T # H, W need to swap as transposing. \n    return mask\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 284721,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "02/18/2018 04:25:14",
          "content": "<p>this function is not correct. there is some pixel shift. here is a checking code:</p>\n\n<pre><code>def run_check_run_length_decode():\n\nname = 'b98681c74842c4058bd2f88b06063731c26a90da083b1ef348e0ec734c58752b'\n\nnpy_file = DATA_DIR + '/image/stage1_train/' + name + '/multi_mask.npy'\nmulti_mask = np.load(npy_file)\nH,W = multi_mask.shape[:2]\n\ncvs_EncodedPixels = []\nnum =int( multi_mask.max())\nfor m in range(num):\n    rle = run_length_encode(multi_mask==m+1)\n    cvs_EncodedPixels.append(rle)\n\n\n\n#reference encoding from 'stage1_train_labels.csv'\ndf = pd.read_csv (DATA_DIR + '/__download__/stage1_train_labels.csv')\ndf = df.loc[df['ImageId'] == name]\n\nreference_cvs_EncodedPixels = df['EncodedPixels'].values\nreference_cvs_EncodedPixels.sort()\n\nreference_multi_mask = np.zeros((H, W), np.int32)\nfor rle in reference_cvs_EncodedPixels:\n    thresh = run_length_decode(rle, H, W, fill_value=255)\n    id = cvs_EncodedPixels.index(rle)\n    reference_multi_mask[thresh&gt;128] = id+1\n\n\n\nreference_multi_mask = reference_multi_mask.astype(np.float32)\nreference_multi_mask = reference_multi_mask/reference_multi_mask.max()*255\nmulti_mask = multi_mask.astype(np.float32)\nmulti_mask = multi_mask/multi_mask.max()*255\n\n\nprint((reference_multi_mask!=multi_mask).sum())\n\nimage_show('multi_mask', multi_mask,2)\nimage_show('reference_multi_mask', reference_multi_mask,2)\nimage_show('diff', (reference_multi_mask!=multi_mask)*255,2)\ncv2.waitKey(0)\n</code></pre>",
          "votes": null,
          "replies": []
        },
        {
          "id": 284722,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "02/18/2018 04:27:34",
          "content": "<p>the correct decoding function should be</p>\n\n<pre><code>def run_length_decode(rle, H, W, fill_value=255):\n\nmask = np.zeros((H * W), np.uint8)\nrle = np.array([int(s) for s in rle.split(' ')]).reshape(-1, 2)\nfor r in rle:\n    start = r[0]-1\n    end = start + r[1]\n    mask[start : end] = fill_value\nmask = mask.reshape(W, H).T # H, W need to swap as transposing.\nreturn mask\n</code></pre>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 290564,
      "author_name": "fidget",
      "author_url": "",
      "post_date": "03/04/2018 12:43:45",
      "content": "",
      "votes": null,
      "replies": []
    },
    {
      "id": 291911,
      "author_name": "rafaelriverasoto",
      "author_url": "",
      "post_date": "03/07/2018 04:37:51",
      "content": "<p>I have a PyTorch UNET implementation that doesn't seem to perform better than 0.195 LB. Any tips on what I might need to do in order to get it to work? </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "270069": "As usual, my starter kit post .... stay tuned .....\n\n(to be updated)\n\n--------------------------------------------------------------------------------\ncode download:  https://drive.google.com/drive/folders/1EtBdlPK3BVahHBZtB103QQxNUdWaJ6di\n\n- [version.0] Jan-21:  a basic Unet version. Predict mask and use connected component labelled. Able to achieve LB 0.311. (With train augmentation, fine-tunning etc, it can reach 0.325)\n\n- [version.0a] ABORTED!:  Predict mask, boundary and centers facilitate labeling for instance segmentation  \n\n- [version.0b] Feb-20:  Nuclei detection first, then crop and segment. Following 2-stage mask rcnn approach.\n\n \n...\n\n\n[version.x due] Feb-28: GAN for data generation,  LB score predictor",
    "270550": "[version.0] due Jan-21:  \n\n - a preliminary version is found at folder \"[google_drive]/20180116\". It is dirty code and will be clean up soon. Achieved LB=0.311. \n\n - example of convergence of training iterations: \n https://drive.google.com/open?id=1ZdNzQOTR83vrqNPeynUYuelWFRxJ-35i\n\n \n [train_iter_no]-[batch_no].png\n\n  ![enter image description here][1]\n\n\n  ![enter image description here][2]\n   \n  \n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/270550/8298/00000000-014.png\n\n  [2]:https://kaggle2.blob.core.windows.net/forum-message-attachments/270550/8299/00000027-013.png",
    "270556": "All Useful development tools here\n \n-  https://github.com/PaddlePaddle/visualdl",
    "270572": "Awesome! Nice work. 😎",
    "270685": "All GAN resources here!\n\n - https://arxiv.org/pdf/1709.05860.pdf\n\n -  https://www.biorxiv.org/content/biorxiv/early/2017/12/02/227645.full.pdf\n\n -  https://arxiv.org/pdf/1711.11317.pdf\n\n -  https://github.com/Saurabh23/mSRGAN-A-GAN-for-single-image-super-resolution-on-high-content-screening-microscopy-images.\n\n---\n\"Unsupervised Histopathology Image Synthesis\"\n\nhttps://arxiv.org/pdf/1712.05021.pdf\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/270685/8406/gan.png",
    "270694": "All useful domain knowledge here!\n\n - http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2016;volume=7;issue=1;spage=29;epage=29;aulast=Janowczyk\n\n - http://www.andrewjanowczyk.com/use-case-1-nuclei-segmentation/, http://www.andrewjanowczyk.com/radhical/, etc\n\n - https://www.nature.com/news/machine-learning-predicts-the-look-of-stem-cells-1.21769\n\n - https://blogs.nvidia.com/blog/2015/12/23/deep-learning-cancer/\n\n - https://warwick.ac.uk/fac/sci/dcs/research/tia/glascontest/  (see presentation slides)\n\n - https://grand-challenge.org/All_Challenges/ \n \n- https://cs.adelaide.edu.au/~carneiro/multimodal.html",
    "270738": "thank you, can confirm the score :)\nnow I have to learn pytorch, hope it's not too complicated vs. keras",
    "271156": "Awesome! Thanks for sharing.",
    "271379": "0.0100   41.9 k  2005.57   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0027  0.0000 |  6 hr 09 min  41929,41929, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.62   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0064  0.0000 |  6 hr 09 min  41930,41930, torch.Size([32, 3, 256, 256])\n0.0100   41.9 k  2005.67   1.3 | 0.0022  0.0000 | 0.0030  0.0000 | 0.0030  0.0000 |  6 hr 09 min  41931,41931, torch.Size([32, 3, 256, 256])\n\nSomething wrong?",
    "271380": "what is your submission results?",
    "271408": "00044700_model.pth LB 0.293,  00002500_model.pth LB 0.303",
    "271479": "results seems correct. Adjust iterations, learning rate and threshold at the submit.py() when making run length encoding from raw probability. If you have time you can add train augmentation as well",
    "271482": "Awesome work, Thank you very much!  I've learned a lot from you!",
    "271763": "[version.0a] due Jan-30:\n\n - extend to 3 class: predict foreground mask, boundary and center. This will facilitate labeling for instance segmentation.\nPreliminary results is shown below.\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/271763/8331/3cls.png",
    "271766": "this code is dirty, but can run and is not difficult to expand and improve.\n\ni decide not to clean up the code but instead go to the next version (version.0a). This is because I find that even if I get the perfect mask, watershed do not give perfect results. Hence I would like to predict boundary and center and mask and see how i can do a better post processing for instance segmentation.",
    "271841": "post processing\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/271841/8332/post_process.png",
    "271862": "it is important to understand the metric score:\n\nbelow are my measurements based on the train set:\n\n(to be updated)\n\nground truth:   AP = 1.0\n\nshift 1 pixel up = ...\n\nshift 1 pixel down = ...\n\nshift 2 pixel up = ...\n\n...\n\nexpand 1 pixel = ...\n\n...\n\nshrink 1 pixel = ...\n\n...\n\nground truth, but overlap nuclei are are labelled as single = .... 0.56? ...\n\n....\n\nground truth, remove 1 (area ...) nuclei = ...\n\n\nground truth, remove 2 (area ...) nuclei = ...\n\n\n....\n\nground truth, add 1 nuclei (area ...) = ...\n\n\nground truth, add 2 nuclei (area ...)  = ...",
    "271991": "0.56 is amazing",
    "272431": "Someone just did what i want to do.\n\nGan for nuclei segmentation\n\n ![enter image description here][1]\n\n ![enter image description here][2]\n\nhttps://arxiv.org/abs/1801.07198\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/272431/8343/IMG_7663.PNG\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/272431/8342/IMG_7664.PNG",
    "272474": "a newbie question: If I want to run the starter code with no GPU support, would the experience be really painful, I mean more painful than installing Nvidia driver on Ubuntu? Seems like Pytorch complains that I don't have the driver installed and I am very hesitate in doing so.\n\nBTW, I am really looking forward to see you GAN implementation, since everyone is talking about GAN nowadays.",
    "272492": "you can modify my code without gpu support. but i do not if it will work.",
    "272655": "Any one try Facebook new library https://github.com/facebookresearch/Detectron?",
    "272743": "thanks, I got the driver running and Pytorch seems happy. \n\nHave you seen this error before: \nOpenCV Error: Assertion failed (ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0) in resize, file /tmp/build/80754af9/opencv_1512687413662/work/modules/imgproc/src/resize.cpp, line 3289\n\nLooks like is triggered from train_unet.py line 250 / 251\nfor tensors, masks, indices in train_loader:\n\nI think I set the path in common.py correctly and the PROJECT_PATH shows where the train_unet.py file is.\n\nEDIT: I think I issue is I don't know where to put the stage1_train. I tried to put it under split/ but doesn't work either\n\nEDIT:  I am missing the one_mask.png files now, after I ran the science_processing.py training ran. Now I got RuntimeError: CUDNN_STATUS_INTERNAL_ERROR, but that's for another story",
    "272814": "Very useful, thanks!\nthe github link seems dead. working from here: https://github.com/Saurabh23",
    "273023": "Let's try it!",
    "273072": "well, thank you for your released code. and I am trying the 3-class , would you share the code that convert the binary mask map to 3-class mask? thank you",
    "273106": "&gt;&gt; ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0 \ni think image file path is wrong. When openCV reas invalid path,  it return a \"None array\" instead of error.\nThis \"None array\" causes error in future code.",
    "274454": "you can try some synthetic images to see if your model can cover all angles, aspect and sizes. You can create such samples by distorting the real train images too.\n\nHere, i test if my model can detect the center and estimate a fitting ellipse  (i replaced the box prediction with ellipse prediction in methods like mask-rcnn and faster-rcnn)\n\n  ![enter image description here][1]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274454/8378/synthetic.png",
    "274492": "Great ideal!",
    "274880": "This is discontinued. Please see [version.0b] due Jan-30 above.",
    "274883": "[version.0b] due Feb-20 :\n\n - switch to mask rcnn, two stage approach .\n - you can find a preliminary version at the goggle drive in folder 20180127 (Warning: this is incomplete version, not all files in the project are working. But the \"train.py\" code is working and you can use it to train and produce a model, please see attacment pptx)\n\n\n  ![enter image description here][1]\n\n  ![enter image description here][2]\n  \n\n    \n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274883/8385/Slide1.png\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274883/8386/Slide3.png",
    "274889": "Awesome! Is this in pytorch?",
    "274890": "yes",
    "274893": "seems that preliminary version [version.0b] is working. I attached some results on LB test set that is not used in training at all! This is at 4.4K iterations with learning rate 0.1. I will need to finetune with later learning rate later.\n\n ![enter image description here][1]\n\n ![enter image description here][2]\n\n ![enter image description here][3]\n\n\n  [1]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8397/336d3e4105766f8ad328a7ee9571e743f376f8cbcf6a969ca7e353fe3235c523.png\n  [2]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8394/a984e7fb886aa02e29d112766d3ce26a4f78eac540ce7bbdbd42af2761928f6d.png\n  [3]: https://kaggle2.blob.core.windows.net/forum-message-attachments/274893/8389/1ef68e93964c2d9230100c1347c328f6385a7bc027879dc3d4c055e6fe80cb3c.png",
    "275003": "Just realised that there is a bug in estimation of the ellipse angle. The loss of the angle is not correct. Will fix it later.\n\nCurrent, the ellipse parameters to be predicted are : cx,cy (center), major_r, minor_r (radius) and angle (rotation). The angle should be changed to sin(angle) and cos(angle) instead.\n\nSo there should be 6  ellipse parameters instead and all these 6 parameters can use L1_smooth loss (like faster rcnn)",
    "275018": "Thanks for sharing the updated code. Learned a lot from them.",
    "275020": "I think there is a science_processing py file where you can find make extra or make more label function. You can search for np.save *.npy",
    "275279": "Hi, I have been trying to write my own Pytorch model, but the loss is not going down. It just keeps fluctuating between some values. I haven't been able to figure out why that's happening for the last three days. Any help is appreciated. I am attaching my jupyter notebook here. The code is pretty clean and the entire pytorch code is in the Pytorch Model Cell.\n\nhttps://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing",
    "275520": "Awesome, I started with a UNET and cannot get more than 0.303. Thanks for sharing.",
    "275571": "Can you please share your code?",
    "275623": "Have you actually try it? I am looking into it, but the computational requirement seems pretty high. Are you planning to run it on your local machine or a cloud somewhere?",
    "275646": "Hi, I use UNET with VGG16 as feature extractor inspired from this:  https://github.com/ternaus/TernausNet\n\nHope this helps",
    "275651": "I just want to see how you load your data in pytorch. If you look at my code, my loss is not decreasing and I can't figure out why.\n[https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing][1]\n\n\n  [1]: https://drive.google.com/file/d/1ZrwYiyddRsT6Hi9iemGIXn-Y5PhwmBqR/view?usp=sharing",
    "275690": "hi there, your pytorch model seems fine to me, but there might be something worth improving in the training step.\n1. your learning rate appears to be too high in this case, why don't you try 1e-4 instead?\n2. you might want to use global average loss rather that local loss, otherwise the loss will fluctuate around some big random number.\n3. why not using the naive CrossEntropyLoss provided by PyTorch instead of using self-extended BCELoss? It'd make things way easier for you.\n4. don't forget to split a validation set from your training set to validate the performance of your model.",
    "275729": "In fact I use Keras locally. Sorry that I can't help. Do you run on colab ?  [Here][1] is an example on how to access to your drive from colab notebook. Then you can load data locally and save it into a pickle file, upload to your drive and access it from your notebook.\n  [1]: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q&amp;scrollTo=c99EvWo1s9-x",
    "275814": "Nice!",
    "277806": "i try to write a pytorch mask-rcnn from scratch.\n\nHere are some results from rpn(red is before nms, white is after)  and rcnn (pink).\n\noriginal image patch has been contrasted enhanced to improve visibility. But such enhancement has not been used in training and testing.",
    "277812": "Almost results show great performances. Good job. I also used mask-rcnn but tensorflow version (https://github.com/matterport/Mask_RCNN) with resnet 50-FPN. But the performance is not so good now. Do you normalize image (from 0 to 1) before feeding to the network. Because I used pre-trained model, so I did not normalize image",
    "277855": "I try from scratch. I normalise 0,255 to 0,1. The cell nuclei are small. I don't think the mask rcnn can be used directly. Firstly, the amchor box should be made smaller.",
    "278120": "Are you going to open-source the Pytorch implementation? I am interested in also implementing Mask-RCNN in Pytorch...",
    "278134": "there is an incomplete version of pytorch mask-rcnn in the folder 20180205 of the google drive. do read the readme! it is used to produce the results shown.\n\nyou can start from train.py in the main folder",
    "278756": "Heng CherKeng Are you attempting to do the CycleGAN?",
    "278982": "Thanks for sharing your work !",
    "279963": "Heng CherKeng Have you try VGG_U-net( https://github.com/ternaus/TernausNet).\nI' ve got 0.351 with only unet, want to try import unet now.",
    "279969": "i suggest you take the appoach:\n\n1) if you are using unet, note that this is semantic segmentation and not instance segmentation. i.e the nuclei will not be separated.\n\n2) what is the best score i can get if i do not separate the nuclei? for a set of validation image, create results for non-separating nuclei from the ground truth. Then measure the the performance metric. (I belive this is about 0.55 from my experiment)\n\n3) Now estimate human performance. e.g. you can re-annotate the traindata ground truth, or you can assume there is about say 0.5 pixel erosion/dilation and measure the results for your assumption. (In my experiment, this is about 0.45)\n\n4) train unet as usual. Measure preformance on validation set. I think the best results is about human performance.\n\n5) make a submission. the difference from LB score to validation score is then the generalisation problem.",
    "280618": "The run_length_decode function is incorrect as the result is not transposed. \n\nHere is modified one:\n\n    def run_length_decode(rel, H, W, fill_value=255):\n        mask = np.zeros((H * W), np.uint8)\n        rel = np.array([int(s) for s in rel.split(' ')]).reshape(-1, 2)\n        for r in rel:\n            start = r[0]\n            end = start + r[1]\n            mask[start : end] = fill_value\n        mask = mask.reshape(W, H).T # H, W need to swap as transposing. \n        return mask",
    "281270": "Hello, @tuanphuc. I'm trying to implement TernausNet too. Can I ask what's your performance (LB score) used TernausNet? How much improve compare to simple UNet?",
    "281653": "Hi @ianchan1990, I tried TernausNet and it got me to around 0.330 in LB. In fact I used VGG16 instead of VGG11 as in the paper so the result is with respect to VGG16. I would like to know the score with VGG11 if you will try it.",
    "284425": "Thanks @Heng",
    "284428": "Heng thanks again these are very useful.",
    "284721": "this function is not correct. there is some pixel shift. here is a checking code:\n\n    def run_check_run_length_decode():\n\n    name = 'b98681c74842c4058bd2f88b06063731c26a90da083b1ef348e0ec734c58752b'\n\n    npy_file = DATA_DIR + '/image/stage1_train/' + name + '/multi_mask.npy'\n    multi_mask = np.load(npy_file)\n    H,W = multi_mask.shape[:2]\n\n    cvs_EncodedPixels = []\n    num =int( multi_mask.max())\n    for m in range(num):\n        rle = run_length_encode(multi_mask==m+1)\n        cvs_EncodedPixels.append(rle)\n\n\n\n    #reference encoding from 'stage1_train_labels.csv'\n    df = pd.read_csv (DATA_DIR + '/__download__/stage1_train_labels.csv')\n    df = df.loc[df['ImageId'] == name]\n\n    reference_cvs_EncodedPixels = df['EncodedPixels'].values\n    reference_cvs_EncodedPixels.sort()\n\n    reference_multi_mask = np.zeros((H, W), np.int32)\n    for rle in reference_cvs_EncodedPixels:\n        thresh = run_length_decode(rle, H, W, fill_value=255)\n        id = cvs_EncodedPixels.index(rle)\n        reference_multi_mask[thresh&gt;128] = id+1\n\n\n\n    reference_multi_mask = reference_multi_mask.astype(np.float32)\n    reference_multi_mask = reference_multi_mask/reference_multi_mask.max()*255\n    multi_mask = multi_mask.astype(np.float32)\n    multi_mask = multi_mask/multi_mask.max()*255\n\n\n    print((reference_multi_mask!=multi_mask).sum())\n\n    image_show('multi_mask', multi_mask,2)\n    image_show('reference_multi_mask', reference_multi_mask,2)\n    image_show('diff', (reference_multi_mask!=multi_mask)*255,2)\n    cv2.waitKey(0)",
    "284722": "the correct decoding function should be\n\n    def run_length_decode(rle, H, W, fill_value=255):\n\n    mask = np.zeros((H * W), np.uint8)\n    rle = np.array([int(s) for s in rle.split(' ')]).reshape(-1, 2)\n    for r in rle:\n        start = r[0]-1\n        end = start + r[1]\n        mask[start : end] = fill_value\n    mask = mask.reshape(W, H).T # H, W need to swap as transposing.\n    return mask",
    "287058": "I use the same code, submit several times results in totally diverse result. Best got 0.37, worst got 0.25. Quite wired.",
    "290564": "",
    "291911": "I have a PyTorch UNET implementation that doesn't seem to perform better than 0.195 LB. Any tips on what I might need to do in order to get it to work?",
    "302514": "Is syntetic data generation working good here? Is it works for another tasks like object detection?",
    "307429": "Did these guys happen to have published their annotated dataset anywhere?",
    "519950": "Thanks. Really useful."
  },
  "source": "meta"
}