Home

Awesome

CBNet: A Composite Backbone Network Architecture for Object Detection

PWC PWC PWC PWC

By Tingting Liang*, Xiaojie Chu*, Yudong Liu*, Yongtao Wang, Zhi Tang, Wei Chu, Jingdong Chen, Haibin Ling.

This repo is the official implementation of CBNetV2. It is based on mmdetection and Swin Transformer for Object Detection.

Contact us with tingtingliang@pku.edu.cn, chuxiaojie@stu.pku.edu.cn, wyt@pku.edu.cn.

Update

Introduction

CBNetV2 achieves strong single-model performance on COCO object detection (60.1 box AP and 52.3 mask AP on test-dev) without extra training data.

teaser

Partial Results and Models

More results and models can be found in model zoo

Faster R-CNN

BackboneLr Schdbox mAP (minival)#paramsFLOPsconfiglogmodel
DB-ResNet501x40.869M284Gconfiggithubgithub

Mask R-CNN

BackboneLr Schdbox mAP (minival)mask mAP (minival)#paramsFLOPsconfiglogmodel
DB-Swin-T3x50.244.576M357Gconfiggithubgithub

Cascade Mask R-CNN (1600x1400)

BackboneLr Schdbox mAP (minival/test-dev)mask mAP (minival/test-dev)#paramsFLOPsconfigmodel
DB-Swin-S3x56.3/56.948.6/49.1156M1016Gconfiggithub

Improved HTC (1600x1400)

We use ImageNet-22k pretrained checkpoints of Swin-B and Swin-L. Compared to regular HTC, our HTC uses 4conv1fc in bbox head.

BackboneLr Schdbox mAP (minival/test-dev)mask mAP (minival/test-dev)#paramsFLOPsconfigmodel
DB-Swin-B20e58.4/58.750.7/51.1235M1348Gconfiggithub
DB-Swin-L1x59.1/59.451.0/51.6453M2162Gconfig (test only)github
DB-Swin-L (TTA)1x59.6/60.151.8/52.3453M-config (test only)github

TTA denotes test time augmentation.

EVA02 (1536x1536)

BackboneLr Schdmask mAP (test-dev)#paramsconfigmodel
DB-EVA02-L1x56.1674MconfigHF

Notes:

Usage

Installation

Please refer to get_started.md for installation and dataset preparation.

Inference

# single-gpu testing (w/o segm result)
python tools/test.py <CONFIG_FILE> <DET_CHECKPOINT_FILE> --eval bbox 

# multi-gpu testing (w/ segm result)
tools/dist_test.sh <CONFIG_FILE> <DET_CHECKPOINT_FILE> <GPU_NUM> --eval bbox segm

Training

To train a detector with pre-trained models, run:

# multi-gpu training
tools/dist_train.sh <CONFIG_FILE> <GPU_NUM> 

For example, to train a Faster R-CNN model with a Duel-ResNet50 backbone and 8 gpus, run:

# path of pre-training model (resnet50) is already in config
tools/dist_train.sh configs/cbnet/faster_rcnn_cbv2d1_r50_fpn_1x_coco.py 8 

Another example, to train a Mask R-CNN model with a Duel-Swin-T backbone and 8 gpus, run:

tools/dist_train.sh configs/cbnet/mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py 8 --cfg-options model.pretrained=<PRETRAIN_MODEL> 

Apex (optional):

Following Swin Transformer for Object Detection, we use apex for mixed precision training by default. To install apex, run:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Documents and Tutorials

We list some documents and tutorials from MMDetection, which may be helpful to you.

Citation

If you use our code/model, please consider to cite our paper CBNet: A Composite Backbone Network Architecture for Object Detection.

@ARTICLE{9932281,
  author={Liang, Tingting and Chu, Xiaojie and Liu, Yudong and Wang, Yongtao and Tang, Zhi and Chu, Wei and Chen, Jingdong and Ling, Haibin},
  journal={IEEE Transactions on Image Processing}, 
  title={CBNet: A Composite Backbone Network Architecture for Object Detection}, 
  year={2022},
  volume={31},
  pages={6893-6906},
  doi={10.1109/TIP.2022.3216771}}

License

The project is only free for academic research purposes, but needs authorization for commerce. For commerce permission, please contact wyt@pku.edu.cn.

Other Links

Original CBNet: See CBNet: A Novel Composite Backbone Network Architecture for Object Detection.