Keras-retinanet: Confusion about the normalization of loss function?

Created on 1 Oct 2018  ·  3Comments  ·  Source: fizyr/keras-retinanet

First of all,Thank you very much for sharing this code!
I have a question as to why the loss is normalized by the number of positive anchors?
normalizer = backend.where(keras.backend.equal(anchor_state, 1))
I think that the loss should be normalized according to the number of positive and negative anchors, because it is calculated by positive and negative anchors.
normalizer = backend.where(keras.backend.not_equal(anchor_state, -1))
Is this right?

Most helpful comment

There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.

I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.

All 3 comments

@fizyr

There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.

I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.

There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.

I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.

I understand, thank you very much for your answer!!!!!!

Was this page helpful?
0 / 5 - 0 ratings