# using (deep) neural networks for a severely imbalanced image dataset when some classes have <10 images

Taking a long shot here. So I have a a small dataset of ~500 images with discrete labels from 1 to 9. My task is to detect the per-class and overall accuracy of this classification method using a (deep) neural network.

I get an accuracy of 56% using multinomial logistic regression using train/test split method. I used transfer learning in PyTorch for some of the categories that have >25 images (2, 3, 5, 7, and 9). However, I do not know how to use this tutorial and report test accuracy when I only have like 3 or 11 images in a category.

https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html

Here is the number of images per category:

category 1: 3
category 2: 66
category 3: 175
category 4: 18
category 5: 54
category 6: 12
category 7: 91
category 8: 11
category 9: 38


What (deep) neural network method (hopefully with a link to tutorial, would you suggest that could work with a dataset like mine that has severe data imbalance and also some categories are having <10 images?

I have provided further discussion of the problem I am dealing with as well here: https://discuss.pytorch.org/t/leave-one-out-cross-validation-for-images-with-labels-and-discrete-confidence-levels-for-labels/29227 Here is the confusion matrix I get from multinomial logistic regression:

• Have you considered the option of "blowing up" your training set by applying transforms to some of the images to create a bigger training set? – mroman Nov 11 '18 at 19:34
• Data augmentation seems like a good idea indeed (+1 to mroman). Comment: with 3 and 11 instances (as in categories 1 and 8) most "within-class" accuracy metrics are you know... a bit irrelevant? What will be it be their standard error like? 50%? – usεr11852 says Reinstate Monic Nov 11 '18 at 23:40
• @usεr11852 can you please explain what you mean by 'a bit irrelevant? What will be it be their standard error like? 50%?' – Mona Jalal Nov 12 '18 at 0:06
• @mroman I have used 'data augmentation' in the past such as rotation/adding noise/etc as given by DL frameworks. However, just having 3 or 11 sample images to start with is really low, isn't it? – Mona Jalal Nov 12 '18 at 0:06
• @usεr11852 also, you say within-class accuracy is a bit irrelevant. Do you mean "per-class accuracy" such as reported in confusion matrix is irrelevant? what accuracy metric do you suggest? – Mona Jalal Nov 12 '18 at 0:08