{
  "id": 50000,
  "title": "Be aware  green bean attacks ¡",
  "url": "/competitions/data-science-bowl-2018/discussion/50000",
  "author_name": "",
  "post_date": "2018-02-17T22:24:06.528066200Z",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p>OK, just to set  the context.</p>\n\n<p>I am learning  and recently have been taking some on-line training ( actually a ton of them) . I am not in a position to spend  hundreds  of dollars in AWS, hence my proposal may sound a bit out of place.</p>\n\n<p>But Hey, It is a good training.</p>\n\n<p>I would explain the steps I have taken and why. Opinion and advice to steer to better direction appreciated. Just be aware I will be running the stuff on a 4 years old corei7 with powerless nvidia gpu. Can’t do u-net or that kind of stuff. I am using  Python/Keras/TF.</p>\n\n<p>•   I was surprised as to how different in sizes and aspect ratio were the images,  not only  within training but how different are training and test sets. </p>\n\n<p>My decision has been to make all images  to 256x256 pixel.  I have padded (with zeros)  all images larger than  that size to multiple of 256 and then created tiles of them.</p>\n\n<p>One benefit is that training size is larger now with some 2200 images that happily go into a NN. After data augmentation (rotations/flips you get 18.000 images….. which is an improvement with regard the original training set).</p>\n\n<p>This is very easy to stitch back together without a lot of science to make predictions and a submission.</p>\n\n<p>•   I thought the approach of getting the predicted masks would be too hard to achieve with my resources. I considered as well that the less parameters I need to learn , the better. Browsing through many of the images I came to the conclusion that a large majority could be approximated pretty well by an ellipse.  What about instead of predicting the actual shape, approximate an ellipse to each of the masks ? It is only 5 parameter. Posx,posy,a,b,theta. And you get the identities.</p>\n\n<p>I reflected on taking an approach like the YOLO algorithm, used in autonomous driving object detection. Only that instead of approximating boxes ( 5  params (prob,x,y,a,b ) this time I have labels with 6  ( prob,x,y,a,b,theta)). Ideally I wanted to reuse the architecture  and weights of the trained model and then who knows…..</p>\n\n<p>Looking at the size of many of the nucleus I saw that a good average was about 9-12 pixels. Given the size of my tiles I decided to go for a 16x16 grid to generate my (volume) labels. I used max suppression to clean cell duplicates. I only got some 1.200 cases with more than 1 nucleus in my cells witch I consider pretty  good ratio.</p>\n\n<p>The useful thing about the YOLO approach is that it is a fully “convolutional” one step process.</p>\n\n<p>•   Eventually this could work well in an ensemble if I could reduce the area of interest to a set of very small well demarcated area (focus) to then, later, apply another method for the precise area delineation.</p>\n\n<p>I am half way through the story. The yolo architecture blows away my computer. I am taking smaller VGG like approaches for now… but they take more than 2 days to run. I was considering (as I have seen in the kernels)  convert everything into B&amp;W plus reduce dimensions to 128x128. This won’t generate many artifacts. I could even go to 64x64 just to experiment with the right model and then rescale for larger inputs without much inconvenience.</p>\n\n<p>This won’t take you anywhere in the leader board…. But it is a lot of fun!</p>\n\n<p>Comments welcome.</p>\n\n<p>Cheers.</p>\n\n<p>Julian</p>",
  "messages": [
    {
      "id": "284675",
      "postDate": "02/17/2018 22:24:06",
      "content": "<p>OK, just to set  the context.</p>\n\n<p>I am learning  and recently have been taking some on-line training ( actually a ton of them) . I am not in a position to spend  hundreds  of dollars in AWS, hence my proposal may sound a bit out of place.</p>\n\n<p>But Hey, It is a good training.</p>\n\n<p>I would explain the steps I have taken and why. Opinion and advice to steer to better direction appreciated. Just be aware I will be running the stuff on a 4 years old corei7 with powerless nvidia gpu. Can’t do u-net or that kind of stuff. I am using  Python/Keras/TF.</p>\n\n<p>•   I was surprised as to how different in sizes and aspect ratio were the images,  not only  within training but how different are training and test sets. </p>\n\n<p>My decision has been to make all images  to 256x256 pixel.  I have padded (with zeros)  all images larger than  that size to multiple of 256 and then created tiles of them.</p>\n\n<p>One benefit is that training size is larger now with some 2200 images that happily go into a NN. After data augmentation (rotations/flips you get 18.000 images….. which is an improvement with regard the original training set).</p>\n\n<p>This is very easy to stitch back together without a lot of science to make predictions and a submission.</p>\n\n<p>•   I thought the approach of getting the predicted masks would be too hard to achieve with my resources. I considered as well that the less parameters I need to learn , the better. Browsing through many of the images I came to the conclusion that a large majority could be approximated pretty well by an ellipse.  What about instead of predicting the actual shape, approximate an ellipse to each of the masks ? It is only 5 parameter. Posx,posy,a,b,theta. And you get the identities.</p>\n\n<p>I reflected on taking an approach like the YOLO algorithm, used in autonomous driving object detection. Only that instead of approximating boxes ( 5  params (prob,x,y,a,b ) this time I have labels with 6  ( prob,x,y,a,b,theta)). Ideally I wanted to reuse the architecture  and weights of the trained model and then who knows…..</p>\n\n<p>Looking at the size of many of the nucleus I saw that a good average was about 9-12 pixels. Given the size of my tiles I decided to go for a 16x16 grid to generate my (volume) labels. I used max suppression to clean cell duplicates. I only got some 1.200 cases with more than 1 nucleus in my cells witch I consider pretty  good ratio.</p>\n\n<p>The useful thing about the YOLO approach is that it is a fully “convolutional” one step process.</p>\n\n<p>•   Eventually this could work well in an ensemble if I could reduce the area of interest to a set of very small well demarcated area (focus) to then, later, apply another method for the precise area delineation.</p>\n\n<p>I am half way through the story. The yolo architecture blows away my computer. I am taking smaller VGG like approaches for now… but they take more than 2 days to run. I was considering (as I have seen in the kernels)  convert everything into B&amp;W plus reduce dimensions to 128x128. This won’t generate many artifacts. I could even go to 64x64 just to experiment with the right model and then rescale for larger inputs without much inconvenience.</p>\n\n<p>This won’t take you anywhere in the leader board…. But it is a lot of fun!</p>\n\n<p>Comments welcome.</p>\n\n<p>Cheers.</p>\n\n<p>Julian</p>",
      "rawMarkdown": "OK, just to set  the context.\n\n I am learning  and recently have been taking some on-line training ( actually a ton of them) . I am not in a position to spend  hundreds  of dollars in AWS, hence my proposal may sound a bit out of place.\n\n But Hey, It is a good training.\n\nI would explain the steps I have taken and why. Opinion and advice to steer to better direction appreciated. Just be aware I will be running the stuff on a 4 years old corei7 with powerless nvidia gpu. Can’t do u-net or that kind of stuff. I am using  Python/Keras/TF.\n\n•\tI was surprised as to how different in sizes and aspect ratio were the images,  not only  within training but how different are training and test sets. \n\nMy decision has been to make all images  to 256x256 pixel.  I have padded (with zeros)  all images larger than  that size to multiple of 256 and then created tiles of them.\n\n One benefit is that training size is larger now with some 2200 images that happily go into a NN. After data augmentation (rotations/flips you get 18.000 images….. which is an improvement with regard the original training set).\n\n This is very easy to stitch back together without a lot of science to make predictions and a submission.\n\n•\tI thought the approach of getting the predicted masks would be too hard to achieve with my resources. I considered as well that the less parameters I need to learn , the better. Browsing through many of the images I came to the conclusion that a large majority could be approximated pretty well by an ellipse.  What about instead of predicting the actual shape, approximate an ellipse to each of the masks ? It is only 5 parameter. Posx,posy,a,b,theta. And you get the identities.\n\nI reflected on taking an approach like the YOLO algorithm, used in autonomous driving object detection. Only that instead of approximating boxes ( 5  params (prob,x,y,a,b ) this time I have labels with 6  ( prob,x,y,a,b,theta)). Ideally I wanted to reuse the architecture  and weights of the trained model and then who knows…..\n\n Looking at the size of many of the nucleus I saw that a good average was about 9-12 pixels. Given the size of my tiles I decided to go for a 16x16 grid to generate my (volume) labels. I used max suppression to clean cell duplicates. I only got some 1.200 cases with more than 1 nucleus in my cells witch I consider pretty  good ratio.\n\nThe useful thing about the YOLO approach is that it is a fully “convolutional” one step process.\n\n•\tEventually this could work well in an ensemble if I could reduce the area of interest to a set of very small well demarcated area (focus) to then, later, apply another method for the precise area delineation.\n\nI am half way through the story. The yolo architecture blows away my computer. I am taking smaller VGG like approaches for now… but they take more than 2 days to run. I was considering (as I have seen in the kernels)  convert everything into B&amp;W plus reduce dimensions to 128x128. This won’t generate many artifacts. I could even go to 64x64 just to experiment with the right model and then rescale for larger inputs without much inconvenience.\n\nThis won’t take you anywhere in the leader board…. But it is a lot of fun!\n\nComments welcome.\n\nCheers.\n\nJulian",
      "votes": null
    },
    {
      "id": "284699",
      "postDate": "02/18/2018 00:58:04",
      "content": "<p>Hey Julian, \nIf your looking for free computation power in the form of a GPU, this might help:</p>\n\n<ul>\n<li><a href=\"https://worksheets.codalab.org/\">https://worksheets.codalab.org/</a></li>\n<li><a href=\"https://colab.research.google.com/\">https://colab.research.google.com/</a></li>\n</ul>\n\n<p>Both come with free GPU support, codalab offers more CPUs I think:</p>\n\n<ul>\n<li><a href=\"https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers\">https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers</a></li>\n</ul>",
      "rawMarkdown": "Hey Julian, \nIf your looking for free computation power in the form of a GPU, this might help:\n\n - https://worksheets.codalab.org/\n - https://colab.research.google.com/\n\nBoth come with free GPU support, codalab offers more CPUs I think:\n\n - https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers",
      "votes": null
    },
    {
      "id": "284703",
      "postDate": "02/18/2018 01:11:40",
      "content": "<p>yolo is good for study purpose，but it should have drawbacks about position precision.</p>",
      "rawMarkdown": "yolo is good for study purpose，but it should have drawbacks about position precision.",
      "votes": null
    },
    {
      "id": "284752",
      "postDate": "02/18/2018 07:34:56",
      "content": "<p>Thanks will look into this. !</p>",
      "rawMarkdown": "Thanks will look into this. !",
      "votes": null
    },
    {
      "id": "284753",
      "postDate": "02/18/2018 07:38:21",
      "content": "<p>this looks good enough for me to start.</p>\n\n<p><a href=\"https://www.youtube.com/watch?v=VOC3huqHrss\">https://www.youtube.com/watch?v=VOC3huqHrss</a></p>\n\n<p>I even like the music ;-)</p>",
      "rawMarkdown": "this looks good enough for me to start.\n\nhttps://www.youtube.com/watch?v=VOC3huqHrss\n\nI even like the music ;-)",
      "votes": null
    },
    {
      "id": "284763",
      "postDate": "02/18/2018 08:49:04",
      "content": "<p>Haha, I like it, especially this frame:\n<img src=\"https://s13.postimg.org/oa4jrcq9j/Screenshot_from_2018-02-18_12-45-45.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "Haha, I like it, especially this frame:\n![enter image description here][1]\n\n\n  [1]: https://s13.postimg.org/oa4jrcq9j/Screenshot_from_2018-02-18_12-45-45.png",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 284699,
      "author_name": "livingprogram",
      "author_url": "",
      "post_date": "02/18/2018 00:58:04",
      "content": "<p>Hey Julian, \nIf your looking for free computation power in the form of a GPU, this might help:</p>\n\n<ul>\n<li><a href=\"https://worksheets.codalab.org/\">https://worksheets.codalab.org/</a></li>\n<li><a href=\"https://colab.research.google.com/\">https://colab.research.google.com/</a></li>\n</ul>\n\n<p>Both come with free GPU support, codalab offers more CPUs I think:</p>\n\n<ul>\n<li><a href=\"https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers\">https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers</a></li>\n</ul>",
      "votes": null,
      "replies": [
        {
          "id": 284752,
          "author_name": "julcol",
          "author_url": "",
          "post_date": "02/18/2018 07:34:56",
          "content": "<p>Thanks will look into this. !</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 284703,
      "author_name": "amxineohp",
      "author_url": "",
      "post_date": "02/18/2018 01:11:40",
      "content": "<p>yolo is good for study purpose，but it should have drawbacks about position precision.</p>",
      "votes": null,
      "replies": [
        {
          "id": 284753,
          "author_name": "julcol",
          "author_url": "",
          "post_date": "02/18/2018 07:38:21",
          "content": "<p>this looks good enough for me to start.</p>\n\n<p><a href=\"https://www.youtube.com/watch?v=VOC3huqHrss\">https://www.youtube.com/watch?v=VOC3huqHrss</a></p>\n\n<p>I even like the music ;-)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 284763,
          "author_name": "mrtzmilani",
          "author_url": "",
          "post_date": "02/18/2018 08:49:04",
          "content": "<p>Haha, I like it, especially this frame:\n<img src=\"https://s13.postimg.org/oa4jrcq9j/Screenshot_from_2018-02-18_12-45-45.png\" alt=\"enter image description here\"></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "284675": "OK, just to set  the context.\n\n I am learning  and recently have been taking some on-line training ( actually a ton of them) . I am not in a position to spend  hundreds  of dollars in AWS, hence my proposal may sound a bit out of place.\n\n But Hey, It is a good training.\n\nI would explain the steps I have taken and why. Opinion and advice to steer to better direction appreciated. Just be aware I will be running the stuff on a 4 years old corei7 with powerless nvidia gpu. Can’t do u-net or that kind of stuff. I am using  Python/Keras/TF.\n\n•\tI was surprised as to how different in sizes and aspect ratio were the images,  not only  within training but how different are training and test sets. \n\nMy decision has been to make all images  to 256x256 pixel.  I have padded (with zeros)  all images larger than  that size to multiple of 256 and then created tiles of them.\n\n One benefit is that training size is larger now with some 2200 images that happily go into a NN. After data augmentation (rotations/flips you get 18.000 images….. which is an improvement with regard the original training set).\n\n This is very easy to stitch back together without a lot of science to make predictions and a submission.\n\n•\tI thought the approach of getting the predicted masks would be too hard to achieve with my resources. I considered as well that the less parameters I need to learn , the better. Browsing through many of the images I came to the conclusion that a large majority could be approximated pretty well by an ellipse.  What about instead of predicting the actual shape, approximate an ellipse to each of the masks ? It is only 5 parameter. Posx,posy,a,b,theta. And you get the identities.\n\nI reflected on taking an approach like the YOLO algorithm, used in autonomous driving object detection. Only that instead of approximating boxes ( 5  params (prob,x,y,a,b ) this time I have labels with 6  ( prob,x,y,a,b,theta)). Ideally I wanted to reuse the architecture  and weights of the trained model and then who knows…..\n\n Looking at the size of many of the nucleus I saw that a good average was about 9-12 pixels. Given the size of my tiles I decided to go for a 16x16 grid to generate my (volume) labels. I used max suppression to clean cell duplicates. I only got some 1.200 cases with more than 1 nucleus in my cells witch I consider pretty  good ratio.\n\nThe useful thing about the YOLO approach is that it is a fully “convolutional” one step process.\n\n•\tEventually this could work well in an ensemble if I could reduce the area of interest to a set of very small well demarcated area (focus) to then, later, apply another method for the precise area delineation.\n\nI am half way through the story. The yolo architecture blows away my computer. I am taking smaller VGG like approaches for now… but they take more than 2 days to run. I was considering (as I have seen in the kernels)  convert everything into B&amp;W plus reduce dimensions to 128x128. This won’t generate many artifacts. I could even go to 64x64 just to experiment with the right model and then rescale for larger inputs without much inconvenience.\n\nThis won’t take you anywhere in the leader board…. But it is a lot of fun!\n\nComments welcome.\n\nCheers.\n\nJulian",
    "284699": "Hey Julian, \nIf your looking for free computation power in the form of a GPU, this might help:\n\n - https://worksheets.codalab.org/\n - https://colab.research.google.com/\n\nBoth come with free GPU support, codalab offers more CPUs I think:\n\n - https://github.com/codalab/codalab-worksheets/wiki/Execution#default-workers",
    "284703": "yolo is good for study purpose，but it should have drawbacks about position precision.",
    "284752": "Thanks will look into this. !",
    "284753": "this looks good enough for me to start.\n\nhttps://www.youtube.com/watch?v=VOC3huqHrss\n\nI even like the music ;-)",
    "284763": "Haha, I like it, especially this frame:\n![enter image description here][1]\n\n\n  [1]: https://s13.postimg.org/oa4jrcq9j/Screenshot_from_2018-02-18_12-45-45.png"
  },
  "source": "meta"
}