grid r-cnn · mask r-cnn [11] extended faster r-cnn by adding a branch for predicting an pixel-wise...

10
Grid R-CNN Xin Lu 1 Buyu Li 2 Yuxin Yue 3 Quanquan Li 1 Junjie Yan 1 1 SenseTime Research, 2 The Chinese University of Hong Kong, 3 Beihang University {luxin,liquanquan,yanjunjie}@sensetime.com, libuyu [email protected], [email protected] Abstract This paper proposes a novel object detection framework named Grid R-CNN, which adopts a grid guided local- ization mechanism for accurate object detection. Differ- ent from the traditional regression based methods, the Grid R-CNN captures the spatial information explicitly and en- joys the position sensitive property of fully convolutional architecture. Instead of using only two independent points, we design a multi-point supervision formulation to encode more clues in order to reduce the impact of inaccurate pre- diction of specific points. To take the full advantage of the correlation of points in a grid, we propose a two-stage in- formation fusion strategy to fuse feature maps of neighbor grid points. The grid guided localization approach is easy to be extended to different state-of-the-art detection frame- works. Grid R-CNN leads to high quality object localiza- tion, and experiments demonstrate that it achieves a 4.1% AP gain at IoU=0.8 and a 10.0% AP gain at IoU=0.9 on COCO benchmark compared to Faster R-CNN with Res50 backbone and FPN architecture. 1. Introduction Object detection task can be decomposed into object classification and localization. In recent years, many deep convolutional neural networks (CNN) based detection frameworks are proposed and achieve state-of-the-art re- sults [9, 8, 25, 17, 11, 1]. Although these methods improve the detection performance in many different aspects, their bounding box localization modules are similar. Typical bounding box localization module is a regression branch, which is designed as several fully connected layers and takes in high-level feature maps to predict the offset of the candidate box (proposal or predefined anchor). In this paper we introduce Grid R-CNN, a novel ob- ject detection framework, where the traditional regression formulation is replaced by a grid point guided localization mechanism. And the explicit spatial representations are ef- ficiently utilized for high quality localization. In contrast to regression approach where the feature map is collapsed Figure 1. (a) Traditional offset regression based bounding box lo- calization. (b) Our proposed grid guided localization in Grid R- CNN. The bounding box is located by a fully convolutional net- work. into a vector by fully connected layers, Grid R-CNN di- vides the object bounding box region into grids and em- ploys a fully convolutional network (FCN) [21] to predict the locations of grid points. Owing to the position sensitive property of fully convolutional architecture, Grid R-CNN maintains the explicit spatial information and grid points locations can be obtained in pixel level. As illustrated in Figure 1.b, when a certain number of grid points at spec- ified location are known, the corresponding bounding box is definitely determined. Guided by the grid points, Grid R-CNN can determine more accurate object bounding box than regression method which lacks the guidance of explicit spatial information. Since a bounding box has four degrees of freedom, two independent points (e.g. the top left corner and bottom right corner) are enough for localization of a certain object. However the prediction is not easy because the location of the points are not directly corresponding to the local fea- tures. For example, the upper right corner point of the cat in Figure 1.b lies outside of the object body and its neigh- borhood region in the image only contains background, and

Upload: others

Post on 17-Jan-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

Grid R-CNN

Xin Lu1 Buyu Li2 Yuxin Yue3 Quanquan Li1 Junjie Yan1

1SenseTime Research, 2The Chinese University of Hong Kong, 3Beihang University{luxin,liquanquan,yanjunjie}@sensetime.com, libuyu [email protected], [email protected]

Abstract

This paper proposes a novel object detection frameworknamed Grid R-CNN, which adopts a grid guided local-ization mechanism for accurate object detection. Differ-ent from the traditional regression based methods, the GridR-CNN captures the spatial information explicitly and en-joys the position sensitive property of fully convolutionalarchitecture. Instead of using only two independent points,we design a multi-point supervision formulation to encodemore clues in order to reduce the impact of inaccurate pre-diction of specific points. To take the full advantage of thecorrelation of points in a grid, we propose a two-stage in-formation fusion strategy to fuse feature maps of neighborgrid points. The grid guided localization approach is easyto be extended to different state-of-the-art detection frame-works. Grid R-CNN leads to high quality object localiza-tion, and experiments demonstrate that it achieves a 4.1%AP gain at IoU=0.8 and a 10.0% AP gain at IoU=0.9 onCOCO benchmark compared to Faster R-CNN with Res50backbone and FPN architecture.

1. IntroductionObject detection task can be decomposed into object

classification and localization. In recent years, manydeep convolutional neural networks (CNN) based detectionframeworks are proposed and achieve state-of-the-art re-sults [9, 8, 25, 17, 11, 1]. Although these methods improvethe detection performance in many different aspects, theirbounding box localization modules are similar. Typicalbounding box localization module is a regression branch,which is designed as several fully connected layers andtakes in high-level feature maps to predict the offset of thecandidate box (proposal or predefined anchor).

In this paper we introduce Grid R-CNN, a novel ob-ject detection framework, where the traditional regressionformulation is replaced by a grid point guided localizationmechanism. And the explicit spatial representations are ef-ficiently utilized for high quality localization. In contrastto regression approach where the feature map is collapsed

