{
  "id": 244189,
  "title": "Predictions Related Confusion : Image Bounding Box and Classes vs Study",
  "url": "/competitions/siim-covid19-detection/discussion/244189",
  "author_name": "Farhan Hai Khan",
  "post_date": "2021-06-05T13:58:10.945000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>As per my understanding :  </p>\n<p>From the homepage : Target Prediction Strings are :</p>\n<pre><code>Id,PredictionString\n2b95d54e4be65_study,negative 1 0 0 1 1\n2b95d54e4be66_study,typical 1 0 0 1 1\n2b95d54e4be67_study,indeterminate 1 0 0 1 1 atypical 1 0 0 1 1\n2b95d54e4be68_image,none 1 0 0 1 1\n2b95d54e4be69_image,opacity 0.5 100 100 200 200 opacity 0.7 10 10 20 20\netc.\n</code></pre>\n<p>For each image, we predict the following :  </p>\n<ul>\n<li>Classes</li>\n<li>Bounding Boxes</li>\n<li>Confidences<br>\nSay I have the following Sample Preds:</li>\n</ul>\n<pre><code>([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\n</code></pre>\n<p>With the following CLASS_LABELS :</p>\n<pre><code>{'negative': 0, 'indeterminate': 1, 'typical': 2, 'atypical': 3}\n</code></pre>\n<p>How should I submit the predictions?</p>\n<p>Approach 1 : Submit All Preds -</p>\n<pre><code>Image-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n</code></pre>\n<p>Approach 2 : Submit Top Preds -<br>\nThis approach says that take <code>n</code> top samples of top confidence class and discard all other classes completely.</p>\n<p>Since a study can have more images than one,</p>\n<pre><code>len(images in study) = len(Study-Level Prediction Classes)\n</code></pre>\n<p>Say there are 2 images in a study :</p>\n<pre><code>Img1  : \n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\nImg2:\n([1, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.9, 0.6, 0.8])\nImage1-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h\nImage2-Level Predictions = opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n</code></pre>\n<p>Note that the other classes are clipped.</p>\n<p>Notebook for visualizing the above approach 1: <a href=\"https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare\" target=\"_blank\">https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare</a></p>",
  "messages": [
    {
      "id": 1337249,
      "postDate": "2021-06-05T13:58:10.947Z",
      "content": "<p>As per my understanding :  </p>\n<p>From the homepage : Target Prediction Strings are :</p>\n<pre><code>Id,PredictionString\n2b95d54e4be65_study,negative 1 0 0 1 1\n2b95d54e4be66_study,typical 1 0 0 1 1\n2b95d54e4be67_study,indeterminate 1 0 0 1 1 atypical 1 0 0 1 1\n2b95d54e4be68_image,none 1 0 0 1 1\n2b95d54e4be69_image,opacity 0.5 100 100 200 200 opacity 0.7 10 10 20 20\netc.\n</code></pre>\n<p>For each image, we predict the following :  </p>\n<ul>\n<li>Classes</li>\n<li>Bounding Boxes</li>\n<li>Confidences<br>\nSay I have the following Sample Preds:</li>\n</ul>\n<pre><code>([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\n</code></pre>\n<p>With the following CLASS_LABELS :</p>\n<pre><code>{'negative': 0, 'indeterminate': 1, 'typical': 2, 'atypical': 3}\n</code></pre>\n<p>How should I submit the predictions?</p>\n<p>Approach 1 : Submit All Preds -</p>\n<pre><code>Image-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n</code></pre>\n<p>Approach 2 : Submit Top Preds -<br>\nThis approach says that take <code>n</code> top samples of top confidence class and discard all other classes completely.</p>\n<p>Since a study can have more images than one,</p>\n<pre><code>len(images in study) = len(Study-Level Prediction Classes)\n</code></pre>\n<p>Say there are 2 images in a study :</p>\n<pre><code>Img1  : \n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\nImg2:\n([1, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.9, 0.6, 0.8])\nImage1-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h\nImage2-Level Predictions = opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n</code></pre>\n<p>Note that the other classes are clipped.</p>\n<p>Notebook for visualizing the above approach 1: <a href=\"https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare\" target=\"_blank\">https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare</a></p>",
      "rawMarkdown": "As per my understanding :  \n\nFrom the homepage : Target Prediction Strings are :\n\n```\nId,PredictionString\n2b95d54e4be65_study,negative 1 0 0 1 1\n2b95d54e4be66_study,typical 1 0 0 1 1\n2b95d54e4be67_study,indeterminate 1 0 0 1 1 atypical 1 0 0 1 1\n2b95d54e4be68_image,none 1 0 0 1 1\n2b95d54e4be69_image,opacity 0.5 100 100 200 200 opacity 0.7 10 10 20 20\netc.\n```\n\nFor each image, we predict the following :  \n- Classes\n- Bounding Boxes\n- Confidences\n Say I have the following Sample Preds:\n\n```\n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\n```\n\nWith the following CLASS_LABELS :\n```\n{'negative': 0, 'indeterminate': 1, 'typical': 2, 'atypical': 3}\n```\n\nHow should I submit the predictions?\n\nApproach 1 : Submit All Preds -\n```\nImage-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n```\n\nApproach 2 : Submit Top Preds -\nThis approach says that take `n` top samples of top confidence class and discard all other classes completely.\n\nSince a study can have more images than one,\n```\nlen(images in study) = len(Study-Level Prediction Classes)\n```\n\nSay there are 2 images in a study :\n```\nImg1  : \n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\nImg2:\n([1, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.9, 0.6, 0.8])\nImage1-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h\nImage2-Level Predictions = opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n```\nNote that the other classes are clipped.\n\n\nNotebook for visualizing the above approach 1: https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1337249": "As per my understanding :  \n\nFrom the homepage : Target Prediction Strings are :\n\n```\nId,PredictionString\n2b95d54e4be65_study,negative 1 0 0 1 1\n2b95d54e4be66_study,typical 1 0 0 1 1\n2b95d54e4be67_study,indeterminate 1 0 0 1 1 atypical 1 0 0 1 1\n2b95d54e4be68_image,none 1 0 0 1 1\n2b95d54e4be69_image,opacity 0.5 100 100 200 200 opacity 0.7 10 10 20 20\netc.\n```\n\nFor each image, we predict the following :  \n- Classes\n- Bounding Boxes\n- Confidences\n Say I have the following Sample Preds:\n\n```\n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\n```\n\nWith the following CLASS_LABELS :\n```\n{'negative': 0, 'indeterminate': 1, 'typical': 2, 'atypical': 3}\n```\n\nHow should I submit the predictions?\n\nApproach 1 : Submit All Preds -\n```\nImage-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n```\n\nApproach 2 : Submit Top Preds -\nThis approach says that take `n` top samples of top confidence class and discard all other classes completely.\n\nSince a study can have more images than one,\n```\nlen(images in study) = len(Study-Level Prediction Classes)\n```\n\nSay there are 2 images in a study :\n```\nImg1  : \n([3, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.8, 0.9, 0.8])\nImg2:\n([1, 3, 1],\n [{'x': 336, 'y': 137, 'width': 70.4, 'height': 52.48},\n  {'x': 371, 'y': 250, 'width': 62.72, 'height': 74.24},\n  {'x': 136, 'y': 228, 'width': 71.68, 'height': 61.44}],\n [0.9, 0.6, 0.8])\nImage1-Level Predictions = opacity 0.8 x y w h opacity 0.9 x y w h\nImage2-Level Predictions = opacity 0.9 x y w h opacity 0.8 x y w h\nStudy-Level Predictions = atypical 1 0 0 1 1 indeterminate 1 0 0 1 1\n```\nNote that the other classes are clipped.\n\n\nNotebook for visualizing the above approach 1: https://www.kaggle.com/farhanhaikhan/visualize-resized-data-prediction-data-prepare"
  }
}