mmrazor
mmrazor copied to clipboard
How to distill instance segmentation (maskrcnn /solo/boxinst) using the cwd algorithm in mmrazor?
###Checklist • I have searched related issues but cannot get the expected help. • I have read related documents and don't know what to do.
###Describe the question you meet I tried distilling boxinst (an instance segmentation algorithm in mmdet) using the cwd algorithm, boxinst-resnet101 to boxinst-resnet50. However, the results show that the object detection accuracy is up to the annotation, but the instance segmentation accuracy is very low, only the edges of the object are split, as visualized below:
It's worth noting that, due to lack of demo of instance segmentation, my config file references the CWD config file for object detection (mmrazor/configs/distill/mmdet/cwd/ cwd_fpn_frcnn_r101_frcnn_r50_1x_coco.py). Directly using the object detection config file for instance segmentation may be the cause of the problem, I think. Given that instance segmentation is an important computer vision task, could you provide some examples of knowledge distillation for instance segmentation, e.g. maskrcnn, yolo, boxinst? please help me! thanks a lot!
###Post related information
The config file that I used is as follows: base = [ 'mmdet::base/datasets/coco_detection.py', 'mmdet::base/schedules/schedule_1x.py', 'mmdet::base/default_runtime.py' ]
default_scope = 'mmrazor' teacher_ckpt = 'iter_90000.pth' # noqa: E501 model = dict( scope='mmrazor', type='FpnTeacherDistill', architecture=dict( cfg_path='mmdet::boxinst/boxinst_r50_fpn_ms-90k_coco_ACID.py', pretrained=False), teacher=dict( cfg_path='mmdet::boxinst/boxinst_r101_fpn_ms-90k_coco_ACID.py', pretrained=False), teacher_ckpt=teacher_ckpt, distiller=dict( type='ConfigurableDistiller', student_recorders=dict(fpn=dict(type='ModuleOutputs', source='neck')), teacher_recorders=dict(fpn=dict(type='ModuleOutputs', source='neck')), distill_losses=dict( loss_cwd_fpn0=dict( type='ChannelWiseDivergence', tau=1, loss_weight=10), loss_cwd_fpn1=dict( type='ChannelWiseDivergence', tau=1, loss_weight=10), loss_cwd_fpn2=dict( type='ChannelWiseDivergence', tau=1, loss_weight=10), loss_cwd_fpn3=dict( type='ChannelWiseDivergence', tau=1, loss_weight=10), loss_cwd_fpn4=dict( type='ChannelWiseDivergence', tau=1, loss_weight=10)), loss_forward_mappings=dict( loss_cwd_fpn0=dict( preds_S=dict(from_student=True, recorder='fpn', data_idx=0), preds_T=dict(from_student=False, recorder='fpn', data_idx=0)), loss_cwd_fpn1=dict( preds_S=dict(from_student=True, recorder='fpn', data_idx=1), preds_T=dict(from_student=False, recorder='fpn', data_idx=1)), loss_cwd_fpn2=dict( preds_S=dict(from_student=True, recorder='fpn', data_idx=2), preds_T=dict(from_student=False, recorder='fpn', data_idx=2)), loss_cwd_fpn3=dict( preds_S=dict(from_student=True, recorder='fpn', data_idx=3), preds_T=dict(from_student=False, recorder='fpn', data_idx=3)), loss_cwd_fpn4=dict( preds_S=dict(from_student=True, recorder='fpn', data_idx=4), preds_T=dict(from_student=False, recorder='fpn', data_idx=4)))))
find_unused_parameters = True
val_cfg = dict(delete=True, type='mmrazor.SingleTeacherDistillValLoop')