Crafting GBD-Net for Object Detection

by   Xingyu Zeng, et al.

The visual cues from multiple support regions of different sizes and resolutions are complementary in classifying a candidate box in object detection. Effective integration of local and contextual visual cues from these regions has become a fundamental problem in object detection. In this paper, we propose a gated bi-directional CNN (GBD-Net) to pass messages among features from different support regions during both feature learning and feature extraction. Such message passing can be implemented through convolution between neighboring support regions in two directions and can be conducted in various layers. Therefore, local and contextual visual patterns can validate the existence of each other by learning their nonlinear relationships and their close interactions are modeled in a more complex way. It is also shown that message passing is not always helpful but dependent on individual samples. Gated functions are therefore needed to control message transmission, whose on-or-offs are controlled by extra visual evidence from the input sample. The effectiveness of GBD-Net is shown through experiments on three object detection datasets, ImageNet, Pascal VOC2007 and Microsoft COCO. This paper also shows the details of our approach in wining the ImageNet object detection challenge of 2016, with source code provided on <>.


page 1

page 12

page 13

page 14

page 15


Learning Object Detectors from Scratch with Gated Recurrent Feature Pyramids

In this paper, we propose gated recurrent feature pyramid for the proble...

Structure Inference Net: Object Detection Using Scene-Level Context and Instance-Level Relationships

Context is important for accurate visual recognition. In this work we pr...

Effective Fusion Factor in FPN for Tiny Object Detection

FPN-based detectors have made significant progress in general object det...

Object Detection with Pixel Intensity Comparisons Organized in Decision Trees

We describe a method for visual object detection based on an ensemble of...

DetCo: Unsupervised Contrastive Learning for Object Detection

Unsupervised contrastive learning achieves great success in learning ima...

Zoom-Net: Mining Deep Feature Interactions for Visual Relationship Recognition

Recognizing visual relationships <subject-predicate-object> among any pa...

I Introduction

Object detection is one of the fundamental vision problems. It provides basic information for semantic understanding of images and videos. Therefore, it has attracted a lot of attentions. Detection is regarded as a problem of classifying candidate boxes. Due to large variations in viewpoints, poses, occlusions, lighting conditions and background, object detection is challenging. Recently, since the seminal work in [1], convolutional neural networks (CNNs) [2, 3, 4, 5, 6] have been proved to be effective for object detection because of its power in learning features.

In object detection, a candidate box is counted as true-positive for an object category if the intersection-over-union (IoU) between the candidate box and the ground-truth box is greater than a threshold. When a candidate box covers only a part of the./ ground-truth regions, there are some potential problems.

  • Visual cues in this candidate box may not be sufficient to distinguish object categories. Take the candidate boxes in Fig. 1(a) for example, they cover parts of animal bodies and have similar visual cues, but with different ground-truth class labels. It is hard to distinguish their class labels without information from larger surrounding regions of the candidate boxes.

  • Classification on the candidate boxes depends on how much an object is occluded, which has to be inferred from larger surrounding regions. Because of occlusion, the candidate box covering a rabbit head in Fig. 1(b1) should be considered as a true positive of rabbit, because of large IoU with the ground truth. Without occlusion, however, the candidate box covering a rabbit head in Fig. 1(b2) should not be considered as a true positive because of small IoU with the ground truth.

To handle these problems, contextual regions surrounding candidate boxes are naturally helpful. Besides, surrounding regions also provide contextual information about background and other nearby objects to help detection. Therefore, in our deep model design and some existing works [7], information from surrounding regions are used to improve classification of a candidate box.

Fig. 1: The necessity of passing messages among features from supporting regions of different resolutions, and controlling message passing according different image instances. Blue windows indicate the ground truth bounding boxes. Red windows are candidate boxes. It is hard to classify candidate boxes which cover parts of objects because of similar local visual cues in (a) and ignorance of the occlusion in (b). Local details of rabbit ears are useful for recognizing the rabbit head in (c). The contextual human head helps to find that the rabbit ear worn on human head should not be used to validate the existence of the rabbit head in (d). Best viewed in color.

On the other hand, when CNN takes a large region as input, it sacrifices the ability in describing local details, which are sometimes critical in discriminating object classes, since CNN encodes input to a fixed-length feature vector. For example, the sizes and shapes of ears are critical details in discriminating rabbits from hamsters. But they may not be identified when they are in a very small part of the CNN input. It is desirable to have a network structure that takes both surrounding regions and local part regions into consideration. Besides, it is well-known that features from different resolutions are complementary


One of our motivations is that features from different resolutions and support regions validate the existence of one another. For example, the existence of rabbit ears in a local region helps to strengthen the existence of a rabbit head, while the existence of the upper body of a rabbit in a larger contextual region also helps to validate the existence of a rabbit head. Therefore, we propose that features with different resolutions and support regions should pass messages to each other in multiple layers in order to validate their existences jointly during both feature learning and feature extraction. This is different from the naive way of learning a separate CNN for each support region and concatenating feature vectors or scores from different support regions for classification.

Our further motivation is that care should be taken when passing messages among contextual and local regions. The messages are not always useful. Taking Fig. 1(c) as an example, the local details of the rabbit ear is helpful in recognizing the rabbit head, and therefore, its existence has a large weight in determining the existence of the rabbit head. However, when this rabbit ear is artificial and worn on a girl’s head in Fig. 1(d), it should not be used as the evidence to support the existence of a rabbit head. Extra information is needed to determine whether the message of a contextual visual pattern, e.g. rabbit ear, should be transmitted to support the existence of a target visual pattern, e.g. rabbit head. In Fig. 1(d), for example, the extra human-face visual cues indicates that the message of the rabbit ear should not be transmitted to strengthen the evidence of seeing the rabbit head. Taking this observation into account, we design a network that uses extra information from the input image region to adaptively control message transmission.

In this paper, we propose a gated bi-directional CNN (GBD-Net) architecture that adaptively models interactions of contextual and local visual cues during feature learning and feature extraction. Our contributions are in three-fold.

  • A bi-directional network structure is proposed to pass messages among features from multiple support regions of different resolutions. With this design, local patterns pass detailed visual messages to larger patterns and large patterns passes contextual visual messages in both directions. Therefore, local and contextual features cooperate with each other on improving detection accuracy. We implement message passing by convolution.

  • We propose to control message passing with gate functions. With such gate functions, message from a found pattern is transmitted only when it is useful for some samples, but is blocked for others.

  • A new deep learning pipeline for object detection. It effectively integrates region proposal, feature representation learning, context modeling, and model averaging into the detection system. Detailed component-wise analysis is provided through extensive experimental evaluation. This paper also investigates the influence of CNN structures for the large-scale object detection task under the same setting. The details of our submission to the ImageNet Object Detection Challenge is provided in this paper, with source code provided online.

