0

i'm new in python so for my college final project, i use EfficientNet for the ripeness palm oil into 4 classification. i've total 5852 train data (1463 each) , and 132 test data (33 each). i used code from the internet. but the result is far from good. i already add layers.dropout to prevent / avoid underfitting. and i also use imagenet to do the transfer learning. is there any solution to improve the result?

Edit: i already change my code from conv_base.trainable = False to conv_base.trainable = True. But i think the result still not good

here's my full code: https://drive.google.com/file/d/1OeiSA23xmF5ceq19aqc1l20mlT3Uxocs/view?usp=sharing

and here's my result

model accuracy

model loss

  • Your code looks good to me. I think you just need to do more experiments. For now, I would suggest you try to overfit your training data and then regularize. Also, train the `conv_base` as well. – Abhishek Prajapat Aug 14 '21 at 10:42
  • is there any clue how to do that sir? – Muhammad Rifqi Oct 23 '21 at 06:53
  • Chnage this line `conv_base.trainable = False` to `conv_base.trainable = True`. Also, dropout prevent Overfitting and not underfitting. – Abhishek Prajapat Oct 24 '21 at 07:04
  • i'll try that. But, can you help me on which code to dropout the prevent overfitting and not underfitting? – Muhammad Rifqi Oct 25 '21 at 03:05
  • i try to train my model. but another model appeared, it said "This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above." i already add code below to limit the memory growth. But the same error still appeared. is there any clue how to solve this? physical_devices = tf.config.experimental.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], True) – Muhammad Rifqi Oct 26 '21 at 15:23

1 Answers1

0

To my opinion 5852 samples for training Efficientnet is far from enough. You also don't have enough data for validation. I train Efficientnet on more than million samples and still it tends to overfit. My advice to you is to try a simpler CNN architecture (you can start with simple LeNet and try to add layers). If you prefer the transfer learning method try to work with BiT model (https://ai.googleblog.com/2020/05/open-sourcing-bit-exploring-large-scale.html) it will give you better results.

Ido
  • 573
  • 4
  • 11