title: Keras: rescale=1./255 vs preprocessing_function=preprocess_input - which one to use?
body: <h2>Background</h2>
  
  <p>I find quite a lot of code examples where people are preprocessing their image-data with either using <code>rescale=1./255</code> or they are using they <code>preprocessing_function</code> setting it to the <code>preprocess_input</code> of the respective model they are using within the ImageDataGenerator. First I thought using <code>rescale=1./255</code> only works when dealing with a pretrained vgg16 model, but I keep seeing examples where it is being used with pre-trained resetnet50, inception etc. as well. </p>
  
  <p>While the keras-blog (<a href="https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html" rel="noreferrer">https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html</a>) uses this approach...</p>
  
  <pre><code>ImageDataGenerator(rescale=1./255, ...
  </code></pre>
  
  <p>... the Keras docs (<a href="https://keras.io/applications/" rel="noreferrer">https://keras.io/applications/</a>) uses this approach:</p>
  
  <pre><code>from keras.applications.vgg19 import preprocess_input
  ImageDataGenerator(preprocessing_function=preprocess_input, ...
  </code></pre>
  
  <p>I thought using the respective preprocess_input of the respective model I want to train is always superior to using the rescale=1./255 approach, since it will 100% reflect the preprocessing that has been used during training of the pretrained model. </p>
  
  <h2>Question</h2>
  
  <p>I need some clarification on when to use <code>rescale=1./255</code> vs keras build-in <code>preprocess_input</code> of the respective model I want to train on when preprocessing images for transfer-learning. Does this only make a difference when using pretrained-models i.e. with loaded weights vs training from scratch?</p>