{
  "id": 60659,
  "title": "Strategies for multi class classification",
  "url": "/competitions/google-ai-open-images-object-detection-track/discussion/60659",
  "author_name": "",
  "post_date": "2018-07-08T02:24:48.978438300Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I'm struggling a little bit to understand how to feed the multi class training data to the network. the imageDataGenerator and associated flow_from_directory assumes a directory structure that requires single class. So two questions:\n1) For an image that two classes for example, is it advisable to present the image to the network twice, once for each class? Or would it be better to pass the network a 'two hot' encoding.</p>\n\n<p>2)  Does anyone have any example code that allows you to use something like flow_from_directory but instead of assume the directory strucuture, pass the labels in as a csv or dataframe or dict or something?</p>",
  "messages": [
    {
      "id": "353845",
      "postDate": "07/08/2018 02:24:48",
      "content": "<p>I'm struggling a little bit to understand how to feed the multi class training data to the network. the imageDataGenerator and associated flow_from_directory assumes a directory structure that requires single class. So two questions:\n1) For an image that two classes for example, is it advisable to present the image to the network twice, once for each class? Or would it be better to pass the network a 'two hot' encoding.</p>\n\n<p>2)  Does anyone have any example code that allows you to use something like flow_from_directory but instead of assume the directory strucuture, pass the labels in as a csv or dataframe or dict or something?</p>",
      "rawMarkdown": "I'm struggling a little bit to understand how to feed the multi class training data to the network. the imageDataGenerator and associated flow_from_directory assumes a directory structure that requires single class. So two questions:\n1) For an image that two classes for example, is it advisable to present the image to the network twice, once for each class? Or would it be better to pass the network a 'two hot' encoding.\n\n2)  Does anyone have any example code that allows you to use something like flow_from_directory but instead of assume the directory strucuture, pass the labels in as a csv or dataframe or dict or something?",
      "votes": null
    },
    {
      "id": "354066",
      "postDate": "07/08/2018 16:28:50",
      "content": "<p>This is an object detection challenge, not an image classification. Many people have used a classifier to create a bounding box over the whole image for the #1 class it detected. However, I would highly recommend using an object detection model, which will produce a significantly higher score. I'm planning on using object detection, but you could also use an image classifier with a sliding box over the whole image to create a \"attention maps\" for the image. For example, if there is a dog and a cat in the scene, and you start occluding the cat, the probability of cat will start to go down, telling you that there is a cat there. Similarly, if you start occluding the dog, the probability of the dog class will decrease, telling you there is a dog in that region of the image. There is probably a better way to do this, but that's as far as I know. You can now use these regions to calculate bounding boxes. Again, I stress using an object detection algorithm.</p>",
      "rawMarkdown": "This is an object detection challenge, not an image classification. Many people have used a classifier to create a bounding box over the whole image for the #1 class it detected. However, I would highly recommend using an object detection model, which will produce a significantly higher score. I'm planning on using object detection, but you could also use an image classifier with a sliding box over the whole image to create a \"attention maps\" for the image. For example, if there is a dog and a cat in the scene, and you start occluding the cat, the probability of cat will start to go down, telling you that there is a cat there. Similarly, if you start occluding the dog, the probability of the dog class will decrease, telling you there is a dog in that region of the image. There is probably a better way to do this, but that's as far as I know. You can now use these regions to calculate bounding boxes. Again, I stress using an object detection algorithm.",
      "votes": null
    },
    {
      "id": "354109",
      "postDate": "07/08/2018 19:05:55",
      "content": "<p>Thanks. This is a helpful distinction. I am currently looking at the tensorflow object detection API. Wish there was a wrapper for keras😉</p>",
      "rawMarkdown": "Thanks. This is a helpful distinction. I am currently looking at the tensorflow object detection API. Wish there was a wrapper for keras😉",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 354066,
      "author_name": "arpandhatt",
      "author_url": "",
      "post_date": "07/08/2018 16:28:50",
      "content": "<p>This is an object detection challenge, not an image classification. Many people have used a classifier to create a bounding box over the whole image for the #1 class it detected. However, I would highly recommend using an object detection model, which will produce a significantly higher score. I'm planning on using object detection, but you could also use an image classifier with a sliding box over the whole image to create a \"attention maps\" for the image. For example, if there is a dog and a cat in the scene, and you start occluding the cat, the probability of cat will start to go down, telling you that there is a cat there. Similarly, if you start occluding the dog, the probability of the dog class will decrease, telling you there is a dog in that region of the image. There is probably a better way to do this, but that's as far as I know. You can now use these regions to calculate bounding boxes. Again, I stress using an object detection algorithm.</p>",
      "votes": null,
      "replies": [
        {
          "id": 354109,
          "author_name": "mj514316",
          "author_url": "",
          "post_date": "07/08/2018 19:05:55",
          "content": "<p>Thanks. This is a helpful distinction. I am currently looking at the tensorflow object detection API. Wish there was a wrapper for keras😉</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "353845": "I'm struggling a little bit to understand how to feed the multi class training data to the network. the imageDataGenerator and associated flow_from_directory assumes a directory structure that requires single class. So two questions:\n1) For an image that two classes for example, is it advisable to present the image to the network twice, once for each class? Or would it be better to pass the network a 'two hot' encoding.\n\n2)  Does anyone have any example code that allows you to use something like flow_from_directory but instead of assume the directory strucuture, pass the labels in as a csv or dataframe or dict or something?",
    "354066": "This is an object detection challenge, not an image classification. Many people have used a classifier to create a bounding box over the whole image for the #1 class it detected. However, I would highly recommend using an object detection model, which will produce a significantly higher score. I'm planning on using object detection, but you could also use an image classifier with a sliding box over the whole image to create a \"attention maps\" for the image. For example, if there is a dog and a cat in the scene, and you start occluding the cat, the probability of cat will start to go down, telling you that there is a cat there. Similarly, if you start occluding the dog, the probability of the dog class will decrease, telling you there is a dog in that region of the image. There is probably a better way to do this, but that's as far as I know. You can now use these regions to calculate bounding boxes. Again, I stress using an object detection algorithm.",
    "354109": "Thanks. This is a helpful distinction. I am currently looking at the tensorflow object detection API. Wish there was a wrapper for keras😉"
  },
  "source": "meta"
}