在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):HikariTJU/LD开源软件地址(OpenSource Url):https://github.com/HikariTJU/LD开源编程语言(OpenSource Language):Python 99.9%开源软件介绍(OpenSource Introduction):Localization Distillation for Dense Object Detection简体中文English |Rotated-LD for rotated object detection is now released.This repo is based on mmDetection.Analysis of LD in ZhiHu: 目标检测-定位蒸馏 (LD, CVPR 2022) and 目标检测-定位蒸馏续集——logit蒸馏与feature蒸馏之争 This is the code for our paper:
[2022.4.13] Rotated-LD is now available. [2021.3.30] LD is officially included in MMDetection V2, many thanks to @jshilong , @Johnson-Wang and @ZwwWayne for helping migrating the code. LD is the extension of knowledge distillation on localization task, which utilizes the learned bbox distributions to transfer the localization dark knowledge from teacher to student. LD stably improves over GFocalV1 about ~2.0 AP without adding any computational cost! IntroductionKnowledge distillation (KD) has witnessed its powerful capability in learning compact models in object detection. Previous KD methods for object detection mostly focus on imitating deep features within the imitation regions instead of mimicking classification logits due to its inefficiency in distilling localization information. In this paper, by reformulating the knowledge distillation process on localization, we present a novel localization distillation (LD) method which can efficiently transfer the localization knowledge from the teacher to the student. Moreover, we also heuristically introduce the concept of valuable localization region that can aid to selectively distill the semantic and localization knowledge for a certain region. Combining these two new components, for the first time, we show that logit mimicking can outperform feature imitation and localization knowledge distillation is more important and efficient than semantic knowledge for distilling object detectors. Our distillation scheme is simple as well as effective and can be easily applied to different dense object detectors. Experiments show that our LD can boost the AP score of GFocal-ResNet-50 with a single-scale 1x training schedule from 40.1 to 42.1 on the COCO benchmark without any sacrifice on the inference speed. InstallationPlease refer to INSTALL.md for installation and dataset preparation. Pytorch=1.5.1 and cudatoolkits=10.1 are recommended. Get StartedPlease see GETTING_STARTED.md for the basic usage of MMDetection. Train# assume that you are under the root directory of this project,
# and you have activated your virtual environment if needed.
# and with COCO dataset in 'data/coco/'
./tools/dist_train.sh configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py 8 Learning rate setting
For 2 GPUs and mini-batch size 6, the relevant portion of the config file would be: optimizer = dict(type='SGD', lr=0.00375, momentum=0.9, weight_decay=0.0001)
data = dict(
samples_per_gpu=3, For 8 GPUs and mini-batch size 16, the relevant portion of the config file would be: optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)
data = dict(
samples_per_gpu=2, Feature Imitation MethodsWe provide several feature imitation methods, including FitNets bbox_head=dict(
loss_im=dict(type='IMLoss', loss_weight=2.0),
imitation_method='finegrained' # gibox, finegrain, decouple, fitnet
) Convert modelIf you find trained model very large, please refer to publish_model.py python tools/model_converters/publish_model.py your_model.pth your_new_model.pth Speed Test (FPS)CUDA_VISIBLE_DEVICES=0 python3 ./tools/benchmark.py configs/ld/ld_gflv1_r101_r50_fpn_coco_1x.py work_dirs/ld_gflv1_r101_r50_fpn_coco_1x/epoch_24.pth Evaluation./tools/dist_test.sh configs/ld/ld_gflv1_r101_r50_fpn_coco_1x.py work_dirs/ld_gflv1_r101_r50_fpn_coco_1x/epoch_24.pth 8 --eval bbox COCO
./tools/dist_test.sh configs/ld/ld_gflv1_r101_r18_fpn_voc.py work_dirs/ld_gflv1_r101_r18_fpn_voc/epoch_4.pth 8 --eval mAP PASCAL VOC
Note:
Pretrained weightsVOC 07+12GFocal V1pan.baidu pw: ufc8, teacher R101 pan.baidu pw: 5qra, teacher R101DCN pan.baidu pw: 1bd3, Main LD R101→R18, box AP = 53.0 pan.baidu pw: thuw, Main LD R101DCN→R34, box AP = 56.5 pan.baidu pw: mp8t, Main LD R101DCN→R101, box AP = 58.4 GoogleDrive Main LD + VLR LD + VLR KD R101→R18, box AP = 54.0 GoogleDrive Main LD + VLR LD + VLR KD + GI imitation R101→R18, box AP = 54.4 COCOGFocal V1pan.baidu pw: hj8d, Main LD R101→R18 1x, box AP = 36.5 pan.baidu pw: bvzz, Main LD R101→R50 1x, box AP = 41.1 GoogleDrive Main KD + Main LD + VLR LD R101→R18 1x, box AP = 37.5 GoogleDrive Main KD + Main LD + VLR LD R101→R34 1x, box AP = 41.0 GoogleDrive Main KD + Main LD + VLR LD R101→R50 1x, box AP = 42.1 GoogleDrive Main KD + Main LD + VLR LD + GI imitation R101→R50, box AP = 42.4 GFocal V2GoogleDrive Main KD + Main LD + VLR LD R101→R50 1x, box AP = 42.7 GoogleDrive | Training log Main KD + Main LD + VLR LD R101-DCN→R101 2x, box AP (test-dev) = 47.1 GoogleDrive | Training log Main KD + Main LD + VLR LD Res2Net101-DCN→X101-32x4d-DCN 2x, box AP (test-dev) = 50.5 GFocalV1, GFocalV2 and mmdetection.For any other teacher model, you can download atScore voting Cluster-DIoU-NMSWe provide Score voting Cluster-DIoU-NMS which is a speed up version of score voting NMS and combination with DIoU-NMS. For GFocalV1 and GFocalV2, Score voting Cluster-DIoU-NMS will bring 0.1-0.3 AP increase, 0.2-0.5 AP75 increase and <=0.4 AP50 decrease, while it is much faster than score voting NMS in mmdetection. The relevant portion of the config file would be:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论