What could be the error in training the detection model?

Using the “TensorFlow 2 Object Detection API”, I trained the neural detection network ( “efficientdet-d0”) to recognize images of cows.
The detector network works well and recognizes all the cows in the picture, even if there are many cows and the orientation of the trunk of different cows is different, for example:

But for some reason, sometimes when there is only one cow in the picture, the same neural network cannot recognize this cow, and if you lower the threshold for the probability of detecting objects to 30%, it “recognizes” empty space - as a cow, while the cow that is in the picture does not recognize.
for example:

What could be the reason for such a strange behavior of the neural network?

Is this a pretrained model fine tuned or it is trained from scratch with your dataset?

If it is pretrained and fine tuned then apparently the original model is not good at classifying pixels of these images with one cow. Therefore when you fine tune it include more images of this style with one cow. For more epochs too.

The same would be the approach for training from scratch, more images of this type for more epochs!

This particular image also, the colours of the cow are very similar to the background so a model easily can mistake, the solution again to include in training similar images.

1 Like

Thank you very much for the reply!
It’s pretrained and fine tuned model ==> models/research/object_detection/g3doc/tf2_detection_zoo.md at master · tensorflow/models · GitHub

That is, you think that the recipe is universal here - it is necessary to increase the dataset due to similar images with one cow and train more epochs?

Yeah its because its a matter of inner workings of convolutional neural networks, a model can’t predict right unless it has been trained on same distribution dataset.

1 Like

Notice that the image with the bad result has much different illumination and contrast.

This is certainly the case. What is the recipe for a “good result” in your opinion? Adding more similar images in the dataset? Or something else?

Include a higher variety of images in the dataset, or increase the controls on the data collection for less variance.

1 Like