Answers.Body: <p>I try to answer the things I know for sure:</p>
  
  <ol start="3">
  <li>One effect of bigger images is the increasing computation time due to more pixels (input to your training)</li>
  </ol>
  
  <p>4.Grayscaling reduces the information, which might decrease training time, but also model performance (accuracy, precision, recall). What I have seen is that grayscaling is used in for example face detection where structural information (shapes) is important and colors can be regarded as secondary. For your example you have to determine whether such structural differences between positives and negatives exist and if color is a valuable information.</p>
  
  <ol start="5">
  <li><p>If possible, I would somehow alter these copies by clipping the objects (sun lights, lamps) and rotate, scale, make them transparent etc.</p></li>
  <li><p>In the end your training data should be representative of the data it should generalize to. If you would for example take my user icon as an additional non fire example, this wouldn't help your cause.</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-23T19:08:33.933Z
Answers.Text: For 5, you mean keep multiple frames and plus, multiple each by keeping altered copies?
Answers.UserDisplayName: Mary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-21T22:26:14.503Z
Answers.LastActivityDate: 2019-11-21T22:26:14.503Z
Answers.UserDisplayName: fcs
Body: <p>I'm relatively new to Deep Learning, and trying various models and datasets using <code>Keras</code>. I'm starting to love it!</p>
  
  <p>Through-out my experimentations, I have come into some semantic questions that I don't know how they can affect the overall accuracy of my trained model. My target application is fire detection in videos (fire vs non-fire). So I'm trying to get tips and tricks from those well experienced on Deep learning, and here are my semantic questions:</p>
  
  <ol>
  <li><p>Given that I have to do detection on videos, I've been mostly adding actuall frames of videos to my dataset, and less photos. Does adding photos from Google ever help (as we largen our dataset) or it's actually more considered noises and shall be removed?</p></li>
  <li><p>I've trained a deep model (<code>ResNet50</code>) as well as a shallow 5-layer model. I realized the ResNet50 model is more sensitive and has a high recall (all fires are definitely detected), but has false positives as well (strong source of lights like sunlight or lamps are identified as fire). While the shallower model is 10x faster, it can miss fires if it is smaller in the image, so it's less sensitive. But also has low false positives. Is it always true? So what are techniques and tips to fix these issues in each of these models? </p></li>
  </ol>
  
  <p>For instance, the shallow model doesn't see this fire. Shall I think it's not complex enough to work well when the scene has many objects inside?</p>
  
  <p><a href="https://i.sstatic.net/gwrjrm.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gwrjrm.jpg" alt="enter image description here"></a></p>
  
  <ol start="3">
  <li><p>The sample code I saw resizes photos to <code>256x256</code> for training. What's the effect of bigger sizes vs smaller ones say <code>300x300</code>? Can I expect while bigger sizes increase computation time, they provide higher accuracy?</p></li>
  <li><p>The sample code also converts photos to grayscale and uses Antialiasing before passing. Does it have good effects? What if I pass the colored version as fire is mostly about colors?</p></li>
  <li><p>When I see the model is doing bad on certain scenes (say those sun lights or lamps), I take multiple of those frames and add them to my non-fire dataset. Does it have any positive effects and being taken care of? And is it better to add multiple successive frames or just one frame is enough? </p></li>
  <li><p>My fire dataset has <code>1800</code> images and my non-fire dataset has <code>4500</code> images. As a rule of thumb, the bigger each class, the better? Of course the non-fire data should be bigger, but we can not add whatever on earth as non-fire so what should be the distribution of the sizes?</p></li>
  </ol>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-21T23:18:53.533Z