Figure 1. (a) Traditional offset regression based bounding box lo-calization. (b) Our proposed grid guided localization in Grid R-CNN. The bounding box is located by a fully convolutional net-work.

into a vector by fully connected layers, Grid R-CNN di-vides the object bounding box region into grids and em-ploys a fully convolutional network (FCN) [21] to predictthe locations of grid points. Owing to the position sensitiveproperty of fully convolutional architecture, Grid R-CNNmaintains the explicit spatial information and grid pointslocations can be obtained in pixel level. As illustrated inFigure 1.b, when a certain number of grid points at spec-ified location are known, the corresponding bounding boxis definitely determined. Guided by the grid points, GridR-CNN can determine more accurate object bounding boxthan regression method which lacks the guidance of explicitspatial information.

Since a bounding box has four degrees of freedom, twoindependent points (e.g. the top left corner and bottomright corner) are enough for localization of a certain object.However the prediction is not easy because the location ofthe points are not directly corresponding to the local fea-tures. For example, the upper right corner point of the catin Figure 1.b lies outside of the object body and its neigh-borhood region in the image only contains background, and

Page 2: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

it may share very similar local features with nearby pixels.To overcome this problem, we design a multi-point super-vision formulation. By defining target points in a gird, wehave more clues to reduce the impact of inaccurate predic-tion of some points. For instance, in a typical 3 × 3 gridpoints supervision case, the probably inaccurate y-axis co-ordinate of the top-right point can be calibrated by that oftop-middle point which just locates on the boundary of theobject. The grid points are effective designs to decrease theoverall deviation.

Furthermore, to take the full advantage of the correlationof points in a gird, we propose an information fusion ap-proach. Specifically, we design individual group of featuremaps for each grid point. For one grid point, the featuremaps of the neighbor grid points are collected and fusedinto an integrated feature map. The integrated feature mapis utilized for the location prediction of the correspondinggrid point. Thus complementary information from spatialrelated grid points is incorporated to make the predictionmore accurate.

We showcase the effectiveness of our Grid R-CNNframework on the object detection track of the challengingCOCO benchmark [19]. Our approach outperforms tradi-tional regression based state-of-the-art methods by a signif-icant margin. For example, we surpass Faster R-CNN [25]with a backbone of ResNet-50 [14] and FPN [17] archi-tecture by 2.2% AP. Further comparison on different IoUthreshold criteria shows that our approach has overwhelm-ing strength in high quality object localization, with a 4.1%AP gain at IoU=0.8 and 10.0% AP gain at IoU=0.9.

The main contributions of our work are listed as follows:

1. We propose a novel localization framework called GridR-CNN which substitute traditional regression net-work by fully convolutional network that preservesspatial information efficiently. To our best knowledge,Grid R-CNN is the first proposed region based (two-stage) detection framework that locate object by pre-dicting grid points on pixel level.

2. We design a multi-point supervision form that predictspoints in grid to reduce the impact of some inaccuratepoints. We further propose a feature map level infor-mation fusion mechanism that enables the spatially re-lated grid points to obtain incorporated features so thattheir locations can be well calibrated.

3. We perform extensive experiments and prove that GridR-CNN framework is widely applicable across differ-ent detection frameworks and network architectureswith consistent gains. The Grid R-CNN performs evenbetter in more strict localization criterion (e.g. IoUthreshold = 0.75). Thus we are confident that our gridguided localization mechanism is a better alternativefor regression based localization methods.

2. Related WorksSince our new approach is based on two stage object de-

tector, here we briefly review some related works. Two-stage object detector was developed from the R-CNN ar-chitecture [9], a region-based deep learning framework thatclassify and locate every RoI (Region of Interest) gener-ated by some low-level computer vision algorithms [30, 34].Then SPP-Net [12] and Fast-RCNN [8] introduced a newway to save redundant computation by extracting every re-gion feature from the shared feature generated by entire im-age. Although SPP-Net and Fast-RCNN significantly im-prove the performance of object detection, the part of RoIsgenerating still cannot be trained end-to-end. Later, Faster-RCNN [25] was proposed to solve this problem by utilizinga light region proposal network(RPN) to generate a sparseset of RoIs. This makes the whole detection pipeline an end-to-end trainable network and further improve the accuracyand speed of the detector. In addition, some single-stageframeworks [20, 18, 24, 16] are also proposed to balancethe performance and efficiency of the model.

Recently, many works extend Faster R-CNN architecturein many aspects to achieve better performance. R-FCN [3]proposed to use region-based fully convolution network toreplace the original fully connected network. FPN [17] pro-posed a top-down architecture with lateral connections forbuilding high-level semantic feature maps for variant scales.Mask R-CNN [11] extended Faster R-CNN by adding abranch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regressionbranch with a new grid branch to locate objects more ac-curately. Also, our method needs no extra annotation otherthan bounding box.

LocNet [7] proposed a boundary-based method for ac-curate localization in object detection. It relies on condi-tional probabilities of region boundaries while our methodis based on grid points prediction. In addition, LocNet isused for proposal generation(like RPN) and Grid R-CNN isused for bounding box prediction.

