Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

MMDetection: Open MMLab Detection Toolbox and Benchmark

MMDetection gathers detection methods and benchmarks them under one training setup

  • Problem Detection results shift with small implementation settings, and existing codebases differ in coverage, speed and memory, so fair comparison is hard. Detectors are also hard to recombine into new ones.
  • Method MMDetection is a PyTorch toolbox that splits each detector into backbone, neck, dense head and RoI head. Training runs through hooks attached at fixed timepoints, and the authors benchmark detectors on COCO 2017.
  • Results Mixed precision cut Mask R-CNN training memory on MMDetection from 3.8 GB to 3.0 GB, with box AP at 37.4 in both precisions.

Why one toolbox

Detection pipelines have more moving parts than classification, and small differences in implementation settings can change results a lot. MMDetection is built on PyTorch with the aim of a high-quality codebase and one benchmark for comparing methods. It started as the codebase of the MMDet team, which won the detection track of the COCO Challenge 2018, and it now bundles training and inference code with weights for more than 200 network models.

The design rests on three goals: modularity, support for several detection frameworks out of the box, and efficiency. Modularity means a detector is split into components that can be recombined into a new detector. Efficiency rests on running the basic bounding-box and mask operations on GPUs, with training speed described as faster than or comparable to Detectron, maskrcnn-benchmark and SimpleDet.

Supported detectors and modules

Single-stage detectors include SSD, RetinaNet, GHM, FCOS and FSAF, and two-stage detectors include Fast R-CNN, Faster R-CNN, R-FCN, Mask R-CNN, Grid R-CNN, Mask Scoring R-CNN and Double-Head R-CNN. Cascade R-CNN and Hybrid Task Cascade form the multi-stage group.

Beyond whole detectors, the list includes general modules such as mixed precision training, Soft NMS, OHEM, deformable convolution, GCNet and Generalized Attention. Normalization variants such as SyncBN, Group Normalization and Weight Standardization, along with HRNet and Libra R-CNN, are also on the list.

Table 1 compares supported features against maskrcnn-benchmark, Detectron and SimpleDet, using a check for official support, an asterisk for support in a forked repository, and blank cells for no support.

Component decomposition

Every detector is decomposed into a backbone, a neck, a dense head, a RoI extractor and a RoI head. The backbone turns an image into feature maps, and the neck refines those maps, with the Feature Pyramid Network as the example given. The dense head works on every location of the feature maps, covering anchor-based heads such as RPNHead and RetinaHead and anchor-free heads such as FCOSHead.

The RoI extractor pulls region-wise features from one or several feature maps, and the RoI head turns them into task-specific outputs such as box classification and regression or mask prediction. Figure 1 describes the single-stage detector as a backbone, a neck and a dense head, and the two-stage detector as the same parts with an RPN-type dense head and an RoI head added.

Because each part is separate, a new method is built by writing new components or by combining existing ones.

Hook-based training loop

Training runs over epochs, each made of many iterations, and validation epochs are optional. The minimal loop only forwards the model repeatedly, and every other behaviour is attached through a hooking mechanism.

Users can register hooks at ten timepoints: before run, before and after each training epoch, before and after each training iteration, before and after each validation epoch, before and after each validation iteration, and after run. Registered hooks fire at these timepoints in order of their priority level.

Figure 2 shows a typical pipeline with hooks such as DistSamplerHook, LrUpdaterHook, OptimizerHook, CheckpointHook, IterTimerHook, LoggerHook and EvalmAPHook placed at these timepoints. Validation is handled by evaluation hooks that test performance after each epoch, so the validation epoch is not drawn in that figure.

Benchmark conditions

Experiments use MS COCO 2017 as the main benchmark, trained on the train split and reported on the val split, and the toolbox supports both VOC-style and COCO-style datasets.

Training uses 8 V100 GPUs with a total batch size of 16, which is 2 images per GPU, and inference uses one V100 GPU. Schedules follow Detectron, where 1x and 2x mean 12 and 24 epochs, and 20e, used for cascade models, means 20 epochs.

Scores follow the COCO metrics with IoU thresholds from 0.5 to 0.95, with RPN quality measured by Average Recall (AR) and detection quality by mAP.

Accuracy across detectors and backbones

Methods benchmarked on COCO 2017 val are SSD, RetinaNet, Faster R-CNN, Mask R-CNN, Cascade R-CNN, Hybrid Task Cascade and FCOS, each evaluated with ResNet-50, ResNet-101, ResNet-101-32x4d and ResNeXt-101-64x4d backbones. Inference speed is measured on a single Tesla V100 GPU and reported together with box and mask AP.

Mask R-CNN with an R-50 backbone under the 1x schedule reaches 37.3 box AP and 34.2 mask AP. The same model with an X-101-64x4d backbone under the 1x schedule reaches 42.1 box AP and 38.0 mask AP. Hybrid Task Cascade with X-101-64x4d under the 20e schedule reaches 46.9 box AP.

