MMDetection 基準測試 和 Model Zoo | 三

做者|open-mmlab
編譯|Flin
來源|Githubhtml

基準測試 和 Model Zoo

環境

硬件
  • 8 個 NVIDIA Tesla V100 GPUs
  • Intel Xeon 4114 CPU @ 2.20GHz
軟件環境
  • Python 3.6 / 3.7
  • PyTorch 1.1
  • CUDA 9.0.176
  • CUDNN 7.0.4
  • NCCL 2.1.15

鏡像站點

咱們使用AWS做爲託管model zoo的主要站點,並在阿里雲上維護鏡像。
你能夠在模型網址中把https://s3.ap-northeast-2.ama...://open-mmlab.oss-cn-beijing.aliyuncs.com。git

經常使用設置

  • 全部FPN基準和RPN-C4基準均使用8個GPU進行訓練,批處理大小爲16(每一個GPU 2張圖像)。其餘C4基線使用8個批處理大小爲8的GP​​U進行了訓練(每一個GPU 1張圖像)。
  • 全部模型都在coco_2017_train上訓練以及在coco_2017_val測試。
  • 咱們使用分佈式訓練,而且BN層統計信息是固定的。
  • 咱們採用與Detectron相同的訓練時間表。1x表示12個epoch,而2x表示24個epoch,這比Detectron的迭代次數略少,而且能夠忽略不計。
  • ImageNet上全部pytorch樣式的預訓練主幹都來自PyTorchmodel zoo。
  • 爲了與其餘代碼庫進行公平比較,咱們將GPU內存報告 torch.cuda.max_memory_allocated()爲全部8個GPU 的最大值。請注意,此值一般小於nvidia-smi顯示的值。
  • 咱們將推理時間報告爲整體時間,包括數據加載,網絡轉發和後處理。

基線

具備不一樣主幹的更多模型將添加到model zoo。github

