{
  "id": 205859,
  "title": "BBox augmentation?",
  "url": "/competitions/global-wheat-detection/discussion/205859",
  "author_name": "",
  "post_date": "2020-12-22T07:46:56.510955500Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi, All.</p>\n<p>If the bounding box of the training dataset is slightly shifted, or the box size is subtly reduced or increased, will there be an augmentation effect to improve the generalization performance of object detection?</p>\n<p>I wonder …</p>\n<p>Thanks, in advance.<br>\nBest,<br>\n<a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
  "messages": [
    {
      "id": "1122115",
      "postDate": "12/22/2020 07:46:56",
      "content": "<p>Hi, All.</p>\n<p>If the bounding box of the training dataset is slightly shifted, or the box size is subtly reduced or increased, will there be an augmentation effect to improve the generalization performance of object detection?</p>\n<p>I wonder …</p>\n<p>Thanks, in advance.<br>\nBest,<br>\n<a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
      "rawMarkdown": "Hi, All.\n\nIf the bounding box of the training dataset is slightly shifted, or the box size is subtly reduced or increased, will there be an augmentation effect to improve the generalization performance of object detection?\n\nI wonder …\n\nThanks, in advance.\nBest,\n@bemoregt.",
      "votes": null
    },
    {
      "id": "1122690",
      "postDate": "12/22/2020 16:15:50",
      "content": "<p>Hi, </p>\n<p>Briefly said :</p>\n<ul>\n<li>Small bbox modifications relatively to the targeted object's size =&gt; training on the same image multiple times</li>\n<li>Large bbox modifications relatively to the targeted object's size =&gt; add noise to the localization part of the network</li>\n</ul>\n<p>In any case, it shouldn't improve the network's ability to generalize.</p>\n<hr>\n<p>To me, a data augmentation policy makes sense if it modifies the content of the original image that is fed into the network. To improve generalization, we want our network to see as much image &amp; annotations as possible that could fit the targeted distribution. All the commonly used augmentation policies modify the original image to create content that is likely to fit the target distribution.</p>\n<p>By modifying bboxes just a little (shifting, rescaling), we do not modify the original image, neither the area of interest we ask the network to extract content from ; At least if the targeted object has a low resolution, where a small shift dramatically changes the pixels distribution of the image contained by the bbox. When the resolution is low, it's always another story. To my knowledge it is still an active field of research… </p>\n<p>But if the resolution of your targeted objects is high enough, applying small changes to the bboxes without modifying the pixels values should result in adding noise to the localization part of the network, without helping the filters to extract content from the image that would help generalization. Intuitively, we could see it as saying to the network : \"This exact same combination of pixels could result in slightly different bbox position.\" If the network has a high learning rate, it might overfit to this part of the image. If the learning rate is low, the network might not be able to extract features that really matter to accuratly distinguish the targeted object from the background. </p>\n<p>On the contrary, commonly used data augmentation modifies the pixel values while preserving the quality of content inside the bboxes - a flipped wheat head is still a wheat head - providing additional high quality resources which could be used to \"interpolate\" wheat heads.</p>\n<p>I never saw slight bbox shifting/rescaling improving the performances of a DL model. If someone has a different view, I would be interested to know !</p>",
      "rawMarkdown": "Hi, \n\n\nBriefly said :\n- Small bbox modifications relatively to the targeted object's size => training on the same image multiple times\n- Large bbox modifications relatively to the targeted object's size => add noise to the localization part of the network\n\nIn any case, it shouldn't improve the network's ability to generalize.\n\n---\n\nTo me, a data augmentation policy makes sense if it modifies the content of the original image that is fed into the network. To improve generalization, we want our network to see as much image & annotations as possible that could fit the targeted distribution. All the commonly used augmentation policies modify the original image to create content that is likely to fit the target distribution.\n\nBy modifying bboxes just a little (shifting, rescaling), we do not modify the original image, neither the area of interest we ask the network to extract content from ; At least if the targeted object has a low resolution, where a small shift dramatically changes the pixels distribution of the image contained by the bbox. When the resolution is low, it's always another story. To my knowledge it is still an active field of research... \n\nBut if the resolution of your targeted objects is high enough, applying small changes to the bboxes without modifying the pixels values should result in adding noise to the localization part of the network, without helping the filters to extract content from the image that would help generalization. Intuitively, we could see it as saying to the network : \"This exact same combination of pixels could result in slightly different bbox position.\" If the network has a high learning rate, it might overfit to this part of the image. If the learning rate is low, the network might not be able to extract features that really matter to accuratly distinguish the targeted object from the background. \n\nOn the contrary, commonly used data augmentation modifies the pixel values while preserving the quality of content inside the bboxes - a flipped wheat head is still a wheat head - providing additional high quality resources which could be used to \"interpolate\" wheat heads.\n\nI never saw slight bbox shifting/rescaling improving the performances of a DL model. If someone has a different view, I would be interested to know !",
      "votes": null
    },
    {
      "id": "1122984",
      "postDate": "12/22/2020 20:39:12",
      "content": "<p>Hi, KT-karl.</p>\n<p>OK, I see…</p>\n<p>if so,<br>\nWith the bounding box fixed<br>\nWhat about inverting the image color?</p>\n<p>Or what if you rotate the image?<br>\nOf course, you have to rotate the bounding box as well..</p>\n<p>Will there be an augmentation effect even in that case?<br>\nI wonder.</p>\n<p><a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
      "rawMarkdown": "Hi, KT-karl.\n\nOK, I see...\n\nif so,\nWith the bounding box fixed\nWhat about inverting the image color?\n\nOr what if you rotate the image?\nOf course, you have to rotate the bounding box as well..\n\nWill there be an augmentation effect even in that case?\nI wonder.\n\n@bemoregt.",
      "votes": null
    },
    {
      "id": "1123136",
      "postDate": "12/23/2020 00:19:00",
      "content": "<p>Color modification &amp; image rotation are commonly used augmentation for object detection. Both are great to improve generalization, but it always depend on your task : does it make the training dataset closer to the (unknown) target distribution ?</p>\n<p>Sometimes it doesn't make sense to apply photometric variations, or rotation. Vertical flipping is not likely to be relevant on images which are meant to describe scenes submitted to gravity…</p>\n<p>I would suggest you to take a look at <a href=\"https://github.com/aleju/imgaug\" target=\"_blank\">this repo</a> and <a href=\"https://github.com/albumentations-team/albumentations\" target=\"_blank\">that one</a> if you want to build a good intuition about data augmentation. There are also plenty of great resources about it on the internet. </p>",
      "rawMarkdown": "Color modification & image rotation are commonly used augmentation for object detection. Both are great to improve generalization, but it always depend on your task : does it make the training dataset closer to the (unknown) target distribution ?\n\nSometimes it doesn't make sense to apply photometric variations, or rotation. Vertical flipping is not likely to be relevant on images which are meant to describe scenes submitted to gravity...\n\nI would suggest you to take a look at [this repo](https://github.com/aleju/imgaug) and [that one](https://github.com/albumentations-team/albumentations) if you want to build a good intuition about data augmentation. There are also plenty of great resources about it on the internet.",
      "votes": null
    },
    {
      "id": "1123141",
      "postDate": "12/23/2020 00:27:40",
      "content": "<p>Thank you for your suggestion sites.</p>\n<p>I'm interested in a kind of special augmentation using like Fourier transforms.</p>\n<p><a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
      "rawMarkdown": "Thank you for your suggestion sites.\n\nI'm interested in a kind of special augmentation using like Fourier transforms.\n\n@bemoregt.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1122690,
      "author_name": "johannhuber",
      "author_url": "",
      "post_date": "12/22/2020 16:15:50",
      "content": "<p>Hi, </p>\n<p>Briefly said :</p>\n<ul>\n<li>Small bbox modifications relatively to the targeted object's size =&gt; training on the same image multiple times</li>\n<li>Large bbox modifications relatively to the targeted object's size =&gt; add noise to the localization part of the network</li>\n</ul>\n<p>In any case, it shouldn't improve the network's ability to generalize.</p>\n<hr>\n<p>To me, a data augmentation policy makes sense if it modifies the content of the original image that is fed into the network. To improve generalization, we want our network to see as much image &amp; annotations as possible that could fit the targeted distribution. All the commonly used augmentation policies modify the original image to create content that is likely to fit the target distribution.</p>\n<p>By modifying bboxes just a little (shifting, rescaling), we do not modify the original image, neither the area of interest we ask the network to extract content from ; At least if the targeted object has a low resolution, where a small shift dramatically changes the pixels distribution of the image contained by the bbox. When the resolution is low, it's always another story. To my knowledge it is still an active field of research… </p>\n<p>But if the resolution of your targeted objects is high enough, applying small changes to the bboxes without modifying the pixels values should result in adding noise to the localization part of the network, without helping the filters to extract content from the image that would help generalization. Intuitively, we could see it as saying to the network : \"This exact same combination of pixels could result in slightly different bbox position.\" If the network has a high learning rate, it might overfit to this part of the image. If the learning rate is low, the network might not be able to extract features that really matter to accuratly distinguish the targeted object from the background. </p>\n<p>On the contrary, commonly used data augmentation modifies the pixel values while preserving the quality of content inside the bboxes - a flipped wheat head is still a wheat head - providing additional high quality resources which could be used to \"interpolate\" wheat heads.</p>\n<p>I never saw slight bbox shifting/rescaling improving the performances of a DL model. If someone has a different view, I would be interested to know !</p>",
      "votes": null,
      "replies": [
        {
          "id": 1122984,
          "author_name": "bemorekgg",
          "author_url": "",
          "post_date": "12/22/2020 20:39:12",
          "content": "<p>Hi, KT-karl.</p>\n<p>OK, I see…</p>\n<p>if so,<br>\nWith the bounding box fixed<br>\nWhat about inverting the image color?</p>\n<p>Or what if you rotate the image?<br>\nOf course, you have to rotate the bounding box as well..</p>\n<p>Will there be an augmentation effect even in that case?<br>\nI wonder.</p>\n<p><a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1123136,
          "author_name": "johannhuber",
          "author_url": "",
          "post_date": "12/23/2020 00:19:00",
          "content": "<p>Color modification &amp; image rotation are commonly used augmentation for object detection. Both are great to improve generalization, but it always depend on your task : does it make the training dataset closer to the (unknown) target distribution ?</p>\n<p>Sometimes it doesn't make sense to apply photometric variations, or rotation. Vertical flipping is not likely to be relevant on images which are meant to describe scenes submitted to gravity…</p>\n<p>I would suggest you to take a look at <a href=\"https://github.com/aleju/imgaug\" target=\"_blank\">this repo</a> and <a href=\"https://github.com/albumentations-team/albumentations\" target=\"_blank\">that one</a> if you want to build a good intuition about data augmentation. There are also plenty of great resources about it on the internet. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1123141,
          "author_name": "bemorekgg",
          "author_url": "",
          "post_date": "12/23/2020 00:27:40",
          "content": "<p>Thank you for your suggestion sites.</p>\n<p>I'm interested in a kind of special augmentation using like Fourier transforms.</p>\n<p><a href=\"https://www.kaggle.com/bemoregt\" target=\"_blank\">@bemoregt</a>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1122115": "Hi, All.\n\nIf the bounding box of the training dataset is slightly shifted, or the box size is subtly reduced or increased, will there be an augmentation effect to improve the generalization performance of object detection?\n\nI wonder …\n\nThanks, in advance.\nBest,\n@bemoregt.",
    "1122690": "Hi, \n\n\nBriefly said :\n- Small bbox modifications relatively to the targeted object's size => training on the same image multiple times\n- Large bbox modifications relatively to the targeted object's size => add noise to the localization part of the network\n\nIn any case, it shouldn't improve the network's ability to generalize.\n\n---\n\nTo me, a data augmentation policy makes sense if it modifies the content of the original image that is fed into the network. To improve generalization, we want our network to see as much image & annotations as possible that could fit the targeted distribution. All the commonly used augmentation policies modify the original image to create content that is likely to fit the target distribution.\n\nBy modifying bboxes just a little (shifting, rescaling), we do not modify the original image, neither the area of interest we ask the network to extract content from ; At least if the targeted object has a low resolution, where a small shift dramatically changes the pixels distribution of the image contained by the bbox. When the resolution is low, it's always another story. To my knowledge it is still an active field of research... \n\nBut if the resolution of your targeted objects is high enough, applying small changes to the bboxes without modifying the pixels values should result in adding noise to the localization part of the network, without helping the filters to extract content from the image that would help generalization. Intuitively, we could see it as saying to the network : \"This exact same combination of pixels could result in slightly different bbox position.\" If the network has a high learning rate, it might overfit to this part of the image. If the learning rate is low, the network might not be able to extract features that really matter to accuratly distinguish the targeted object from the background. \n\nOn the contrary, commonly used data augmentation modifies the pixel values while preserving the quality of content inside the bboxes - a flipped wheat head is still a wheat head - providing additional high quality resources which could be used to \"interpolate\" wheat heads.\n\nI never saw slight bbox shifting/rescaling improving the performances of a DL model. If someone has a different view, I would be interested to know !",
    "1122984": "Hi, KT-karl.\n\nOK, I see...\n\nif so,\nWith the bounding box fixed\nWhat about inverting the image color?\n\nOr what if you rotate the image?\nOf course, you have to rotate the bounding box as well..\n\nWill there be an augmentation effect even in that case?\nI wonder.\n\n@bemoregt.",
    "1123136": "Color modification & image rotation are commonly used augmentation for object detection. Both are great to improve generalization, but it always depend on your task : does it make the training dataset closer to the (unknown) target distribution ?\n\nSometimes it doesn't make sense to apply photometric variations, or rotation. Vertical flipping is not likely to be relevant on images which are meant to describe scenes submitted to gravity...\n\nI would suggest you to take a look at [this repo](https://github.com/aleju/imgaug) and [that one](https://github.com/albumentations-team/albumentations) if you want to build a good intuition about data augmentation. There are also plenty of great resources about it on the internet.",
    "1123141": "Thank you for your suggestion sites.\n\nI'm interested in a kind of special augmentation using like Fourier transforms.\n\n@bemoregt."
  },
  "source": "meta"
}