Benchmark and Model Zoo

March 11, 2020 ยท View on GitHub

Environment

Hardware

  • 8 NVIDIA Tesla V100 GPUs
  • Intel Xeon 4114 CPU @ 2.20GHz

Software environment

  • Python 3.6 / 3.7
  • PyTorch 1.1
  • CUDA 9.0.176
  • CUDNN 7.0.4
  • NCCL 2.1.15

Mirror sites

We use AWS as the main site to host our model zoo, and maintain a mirror on aliyun. You can replace https://s3.ap-northeast-2.amazonaws.com/open-mmlab with https://open-mmlab.oss-cn-beijing.aliyuncs.com in model urls.

Common settings

  • All FPN baselines and RPN-C4 baselines were trained using 8 GPU with a batch size of 16 (2 images per GPU). Other C4 baselines were trained using 8 GPU with a batch size of 8 (1 image per GPU).
  • All models were trained on coco_2017_train, and tested on the coco_2017_val.
  • We use distributed training and BN layer stats are fixed.
  • We adopt the same training schedules as Detectron. 1x indicates 12 epochs and 2x indicates 24 epochs, which corresponds to slightly less iterations than Detectron and the difference can be ignored.
  • All pytorch-style pretrained backbones on ImageNet are from PyTorch model zoo.
  • For fair comparison with other codebases, we report the GPU memory as the maximum value of torch.cuda.max_memory_allocated() for all 8 GPUs. Note that this value is usually less than what nvidia-smi shows.
  • We report the inference time as the overall time including data loading, network forwarding and post processing.

Baselines

More models with different backbones will be added to the model zoo.

RPN

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)AR1000Download
R-50-C4caffe1x--20.551.1model
R-50-C4caffe2x2.20.1720.352.2model
R-50-C4pytorch1x--20.150.2model
R-50-C4pytorch2x--20.051.1model
R-50-FPNcaffe1x3.30.25316.958.2-
R-50-FPNpytorch1x3.50.27617.757.1model
R-50-FPNpytorch2x---57.6model
R-101-FPNcaffe1x5.20.37913.959.4-
R-101-FPNpytorch1x5.40.39614.458.6model
R-101-FPNpytorch2x---59.1model
X-101-32x4d-FPNpytorch1x6.60.58911.859.4model
X-101-32x4d-FPNpytorch2x---59.9model
X-101-64x4d-FPNpytorch1x9.50.9558.359.8model
X-101-64x4d-FPNpytorch2x---60.0model

Faster R-CNN

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APDownload
R-50-C4caffe1x--9.534.9model
R-50-C4caffe2x4.00.399.336.5model
R-50-C4pytorch1x--9.333.9model
R-50-C4pytorch2x--9.435.9model
R-50-FPNcaffe1x3.60.33313.536.6-
R-50-FPNpytorch1x3.80.35313.636.4model
R-50-FPNpytorch2x---37.7model
R-101-FPNcaffe1x5.50.46511.538.8-
R-101-FPNpytorch1x5.70.47411.938.5model
R-101-FPNpytorch2x---39.4model
X-101-32x4d-FPNpytorch1x6.90.67210.340.1model
X-101-32x4d-FPNpytorch2x---40.4model
X-101-64x4d-FPNpytorch1x9.81.0407.341.3model
X-101-64x4d-FPNpytorch2x---40.7model
HRNetV2p-W18pytorch1x---36.1model
HRNetV2p-W18pytorch2x---38.3model
HRNetV2p-W32pytorch1x---39.5model
HRNetV2p-W32pytorch2x---40.6model
HRNetV2p-W48pytorch1x---40.9model
HRNetV2p-W48pytorch2x---41.5model
Res2Net-101pytorch2x---42.3model

Mask R-CNN

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APmask APDownload
R-50-C4caffe1x--8.135.931.5model
R-50-C4caffe2x4.20.438.137.932.9model
R-50-C4pytorch1x--7.935.131.2model
R-50-C4pytorch2x--8.037.232.5model
R-50-FPNcaffe1x3.80.43010.237.434.3-
R-50-FPNpytorch1x3.90.45310.637.334.2model
R-50-FPNpytorch2x---38.535.1model
R-101-FPNcaffe1x5.70.5349.439.936.1-
R-101-FPNpytorch1x5.80.5719.539.435.9model
R-101-FPNpytorch2x---40.336.5model
X-101-32x4d-FPNpytorch1x7.10.7598.341.137.1model
X-101-32x4d-FPNpytorch2x---41.437.1model
X-101-64x4d-FPNpytorch1x10.01.1026.542.138.0model
X-101-64x4d-FPNpytorch2x---42.037.7model
HRNetV2p-W18pytorch1x---37.334.2model
HRNetV2p-W18pytorch2x---39.235.7model
HRNetV2p-W32pytorch1x---40.736.8model
HRNetV2p-W32pytorch2x---41.737.5model
HRNetV2p-W48pytorch1x---42.438.1model
HRNetV2p-W48pytorch2x---42.938.3model
Res2Net-101pytorch2x---43.338.6model

