Focal-Loss
Focal-Loss copied to clipboard
How does it work?
Hi,sciencefans: thank you for sharing your code , and I want to know is the Focal Loss work well?? How much improve than before?
Actually I haven't get any gain for now. The result on face detection task of using default setting (alpha=0.25, gamma=2) is just similar with that of using sigmoid_cross_entropy_loss
. I'm still trying to make it work.
@sciencefans I've implement focal loss for SSD object detection framework. In my case, it's worsen than OHEM, but my friend get higher precision using it in semantic segmentation.
The author used it in object detection with a self-created network similar to SSD. Although the performance is amazing, it is contributed by both larger input size and more anchor boxes.
It's doubtful why they did not prove its effectiveness with a prevailed pipeline, and most likely the problem is in implementation details. Hope to see your further update and discussion.
@Johnson-yue @XiaoyanLi1
Hi all, in my experiments, focal loss works well on object proposal task. On coco minival
, it performs 2% better than softmax loss (recall=82.53%->84.71% @ 300 proposals, IoU=0.5), in which resnet-101 is used as RPN backbone.
@sciencefans Hi,your method is faster rcnn or ssd? rpn network and rcnn network use focal loss?
@XiaoyanLi1 I also tried focal loss with SSD, it's worse than OHEM.Do you have any update?
@bailvwangzi The mAP under the best setting I've tried is still lower than OHEM. Considering the computation cost, I've stopped my experiment. The only conclusion is that the ratio (lambda) between classification loss and regression loss is important. Hyper-parameters I've tried are
- lambda=1, gamma=2
- lambda=4, gamma=2
- lambda=4, gamma=2. alpha=0.25 (best)