Zzh-tju / DIoU-SSD-pytorch

Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression (AAAI 2020)
GNU General Public License v3.0
87 stars 24 forks source link

Some questions #16

Open xianfangfx opened 4 years ago

xianfangfx commented 4 years ago

In the SSD code, I choose diounms to train with IoU, GIoU, DIoU and CIoU, respectively, and save the result when epoch = 1. The AP evaluation of these results shows that DIoU + diounms is the best, GIoU + diounms is the second, IoU + diounms is the third, and CIoU + diounms is the last. Is this normal? Or what parts of the original code need to be modified?

Zzh-tju commented 4 years ago

There is randomness in training, especially in the early stage of training

xianfangfx commented 4 years ago

Hello! The gradient of v w.r.t. w and h in the paper are not consistent with the results of my solution. I am very confused. Here is my answer. the gradient of v w.r.t. w: 8/pi^2 (arctan(w^gt/h^gt)-arctan(w/h)) (-h/(w^2+h^2)) the gradient of v w.r.t. h: 8/pi^2 (arctan(w^gt/h^gt)-arctan(w/h)) (1/(w^2+h^2))

Zzh-tju commented 4 years ago

the latest loss function has removed the self-defined gradient, since we do not observe any explosion in training.

xianfangfx commented 4 years ago

I'm sorry that my previous message was wrong. I've fixed it in the picture below. In addition, is the first picture in paper below from the latest version? Is the second figure in code below need to update the plus and minus symbols? 微信截图_20200414162902 微信截图_20200414163251

Zzh-tju commented 4 years ago

Actually, we are about to remove this paragraph in the latest version of paper. Because even in YOLOv3 (darknet), there is only a minor difference between removing 1/(w²+h²) or not. It only affects simulation experiments.

Is the second figure in code below need to update the plus and minus symbols?

no

xianfangfx commented 4 years ago

Thank you very much for your prompt reply. I'm sorry I didn't state clearly enough. What I don't understand is that the gradient sign of v w.r.t. w and h in the paper is reversed, while the code is written strictly according to the wrong answer of the old paper. Whether it needs to be modified.

Zzh-tju commented 4 years ago

For YOLOv3 and simulation experiments, the answer is not.

xianfangfx commented 4 years ago

In box_utils.py, I am confused about the definition of diounms, where center_x2 = (xx1 + xx2) / 2, while center_y2 = (yy2 + yy2) / 2, why not center_y2 = (yy1 + yy2) / 2. 微信截图_20200426100446

Zzh-tju commented 4 years ago

you're right. I've fixedd this error a couple days ago. But beta for DIoU-NMS will change and become similar to YOLOv3.

And more improvement for this repo is coming soon. maybe within the next 2 weeks.

poppy007 commented 2 years ago

image I am very confused about the gradient explanation of this place, but the use of this gradient is not reflected in your code, and the author's gradient calculation is wrong, I would like to ask you, what is the function of this gradient here?