Fast R-CNN (with pre-computed proposals)

BackboneStyleTypeLr schdMem (GB)Train time (s/iter)Inf time (fps)box APmask APDownload
R-50-C4caffeFaster1x--6.735.0-model
R-50-C4caffeFaster2x3.80.346.636.4-model
R-50-C4pytorchFaster1x--6.334.2-model
R-50-C4pytorchFaster2x--6.135.8-model
R-50-FPNcaffeFaster1x3.30.24218.436.6--
R-50-FPNpytorchFaster1x3.50.25016.535.8-model
R-50-C4caffeMask1x--8.135.931.5model
R-50-C4caffeMask2x4.20.438.137.932.9model
R-50-C4pytorchMask1x--7.935.131.2model
R-50-C4pytorchMask2x--8.037.232.5model
R-50-FPNpytorchFaster2x---37.1-model
R-101-FPNcaffeFaster1x5.20.35514.438.6--
R-101-FPNpytorchFaster1x5.40.38813.238.1-model
R-101-FPNpytorchFaster2x---38.8-model
R-50-FPNcaffeMask1x3.40.32812.837.334.5-
R-50-FPNpytorchMask1x3.50.34612.736.834.1model
R-50-FPNpytorchMask2x---37.934.8model
R-101-FPNcaffeMask1x5.20.42911.239.436.1-
R-101-FPNpytorchMask1x5.40.46210.938.935.8model
R-101-FPNpytorchMask2x---39.936.4model

RetinaNet

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APDownload
R-50-FPNcaffe1x3.40.28512.535.8-
R-50-FPNpytorch1x3.60.30812.135.6model
R-50-FPNpytorch2x---36.4model
R-101-FPNcaffe1x5.30.41010.437.8-
R-101-FPNpytorch1x5.50.42910.937.7model
R-101-FPNpytorch2x---38.1model
X-101-32x4d-FPNpytorch1x6.70.6329.339.0model
X-101-32x4d-FPNpytorch2x---39.3model
X-101-64x4d-FPNpytorch1x9.60.9937.040.0model
X-101-64x4d-FPNpytorch2x---39.6model

Cascade R-CNN

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APDownload
R-50-C4caffe1x8.70.925.038.7model
R-50-FPNcaffe1x3.90.46410.940.5-
R-50-FPNpytorch1x4.10.45511.940.4model
R-50-FPNpytorch20e---41.1model
R-101-FPNcaffe1x5.80.5699.642.4-
R-101-FPNpytorch1x6.00.58410.342.0model
R-101-FPNpytorch20e---42.5model
X-101-32x4d-FPNpytorch1x7.20.7708.943.6model
X-101-32x4d-FPNpytorch20e---44.0model
X-101-64x4d-FPNpytorch1x10.01.1336.744.5model
X-101-64x4d-FPNpytorch20e---44.7model
HRNetV2p-W18pytorch20e---41.2model
HRNetV2p-W32pytorch20e---43.7model
HRNetV2p-W48pytorch20e---44.6model
Res2Net-101pytorch20e---45.5model

Cascade Mask R-CNN

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APmask APDownload
R-50-C4caffe1x9.10.994.539.332.8model
R-50-FPNcaffe1x5.10.6927.640.935.5-
R-50-FPNpytorch1x5.30.6837.441.235.7model
R-50-FPNpytorch20e---42.336.6model
R-101-FPNcaffe1x7.00.8037.243.137.2-
R-101-FPNpytorch1x7.20.8076.842.637.0model
R-101-FPNpytorch20e---43.337.6model
X-101-32x4d-FPNpytorch1x8.40.9766.644.438.2model
X-101-32x4d-FPNpytorch20e---44.738.6model
X-101-64x4d-FPNpytorch1x11.41.335.345.439.1model
X-101-64x4d-FPNpytorch20e---45.739.4model
HRNetV2p-W18pytorch20e---41.936.4model
HRNetV2p-W32pytorch20e---44.538.5model
HRNetV2p-W48pytorch20e---46.039.5model
Res2Net-101pytorch20e---46.139.4model

Notes:

  • The 20e schedule in Cascade (Mask) R-CNN indicates decreasing the lr at 16 and 19 epochs, with a total of 20 epochs.

Hybrid Task Cascade (HTC)

BackboneStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APmask APDownload
R-50-FPNpytorch1x7.40.9364.142.137.3model
R-50-FPNpytorch20e---43.238.1model
R-101-FPNpytorch20e9.31.0514.044.939.4model
X-101-32x4d-FPNpytorch20e5.80.7693.846.140.3model
X-101-64x4d-FPNpytorch20e7.51.1203.546.940.8model
HRNetV2p-W18pytorch20e---43.137.9model
HRNetV2p-W32pytorch20e---45.339.6model
HRNetV2p-W48pytorch20e---46.840.7model
HRNetV2p-W48pytorch28e---47.041.0model
Res2Net-101pytorch20e---47.541.3model

Notes:

