implus / GFocal

Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection, NeurIPS2020
Apache License 2.0
587 stars 73 forks source link

Some questions about the implementation #3

Closed JyunYuLai closed 4 years ago

JyunYuLai commented 4 years ago

Hi, Thank you for sharing the great work. I have few questions listed below.

  1. Table 1(a) in paper, you replaced the centerness branch with iou branch in FCOS, and got some quality gain. I'm curious about the details about this part. I do some experiment myself and found the training is not working. In the original FCOS, the regression loss is weighted by centerness target, and if I simply replace the centerness target with the iou target, the regression loss and iou loss will all be zero, so the training failed. It will be very nice if you share some code or details about this experiment.
  2. In gfl_head.py, the loss_dfl and loss_bbox is weighted by "predicted score" which is different in FCOS and ATSS. Is there any reason about this part? Thank you in advance.
implus commented 4 years ago
  1. I think one possible problem is that you may try to call iou_target.detach() for weighting the regression loss. It is easy to conduct the experiment by referring to the codes in this repo.
  2. In fact, the performances for "predicted score" and "calculated score" have no obvious differences in final performance. You can try either as you like.
JyunYuLai commented 4 years ago

Hi, Thank you for your quick response.

  1. I'm not sure if i understand your answer correctly. So in the FCOS experiment, we shouldn't normalize the regression loss by the iou target. The reason not to do this is because it may cause the initial training unstable ? please correct me if i'm wrong.
  2. Okay, thank you so much. I will give it a try.
implus commented 4 years ago
  1. We should normalize, but use a form like ``iou_target.detach()'' for normalizing as it contains predicted bounding box part which may introduce gradient propagation.
JyunYuLai commented 4 years ago

Hi, Yes, i already weighted the regression loss by iou target as FCOS did. In my FCOS IOU-branch experiment, it doesn't work. As training started, the iou target values are small(close to zero), probably because the initial prediction in regression branch is nothing. And then the iou branch tend to predict all zero iou value and then the training just failed. Did you use any trick like increase regression loss scale at the beginning of training ?

implus commented 4 years ago

It is a bit strange. In our experiments, we do nothing like increase regression loss scale at the beginning of training, and we do not observe training failures as you describe.

JyunYuLai commented 4 years ago

Okay, thank you, so in your case, simply replace centerness branch to iou branch work, I will check my code if there is any problem.

implus commented 4 years ago

All right~

chenxuheng1995 commented 4 years ago

I have the same question. When I replace the centerness target with the iou target, the regression loss and iou loss will all be zero. What's more, the giou loss cannot be calculated.

implus commented 4 years ago

You can simply run the code in this repo and carefully go through more details to check what is missing in your implementation.

chenxuheng1995 commented 4 years ago

This is my label question. Thank you for your reply.