{
  "id": 248038,
  "title": "Background class in EfficientDet (and other archs)",
  "url": "/competitions/siim-covid19-detection/discussion/248038",
  "author_name": "",
  "post_date": "2021-06-22T07:47:53.389036500Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I'm new to object detection and something confuses me. I'm using <strong>EfficientDet</strong> implementation from <strong><a href=\"https://github.com/rwightman/efficientdet-pytorch\" target=\"_blank\">rwightman</a></strong> library (which is based on official TF implementation) and I don't know how to approach the '<strong>none</strong>' class in this competition which is equivalent to background class in other scenarios.</p>\n<p>My main question is <strong>should I include the images with no bounding boxes</strong> (i.e. the none class images) in my training dataset? and if I include them, what will be the correct <strong>num_classes</strong> to give to the model? 1 or 2? actually what will be the correct format of class/bbox for those 'none' images?</p>\n<p>Overall, is there a notion of background class in EfficientDet as in SSD? It would be great if someone can explain these.</p>\n<p><strong>I think in general there will be three approaches</strong> (correct me if I'm wrong which probably I am):</p>\n<ol>\n<li>To give the model <strong>only</strong> the images that have bounding boxes (i.e. class opacity) </li>\n<li>To give the model <strong>both</strong> images w/ and w/o bounding boxes and treat the 'none' class as <strong>new class</strong> w/ an arbitrary bounding box like [0, 0, 512, 512] </li>\n<li>To give the model <strong>both</strong> images w/ and w/o bounding boxes and make the model somehow recognize that 'none' class is actually the <strong>background</strong>, hence no new class, just 1 for opacity (kinda my main question)</li>\n</ol>\n<p>Thanks in advance for your responses.</p>",
  "messages": [
    {
      "id": "1360598",
      "postDate": "06/22/2021 07:47:53",
      "content": "<p>I'm new to object detection and something confuses me. I'm using <strong>EfficientDet</strong> implementation from <strong><a href=\"https://github.com/rwightman/efficientdet-pytorch\" target=\"_blank\">rwightman</a></strong> library (which is based on official TF implementation) and I don't know how to approach the '<strong>none</strong>' class in this competition which is equivalent to background class in other scenarios.</p>\n<p>My main question is <strong>should I include the images with no bounding boxes</strong> (i.e. the none class images) in my training dataset? and if I include them, what will be the correct <strong>num_classes</strong> to give to the model? 1 or 2? actually what will be the correct format of class/bbox for those 'none' images?</p>\n<p>Overall, is there a notion of background class in EfficientDet as in SSD? It would be great if someone can explain these.</p>\n<p><strong>I think in general there will be three approaches</strong> (correct me if I'm wrong which probably I am):</p>\n<ol>\n<li>To give the model <strong>only</strong> the images that have bounding boxes (i.e. class opacity) </li>\n<li>To give the model <strong>both</strong> images w/ and w/o bounding boxes and treat the 'none' class as <strong>new class</strong> w/ an arbitrary bounding box like [0, 0, 512, 512] </li>\n<li>To give the model <strong>both</strong> images w/ and w/o bounding boxes and make the model somehow recognize that 'none' class is actually the <strong>background</strong>, hence no new class, just 1 for opacity (kinda my main question)</li>\n</ol>\n<p>Thanks in advance for your responses.</p>",
      "rawMarkdown": "I'm new to object detection and something confuses me. I'm using **EfficientDet** implementation from **[rwightman](https://github.com/rwightman/efficientdet-pytorch)** library (which is based on official TF implementation) and I don't know how to approach the '**none**' class in this competition which is equivalent to background class in other scenarios.\n\nMy main question is **should I include the images with no bounding boxes** (i.e. the none class images) in my training dataset? and if I include them, what will be the correct **num_classes** to give to the model? 1 or 2? actually what will be the correct format of class/bbox for those 'none' images?\n\nOverall, is there a notion of background class in EfficientDet as in SSD? It would be great if someone can explain these.\n\n\n**I think in general there will be three approaches** (correct me if I'm wrong which probably I am):\n1. To give the model **only** the images that have bounding boxes (i.e. class opacity) \n2. To give the model **both** images w/ and w/o bounding boxes and treat the 'none' class as **new class** w/ an arbitrary bounding box like [0, 0, 512, 512] \n3. To give the model **both** images w/ and w/o bounding boxes and make the model somehow recognize that 'none' class is actually the **background**, hence no new class, just 1 for opacity (kinda my main question)\n\nThanks in advance for your responses.",
      "votes": null
    },
    {
      "id": "1385637",
      "postDate": "07/12/2021 21:36:15",
      "content": "<p>I think the approach 1 may be better, simple is good. </p>",
      "rawMarkdown": "I think the approach 1 may be better, simple is good.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1385637,
      "author_name": "ldwang",
      "author_url": "",
      "post_date": "07/12/2021 21:36:15",
      "content": "<p>I think the approach 1 may be better, simple is good. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1360598": "I'm new to object detection and something confuses me. I'm using **EfficientDet** implementation from **[rwightman](https://github.com/rwightman/efficientdet-pytorch)** library (which is based on official TF implementation) and I don't know how to approach the '**none**' class in this competition which is equivalent to background class in other scenarios.\n\nMy main question is **should I include the images with no bounding boxes** (i.e. the none class images) in my training dataset? and if I include them, what will be the correct **num_classes** to give to the model? 1 or 2? actually what will be the correct format of class/bbox for those 'none' images?\n\nOverall, is there a notion of background class in EfficientDet as in SSD? It would be great if someone can explain these.\n\n\n**I think in general there will be three approaches** (correct me if I'm wrong which probably I am):\n1. To give the model **only** the images that have bounding boxes (i.e. class opacity) \n2. To give the model **both** images w/ and w/o bounding boxes and treat the 'none' class as **new class** w/ an arbitrary bounding box like [0, 0, 512, 512] \n3. To give the model **both** images w/ and w/o bounding boxes and make the model somehow recognize that 'none' class is actually the **background**, hence no new class, just 1 for opacity (kinda my main question)\n\nThanks in advance for your responses.",
    "1385637": "I think the approach 1 may be better, simple is good."
  },
  "source": "meta"
}