broadinstitute / keras-rcnn

Keras package for region-based convolutional neural networks (RCNNs)
Other
553 stars 224 forks source link

Add inside and outside bounding box weights #88

Open jhung0 opened 6 years ago

jhung0 commented 6 years ago

As in https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/fast_rcnn/config.py#L120 and used in https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/rpn/proposal_target_layer.py#L64 and regression losses.

hgaiser commented 6 years ago

I never really checked what these weights do, can you explain them to me ?

jhung0 commented 6 years ago

Inside weights seem to be for specifying anchors or rois with positive label (as opposed to 0 or -1). In the config, it seems outside weights are sample weighting (separate for RPN and RCNN).

Give the positive RPN examples weight of p * 1 / {num positives} and give negatives a weight of (1 - p). Set __C.TRAIN.RPN_POSITIVE_WEIGHT = -1.0 to use uniform example weighting. (This is used for outside weights)