{
  "id": 458763,
  "title": "Kidney 3: sparse vs dense",
  "url": "/competitions/blood-vessel-segmentation/discussion/458763",
  "author_name": "",
  "post_date": "2023-12-01T11:59:34.663888300Z",
  "votes": 2,
  "comment_count": 1,
  "views": 0,
  "content": "<p>This is likely a question to a competition host.</p>\n<p>The data page says that kidney_3_sparse is sparsely segmented (about 85%). However the IoU score for corresponding label layers from dense and sparse sets is as high as 0.98453826 (see the code snippet below).</p>\n<p>I was thinking first that you have same portion of densely segmented labels in both sets, but the dice is not equal to one for any of corresponding layers.</p>\n<p><a href=\"https://www.kaggle.com/clairewalsh\" target=\"_blank\">@clairewalsh</a> <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> Can you please explain this as it does not look like a major gap between two segmentations? Maybe I'm missing something…</p>\n<pre><code>layers = os()\nsparse = \ndense = \npath = \n x  layers:\n    sparse((np(Image(os(path(), x))) / )(int))\n    dense((np(Image(os(path(), x))) / )(int))\nsparse = np(sparse, axis=-)\ndense = np(dense, axis=-)\niou = tf(target_class_ids=)\niou(dense, sparse)\n())\n</code></pre>",
  "messages": [
    {
      "id": "2545281",
      "postDate": "12/01/2023 11:59:34",
      "content": "<p>This is likely a question to a competition host.</p>\n<p>The data page says that kidney_3_sparse is sparsely segmented (about 85%). However the IoU score for corresponding label layers from dense and sparse sets is as high as 0.98453826 (see the code snippet below).</p>\n<p>I was thinking first that you have same portion of densely segmented labels in both sets, but the dice is not equal to one for any of corresponding layers.</p>\n<p><a href=\"https://www.kaggle.com/clairewalsh\" target=\"_blank\">@clairewalsh</a> <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> Can you please explain this as it does not look like a major gap between two segmentations? Maybe I'm missing something…</p>\n<pre><code>layers = os()\nsparse = \ndense = \npath = \n x  layers:\n    sparse((np(Image(os(path(), x))) / )(int))\n    dense((np(Image(os(path(), x))) / )(int))\nsparse = np(sparse, axis=-)\ndense = np(dense, axis=-)\niou = tf(target_class_ids=)\niou(dense, sparse)\n())\n</code></pre>",
      "rawMarkdown": "This is likely a question to a competition host.\n\nThe data page says that kidney_3_sparse is sparsely segmented (about 85%). However the IoU score for corresponding label layers from dense and sparse sets is as high as 0.98453826 (see the code snippet below).\n\nI was thinking first that you have same portion of densely segmented labels in both sets, but the dice is not equal to one for any of corresponding layers.\n\n@clairewalsh @ryanholbrook Can you please explain this as it does not look like a major gap between two segmentations? Maybe I'm missing something...\n\n```\nlayers = os.listdir('train/kidney_3_dense/labels')\nsparse = []\ndense = []\npath = 'train/kidney_3_{}/labels'\nfor x in layers:\n    sparse.append((np.array(Image.open(os.path.join(path.format('sparse'), x))) / 255).astype(int))\n    dense.append((np.array(Image.open(os.path.join(path.format('dense'), x))) / 255).astype(int))\nsparse = np.stack(sparse, axis=-1)\ndense = np.stack(dense, axis=-1)\niou = tf.keras.metrics.BinaryIoU(target_class_ids=[1])\niou.update_state(dense, sparse)\nprint(iou.result().numpy())\n```",
      "votes": null
    },
    {
      "id": "2553539",
      "postDate": "12/08/2023 10:41:21",
      "content": "<p><a href=\"https://www.kaggle.com/clairewalsh\" target=\"_blank\">@clairewalsh</a> <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>",
      "rawMarkdown": "clairewalsh @ryanholbrook",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2553539,
      "author_name": "bhavesjain",
      "author_url": "",
      "post_date": "12/08/2023 10:41:21",
      "content": "<p><a href=\"https://www.kaggle.com/clairewalsh\" target=\"_blank\">@clairewalsh</a> <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2545281": "This is likely a question to a competition host.\n\nThe data page says that kidney_3_sparse is sparsely segmented (about 85%). However the IoU score for corresponding label layers from dense and sparse sets is as high as 0.98453826 (see the code snippet below).\n\nI was thinking first that you have same portion of densely segmented labels in both sets, but the dice is not equal to one for any of corresponding layers.\n\n@clairewalsh @ryanholbrook Can you please explain this as it does not look like a major gap between two segmentations? Maybe I'm missing something...\n\n```\nlayers = os.listdir('train/kidney_3_dense/labels')\nsparse = []\ndense = []\npath = 'train/kidney_3_{}/labels'\nfor x in layers:\n    sparse.append((np.array(Image.open(os.path.join(path.format('sparse'), x))) / 255).astype(int))\n    dense.append((np.array(Image.open(os.path.join(path.format('dense'), x))) / 255).astype(int))\nsparse = np.stack(sparse, axis=-1)\ndense = np.stack(dense, axis=-1)\niou = tf.keras.metrics.BinaryIoU(target_class_ids=[1])\niou.update_state(dense, sparse)\nprint(iou.result().numpy())\n```",
    "2553539": "clairewalsh @ryanholbrook"
  },
  "source": "meta"
}