Open Jackson-zhao97 opened 2 years ago
This repo does not support a one-stage Detector (such as RetinaNet) yet. Detectron2 does support RetinaNet, and I could give you some suggestions to change the backbone.
You should keep the Unbiased Teacher Trainer.
And follow the Detectron2 RetinaNet https://github.com/facebookresearch/detectron2/blob/master/configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml
and change these lines in the config file https://github.com/facebookresearch/unbiased-teacher/blob/6977c6f77c812fae4064dc1b3865658c2ed247b1/configs/coco_supervision/faster_rcnn_R_50_FPN_sup05_run1.yaml#L1-L15
you also need to change the meta_arch of RetinaNet and produce the pseudo-labels. https://github.com/facebookresearch/detectron2/blob/master/detectron2/modeling/meta_arch/retinanet.py
Tune the hyper-parameters for pseudo-labeling threshold and unsupervised loss weight, as the output of RetinaNet is sigmoid rather than softmax.
I know someone has used our Unbiased Teacher and successfully adapt to RetinaNet (and also improve against the supervised only significantly), so don't worry about whether the unbiased teacher can be used on RetinaNet.
I want to use retinanet to change the two stages in the network, how can I do it based on detectron2?
Hi, i'm also trying to implement the one-stage ubteacher. If you have any experimental progress, i‘d like to disscuss with you.
This repo does not support a one-stage Detector (such as RetinaNet) yet. Detectron2 does support RetinaNet, and I could give you some suggestions to change the backbone.
- You should keep the Unbiased Teacher Trainer.
- And follow the Detectron2 RetinaNet https://github.com/facebookresearch/detectron2/blob/master/configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml
and change these lines in the config file https://github.com/facebookresearch/unbiased-teacher/blob/6977c6f77c812fae4064dc1b3865658c2ed247b1/configs/coco_supervision/faster_rcnn_R_50_FPN_sup05_run1.yaml#L1-L15
- you also need to change the meta_arch of RetinaNet and produce the pseudo-labels. https://github.com/facebookresearch/detectron2/blob/master/detectron2/modeling/meta_arch/retinanet.py
- Tune the hyper-parameters for pseudo-labeling threshold and unsupervised loss weight, as the output of RetinaNet is sigmoid rather than softmax.
I know someone has used our Unbiased Teacher and successfully adapt to RetinaNet (and also improve against the supervised only significantly), so don't worry about whether the unbiased teacher can be used on RetinaNet.
Thank you very much for your suggestions! Now I have used mmdetection to change the unbiased teacher to one stage. But there is still a big gap between my experimental mAP and the experimental one. For example, when I tried to use 10% coco dataset as supervised data, in the burn in stage (fully supervised training), I only got 0.14 mAP, which was 9% lower than the result of the paper. After the semi-supervised learning, I only got a mAP of 0.19, which is 12% lower than the result of the paper.
Some of my hyper parameters are set as follows: imgs_per_gpu = 2 # set bacth_size=2, for me larger batch_size will lead to runtime error lr = 0.01 * (imgs_per_gpu / 32) # I have only one gpu lr_config = CosineAnnealing optimizer = SGD Unsuper_weight = 2.0 # unsupervised loss weight threshold = 0.5 # pseudo-labeling threshold
I also tried it on the VOC data set because it takes less time to train. I have observed the mAP of different learning rates in burn in stage, and the highest(35:42) is also 7% lower than the result in the paper. Is it because the result of the one-stage is lower than that of the two-stages?
@Jackson-zhao97 Hello, I am also trying to replace the model now, may I communicate with you? My email is qianli_1209@163.com, looking forward to your reply.
Hi, I have reproduced this paper with mmdetection, and replaced the two-stages with one stage. There may be some problems, and I am experimenting.
@Jackson-zhao97 Hello, I am also trying to replace the model now, may I communicate with you? My email is qianli_1209@163.com, looking forward to your reply.
Hi, I have reproduced this paper with mmdetection, and replaced the two-stages with one stage. There may be some problems, and I am experimenting.
Hi @Jackson-zhao97 and @luogen1996 would it be possible to take a look at the paper or the codebase?
Any update? Thx
Hi @darkhan-s @sisrfeng soft teacher is also a great job, you can refer to https://github.com/microsoft/SoftTeacher. It is also implemented based on mm, and you can build your own network structure by replacing the two-stage detector in it with a single-stage detector.
I want to use retinanet to change the two stages in the network, how can I do it based on detectron2?