CornerNet [15] is a single-stage object detector whichuses paired key-points to locate the objects. It’s a bottom-up detector that detects all the possible bounding box (cor-ner point) location through a hourglass [22] network. In themeanwhile, an embedding network was designed to map thepaired keypoints as close as possible. With above embed-ding mechanism, detected corners can be group as pairs andlocate the bounding boxes.

It’s worth noting that our approach is quite different fromCornerNet. CornerNet is a bottom-up method, which meansit directly generate keypoints from the entire image withoutdefining instance. The key step of the CornerNet is to recog-nize keypoints and grouping them correctly. In contrast tothat, our approach is a top-down two-stage detector whichdefines instance at first stage. What we focus on is how to

Page 3: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

Figure 2. Overview of the pipeline of Grid R-CNN. Region proposals are obtained from RPN and used for RoI feature extraction from theoutput feature maps of a CNN backbone. The RoI features are then used to perform classification and localization. In contrast to previousworks with a box offset regression branch, we adopt a grid guided mechanism for high quality localization. The grid prediction branchadopts a FCN to output a probability heatmap from which we can locate the grid points in the bounding box aligned with the object. Withthe grid points, we finally determine the accurate object bounding box by a feature map level information fusion approach.

locate the grid points accurately. Furthermore, we designedfeature fusion module to exploit the features of related gridpoints and calibrate for more accurate grid points localiza-tion than two corner points only.

3. Grid R-CNNAn overview of Grid R-CNN framework is shown in Fig-

ure 2. Based on region proposals, features for each RoI areextracted individually from the feature maps obtained by aCNN backbone. The RoI features are then used to performclassification and localization for the corresponding propos-als. In contrast to previous works, e.g. Faster R-CNN, weuse a grid guided mechanism for localization instead of off-set regression. The grid prediction branch adopts a fullyconvolutional network [21]. It outputs a fine spatial layout(probability heatmap) from which we can locate the gridpoints of the bounding box aligned with the object. With thegrid points, we finally determine the accurate object bound-ing box by a feature map level information fusion approach.

3.1. Grid Guided Localization

Most previous methods [9, 8, 25, 17, 11, 1] use severalfully connected layers as a regressor to predict the box off-set for object localization. Whereas we adopt a fully convo-lutional network to predict the locations of predefined gridpoints and then utilize them to determine the accurate objectbounding box.

We design an N × N grid form of target points alignedin the bounding box of object. An example of 3× 3 case isshown in Figure 1.b, the gird points here are the four cor-ner points, midpoints of four edges and the center pointrespectively. Features of each proposal are extracted byRoIAlign [11] operation with a fixed spatial size of 14×14,followed by eight 3×3 dilated(for large receptive field) con-volutional layers. After that, two 2× group deconvolutionlayers are adopted to achieve a resolution of 56× 56.

The grid prediction branch outputs N×N heatmaps with56 × 56 resolution, and a pixel-wise sigmoid function isapplied on each heatmap to obtain the probability map. Andeach heatmap has a corresponding supervision map, where5 pixels in a cross shape are labeled as positive locations ofthe target grid point. Binary cross-entropy loss is utilizedfor optimization.

During inference, on each heatmap we select the pixelwith highest confidence and calculate the corresponding lo-cation on the original image as the grid point. Formally,a point (Hx, Hy) in heatmap will be mapped to the point(Ix, Iy) in origin image by the following equation:

Ix = Px +Hx

wowp

Iy = Py +Hy

hohp

(1)

where (Px, Py) is the position of upper left corner of theproposal in input image, wp and hp are width and height ofproposal, wo and ho are width and height of output heatmap.

Then we determine the four boundaries of the box of ob-ject with the predicted grid points. Specifically, we denotethe four boundary coordinates as B = (xl, yu, xr, yb) rep-resenting the left, upper, right and bottom edge respectively.Let gj represent the j-th grid point with coordinate (xj , yj)and predicted probability pj ,. Then we define Ei as the setof indices of grid points that are located on the i-th edge,i.e., j ∈ Ei if gj lies on the i-th edge of the bounding box.We have the following equation to calculate B with the setof g:

xl =1

N

∑j∈E1

xjpj , yu =1

N

∑j∈E2

yjpj

xr =1

N

∑j∈E3

xjpj , yb =1

N

∑j∈E4

yjpj

(2)

Page 4: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

(b)(a)

Figure 3. An illustration of the 3 × 3 case of grid points featurefusion mechanism acting on the top left grid point. The arrowsrepresent the spatial information transfer direction. (a) First orderfeature fusion, feature of the point can be enhanced by fusing fea-tures from its adjacent points. (b) The second order feature fusiondesign in Grid R-CNN.

Taking the upper boundary yu as an example, it is the prob-ability weighted average of y axis coordinates of the threeupper grid points.

3.2. Grid Points Feature Fusion

The grid points have inner spatial correlation, and theirlocations can be calibrated by each other to reduce overalldeviation. Thus a spatial information fusion module is de-signed.

