Skip to content
Advertisement

Loss function for CNN sliding window model, for multi Object

JavaScript

I implemented a model with python using Keras which is series of convents layer that takes a 512*512 image and converts it to a tensor with the dimensions of 16*16. Im now trying to detect an object in this 16*16 tensor so that it gives me a 1 for detecting and a 0 otherwise. The problem is I don’t know which loss function I should use in Keras. I used binery_cronstropy and xx but the model trains in a way that only outputs 1 for one of the detected objects and 0 for everything else even though there is still objects to detect. I want to use the code in a way that detect All the present objects and not just one. Here is the code im working on.

Advertisement

Answer

binary_crossentropy is used in binary clasification (excluding classes with values of 1 or 0 ).

If you are detecting objects, you probably are in a multimodal problem with multiples classes and in the results you want a probability of there is a certain object in certain box/space of the image.

I didn’t try object detection but probably you should use categorical_crossentropy.

Advertisement