Search code examples
tensorflowobject-detection

Do I need every class in a training image for object detection?


I just try to dive into TensorFlows Object Detection. I have a very small training set of circa 40 images yet. Each image can have up to 3 classes. But now the question came into my mind: Does every training image need every class? Is that important for efficient training? Or is it okay if an image may only have one of the object classes?

I get a very high total loss with ~8.0 and thought this might be the reason for this but I couldn't find an answer.


Solution

  • In general machine learning systems can cope with some amount of noise. An image missing labels or having the wrong labels is fine as long as overall you have sufficient data for the model to figure it out.

    40 examples for image classification sounds very small. It might work if you start with a pre-trained image network and there are few classes that are very easy to distinguish.

    Ignore absolute the loss value, it doesn't mean anything. Look at the curve to see that the loss is decreasing and stop the training when the curve flattens out. Compare the loss value to a test dataset to check if the values are sufficiently similar (you are not overfitting). You might be able to compare to another training of the exact same system (to check if the training is stable for example).