An intuitive implementation is a coordinate level aver-age, but the rich information in the feature maps are dis-carded. A further idea is to extract the local features corre-sponding to the grid points on each feature map for a fusionoperation. However this also discards potential effective in-formation in different feature maps. Taking the 3 × 3 girdas an example, for the calibration of top left point, the fea-tures in the top left region of other neighbor points’ featuremaps (e.g. the top middle point) may provide effective in-formation but not used. Therefore we design a feature maplevel information fusion mechanism to take full advantageof feature maps of each grid point.

To distinguish the feature maps of different points, weuse N × N group of filters to extract the features for themindividually (from the last feature map) and give them in-termediate supervision of their corresponding grid points.Thus each feature map has specified relationship with a cer-tain grid point and we denote the feature map correspondingto the i-th point as Fi.

For each grid point, the points that have a L1 distanceof 1 (unit grid length) will contribute to the fusion, whichare called source points. We define the set of source pointsw.r.t the i-th grid point as Si. For the j-th source point in Si,Fj will be processed by three consecutive 5×5 convolutionlayers for information transfer and this process is denoted asa function Tj→i. The processed features of all source pointsare then fused with Fi to obtain an fusion feature map F ′

i .An illustration of the top left grid point in 3 × 3 case is in

Figure 4. Illustration of the extended region mapping strategy. Thesmall white box is the original region of the RoI and we extend therepresentation region of the feature map to the dashed white boxfor higher coverage rate of the grid points in the the ground truthbox which is in green.

Figure 3.a. We adopt a simple sum operation for the fusionin implementation and the information fusion is formulatedas the following equation:

F ′i = Fi +

∑j∈Si

Tj→i(Fj) (3)

Based on F ′i for each grid point, a second order of fu-

sion is then performed with new conv layers T+j→i that don’t

share parameters with those in first order of fusion. And thesecond order fused feature map F ′′

i is utilized to output thefinal heatmap for the grid point location prediction. Thesecond order fusion enables an information transfer in therange of 2 (L1 distance). Taking the upper left grid point in3 × 3 grids as an example (shown in Figure 3.b), it synthe-sizes the information from five other grid points for reliablecalibration.

3.3. Extended Region Mapping

Grid prediction module outputs heatmaps with a fixedspatial size representing the confidence distribution of thelocations of grid points. Since the fully convolutional net-work architecture is adopted and spatial information is pre-served all along, an output heatmap naturally correspondsto the spatial region of the input proposal in original image.However, a region proposal may not cover the entire object,which means some of the ground truth grid points may lieoutside of the region of proposal and can’t be labeled on thesupervision map or predicted during inference.

During training, the lack of some grid points labels leadsto inefficient utilization of training samples. While in in-ference stage, by simply choosing the maximum pixel onthe heatmap, we may obtain a completely incorrect locationfor the grid points whose ground truth location is outsidethe corresponding region. In many cases over half of thegrid points are not covered, e.g. in Figure 4 the proposal(the small white box) is smaller than ground truth bounding

Page 5: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

box and 7 of the 9 grid points cannot be covered by outputheatmap.

A natural idea is to enlarge the proposal area. This ap-proach can make sure that most of the grid points will be in-cluded in proposal area, but it will also introduce redundantfeatures of background or even other objects. Experimentsshow that simply enlarging the proposal area brings no gainbut harms the accuracy of small objects detection.

To address this problem, we modify the relationship ofoutput heatmaps and regions in the original image by a ex-tended region mapping approach. Specifically, when theproposals are obtained, the RoI features are still extractedfrom the same region on the feature map without enlargingproposal area. While we re-define the representation areaof the output heatmap as a twice larger corresponding re-gion in the image, so that all grid points are covered in mostcases as shown in Figure 4 (the dashed box).

The extended region mapping is formulated as a modifi-cation of Equation 1:

I′

x = Px +4Hx − wo

2wowp

I′

y = Py +4Hy − ho

2hohp

(4)

After the new mapping, all the target grid points of the pos-itive proposals (which have an overlap larger than 0.5 withground truth box) will be covered by the corresponding re-gion of the heatmap.

3.4. Implementation Details

Network Configuration: We adopt the depth 50 or 101ResNets [14] w/o FPN [17] constructed on top as backboneof the model. RPN [25] is used to propose candidate re-gions. By convention, we set the shorter edge of the inputimage to 800 pixels in COCO dataset [19] and 600 pix-els in Pascal VOC dataset [5]. In RPN, 256 anchors aresampled per image with 1:1 ratio of positive to negative an-chors. The RPN anchors span 5 scales and 3 aspect ratios,and the IoU threshold of positive and negative anchors are0.7 and 0.3 respectively. In classification branch, RoIs thathave an overlap with ground truth greater than 0.5 are re-garded as positive samples. We sample 128 RoIs per imagein Faster R-CNN [25] based model and 512 RoIs per imagein FPN [17] based model, with the 1:3 ratio of positive tonegative. RoIAlign [11] is adopted in all experiments, andthe pooling size is 7 in category classification branch and 14in grid branch. The grid prediction branch samples at most96 RoIs per image and only positive RoIs are sampled fortraining.

