{
  "id": 50153,
  "title": "Very confused by RLE Encoding and LB Results...",
  "url": "/competitions/data-science-bowl-2018/discussion/50153",
  "author_name": "",
  "post_date": "2018-02-20T21:00:58.986817200Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I am new to this whole problem set, I have also never used run length encoding, but I am clearly missing something, so maybe this is a stupid question.  I have a model generating masks.  To my eye they appear to have some validity.  I know they are far from done or perfect.  I am using <a href=\"https://www.kaggle.com/stainsby/fast-tested-rle-and-input-routines\">Sam Stainsby's rle encoding algo</a> for RLE.  Despite dice coefficient scores in the 0.70-0.80 range on eval, I am getting 0's on the LB.  I would have thought, I would at least be LB positive given the masks I am seeing. </p>\n\n<p>I've included one example of a test image, the generated mask, and the first few lines of the RLE encoding.  If someone has an idea or suggestion it would be appreciated.  My next step is to list pixels and compare 1 by 1 to the RLE, I really don't know what else to do.</p>\n\n<p>Is this mask really so bad it <em>should</em> be generating a 0 LB?</p>\n\n<p>A few examples:\n<strong>Test Image</strong>\n<img src=\"https://storage.googleapis.com/mwpdsb/submission_images/feat-eb8629-64.png\" alt=\"Test Image\"> </p>\n\n<p><strong>Mask</strong>\n<img src=\"https://storage.googleapis.com/mwpdsb/submission_images/pred-eb8629-64.png\" alt=\"Mask\"></p>\n\n<p><strong>RLE</strong></p>\n\n<p>1 4 33 1 63 15 79 2 97 11 235 19 257 5 282 12 318 15 353 12 489 23 513 4 536 14 574 13 597 3 610 8 745 1 747 19 769 1 771 1 792 14 830 12 851 6 1005 14 1047 15 1087 10 1107 7 1302 17 1345 7 1363 8 1558 17 1603 2 1619 9 1814 17 1876 8 2070 16 2132 9 2327 14 2389 7 2583 11 2595 4 2630 6 2646 5 2840 8 2849 1 2851 6 2885 9 3001 ...</p>",
  "messages": [
    {
      "id": "285687",
      "postDate": "02/20/2018 21:00:58",
      "content": "<p>I am new to this whole problem set, I have also never used run length encoding, but I am clearly missing something, so maybe this is a stupid question.  I have a model generating masks.  To my eye they appear to have some validity.  I know they are far from done or perfect.  I am using <a href=\"https://www.kaggle.com/stainsby/fast-tested-rle-and-input-routines\">Sam Stainsby's rle encoding algo</a> for RLE.  Despite dice coefficient scores in the 0.70-0.80 range on eval, I am getting 0's on the LB.  I would have thought, I would at least be LB positive given the masks I am seeing. </p>\n\n<p>I've included one example of a test image, the generated mask, and the first few lines of the RLE encoding.  If someone has an idea or suggestion it would be appreciated.  My next step is to list pixels and compare 1 by 1 to the RLE, I really don't know what else to do.</p>\n\n<p>Is this mask really so bad it <em>should</em> be generating a 0 LB?</p>\n\n<p>A few examples:\n<strong>Test Image</strong>\n<img src=\"https://storage.googleapis.com/mwpdsb/submission_images/feat-eb8629-64.png\" alt=\"Test Image\"> </p>\n\n<p><strong>Mask</strong>\n<img src=\"https://storage.googleapis.com/mwpdsb/submission_images/pred-eb8629-64.png\" alt=\"Mask\"></p>\n\n<p><strong>RLE</strong></p>\n\n<p>1 4 33 1 63 15 79 2 97 11 235 19 257 5 282 12 318 15 353 12 489 23 513 4 536 14 574 13 597 3 610 8 745 1 747 19 769 1 771 1 792 14 830 12 851 6 1005 14 1047 15 1087 10 1107 7 1302 17 1345 7 1363 8 1558 17 1603 2 1619 9 1814 17 1876 8 2070 16 2132 9 2327 14 2389 7 2583 11 2595 4 2630 6 2646 5 2840 8 2849 1 2851 6 2885 9 3001 ...</p>",
      "rawMarkdown": "I am new to this whole problem set, I have also never used run length encoding, but I am clearly missing something, so maybe this is a stupid question.  I have a model generating masks.  To my eye they appear to have some validity.  I know they are far from done or perfect.  I am using [Sam Stainsby's rle encoding algo][1] for RLE.  Despite dice coefficient scores in the 0.70-0.80 range on eval, I am getting 0's on the LB.  I would have thought, I would at least be LB positive given the masks I am seeing. \n\nI've included one example of a test image, the generated mask, and the first few lines of the RLE encoding.  If someone has an idea or suggestion it would be appreciated.  My next step is to list pixels and compare 1 by 1 to the RLE, I really don't know what else to do.\n\nIs this mask really so bad it *should* be generating a 0 LB?\n\n\nA few examples:\n**Test Image**\n![Test Image][2] \n\n**Mask**\n![Mask][3]\n\n**RLE**\n\n1 4 33 1 63 15 79 2 97 11 235 19 257 5 282 12 318 15 353 12 489 23 513 4 536 14 574 13 597 3 610 8 745 1 747 19 769 1 771 1 792 14 830 12 851 6 1005 14 1047 15 1087 10 1107 7 1302 17 1345 7 1363 8 1558 17 1603 2 1619 9 1814 17 1876 8 2070 16 2132 9 2327 14 2389 7 2583 11 2595 4 2630 6 2646 5 2840 8 2849 1 2851 6 2885 9 3001 ...\n\n  [1]: https://www.kaggle.com/stainsby/fast-tested-rle-and-input-routines\n  [2]: https://storage.googleapis.com/mwpdsb/submission_images/feat-eb8629-64.png\n  [3]: https://storage.googleapis.com/mwpdsb/submission_images/pred-eb8629-64.png",
      "votes": null
    },
    {
      "id": "285692",
      "postDate": "02/20/2018 21:14:32",
      "content": "<p>You have to isolate each nucleus and run RLE on each. So for each image you will have several masks, hence several lines in the submission file.</p>",
      "rawMarkdown": "You have to isolate each nucleus and run RLE on each. So for each image you will have several masks, hence several lines in the submission file.",
      "votes": null
    },
    {
      "id": "285695",
      "postDate": "02/20/2018 21:16:47",
      "content": "<p>The submission format expects one row for each nuclei, not a row for the mask corresponding to the whole image. One common procedure is to use skimage.morphology.label to find connected regions and then RLE-encode each nuclei separately; check the kernels for examples.</p>",
      "rawMarkdown": "The submission format expects one row for each nuclei, not a row for the mask corresponding to the whole image. One common procedure is to use skimage.morphology.label to find connected regions and then RLE-encode each nuclei separately; check the kernels for examples.",
      "votes": null
    },
    {
      "id": "285696",
      "postDate": "02/20/2018 21:18:07",
      "content": "<p>Well that explains it.  Thanks!</p>",
      "rawMarkdown": "Well that explains it.  Thanks!",
      "votes": null
    },
    {
      "id": "317600",
      "postDate": "04/22/2018 00:40:44",
      "content": "<p>Had a naive question , if label does this one need not use any deep learning technique right. Just convert the test images to grayscale then use morphology.label on it to find the run length encoded values ?</p>",
      "rawMarkdown": "Had a naive question , if label does this one need not use any deep learning technique right. Just convert the test images to grayscale then use morphology.label on it to find the run length encoded values ?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 285692,
      "author_name": "mrtzmilani",
      "author_url": "",
      "post_date": "02/20/2018 21:14:32",
      "content": "<p>You have to isolate each nucleus and run RLE on each. So for each image you will have several masks, hence several lines in the submission file.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 285695,
      "author_name": "aamaia",
      "author_url": "",
      "post_date": "02/20/2018 21:16:47",
      "content": "<p>The submission format expects one row for each nuclei, not a row for the mask corresponding to the whole image. One common procedure is to use skimage.morphology.label to find connected regions and then RLE-encode each nuclei separately; check the kernels for examples.</p>",
      "votes": null,
      "replies": [
        {
          "id": 317600,
          "author_name": "vishalse",
          "author_url": "",
          "post_date": "04/22/2018 00:40:44",
          "content": "<p>Had a naive question , if label does this one need not use any deep learning technique right. Just convert the test images to grayscale then use morphology.label on it to find the run length encoded values ?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 285696,
      "author_name": "jbfarrar",
      "author_url": "",
      "post_date": "02/20/2018 21:18:07",
      "content": "<p>Well that explains it.  Thanks!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "285687": "I am new to this whole problem set, I have also never used run length encoding, but I am clearly missing something, so maybe this is a stupid question.  I have a model generating masks.  To my eye they appear to have some validity.  I know they are far from done or perfect.  I am using [Sam Stainsby's rle encoding algo][1] for RLE.  Despite dice coefficient scores in the 0.70-0.80 range on eval, I am getting 0's on the LB.  I would have thought, I would at least be LB positive given the masks I am seeing. \n\nI've included one example of a test image, the generated mask, and the first few lines of the RLE encoding.  If someone has an idea or suggestion it would be appreciated.  My next step is to list pixels and compare 1 by 1 to the RLE, I really don't know what else to do.\n\nIs this mask really so bad it *should* be generating a 0 LB?\n\n\nA few examples:\n**Test Image**\n![Test Image][2] \n\n**Mask**\n![Mask][3]\n\n**RLE**\n\n1 4 33 1 63 15 79 2 97 11 235 19 257 5 282 12 318 15 353 12 489 23 513 4 536 14 574 13 597 3 610 8 745 1 747 19 769 1 771 1 792 14 830 12 851 6 1005 14 1047 15 1087 10 1107 7 1302 17 1345 7 1363 8 1558 17 1603 2 1619 9 1814 17 1876 8 2070 16 2132 9 2327 14 2389 7 2583 11 2595 4 2630 6 2646 5 2840 8 2849 1 2851 6 2885 9 3001 ...\n\n  [1]: https://www.kaggle.com/stainsby/fast-tested-rle-and-input-routines\n  [2]: https://storage.googleapis.com/mwpdsb/submission_images/feat-eb8629-64.png\n  [3]: https://storage.googleapis.com/mwpdsb/submission_images/pred-eb8629-64.png",
    "285692": "You have to isolate each nucleus and run RLE on each. So for each image you will have several masks, hence several lines in the submission file.",
    "285695": "The submission format expects one row for each nuclei, not a row for the mask corresponding to the whole image. One common procedure is to use skimage.morphology.label to find connected regions and then RLE-encode each nuclei separately; check the kernels for examples.",
    "285696": "Well that explains it.  Thanks!",
    "317600": "Had a naive question , if label does this one need not use any deep learning technique right. Just convert the test images to grayscale then use morphology.label on it to find the run length encoded values ?"
  },
  "source": "meta"
}