The proposed GBD-Net is implemented under the fast RCNN detection frameworks [8]. The effectiveness is validated through the experiments on three datasets, ImageNet [9], PASCAL VOC2007 [10] and Microsoft COCO [11].

Ii Related work

Impressive improvements have been achieved on object detection in recent years. They mainly come from better region proposals, detection pipeline, feature learning algorithms and CNN structures, iterative bounding box regression and making better use of local and contextual visual cues.

Region proposal. Selective search [12] obtained region proposals by hierarchically grouping segmentation results. Edgeboxes [13] evaluated the number of contours enclosed by a bounding box to indicate the likelihood of an object. Faster RCNN [14] and CRAFT [15] obtained region proposals with the help of convolutional neural networks. Pont-Tuest and Van Gool [16] studied the statistical difference between the Pascal-VOC dataset [10] to Microsoft CoCo dataset [11] to obtain better object proposals. Region proposal can be considered as a cascade of classifiers. At the first stage, millions of windows that are highly confident of being background are removed by region proposal methods and the remaining hundreds or southands are then used for classification. In this paper, we adopt an improved version of the CRAFT in providing the region proposals.

Iterative regression. Since the candidate regions are not very accurate in locating objects, multi-region CNN [17], LocNet [18] and AttractioNet [19] are proposed for more accurate localization of the objects. These approaches conduct bounding box regression iteratively so that the candidate regions gradually move towards the ground truth object.

Object detection pipeline. The state-of-the-art deep learning based object detection pipeline RCNN [1] extracted CNN features from the warped image regions and applied a linear SVM as the classifier. By pre-training on the ImageNet classification dataset, it achieved great improvement in detection accuracy compared with previous sliding-window approaches that used handcrafted features on PASCAL-VOC and the large-scale ImageNet object detection dataset. In order to obtain a higher speed, Fast RCNN [8] shared the computational cost among candidate boxes in the same image and proposed a novel roi-pooling operation to extract feature vectors for each region proposal. Faster RCNN [14] combined the region proposal step with the region classification step by sharing the same convolution layers for both tasks. Region proposal is not necessary. Some recent approaches, e.g. Deep MultiBox [20], YOLO [21] and SSD [22]

, directly estimate the object classes from predefined sliding windows.

Learning and design of CNN. A large number of works [3, 4, 5, 6, 23, 24] aimed at designing network structures and they are shown to be effective in the detection task. The works in [3, 4, 5, 6, 24] proposed deeper networks. People [25, 5, 26] also investigated how to effectively train deep networks. Simonyan et al. [5] learn deeper networks based on the parameters in shallow networks. Ioffe et al. [25] normalized each layer inputs for each training mini-batch in order to avoid internal covariate shift. He et al. [26]

investigated parameter initialization approaches and proposed parameterized RELU. Li

et al. [27] proposed multi-bias non-linear activation (MBA) layer to explore the information hidden in the magnitudes of responses.

Our contributions focus on a novel bi-directional network structure to effectively make use of multi-scale and multi-context regions. Our design is complementary to above region proposals, pipelines, CNN layer designs, and training approaches. There are many works on using visual cues from object parts [28, 17, 29] and contextual information [28, 17]. Gidaris et al. [17] adopted a multi-region CNN model and manually selected multiple image regions. Girshick et al. [29] and Ouyang et al. [28] learned the deformable parts from CNNs. In order to use the contextual information, multiple image regions surrounding the candidate box were cropped in [17] and whole-image classification scores were used in [28]. These works simply concatenated features or scores from object parts or context while we pass message among features representing local and contextual visual patterns so that they validate the existence of each other by non-linear relationship learning. Experimental results show that GBD-Net is complementary to the approaches in [17, 28]. As a step further, we propose to use gate functions for controlling message passing, which was not investigated in existing works.

Passing messages and gate functions.

Message passing at the feature level was studied in Recurrent neural network (RNN) and gate functions are used to control message passing in long short-term memory (LSTM) networks. However, both techniques have not been used to investigate feature extraction from multi-resolution and multi-context regions yet, which is fundamental in object detection. Our message passing mechanism and gate functions are specifically designed for this problem setting. GBD-Net is also different from RCNN and LSTM in the sense that it does not share parameters across resolutions/contexts.

Iii Gated Bi-directional CNN

We briefly introduce the fast RCNN pipeline in Section III-A and then provide an overview of our approach in Section III-B. Our use of roi-pooling is discussed in SectionIII-C. SectionIII-D focuses on the proposed bi-directional network structure and its gate function. Section III-E introduces the modified GBD structure. SectionIII-F explains the details of the training scheme.

Iii-a Fast RCNN pipeline

We adopt the Fast RCNN[8] as the object detection pipeline with four steps.

  • Step 1) Candidate box generation. Thousands or hundreds of candidate boxes are selected from a large pool of boxes.

  • Step 2) Feature map generation. Given an input as the input of CNN, feature maps are generated.

  • Step 3) Roi-pooling. Each candidate box is considered as a region-of-interest (roi) and a pooling function is operated on the CNN feature maps generated in the step 2. After roi-pooling, candidate boxes of different sizes are pooled to have the same feature vector size.

  • Step 4) Classification. CNN features after roi-pooling go through several convolutions, pooling and fully connected layers to predict the class label and location refinement of candidate boxes.

Iii-B Framework overview

Fig. 2: Overview of our framework. The network takes an image as input and produces feature maps. The roi-pooling is done on feature maps to obtain features with different resolutions and support regions, denoted by and . Red arrows denote our gated bi-directional structure for passing messages among features. Gate functions are defined for controlling the message passing rate. Then all features for go through multiple CNN layers with shared parameters to obtain the final features that are used to predict the class . Parameters on black arrows are shared across branches, while parameters on red arrows are not shared. Best viewed in color.

An overview of the GBD-Net is shown in Fig. 2. Based on the fast RCNN pipeline, our proposed model takes an image as input, uses roi-pooling operations to obtain features with different resolutions and different support regions for each candidate box, and then the gated bi-direction layer is used for passing messages among features, and final classification is made. We use the BN-net [25] as the baseline network structure, i.e. if only one support region and one branch is considered, Fig. 2 becomes a BN-net. Currently, messages are passed between features in one layer. It can be extended by adding more layers between the roi-pooled feature and refined feature for passing messages in these layers.

We use the same candidate box generation and feature map generation steps as the fast RCNN introduced in Section III-A. In order to take advantage of complementary visual cues in the surrounding/inner regions, the major modifications of fast RCNN are as follows.

  • In the roi-pooling step, regions with the same center location but different sizes are pooled from the same feature maps for a single candidate box. The regions with different sizes before roi-pooling have the same size after roi-pooling. In this way, the pooled features corresponds to different support regions and have different resolutions.

  • Features with different resolutions optionally go through several CNN layers to extract their high-level features.

  • The bi-directional structure is designed to pass messages among the roi-pooled features with different resolutions and support regions. In this way, features corresponding to different resolutions and support regions verify each other by passing messages to each other.

  • Gate functions are used to control message transmission.

  • After message passing, the features for different resolutions and support regions are then passed through several CNN layers for classification.

An exemplar implementation of our model is shown in Fig. 3

. There are 9 inception modules in the BN-net

[25]. Roi-pooling of multiple resolutions and support regions is conducted after the 6th inception module, which is inception (4d). Then the gated bi-directional network is used for passing messages among features and outputs , , , and . After message passing, , , and go through the 7th, 8th, 9th inception modules and the average pooling layers separately and then used for classification. There is option to place roi-pooling and GBD-Net after different layers of the BN-net. In Fig. 3, they are placed after inception (4e). In the experiment, we also tried to place them after the input image.

Fig. 3: Exemplar implementation of our model. The gated bi-directional network, dedicated as GBD-Net, is placed between Inception (4d) and Inception (4e). Inception (4e),(5a) and (5b) are shared among all branches.

Iii-C Roi-pooling of features with different resolutions and support regions

We use the roi-pooling layer designed in [8] to obtain features with different resolutions and support regions. Given a candidate box with center location , width and height

, its padded bounding box is denoted by

. is obtained by enlarging the original box along both and directions with scale as follows:


In RCNN [1], is 0.2 by default and the input to CNN is obtained by warping all the pixels in the enlarged bounding box to a fixed size , where for the BN-net [25]. In fast RCNN [8], warping is done on feature maps instead of pixels. For a box , its corresponding feature box

on the feature maps is calculated and roi-pooling uses max pooling to convert the features in

to feature maps with a fixed size.

Fig. 4: Illustration of using roi-pooling to obtain CNN features with different resolutions and support regions. The red rectangle in the left image is a candidate box. The right four image patches show the supporting regions for . Best viewed in color.

In our implementation, a set of padded bounding boxes with different are generated for each candidate box . By roi-pooling on the CNN features, these boxes are warped into the same size, which is for BN-net. The CNN features of these padded boxes have different resolutions and support regions. In the roi-pooling step, regions corresponding to and are warped into features and respectively. Figure 4 illustrates this procedure.

Since features and after roi-pooling are of the same size, the context scale value determines both the amount of padded context and also the resolution of the features. A larger value means a lower resolution for the original box but more contextual information around the original box, while a small means a higher resolution for the original box but less context.

Iii-D Gated Bi-directional network structure (GBD-v1)

Iii-D1 Bi-direction structure

Figure 5 shows the architecture of our proposed bi-directional network. It takes features and as input and outputs features , , and for a single candidate box. In order to have features with different resolutions and support regions cooperate with each other, this new structure builds two directional connections among them. One directional connection starts from features with the smallest region size and ends at features with the largest region size. The other is the opposite.

Fig. 5: Details of our bi-directional structure. denotes convolution. The input of this structure is the features of multiple resolutions and contextual regions. Then bi-directional connections among these features are used for passing messages across resolutions/contexts. The output are updated features for different resolutions/contexts after message passing.

For a single candidate box , representing features with context pad value . The forward propagation for the proposed bi-directional structure can be summarized as follows:

  • There are four different resolutions/contexts, .

  • represents the updated features after receiving message from with a higher resolution and a smaller support region. It is assumed that , since has the smallest support region and receives no message.

  • represents the updated features after receiving message from with a lower resolution and a larger support region. It is assumed that , since has the largest support region and receives no message.

  • concatenates CNN features maps along the channel direction.

  • The features and after message passing are integrated into using the convolutional filters .

  • represents the convolution operation. The biases and filters of convolutional layers are respectively denoted by and .

  • Element-wise RELU is used as the non-linear function .

From the equations above, the features in receive the messages from the high-resolution/small-context features and the features receive messages from the low-resolution/large-context features. Then collects messages from both directions to have a better representation of the th resolution/context. For example, the visual pattern of a rabbit ear is obtained from features with a higher resolution and a smaller support region, and its existence (high responses in these features) can be used for validating the existence of a rabbit head, which corresponds to features with a lower resolution and a larger support region. This corresponds to message passing from high resolution to low resolution in (2). Similarly, the existence of the rabbit head at the low resolution also helps to validate the existence of the rabbit ear at the high resolution by using (3). and are learned to control how strong the existence of a feature with one resolution/context influences the existence of a feature with another resolution/context. Even after bi-directional message passing, are complementary and will be jointly used for classification in later layers.

Our bi-directional structure is different from the bi-direction recurrent neural network (RNN). RNN aims to capture dynamic temporal/spatial behavior with a directed cycle. It is assumed that parameters are shared among directed connections. Since our inputs differ in both resolutions and contextual regions, convolutions layers connecting them should learn different relationships at different resolution/context levels. Therefore, the convolutional parameters for message passing are not shared in our bi-directional structure.

Iii-D2 Gate functions for message passing

Instead of passing messages in the same way for all the candidate boxes, gate functions are introduced to adapt message passing for individual candidate boxes. Gate functions are also implemented as convolution. The design of gate filters considers the following aspects.

  • has multiple feature channels. A different gate filter is learned for each channel.

  • The message passing rates should be controlled by the responses to particular visual patterns which are captured by gate filters.

  • The message passing rates can be determined by visual cues from nearby regions, e.g. in Fig. 1, a girl’s face indicates that the rabbit ear is artificial and should not pass message to the rabbit head. Therefore, the size of gate filters should not be and is used in our implementation.

