Answers.Body: <p>In fact, choosing smartly the values of the image augmentation can help the performance of your system. Where I work we developed an object detector for cars. We had the following image augmentation parameters:</p>
  
  <ul>
  <li>Apect ratio distorsion: it changed the cars dimensions</li>
  <li>Additive noise: it blurred the image</li>
  <li>Change colorspace: change the cars colors</li>
  <li>Saturation change: brightness</li>
  <li>Rotation: rotate image axis</li>
  <li>Flipping (horizontally): mirror effect</li>
  <li>Zooming: zoom in/out of image</li>
  </ul>
  
  <p>At first we just combined all the effects (within a certain range of change per effect) randomly in each augmented image. But then we did an study for our use case and we found that our model performed better with: <strong>no aspect ratio deformation</strong> and <strong>no change in color space</strong>. After giving it a bit of a thought it really made sense for our use case because it is a detector for a very specific type of car. </p>
  
  <p>However, although the improvements accomplished by optimizing the parameters of image augmentation boosted the performance of the model, the improvements were not huge, so in the end it did not really worth the effort. To give some numbers it improved <span class="math-container">$5\%$</span> in our custom test metrics, and we were expecting something around <span class="math-container">$10\%$</span> so from that moment on we left the specific image augmentation parameters but stopped thinking too much about it.</p>
  
  <p>So, in conclussion, does it helps? yes, how much? well, that would depend on the use case. For us, it turned out it did not improve as much as we wanted.</p>
  
  <p>Hope this helps :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-11T17:16:34.417Z
Answers.Text: Thanks. Useful thoughts. So after each removal, your trained the model and tested it? What metric do you look to get the best model? Is that `val_loss`?
Answers.UserDisplayName: Mary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:51:28.980Z
Answers.Text: Yes, exactly that, we trained the model several times with different parameters. That's how we found the best ones. That is also why we lost so much time and we think it did not worth the effort. The custom metric was an aggregated metric of precission and accuracy for our use case. So after train the model we run some tests on top.
Answers.UserDisplayName: JVGD
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-11T14:53:58.440Z
Answers.LastActivityDate: 2020-02-11T14:53:58.440Z
Answers.UserDisplayName: JVGD
Body: <p>I'm trying to understand the role of data augmentation and how it can affect the performance/accuracy of a deep model. My target application is fire detection (on video frames), with almost 15K positive and negative samples, and I was using the following data augmentation techniques. Does using <strong>ALL</strong> the followings always increase the performance? Or we have to choose them somehow <strong>smartly</strong> given our target application?</p>
  
  <pre><code>rotation_range=20, width_shift_range=0.2, height_shift_range=0.2,zoom_range=0.2, horizontal_flip=True
  </code></pre>
  
  <p>When I think a bit more, fire is always straight up, so I think <code>rotation</code> or <code>shift</code> might in fact worsen the results, given that it makes the image sides stretch like this, which is irrelevant to fires in video frames. Same with rotation. So I think maybe I should only keep <code>zoom_range=0.2, horizontal_flip=True</code> and remove the first three. Because I see some false positives when we have a scene transition effect in videos.</p>
  
  <p>Is my argument correct? Should I keep them or remove them?</p>
  
  <p><a href="https://i.sstatic.net/4REwQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4REwQ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.sstatic.net/DsOR8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DsOR8.png" alt="enter image description here"></a></p>
  
Tags: <deep-learning><training><object-detection><data-preprocessing><accuracy>
Title: Choosing Data Augmentation smartly for different application
UserDisplayName: Mary
ThreadText: # Choosing Data Augmentation smartly for different application
  
  (Asked by: username_0 on 2020-02-10)
  
  I'm trying to understand the role of data augmentation and how it can affect the performance/accuracy of a deep model. My target application is fire detection (on video frames), with almost 15K positive and negative samples, and I was using the following data augmentation techniques. Does using **ALL** the followings always increase the performance? Or we have to choose them somehow **smartly** given our target application?
  
  ```
  rotation_range=20, width_shift_range=0.2, height_shift_range=0.2,zoom_range=0.2, horizontal_flip=True
  
  ```
  
  When I think a bit more, fire is always straight up, so I think `rotation` or `shift` might in fact worsen the results, given that it makes the image sides stretch like this, which is irrelevant to fires in video frames. Same with rotation. So I think maybe I should only keep `zoom_range=0.2, horizontal_flip=True` and remove the first three. Because I see some false positives when we have a scene transition effect in videos.
  
  Is my argument correct? Should I keep them or remove them?
  
  [![enter image description here](https://i.sstatic.net/4REwQ.png)](https://i.sstatic.net/4REwQ.png)
  
  [![enter image description here](https://i.sstatic.net/DsOR8.png)](https://i.sstatic.net/DsOR8.png)
  
  **Tags:** deep-learning, training, object-detection, data-preprocessing, accuracy
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-11. Score: 1 | Accepted answer
  
  In fact, choosing smartly the values of the image augmentation can help the performance of your system. Where I work we developed an object detector for cars. We had the following image augmentation parameters:
  
  * Apect ratio distorsion: it changed the cars dimensions
  * Additive noise: it blurred the image
  * Change colorspace: change the cars colors
  * Saturation change: brightness
  * Rotation: rotate image axis
  * Flipping (horizontally): mirror effect
  * Zooming: zoom in/out of image
  
  At first we just combined all the effects (within a certain range of change per effect) randomly in each augmented image. But then we did an study for our use case and we found that our model performed better with: **no aspect ratio deformation** and **no change in color space**. After giving it a bit of a thought it really made sense for our use case because it is a detector for a very specific type of car.
  
  However, although the improvements accomplished by optimizing the parameters of image augmentation boosted the performance of the model, the improvements were not huge, so in the end it did not really worth the effort. To give some numbers it improved $5\%$ in our custom test metrics, and we were expecting something around $10\%$ so from that moment on we left the specific image augmentation parameters but stopped thinking too much about it.
  
  So, in conclussion, does it helps? yes, how much? well, that would depend on the use case. For us, it turned out it did not improve as much as we wanted.
  
  Hope this helps :)
  
  > **Comments:**
  > **username_0**: Thanks. Useful thoughts. So after each removal, your trained the model and tested it? What metric do you look to get the best model? Is that `val_loss`?  
  > **username_1**: Yes, exactly that, we trained the model several times with different parameters. That's how we found the best ones. That is also why we lost so much time and we think it did not worth the effort. The custom metric was an aggregated metric of precission and accuracy for our use case. So after train the model we run some tests on top.  
  
  ---
  
  