I am trying to do multi class(16) classification, however no matter what parameters or number of layers I use my accuracy is not improving, its in 30s the max I got was 43.
I have tried early stopping to red overfilling but my testing accuracy is still low.
I have 750 images in training and 350 in testing. I am also getting high traning accuracy vs low validation accuracy.
features_train=features_train/255
features_test=features_test/255
cnn = models.Sequential([
layers.Conv2D(filters=16, kernel_size=(3, 3), activation='relu', strides=(2, 2), padding="same", input_shape=(224, 224, 3)),
layers.MaxPooling2D((2,2)),
layers.Dropout(0.25),
layers.Conv2D(32 ,(3, 3), activation='relu'),
layers.MaxPooling2D((2,2)),
layers.Dropout(0.25),
layers.Conv2D(64, (3, 3), activation='relu'),
layers.MaxPooling2D((2,2)),
layers.Dropout(0.25),
layers.Conv2D(128, (3, 3), activation='relu'),
layers.MaxPooling2D((2,2)),
layers.Flatten(),
layers.Dense(64,activation='relu'),
layers.Dense(16, activation='softmax')
])
cnn.compile(optimizer='adam',
loss='categorical_crossentropy',
metrics=['accuracy'])
cnn.fit(features_train,labels_train,epochs=20, batch_size = 4 ,validation_split = 0.25)