Paper commentary
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- Problem Once convolutional features are shared across proposals, region proposal computation becomes the test-time bottleneck of region-based detectors.
- Method A fully convolutional Region Proposal Network predicts anchor-referenced objectness and box offsets on the detector's shared convolutional features, and the network is trained in alternating steps with Fast R-CNN.
- Results Reached 5 fps including all steps with VGG-16 on a GPU, and 73.2% mAP on PASCAL VOC 2007 test when trained on VOC 2007 and 2012 trainval.
Why proposals became the bottleneck
Sharing convolutions across proposals made region-based detectors much cheaper. Once that cost was removed, the proposal step was left as the part of the pipeline that limits test-time speed, even for detectors built on very deep networks.
Selective Search takes about 2 seconds per image on a CPU, and EdgeBoxes about 0.2 seconds, so with either method the proposal step takes as long as the detection network itself. Comparisons of this kind are uneven, because the fast detectors run on GPUs while the proposal methods run on CPUs. Moving proposal computation to the GPU would address the speed gap, but it would leave the convolutional computation of the detector unused.
The authors instead compute proposals with a deep convolutional network that reuses the feature maps the detector already needs. Because those convolutions are shared at test time, the marginal cost of proposals is about 10ms per image.
What the RPN computes on the shared feature map
The RPN slides a small network over the feature map produced by the last shared convolutional layer. At each position it reads an n×n spatial window, with n = 3 in this paper, and maps that window to a lower-dimensional vector of 256 dimensions for ZF and 512 for VGG, followed by ReLU. The shared backbones contribute 5 shareable convolutional layers for the ZF net and 13 for VGG-16.
Two sibling 1×1 convolutional layers then produce the box-regression output (reg) and the box-classification output (cls). Since the same small network is applied at every position, its weights are shared across all spatial locations. The effective receptive field on the input image is 171 pixels for ZF and 228 pixels for VGG.
With k anchors per position, the reg layer outputs 4k coordinates and the cls layer outputs 2k scores, one pair per anchor for object versus not object. The classifier is written as a two-class softmax, although logistic regression could also produce the k scores.
Anchors as multi-scale references
The usual remedies are image pyramids, where the image and its feature maps are computed at several scales, and filter pyramids, where filters of several sizes slide over one feature map. The RPN instead regresses from anchor boxes placed at each position, so it needs one image scale and one filter size.
By default there are 3 scales and 3 aspect ratios, giving k = 9 anchors at each sliding position. A feature map of typically about 2,400 positions therefore carries that many times 9 anchors.
The anchor-based function is applied at every location, so a translated object produces a translated proposal, which is the translation-invariant property the design aims for. MultiBox instead uses k-means to generate 800 anchors, which are not translation invariant. Each of the k regressors works on the same 3×3 feature region and handles one scale and one aspect ratio, so the regressors do not share weights.
The authors note that the translation invariance holds only up to the total stride of the network.
Anchor labels and the RPN loss
An anchor is negative if its IoU is lower than 0.3 for every ground-truth box, and anchors that are neither contribute nothing to the objective.
The loss for an image is a classification term summed over the anchors plus a regression term that is switched on only for positive anchors. \[L(\{p_i\},\{t_i\}) = \frac{1}{N_{cls}}\sum_i L_{cls}(p_i,p_i^*) + \lambda\frac{1}{N_{reg}}\sum_i p_i^* L_{reg}(t_i,t_i^*)\] Here i indexes an anchor in the mini-batch, p_i is the predicted probability that the anchor is an object, and p_i^* is 1 for a positive anchor and 0 for a negative one.
L_cls is a log loss over object versus not object, and the regression term applies the smooth L1 function R to the difference t_i minus t_i^*. The box targets are offsets normalized by the anchor size, with a logarithm on the width and height ratios. \[t_x=(x-x_a)/w_a,\quad t_y=(y-y_a)/h_a,\quad t_w=\log(w/w_a),\quad t_h=\log(h/h_a)\]
The classification term is normalized by the mini-batch size, N_cls = 256, and the regression term by the number of anchor locations, N_reg of about 2,400. The weight λ is set to 10, which the authors describe as making the two terms roughly equally weighted.
Sampling and optimizing one image
Each mini-batch comes from a single image, and the RPN is trained end-to-end by backpropagation and stochastic gradient descent. Instead of using all anchors, which would be dominated by negatives, 256 anchors are sampled per image with positive and negative anchors in a ratio of up to 1:1. If an image has fewer than 128 positive anchors, the mini-batch is padded with negative anchors.
The new layers are initialized from a zero-mean Gaussian with standard deviation 0.01, while the shared layers come from an ImageNet classification model. On PASCAL VOC the learning rate is 0.001 for 60k mini-batches and 0.0001 for the next 20k, with momentum 0.9 and weight decay 0.0005.
Training the RPN and Fast R-CNN together
The RPN and Fast R-CNN would modify the shared convolutional layers in different ways if trained separately, so a scheme is needed that keeps the features shared. The paper considers three schemes, and all experiments in the paper use the first one.
The detector then initializes the RPN training with the shared layers fixed, and the detector's unique layers are fine-tuned last with the shared layers fixed. Further alternating iterations were observed to bring negligible improvements.
Approximate joint training merges the two networks into one, treats the proposals of each forward pass as fixed, and backpropagates the combined signals into the shared layers. The authors found this close in accuracy while cutting training time by about 25-50% compared with alternating training, and the solver is included in the released Python code.
Non-approximate joint training would also need gradients with respect to the box coordinates, which requires an RoI pooling layer that is differentiable in those coordinates. The authors describe that as a nontrivial problem, addressed by an RoI warping layer in another work, and beyond the scope of this paper.
Scale, stride and anchor filtering
Training and testing use single-scale images whose shorter side is rescaled to 600 pixels. The total stride on the last convolutional layer is 16 pixels for both ZF and VGG, which corresponds to about 10 pixels on a typical PASCAL image before resizing. A smaller stride may improve accuracy, but the authors did not explore one.
During training, anchors that cross the image boundary are ignored, which leaves about 6000 anchors per image out of roughly 20000 for a typical 1000×600 image. At test time the fully convolutional RPN is applied to the whole image, and the resulting boundary-crossing proposals are clipped to the image.
Non-maximum suppression with an IoU threshold of 0.7 is applied to the proposals using their cls scores, which leaves about 2000 proposals per image. The top-N ranked proposals are then used for detection, and the Fast R-CNN detector is trained with 2000 RPN proposals while the number of proposals is varied at test time.
PASCAL VOC 2007 and 2012 detection
With the ZF net and the Fast R-CNN detector, Selective Search reaches 58.7% mAP and EdgeBoxes 58.6%. RPN with shared features reaches 59.9% while using up to 300 proposals.
Running time with shared convolutions
With VGG, the Selective Search pipeline takes 1830 ms per image on a K40 GPU, at 0.5 fps, with 1510 ms of that spent on proposals computed on the CPU. The RPN pipeline with VGG takes 198ms in total, of which the proposal step is 10 ms, at 5 fps. With the ZF net, the RPN pipeline takes 59 ms in total, at 17 fps.
Selective Search takes 1-2 seconds per image depending on content, with an average of about 1.5s, while Fast R-CNN with VGG-16 takes 320ms on 2000 Selective Search proposals. The 5 fps figure is for VGG-16 on a GPU with all steps included.
Which RPN outputs matter as proposals
In these ablations a Fast R-CNN detector trained on 2000 Selective Search proposals is fixed and only the test-time proposals are changed, with no feature sharing with the RPN. Replacing Selective Search with 300 RPN proposals gives 56.8%, and the top-ranked 100 RPN proposals give 55.1%. Using the top-ranked 6000 RPN proposals without NMS gives 55.2%, which the authors read as NMS not harming mAP while reducing false alarms.
The authors take this to show that the cls scores carry the accuracy of the highest-ranked proposals.
When the reg layer is removed, the proposals become anchor boxes, and mAP drops to 52.1% with 300 proposals. The authors conclude that the high-quality proposals mainly come from the regressed box bounds.
Replacing the ZF proposals with VGG-16 RPN proposals, with the SS-trained ZF detector, raises mAP from 56.8% to 59.2%.
Recall as the number of proposals drops
Recall-to-IoU measures the recall of proposals at different IoU thresholds, and the authors describe it as only loosely related to final detection accuracy, so they use it to diagnose proposal methods. The comparison uses 300, 1000 and 2000 proposals, taking the top-N ranked ones for each method.
The RPN degrades gracefully when the proposal count drops from 2000 to 300, while the recall of Selective Search and EdgeBoxes falls more quickly. The authors attribute this mainly to the cls term of the RPN.
Two-stage cascade versus dense one-stage detection
OverFeat is a one-stage, class-specific pipeline, whereas the Faster R-CNN system is a two-stage cascade of class-agnostic proposals followed by class-specific detection. The authors emulate the one-stage design with dense windows of 3 scales (128, 256, 512) and 3 aspect ratios, and also test 5 scales.
The one-stage system also has about 20000 proposals to process, which makes it slower. The authors note that similar sliding-window replacements in other work caused about 6% degradation.
MS COCO detection
The COCO dataset has 80 object categories, with 80k training images, 40k validation images and 20k test-dev images, and it is evaluated with mAP@[.5, .95] and mAP@0.5. Training uses an 8-GPU implementation, with a mini-batch of 8 for the RPN and 16 for Fast R-CNN, and learning rate 0.003 for 240k iterations followed by 0.0003 for 80k iterations.
Faster R-CNN trained on COCO train reaches 42.1% mAP@0.5 and 21.5% mAP@[.5, .95] on test-dev, which the paper states is 2.8% and 2.2% higher than the Fast R-CNN counterpart. Training on COCO trainval gives 42.7% mAP@0.5 and 21.9% mAP@[.5, .95].
The authors attribute the gap to the Fast R-CNN baseline mainly to the definition of negatives and to the mini-batch sizes. They read the larger gain at mAP@0.5 as RPN improving localization at higher IoU thresholds.
Deeper backbone in the 2015 entries
Replacing VGG-16 with ResNet-101 raises the COCO val results from 41.5%/21.2% to 48.4%/27.2%. This comparison comes from the cited work on ResNet-101, and the paper's own controlled numbers stay with VGG-16.
The same residual-network entry reached 55.7%/34.9% as a single model and 59.0%/37.4% as an ensemble on COCO test-dev, and was the first-place COCO 2015 detection result. The same system also won the ILSVRC 2015 object detection track, surpassing the second place by an absolute 8.5%.
Using COCO data for PASCAL VOC
The COCO detection model is applied directly to VOC 2007 test without VOC fine-tuning, with the softmax restricted to the 20 VOC categories plus background. This gives 76.1% mAP, above the 73.2% of the model trained on VOC 2007 and 2012 trainval.
Fine-tuning the COCO model on VOC, with COCO in place of the ImageNet initialization, reaches 78.8% mAP on VOC 2007 test, a gain of 5.6%. The COCO+VOC07+12 model has the best AP in every individual category on VOC 2007.
Limitations
The approximate joint scheme ignores the derivative with respect to the proposal box coordinates, so it only approximates joint optimization. The non-approximate scheme needs a differentiable RoI pooling layer, which the paper leaves beyond its scope.
All training and testing in the paper uses a single image scale, and the authors state that multi-scale feature extraction does not give a good speed-accuracy trade-off. The translation invariance is guaranteed only up to the network's total stride.
The recall analysis is described as only loosely related to detection accuracy, so it is used as a diagnostic.
Paper info
- Authors
- Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun
- Venue
- arXiv · Preprint
- First published
- 2015-6-4
- Added
- 2026-10-20
- Updated
- 2016-1-6
- Version
- v3
- arXiv
- 1506.01497
- Category
- cs.CV
- 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
Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun (2015). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv:1506.01497v3. https://arxiv.org/abs/1506.01497v3
BibTeX
@misc{ren2015faster,
title = {{Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks}},
author = {Shaoqing Ren and Kaiming He and Ross Girshick and Jian Sun},
year = {2015},
eprint = {1506.01497},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1506.01497v3}
}