title: Keras Image Classification Problems
body: <p>I'm working on an image classification model for a multiclass problem. I get the model up and running, but when I try to predict/test the model, it appears only to be able to recognise 1 of 4 image types (it's the same class no matter how I change the model). My dataset per class is pretty small, but I do use imagegenerator to increase the amount of data. The model should be able to recognise the images with some added noise on the picture.</p>
  
  <p>My challenges can be boiled down to this:</p>
  
  <ol>
  <li>Small amount of data. I have &lt; 100 images per class.</li>
  <li>My model is not supposed to find specific figures, but more overall patterns in the picture (areas with a certain colour and such).</li>
  <li>Many of the pictures contain a lot of white and text. Do I need any image preprocessing to help the model.</li>
  </ol>
  
  <p>My model looks like this:</p>
  
  <pre><code>model = Sequential()
  model.add(Conv2D(32, (3, 3), padding='same', activation='relu', input_shape=(s1,s2,3), data_format = "channels_first"))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Dropout(0.25))
  
  model.add(Conv2D(64, (3, 3), padding='same', activation='relu'))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Dropout(0.25))
  
  model.add(Conv2D(64, (3, 3), activation='relu'))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Dropout(0.25))
  
  model.add(Flatten())
  model.add(Dense(50, activation='relu'))
  model.add(Dropout(0.5))
  model.add(Dense(4, activation='softmax'))
  
  model.compile(loss='categorical_crossentropy',
            optimizer='Adam',
            metrics=['accuracy'])
  </code></pre>
  
  <p>And has img size of 250,250, and batch size 16.</p>
  
  <p>Check acc and loss curves</p>
  
  <p><a href="https://i.stack.imgur.com/vfTM0.png" rel="nofollow noreferrer">acc curve</a> </p>
  
  <p><a href="https://i.stack.imgur.com/y05vZ.png" rel="nofollow noreferrer">loss curve</a></p>
  
  <p>Do you guys have any advice?</p>
  
  <p>Thanks in advance!</p>