Comments.Text: Hi Tina. You're asking too many questions on this post. You should try asking **one question per post**. See https://meta.stackexchange.com/a/39224/287113.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-21T23:30:12.013Z
Comments.Text: @nbro no they are all semantically related and are essentially one thing. I'm sure if this get a proper answer, it will end up being a very **popular** post!
Comments.UserDisplayName: Mary
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-23T15:57:37.793Z
Comments.Text: If they are essentially one thing, then ask just one question. However, I really think you're asking multiple distinct questions here.
Comments.UserDisplayName: nbro
Tags: <machine-learning><deep-learning><classification><keras><deep-neural-networks>
Title: Techniques and semantics in better training of deep learning models
UserDisplayName: Mary
ThreadText: # Techniques and semantics in better training of deep learning models
  
  (Asked by: username_0 on 2019-11-21)
  
  I'm relatively new to Deep Learning, and trying various models and datasets using `Keras`. I'm starting to love it!
  
  Through-out my experimentations, I have come into some semantic questions that I don't know how they can affect the overall accuracy of my trained model. My target application is fire detection in videos (fire vs non-fire). So I'm trying to get tips and tricks from those well experienced on Deep learning, and here are my semantic questions:
  
  1. Given that I have to do detection on videos, I've been mostly adding actuall frames of videos to my dataset, and less photos. Does adding photos from Google ever help (as we largen our dataset) or it's actually more considered noises and shall be removed?
  2. I've trained a deep model (`ResNet50`) as well as a shallow 5-layer model. I realized the ResNet50 model is more sensitive and has a high recall (all fires are definitely detected), but has false positives as well (strong source of lights like sunlight or lamps are identified as fire). While the shallower model is 10x faster, it can miss fires if it is smaller in the image, so it's less sensitive. But also has low false positives. Is it always true? So what are techniques and tips to fix these issues in each of these models?
  
  For instance, the shallow model doesn't see this fire. Shall I think it's not complex enough to work well when the scene has many objects inside?
  
  [![enter image description here](https://i.sstatic.net/gwrjrm.jpg)](https://i.sstatic.net/gwrjrm.jpg)
  
  3. The sample code I saw resizes photos to `256x256` for training. What's the effect of bigger sizes vs smaller ones say `300x300`? Can I expect while bigger sizes increase computation time, they provide higher accuracy?
  4. The sample code also converts photos to grayscale and uses Antialiasing before passing. Does it have good effects? What if I pass the colored version as fire is mostly about colors?
  5. When I see the model is doing bad on certain scenes (say those sun lights or lamps), I take multiple of those frames and add them to my non-fire dataset. Does it have any positive effects and being taken care of? And is it better to add multiple successive frames or just one frame is enough?
  6. My fire dataset has `1800` images and my non-fire dataset has `4500` images. As a rule of thumb, the bigger each class, the better? Of course the non-fire data should be bigger, but we can not add whatever on earth as non-fire so what should be the distribution of the sizes?
  
  **Tags:** machine-learning, deep-learning, classification, keras, deep-neural-networks
  > **Comments:**
  > **username_1**: Hi Tina. You're asking too many questions on this post. You should try asking **one question per post**. See https://meta.stackexchange.com/a/39224/287113.  
  > **username_0**: @nbro no they are all semantically related and are essentially one thing. I'm sure if this get a proper answer, it will end up being a very **popular** post!  
  > **username_1**: If they are essentially one thing, then ask just one question. However, I really think you're asking multiple distinct questions here.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-11-21. Score: 2 | Accepted answer
  
  I try to answer the things I know for sure:
  
  3. One effect of bigger images is the increasing computation time due to more pixels (input to your training)
  
  4.Grayscaling reduces the information, which might decrease training time, but also model performance (accuracy, precision, recall). What I have seen is that grayscaling is used in for example face detection where structural information (shapes) is important and colors can be regarded as secondary. For your example you have to determine whether such structural differences between positives and negatives exist and if color is a valuable information.
  
  5. If possible, I would somehow alter these copies by clipping the objects (sun lights, lamps) and rotate, scale, make them transparent etc.
  6. In the end your training data should be representative of the data it should generalize to. If you would for example take my user icon as an additional non fire example, this wouldn't help your cause.
  
  > **Comments:**
  > **username_0**: For 5, you mean keep multiple frames and plus, multiple each by keeping altered copies?  
  
  ---
  
  