As mentioned here, this is what I propose. I have not tested this, so I don't know if it is working or not. This PR only changes the classification loss, I didn't touch the regression loss.
Basically what this does is:
Reshape predicted classifications to (None, 2) (rpn_labels is already (None,).
Select those classifications that have a label which is not equal to -1. These are labelled as background (0) or foreground (1). -1 is reserved for "don't care".
Similarly, filter out rpn_labels with -1.
Execute categorical_crossentropy on the resulting two tensors (rpn_labels.shape = (None,) and rpn_classification.shape = (None, 2)).
I would love to hear some feedback on this approach of RPN losses.
As mentioned here, this is what I propose. I have not tested this, so I don't know if it is working or not. This PR only changes the classification loss, I didn't touch the regression loss.
Basically what this does is:
(None, 2)
(rpn_labels
is already(None,)
.-1
. These are labelled as background (0
) or foreground (1
).-1
is reserved for "don't care".rpn_labels
with-1
.categorical_crossentropy
on the resulting two tensors (rpn_labels.shape = (None,)
andrpn_classification.shape = (None, 2)
).I would love to hear some feedback on this approach of RPN losses.