Codebase comparison in one environment

Mask R-CNN and RetinaNet stand for the two-stage and single-stage groups, and the latest code of each codebase was run in the same environment. For Mask R-CNN, MMDetection reaches 37.4 box AP and 34.3 mask AP at 3.8 GB training memory and 10.8 fps, while maskrcnn-benchmark reaches 37.8 box AP and 34.2 mask AP at 3.3 GB and 12.1 fps. Detectron reaches 37.8 box AP and 34.1 mask AP at 8.8 GB, and SimpleDet reaches 37.1 box AP and 33.7 mask AP at 6.7 GB.

For RetinaNet, MMDetection reaches 35.8 box AP at 13.1 fps and 3.4 GB, while maskrcnn-benchmark reaches 36.0 box AP at 11.1 fps and 2.7 GB.

The memory columns are not measured the same way: MMDetection reports the maximum over all GPUs, maskrcnn-benchmark reports GPU 0, Detectron uses a caffe2 query, and SimpleDet reads nvidia-smi. The authors report that MMDetection and maskrcnn-benchmark use similar memory, which is lower than the other two codebases.

A separate GPU-type study measures Faster R-CNN, Mask R-CNN and RetinaNet on TITAN X, GTX 1080 Ti, TITAN Xp, RTX 2080 Ti, TITAN V and V100. The servers differ in other hardware such as CPUs and hard disks, so the authors treat these speeds as a basic impression only.

FP16 memory savings

MMDetection supports mixed precision training with FP16, aiming to cut GPU memory and speed up training while keeping performance almost unchanged. maskrcnn-benchmark uses apex for this, SimpleDet has its own implementation, and Detectron did not support it at the time.

On the same V100 node, MMDetection's Mask R-CNN drops from 3.8 GB to 3.0 GB of training memory when moving from FP32 to FP16, with box AP at 37.4 in both and mask AP at 34.3 against 34.4. SimpleDet falls from 6.7 GB to 5.5 GB, while maskrcnn-benchmark stays at 3.3 GB in both precisions.

Table 4 varies the batch size per GPU across several MMDetection models. For Faster R-CNN with R-18 at 2 images per GPU, memory goes from 2.0 GB to 1.7 GB, while at 12 images per GPU it goes from 11.3 GB to 5.7 GB, so the saving grows with batch size. RetinaNet with R-50 at 2 images per GPU drops from 3.6 GB to 2.9 GB, and FCOS with R-50 at 4 images per GPU drops from 6.9 GB to 5.2 GB.

Table 3 reports training speed in iter/s, with MMDetection's Mask R-CNN at 0.430 in FP32 and 0.364 in FP16. Table 4 gives the same 0.430 and 0.364 for Mask R-CNN R-50 at 2 images per GPU in s/iter, where the FP16 value is the smaller one. The two units point in opposite directions, so the speed effect of FP16 on MMDetection is not settled by these tables.

Multi-node scaling

Mask R-CNN is trained on 8, 16, 32 and 64 GPUs on another V100 cluster, with the base learning rate scaled linearly with batch size following the cited large mini-batch work.

Throughput on 64 GPUs reaches 253 images/s, against a linear upper bound of 288 images/s. The authors describe MMDetection as achieving nearly linear acceleration across nodes.

Regression loss choice

Detectors are trained with a multi-task loss whose regression branch is usually Smooth L1 Loss, and the study compares it with L1 Loss, Balanced L1 Loss, IoU Loss, GIoU Loss and Bounded IoU Loss. Each loss is run with weights 1, 2, 5 and 10 on Faster R-CNN with ResNet-50-FPN, and a coarse grid search picks the best weight for each loss, so some weight cells are left blank.

Smooth L1 Loss reaches 36.4 at weight 1 and 36.9 at weight 2, so raising its weight adds 0.5 points at the best setting. Without weight tuning, L1 Loss reaches 36.8 at weight 1, against 36.4 for Smooth L1 Loss at weight 1, while the text states the gap as 0.6%. L1 Loss reaches 36.9 at weight 2 and drops to 34.0 at weight 5, so raising its weight brings no further gain.

The authors relate the lack of gain for L1 to its loss values, which are already large, and tie the benefit of boosting gradients of well-located boxes to the Balanced L1 Loss analysis.

At each loss's best weight, Balanced L1 Loss reaches 37.2 at weight 1 and L1 Loss 36.9 at weight 2, which the text reports as 0.3% higher for end-to-end Faster R-CNN.

Bounded IoU Loss reaches 36.8 only at weights 5 and 10, which the text describes as similar to Smooth L1 Loss but requiring a larger weight.

BN configuration under small batches

