{'fraction_non_alphanumeric': 0.03328200131996606, 'fraction_numerical': 0.012099688865143468, 'mean_word_length': 4.745756590827013, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Bridging Category-level and Instance-level Semantic Image Segmentation

We propose an approach to instance-level image segmentation that is built on top of category-level segmentation. Specifically, for each pixel in a semantic category mask, its corresponding instance bounding box is predicted using a deep fully convolutional regression network. Thus it follows a different pipeline to the popular detect-then-segment approaches that first predict instances' bounding boxes, which are the current state-of-the-art in instance segmentation. We show that, by leveraging the strength of our state-of-the-art semantic segmentation models, the proposed method can achieve comparable or even better results to detect-then-segment approaches. We make the following contributions. (i) First, we propose a simple yet effective approach to semantic instance segmentation. (ii) Second, we propose an online bootstrapping method during training, which is critically important for achieving good performance for both semantic category segmentation and instance-level segmentation. (iii) As the performance of semantic category segmentation has a significant impact on the instance-level segmentation, which is the second step of our approach, we train fully convolutional residual networks to achieve the best semantic category segmentation accuracy. On the PASCAL VOC 2012 dataset, we obtain the currently best mean intersection-over-union score of 79.1%. (iv) We also achieve state-of-the-art results for instance-level segmentation.


Introduction
Semantic category-level image segmentation amounts to predicting the category of individual pixels in an image, which has been one of the most active topics in the field of image understanding and computer vision for a long time. Most of the recently proposed approaches to this task are based on deep convolutional networks. Particularly, the fully convolutional network (FCN) [1] is efficient and at the same time has achieved the state-of-the-art performance. By reusing the computed feature maps for an image, FCN avoids redundant re-computation for classifying individual pixels in the image. FCN has become the de facto approach to dense prediction, and many methods have been proposed to further improve this framework, e.g., the DeepLab [2] and the Adelaide-Context model [3]. One key reason for the success of these methods is that they are based on rich features learned from the very large ImageNet [4] dataset, often in the form of a 16-layer VGGNet [5]. However, currently, there exist much improved models for image classification, e.g., the ResNet [6,7].
Semantic instance-level segmentation aims to identify the individual instances of different semantic categories, i.e., simultaneous object detection and segmentation. Instance segmentation is supposed to be only one more step beyond semantic segmentation. However, most recently proposed approaches [8,9,10] to instance segmentation are based on bounding-box detection methods. Generally speaking, these methods follow the pipeline of a typical object detection method, e.g., Fast R-CNN [11], to locate instances of semantic objects with bounding-boxes as the first step, and then predict binary object masks within these boxes via background-foreground segmentation. In spite of the recent fast development of powerful semantic-category segmentation methods, there is little work in the literature towards developing an instance segmentation method on top of, and fully exploiting the power of such methods. One notable work is the proposal-free network (PFN) [12], which for all pixels predicts semantic scores and instance bounding-boxes, as well as category-wise numbers of instances per image, based on which a clustering algorithm is applied for post-processing to locate instances. As pointed out by Uhrig et al. [13], PFN has a complex architecture with many interleaved building blocks, which makes training very complex. More importantly, its performance seemingly depends critically on the correct prediction of instance numbers, which is sometimes infeasible. Especially, in a complex scene usually there are many small instances, and the number of training samples per number of instances can be very small, leading to mistakes in their estimation. Consequently, the available cues for clustering may significantly deviate from the estimated number of instances. This might be one of the reasons why their performance reported in [12] is considerably poorer than most recent results. On the other hand, the concurrent work to ours by Uhrig et al. [13] relies on elaborately designed template matching to detect instances, which is very case-specific. Furthermore, good performance in [13] heavily relies on accurate depth estimation, which only works well for indoor/outdoor scene images. Based on the above considerations, here we attempt to develop a concise and generic yet accurate method of this kind, and show the great potential of the less explored route.
In summary, we highlight the main contributions of this work as follows: • We propose a new approach to instance-level segmentation, in which semantic score maps are transformed into Hough-like maps. We can easily detect the instances of different semantic objects from these transformed maps. • We propose an online bootstrapping method for training, and show that it is critically important in achieving the best performance both for semantic and instance segmentation. • We extensively evaluate different variations of a fully convolutional residual network (FCRN) so as to find the best configuration, including the number of layers, the resolution of feature maps, and the size of field-of-view. • We introduce dropout regularization to some of the residual blocks in an FCRN, replace the top-most linear classifier with a multi-layer non-linear one, and adopt the multi-view testing technique, by which we further improve the performance. Our method achieves the currently best results on the PASCAL VOC 2012 dataset in terms of semantic segmentation. Our mean intersection-over-union score reaches 79.1% even though we use only the augmented PASCAL VOC training data, which is a new record 2 . • We achieve on par or even better results in terms of instance segmentation on the PASCAL VOC 2012 dataset, compared with the previous best performers. In particular, we significantly improve the mean region average precision at an overlap of 0.7 by 5.1%, from 41.5% to 46.6%. We empirically show that, as the accuracy of semantic segmentation improves, our method has the potential to improve by a remarkable margin.
Related work Next we briefly review the most recent developments within four topics, which are closely related to this paper.
Very deep convolutional networks. The recent boom in deep convolution networks originated when Krizhevsky et al. [14] won the first place in the ILSVRC 2012 competition [4] with the 8-layer AlexNet. In the next year, 'Clarifai' [4] still had the same number of layers. However, in 2014, the VGGNets [5] were composed of up to nineteen layers, while the even deeper 22-layer GoogLeNet [15] won the competition [4]. In 2015, the much deeper ResNets [6] achieved the best performance [4], showing deeper networks indeed learn better features.
The most impressive part was that, by replacing the VGGNets in Fast RCNN [11] with their ResNets, He et al. [6] won in the object detection task with a remarkable margin. This result showed the importance of features in image understanding tasks. The main contribution that enabled them to train such deep networks was that they connected some of the layers with shortcuts. These shortcuts directly passed through the signals, and thus avoid the gradient vanishing effect, which may be a problem for very deep plain networks. In a more recent work, they redesigned their residual blocks to avoid over-fitting, which enabled them to train an even deeper 200-layer residual network. Deep ResNets can be seen as a simplified version of the highway network [16].
Fully convolutional networks for semantic segmentation. Long et al. [1] first proposed the framework of fully convolutional networks for semantic segmentation, which was both effective and efficient. They also enhanced the final feature maps with those from intermediate layers, which enabled their model to make finer predictions. Chen et al. [2] increased the resolution of feature maps by spontaneously removing some of the down-sampling operations and accordingly introducing kernel dilation into their networks. They also found that a classifier composed of small kernels with a large dilation performed as well as a classifier with large kernels, and that reducing the size of field-of-view had an adverse impact on performance. As post-processing, they applied dense CRFs [17] to the network-predicted category-wise score maps for further improvement. Zheng et al. [18] simulated the dense CRFs with an recurrent neural network (RNN), which can be trained end-to-end together with the down-lying convolution layers. Lin et al. [3] jointly trained CRFs with down-lying convolution layers. Thus they were able to capture both 'patch-patch' and 'patch-background' context with CRFs, rather than just pursuing local smoothness as most of the previous methods did.
Bounding-box detection based approaches to instance segmentation. Most of the best performers for instance-level segmentation in the literature can be attributed as bounding-box detection based approaches [8,9,10]. Usually, they were composed of two steps, i.e., first locating objects with bounding-boxes, and second generating masks from these boxes via foreground segmentation. However, our method in this paper is built upon semantic image segmentation. An object is detected as a local maxima on a transformed semantic score map, which has some connections to the generalized Hough transform based approaches to object detection and segmentation [19].
Online bootstrapping for training deep convolutional networks. There are some recent works in the literature exploring sampling methods during training, which are concurrent with ours. Loshchilov and Hutter [20] studied mini-batch selection in terms of image classification. They picked hard training images from the whole training set according to their current losses, which were lazily updated once an image had been forwarded through the network being trained. Shrivastava et al. [21] in a concurrent work to ours selected hard regions-of-interest (RoIs) for object detection. They only computed the feature maps of an image once, and forwarded all RoIs of the image on top of these feature maps. Thus they were able to find the hard RoIs with a small additional computational cost.
The method of [20] is similar to ours in the sense that they both select hard training samples based on the current losses of individual data-points. However, we only search for hard pixels within the current mini-batch, rather than the whole training set. In this sense, the method of [21] is more similar to ours. Nevertheless, to our knowledge, the method here is the first to propose online bootstrapping of hard pixel samples for the problems of instance and semantic image segmentation.

Proposed method
We first introduce the proposed pipeline for instance segmentation, then demonstrate our online bootstrapping approach, which is one of the key components in our high-performance fully convolutional residual networks (FCRNs) for both semantic and instance segmentation, and finally explain how to build up our FCRNs from residual networks.

Proposed pipeline for instance segmentation
The pipeline of our approach is illustrated in Fig. 1. During testing, we obtain the instance segmentation result of an image following the steps shown below.
1) Calculate the category-wise score maps via semantic category segmentation. For clarity, we only depict the score maps corresponding to the 'sheep' category and discard the remaining nineteen object categories in the figure.
2) Calculate the category-wise transform maps via bounding-box regression. Again, only the transform map for the 'sheep' category is depicted.
3) Apply the obtained transform maps to their corresponding scores maps. 4) Search for local maxima on the transformed maps by non-maximal suppression (NMS), and keep the obtained maxima as detected instance hypotheses.  Figure 1: The pipeline of our proposed approach to instance segmentation.

