Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about the formula of alpha-DIoU loss in Eq. (4) #6

Closed
wangren97 opened this issue Nov 24, 2021 · 2 comments
Closed

question about the formula of alpha-DIoU loss in Eq. (4) #6

wangren97 opened this issue Nov 24, 2021 · 2 comments

Comments

@wangren97
Copy link

Dear author,
Thanks for your work. I have a question about the the formula of alpha-DIoU loss in Eq. (4) from the paper. The alpha-version of the penalty term computed based on B and Bgt is ρ^(2alpha) / c^(2alpha), where ρ(·) being the Euclidean distance and c being the diagonal length of the smallest enclosing box. In your code, utils/general.py, line 405: c2 = cw ** beta + ch ** beta + eps # convex diagonal and line 408: rho2 = (rho_x ** beta + rho_y ** beta) / (2 ** beta) # center distance, it calculates the alpha version of penalty term as (w^(2alpha) + h^(2alpha)) / ( ρx^(2alpha) + ρy^(2alpha)) [type 1]. Why not ((w^2 + h^2) / (ρx^2 + ρy^2))^alpha [type 2]? It seems type 2 is reasonable because it follows the form (term)^alpha, such as IoU^alpha, (BV)^alpha and keeps the representation of Euclidean distance. In type 1, I don't understand the meaning of w^(2alpha) + h^(2alpha), does it still mean distance? Could you please explain more details about your design and why it is better than type 2? I don't find the theoretical analysis about this part in the paper.
Thanks

@Jacobi93
Copy link
Owner

Thx so much for your interest and you're right to use type 2 as the training loss function. Actually, we try both type 1 and 2 and find little difference in their final performance. They maintain the same dimension consistency, i.e., area^(alpha) is equivalent to length^(2*alpha). In addition, the regularization term is not as important as the IoU term in our experiments, which is also empirically demonstrated in the paper.
Thx again for your question and I have changed the form back to type 2 in utils/general.py.

@wangren97
Copy link
Author

Thanks for your reply. I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants