keras-yolo3
keras-yolo3 copied to clipboard
is there any wrong about the confidence loss?
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
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.