5)
Trace back to all of the suppressed pixels and recover a mask for each instance hypothesis. 6) Generate the final instance segmentation result by region based NMS [8].
We train the two networks separately. The semantic segmentation net is trained with the classic Logistic regression loss, and the localization network is trained with the smoothed 1 loss [11]. Our regression targets include the vertical and horizontal offsets from the current pixel to the bounding-box center of the instance that it belongs to, and also the height and width of that instance. To balance the contributions of instances in different sizes, we re-weight their pixels in the training loss according to their heights and widths. However, we let pixels in the same instance have the same loss weight, since the central and peripheral pixels are of the same importance in order to reconstruct the whole instance.
To combine the outputs of both networks during testing, we start by applying the transform maps to the semantic score maps. Note that we ignore the background and only transform the foreground pixels, e.g., only those labeled as 'sheep' in Fig. 1. To improve the recall rate of instances, we use top-n 'sheep' masks. In other words, we generate n masks per category. The top-n masks are obtained by keeping the pixels whose scores for the 'sheep' category are among their top-n highest scores.
The next step is to find the instances. We need to detect the modes of transformed pixels in the 2D spatial image space. To this end, here we resort to a simple off-the-shelf approach, although more sophisticated clustering methods may lead to improved results. Namely, we apply non-maximum suppression (NMS) to the bounding-boxes previously predicted by our localization net. The pixels with locally high semantic scores will be kept as instance hypotheses. For each of them, we view that pixel and its suppressed pixels as a cluster, and average their semantic scores to compute the confidence of their corresponding instance hypothesis. Note that the above process has some connections with the generalized Hough transform based approaches to object detection and segmentation [19], and that predicting bounding-boxes is not an indispensable component but a trivial implementation of maxima searching in our proposed method. However, in most of the recent methods [8,9,10], bounding-boxes are one of the required inputs for their segmentation components to generate binary masks for individual instances.