Optimization: We use SGD to optimize the training losswith 0.9 momentum and 0.0001 weight decay. The back-bone parameter are initialized by image classification task

on ImageNet dataset [26], other new parameters are initial-ized by He (MSRA) initialization [13]. No data augmen-tations except standard horizontal flipping are used. Ourmodel is trained on 32 Nvidia TITAN Xp GPUs with oneimage on each for 20 epochs with an initial learning rateof 0.02, which decreases by 10 in the 13 and 18 epochs.We also use learning rate warming up and SynchronizedBatchNorm machanism [10, 23](only used in Grid branch)to make multi-GPU training more stable.

Inference: During the inference stage, the RPN gener-ates 300/1000 (Faster R-CNN/FPN) RoIs per image. Thenthe features of these RoIs will be processed by RoIAl-gin [11] layer and the classification branch to generate cate-gory score, followed by non-maximum suppression (NMS)with 0.5 IOU threshold. After that we select top 125 high-est scoring RoIs and put their RoIAlign features into gridbranch for further location prediction. Finally, NMS with0.5 IoU threshold will be applied to remove duplicate de-tection boxes.

4. ExperimentsWe perform experiments on two object detection

datasets, Pascal VOC [5] and COCO [19]. On Pascal VOCdataset, we train our model on VOC07+12 trainval set andevaluate on VOC2007 test set. On COCO [19] datasetwhich contains 80 object categories, we train our model onthe union of 80k train images and 35k subset of val imagesand test on a 5k subset of val (minival) and 20k test-dev.

4.1. Ablation Study

Multi-point Supervision: Table 1 shows how grid pointselection affects the accuracy of detection. We perform ex-periments of variant grid formulations. The experiment of2 points uses the supervision of upper left and bottom rightcorner of the ground truth box. In 4-point grid we add su-pervision of two other corner grid points. 9-point grid isa typical 3x3 grid formulation that has been described insection 3.1. All experiments in Table 1 are trained with-out feature fusion to avoid the extra gain from using morepoints for feature fusion. It can be observed that as the num-ber of supervised grid points increases, the accuracy of thedetection also increases.

method AP AP.5 AP.75

regression 37.4 59.3 40.32 points 38.3 57.3 40.54-point grid 38.5 57.5 40.89-point grid 38.9 58.2 41.2

Table 1. Comparison of different grid points strategies in Grid R-CNN. Experiments show that more grid points bring performancegains.

Grid Points Feature Fusion: Results in Table 2 shows

Page 6: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

method AP AP.5 AP.75

w/o fusion 38.9 58.2 41.2bi-directional fusion [2] 39.2 58.2 41.8first order feature fusion 39.2 58.1 41.9second order feature fusion 39.6 58.3 42.4

Table 2. Comparison of different feature fusion methods. Bi-directional feature fusion, first order feature fusion and secondorder fusion all demonstrate improvements. Second order fusionachieves the best performance with an improvement of 0.7% onAP.

method AP APsmall APlarge

baseline 37.7 22.1 48.0enlarge proposal area 37.7 20.8 50.9extended region mapping 38.9 22.1 51.4

Table 3. Comparison of enlarging the proposal directly and ex-tended region mapping strategy.

the effectiveness of feature fusion. We perform experimentson several typical feature fusion methods and achieve dif-ferent levels of improvement on AP performance. The bi-directional fusion method, as mentioned in [2], models theinformation flow as a bi-directional tree. For fair compar-ison, we directly use the feature maps from the first orderfeature fusion stage for grid point location prediction, andsee a same gain of 0.3% AP as bi-directional fusion. Andwe also perform experiment of the complete two stage fea-ture fusion. As can be seen in Table 2, the second orderfusion further improves the AP by 0.4%, with a 0.7% gainfrom the non-fusion baseline. Especially, the improvementof AP0.75 is more significant than that of AP0.5, which in-dicates that feature fusion mechanism helps to improve thelocalization accuracy of the bounding box.

Extended Region Mapping: Table 3 shows the resultsof our extended region mapping strategy compared with theoriginal region representation and the method of directlyenlarging the proposal box. Directly enlarging the regionof proposal box for RoI feature extraction helps to covermore grid points of big objects but also brings in redundantinformation for small objects. Thus we can see that withthis enlargement method there is a increase in APlarge buta decrease in APsmall, and finally a decline compared withthe baseline. Whereas the extended region mapping strat-egy improves APlarge performance as well as producing nonegative influences on APsmall, which leads to 1.2% im-provement on AP.

4.2. Comparison with State-of-the-art Methods

On minival set, we mainly compare Grid R-CNN withtwo widely used two-stage detectors, Faster-RCNN andFPN. We replace the original regression based localizationmethod by the grid guided localization mechanism in the

method backbone APR-FCN ResNet-50 45.6FPN ResNet-50 51.7FPN based Grid R-CNN ResNet-50 55.3

Table 4. Comparison with R-FCN and FPN on Pascal VOCdataset. Note that we evaluate the results with a COCO-style cri-terion which is the average AP across IoU thresholds range from0.5 to [0.5:0.95].

two frameworks for fair comparison.Experiments on Pascal VOC: We train Grid R-CNN

