1
$\begingroup$

I am using my own dataset to retrain mobilenet_v2_100_224 model, I currently have 4 classes where each class have more than 100 images still I'm observing overfitting even though I've used --random_scale and --random_brightness parameters, how should I overcome this overfitting problem when there's no such regularization technique available in the retrain.py script? following is my TensorBoard visualization:

Retrain command:

python retrain.py --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/2 --how_many_training_steps 500 --random_scale=5 --random_brightness=10 --output_graph=./retrained_graph.pb --output_labels=./retrained_labels.txt --image_dir ./data --summaries_dir /tmp/log

enter image description here

$\endgroup$
  • $\begingroup$ How many images do you have? If your dataset is small you will always suffer from overfitting if you train long enough. $\endgroup$ – J_Heads Jan 24 '19 at 14:52
  • $\begingroup$ Currently have 4 classes where each class have more than 100 images. $\endgroup$ – Ali Jan 24 '19 at 14:56
1
$\begingroup$

I do not see any overfitting there. Overfitting is when your validation loss becomes worse with time, while training loss improves. Just because your training error is less than the validation (which is expected) does not mean it overfits.

But you can try to freeze the first layers (up to the fully connected one) to ensure the network does not lose generalization.

$\endgroup$
  • $\begingroup$ The problem is it's doing worst on generalization and hence I'm getting very poor results in predictions. $\endgroup$ – Ali Jan 25 '19 at 14:31
  • $\begingroup$ I agree with @Dmytro that these graphs don't look like a over-fitting case. You probably not able to learn the patterns since you have about 400 images to train. Try applying some data augmentation, that will probably improve your accuracy $\endgroup$ – Pedro Henrique Monforte Oct 21 '19 at 19:34

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.