Home

Awesome

<img align="center" src="https://github.com/zhangheng19931123/MutualGuide/blob/master/doc/mg.svg">

Introduction

MutualGuide is a compact object detector specially designed for edge computing devices. Comparing to existing detectors, this repo contains two key features.

Firstly, the Mutual Guidance mecanism assigns labels to the classification task based on the prediction on the localization task, and vice versa, alleviating the misalignment problem between both tasks; Secondly, the teacher-student prediction disagreements guides the knowledge transfer in a feature-based detection distillation framework, thereby reducing the performance gap between both models.

For more details, please refer to our ACCV paper and BMVC paper.

Planning

Benchmark

BackboneSizeAP<sup>val<br>0.5:0.95AP<sup>val<br>0.5AP<sup>val<br>0.75AP<sup>val<br>smallAP<sup>val<br>mediumAP<sup>val<br>largeParams<br>(M)FLOPs<br>(G)Speed<br>(ms)
cspdarknet-0.75640x64043.061.146.224.250.059.924.3224.0211.4(3060)
cspdarknet-0.5640x64040.458.443.321.046.458.017.4012.676.5(3060)
resnet18640x64040.458.543.319.946.558.922.0922.958.5(3060)
repvgg-A0640x64039.958.242.520.346.157.912.3018.407.5(3060)
shufflenet-1.5640x64035.753.937.916.541.353.52.552.655.6(3060)
shufflenet-1.0640x64031.849.033.113.635.848.41.501.475.4(3060)

Remarks:

Datasets

First download the COCO2017 dataset, you may find the sripts in data/scripts/ helpful. Then modify the parameter self.root in data/coco.py to the path of COCO dataset:

self.root = os.path.join("/home/heng/Documents/Datasets/", "COCO/")

Remarks:

Training

For training with Mutual Guide:

$ python3 train.py --neck ssd --backbone vgg16    --dataset COCO
                          fpn            resnet34           VOC
                          pafpn          repvgg-A2          XML
                                         cspdarknet-0.75
                                         shufflenet-1.0
                                         swin-T

For knowledge distillation using PDF-Distil:

$ python3 distil.py --neck ssd --backbone vgg11    --dataset COCO  --kd pdf
                           fpn            resnet18           VOC
                           pafpn          repvgg-A1          XML
                                          cspdarknet-0.5
                                          shufflenet-0.5

Remarks:

Evaluation

Every time you want to evaluate a trained network:

$ python3 test.py --neck ssd --backbone vgg11    --dataset COCO --trained_model path_to_saved_weights --vis
                         fpn            resnet18           VOC
                         pafpn          repvgg-A1          XML
                                        cspdarknet-0.5
                                        shufflenet-0.5

Remarks:

Citing us

Please cite our papers in your publications if they help your research:

@InProceedings{Zhang_2020_ACCV,
    author    = {Zhang, Heng and Fromont, Elisa and Lefevre, Sebastien and Avignon, Bruno},
    title     = {Localize to Classify and Classify to Localize: Mutual Guidance in Object Detection},
    booktitle = {Proceedings of the Asian Conference on Computer Vision (ACCV)},
    month     = {November},
    year      = {2020}
}

@InProceedings{Zhang_2021_BMVC,
    author    = {Zhang, Heng and Fromont, Elisa and Lefevre, Sebastien and Avignon, Bruno},
    title     = {PDF-Distil: including Prediction Disagreements in Feature-based Distillation for object detection},
    booktitle = {Proceedings of the British Machine Vision Conference (BMVC)},
    month     = {November},
    year      = {2021}
}

Acknowledgement

This project contains pieces of code from the following projects: ssd.pytorch, rfbnet, mmdetection and yolox.