MATLAB: Regarding usage of classifier in case of imbalance data

classificationComputer Vision ToolboxdatasetImage Processing ToolboximbalancedStatistics and Machine Learning Toolboxunbalance

I have images database consisting of four classes, but highly imbalanced. One class contains 150 images other 1500, 1800,1000. which classifier can be used to get efficient results for classification. How can i divide these images into training and testing. Kindly help

Best Answer

You can use randsample() or randperm() to get a list of 120 (80% of the smallest group) from each of the 4 groups. Use those 480 images for training, and the rest for testing/validation of the model.