I am using the InceptionV3 model for training. Here is the link for the code (https://github.com/maxmelnick/tensorflow/blob/no_random/tensorflow/examples/image_retraining/retrain.py) Initially I have a small size dataset. So, I used the augmentation technique to increase the size of the dataset.

While training phase dataset was divided into training, validation, and testing. During the training phase, it shows 96% accuracy for 11 classes. But When I predict any new input image(Unseen data) it gave 56% accuracy. What's the problem lies with the model?

I have already used Dropout, Cross-validation, OverSampling techniques but not achieved good results over the new input image.

Parameters used while training.

Training Samples - 800 images in each class

  • Training Samples - 70%
  • Validation Samples - 20%
  • Testing Samples - 10%

Testing Samples (Unseen data other than Training Samples) - 51 images in each class

Epochs - 10,000

Thank You.

  • $\begingroup$ What augmentation are you using? Also, I guess you are not performing augmentation on the test set right? $\endgroup$ Sep 2 '20 at 13:59
  • $\begingroup$ I am using the Flip, Rotate, Skew, Zoom technique. I performed augmentation on both testings as well as the training dataset. $\endgroup$
    – Rina
    Sep 3 '20 at 3:51
  • $\begingroup$ You're not supposed to do that. The test set should reflect production data. Don't augmentate it $\endgroup$ Sep 3 '20 at 11:14
  • $\begingroup$ Thats not right. You can also perform augmention on the test set, and average over the predictions for example. $\endgroup$ Sep 3 '20 at 22:15
  • $\begingroup$ My training, as well as the testing dataset size, is so small. So I perform augmentation. $\endgroup$
    – Rina
    Sep 4 '20 at 3:31

While Yolov3 is a great model it may underperform for certain datasets. A simple example would be this. Take a model and train it on cifar 10. The same model might significantly perform lower on cifar 100 or imagenet!

Things you could do to improve your model:

  1. Introduce Batch or group normalization?
  2. Study the data better, if possible see if the data is used elsewhere and how they approach it.
  3. Epochs isn't the problem, so that should stay the same.

If nothing continues to work then you might have to opt for some other model. Try yolov5 or rcnn!

  • $\begingroup$ Thank you, Soumya for your reply. But I don't know how to add Batch or Group Normalization in this code (github.com/maxmelnick/tensorflow/blob/no_random/tensorflow/…) $\endgroup$
    – Rina
    Sep 3 '20 at 3:52
  • $\begingroup$ could you point out where the model exactly is there? Then i may be able to add the norm layers! $\endgroup$
    – Academic
    Sep 3 '20 at 4:28
  • $\begingroup$ I think it starts from line no .771 def nn_layer(input_tensor, input_dim, output_dim, layer_name, activation_name='activation', act=tf.nn.softmax): $\endgroup$
    – Rina
    Sep 3 '20 at 5:41
  • $\begingroup$ im sorry, I dont think I can help you with that specific model. But can you build yolo from scratch and add it? $\endgroup$
    – Academic
    Sep 3 '20 at 5:54
  • $\begingroup$ Ok.I'll tries of using yolo. $\endgroup$
    – Rina
    Sep 3 '20 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.