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

关于论文中Joint-optimization Loss的问题 #7

Closed
Oooqf opened this issue Feb 22, 2022 · 3 comments
Closed

关于论文中Joint-optimization Loss的问题 #7

Oooqf opened this issue Feb 22, 2022 · 3 comments
Labels
loss function question Further information is requested

Comments

@Oooqf
Copy link

Oooqf commented Feb 22, 2022

(Joint-optimization Loss中提到的area normalization 和 loss re-weighting mechanism都能理解)

因为从PDF中由MLE得到的joint-optimization function都是最为常用的损失函数。
所以没能理解,论文中提到的:由最大似然估计(MLE)得到joint-optimization function有什么意义。

@Shank2358
Copy link
Owner

Shank2358 commented Feb 22, 2022

(Joint-optimization Loss中提到的area normalization 和 loss re-weighting mechanism都能理解)

因为从PDF中由MLE得到的joint-optimization function都是最为常用的损失函数。 所以没能理解,论文中提到的:由最大似然估计(MLE)得到joint-optimization function有什么意义。

您好。cls的估计值不是单纯的卷积层输出然后sigmoid激活,是卷积层对cls估计值与回归的e^-loss这俩的乘积,范围也是0-1,然后再用这个值和gt去做BCE,也就是cls是会受到回归loss影响的。或者说这里的cls概率估计是一个条件概率估计,是在e^-loss最小化条件下的。
loss_jol.py的第104-105行
scores_cls_loc = torch.sigmoid(p_cls) * scores_loc
scores_cls_loc = -torch.log((1-scores_cls_loc)/(scores_cls_loc+1e-16)+1e-16)
111-112行
loss_pos = (label_cls != 0).float() * label_mask * BCE(input=scores_cls_loc, target=label_cls_smooth) * label_mix * area_weight
loss_neg = (1 - (label_cls != 0).float()) * label_mask * BCE(input=p_cls, target=label_cls_smooth) * label_mix * area_weight
最终和类别gt算BCE的是scores_cls_loc,定位和分类的联合得分而不是原来直接的cls_cls=sigmoid(...)

论文里有相应的解释在介绍cls的估计值后面,Eq.(14)后面那一段,这个公式里面的G
就是scores_loc=e^-loss_loc。scores_cls=原来常见loss中CNN预测的scores_cls*score_loc,joint体现在这里,而不是单纯的objectness,localization和classification三部分loss根据MLE得出的相加(根据MLE得出三部分相加范式是有前提的,是假设三部分的预测相互独立的,联合pdf才是各部分pdf的乘积,MLE才能推出各部分相加),但我们认为这三个pdf不一定是互相独立的。

当然也可以从条件概率的角度去解释,您可以和您理解的普通loss对比康康论文中给出的每一部分pdf的条件项是什么,估计值是什么,就会发现上述的不同了。

另外论文里写这么多从头开始推的解释也有一个目的是为了解释清楚常见的loss是怎么来的,因为审稿意见里面有这条。

不知这样解释是否能够理解,还有问题也欢迎交流讨论,如有不对也请批评指正。谢谢。

@Oooqf
Copy link
Author

Oooqf commented Feb 23, 2022

明白了,非常感谢作者的细致解答。

@Oooqf Oooqf closed this as completed Feb 23, 2022
@Shank2358
Copy link
Owner

明白了,非常感谢作者的细致解答。

不客气~~

@Shank2358 Shank2358 added question Further information is requested loss function labels Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loss function question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants