# Image classification with different number of training image for each class

I'm trying to train neural network for image classification with 4 different classes:

1. Cars (22k training examples)
2. Building (8k training examples)
3. Pedestrian (5k training examples)
4. Trees (1k training examples)

The problem is that the number of training images is biased toward one/two class(es).

I'm wondering if there is a way to train neural network in terms of the number of training examples per class?

Do I have to limit the number of training examples per class to the minimum number of all classes?

It is not important that you don't have data of different classes which are unbalanced. What is important is that your data should have a real distribution. The distribution of your training data should be the same as your test environment. As you can read here, your data should be suited well for the task it is going to be used. Consequently, if the distribution of your samples is real, there will be no problem. Consider the point that for unbalanced data-sets we should use appropriate evaluation metrics like F1 score.