on Pascal VOC dataset for 18 epochs with the learning ratereduced by 10 at 15 and 17 epochs. The origianl evaluationcriterion of PASCAL VOC is to calculate the mAP at 0.5IoU threshold. We extend that to the COCO-style criterionwhich calculates the average AP across IoU thresholds from0.5 to 0.95 with an interval of 0.05. We compare Grid R-CNN with R-FCN [3] and FPN [17]. Results in Table 4show that our Grid R-CNN significantly improve AP overFPN and R-FCN by 3.6% and 9.7% respectively.

Experiments on COCO: To further demonstrate thegeneralization capacity of our approach, we conduct experi-ments on challenging COCO dataset. Table 5 shows that ourapproach brings consistently and substantially improvementacross multiple backbones and frameworks. Compared withFaster R-CNN framework, Grid R-CNN improves AP overbaseline by 2.1% with ResNet-50 backbone. The significantimprovements are also shown on FPN framework based onboth ResNet-50 and ResNet-101 backbones. Experimentsin Table 5 demonstrate that Grid R-CNN significantly im-prove the performance of middle and large objects by about3 points.

Results on COCO test-dev Set: For complete compari-son, we also evaluate Grid R-CNN on the COCO test-devset. We adopt ResNet-101 and ResNeXt-101 [31] withFPN [17] constructed on the top. Without bells and whis-tles, Grid R-CNN based on ResNet-101-FPN and ResNeXt-101-FPN could achieve 41.5 and 43.2 AP respectively. Asshown in Table 6, Grid R-CNN achieves very competitiveperformance comparing with other state-of-the-art detec-tors. It outperforms Mask R-CNN by a large margin with-out using any extra annotations. Note that since the tech-niques such as scaling used in SNIP [28] and cascading inCascade R-CNN [1] are not applied in current frameworkof Grid R-CNN, there is still room for large improvementon performance (e.g. combined with scaling and cascadingmethods).

4.3. Analysis and Discussion

Accuracy in Different IoU Criteria: In addition to theoverview of mAP, in this part we focus on the localizationquality of the Grid R-CNN. Figure 5 shows the comparisonbetween FPN based Grid R-CNN and baseline FPN with

Page 7: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

method backbone AP AP.5 AP.75 APS APM APL

Faster R-CNN ResNet-50 33.8 55.4 35.9 17.4 37.9 45.3Grid R-CNN ResNet-50 35.9 54.0 38.0 18.6 40.2 47.8Faster R-CNN w FPN ResNet-50 37.4 59.3 40.3 21.8 40.9 47.9Grid R-CNN w FPN ResNet-50 39.6 58.3 42.4 22.6 43.8 51.5Faster R-CNN w FPN ResNet-101 39.5 61.2 43.1 22.7 43.7 50.8Grid R-CNN w FPN ResNet-101 41.3 60.3 44.4 23.4 45.8 54.1

Table 5. Bounding box detection AP on COCO minival. Grid R-CNN outperforms both Faster R-CNN and FPN on ResNet-50 andResNet-101 backbone.

method backbone AP AP.5 AP.75 APS APM APL

YOLOv2 [24] DarkNet-19 21.6 44.0 19.2 5.0 22.4 35.5SSD-513 [20] ResNet-101 31.2 50.4 33.3 10.2 34.5 49.8DSSD-513 [6] ResNet-101 33.2 53.3 35.2 13.0 35.4 51.1RefineDet512 [33] ResNet101 36.4 57.5 39.5 16.6 39.9 51.4RetinaNet800 [18] ResNet-101 39.1 59.1 42.3 21.8 42.7 50.2CornerNet [15] Hourglass-104 40.5 56.5 43.1 19.4 42.7 53.9Faster R-CNN+++ [14] ResNet-101 34.9 55.7 37.4 15.6 38.7 50.9Faster R-CNN w FPN [17] ResNet-101 36.2 59.1 39.0 18.2 39.0 48.2Faster R-CNN w TDM [27] Inception-ResNet-v2 [29] 36.8 57.7 39.2 16.2 39.8 52.1D-FCN [4] Aligned-Inception-ResNet 37.5 58.0 - 19.4 40.1 52.5Regionlets [32] ResNet-101 39.3 59.8 - 21.7 43.7 50.9Mask R-CNN [11] ResNeXt-101 39.8 62.3 43.4 22.1 43.2 51.2Grid R-CNN w FPN (ours) ResNet-101 41.5 60.9 44.5 23.3 44.9 53.1Grid R-CNN w FPN (ours) ResNeXt-101 43.2 63.0 46.6 25.1 46.5 55.2

Table 6. Comparison with state-of-the-art detectors on COCO test-dev.

the same ResNet-50 backbone across IoU thresholds from0.5 to 0.9. Grid R-CNN outperforms regression at higherIoU thresholds (greater than 0.7). The improvements overbaseline at AP0.8 and AP0.9 are 4.1% and 10% respectively,which means that Grid R-CNN achieves better performancemainly by improving the localization quality of the bound-ing box. In addition, the results of AP0.5 indicates that gridbranch may slightly affect the performance of the classifi-cation branch.

