title: Keras flow_from_directory class index
body: <p>I used to make it manually, but i am using now flow_from_directory to train my network with my own data. I just have one question. When i make model.predict(), how can i know that my index 0 on predictions is for label category dog and index 1 is for category cats?</p>
  
  <p>The code i am using is the following.</p>
  
  <pre><code>train_datagen = ImageDataGenerator(
      rescale=1./255,
      shear_range=0.2,
      zoom_range=0.2,
      horizontal_flip=True)
  
  test_datagen = ImageDataGenerator(rescale=1./255)
  
  train_generator = train_datagen.flow_from_directory(
          train_images_path,  
          target_size=(64, 64),  
          batch_size=batch_size)  
  
  
  validation_generator = test_datagen.flow_from_directory(
          validate_images_path,
          target_size=(64, 64),
          batch_size=batch_size)
  early_stopping = keras.callbacks.EarlyStopping(monitor='val_acc', min_delta=0, patience=3, verbose=1, mode='auto')
  history = model.fit_generator(
          train_generator,
          steps_per_epoch=1700,
          epochs=epochs,
          verbose=1,
          callbacks=[early_stopping],
          validation_data=validation_generator,
          validation_steps=196
  )
  </code></pre>
  
  <p>What i wanted to know is the pair images vs ground truth label. </p>
  
  <p>Thank you</p>