title: Is this a case of overfitting? CNN Image classifier
body: <p>Pardon me if this question is considered off-topic or just generally a bad question, I am new to Computer Vision and CNNs in general. </p>
  
  <p>I have 3440 images in total, for a total of 10 classes. </p>
  
  <p>85 images per column of each row:</p>
  
  <p><a href="https://i.stack.imgur.com/b9lSd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b9lSd.png" alt="85 images per column of each row"></a></p>
  
  <p>Because there are only 3440 images in my dataset, I used data augmentation to increase my dataset to 34400 images. (augment 10 times per image)</p>
  
  <pre><code>aug = ImageDataGenerator( 
         rescale = 1./255,
         rotation_range = 20, 
         width_shift_range = 0.10,
         height_shift_range = 0.10,
         zoom_range= 0.05
         )
  </code></pre>
  
  <p>This is the model that I used for both instances. (once with augmentation, once without)</p>
  
  <pre><code>model = Sequential() 
  
  model.add(Conv2D(32, (3,3), input_shape = (50, 50, 3)))
  model.add(Activation("relu"))
  model.add(MaxPooling2D(pool_size=(2,2)))
  
  model.add(Conv2D(64, (3, 3)))
  model.add(Activation("relu"))
  model.add(MaxPooling2D(pool_size=(2,2)))
  
  model.add(Conv2D(64, (3, 3)))
  model.add(Activation("relu"))
  model.add(MaxPooling2D(pool_size=(2,2)))
  model.add(Dropout(0.25))
  
  # 2 hidden layers
  model.add(Flatten())
  model.add(Dense(128))
  model.add(Activation("relu"))
  
  model.add(Dense(128))
  model.add(Activation("relu"))
  
  # The output layer with 10 neurons, for 10 classes
  model.add(Dense(10))
  model.add(Activation("softmax"))
  
  # Compiling the model using some basic parameters
  model.compile(loss="sparse_categorical_crossentropy"
                ,optimizer="adam"
                ,metrics=["accuracy"])
  </code></pre>
  
  <p>I was able to increase my accuracy from ~90%(no augmentation) to ~97%(with augmentation), however the difference between training accuracy and validation accuracy remains similar.</p>
  
  <p>Graph with data augmentation:</p>
  
  <p><a href="https://i.stack.imgur.com/uNmBj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uNmBj.png" alt="Graph with data augmentation"></a></p>
  
  <p>I have read that non converging training and validation accuracies/loss with a big difference is a sign of overfitting. </p>
  
  <p>Is this the case for my CNN model? What else can I do to improve my model? </p>
  
  <p>The full codes can be found on my github </p>
  
  <p><a href="https://github.com/jwngo/SimpleImageClassifier" rel="nofollow noreferrer">https://github.com/jwngo/SimpleImageClassifier</a></p>
  
  <p>Thank you everyone, I appreciate your time. </p>
  
  <p>EDIT: 
  For the augmentated dataset, Training set is 29355 images, Validation set is 7331 images. The difference between accuracy is 0.9972(training) vs 0.9750(validation), difference in loss is 0.0102(training) vs 0.1245(validation)</p>
  
  <p>The validation images have also been augmented, which I will change to only use non-augmented images. </p>