RPN
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) AR1000 Download
R-50-C4 caffe 1x - - 20.5 51.1 model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe 2x 2.2 0.17 20.3 52.2 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 1x - - 20.1 50.2 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 2x - - 20.0 51.1 model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe 1x 3.3 0.253 16.9 58.2 -
R-50-FPN pytorch 1x 3.5 0.276 17.7 57.1 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 2x - - - 57.6 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe 1x 5.2 0.379 13.9 59.4 -
R-101-FPN pytorch 1x 5.4 0.396 14.4 58.6 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 2x - - - 59.1 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 6.6 0.589 11.8 59.4 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 2x - - - 59.9 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 9.5 0.955 8.3 59.8 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 2x - - - 60.0 model(https://s3.ap-northeast-2.ama...
Faster R-CNN
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP Download
R-50-C4 caffe 1x - - 9.5 34.9 model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe 2x 4.0 0.39 9.3 36.5 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 1x - - 9.3 33.9 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 2x - - 9.4 35.9 model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe 1x 3.6 0.333 13.5 36.6 -
R-50-FPN pytorch 1x 3.8 0.353 13.6 36.4 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 2x - - - 37.7 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe 1x 5.5 0.465 11.5 38.8 -
R-101-FPN pytorch 1x 5.7 0.474 11.9 38.5 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 2x - - - 39.4 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 6.9 0.672 10.3 40.1 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 2x - - - 40.4 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 9.8 1.040 7.3 41.3 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 2x - - - 40.7 model(https://s3.ap-northeast-2.ama...
HRNetV2p-W18 pytorch 1x - - - 36.1 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W18 pytorch 2x - - - 38.3 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 1x - - - 39.5 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 2x - - - 40.6 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 1x - - - 40.9 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 2x - - - 41.5 model(https://open-mmlab.s3.ap-nort...
Mask R-CNN
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP mask AP Download
R-50-C4 caffe 1x - - 8.1 35.9 31.5 model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe 2x 4.2 0.43 8.1 37.9 32.9 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 1x - - 7.9 35.1 31.2 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch 2x - - 8.0 37.2 32.5 model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe 1x 3.8 0.430 10.2 37.4 34.3 -
R-50-FPN pytorch 1x 3.9 0.453 10.6 37.3 34.2 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 2x - - - 38.5 35.1 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe 1x 5.7 0.534 9.4 39.9 36.1 -
R-101-FPN pytorch 1x 5.8 0.571 9.5 39.4 35.9 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 2x - - - 40.3 36.5 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 7.1 0.759 8.3 41.1 37.1 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 2x - - - 41.4 37.1 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 10.0 1.102 6.5 42.1 38.0 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 2x - - - 42.0 37.7 model(https://s3.ap-northeast-2.ama...
HRNetV2p-W18 pytorch 1x - - - 37.3 34.2 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W18 pytorch 2x - - - 39.2 35.7 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 1x - - - 40.7 36.8 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 2x - - - 41.7 37.5 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 1x - - - 42.4 38.1 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 2x - - - 42.9 38.3 model(https://open-mmlab.s3.ap-nort...
Fast R-CNN (有預先計算的proposals)
Backbone Style 類型 Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP mask AP Download
R-50-C4 caffe Faster 1x - - 6.7 35.0 - model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe Faster 2x 3.8 0.34 6.6 36.4 - model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch Faster 1x - - 6.3 34.2 - model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch Faster 2x - - 6.1 35.8 - model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe Faster 1x 3.3 0.242 18.4 36.6 - -
R-50-FPN pytorch Faster 1x 3.5 0.250 16.5 35.8 - model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe Mask 1x - - 8.1 35.9 31.5 model(https://s3.ap-northeast-2.ama...
R-50-C4 caffe Mask 2x 4.2 0.43 8.1 37.9 32.9 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch Mask 1x - - 7.9 35.1 31.2 model(https://s3.ap-northeast-2.ama...
R-50-C4 pytorch Mask 2x - - 8.0 37.2 32.5 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch Faster 2x - - - 37.1 - model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe Faster 1x 5.2 0.355 14.4 38.6 - -
R-101-FPN pytorch Faster 1x 5.4 0.388 13.2 38.1 - model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch Faster 2x - - - 38.8 - model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe Mask 1x 3.4 0.328 12.8 37.3 34.5 -
R-50-FPN pytorch Mask 1x 3.5 0.346 12.7 36.8 34.1 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch Mask 2x - - - 37.9 34.8 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe Mask 1x 5.2 0.429 11.2 39.4 36.1 -
R-101-FPN pytorch Mask 1x 5.4 0.462 10.9 38.9 35.8 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch Mask 2x - - - 39.9 36.4 model(https://s3.ap-northeast-2.ama...
RetinaNet
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP Download
R-50-FPN caffe 1x 3.4 0.285 12.5 35.8 -
R-50-FPN pytorch 1x 3.6 0.308 12.1 35.6 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 2x - - - 36.4 model(https://open-mmlab.s3.ap-nort...
R-101-FPN caffe 1x 5.3 0.410 10.4 37.8 -
R-101-FPN pytorch 1x 5.5 0.429 10.9 37.7 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 2x - - - 38.1 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 6.7 0.632 9.3 39.0 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 2x - - - 39.3 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 9.6 0.993 7.0 40.0 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 2x - - - 39.6 model(https://s3.ap-northeast-2.ama...
Cascade R-CNN
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP Download
R-50-C4 caffe 1x 8.7 0.92 5.0 38.7 model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe 1x 3.9 0.464 10.9 40.5 -
R-50-FPN pytorch 1x 4.1 0.455 11.9 40.4 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 20e - - - 41.1 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe 1x 5.8 0.569 9.6 42.4 -
R-101-FPN pytorch 1x 6.0 0.584 10.3 42.0 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 20e - - - 42.5 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 7.2 0.770 8.9 43.6 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 20e - - - 44.0 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 10.0 1.133 6.7 44.5 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 20e - - - 44.7 model(https://s3.ap-northeast-2.ama...
HRNetV2p-W18 pytorch 20e - - - 41.2 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 20e - - - 43.7 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 20e - - - 44.6 model(https://open-mmlab.s3.ap-nort...
Cascade Mask R-CNN
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP mask AP Download
R-50-C4 caffe 1x 9.1 0.99 4.5 39.3 32.8 model(https://s3.ap-northeast-2.ama...
R-50-FPN caffe 1x 5.1 0.692 7.6 40.9 35.5 -
R-50-FPN pytorch 1x 5.3 0.683 7.4 41.2 35.7 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 20e - - - 42.3 36.6 model(https://s3.ap-northeast-2.ama...
R-101-FPN caffe 1x 7.0 0.803 7.2 43.1 37.2 -
R-101-FPN pytorch 1x 7.2 0.807 6.8 42.6 37.0 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 20e - - - 43.3 37.6 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 1x 8.4 0.976 6.6 44.4 38.2 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 20e - - - 44.7 38.6 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 1x 11.4 1.33 5.3 45.4 39.1 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 20e - - - 45.7 39.4 model(https://s3.ap-northeast-2.ama...
HRNetV2p-W18 pytorch 20e - - - 41.9 36.4 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 20e - - - 44.5 38.5 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 20e - - - 46.0 39.5 model(https://open-mmlab.s3.ap-nort...

注意s:服務器

  • 20e級聯(掩碼)R-CNN中的時間表指示在第16和19個epoch減小lr,總共減小20個epoch。
混合任務級聯(HTC)
Backbone Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP mask AP Download
R-50-FPN pytorch 1x 7.4 0.936 4.1 42.1 37.3 model(https://s3.ap-northeast-2.ama...
R-50-FPN pytorch 20e - - - 43.2 38.1 model(https://s3.ap-northeast-2.ama...
R-101-FPN pytorch 20e 9.3 1.051 4.0 44.9 39.4 model(https://s3.ap-northeast-2.ama...
X-101-32x4d-FPN pytorch 20e 5.8 0.769 3.8 46.1 40.3 model(https://s3.ap-northeast-2.ama...
X-101-64x4d-FPN pytorch 20e 7.5 1.120 3.5 46.9 40.8 model(https://s3.ap-northeast-2.ama...
HRNetV2p-W18 pytorch 20e - - - 43.1 37.9 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W32 pytorch 20e - - - 45.3 39.6 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 20e - - - 46.8 40.7 model(https://open-mmlab.s3.ap-nort...
HRNetV2p-W48 pytorch 28e - - - 47.0 41.0 model(https://open-mmlab.s3.ap-nort...

注意:網絡

SSD
Backbone Size Style Lr schd 內存 (GB) 訓練時間 (s/iter) 最短期 (fps) box AP Download
VGG16 300 caffe 120e 3.5 0.256 25.9 / 34.6 25.7 model(https://s3.ap-northeast-2.ama...
VGG16 512 caffe 120e 7.6 0.412 20.7 / 25.4 29.3 model(https://s3.ap-northeast-2.ama...

注意:機器學習

  • cudnn.benchmark設置爲True用於SSD訓練和測試。
  • 對於batch size= 1和batch size= 8,報告推理時間。
  • 因爲模型參數和nms,COCO和VOC的速度有所不一樣。
組規範化(GN)

有關詳細信息,請參考組規範化(https://github.com/open-mmlab...分佈式

權重標準化

有關詳細信息,請參考權重標準化(https://github.com/open-mmlab...ide

可變形卷積v2

有關詳細信息,請參閱可變形卷積網絡(https://github.com/open-mmlab...性能

CARAFE:功能的內容感知重組

有關詳細信息,請參考CARAFE(https://github.com/open-mmlab...學習

Instaboost

有關詳細信息,請參考Instaboost(https://github.com/open-mmlab...

Libra R-CNN

有關詳細信息,請參考Libra R-CNN(https://github.com/open-mmlab...

Guided Anchoring

有關詳細信息,請參閱Guided Anchoring(https://github.com/open-mmlab...

FCOS

有關詳細信息,請參閱FCOS(https://github.com/open-mmlab...

FoveaBox

有關詳細信息,請參考FoveaBox(https://github.com/open-mmlab...

RepPoints

有關詳細信息,請參考RepPoints(https://github.com/open-mmlab...

FreeAnchor

有關詳細信息,請參考FreeAnchor(https://github.com/open-mmlab...

Grid R-CNN (plus)

有關詳細信息,請參考Grid R-CNN(https://github.com/open-mmlab...

GHM

有關詳細信息,請參閱GHM(https://github.com/open-mmlab...

GCNet

有關詳細信息,請參考GCNet(https://github.com/open-mmlab...

HRNet

有關詳細信息,請參考HRNet(https://github.com/open-mmlab...

Mask Scoring R-CNN

有關詳細信息,請參考Mask Scoring R-CNN(https://github.com/open-mmlab...

Train from Scratch

有關詳細信息,請參考 從新思考ImageNet預訓練(https://github.com/open-mmlab...

NAS-FPN

有關詳細信息,請參閱NAS-FPN(https://github.com/open-mmlab...

ATSS

有關詳細信息,請參考ATSS(https://github.com/open-mmlab...

其餘數據集

咱們還對PASCAL VOC(https://github.com/open-mmlab...://github.com/open-mmlab/ mmdetection / blob / master / configs / cityscapes)和WIDER FACE(https://github.com/open-mmlab...

與 Detectron 和 maskrcnn-benchmark 的比較

咱們將mmdetection與Detectron(https://github.com/facebookre... 和maskrcnn-benchmark(https://github.com/facebookre...。使用的主幹是R-50-FPN。

一般來講,mmdetection與Detectron相比具備3個優點。

  • 更高的性能(尤爲是在mask AP方面)
  • 更快的訓練速度
  • 高效記憶
性能

Detectron和maskrcnn-benchmark使用Caffe風格的ResNet做爲主幹。咱們使用caffe樣式(權重從(https://github.com/facebookre... 和pytorch樣式(權重來自官方model zoo)ResNet主幹報告結果,表示爲pytorch樣式結果 / caffe樣式結果。

咱們發現,pytorch風格的ResNet一般比caffe風格的ResNet收斂慢,所以在1倍進度中致使結果略低,但2倍進度的最終結果則較高。

類型 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 / -
訓練速度

訓練速度以s/iter爲單位。越低越好。

類型 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的Big Basin服務器(P100 / V100)比咱們使用的服務器稍快。mmdetection在FB的服務器上也能夠稍快一些地運行。
  • 2。爲了公平比較,咱們在此處列出了caffe的結果。
推理速度

推理速度在單個GPU上以fps(img / s)進行測量。越高越好。

類型 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
訓練內存
類型 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

毫無疑問,maskrcnn基準測試和mmdetection比Detectron的存儲效率更高,而主要優勢是PyTorch自己。咱們還執行一些內存優化來推進它向前發展。

請注意,Caffe2和PyTorch具備不一樣的API,以經過不一樣的實現獲取內存使用狀況。對於全部代碼庫,nvidia-smi顯示的內存使用量均大於上表中報告的數字。

原文連接:https://mmdetection.readthedo...

歡迎關注磐創AI博客站:
http://panchuang.net/

sklearn機器學習中文官方文檔:
http://sklearn123.com/

歡迎關注磐創博客資源彙總站:
http://docs.panchuang.net/

相關文章
相關標籤/搜索