Detectors trained with small batches usually freeze BN layers, and the configuration has two switches: whether the BN statistics are updated, and whether the affine weights \(\gamma\) and \(\beta\) are optimized. The switches are named eval and requires grad after PyTorch's argument names, so eval True keeps the statistics fixed and requires grad True keeps \(\gamma\) and \(\beta\) trainable.

The authors read this as a negligible effect at 1x and a gain of about 0.5% at 2x, and MMDetection uses eval True with requires grad True as its default.

Normalization layers and heads

FrozenBN keeps the pretrained backbone statistics fixed, SyncBN computes mean and variance across GPUs, and GN divides channels into groups and computes statistics inside each group.

Multi-scale training ranges

Value mode draws from a predefined set of scales, and range mode draws any scale between a minimum and a maximum; range mode is a value mode with an interval of 1.

The notation 1333×[640:800:32] samples the shorter edge from {640, 672, 704, 736, 768, 800} in value mode, and 1333×[640:800] samples it between 640 and 800 in range mode, with the longer edge fixed at 1333. All runs use Mask R-CNN with ResNet-50-FPN under the 2x schedule.

The authors find range mode similar to or slightly better than value mode with the same extremes, and a wider range usually brings more gain.

RPN sampling and anchor settings

The authors found some Detectron RPN settings not optimal and list alternatives in Table 9, but MMDetection keeps the Detectron defaults. All rows use an RPN with ResNet-50 and report AR1000.

Table 9 rows use beta values 1/5, 1/9 and 1/15, with AR1000 of 56.5, 57.1 and 57.3 respectively, and the smaller values bring the loss closer to L1 Loss.

The allowed border parameter sets how far anchors may extend beyond the image before they are ignored during training, and its default of 0 ignores any anchor outside the image. Setting it to infinity, which keeps every anchor, raises AR from 57.1% to 57.7%.

The neg pos ub parameter caps the ratio of negative to positive samples, since default sampling adds negatives to keep a fixed count when positives are few, which the authors say can unbalance training. Setting neg pos ub to 3 gives AR 58.3 and to 5 gives AR 58.1 in Table 9, and the text reports gains of 1.2% and 1.1% for these two settings.

The text does not state which row it uses as the baseline for these gains, and the 1.1% figure differs from the table value at 5.

Limitations

Memory figures are not comparable across codebases, because each framework measures memory in its own way. Speed comparisons were run on servers whose CPUs and disks are not exactly the same.

Training speed is given in iter/s in Table 3 and in s/iter in Table 4 for the same Mask R-CNN FP32 value of 0.430, so training speed across these tables cannot be compared directly. Some text values differ from their tables: the text gives 0.6% for L1 Loss over Smooth L1 Loss, while the table gives 36.8 against 36.4 at weight 1, and the text gives 0.5% for mask AP in the scale comparison, while Table 8 gives 0.4.

The ablations each use a single setup: the BN study uses Mask R-CNN with ResNet-50-FPN, the scale study uses Mask R-CNN under 2x, the RPN study uses ResNet-50, and the regression loss study uses Faster R-CNN with ResNet-50-FPN. The normalization study covers only Mask R-CNN with ResNet-50-FPN.

The 64-GPU throughput of 253 images/s sits below the linear bound of 288 images/s, and the acceleration is described as nearly linear rather than linear.

Paper info

Authors
Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, Zheng Zhang, Dazhi Cheng, Chenchen Zhu, Tianheng Cheng, Qijie Zhao, Buyu Li, Xin Lu, Rui Zhu, Yue Wu, Jifeng Dai, Jingdong Wang, Jianping Shi, Wanli Ouyang, Chen Change Loy, Dahua Lin
Venue
arXiv · Preprint
First published
2019-6-17
Added
2026-11-12
Updated
2019-6-17
Version
v1
arXiv
1906.07155
Category
cs.CV · cs.LG · eess.IV
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, Zheng Zhang, Dazhi Cheng, Chenchen Zhu, Tianheng Cheng, Qijie Zhao, Buyu Li, Xin Lu, Rui Zhu, Yue Wu, Jifeng Dai et al. (2019). MMDetection: Open MMLab Detection Toolbox and Benchmark. arXiv:1906.07155v1. https://arxiv.org/abs/1906.07155v1

BibTeX
@misc{chen2019mmdetection,
  title = {{MMDetection: Open MMLab Detection Toolbox and Benchmark}},
  author = {Kai Chen and Jiaqi Wang and Jiangmiao Pang and Yuhang Cao and Yu Xiong and Xiaoxiao Li and Shuyang Sun and Wansen Feng and Ziwei Liu and Jiarui Xu and Zheng Zhang and Dazhi Cheng and Chenchen Zhu and Tianheng Cheng and Qijie Zhao and Buyu Li and Xin Lu and Rui Zhu and Yue Wu and Jifeng Dai and Jingdong Wang and Jianping Shi and Wanli Ouyang and Chen Change Loy and Dahua Lin},
  year = {2019},
  eprint = {1906.07155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.07155v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up