2
$\begingroup$

I am using Keras library to build a CNN model. I want to use data augmentation for training data.

Should I use rescale parameters for data augmentation?

ImageDataGenerator(rescale=1./255)
$\endgroup$
2
$\begingroup$

The rescale argument byitself does not augment your data.

If you input pixels are in the range of [0,255], you can rescale to [0,1] using the code in your question. Just remember to do the same on all partitions of your dataset.

If you input is already in the range of [0,1], then obviously you should not rescale.

$\endgroup$
4
  • 2
    $\begingroup$ How can I know the range of the input? $\endgroup$
    – Noran
    Sep 18 '18 at 18:21
  • 1
    $\begingroup$ Come on, use the fact that images are numbers and numpy array's can take care of them, combine with min, max...! A humble request, kindly read about DL before applying DL... $\endgroup$
    – Aditya
    Sep 18 '18 at 18:27
  • 2
    $\begingroup$ I am not using numpy array, I am reading the images from directory. $\endgroup$
    – Noran
    Sep 18 '18 at 19:34
  • 2
    $\begingroup$ I cannot see the scale of the image from the image details. $\endgroup$
    – N.IT
    Sep 18 '18 at 19:49

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