59.354.7

46.3

32.2

9.6

58.353.9

46.3

36.3

19.6

0

10

20

30

40

50

60

70

0.5 0.6 0.7 0.8 0.9

mAP

IoU threshold

Faster R-CNN with FPN

Grid R-CNN with FPN

Figure 5. AP results across IoU thresholds from 0.5 to 0.9 with aninterval of 0.1.

Varying Degrees of Improvement in Different Cate-gories: We have analyzed the specific improvement of GridR-CNN on each category and discovered a meaningful andinteresting phenomenon. As shown in Table 7, the cate-gories with the most gains usually have a rectangular or barlike shape (e.g. keyboard, laptop, fork, train, and refrigera-tor), while the categories suffering declines or having leastgains usually have a round shape without structural edges(e.g. sports ball, frisbee, bowl, clock and cup). This phe-nomenon is reasonable since grid points are distributed ina rectangular shape. Thus the rectangular objects tend tohave more grid points on the body but round objects cannever cover all the grid points (especially the corners) withits body.

Qualitative Results Comparison: We showcase the il-lustrations of our high quality object localization results inthis part. As shown in Figure 6, Grid R-CNN (in the 1stand 3rd row) has an outstanding performance in accuratelocalization compared with the widely used Faster R-CNN(in the 2nd and 4th row). First and second row in figure 6show that Grid R-CNN outperforms Faster R-CNN in highquality object detection. Third and 4th row show that GridR-CNN performs better in large object detection tasks.

Page 8: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

Figure 6. Qualitative results comparison. The results of Grid R-CNN are listed in the first and third row, while those of Faster R-CNN arein the second and fourth row.

category cat bear giraffe dog airplane horse zebra toilet keyboard fork teddy bear train laptop refrigerator hot doggain 6.0 5.6 5.4 5.3 5.3 5.0 4.8 4.8 4.7 4.6 4.4 4.2 4.0 3.6 3.6

category toaster hair drier sports ball frisbee traffic light backpack kite handbag microwave bowl clock cup carrot dining table boatgain -1.9 -1.3 -1.0 -0.8 -0.5 -0.4 -0.3 -0.1 -0.1 -0.1 0.1 0.1 0.2 0.3 0.3

Table 7. The top 15 categories with most gains and most declines respectively, in the results of Grid R-CNN compared to Faster R-CNN.

5. Conclusion

In this paper we propose a novel object detection frame-work, Grid R-CNN, which replaces the traditional box off-set regression strategy in object detection by a grid guidedmechanism for high quality localization. The grid branchlocates the object by predicting grid points with the po-sition sensitive merits of FCN and then determining thebounding box guided by the grid. Further more, we de-sign a feature fusion module to calibrate the locations ofgrid points by transferring the spatial information in fea-ture map level. Additionally, an extended region mappingmechanism is proposed to help RoIs get a larger represent-

ing area to cover as many grid points as possible, whichsignificantly improves the performance. Extensive experi-ments show that Grid R-CNN brings solid and consistentimprovement and achieves state-of-the-art performance, es-pecially on strict evaluation metrics such as AP at IoU=0.8and IoU=0.9. Since the grid guided localization approach iseasy to be extended to other frameworks, we will try to com-bine the scale selection and cascade techniques with GridR-CNN and we believe a further gain can be obtained.

Page 9: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

References[1] Z. Cai and N. Vasconcelos. Cascade r-cnn: Delving into high

quality object detection. In Proceedings of the IEEE Con-ference on Computer Vision and Pattern Recognition, pages6154–6162, 2018.

[2] X. Chu, W. Ouyang, H. Li, and X. Wang. Structured featurelearning for pose estimation. In Proceedings of the IEEEConference on Computer Vision and Pattern Recognition,pages 4715–4723, 2016.

[3] J. Dai, Y. Li, K. He, and J. Sun. R-fcn: Object detectionvia region-based fully convolutional networks. In Advancesin neural information processing systems, pages 379–387,2016.

[4] J. Dai, H. Qi, Y. Xiong, Y. Li, G. Zhang, H. Hu, and Y. Wei.Deformable convolutional networks. In Proceedings of theIEEE international conference on computer vision, pages764–773, 2017.

[5] M. Everingham, S. A. Eslami, L. Van Gool, C. K. Williams,J. Winn, and A. Zisserman. The pascal visual object classeschallenge: A retrospective. International journal of com-puter vision, 111(1):98–136, 2015.

[6] C.-Y. Fu, W. Liu, A. Ranga, A. Tyagi, and A. C. Berg.Dssd: Deconvolutional single shot detector. arXiv preprintarXiv:1701.06659, 2017.

[7] S. Gidaris and N. Komodakis. Locnet: Improving localiza-tion accuracy for object detection. In Proceedings of theIEEE conference on computer vision and pattern recogni-tion, pages 789–798, 2016.

[8] R. Girshick. Fast r-cnn. In Proceedings of the IEEE inter-national conference on computer vision, pages 1440–1448,2015.

[9] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich fea-ture hierarchies for accurate object detection and semanticsegmentation. In Proceedings of the IEEE conference oncomputer vision and pattern recognition, pages 580–587,2014.

