Closed zengziru closed 10 months ago
Hi, @zengziru:
The hm is used to reweight the distillation from the teacher to the student model instead of VFL, VFL.WEIGHT_TYPE is set to iou, which is the same as Eq. (4) in the paper. You can try to use hm or hm_rev and observe whether further improve the performance or not. From my side, I do not observe obvious improvements.
We use the hm to reweight the distillation for both classification and localization, you can find them in https://github.com/kinredon/Harmonious-Teacher/blob/863eda2d4fc2ced8fee228034033865e54ddc286/ht_c2f/runner.py#L409C9-L409C20, which is used to weight both classification and localization.
Thanks a lot for your detailed reply, I will read the code again carefully.
Hello! Based on the get_distill_loss code in the runner.py you provided, I found that:
hm = (cls_prob ** self.alpha) * (iou ** self.beta)
loss_uncertainty = (1 - hm) / self.cfg.TRAINER.DISTILL.UN_REGULAR_ALPHA
loss_weight = torch.exp(-loss_uncertainty.detach())
But in your paper the weighting function is written like this: exp^(1-h), there seems to be a minus sign difference between the code and the formula. I wonder which version, code or paper should I refer to? Hope to get your reply, thank you very much!
Thank you for pointing this out. You can refer to the implementation of the codebase.
I observe that in all your configs the VFL.WEIGHT_TYPE all set to be 'iou' not the 'hm' or 'hm_rev' said in your paper. I would like to know whether the accuracy of the model can be improved if the weight_type is changed to "hm_rev". Is the best data in your paper obtained by setting weight_type to iou or hm_rev?
In your paper, it seems that hm operation is only for vfloss. By observing your code, I find that hm does not seem to be used for weighting when calculating the regression loss of the boxes. Is the hm operation not used on the box regression branch? Hope to receive your reply, thank you very much!