allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.71k stars 879 forks source link

Why didn't the coordinates_loss multiplied by object_detection mask? #149

Closed JustinhoCHN closed 5 years ago

JustinhoCHN commented 5 years ago

In keras_yolo.py line 282, the coordinates_loss code is:

coordinates_loss = (coordinates_scale * detectors_mask * K.square(matching_boxes - pred_boxes))

But in the original yolo paper, the coordinates_loss should be like this: _20181009101100

In other words, the object_detection mask is missing.

So what do you think? Correct me if I'm wrong please. Thank you.

JustinhoCHN commented 5 years ago

Sorry, I made a mistake, the detectors_mask are those positive examples that in the responsible cells for training, and the 1 - object_detection are negative examples that in the responsible cells. The reason why the no_objects_loss multiplied by the 1 - object_detection is because we should choose less negative examples rather than all the other cells and anchors which are not reponsible for training (1-detectors_mask). So, the object_detection part has nothing to do with coordinates loss.