Online bootstrapping of hard training pixels
When we train an FCRN, depending on the size of image crops, there may be tens of thousands of labeled pixels to predict per crop. However, sometimes many of them can easily be discriminated from others, especially those lying at the center of a large semantic region. Continuing to learn from these pixels cannot improve our objective. For this reason, we propose an online bootstrapping method, which forces networks to focus on hard (and so more valuable) pixels during training.
We first describe the proposed online bootstrapping in the context of semantic category-level segmentation. Let there be K different categories c j in a label space. For simplicity, suppose that there is only one image crop per mini-batch, and let there be N pixels a i to predict in this crop. Let y i denote the ground-truth label of pixel a i , and p ij denote the predicted probability of pixel a i belonging to category c j . Then, the loss function can be defined as, where t ∈ (0, 1] is a threshold. Here 1{·} equals one when the condition inside the brackets holds, and otherwise equals zero. In other words, we drop pixels when they are too easy for the current model, i.e., their losses are below t. However, in practice, we hope that there should be at least a reasonable number of pixels kept per mini-batch. Otherwise, the computed gradient can become very noisy. Hence, we increase the threshold t accordingly if our current model performs fairly well on a specific mini-batch; and decrease if the model does not work well. The idea to introduce online bootstrapping into our localization network is similar, i.e., to drop those too easy pixels. However, the definition of 'easy' is slightly different. Here, we threshold the intersection-over-union (IoU) scores between ground-truth and predicted bounding-boxes, rather than directly thresholding the regression loss. Our intuition is straightforward. We do not care how accurate the heights, widths or offsets are regressed, but we do care if we can get the correct instances after the following NMS on transformed score maps. Since NMS is based on IoU scores between bounding-boxes, our choice is more natural than thresholding regression losses of the four targets respectively.
Note that this online bootstrapping approach is also capable of automatically balancing biased training data, which is one of the significant and common problems for a pixel labeling task. Usually, there are remarkably more background pixels than object pixels. Sometimes, one category has many more pixels than the others. The mechanism works as follows. As the training process goes on, our model may become overly-learned for those majority categories. Therefore, pixels belonging to these categories will become easy to discriminate, which means that the training losses for these pixels will go down. At the same time, the losses for pixels belonging to minority categories keep unchanged or even go up. At some point, our bootstrapping approach will find them and keep the model learning from them until their losses go down to the same level as the majority category pixels. Similar argument was also presented in a concurrent work to ours by Shrivastava et al. [20].