Fig. 6: Illustration of the bi-directional structure with gate functions. The represents the convolution and the switch button represents the gate function.

We design gate functions as convolution layers with the sigmoid non-linearity to make the message passing rate in the range of (0,1). With gate functions, message passing in (2) and (3) for the bi-directional structure is changed:



is the element-wise sigmoid function and

denotes element-wise product. is the gate function to control message passing. It contains learnable convolutional parameters and uses features from the co-located regions to determine the rates of message passing. When is 0, the message is not passed. The formulation for obtaining is unchanged. Fig. 6 illustrates the bi-directional structure with gate functions.

Iii-E The modified GBD structure (GBD-v2)

For the models submitted to ImageNet challenge, the GBD-v1 is modified. The modified GBD-Net structure has the following formulation:


where and are defined in (7) and (8). Fig. 7 shows the modified GBD structure. The operations requried for obtaining and are the same as before. The main changes are in obtaining . The changes made are as follows.

Fig. 7: Details of our modified bi-directional structure. Compared with the stucture in Fig. 5, an identity mapping layer is added from to . The convolution from to in Fig. 5 is changed into max-pooling.

First, in the previous GBD structure, and are concatenated and then convoled by filters to produce the output . In the modified sturcture, a max pooling is used for merging the information from and . This saves the memory and computation required by the convolution in the previous GBD structure.

Second, we add an identity mapping layer in the struture, which corresoponds to the in (12). The aim of the GBD structure is to refine the input by using the messages from other contextual features. Since the parameters for the layers after the output are from pretrained model, a drastic change of the output from the input would cause difficulty in training the layers after the layer to adapt at the training stage. Therefore, this drastic change would lead to difficulty in learning a good model. When we train the previous GBD structure, careful initialization of the convolution parameters and the gate functions has to be done in order to learn well. For example, we have to set the gate function close 0 and the convolution parameter close to identity mapping for initialization. With the identity mapping layer, however, a simple initialization using the approach in [30] works well.

Third, a constant is multiplied with the merged messages from other contextual regions. We empirically found that it improves detection accuracy by using to control the magnitude of the messages from other contextual features.

Iii-F Implementation details, training scheme, and loss function

For the state-of-the-art fast RCNN object detection framework, CNN is first pre-trained with the ImageNet image classification data, and then utilized as the initial point for fine-tuning the CNN to learn both object confidence scores and bounding-box regression offsets for each candidate box. Our proposed framework also follows this strategy and randomly initialize the filters in the gated bi-direction structure while the other layers are initialized from the pre-trained CNN. The final prediction on classification and bounding box regression is based on the representations in equation (4). For a training sample with class label and ground-truth bounding box offsets

, the loss function of our framework is a summation of the cross-entropy loss for classification and the smoothed

loss for bounding box regression as follows:


where the predicted classification probability for class

is denoted by , and the predicted offset is denoted by , if and otherwise. in our implementation. Parameters in the networks are learned by back-propagation.

Iii-G Discussion

Our GBD-Net builds upon the features of different resolutions and contexts. Its placement is independent of the place of roi-pooling. In an extreme setting, roi-pooling can be directly applied on raw pixels to obtain features of multiple resolutions and contexts, and in the meanwhile GBD-Net can be placed in the last convolution layer for message passing. In this implementation, fast RCNN is reduced to RCNN where multiple regions surrounding a candidate box are cropped from raw pixels instead of feature maps.

Iv The object detection framework on ImageNet 2016

In this section, we describe object detection framework used for our submission to the 2016 ImageNet Detection Challenge.

Iv-a Overview at the testing stage

  • Step 1) Candidate box generation. An improved version of CRAFT in [15] is used for generating the region proposal.

  • Step 2) Box classification. The GBD-Net predicts the class of candidate boxes.

  • Step 3) Average of multiple deep model outputs is used to improve the detection accuracy.

  • Step 4) Postprocessing. The whole-image classification scores are used as contextual scores for refining the detection scores. The bounding box voting scheme in [17] is adopted for adjusting the box locations based on its neigbouring boxes.

Iv-B Candidate box generation

We use two versions of object proposal. In early version of our method, we use the solutions published in [15] which is denoted as Craft-v2. In the final ImageNet submission, we further improve the results and denote it as Craft-v3. A brief review of Craft-v2 and details of Craft-v3 are described as follows.

Iv-B1 Craft-V1 and V2

In Craft [15], the RPN [14] is extended to be a two-stage cascade structure, following the “divide and conquer ” strategy in detection task. In the first stage, the standard RPN is used to generated about 300 proposals for each image, which is similar to the setting in [14]. While in the second stage, a two-category classifier is further used to distinguish objects from background. Specially in the paper, we use a two-category fast RCNN [8]. It provides fewer and better localized object proposals than the standard RPN. Craft-V1, which was used in our preliminary version [31], and Craft-V2 can be found it our early paper [15]. Craft-V1 and Craft-V2 are only different in pre-training. Craft-V1 is pre-trained from 1000-class image classification, Craft-V2 is pre-trained from RPN [14].

Iv-B2 Craft-v3

Compared with Craft-v2, the differences in Craft-v3 includes:

  • Random crop is used in model training, to ensure objects in different scales are roughly trained equally.

  • Multi-scale pyramid is used in model testing, in order to improve recall of small objects.

  • The positive and negative samples in RPN training are balanced to be 1:1.

  • LocNet [18] object proposals are added, which we found are complementary to the Craft based proposals.

Implementation details and experimental comparison can be found it Section V-E1.

Iv-C Box classification with GBD-Net

The GBD-Net is used for predicting the object category of the given candidate boxes. The preliminary GBD-Net structure in [31] was based on the BN-net. In the challenge we make the following modifications:

  • The baseline network is pretrained on ImageNet 1000-class data with object-centric labels without adapting to fas RCNN. In the challenge, we learn the baseline network with object-centric labels by adapting it to fas RCNN.

  • A ResNet with 269 layers is used as the baseline model for the best performing GBD-Net.

  • The structure of GBD-Net is changed from GBD-v1 to GBD-v2, with details in Section III-E.

Iv-D Pretraining the baseline

Iv-D1 The baseline ResNet-269 model

The network structure of baseline ResNet with 269 layers is shown in Fig. 9. Compared with the ResNet [24] with 152 layers, we simply increase the number of stacked blocks for conv3_x, conv4_x, and conv5_x. The basic blocks adopt the identity mapping used in [32]. At the training stage, the stochastic depth in [33] is used. Stochastic depth is found to reduce training time and test error in [33]. For fast RCNN, we place the roi-pooling after the 234th layer, which is in the stacked blocks conv4_x.

Iv-D2 Adapt the pretraining for roi-pooling

Pretraining can be done on the ImageNet 1000-class image classification data by taking the whole image as the input of CNN, this is called image-centric pretraining. On the other hand, since bounding box labels are provided for these classes in ImageNet, the input of CNN can be obtained from warping image patches in the bounding boxes, which is called object-centric pretraining. For the RCNN framework, it is found by our previous work [28] that object-centric pretraining performs better than image-centric pretraining. For fast RCNN, however, we found that the CNN with object-centric pretraining does not perform better than the 1000-class image-centric pretraining. Take the BN-net as an exmaple, after finetuning on the ImageNet train+val1 data, the BN-net from the image-centric pretraining has 49.4% mAP on the ImageNet val2 while the BN-net from the object-centric pretraining has 48.4% mAP. This is caused by the following two reasons:

  • Change from constant relative contextual region in RCNN to variant relative contextual region fast RCNN. The receptive field of a neuron refers to the image region that influences the value of a neuron. In RCNN, the a contextual region with 0.2 the size of the bounding box is defined. Image patch within this contextual region is warped into a target size and then used as the input of CNN. Take BN-net for example, this target size is

    . The CNN only takes the visual cues in this contextual region into consideration. The number of pixels for the contextual region changes as the bounding box size changes. When pretraining the network for object-centric classification in [28], we adopted the RCNN scheme. The contextual region size changes as the bounding box changes. For fast RCNN, however, the contextual region size is the same for bounding boxes of different sizes. In this case, the relative contextual region changes as bounding box size changes. Take the BN-net with roi-pooling at inception (4d) for example. Because of the convolution and pooling in multiple layers, a neuron in inception (4d) has receptive field being 379. Therefore, the contextual region with 378 pixels influences the neurons after roi-pooling for bounding box of any size. For a bounding box with size , the contextual region used in the roi-pooled features has 378 pixels. On the other hand, for a bounding box with size , the contextual region used in the roi-pooled features also has 378 pixels. An example is shown in Fig. 8. This is caused by the convolution on the whole image in fast RCNN compared with the convolution on image patch in RCNN. The padded zeros in convolutional layers for the image patch in RCNN are replaced by contextual image region in fast RCNN. Therefore, the object-centric pretraining in [28] for RCNN does not match fast RCNN in terms of relative contextual region.

  • Change from image warping in RCNN to feature warping in fast RCNN. In order to obtain features of the same size for candidate regions of different sizes, RCNN warp the candidate image region. Fast RCNN keeps the image size unchanged and uses roi-pooling for warping features. Warping at image level for RCNN and roi-pooling at feature level are not equivalent operations.

Fig. 8: The number of padded pixels changes as the box size changes for RCNN but is kept the same for fast RCNN.

In order to have the pretrained CNN aware of the differences mentioned above, we pretrain on object-centric task with roi-pooling layer included. Let denote the bounding box of an object. When pretraining the BN-net with the roi-pooling layer, we include 32 pixels as the contextual region for this object. Therefore, the target box is . To augment data, we randomly shake the target box as follows:


where and are respectively the width and height of the bounding box. , , , and are randomly sampled from independently. The image region within the box in (17) is warped into an image with shorter side randomly sampled from and the longer side constrained to be no greater than 597. Batch size is set as 256 with other settings the same as BN-net. We observe 1.5% mAP gain for BN-net and around 1.0% mAP gain for ResNet-101 with this pretraining when compared with pretraining by image-centric classification.

Fig. 9: Architecture for the baseline ResNet-269. Building blocks are the identity mapping blocks used in [32]

, with the numbers of blocks stacked. Downsampling is performed by conv3_1, conv4_1, and conv5_1 with a stride of 2.

Iv-E Technical details on improving performance

Iv-E1 Multi-scale testing

Multi-scale training/testing has been developed in [8, 34] by selecting from a feature pyramid. We only use the multi-scale input at the testing stage. With a trained model, we compute feature maps on an image pyramid, with the shorter side of the image being and longer size being no greater than 1000. Roi-pooling and its subsequent layers are performed on the feature map of one scale. We did not observe obvious improvement by averaging the scores of a bounding box using its features pooled from multiple scales.

Iv-E2 Left-right flip

We adopt left-right flip at both the training stage and testing stage. At the training stage, the training images are augmented by flipping them. The candidate boxes are flipped accordingly. At the testing stage, an image and its corresponding candidate boxes are flipped and treated as the input of the CNN to obtained the detection scores for these boxes. The scores and estimated box locations from the original image and the flipped image are averaged.

Iv-E3 Bounding box voting

The bounding box voting scheme in [17] is adopted. After finding the peaked box with the highest score on its neighborhood, the final object location is obtained by having each of the boxes that overlap with the peaked one by more than a threshold to vote for the bounding box location using its score as weight. This threshold is set as 0.5 for IoU.

Iv-E4 Non-maximum suppression (NMS) threshold

For ImageNet, the NMS threshold was set as 0.3 by default. We empirically found 0.4 to be a better threshold. Setting this threshold from 0.3 to 0.4 provides 0.4-0.7% mAP gain, with variation for different models.

Iv-E5 Global context

From the pretrained image-centric CNN model, we finetune on the ImageNet detection data by treating it as an image classification problem. The 200-class image classification score is then used for combining with the 200-class object detection scores by weighted averaging. The weight are obtained by greedy search from the val1 data.

Iv-E6 Model ensemble

For model ensemble, 6 models are automatically selected by greedy search on ImageNet Det val2 from 10 models. The average of scores and bounding box regression results of these 6 models are used for obtaining the model averaging results.

V Experimental Results

V-a Implementation details

The GBD-net is implemented based on the fast RCNN pipeline. The BN-net will be used for ablation study and our submission to the challenge is based on the ResNet with identity mapping [32] and the model from the team of CU-DeepLink. The gated bi-directional structure is added after the 6th inception module (4d) of BN-net and after the 234th layer for ResNet-269. In the GBD-Net, layers belonging to the baseline networks are initialized by these baseline networks pre-trained on the ImageNet 1000-class classification and localization dataset. The parameters in the GBD layers as shown in Fig. 5, which are not present in the pre-trained models, are randomly initialized when finetuning on the detection task. In our implementation of GBD-Net, the feature maps for in (2)-(4) have the same width, height and number of channels as the input for .

We evaluate our method on three public datasets, ImageNet object detection dataset [9], Pascal VOC 2007 dataset [10] and Microsoft COCO object detection dataset [11]. Since the ImageNet object detection task contains a sufficiently large number of images and object categories to reach a conclusion, evaluations on component analysis of our training method are conducted on this dataset. This dataset has 200 object categories and consists of three subsets. i.e., train, validation and test data. In order to have a fair comparison with other methods, we follow the same setting in [1]

and split the whole validation subset into two subsets, val1 and val2. The network finetuning step uses training samples from train and val1 subsets. The val2 subset is used for evaluating components and the performance on test data is from the results submitted to the ImageNet challenge. Because the input for fast RCNN is an image from which both positive and negative samples are sampled, we discard images with no ground-truth boxes in the val1. Considering that lots of images in the train subset do not annotate all object instances, we reduce the number of images from this subset in the batch. For all networks, the learning rate and weight decay are fixed to 0.0005 during training, the batch size is 192. We use batch-based stochastic gradient descent to learn the network and the batch size is 192. The overhead time at inference due to gated connections is less than 40%.

V-B Overall performance

V-B1 PASCAL VOC2007 dataset

It contains 20 object categories. Following the most commonly used approach in [1], we finetune the BN-net with the 07+12 trainval set and evaluate the performance on the test set. Our GBD-net obtains 77.2% mAP while the baseline BN+FRCN is only 73.1%.

V-B2 Microsoft COCO object detection dataset

We use MCG [35] for region proposal and report both the overall AP and AP on the closed-test data. The baseline BN+FRCN implemented by us obtains 24.4% AP and 39.3% AP, which is comparable with Faster RCNN (24.2% AP) on COCO detection leadboard. With our proposal gated bi-directional structure, the network is improved by 2.6% AP points and reaches 27.0% AP and 45.8% AP, which further proves the effectiveness of our model.

V-B3 ImageNet object detection dataset

We compare our framework with several other state-of-art approaches [1, 6, 25, 28, 36, 24]. The mean average precision for these approaches are shown in Table I. Our work is trained using the provided data of ImageNet. Compared with the published results and recent results in the provided data track on ImageNet 2015 challenge, our single model result performs better than the ResNet [24] by 4.5% in mAP for single-model result.

Table II shows the experimental results for UvA, GoogleNet, ResNet, which are best performing approaches in the ImageNet challenge 2013, 2014 and 2015 respectively. The top-10 approaches attending the challenge 2016 are also shown in Table II. Our approach has the similar mAP as Hikvision in single model and performs better for averaged model. Among the 200 categories, our submission wins 109 categories in detection accuracy.

appraoch RCNN Berkeley GoogleNet DeepID- Superpixel ResNet Ours
[1] [1] [6] Net[28] [36] [24]
val2(sgl) 31.0 33.4 38. 5 48.2 42.8 60.5 65
val2(avg) n/a n/a 40.9 50.7 45.4 63.6 68
TABLE I: Object detection mAP (%) on ImageNet val2 for state-of-the-art approaches with single model (sgl) and averaged model (avg).
Year 2013 2014 2015 2016 2016 2016 2016 2016 2016 2016 2016 2016 2016
Team UvA GoogleNet ResNet VB Faceall MIL_UT KAIST-SLSP CIL 360+MCG Trimps NUIST Hikvision Ours
val2 (sgl) - 38.8 60.5 - 49.3 - - - - - - 65.1 65
val2 (avg) - 44.5 63.6 - 52.3 - - - - - - 67 68
Test (avg) - 38 62.1 48.1 48.9 53.2 53.5 55.4 61.6 61.8 60.9 65.2 66.3
Test (sgl) 22.6 43.9 58.8 - 46.1 - - - 59.1 58.1 - 63.4 63.4
TABLE II: Object detection mAP (%) on ImageNet for the approaches attending the ImageNet challenge with single model (sgl) and averaged model (avg) when tested on the val2 data and Test data without using external data for training.

V-C Investigation on different settings in GBD-v1

V-C1 Investigation on placing roi-pooling at different layers

The placement of roi-pooling is independent of the placement of the GBD-Net. Experimental results on placing the roi-pooling after the image pixels and after the 6th inception module are reported in this section. If the roi-pooling is placed after the 6th inception module (4d) for generating features of multiple resolutions, the model is faster in both training and testing stages. If the roi-pooling is placed after the image pixels for generating features of multiple resolutions, the model is slower because the computation in CNN layers up to the 6th inception module cannot be shared. Compared with the GBD-Net placing roi-pooling after the 6th inception module with mAP 48.9%, the GBD-Net placing the roi-pooling after the pixel values with mAP 51.4% has better detection accuracy. This is because the features for GBD-Net are more diverse and more complementary to each other when roi-pooling is placed after pixel values.

V-C2 Investigation on gate functions

Gate functions are introduced to control message passing for individual candidate boxes. Without gate functions, it is hard to train the network with message passing layers in our implementation. It is because nonlinearity increases significantly by message passing layers and gradients explode or vanish, just like it is hard to train RNN without LSTM (gating). In order to verify it, we tried different initializations. The network with message passing layers but without gate functions has 42.3% mAP if those message passing layers are randomly initialized. However, if those layers are initialized from a well-trained GBD-net, the network without gate functions reaches 48.2% mAP. Both two results also show the effectiveness of gate functions.

V-C3 Investigation on using different feature region sizes

Padding value Single resolution Multiple resolutions
-0.2 0.2 0.8 1.7 -0.2,0.2 0.2+1.7 -0.2+0.2+1.7 -0.2+0.2+0.8+1.7
mAP 46.3 46.3 46.0 45.2 47.4 47.0 48.0 48.9
TABLE III: Detection mAP (%) for features with different padding values for GBD-Net-v1 using BN-net as the baseline. Craft-V1 is used for region proposal. Different s leads to different resolutions and contexts.

The goal of our proposed gated bi-directional structure is to pass messages among features with different resolutions and contexts. In order to investigate the influence from different settings of resolutions and contexts, we conduct a series of experiments. In these experiments, features of a particular padding value is added one by one.The experimental results for these settings are shown in Table III. When single padding value is used, it can be seen that simply enlarging the support region of CNN by increasing the padding value from 0.2 to 1.7 does harm to detection performance because it loses resolution and is influenced by background clutter. On the other hand, integrating features with multiple resolutions and contexts using our GBD-Net substantially improves the detection performance as the number of resolutions/contexts increases. Therefore, with the GBD-Net, features with different resolutions and contexts help to validate the existence of each other in learning features and improve detection accuracy.

V-C4 Investigation on combination with multi-region

This section investigates experimental results when combing our gated bi-directional structure with the multi-region approach. We adopt the simple straightforward method and average the detection scores of the two approaches. The baseline BN model has mAP 46.3%. With our GBD-Net the mAP is 48.9%. The multi-region approach based on BN-net has mAP 47.3%. The performance of combining our GBD-Net with mutli-region BN is 51.2%, which has 2.3% mAP improvement compared with the GBD-Net and 3.9% mAP improvement compared with the multi-region BN-net. This experiment shows that the improvement brought by our GBD-Net is complementary to the multi-region approach in [17].

V-D Investigation on GBD and GBD-v2

This section investigates the experimental results for the GBD in Section III-D and the GBD-v2 introduced in Section III-E. For the same BN-net, the GBD-v1 introduced in Section III improves the BN-net by 2.6% in mAP. The GBD-v2 structure introduced in Section III-E improves mAP by 3.7%. Therefore, the GBD-v2 is better in improving the detection accuracy. Since GBD-v2 has better performance and is easier to train, we use the GBD-v2 as the default GBD structure in the following part of this paper if not specified. Since the components investigated in Section V-C are not different for GBD-v1 and GBD-v2, we directly adopt the settings found to be effective in GBD-v1 for GBD-v2. In GBD-v2, roi-pooling is placed at the module (4d) for BN-net and the 234th layer for ResNet-269. Gate function is used. We use feature regions with padding values -0.2, 0.2, 0.8, 1.7.

V-E Investigation on other components in the detection framework

In the component-wise study, none of the techniques in Section IV-E is included if not specified. We adopt the left-right flip at the the training stage for data augmentation for all of the evaluated approaches but did not use flip at the testing stage if not specified.

V-E1 Region proposal

We list the improvements on top of our early work Craft-v2 [15] in Table IV. Random crop in training and multi-scale testing also helps and they leads to 0.74% and 1.1% gain in recall, respectively. In multi-scale training, we want to keep the distribution of image size after log operation is uniform. To this end, in each iteration, for each image, we randomly select a scale number in range of and randomly select an object in this image with the length . Then the resize scale is set to be . This multi-scale training improves recall by 0.7%.

In the testing stage, we densely resize the longer side of each image to and found that it is necessary to achieve high enough recall for objects range in pixels for longer side.

To balance the positive and negative samples, we implement a new multi-GPU implementation, where 50% of the GPUs only train positive samples while the other 50% GPUs only train the negative ones. Balancing the positive and negative samples to in training leads to 0.6% gain in recall.

We use 150 proposals for each image generated by the Craft framework. We combine two methods to get 300 proposals for each image and named it as Craft-v3. For the Craft-v3, the recall on ImageNet val2 is 95.30%, and the average recall 111please refer more details of the proposal average recall to [37]. is 1.59.

Use the same BN-net as the baseline on ImageNet val2, Craft-V1, V2 and V3 have mAP 46.3, 48.4, and 49.4 respectively. Compared to the Craft-v2 on ImageNet val2, the Craft-v3 leads to 1.9% gain in final detection AP for ResNet-269+GBD-Net.

Components. baseline (Craft-v2) [15] +Random Crop training +Multi-scale testing +Balancing positive and negative samples +ensemble
Recall @ 150 proposals 92.37% 93.11% 94.21% 94.81%
Recall @ 300 proposals 95.30%
TABLE IV: Recall rate on ImageNet val2 with different components in proposal generation.

V-E2 Pretraining scheme

There are three pretraining schemes evaluated in the experimental results shown in Table V. The BN-net is used as the network for evaluation. The pretraining on the 1000-class image-centric classification task without using the box annotation of these objects, which is denoted by image in Table V. The pretraining on the 1000-class object-centric classification task using the box annotations without including the roi-pooling at the pretraining stage, which is denoted by object w/o roi in Table V. The pretraining for the 1000-class object-centric classification task with the box annotations and with the roi-pooling included at the pretraining stage, which is denoted by object+roi in Table V. Without using the roi-pooling at the pretraining stage, the object-centric pretraining performs worse than image-centric pretraining. The inclusion of roi-pooling at the pretraining stage improves the effectiveness of object centric pretraining for finetuning in object detection, with 1.5% increase in absolute mAP.

Pretraining scheme Image Object w/o roi Object+roi
Region proposal Craft-V2 Craft-V2 Craft-V2
mAP 49.1 48.4 49.9
TABLE V: Object detection mAP (%) on ImageNet val2 for BN-net using different pretraining schemes.

V-E3 The GBD structure

We evaluate the GBD structure for different baseline models. Fig. VI shows the experimental results for different baseline networks with the GBD structure. The GBD structure introduced in Section III-E improves the BN-net by 3.7% in mAP for Craft-V2 and by 4.2% in mAP for Craft-V3. With GBD and the better region proposal, BN-net+GBD with mAP 53.6% is close to ResNet-152 with mAP 54% in detection accuracy. The modified GBD structure improves the mAP by 2.5% and 2.2% for ResNet-152 and ResNet-269 respectively.

Baseline network BN-net BN-net ResNet-152 ResNet-269
Region proposal Craft-V2 Craft-V3 Craft-V2 Craft-V2
Pretrain Object w/o roi Object w/o roi Image Image
Without GBD 48.4 49.4 54 56.6
+ new GBD 52.1 53.6 56.5 58.8
TABLE VI: Object detection mAP (%) on ImageNet val2 for different baseline networks with the GBD-v2.The + new GBD denotes the use of the modified GBD structure in Fig. 7 and introduced in Section III-E.

It is mentioned in Section III-E the magnitude of the messages from other contextual features influences the detection accuracy. Table VII shows the experimental results for messages with different magnitudes. In the experiments, the BN-net pretrained with bounding box label without roi-pooling is used as the baseline model. It can be seen that the scalar has the best performance when it is 0.1. Setting to be 1, i.e. not scaling messages, results in 1.6% mAP drop.

Network config. =0 ( without GBD)
Pretrain Object w/o roi Object w/o roi Object w/o roi Object w/o roi Object w/o roi
Region proposal Craft-V3 Craft-V3 Craft-V3 Craft-V3 Craft-V3
mAP on val2 52 53.2 53.3 53.6 49.4
TABLE VII: Object detection mAP (%) on ImageNet val2 for BN-net using GBD structure with different scale factor in controlling the magnitude of message.

V-E4 Baseline deep models

In this section, we evaluate the influence of baseline deep models for the detection accuray on the ImageNet. Table VIII shows the experimental results for different baseline network structures. All models evaluated are pretrained from ImageNet 1000-class training data without using the bounding box label. None of the model uses the stochastic depth [33] at the finetuning stage. If stochastic depth is included, it is only used at the pretraining stage. From the results in VIII, it can be seen that ResNet-101 with identity mapping [32] and stochastic depth has 1.1% mAP improvement compared with the ResNet-101 without them. Because of time limit and the evidence in ResNet-101, we have used the stochastic depth and identity mapping for the ResNet-269 baseline model.

Net structure BN-net ResNet-101 ResNet-101+I+S ResNet-152 ResNet-269+I+S Inception-V5 CU-DeepLink
[25] [24] [32, 33] [24] [38]
Pretraining scheme Image Image Image Image Image Image Image
Region proposal Craft-V2 Craft-V2 Craft-V2 Craft-V2 Craft-V2 Craft-V2 Craft-V3
Mean AP 49.9 52.7 53.8 54 56.6 53.3 57.2
TABLE VIII: Object detection mAP (%) on ImageNet val2 for different baseline deep models. All models are pretrained from ImageNet 1000-class classification data without using the bounding box label. None of the approaches introduced in Section IV-E are used. ‘+I’ denotes the use of identity mapping [32]. ‘+S’ denotes the use of stochastic depth [33].

V-E5 Model ensemble

For model ensemble, we have used six models and the averge of their scores are used as the result for model ensemble. As shown in Table IX, these models vary in baseline model, pretraining scheme, use of GBD or not and region proposal for training the model. Note that the region proposal for training could be different, but they are tested using the same region proposal. Without context, the averaged model has mAP 66.9%. With global contextual scores, the model has mAP 68%.

Model denotation 1 2 3 4 5 6
Baseline model ResNet-269 ResNet-269 ResNet-269 ResNet-269 CU-DeepLink ResNet-101
Pretraining scheme Object + roi Image Object + roi Image Image Image
Region proposal for training Craft-V3 Craft-V2 Craft-V3 Craft-V2 Craft-V3 Craft-V3
Averaged model 1 1+2 1+2+3 1+2+3+4 1+2+3+4+5 1+2+3+4+5+6
Average mAP 63.5 64.8 65.5 66 66.8 66.9
TABLE IX: Models used in the model ensemble, global contextual scores are not used in the results for these models.

V-E6 Components improving performance

Table X summarizes experimental results for the components that improve the performance. The baseline ResNet-269 has mAP 56.6%. With GBD-net, the mAP is 58.8%. Changing the region proposal from Craft-v2 to Craft-v3 improves the mAP to 60.7%. In the experimental results for the settings above, single-scale testing is used, in which the shorter side of the is constrained to be no greater than 600 and the longer is constrain to be no greater than 700 at the testing and training stage. When the same model is used for multi-scale testing, we set scales to be [400, 500, 600, 700, 800] and the longer side constrain to be no greater than 1000. This multi-scale testing provides 1.3% mAP improvement. Left-right flip provides 0.7 mAP gain. Bounding box voting leads to 1.3 % mAP gain. Changing the NMS threshold from 0.3 to 0.4 leads to 0.4 mAP gain. The use of context provides 1.3% mAP improvement. The final single model result has 65% mAP on the val2 data. Ensemble of six models improves the mAP by 3% and the final result has 68% mAP.

ResNet-269 ResNet-269
Craft-v3 Craft-v3
Multi-scale testing Multi-scale testing
Left-right flip Left-right flip
Box voting Box voting
NMS threshold 0.3 0.3 0.3 0.3 0.3 0.3 0.4 0.4 0.4 NMS threshold
Context Model ensemble
Model ensemble Context
mAP gain - 2.2 1.9 1.3 0.7 1.3 0.4 1.3 3 mAP gain
mAP 56.6 58.8 60.7 62 62.7 63.3 63.7 65 68 mAP
TABLE X: Summary of the components that lead to the final submission.

V-F Analysis of false positive types

Fig. 10 shows the fraction of false positives on ImageNet Val2 that are caused by confusion with background, poor localization and confusion with other objects. It can be seen that, the majority of false positives are from background, which is different from the results in [28] for Pascal VOC, where the majority of false positives are from poor localization. This is possibly from a better region proposal used in our approach.

Fig. 10: Fraction of high-scored false positives on ImageNet Val2 that are due to poor localization (Loc), confusion with other objects (Other), or confusion with background or unlabeled objects (Bg)

Vi Conclusion

In this paper, we propose a gated bi-directional CNN (GBD-Net) for object detection. In this CNN, features of different resolutions and support regions pass messages to each other to validate their existence through the bi-directional structure. And the gate function is used for controlling the message passing rate among these features. Our GBD-Net is a general layer design which can be used for any network architecture and placed after any convolutional layer for utilizing the relationship among features of different resolutions and support regions. The effectiveness of the proposed approach is validated on three object detection datasets, ImageNet, Pascal VOC2007 and Microsoft COCO.

Vii Acknowledgment

This work is supported by SenseTime Group Limited and the General Research Fund sponsored by the Research Grants Council of Hong Kong (Project Nos. CUHK14206114, CUHK14205615, CUHK417011, and CUHK14207814).