I am having a dataset which is highly imbalanced, and having approx 264 classes with each class having samples ranging from 1 to 500, mostly of the classes having less then 100 samples. I tried under and oversampling and big ANN having 7-8 layers having avg 2000 neurons in each layers. Still getting only 1-2% accuracy. Please help me. I am unable to increase even training accuracy
I think that is way too many weights and biases to train using that size of data set. And training an 8-layer NN is a very difficult task.
I recommend you start with simpler solutions, and only add as much complexity as you need to get good enough results.
Thank you @TMosh , you means getting started with 2-3 layers network? I started with 2-3 layers and gradually increase them, but does not seem to work. It got stuck in same accuracy after 10-11 epochs.
Additionally to what @TMosh said, you need more data per class, you say you have 264 classes with 1-500 samples each, you need more data per class! Much more, because you also have a lot of classes and with that very little data, the model will sure misclassify the images to another similar class (unless it has seen more data for each class).