Fully convolutional residual network
We initialize an FCRN from the version of ResNet in [6]. We replace the linear classification layer with a convolution layer so as to make one prediction per spatial location. Besides, we also remove the 7×7 pooling layer. This layer can enlarge the field-of-view (FoV) [2] of features, which is sometimes useful considering the fact that we human usually tell the category of a pixel by referring to its surrounding context region. However, this pooling layer at the same time smoothes the features. In pixel labeling tasks, features of adjacent pixels should be distinct from each other when they respectively belong to different categories, which may conflict with the pooling layer. Therefore we remove this layer and let the linear convolution layer be on top to deal with the FoV.
Up to now, the feature maps below the added linear convolution layer only has a resolution of 1/32, which is too low to precisely discriminate individual pixels. Long et al. [1] learned extra up-sampling layers for this issue. However, Chen et al. [2] reported that the hole algorithm (or the àtrous algorithm by Mallat [22]) can be more efficient. Intuitively, the hole algorithm can be seen as dilating the convolution kernels before applying them to their input feature maps. With this technique, we can build up a new network generating feature maps of any higher resolution, without changing the weights. When there is a layer with down-sampling, we skip the down-sampling part and increase the dilations of subsequent convolution kernels accordingly. See DeepLab [2] for an explanation.
A sufficiently large FoV was reported to be important by Chen et al. [2]. Intuitively, we need to present context information of a pixel to the top-most classification layer. However, the features at different locations should be discriminative at the same time so that the classifier can tell the differences between adjacent pixels which belong to different categories. Therefore, a natural way is to let the classifier to handle the FoV, which can be achieved by enlarging its kernel size. Unfortunately, the required size can be so large that it can blow up the number of parameters in the classifier. Nevertheless, we can resort to the hole algorithm again. In other words, we use small kernels with large dilations, in order to realize a large FoV.
Following the above three steps, we design our baseline FCRN for semantic category-level segmentation. Although the ResNet has shown its advantages in terms of many tasks due to much richer learned features, we observe that this baseline FCRN is not powerful enough to beat the best algorithm for semantic segmentation [3], which is based on the VGGNet [5]. However, we empirically show that FCRN can achieve the best performance together with our proposed online bootstrapping and a few modifications. We design our localization networks similarly. We do not regress bounding-boxes for background pixels, thus there are only eighty channels in the top-most layer.

Experiments
In this section, we show that our method achieves the state-of-the-art performance both in terms of semantic category-level and instance-level segmentation. We implement our algorithm with the Caffe [23] toolkit throughout all the experiments.

