QA-FewDet
QA-FewDet copied to clipboard
Differents from fewx
Hello, your work is very interesting. When I read the code, I found the following differences between QA-FewDet and fewx :
in fewx
bg_num_0 = max(1, min(fg_inds.shape[0] * 2, int(num_instances * 0.25))),
real_bg_topk_inds_0 = real_bg_inds[real_bg_inds < int(num_instances * 0.5)][:bg_num_0],
real_bg_topk_inds_1 = real_bg_inds[real_bg_inds >= int(num_instances * 0.5)][:bg_num_1]
in QA-FewD
bg_num_0 = max(1, min(fg_inds.shape[0] * 2, int(128 * 0.5)))
real_bg_topk_inds_0 = real_bg_inds[real_bg_inds < 128][:bg_num_0]
real_bg_topk_inds_1 = real_bg_inds[real_bg_inds >= 128][:bg_num_1]
According to my understanding,the first 128 proposals are negative support proposals, and the last 128 proposals are positive support proposals,this means that there is only one query image to participate in the training each time? Could you please explain why you did this,thanks a lot.
Thanks for your interest in our work.
Yes, this is because we made one following change compared with FewX, In FewX, the support_way is exactly 2 way (https://github.com/fanq15/FewX/blob/master/fewx/modeling/fsod/fsod_rcnn.py#L159). In our repo, we remove this restriction, and the support_way can be larger than 2 (See https://github.com/GuangxingHan/QA-FewDet/blob/main/fewx/modeling/fsod/fsod_rcnn.py#L211, we enumerate all the negative support classes here). In our experiment, we find that using support_way = 5 during fine-tuning gives the best results.
The num_instances means the number of proposals used to calculate loss here. It consists of 128 proposals generated by the positive support class, and 128 * (support_way-1) proposals generated by the rest negative support classes. Only when support_way=2, num_instances * 0.5 equals to 128, which is the number of proposals generated by the positive support class. If the support_way>2, using num_instances * 0.5 in the above python script is incorrect.
I see. Thank you very much!