Need advice training object detection

username: rizal_alfarizi
cooked: <p>i have 433 image dataset which consists of class (multiple class can be inside one image):<br>
‘a’: 634,<br>
‘b’: 501,<br>
‘c’: 590,<br>
‘d’: 293,<br>
‘e’: 524,<br>
‘f’: 262<br>
i know my data is too small so i added several image augmentation technique and i get 2598 images without original image:<br>
‘a’: 3804,<br>
‘b’: 3006,<br>
‘c’: 3540,<br>
‘d’: 1757,<br>
‘e’: 3142,<br>
‘f’: 1569</p>
<p>i’m using SSD as detector and mobilenet v1 as backbone based on this repo:<br>
</p><aside class="onebox whitelistedgeneric">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="32" height="32">
      <a href="https://github.com/qfgaohao/pytorch-ssd" target="_blank" rel="nofollow noopener">GitHub</a>
  </header>
  <article class="onebox-body">
    <img src="https://avatars0.githubusercontent.com/u/1721472?s=400&amp;v=4" class="thumbnail onebox-avatar" width="420" height="420">

<h3><a href="https://github.com/qfgaohao/pytorch-ssd" target="_blank" rel="nofollow noopener">qfgaohao/pytorch-ssd</a></h3>

<p>MobileNetV1, MobileNetV2, VGG based SSD/SSD-lite implementation in Pytorch 1.0 / Pytorch 0.4. Out-of-box support for retraining on Open Images dataset. ONNX and Caffe2 support. Experiment Ideas lik...</p>


  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>

<p>in ssd there are 2 loss function , regression with smoothL1 and classification with  cross entropy,<br>
i trained with my dataset with 80% training and 20% testing, i forgot to plot the training and validation loss but i’m sure i don’t overfit my model, i stopped training when the loss function increase, i get around 0.5 for regression loss and 1.5 for classification loss, i trained without pretrained model because that repo only provide voc pretrained model.<br>
when i try to test my model with live cam the accuracy of detection is not good but can detect object with probability below 0.5, and cannot detect with little oclussion like when i grab the object with my hand</p>
<p>here mAP i get with confidence 0.5</p>
<p>mAP 33.68%:</p>
<pre><code class="lang-auto">'a': 0.38, 
'b': 0.45, 
'c': 0.27, 
'd': 0.65, 
'e': 0.16, 
'f': 0.11
</code></pre>
<p>i want to ask what should i do to improve my model, did i wrong with handling the dataset? thank you</p>

username: Scott_Hoang
cooked: <p>Are you including random jittering, random crop, random rotation, random Gaussian noise to help your model learned better?</p>

username: rizal_alfarizi
cooked: <p>Hi <a class="mention" href="/u/scott_hoang">@Scott_Hoang</a>,  yes i’m using imageaug lib with this augmentation i used :</p>
<pre><code class="lang-auto">aug = iaa.SomeOf(2, [
                iaa.AdditiveGaussianNoise(scale=(0,0.1*255)),
                iaa.Add((-40,40), per_channel=True),
                iaa.Sharpen(alpha=(0, 0.5)),
                iaa.Dropout(p=(0,0.15)),
                iaa.GaussianBlur(sigma=(0.0, 1.5)),
                iaa.MotionBlur(k=blur)
            ])
</code></pre>
<p>and combine with</p>
<pre><code class="lang-auto">random_shear
random_rotate
random_scale
random_horizontal_flip
random_vertical_flip
</code></pre>
<p>also my objects are diverse, small but not so small and large object</p>

username: anujd9
cooked: <p>Hi. Since you are not using the pre-trained model weights as a starting point, that’s a possible reason for this performance. There are 2 options here:</p>
<ol>
<li>You can use the pre-trained model weights and freeze some backbone layers and do a transfer learning with your images. You can do that without even freezing the layers to try it out.</li>
<li>Second would be to increase your dataset size if you don’t want to use the pre-trained model weights and rather train from scratch.<br>
Also to handle for cases like occlusion, try to add more data that represents those cases or use augmentations like <a href="https://arxiv.org/pdf/1905.04899.pdf" rel="noopener nofollow ugc">CutMix</a>, Mosaic etc. which should probably help.<br>
Hope this helps.</li>
</ol>