Semantic category-level segmentation results
We first evaluate the semantic category segmentation component in our method, which is derived based on the FCN [1] and the ResNet [6]. We name it as the fully convolutional residual network (FCRN), whose hyper-parameters are carefully evaluated, including the network depth, the resolution of feature maps, the kernel size and dilation of the top-most classifier in the network. For evaluation, we use three popular and challenging datasets, i.e., the PASCAL VOC 2012 [24], the Cityscapes [25], and the PASCAL-Context [26] dataset. We report, 1) the pixel accuracy, which is the percentage of correctly labeled pixels on a whole test set, 2) the mean pixel accuracy, which is the mean of class-wise pixel accuracies, and 3) the mean class-wise intersection-over-union (IoU) scores. Also note that we only show these three scores when it is possible for the individual datasets. For example, we will not show the first two kinds of scores for the test set of PASCAL VOC 2012, since only the mean IoU is available.
PASCAL VOC 2012. This dataset consists of photos taken in human daily life. Besides the background category, there are twenty semantic categories, including bus, car, cat, sofa, monitor, etc. There are 1,464 fully labeled images in the train set and another 1,449 in the val set. Ground-truth labels of the 1,456 images in the test set are not public, but there is an online evaluation server. Following the conventional settings in the literature [1,2], we augment the train set with extra labeled PASCAL VOC images from the semantic boundaries dataset [27]. So, in total there are 10,582 images in the augmented train set.
According to results on the val set in Table 1, we notice the below three points. 1) Increasing the depth from 50 to 101 brings a significant improvement. However, we observe no further improvement when increasing the depth to 152, probably, due to over-fitting. 2) Increasing the resolution of feature maps is beneficial. 3) Increasing the size of field-of-view (FoV) to more than 224 is also helpful. Note that 224 is the setting used in FCNs [1].
The above results suggest using deeper networks, generating high resolution feature maps, and enlarging the FoV of classifiers. This makes sense because we can obtain richer and finer features, and classifiers learn from larger context regions. However, it also makes computational cost heavier and may be limited by the amount of GPU memories. Besides, as for the size of FoV, there is another important factor to consider. Note that all of the images in PASCAL VOC are no larger than 500×500, and we feed a network with original images (without resizing) during testing. Thus, we have to limit the size of FoV below 500 pixels on this dataset. Otherwise, the dilated kernels of a classifier will be larger than the size of feature maps. As a result, the outer part of the kernels must be applied to padded zeros, which may cause adversarial impact. Similarly, if the size of FoV is larger than the size of image crops during training, the outer part of the kernels cannot be properly learned. In Table 1, our largest evaluated size of FoV is 392. No matter what is the depth, networks with this setting always achieve the best performance. To realize such a large FoV, we can either enlarge the kernel size of the classifier or increase the dilation of these kernels. However, this dilation should not be too large, since the feature vector per location can only cover a limited size of area. For example, models with a dilation of eighteen show no advantages over those with a dilation of twelve.
We compare our method with the previous best performers on the test set in the bottom part of Table 2.
Being trained with only the augmented PASCAL VOC data, our model outperforms the previous best performer by 3.8% and wins the first place for 18 out of the 20 object categories. Generally speaking, our method usually loses for those very hard categories, e.g., 'bicycle' and 'chair', for which most of the methods can only achieve scores below 60.0%. Instances of these categories are usually of large diversity and in occluded situations. More importantly, some of them are given with quite elaborated annotations, e.g., a bicycle with carefully labeled skeletons. The above facts suggest that more training data are required for these categories. But unfortunately, this is not the case for this dataset. Some works [18,28,3] pre-trained their models with the Microsoft COCO [29] data, which is composed of about 120k labeled images. In this case, the best previous result is 77.8% [3].
With this setting, we can only observe a rather limited improvement. It seems like that more efforts   should be put in domain adaption from COCO to PASCAL VOC. Here, we leave this problem as one of our future works, and focus on the augmented PASCAL VOC dataset. Nevertheless, even with less training data, our method still beats the previous best performer by 1.3%.
Cityscapes. This dataset consists of street scene images taken using car-carried cameras. There are nineteen semantic categories, including road, car, pedestrian, bicycle, etc. There are 2975 fully labeled images in the train set and another 500 in the val set. Ground-truth labels of images in the test set are not public, but there is an online evaluation server also. All of the images in this dataset are in the same size. They are 1024 pixels high and 2048 pixels wide.
We show results on the val set of Cityscapes in Table 3. Most of the observations on this dataset are consistent with those on PASCAL VOC 2012, as demonstrated previously. Two notable exceptions are as follows. First, the problem of over-fitting seems less severe. One possible reason is that the resolution of images in this dataset are higher than those in PASCAL VOC 2012, so the total number of pixels are actually larger. On the other hand, the diversity of images in this dataset is smaller than those in PASCAL VOC 2012. In this sense, even less training data can cover a larger proportion of possible situations, which can reduce over-fitting. Second, 392 seems still smaller than the optimal size of FoV. Since the original images are in a size of 1024×2048, we can feed a 50-layer network with larger image crops during both training and testing. In this case, a network may prefer even larger FoV. Therefore, to some extent, the ideal size of FoV depends on the size of image crops during training and testing.
Our best model achieves an IoU score of 74.6% on the val set, as shown in Table 7, which is compared with the previously reported best result 68.6% [3].
PASCAL-Context. This dataset is composed of PASCAL VOC 2010 images with extra object and stuff labels, e.g., bag, food, sign, ceiling, ground and snow. Including the background category, in total there are sixty semantic categories. At present, labels on the test set are not released yet. So, we train networks using the 4,998 images in the train set, and evaluate them using the 5,105 images in  the val set. For this dataset, we just evaluate the same model as the one used for PASCAL VOC 2012. Our method outperforms the previous best performers with a clear margin in terms of all the three kinds of scores, as shown in Table 5.

