2

I am trying to model a packet data with 1 dimensional CNN but I have a very imbalanced classes in my target. I have 3 classes as class 0 has 53000 cases, class 1 has 300 cases and class 2 has 150 cases. Thanks in advance!

I have tried what you have suggested but I do not think I am getting a good results(loss and accuracy), from the model.

enter image description here

1 Answers1

0

If you are using TensorFlow to write your architecture,

  1. You can create 3 training datasets( one for one class) using tf.data and then you can use tf.data.experimental.sample_from_datasets with the same weightage to generate the batch data. Check weights parameter in the documentation.

  2. You can initialize well in the final layer. Please check this blog from Andrej Karpathy.

  3. You can add the class_weight parameter while training.

Uday
  • 576
  • 4
  • 9