I am working on an image based classification task with some significant class imbalance in the training database of images (largest class: 4967 images, smallest class: 61 images).

I will be experimenting with two different machine learning approaches for this purpose (SVM and CNN), and will need to use the same training data for each approach.

I was planning on synthesizing additional training data by applying some simple transformations to the original images (rotation, flipping, and altering brightness), and think this is a good opportunity to also resolve the problem of class imbalance by creating more augmented images for the less frequent image classes.

My query regarding this essentially has two elements:

1) Is there a sensible limit to how much data I can synthesize in this manner? Obviously I could increase the frequency of the least frequent class by a factor of 359 if I simply apply rotation transformations in 1 degree steps. However, I am concerned creating many similar images from the same source image will result in over-fitting, or have some other negative impact.

2) If there is a limit on the amount of data synthesis it is sensible to do: can any one offer advice on balancing the trade-off between not synthesizing too much data and reducing class imbalance via data augmentation?

I would be particularly interested in input from anyone who has dealt with similar problems in practice before

  • $\begingroup$ Keep in mind that transformations multiply each class by some fixed number $K$, unless you only focus on the lower classes. In either case, be wary that these transformations will not guarantee your model will generalize well. Just because you can turn your 61 images to say, 1000, doesn't mean your model will go on to predict that class very well. $\endgroup$
    – Alex R.
    Commented Nov 20, 2017 at 21:46

1 Answer 1


While this does not directly answer your question, this might guide you a little bit.

It's possible to balance out your lopsided training data. For example, if you are using SVM implementation in python's Scikit-learn library, you can specify a class weight (details here). There are some additional tweaks you can do but I think this could help you get started on it. I would definitely not suggest you to synthesize additional data as I feel this would create bias and is redundant.

You might also consider checking out this post: SVM for unbalanced data


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.