Focal-Loss icon indicating copy to clipboard operation
Focal-Loss copied to clipboard

How does it work?

Open Johnson-yue opened this issue 7 years ago • 6 comments

Hi,sciencefans: thank you for sharing your code , and I want to know is the Focal Loss work well?? How much improve than before?

Johnson-yue avatar Aug 17 '17 03:08 Johnson-yue

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.

liuyuisanai avatar Aug 17 '17 07:08 liuyuisanai

@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.

XiaoyanLi1 avatar Aug 17 '17 14:08 XiaoyanLi1

@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.

liuyuisanai avatar Sep 02 '17 14:09 liuyuisanai

@sciencefans Hi,your method is faster rcnn or ssd? rpn network and rcnn network use focal loss?

JacobianTang avatar Sep 07 '17 03:09 JacobianTang

@XiaoyanLi1 I also tried focal loss with SSD, it's worse than OHEM.Do you have any update?

bailvwangzi avatar Sep 13 '17 03:09 bailvwangzi

@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)

XiaoyanLi1 avatar Sep 14 '17 09:09 XiaoyanLi1