{
  "id": 34557,
  "title": "Cervix ROI Segmentation Using U-NET",
  "url": "/competitions/intel-mobileodt-cervical-cancer-screening/discussion/34557",
  "author_name": "",
  "post_date": "2017-06-11T19:47:45.414274800Z",
  "votes": 26,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Hi all,</p>\n\n<p>Would like to share my approach to segment the Cervix ROI :</p>\n\n<p><a href=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet\">https://github.com/scottykwok/cervix-roi-segmentation-by-unet</a></p>\n\n<p>It is a U-NET implemented in Keras2, using dice coef as the objective. And thanks Paul for his bounding boxes annotation <a href=\"https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\">here</a>.</p>\n\n<p>When applied on the unseen test images, the result looks quite satisfactory in most cases: \n<img src=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet/raw/master/img/preview.jpg\" alt=\"enter image description here\" title=\"\"></p>\n\n<p><strong>Updates on 13 Jun:</strong>  fixed some bugs &amp; added pre-trained weight.</p>\n\n<p>Cheers</p>\n\n<p>Scotty</p>",
  "messages": [
    {
      "id": "191792",
      "postDate": "06/11/2017 19:47:45",
      "content": "<p>Hi all,</p>\n\n<p>Would like to share my approach to segment the Cervix ROI :</p>\n\n<p><a href=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet\">https://github.com/scottykwok/cervix-roi-segmentation-by-unet</a></p>\n\n<p>It is a U-NET implemented in Keras2, using dice coef as the objective. And thanks Paul for his bounding boxes annotation <a href=\"https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\">here</a>.</p>\n\n<p>When applied on the unseen test images, the result looks quite satisfactory in most cases: \n<img src=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet/raw/master/img/preview.jpg\" alt=\"enter image description here\" title=\"\"></p>\n\n<p><strong>Updates on 13 Jun:</strong>  fixed some bugs &amp; added pre-trained weight.</p>\n\n<p>Cheers</p>\n\n<p>Scotty</p>",
      "rawMarkdown": "Hi all,\n\nWould like to share my approach to segment the Cervix ROI :\n\n[https://github.com/scottykwok/cervix-roi-segmentation-by-unet][1]\n\nIt is a U-NET implemented in Keras2, using dice coef as the objective. And thanks Paul for his bounding boxes annotation [here][2].\n\n\nWhen applied on the unseen test images, the result looks quite satisfactory in most cases: \n![enter image description here][3]\n\n\n**Updates on 13 Jun:**  fixed some bugs &amp; added pre-trained weight.\n\nCheers\n\nScotty\n\n  [1]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet\n  [2]: https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\n  [3]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet/raw/master/img/preview.jpg",
      "votes": null
    },
    {
      "id": "191800",
      "postDate": "06/11/2017 20:35:22",
      "content": "<blockquote>\n  <p>I have made some minor adjustments and added the missing images.</p>\n</blockquote>\n\n<p>Scotty, could you talk a bit about the adjustments you made? I'm about to convert your json files to x,y,w,h format so that I can compare and just visualize against the original annotations by @Paul, but I was more interested in your personal reasoning for the adjustments =)</p>\n\n<p>Thanks!</p>",
      "rawMarkdown": "&gt; I have made some minor adjustments and added the missing images.\n\nScotty, could you talk a bit about the adjustments you made? I'm about to convert your json files to x,y,w,h format so that I can compare and just visualize against the original annotations by @Paul, but I was more interested in your personal reasoning for the adjustments =)\n\nThanks!",
      "votes": null
    },
    {
      "id": "191867",
      "postDate": "06/12/2017 02:01:25",
      "content": "<p>wow thanks, I'm late to the competition , I didn't realize bounding box annotations were shared. </p>",
      "rawMarkdown": "wow thanks, I'm late to the competition , I didn't realize bounding box annotations were shared.",
      "votes": null
    },
    {
      "id": "191927",
      "postDate": "06/12/2017 06:09:30",
      "content": "<p>@authman, \nFor the adjustments: (1) a few annotations bounded the lesions instead of transformation zone, so I changed those annotation to include Os and transformation zone. (2) I added back those missing images with my own annotations.</p>\n\n<p>Its worth noting though, in <a href=\"https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\">@Paul 's annotation</a>, <strong>his original intention is to annotate epithelial lesions instead of ROI</strong>. But so happen that most of his annotations roughly included the Oz + transformation zone, so I used them as ROI bounding box.</p>\n\n<p>Another observation:  even though the input masks are rectangular bounding boxes, the immediate output of the U-NET is a smooth irregular/circular masks that cover the cervix. I guess that is due to the heavy data augmentations that rotate the masks during training. </p>",
      "rawMarkdown": "authman, \nFor the adjustments: (1) a few annotations bounded the lesions instead of transformation zone, so I changed those annotation to include Os and transformation zone. (2) I added back those missing images with my own annotations.\n\nIts worth noting though, in [@Paul 's annotation][1], **his original intention is to annotate epithelial lesions instead of ROI**. But so happen that most of his annotations roughly included the Oz + transformation zone, so I used them as ROI bounding box.\n\nAnother observation:  even though the input masks are rectangular bounding boxes, the immediate output of the U-NET is a smooth irregular/circular masks that cover the cervix. I guess that is due to the heavy data augmentations that rotate the masks during training. \n\n\n  [1]: https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565",
      "votes": null
    },
    {
      "id": "191948",
      "postDate": "06/12/2017 07:56:19",
      "content": "<p>But aren't these bounding boxes shared by Paul for the lesions region but not the cervix? How could you then get the centered cervix crops predicted by your UNet model? Thanks! Neat piece,  btw.</p>",
      "rawMarkdown": "But aren't these bounding boxes shared by Paul for the lesions region but not the cervix? How could you then get the centered cervix crops predicted by your UNet model? Thanks! Neat piece,  btw.",
      "votes": null
    },
    {
      "id": "191968",
      "postDate": "06/12/2017 10:05:56",
      "content": "<p>Awesome. This is what I had observed too (made an initial comment on Paul's post) but wasn't able to find the right words to describe as you've done eloquently above.</p>",
      "rawMarkdown": "Awesome. This is what I had observed too (made an initial comment on Paul's post) but wasn't able to find the right words to describe as you've done eloquently above.",
      "votes": null
    },
    {
      "id": "192306",
      "postDate": "06/13/2017 05:32:16",
      "content": "<p>He intended to annotate the lesions, but so happen that most of the annotations included the Oz + transformation zone. So it works for ROI as well.</p>",
      "rawMarkdown": "He intended to annotate the lesions, but so happen that most of the annotations included the Oz + transformation zone. So it works for ROI as well.",
      "votes": null
    },
    {
      "id": "192467",
      "postDate": "06/13/2017 16:18:37",
      "content": "<p>Hmm I really thought this would boost my score on the leaderboard more than it did. Only improved 0.01 loss.</p>",
      "rawMarkdown": "Hmm I really thought this would boost my score on the leaderboard more than it did. Only improved 0.01 loss.",
      "votes": null
    },
    {
      "id": "193731",
      "postDate": "06/17/2017 18:14:27",
      "content": "<p>It appears that the network architecture proposed in the <a href=\"https://arxiv.org/abs/1505.04597\">original paper</a> is somewhat different than what's implemented in your code. </p>\n\n<p>For example, in the paper, the first 3x3 convolution layer outputs 64 channels. However, the following code snippet (taken from your github repo file: <a href=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet/blob/master/src/unet.py\">unet.py</a>) outputs 32 channels after first 3x3 convolution. </p>\n\n<pre><code>conv1 = Conv2D(32, (3, 3), padding=\"same\", activation=\"relu\")(inputs)\n</code></pre>\n\n<p>There are other variations aswell such as unpadded convolutions in the paper as opposed to padded convolutions in the implementation. </p>\n\n<p>Kindly correct me if I am wrong. Other UNET implementations does exactly what you did. Am I misunderstanding anything? Thanks!</p>",
      "rawMarkdown": "It appears that the network architecture proposed in the [original paper][1] is somewhat different than what's implemented in your code. \n\nFor example, in the paper, the first 3x3 convolution layer outputs 64 channels. However, the following code snippet (taken from your github repo file: [unet.py][2]) outputs 32 channels after first 3x3 convolution. \n\n    conv1 = Conv2D(32, (3, 3), padding=\"same\", activation=\"relu\")(inputs)\n\nThere are other variations aswell such as unpadded convolutions in the paper as opposed to padded convolutions in the implementation. \n\nKindly correct me if I am wrong. Other UNET implementations does exactly what you did. Am I misunderstanding anything? Thanks!\n\n  [1]: https://arxiv.org/abs/1505.04597\n  [2]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet/blob/master/src/unet.py",
      "votes": null
    },
    {
      "id": "199053",
      "postDate": "07/04/2017 12:31:59",
      "content": "<p>Muneeb, many other Keras UNET implementation are based on <a href=\"https://github.com/jocicmarko/ultrasound-nerve-segmentation\">jocicimarko 's code</a>.  Mine is the also based on that. So may be that's why they all different from the paper the same way.</p>",
      "rawMarkdown": "Muneeb, many other Keras UNET implementation are based on [jocicimarko 's code][1].  Mine is the also based on that. So may be that's why they all different from the paper the same way.\n\n  [1]: https://github.com/jocicmarko/ultrasound-nerve-segmentation",
      "votes": null
    },
    {
      "id": "390628",
      "postDate": "09/20/2018 14:43:53",
      "content": "",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 191800,
      "author_name": "authman",
      "author_url": "",
      "post_date": "06/11/2017 20:35:22",
      "content": "<blockquote>\n  <p>I have made some minor adjustments and added the missing images.</p>\n</blockquote>\n\n<p>Scotty, could you talk a bit about the adjustments you made? I'm about to convert your json files to x,y,w,h format so that I can compare and just visualize against the original annotations by @Paul, but I was more interested in your personal reasoning for the adjustments =)</p>\n\n<p>Thanks!</p>",
      "votes": null,
      "replies": [
        {
          "id": 191927,
          "author_name": "scottykwok",
          "author_url": "",
          "post_date": "06/12/2017 06:09:30",
          "content": "<p>@authman, \nFor the adjustments: (1) a few annotations bounded the lesions instead of transformation zone, so I changed those annotation to include Os and transformation zone. (2) I added back those missing images with my own annotations.</p>\n\n<p>Its worth noting though, in <a href=\"https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\">@Paul 's annotation</a>, <strong>his original intention is to annotate epithelial lesions instead of ROI</strong>. But so happen that most of his annotations roughly included the Oz + transformation zone, so I used them as ROI bounding box.</p>\n\n<p>Another observation:  even though the input masks are rectangular bounding boxes, the immediate output of the U-NET is a smooth irregular/circular masks that cover the cervix. I guess that is due to the heavy data augmentations that rotate the masks during training. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 191968,
          "author_name": "authman",
          "author_url": "",
          "post_date": "06/12/2017 10:05:56",
          "content": "<p>Awesome. This is what I had observed too (made an initial comment on Paul's post) but wasn't able to find the right words to describe as you've done eloquently above.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 191867,
      "author_name": "tanstaafl",
      "author_url": "",
      "post_date": "06/12/2017 02:01:25",
      "content": "<p>wow thanks, I'm late to the competition , I didn't realize bounding box annotations were shared. </p>",
      "votes": null,
      "replies": [
        {
          "id": 192467,
          "author_name": "tanstaafl",
          "author_url": "",
          "post_date": "06/13/2017 16:18:37",
          "content": "<p>Hmm I really thought this would boost my score on the leaderboard more than it did. Only improved 0.01 loss.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 191948,
      "author_name": "bvineeth007",
      "author_url": "",
      "post_date": "06/12/2017 07:56:19",
      "content": "<p>But aren't these bounding boxes shared by Paul for the lesions region but not the cervix? How could you then get the centered cervix crops predicted by your UNet model? Thanks! Neat piece,  btw.</p>",
      "votes": null,
      "replies": [
        {
          "id": 192306,
          "author_name": "scottykwok",
          "author_url": "",
          "post_date": "06/13/2017 05:32:16",
          "content": "<p>He intended to annotate the lesions, but so happen that most of the annotations included the Oz + transformation zone. So it works for ROI as well.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 193731,
      "author_name": "muneebaadil",
      "author_url": "",
      "post_date": "06/17/2017 18:14:27",
      "content": "<p>It appears that the network architecture proposed in the <a href=\"https://arxiv.org/abs/1505.04597\">original paper</a> is somewhat different than what's implemented in your code. </p>\n\n<p>For example, in the paper, the first 3x3 convolution layer outputs 64 channels. However, the following code snippet (taken from your github repo file: <a href=\"https://github.com/scottykwok/cervix-roi-segmentation-by-unet/blob/master/src/unet.py\">unet.py</a>) outputs 32 channels after first 3x3 convolution. </p>\n\n<pre><code>conv1 = Conv2D(32, (3, 3), padding=\"same\", activation=\"relu\")(inputs)\n</code></pre>\n\n<p>There are other variations aswell such as unpadded convolutions in the paper as opposed to padded convolutions in the implementation. </p>\n\n<p>Kindly correct me if I am wrong. Other UNET implementations does exactly what you did. Am I misunderstanding anything? Thanks!</p>",
      "votes": null,
      "replies": [
        {
          "id": 199053,
          "author_name": "scottykwok",
          "author_url": "",
          "post_date": "07/04/2017 12:31:59",
          "content": "<p>Muneeb, many other Keras UNET implementation are based on <a href=\"https://github.com/jocicmarko/ultrasound-nerve-segmentation\">jocicimarko 's code</a>.  Mine is the also based on that. So may be that's why they all different from the paper the same way.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 390628,
      "author_name": "samghim",
      "author_url": "",
      "post_date": "09/20/2018 14:43:53",
      "content": "",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "191792": "Hi all,\n\nWould like to share my approach to segment the Cervix ROI :\n\n[https://github.com/scottykwok/cervix-roi-segmentation-by-unet][1]\n\nIt is a U-NET implemented in Keras2, using dice coef as the objective. And thanks Paul for his bounding boxes annotation [here][2].\n\n\nWhen applied on the unseen test images, the result looks quite satisfactory in most cases: \n![enter image description here][3]\n\n\n**Updates on 13 Jun:**  fixed some bugs &amp; added pre-trained weight.\n\nCheers\n\nScotty\n\n  [1]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet\n  [2]: https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565\n  [3]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet/raw/master/img/preview.jpg",
    "191800": "&gt; I have made some minor adjustments and added the missing images.\n\nScotty, could you talk a bit about the adjustments you made? I'm about to convert your json files to x,y,w,h format so that I can compare and just visualize against the original annotations by @Paul, but I was more interested in your personal reasoning for the adjustments =)\n\nThanks!",
    "191867": "wow thanks, I'm late to the competition , I didn't realize bounding box annotations were shared.",
    "191927": "authman, \nFor the adjustments: (1) a few annotations bounded the lesions instead of transformation zone, so I changed those annotation to include Os and transformation zone. (2) I added back those missing images with my own annotations.\n\nIts worth noting though, in [@Paul 's annotation][1], **his original intention is to annotate epithelial lesions instead of ROI**. But so happen that most of his annotations roughly included the Oz + transformation zone, so I used them as ROI bounding box.\n\nAnother observation:  even though the input masks are rectangular bounding boxes, the immediate output of the U-NET is a smooth irregular/circular masks that cover the cervix. I guess that is due to the heavy data augmentations that rotate the masks during training. \n\n\n  [1]: https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/discussion/31565",
    "191948": "But aren't these bounding boxes shared by Paul for the lesions region but not the cervix? How could you then get the centered cervix crops predicted by your UNet model? Thanks! Neat piece,  btw.",
    "191968": "Awesome. This is what I had observed too (made an initial comment on Paul's post) but wasn't able to find the right words to describe as you've done eloquently above.",
    "192306": "He intended to annotate the lesions, but so happen that most of the annotations included the Oz + transformation zone. So it works for ROI as well.",
    "192467": "Hmm I really thought this would boost my score on the leaderboard more than it did. Only improved 0.01 loss.",
    "193731": "It appears that the network architecture proposed in the [original paper][1] is somewhat different than what's implemented in your code. \n\nFor example, in the paper, the first 3x3 convolution layer outputs 64 channels. However, the following code snippet (taken from your github repo file: [unet.py][2]) outputs 32 channels after first 3x3 convolution. \n\n    conv1 = Conv2D(32, (3, 3), padding=\"same\", activation=\"relu\")(inputs)\n\nThere are other variations aswell such as unpadded convolutions in the paper as opposed to padded convolutions in the implementation. \n\nKindly correct me if I am wrong. Other UNET implementations does exactly what you did. Am I misunderstanding anything? Thanks!\n\n  [1]: https://arxiv.org/abs/1505.04597\n  [2]: https://github.com/scottykwok/cervix-roi-segmentation-by-unet/blob/master/src/unet.py",
    "199053": "Muneeb, many other Keras UNET implementation are based on [jocicimarko 's code][1].  Mine is the also based on that. So may be that's why they all different from the paper the same way.\n\n  [1]: https://github.com/jocicmarko/ultrasound-nerve-segmentation",
    "390628": ""
  },
  "source": "meta"
}