KaihuaTang / Long-Tailed-Recognition.pytorch

[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS). It is also a PyTorch implementation of the NeurIPS 2020 paper 'Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal Effect'.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问detection中rcnn head的cls是不是做了2次softmax操作?

TangJiajieseu opened this issue · comments

第一次在cos_forward函数里,if self.KEEP_FG会做一次softmax

第二次在基类bbox_headget_bboxes函数里

scores = F.softmax(cls_score, dim=1) if cls_score is not None else None

请问是我理解错了还是就是这样设计的哇?

另外在get_target函数里,背景被设为最后一类,但是在update_embed时,过滤的条件是gt_label > 0


请问这是为啥?

另外在get_target函数里,背景被设为最后一类,但是在update_embed时,过滤的条件是gt_label > 0

请问这是为啥?

这里是个Bug,因为我早期投稿的时候LVIS V0.5是在mmdet V1.1上实现的,V1.1里background是第0类。后来文章中了之后发现新出了个LVIS V1.0和mmdet V2.4, 然后我就移植了下,mmdet V2.4里背景被设为最后一类。所以这里update_embed是有bug的,改了之后LVIS V1.0上应该还会有提升。。。

对的,是两个softmax,不过这部分代码只在test时候跑(Line 216: if (not self.training) and self.CAUSAL_INFER:)所以并不会改变预测的类别。而训练的时候只有一个softmax。之所以这里要多一个是因为这里不能让TDE改变background/foreground的概率。所以要先Freeze Background的probability

多谢回答 @KaihuaTang ,关于做两次softmax我还有个问题,如果做两次softmax会导致正样本的score特别低吧?例如有10个类,其中第5类的logit=10,其他的logit=-10,做2次softmax后,第五类的score就只有0.2320,会由于score太低(<0.3)被直接忽略吗?如果是这样那mAP会不会很低呢

ok,多谢!!