Answers.Body: <blockquote>
    <p>The problem is that this kind of data augmentation seems (in theory) to hamper the network to gain precision on bounding boxes location as it loosens the frame.</p>
  </blockquote>
  
  <p>Yes, it is clear from your examples that the bounding boxes become wider. Generally, including large amounts of data like this in your training data will mean that your network will also have a tendency to learn slightly larger bounding boxes. Of course, if the majority of your training data still has tight boxes, it should stell tend towards learning those... but likely slightly wider ones than if the training data did not include these kinds of rotations.</p>
  
  <blockquote>
    <p>Are there some studies dealing with the effect of data augmentation on the precision of detection networks? Are there systems that prevent this kind of thing?</p>
    
    <p>(Obviously, it seems advisable to use small rotation angles)</p>
  </blockquote>
  
  <p>I do not personally work directly in the area of computer vision really, so I'm not sufficiently familiar with the literature to point you to any references on this particular issue. Based on my own intuition, I can recommend:</p>
  
  <ol>
  <li>Using relatively small rotation angles, as you also already suggested yourself. The bounding boxes will become a little bit wider than in the original dataset, but not by too much.</li>
  <li>Using rotation angles that are a multiple of <span class="math-container">$90^\circ$</span>. Note that if you rotate a bounding box by a multiple of <span class="math-container">$90^\circ$</span>, the rotated bounding boxes become axis-aligned and your problem disappears again, they'll become just as tight as the bounding boxes in the unrotated image. Of course, you can also combine this suggestion with the previous one, and use rotation angles in, for example, <span class="math-container">$[85^\circ, 95^\circ]$</span>.</li>
  <li>Apply larger rotations primarily in images that only have bounding boxes that are approximately "square". From looking at your image, I get the impression that the problem of bounding boxes becoming wider after rotations is much more severe when you have extremely wide or thin bounding boxes (with one dimension much greater than the other). When the original bounding box is square, there still will be some widening after rotation, but not nearly as much, so the problem may be more acceptable in such cases.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-13T11:56:12.210Z
Answers.LastActivityDate: 2019-01-13T11:56:12.210Z
Answers.UserDisplayName: Dennis Soemers
Body: <p>I'm using an object detection neural network and I employ data augmentation to increase a little my small dataset. More specifically I do rotation, translation, mirroring and rescaling.</p>
  
  <p>I notice that rotating an image (and thus it's bounding box) changes its shape. This implies an erroneous box for elongated boxes, for instance on the augmented image (right image below) the box is not tightly packed around the left player as it was on the original image. </p>
  
  <p>The problem is that this kind of data augmentation seems (in theory) to hamper the network to gain precision on bounding boxes location as it loosens the frame.</p>
  
  <p>Are there some studies dealing with the effect of data augmentation on the precision of detection networks? Are there systems that prevent this kind of thing?</p>
  
  <p>Thank you in advance!</p>
  
  <p>(Obviously, it seems advisable to use small rotation angles)</p>
  
  <p><a href="https://i.sstatic.net/ZylvJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZylvJ.png" alt="enter image description here"></a></p>
  
Tags: <convolutional-neural-networks><object-recognition>
Title: How data augmentation like rotation affects the quality of detection?
UserDisplayName: Louis Lac
ThreadText: # How data augmentation like rotation affects the quality of detection?
  
  (Asked by: username_0 on 2019-01-11)
  
  I'm using an object detection neural network and I employ data augmentation to increase a little my small dataset. More specifically I do rotation, translation, mirroring and rescaling.
  
  I notice that rotating an image (and thus it's bounding box) changes its shape. This implies an erroneous box for elongated boxes, for instance on the augmented image (right image below) the box is not tightly packed around the left player as it was on the original image.
  
  The problem is that this kind of data augmentation seems (in theory) to hamper the network to gain precision on bounding boxes location as it loosens the frame.
  
  Are there some studies dealing with the effect of data augmentation on the precision of detection networks? Are there systems that prevent this kind of thing?
  
  Thank you in advance!
  
  (Obviously, it seems advisable to use small rotation angles)
  
  [![enter image description here](https://i.sstatic.net/ZylvJ.png)](https://i.sstatic.net/ZylvJ.png)
  
  **Tags:** convolutional-neural-networks, object-recognition
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-13. Score: 1 | Accepted answer
  
  > The problem is that this kind of data augmentation seems (in theory) to hamper the network to gain precision on bounding boxes location as it loosens the frame.
  
  Yes, it is clear from your examples that the bounding boxes become wider. Generally, including large amounts of data like this in your training data will mean that your network will also have a tendency to learn slightly larger bounding boxes. Of course, if the majority of your training data still has tight boxes, it should stell tend towards learning those... but likely slightly wider ones than if the training data did not include these kinds of rotations.
  
  > Are there some studies dealing with the effect of data augmentation on the precision of detection networks? Are there systems that prevent this kind of thing?
  >
  > (Obviously, it seems advisable to use small rotation angles)
  
  I do not personally work directly in the area of computer vision really, so I'm not sufficiently familiar with the literature to point you to any references on this particular issue. Based on my own intuition, I can recommend:
  
  1. Using relatively small rotation angles, as you also already suggested yourself. The bounding boxes will become a little bit wider than in the original dataset, but not by too much.
  2. Using rotation angles that are a multiple of $90^\circ$. Note that if you rotate a bounding box by a multiple of $90^\circ$, the rotated bounding boxes become axis-aligned and your problem disappears again, they'll become just as tight as the bounding boxes in the unrotated image. Of course, you can also combine this suggestion with the previous one, and use rotation angles in, for example, $[85^\circ, 95^\circ]$.
  3. Apply larger rotations primarily in images that only have bounding boxes that are approximately "square". From looking at your image, I get the impression that the problem of bounding boxes becoming wider after rotations is much more severe when you have extremely wide or thin bounding boxes (with one dimension much greater than the other). When the original bounding box is square, there still will be some widening after rotation, but not nearly as much, so the problem may be more acceptable in such cases.
  
  
  ---
  
  