SSD

BackboneSizeStyleLr schdMem (GB)Train time (s/iter)Inf time (fps)box APDownload
VGG16300caffe120e3.50.25625.9 / 34.625.7model
VGG16512caffe120e7.60.41220.7 / 25.429.3model

Notes:

  • cudnn.benchmark is set as True for SSD training and testing.
  • Inference time is reported for batch size = 1 and batch size = 8.
  • The speed on COCO and VOC are different due to model parameters and nms.

Group Normalization (GN)

Please refer to Group Normalization for details.

Weight Standardization

Please refer to Weight Standardization for details.

Deformable Convolution v2

Please refer to Deformable Convolutional Networks for details.

CARAFE: Content-Aware ReAssembly of FEatures

Please refer to CARAFE for details.

Instaboost

Please refer to Instaboost for details.

Libra R-CNN

Please refer to Libra R-CNN for details.

Guided Anchoring

Please refer to Guided Anchoring for details.

FCOS

Please refer to FCOS for details.

FoveaBox

Please refer to FoveaBox for details.

RepPoints

Please refer to RepPoints for details.

FreeAnchor

Please refer to FreeAnchor for details.

Grid R-CNN (plus)

Please refer to Grid R-CNN for details.

GHM

Please refer to GHM for details.

GCNet

Please refer to GCNet for details.

HRNet

Please refer to HRNet for details.

Res2Net

Please refer to Res2Net for details.

Mask Scoring R-CNN

Please refer to Mask Scoring R-CNN for details.

Train from Scratch

Please refer to Rethinking ImageNet Pre-training for details.

NAS-FPN

Please refer to NAS-FPN for details.

ATSS

Please refer to ATSS for details.

Other datasets

We also benchmark some methods on PASCAL VOC, Cityscapes and WIDER FACE.

Comparison with Detectron and maskrcnn-benchmark

We compare mmdetection with Detectron and maskrcnn-benchmark. The backbone used is R-50-FPN.

In general, mmdetection has 3 advantages over Detectron.

  • Higher performance (especially in terms of mask AP)
  • Faster training speed
  • Memory efficient

Performance

Detectron and maskrcnn-benchmark use caffe-style ResNet as the backbone. We report results using both caffe-style (weights converted from here) and pytorch-style (weights from the official model zoo) ResNet backbone, indicated as pytorch-style results / caffe-style results.

We find that pytorch-style ResNet usually converges slower than caffe-style ResNet, thus leading to slightly lower results in 1x schedule, but the final results of 2x schedule is higher.

Type Lr schd Detectron maskrcnn-benchmark mmdetection
RPN 1x 57.2 - 57.1 / 58.2
2x - - 57.6 / -
Faster R-CNN 1x 36.7 36.8 36.4 / 36.6
2x 37.9 - 37.7 / -
Mask R-CNN 1x 37.7 & 33.9 37.8 & 34.2 37.3 & 34.2 / 37.4 & 34.3
2x 38.6 & 34.5 - 38.5 & 35.1 / -
Fast R-CNN 1x 36.4 - 35.8 / 36.6
2x 36.8 - 37.1 / -
Fast R-CNN (w/mask) 1x 37.3 & 33.7 - 36.8 & 34.1 / 37.3 & 34.5
2x 37.7 & 34.0 - 37.9 & 34.8 / -

Training Speed

The training speed is measure with s/iter. The lower, the better.

Type Detectron (P1001) maskrcnn-benchmark (V100) mmdetection (V1002)
RPN 0.416 - 0.253
Faster R-CNN 0.544 0.353 0.333
Mask R-CNN 0.889 0.454 0.430
Fast R-CNN 0.285 - 0.242
Fast R-CNN (w/mask) 0.377 - 0.328

*1. Facebook's Big Basin servers (P100/V100) is slightly faster than the servers we use. mmdetection can also run slightly faster on FB's servers.

*2. For fair comparison, we list the caffe-style results here.

Inference Speed

The inference speed is measured with fps (img/s) on a single GPU. The higher, the better.

Type Detectron (P100) maskrcnn-benchmark (V100) mmdetection (V100)
RPN 12.5 - 16.9
Faster R-CNN 10.3 7.9 13.5
Mask R-CNN 8.5 7.7 10.2
Fast R-CNN 12.5 - 18.4
Fast R-CNN (w/mask) 9.9 - 12.8

Training memory

Type Detectron maskrcnn-benchmark mmdetection
RPN 6.4 - 3.3
Faster R-CNN 7.2 4.4 3.6
Mask R-CNN 8.6 5.2 3.8
Fast R-CNN 6.0 - 3.3
Fast R-CNN (w/mask) 7.9 - 3.4

There is no doubt that maskrcnn-benchmark and mmdetection is more memory efficient than Detectron, and the main advantage is PyTorch itself. We also perform some memory optimizations to push it forward.

Note that Caffe2 and PyTorch have different apis to obtain memory usage with different implementations. For all codebases, nvidia-smi shows a larger memory usage than the reported number in the above table.