[10] P. Goyal, P. Dollar, R. Girshick, P. Noordhuis,L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He.Accurate, large minibatch sgd: training imagenet in 1 hour.arXiv preprint arXiv:1706.02677, 2017.

[11] K. He, G. Gkioxari, P. Dollar, and R. Girshick. Mask r-cnn.In Computer Vision (ICCV), 2017 IEEE International Con-ference on, pages 2980–2988. IEEE, 2017.

[12] K. He, X. Zhang, S. Ren, and J. Sun. Spatial pyramid poolingin deep convolutional networks for visual recognition. InEuropean conference on computer vision, pages 346–361.Springer, 2014.

[13] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep intorectifiers: Surpassing human-level performance on imagenetclassification. In Proceedings of the IEEE international con-ference on computer vision, pages 1026–1034, 2015.

[14] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learn-ing for image recognition. In Proceedings of the IEEE con-ference on computer vision and pattern recognition, pages770–778, 2016.

[15] H. Law and J. Deng. Cornernet: Detecting objects as pairedkeypoints. In Proceedings of the European Conference onComputer Vision (ECCV), pages 734–750, 2018.

[16] B. Li, Y. Liu, and X. Wang. Gradient harmonized single-stage detector. In AAAI Conference on Artificial Intelligence,2019.

[17] T.-Y. Lin, P. Dollar, R. Girshick, K. He, B. Hariharan, andS. Belongie. Feature pyramid networks for object detection.In Computer Vision and Pattern Recognition (CVPR), 2017IEEE Conference on, pages 936–944. IEEE, 2017.

[18] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar. Focalloss for dense object detection. In Proceedings of the IEEEinternational conference on computer vision, pages 2980–2988, 2017.

[19] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ra-manan, P. Dollar, and C. L. Zitnick. Microsoft coco: Com-mon objects in context. In European conference on computervision, pages 740–755. Springer, 2014.

[20] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg. Ssd: Single shot multibox detector.In European conference on computer vision, pages 21–37.Springer, 2016.

[21] J. Long, E. Shelhamer, and T. Darrell. Fully convolutionalnetworks for semantic segmentation. In Proceedings of theIEEE conference on computer vision and pattern recogni-tion, pages 3431–3440, 2015.

[22] A. Newell, K. Yang, and J. Deng. Stacked hourglass net-works for human pose estimation. In European Conferenceon Computer Vision, pages 483–499. Springer, 2016.

[23] C. Peng, T. Xiao, Z. Li, Y. Jiang, X. Zhang, K. Jia, G. Yu, andJ. Sun. Megdet: A large mini-batch object detector. In Pro-ceedings of the IEEE Conference on Computer Vision andPattern Recognition, pages 6181–6189, 2018.

[24] J. Redmon and A. Farhadi. Yolo9000: better, faster, stronger.In Proceedings of the IEEE conference on computer visionand pattern recognition, pages 7263–7271, 2017.

[25] S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towardsreal-time object detection with region proposal networks. InAdvances in neural information processing systems, pages91–99, 2015.

[26] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh,S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein,et al. Imagenet large scale visual recognition challenge.International Journal of Computer Vision, 115(3):211–252,2015.

[27] A. Shrivastava, R. Sukthankar, J. Malik, and A. Gupta. Be-yond skip connections: Top-down modulation for object de-tection. arXiv preprint arXiv:1612.06851, 2016.

[28] B. Singh and L. S. Davis. An analysis of scale invariance inobject detection snip. In Proceedings of the IEEE Conferenceon Computer Vision and Pattern Recognition, pages 3578–3587, 2018.

[29] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. A. Alemi.Inception-v4, inception-resnet and the impact of residualconnections on learning. In AAAI, volume 4, page 12, 2017.

[30] J. R. Uijlings, K. E. Van De Sande, T. Gevers, and A. W.Smeulders. Selective search for object recognition. Interna-tional journal of computer vision, 104(2):154–171, 2013.

Page 10: Grid R-CNN · Mask R-CNN [11] extended Faster R-CNN by adding a branch for predicting an pixel-wise object mask. Differ-ent from Mask R-CNN, our method replaces the regression branch

[31] S. Xie, R. Girshick, P. Dollar, Z. Tu, and K. He. Aggregatedresidual transformations for deep neural networks. In Com-puter Vision and Pattern Recognition (CVPR), 2017 IEEEConference on, pages 5987–5995. IEEE, 2017.

[32] H. Xu, X. Lv, X. Wang, Z. Ren, N. Bodla, and R. Chel-lappa. Deep regionlets for object detection. In Proceedingsof the European Conference on Computer Vision (ECCV),pages 798–814, 2018.

[33] S. Zhang, L. Wen, X. Bian, Z. Lei, and S. Z. Li. Single-shotrefinement neural network for object detection. In Proceed-ings of the IEEE Conference on Computer Vision and PatternRecognition, pages 4203–4212, 2018.

[34] C. L. Zitnick and P. Dollar. Edge boxes: Locating objectproposals from edges. In European conference on computervision, pages 391–405. Springer, 2014.