0
$\begingroup$

I have a dataset that contains about 87000 images in a directory, with each class in a separate subfolder. I've tried the class ImageDataGenerator() and the function flow_from_directory() for generating the images, it worked completely fine but I have a question.. Does flow_from_directory() only yield the augmented images? and if this is the case, how can I train my model "which has overfit the training set" on both original and augmented data? Thanks

$\endgroup$

2 Answers 2

0
$\begingroup$

ImageDataGenerator do augmentation on the fly base on the setting you give , so it did not separate “original” or “augmented “ data , just the possibility of data been augmented. so your question actually is “ how to tune model when overfitting happens ”? I think you can start from adding dropout or reduce number of parameters. Hope this helps, cheers.

$\endgroup$
1
  • $\begingroup$ I've tried adding dropout and parameter reduction, they helped by increasing validation accuracy from 0.72 to 0.85, but I think there's still a room for improvement. Thanks! $\endgroup$ Jun 27, 2020 at 10:08
0
$\begingroup$

Below are the things can be done in order to reduce variance (overfitting):

  1. Add more training data.
  2. Normalization (BatchNorm, LayerNorm)
  3. Data Augmentation
  4. Regularization (Dropout, L2, WeightDecay)
  5. Error Analysis
  6. Tune Hyperparameters
  7. Early Stopping
  8. Use better state of the art model or transfer learning
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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