keras-yolo3 icon indicating copy to clipboard operation
keras-yolo3 copied to clipboard

is there any wrong about the confidence loss?

Open ztfmars opened this issue 4 years ago • 1 comments

origin: confidence_loss = object_mask * K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+ (1-object_mask) * K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True) * ignore_mask

i think , it means the different cross entroypy value of labels = 1 and labels=0. so the equation should be

1x binary_crossentropy(lable=1, pred) + (1-0)xignore_maskxbinary_crossentropy(label=0, pred)

so the confidence loss may should be like following:

confidence_loss = object_mask * K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+
(1-object_mask) * K.binary_crossentropy((1-object_mask), raw_pred[...,4:5], from_logits=True) * ignore_mask

ztfmars avatar Jun 05 '20 10:06 ztfmars

the second part of the equation is to verify that you don't detect any object when there is not. So when object_mask is equal to 0, raw_pred[] should too. So the equation seems correct.

MrSouwbauck avatar Nov 03 '20 13:11 MrSouwbauck