Need support to improve model accuracy

Hi all, having tried

  • 4 or 3 layers of CNN
  • Optimizer: Adam, RMSprop
  • Batch size from 10~50
  • learning rate from 0.01~0.0001

my accuracy is still hanging at the 70~80% for both training and validation datasets.

No idea about how to improve it to 95% for training dataset but it seemed it reached 80% for validation dataset.

Any suggestions?

My best results are listed as followed:
learning rate: 0.0001
optimizer: Adam
layers: 4

Epoch 1/15
1125/1125 [==============================] - 38s 33ms/step - loss: 0.5976 - accuracy: 0.6690 - val_loss: 0.5039 - val_accuracy: 0.7616
Epoch 2/15
1125/1125 [==============================] - 36s 32ms/step - loss: 0.4835 - accuracy: 0.7680 - val_loss: 0.4908 - val_accuracy: 0.7672
Epoch 3/15
1125/1125 [==============================] - 35s 31ms/step - loss: 0.4377 - accuracy: 0.7986 - val_loss: 0.4493 - val_accuracy: 0.7916
Epoch 4/15
1125/1125 [==============================] - 37s 32ms/step - loss: 0.4054 - accuracy: 0.8163 - val_loss: 0.4133 - val_accuracy: 0.8148
Epoch 5/15
1125/1125 [==============================] - 36s 32ms/step - loss: 0.3824 - accuracy: 0.8283 - val_loss: 0.4027 - val_accuracy: 0.8164
Epoch 6/15
1125/1125 [==============================] - 35s 32ms/step - loss: 0.3598 - accuracy: 0.8436 - val_loss: 0.3883 - val_accuracy: 0.8320
Epoch 7/15
1125/1125 [==============================] - 35s 31ms/step - loss: 0.3414 - accuracy: 0.8533 - val_loss: 0.3822 - val_accuracy: 0.8328
Epoch 8/15
1125/1125 [==============================] - 37s 33ms/step - loss: 0.3255 - accuracy: 0.8613 - val_loss: 0.3691 - val_accuracy: 0.8404
Epoch 9/15
1125/1125 [==============================] - 37s 33ms/step - loss: 0.3108 - accuracy: 0.8675 - val_loss: 0.3714 - val_accuracy: 0.8424
Epoch 10/15
1125/1125 [==============================] - 36s 32ms/step - loss: 0.2946 - accuracy: 0.8765 - val_loss: 0.4124 - val_accuracy: 0.8316
Epoch 11/15
1125/1125 [==============================] - 35s 31ms/step - loss: 0.2887 - accuracy: 0.8780 - val_loss: 0.3661 - val_accuracy: 0.8540
Epoch 12/15
1125/1125 [==============================] - 35s 31ms/step - loss: 0.2832 - accuracy: 0.8818 - val_loss: 0.3561 - val_accuracy: 0.8500

Please read this.

Unless you’ve taken deep learning specialization, let’s start by not touching the batch size & learning rate and try the rest.

Hi Balaji,

Thank you for your reply. Now I constrained my learning rate to 0.001 and batch_size =20 and tried 3 layers and 4 layers. The result still failed to meet the threshold.

I’ve already tired the page you sent and also tried all other methods in this forum.
Could you please check with my Jupyter notebook which I DM you?

Check shiro’s comment in the post, that’s how I got the desired accuracy.

this post should help you, in case you were having the same issue.

The notebook you messaged me had this performance in the last iteration:
Epoch 15/15 1125/1125 [==============================] - 45s 40ms/step - loss: 45.2598 - accuracy: 0.7362 - val_loss: 59.2604 - val_accuracy: 0.7124

Please message me your best performing model.