Paper commentary
Fast R-CNN
Fast R-CNN trains one stage that updates every layer for detection
- Problem R-CNN trains in three stages and caches features on disk, while SPPnet cannot fine-tune layers before its pooling layer. Both are slow and limit accuracy for very deep networks.
- Method Fast R-CNN runs the conv layers once per image and pools each proposal with RoI pooling. Unlike R-CNN, it trains classification and box regression jointly in one stage.
- Results Fast R-CNN trained VGG16 in 9.5 hours, compared to 84 hours for R-CNN. It also reached 66.9% mAP on VOC07.
Why multi-stage detectors stall
Detection is harder than classification because a detector must handle two problems at once. It has to score a very large number of candidate object locations, and those candidates only roughly fit the objects. Fixing both problems tends to cost speed, accuracy or simplicity.
R-CNN classifies proposals with a deep ConvNet, but it trains in three stages: log-loss fine-tuning, then SVMs, then box regressors. Its features are also written to disk, which took 2.5 GPU-days for the VOC07 trainval images with VGG16 and needs hundreds of gigabytes. At test time it runs a ConvNet forward pass for every proposal, which takes 47s per image with VGG16 on a GPU.
SPPnet shares computation by building one feature map per image and pooling each proposal from it. That brings test-time speed-ups of 10 to 100× over R-CNN, but its fine-tuning cannot update the convolutional layers before the pooling layer. The authors argue that this fixed-layer limit holds back the accuracy of very deep networks.
The open question is whether one training stage can update every layer without caching features on disk. Fast R-CNN is the proposed answer to that question.
One shared feature map and RoI pooling
Fast R-CNN runs the convolutional layers once per image and scores every proposal from that shared map. Each proposal is pooled to a fixed size, and fully connected layers then produce two outputs per RoI. One output is a softmax over K+1 classes, and the other is per-class box offsets for the K object classes.
The network takes a whole image and a set of object proposals as input. Several convolutional and max pooling layers turn the image into one conv feature map. For each proposal, an RoI pooling layer cuts out its region and produces a fixed-length feature vector.
An RoI is a rectangle given by its top-left corner \((r,c)\) and its height and width \((h,w)\). The layer splits that rectangle into an H×W grid of sub-windows, each about h/H by w/W, and takes the max in every sub-window. Each channel is pooled on its own, and H = W = 7 for VGG16 matches the first fully connected layer.
The authors use the same sub-window calculation as SPPnet.
Starting from an ImageNet network takes three changes. The last max pooling layer becomes an RoI pooling layer, and the 1000-way classifier becomes a fully connected layer and softmax over K+1 categories, with class-specific box regressors.
Sampling RoIs by image
Earlier methods drew one RoI from each of many images, so each training sample needed its own large forward pass. Fast R-CNN instead samples N images per mini-batch and R/N RoIs from each, so RoIs from one image share computation and memory. With N = 2 and R = 128, the authors estimate this is roughly 64× faster than sampling one RoI from 128 images.
A possible drawback is slower convergence, since RoIs from the same image are correlated. The authors report that this isn't a practical problem, and they reach good results with fewer SGD iterations than R-CNN. Each mini-batch uses 64 RoIs from each of its two images.
Of those RoIs, 25% come from proposals with IoU of at least 0.5 against a ground-truth box, and these are the foreground examples. The rest come from proposals whose maximum IoU with ground truth lies in [0.1, 0.5), and these are labeled background. The authors suggest that the 0.1 lower bound acts as a heuristic for hard example mining. Training flips images horizontally with probability 0.5, and no other augmentation is used.
One loss for classification and boxes
Each labeled RoI carries a ground-truth class u and a regression target v. The loss adds log loss on the true class to a localization term, scaled by λ and active only for foreground RoIs. In symbols, \( L(p,u,t^u,v) = L_{cls}(p,u) + \lambda [u \ge 1] L_{loc}(t^u,v) \), with \( L_{cls}(p,u) = -\log p_u \).
The localization term sums smooth L1 over the four box coordinates, comparing each \(t^u_i\) with \(v_i\). Smooth L1 is quadratic when the error is below 1 in absolute value and linear otherwise, so outliers have less effect than under an L2 loss. The authors say this avoids the careful learning-rate tuning that an L2 loss needs when targets are unbounded.
The weight λ is 1 in every experiment, and the regression targets are normalized to zero mean and unit variance. The backward pass through RoI pooling sends each gradient only to the input that won the max for that output cell. The gradient is \( \partial L/\partial x_i = \sum_r \sum_j [i = i^*(r,j)]\, \partial L/\partial y_{rj} \). An input that won the max for several outputs collects all of their gradients, which lets the conv layers below RoI pooling learn.
Whether conv layers need fine-tuning
SPPnet's results on smaller networks suggested that fine-tuning only the fully connected layers is enough. The authors expected this to fail for very deep networks such as VGG16.
Under this frozen setting, VOC07 mAP fell from 66.9% to 61.4%. The authors read the drop as showing that training through the RoI pooling layer matters for very deep networks. Updating every conv layer isn't required, though.
Updating from conv2_1 slowed training by 1.3× (12.5 vs. 9.5 hours) for a gain of only +0.3 points. Updating from conv1_1 over-ran GPU memory.
Multi-task training against classification alone
The authors trained classification-only baselines, which have no box regressors. They also tested multi-task networks with box regression switched off at test time, which isolates classification accuracy. This makes the comparison like for like.
Across models S, M and L, multi-task training raised classification mAP by 0.8 to 1.1 points. The authors read this as a consistent benefit from sharing one representation between the two tasks.
Stage-wise training adds a box regressor to a frozen classifier and trains only that regressor. It improves on the baselines but stays below multi-task training.
Accuracy and speed against R-CNN and SPPnet
On VOC07 with VGG16, Fast R-CNN reached 66.9% mAP using single-scale training and testing. SPPnet reached 63.1% using five scales, and R-CNN reached 66.0%. The authors attribute the gain over SPPnet to fine-tuning the conv layers, since Fast R-CNN is single-scale and still ahead.
Training VGG16 took 9.5 hours, compared to 84 hours for R-CNN and 25.5 hours for SPPnet. Fast R-CNN therefore trained VGG16 about 9× faster than R-CNN and 2.7× faster than SPPnet. Training is not the whole saving, because Fast R-CNN also avoids caching features on disk.
At test time, the VGG16 model ran at 0.32 seconds per image, compared to 47.0 for R-CNN. Those rates give speed-ups of 146× and 213× over R-CNN, without and with SVD.
For detection, the many RoIs make the fully connected layers take nearly half the forward time. Truncated SVD approximates the \(u \times v\) weight matrix \(W\) as \( W \approx U \Sigma_t V^T \), keeping the top t singular values. The layer is then replaced by two layers with no nonlinearity between them, the first with \(\Sigma_t V^T\) and the second with U.
Leaderboard results on VOC 2010 and 2012
On VOC 2012, Fast R-CNN trained on VOC12 trainval scored 65.7% on the test set. With the enlarged 07++12 data, it reached 68.4%. These are comp4 leaderboard entries, and the other methods there are built on the slower R-CNN pipeline.
SegDeepM uses VOC12 trainval plus segmentation annotations, so the two methods are trained on different data. With the 07++12 data, Fast R-CNN reached 68.8%, above SegDeepM. The authors suggest Fast R-CNN could replace R-CNN inside SegDeepM, which may lead to better results.
A preliminary MS COCO baseline trained on 80k images reached 35.9% PASCAL-style mAP and 19.7% COCO-style AP on test-dev. Because the training sets differ across these rows, they are leaderboard results rather than one controlled comparison.
Scale, data and proposal choices
Single-scale training used s = 600, with the longer side capped at 1000 pixels so VGG16 fits in GPU memory. The authors read this as deep ConvNets learning scale invariance directly, so single-scale testing gives the best speed and accuracy trade-off.
Adding VOC12 trainval to VOC07 trainval roughly tripled the images to 16.5k. This raised VOC07 test mAP from 66.9% to 70.0%. The authors cite earlier DPM work where mAP saturated after a few hundred to thousand training examples.
Softmax was compared with post-hoc SVMs trained with hard negative mining on Fast R-CNN features. Softmax beat the SVMs by 0.1 to 0.8 points across models S, M and L. The authors take this as support for one-shot fine-tuning, though the gap is small.
Sweeping selective search from 1k to 10k proposals, mAP rose and then fell slightly with model M. Replacing each selective search box with its closest dense box cut mAP by only one point, to 57.7%. Training on 45k dense boxes alone gave 52.9%, and SVMs did worse at 49.3%.
Limits of the evidence
VGG16 ran only at a single scale because GPU memory constraints ruled out multi-scale testing. Multi-scale training was tried only on the smaller networks. The proposal count study uses model M only.
The timings were measured on one Nvidia K40 GPU overclocked to 875 MHz. The COCO result is described as a preliminary baseline.
The authors say sparse proposals appear to improve detector quality. Whether dense boxes can match sparse proposals was left open.
Paper info
- Authors
- Ross Girshick
- Venue
- arXiv · Preprint
- First published
- 2015-4-30
- Added
- 2026-11-6
- Updated
- 2015-9-27
- Version
- v2
- arXiv
- 1504.08083
- 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
Ross Girshick (2015). Fast R-CNN. arXiv:1504.08083v2. https://arxiv.org/abs/1504.08083v2
BibTeX
@misc{girshick2015fast,
title = {{Fast R-CNN}},
author = {Ross Girshick},
year = {2015},
eprint = {1504.08083},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1504.08083v2}
}