Instance-level segmentation results
We now evaluate the whole framework in terms of instance segmentation on the PASCAL VOC 2012 dataset, following the common protocols used in several recent works [8,9,10]. We use the annotations in SBD [27]. According to the PASCAL VOC 2012 splits, there are 5,623 images in the train set and 5,732 in the val set. Since there is no annotation for the test set, we train models with the train set and evaluate them with the val set. We report two mean region average precisions mAP r 0.5 and mAP r 0.7 , and also the mean volume region average precisions mAP r vol , which were proposed by Hariharan et al. [8].
We show results on the val set of PASCAL VOC 2012 in Table 6. Our method can finally achieve on par or even better performance compared with the previous best performers. Especially, in terms of the mean AP at an overlap of 0.7, our method outperforms the previous best one by 3.1%, which is a significant improvement. By pre-training the semantic segmentation network using the COCO dataset [29], we can further improve the performance by 2.0%. In a pilot experiment, we generate semantic score maps with ground-truth masks, while still compute transform maps with our best localization network. The performance goes up to 73.0% in mAP r 0.5 and 60.6% in mAP r 0.7 , which shows the great potential of our method to benefit from the improvement of semantic category-level segmentation approaches.

Importance of online bootstrapping of hard training pixels
We show the results of two best models for semantic segmentation in Table 7. In both cases, the best setting is to keep the 512 most hardest pixels. Particularly, the proposed bootstrapping improves the mean IoU by 3.1% on Cityscapes, which is a significant margin. The problem of biased data is more severe on this dataset, since there are clearly much more 'sky' and 'road' pixels than 'traffic sign' in a street scene. We also show the category-wise results in Tables 2 and 4. Generally, the proposed bootstrapping can clearly improve the performance for those categories which are less frequent in training data, e.g., 'cow' and 'horse' on PASCAL VOC 2012, 'traffic light' and 'train' on Cityscapes. Similarly, the proposed online bootstrapping also contributes clearly to our localization networks, as shown in Table 6.

Conclusions
In this work, we have built a state-of-the-art fully convolutional residual network for semantic category-level segmentation. On top of this model, we have proposed a new pipeline for instancelevel segmentation, which is intrinsically different from the currently commonly-used bounding-box detection based methods. We have also proposed an online bootstrapping approach, which contributes greatly in both of the above two tasks. Finally, on the PASCAL VOC 2012 dataset, we have achieved the currently best mean IoU score for semantic segmentation, and the state-of-the-art performance for instance-level segmentation.

Image
Truth Prediction Image Truth Prediction Image Truth Prediction