Resources of semantic segmantation based on Deep Learning model
State-of-the-art semantic image segmentation methods are mostly based on training deep convolutional neural networks (CNNs). In this work, we proffer to improve semantic segmentation with the use of contextual information. In particular, we explore `patch-patch' context and `patch-background' context in deep CNNs. We formulate deep structured models by combining CNNs and Conditional Random Fields (CRFs) for learning the patch-patch context between image regions. Specifically, we formulate CNN-based pairwise potential functions to capture semantic correlations between neighboring patches. Efficient piecewise training of the proposed deep structured model is then applied in order to avoid repeated expensive CRF inference during the course of back propagation. For capturing the patch-background context, we show that a network design with traditional multi-scale image inputs and sliding pyramid pooling is very effective for improving performance. We perform comprehensive evaluation of the proposed method. We achieve new state-of-the-art performance on a number of challenging semantic segmentation datasets including NYUDv2, PASCAL-VOC2012, Cityscapes, PASCAL-Context, SUN-RGBD, SIFT-flow, and KITTI datasets. Particularly, we report an intersection-over-union score of 77.8 on the PASCAL-VOC2012 dataset.READ FULL TEXT VIEW PDF
Recent advances in semantic image segmentation have mostly been achieved...
Image segmentation is considered to be one of the critical tasks in
Convolutional Neural Networks (CNNs) have achieved state-of-the-art
This paper proposes a learning-based approach to scene parsing inspired ...
Recently, very deep convolutional neural networks (CNNs) have shown
In this work we address the task of semantic image segmentation with Dee...
In this work we propose a structured prediction technique that combines ...
Resources of semantic segmantation based on Deep Learning model
Semantic image segmentation aims to predict a category label for every image pixel, which is an important yet challenging task for image understanding. Recent approaches have applied convolutional neural network (CNNs) [17, 39, 5] to this pixel-level labeling task and achieved remarkable success. Among these CNN-based methods, fully convolutional neural networks (FCNNs) [39, 5] have become a popular choice, because of their computational efficiency for dense prediction and end-to-end style learning.
Contextual relationships are ubiquitous and provide important cues for scene understanding tasks. Spatial context can be formulated in terms of semantic compatibility relations between one object and its neighboring objects or image patches (stuff), in which a compatibility relation is an indication of the co-occurrence of visual patterns. For example, a car is likely to appear over a road, and a glass is likely to appear over a table. Context can also encode incompatibility relations. For example, a boat is unlikely to appear on a road. These relations also exist at finer scales, for example, in object part-to-part relations, and part-to-object relations. In some cases, contextual information is the most important cue, particularly when a single object shows significant visual ambiguities. A more detailed discussion of the value of spatial context can be found in.
We explore two types of spatial context to improve the segmentation performance: patch-patch context and patch-background context. The patch-patch context is the semantic relation between the visual patterns of two image patches. Likewise, patch-background context the semantic relation between an image patch and a large background region.
Explicitly modeling the patch-patch contextual relations has not been well studied in recent CNN-based segmentation methods. In this work, we propose to explicitly model the contextual relations using conditional random fields (CRFs). We formulate CNN-based pairwise potential functions to capture semantic correlations between neighboring patches. Some recent methods combine CNNs and CRFs for semantic segmentation, e.g., the dense CRFs applied in [5, 48, 60, 8]. The purpose of applying the dense CRFs in these methods is to refine the upsampled low-resolution prediction to sharpen object/region boundaries. These methods consider Potts-model-based pairwise potentials for enforcing local smoothness. There the pairwise potentials are conventional log-linear functions. In contrast, here we learn more general pairwise potentials using CNNs to model the semantic compatibility between image regions. Our CNN pairwise potentials aim to improve the coarse-level prediction rather than merely encouraging local smoothness, and thus have a different purpose compared to Potts-model-based pairwise potentials. Given that these two types of potentials make different effects, they can be combined to improve segmentation results. Fig. 1 illustrates the prediction process of our method.
In contrast to patch-patch context, patch-background context is widely explored in the literature. For CNN-based methods, background information can be effectively captured by combining features from a multi-scale image network input, and has shown good performance in some recent segmentation methods [17, 40]. A special case of capturing patch-background context is considering the whole image as the background region and incorporating the image-level label information into learning. In our approach, to encode rich background information, we construct multi-scale networks and apply sliding pyramid pooling on feature maps. The traditional pyramid pooling (in a sliding manner) on the feature map is able to capture information from background regions of different sizes.
Incorporating general pairwise potentials usually involves computationally expensive inference, which brings challenges for CRF learning. To facilitate efficient learning we apply piecewise training of the CRF  to avoid repeated inference during back propagation training of the deep model.
Thus our main contributions are as follows.
We formulate CNN-based general pairwise potential functions in CRFs to explicitly model patch-patch semantic relations.
We set new state-of-the-art performance on a number of challenging semantic segmentation datasets, including NYUDv2, PASCAL VOC 2012, PASCAL-Context, SIFT-flow, SUN-RGBD, Cityscapes dataset and so on. In particular, we achieve an intersection-over-union score of on the PASCAL VOC 2012 dataset.
Preliminary results of our work appeared in . Exploiting contextual information has been widely studied in the literature (e.g., [46, 26, 11]). For example, early work of “TAS”  models different types of spatial context between Things and Stuff using a generative graphical model.
The most successful recent methods for semantic image segmentation are based on CNNs. CNN based methods have shown outstanding performance compared to traditional semantic segmentation methods like TextonBoost . A number of these CNN-based methods are region-proposal-based methods [19, 24], which first generate region proposals and then assign category labels to each of them. Very recently, FCNNs [39, 5, 8] have become a popular choice for their efficient feature generation and end-to-end training. FCNNs have also been applied to a range of other dense-prediction tasks recently, such as image restoration 
, image super-resolution
and depth estimation[15, 36, 13]. The method that we propose here is also built upon fully convolution-style networks.
FCNN methods make use of the Image-Net trained CNN models (e.g., the VGG-16 model 
) which takes advantages of the large Image-Net dataset for learning deep models. For convolution and pooling layers, the resolution of the output feature map is down-sampled if the convolution/pooling stride is greater than. Usually a few such layers use a stride setting of , hence the direct predictions of FCNNs are typically in low resolution. To increase the prediction resolution, the naive method of directly reducing the strides for all layers is not able to address this down-sampled prediction for a deep network. Small strides result in prohibitively expensive computation for a deep network, and also reduce the view-of-field (the image region that a filter is able to “see”) of the network layers. Network layers with insufficient view-of-field may not be able to capture high-level semantic patterns and thus degrade the performance.
To address this low-resolution prediction issue, a variety of FCNN based methods are proposed very recently which focus on refining the low-resolution prediction to obtain high resolution prediction. DeepLab-CRF  first applies atrous convolution to produce larger size feature maps and performs bilinear upsampling on the prediction score map to the input image size, then they apply the dense CRF method  to refine the object boundary by levering low-level (color contrast) information. They consider Potts-model based pairwise potential functions which enforce local smoothness. CRF-RNN  extends this approach by implementing the mean field CRF inference as recurrent layers for end-to-end learning of the dense CRF and FCNN network. The work in  learns deconvolution layers to upsample the low-resolution predictions. The depth estimation method  explores super-pixel pooling for building the gap between the low-resolution feature map and high-resolution final prediction. Eigen et al.  perform coarse-to-fine learning of multiple networks with different resolution outputs for refining the coarse prediction. The method FCN  and Hyper-column  explore mid-layer features (skip connections) for high-resolution prediction. Unlike these methods, our method focuses on improving the coarse (low-resolution) prediction by learning general CNN pairwise potentials to capture semantic relations between patches. These methods are complementary to our method.
Jointly learning CNNs and CRFs has also been explored in other applications apart from segmentation. Recent work in [36, 37] proposes to jointly learn continuous CRFs and CNNs for depth estimation from single monocular images. They focus on continuously-valued variable prediction, while our method is for discrete categorical label prediction. The work in  combines CRFs and CNNs for human pose estimation. The authors of  explore joint training of Markov random fields and deep neural networks for the tasks of predicting words from noisy images and multi-class classification. They require marginal inference for every gradient calculation which is computationally expensive for training deep models.
We first describe how to build the CRF graph for modeling semantic pairwise relations. Given an image, we first apply a convolutional network to generate a feature map. We refer to this network as ‘FeatMap-Net’, details of which are presented in Sec. 4 (Fig. 6 shows the overall architecture). With this feature map, we construct one node in the CRF graph corresponding to one spatial position of the feature map. Fig. 2 illustrates how we construct nodes and pairwise connections in a CRF graph.
Pairwise connections are constructed by connecting one node to all other nodes which lie within a spatial range box (the dashed box in Fig. 3). We consider different spatial relations by defining different types range boxes, and each type of spatial relation is modeled by a specific pairwise potential function. As shown in Fig. 3, our method models the “surrounding” and “above/below” spatial relations. For the surrounding relation, the range box is centered at the node. For the above/below relation, the bottom edge of the range box is centered at the node.
In our experiments, the size of the range box (dash box in the figure) size is , where is the length of the short edge of the feature map. It would be straightforward to construct more pairwise potentials, by varying either the sizes or positions of the connection range boxes, and our approach is not limited to connections within “boxes”.
Here we present the details of our deep CRF model. We denote by one input image and the labeling mask which describes the label configuration of each node in the CRF graph. The energy function is denoted by which models the compatibility of the input-output pair, with a small output value indicating high confidence in the prediction . All network parameters are denoted by which we need to learn. The conditional likelihood for one image is formulated as follows:
Here is the partition function, defined as: . The energy function is typically formulated by a set of unary and pairwise potentials:
Here is a unary potential function. To make the exposition more general, we consider multiple types of unary potentials with the set of all such unary potentials. is a set of nodes for the potential . Likewise, is a pairwise potential function with the set of all types of pairwise potential. is the set of edges for the potential . and indicates the corresponding image regions which associate to the specified node and edge.
The potential function is constructed by a deep network for generating feature map (FeatMap-Net) and a shallow network (Unary-Net or Pairwise-Net) to generate the output of the potential function. Details are described in the following sections. An overview of our contextual deep structured model for prediction and training is shown in Fig. 4.
We formulate the unary potential function by stacking the FeatMap-Net for generating feature maps and a shallower fully connected network (referred to as Unary-Net) to generate the final output of the unary potential function. The unary potential function is written as follows:
Here is the output value of Unary-Net, which corresponds to the -th node and the -th class.
Fig. 4 shows an illustration of the Unary-Net and how it corporates with FeatMap-Net. Fig. 5 demonstrates the process for generating the feature vector for one node. The input of the Unary-Net is the node feature vector extracted from the feature map which is generated by FeatMap-Net. The feature vector for one CRF node is simply the corresponding feature vector in the feature map. The dimension of the Unary-Net output vector for one node is , which is the same as the number of classes.
We formulate the unary potential function, analogous to the unary potentials, by stacking the FeatMap-Net for generating feature maps and a shallower fully connected network (referred to as Pairwise-Net) to generate the final output of the pairwise potential function. The pairwise potential function is written as follows:
Here is the output value of Pairwise-Net. It is the confidence value for the node pair when they are labeled with the class value , which measures the compatibility of the label pair ) given the input image . is the corresponding set of CNN parameters for the potential , which we need to learn. The role of Pairwise-Net in our structured model is illustrated in Fig. 4. Fig. 5 describes the process for generating the feature vector for one pairwise connection. The input of Pairwise-Net is the edge feature vector which is generated from the feature map for two connected nodes. Following the work of , we concatenate the corresponding feature vectors of two connected nodes to obtain the CRF edge feature vector. The Pairwise-Net has output units to match the number of possible label combinations for a pair of nodes.
Our formulation of pairwise potentials is different from the Potts-model-based smoothness potentials in the existing methods of [5, 60]. The Potts-model-based pairwise potentials are a log-linear functions and employ a special formulation for enforcing neighborhood smoothness based on color contrast, and thus to sharpen object/region boundaries. In contrast, our pairwise potentials model the semantic compatibility relations between two nodes with the output for every possible value of the label pair individually parameterized by CNNs. Clearly, these two types of pairwise potential formulations have different purposes and effects.
Most recent segmentation methods, e.g., the work in [5, 8, 48, 60], have applied the dense CRF method  in the prediction refinement stage for refining (sharpen object boundaries) the coarse (low-resolution) prediction. The dense CRF method is a Potts-model-based fully-connected CRF with pairwise potentials based on color contrast for local smoothness. It is important to clarify that, this smoothness CRFs and our contextual deep CRFs are working in different prediction stages. Our contextual CNN pairwise potentials are applied in the coarse prediction stage to improve the lower-resolution prediction, rather than applying in the boundary refinement stage.
In our framework, after obtaining the coarse level prediction, we still need to perform a refinement step to obtain the final high-resolution prediction (as shown in Fig. 1). Hence we also apply the dense CRF method , as in many other recent methods, in the prediction refinement step. Therefore, our method takes advantage of both contextual CNN potentials and the traditional smoothness potentials to improve the final result. More details for prediction can be found in Sec. 6.
As in [57, 25], modeling asymmetric relations requires learning asymmetric potential functions, the output of which should depend on the input order of a pair of nodes. In other words, the potential function is required to be capable of modeling different input orders. Typically we have the following case for asymmetric relations:
Ideally, the potential is learned from the training data.
Here we discuss the asymmetric relation “above/below” as an example. We take advantage of the input pair order to indicate the spatial configuration of two nodes, thus the input indicates the configuration that the node is spatially lies above the node . Clearly, the potential function is required to model different input orders.
The asymmetric property is readily achieved with our general formulation of pairwise potentials. The edge features for the node pair are generated from a concatenation of the corresponding features of nodes and (as in ), in that order. The potential output for every possible pairwise label combination for is individually parameterized by the pairwise CNNs. These factors ensure that the edge response is order dependent, easily satisfying the asymmetric requirement.
We develop multi-scale CNNs and sliding pyramid pooling in our FeatMap-Net to encode rich background information for capturing patch-background context. Fig. 6 shows the architecture of FeatMap-Net. Details are presented shortly in the squeal.
Applying CNNs on multi-scale images has shown improved performance in some recent segmentation methods, e.g., [17, 40]. In our multi-scale network, an input image is first resized into scales, then each resized image goes through 6 convolution blocks to output one feature map. In our experiment, the scales for the input image are set to , and . All scales share the same top convolution blocks. In addition, each scale has an exclusive convolution block (“Conv Block 6” in the figure) which captures scale-dependent information. The resulting feature maps (corresponding to
scales) are of different resolutions, therefore we upscale the two smaller ones to the size of the largest feature map using bilinear interpolation. These feature maps are then concatenated to form one feature map.
We perform spatial pyramid pooling  (a modified version using sliding windows) on the feature map to capture information from background regions in multiple sizes. From another point of view, this increases the field-of-view for the feature map, for which feature vectors are able to encode information from a larger image region. Increasing the field-of-view generally helps to improve performance, which is also discussed in .
The details of spatial pyramid pooling are illustrated in Fig. 7. In our experiment, we perform -level pooling for each image scale. We define and
sliding pooling windows with max-pooling to generatesets of pooled feature maps. These pooled feature maps are then concatenated to the original feature map to construct the final feature map, and thus the resulting feature dimension is for one image scale.
We show the detailed network layer configuration for all networks in Fig. 8. For FeatMap-Net, the configuration of the convolution blocks is similar to the VGG-16 model . The top convolution blocks share the same configuration as the VGG-16 network. The first fully-connected layer in VGG-16 is converted into a convolution layer ( see FCN in  for details) and merged into the -th convolution block. We only transfer the first fully-connected (FC) layer into our network rather than FC layers. Note that transferring FC layers is commonly applied in almost all recent FCN based methods [39, 5, 60]. The FC layer in the VGG-16 model contains a large number of filters (), thus our network which transfers only one FC layer is more efficient.
In FeatMap-Net, we add a new convolution block (“Conv Block 6” in the figure) which contains convolution layers. This extra convolution block is not existed in the VGG-16 network. With this new convolution block, we are able to capture scale-dependent information and increase the abstraction level. We also have the consideration of increasing the field-of-view for the final feature map by adding this extra block.
As discussed in Sec. 1.1, The stride setting of the convolution and pooling layers will result in a feature map which has a smaller resolution than the input image. For the convolution and pooling layers, the resolution of the output feature map is down-sampled if the stride is greater than . Note that there are a number of convolution/pooling layers in VGG-16 model which use the stride setting of . Therefore, for the original VGG-16 model, the resolution of the output feature map is times smaller than the size of the input image (see FCN  for details). To increase the resolution of the feature map, almost all recent VGG-16 based methods [39, 5, 60] reduce the stride of the last two pooling layers to , which reduces the down-sampling factor from to .
In our setting, we reduce the stride of the last max pooling layer (only one layer) in the VGG-16 network to , instead of reducing for two pooling layers in many other methods [5, 60]. The resolution of the resulting feature map is times smaller than the size of the input image. For a input image, the resolution of the resulting feature map is around .
Directly changing the stride inevitably degrades the performance of the learned filters since the field-of-view of the input feature map for some filters is changed. To preserve the field-of-view, recent work has proposed a number of approaches. For example, a straightforward approach is to increase the receptive field size of the filter (e.g., double the filter size). Large filter sizes will significantly increase the computation cost for convolution operations. This approach also brings the problem of how to upsample the filter weights. Probably a better approach is to apply the hole algorithm as in, which performs a skipping (sampled) dot-product calculation for filter convolution. Therefore, a large convolution window size can be applied without increasing the computation cost.
Different from existing approaches, here we apply a simple yet effective approach. We add extra two convolution layers (“Conv Block 6” ) instead of increasing the filter size. These extra layers are able to enlarge the field-of-view and compensate the side-effect of reducing the stride in pooling layers.
At the prediction stage, our deep structured model generates low-resolution prediction (as shown in Fig. 1), which is of the input image size. As discussed in Sec. 5, this is due to the stride setting of pooling layers. Therefore, we apply two prediction stages for obtaining the final high-resolution prediction: the coarse-level prediction stage and the prediction refinement stage. We first perform CRF inference on our contextual structured model to generate a score map for coarse-level prediction, then we bilinearly unsmaple the score map and apply a boundary refinement method  to obtain the final prediction which has the same resolution as the input image. This two-stage prediction process is illustrated in Fig. 9.
We perform CRF inference on our contextual structured model to obtain the coarse prediction of a test image. For example, we can solve the maximum a posteriori (MAP) problem: . Alternatively, we also can consider the marginal inference over nodes for prediction:
We obtain the marginal distribution for each node after performing this marginal inference. This marginal distribution can be further applied in the next prediction stage for boundary refinement. Details are shown in the next section.
Our CRF graph does not form a tree structure, nor are the potentials submodular, hence we need to an apply approximate inference. To address this we apply an efficient message passing algorithm which is based on the mean field approximation . The mean field algorithm constructs a simpler distribution , e.g., a product of independent marginals: , which minimizes the KL-divergence between the distribution and . In our experiments, we perform mean field iterations.
We generate the score map for the coarse prediction from the marginal distribution which we obtain from the mean-field inference. We first bilinearly up-sample the score map of the coarse prediction to the size of the input image. Then we apply a common post-processing method  (dense CRF) to sharpen the object boundary for generating the final high-resolution prediction. This post-processing method leverages low-level pixel intensity information (color contrast) for boundary refinement. Note that most recent work on image segmentation produce low-resolution prediction and have a upsampling and refinement process/model for the final prediction, e.g., [5, 60, 8].
In summary, we simply perform bilinear upsampling of the coarse score map and apply the boundary refinement post-processing. We argue that this stage can be further improved by applying more sophisticated refinement methods, e.g., training deconvolution networks  training multiple coarse to fine learning networks , and exploring middle layer features for high-resolution prediction [23, 39]. It is expected that applying better refinement approaches will gain further performance improvement. In the experiment part, we show an example of exploring the feature maps from middle layers to refine the coarse prediction. We apply this improved refinement approach on the dataset PASCAL VOC 2012. Refer to Sec. 9.2 for details.
A common approach to CRF learning is to maximize the likelihood, or equivalently minimize the negative log-likelihood, which can be written for one image as:
Adding regularization to the CNN parameter , the optimization problem for CRF learning is:
We can apply stochastic gradient (SGD) based methods to optimize the above problem for learning . The energy function is constructed from CNNs, and its gradient
easily computed by applying the chain rule as in conventional CNNs. However, the partition functionbrings difficulties for optimization. Its gradient is written:
Generally the size of the output space is exponential in the number of nodes, which prohibits the direct calculation of and its gradient. The CRF graph we considered for segmentation here is a loopy graph (not tree-structured), in which a large number of nodes (more than ) and pairwise connections (more than ) are involved for one image. For loopy graph with large number of nodes and edges, typically approximation is required for inference, and even this is generally computationally expensive.
More importantly, usually a large number of SGD iterations are required for training CNNs. Typically the number of iterations is in tens or hundreds of thousands. Thus performing inference at each SGD iteration is very computationally expensive.
Instead of directly solving the optimization in (9), we propose to apply an approximate CRF learning method. In the literature, there are two popular types of learning methods which approximate the CRF objective: pseudo-likelihood learning  and piecewise learning 
. The main advantage of these methods in term of training deep CRF is that they do not involve marginal inference for gradient calculation, which significantly improves the efficiency of training. Decision tree fields and regression tree fields  are based on pseudo-likelihood learning, while piecewise learning has been applied in the work [53, 29].
Here we develop this idea for the case of training the CRF with the CNN potentials. In piecewise training, the conditional likelihood is formulated as a number of independent likelihoods defined on potentials, written as:
The likelihood is constructed from the unary potential . Likewise, is constructed from the pairwise potential . and are written as:
The log-likelihood for piecewise training is then:
The optimization problem for piecewise training is to minimize the negative log likelihood with regularization:
Compared to the objective in (9) for direct maximum likelihood learning, the above objective does not involve the global partition function . To calculate the gradient of the above objective, we only need to calculate the gradient and . With the definition in (11), is a conventional softmax normalization function over only (the number of classes) elements. Similar analysis can also be applied to . Hence, we can easily calculate the gradient without involving expensive inference. Moreover, we are able to perform paralleled training of potential functions, since the above objective is formulated by a summation of independent log-likelihoods.
As previously discussed, CNN training usually involves a large number of gradient update iteration which prohibit the repeated expensive inference. Our piecewise approach here provides a practical solution for learning CRFs with CNN potentials on large-scale data.
For the FeatMap-Net, the first convolution blocks and the first convolution layer in the th convolution block are initialized from the VGG-16 network . All remaining layers are randomly initialized. Note that VGG-16 network is widely applied in recent segmentation methods. All layers are trained using back-propagation/stochastic gradient descend (SGD). We apply simple data augmentation in the training stage. Specifically, we perform random scaling (from to ) and flipping of the images for training.
As illustrated in Fig. 3, we use types of pairwise potential functions. In total, we have type of unary potential function and types of pairwise potential functions. We formulate one specific FeatMap-Net and potential network (Unary-Net or Pairwise-Net) for one type of potential function. In other words, one type of potential function is constructed by one FeatMap-Net and a shallow potential network. More details of FeatMap-Net and Unary/Pairwise-Net can be found in Fig. 4. There are two main benefits of modeling specific FeatMap-Net for each potential instead of sharing one FeatMap-Net across potentials. Different types of potentials have different focus and thus probably require separate feature maps. Using separate FeatMap-Net allows generating specific high-level features for the corresponding potential function. Moreover, with separate FeatMap-Net, we are able to parallel the training of different types of potentials, and thus ease the implementation and speed up the training.
As previously discussed, one node in the CRF graph is connected to all nodes which lie within a predefined range box. Under this setting, the number of pairwise connections for one node can be a few hundred. For example, for an input image with a resolution of pixels and x scaling, the resolution of the feature map after going through FeatMap-Net is around . In this case, the number of nodes are around , and the number of connections is around for one node. Hence for this image, we need to process pairwise relations for generating the edge features, passing forward the Pairwise-Net and back-propagating the gradients (in the training stage). These operations are considerably computationally expensive for such a large number of pairwise connections. If using high feature dimension for the feature map, these operations can even run out of the GPU memory.
In our solution, to speed up the training and testing of the pairwise potentials, we perform sampling of pairwise connections for each node in the CRF graph. Since the feature map encodes redundant information in local regions, performing sampling can still preserve sufficient pairwise relations while removing redundancies. Specifically, we sample neighboring nodes based on a regular grid spanning the range box (excluding self-connection), and thus we have pairwise connections for each node, which is an order of magnitude fewer connections than the original setting. We observe that this sampling setting, which reduces the number of pairwise connections significantly, speeds up the training without degrading the performance.
The number of pairwise connections is still large even with sampling, which brings the problem of keeping the edge features in the GPU memory. Moreover, considering a large number of pairwise connections (more than ) in one iteration for updating the parameters of Pairwise-Net might result in degraded gradients. This is similar to the case that using an extremely large batch size for gradient calculation in the training of a conventional classification network. An extremely large batch size for gradient update can significantly slow down the convergence and may decrease the performance . Moreover, as discussed in , using small batch size may perform “noise” injection in the gradient calculation as is a form of regularization, which may lead to better parameter solutions. Overall, from both empirical observations and theoretical analysis, a appropriate setting of batch size is key to the network training. Therefore, we probably should not consider all pairwise connections in one gradient iteration for updating the Pairwise-Net.
To reduce the GPU memory consumption and improve the batch update for the Pairwise-Net, we perform asynchronous gradient update for training the FeatMap-Net and Pairwise-Net. With asynchronous gradient update, the gradient calculations for different parts of the network are not required in the same iteration, which breaks the dependency between different parts (or layers) of the networks. Asynchronous gradient update is widely applied in large-scale distributed network learning. For details one may refer to .
Specifically, in one stochastic gradient iteration, we perform multiple sub-iterations of gradient update for the Pairwise-Net and collect the gradients for the FeatMap-Net. In each sub-iteration, a subset of pairwise connections is selected (e.g., ) for gradient calculation and the parameters of Pairwise-Net are updated. Clearly, in each sub-iteration we only process a small number of connections for updating the network parameters of Pairwise-Net, thus GPU consumption is low and the batch size for learning Pairwise-Net is reduced. This asynchronous approach addresses the problems of GPU memory and large batch size for training Pairwise-Net. After going through all pairwise connections, we collect the gradients for FeatMap-Net, and perform a conventional back-propagation gradient update to FeatMap-Net.
|method||training data||pixel accuracy||mean accuracy||IoU|
|Gupta et al. ||RGB-D||60.3||-||28.6|
|method||pixel accuracy||mean accuracy||IoU|
|sliding pyramid pooling||63.5||45.3||32.4|
|CNN contextual pairwise||70.0||53.6||40.6|
|2 unary ensemble||37.8|
|3 unary ensemble||38.4|
|4 unary ensemble||38.7|
|1 pairwise + 1 unary||38.9|
|1 pairwise +2 unary||39.2|
|Only using VOC training data|
|Using VOC+COCO training data|
We evaluate our method on challenging semantic segmentation datasets: PASCAL VOC 2012, NYUDv2, PASCAL-Context, SIFT-flow, SUN-RGBD, KITTY, COCO and Cityscapes, which covers various types of scene images, including indoor/outdoor scene, street scene, etc. Our comprehensive experiments show that the proposed method achieves new state-or-the-art performance on these datasets. For VGG pre-trained layers (Block 1 to Block 5 in FeatMap-Net), we use a small learning rate: 0.0001; for the remaining layers (Block 6 in FeatMap-Net, layers in Unary-Net and Pairwise-Net), we set a larger learning rate: 0.001. Our system is built on MatConvNet .
as an element in the confusion matrix, which is the number of pixels with the-th category as the ground truth and the -th category as the prediction; is the total number of pixels for the -th category in the ground truth; is the number of categories. Pixel accuracy measures the portion of correctly predicted pixels: . Mean accuracy measures the per-category pixel accuracy: . IoU score calculates the portion of the intersection between the ground truth and the prediction: .
We first evaluate our method on the NYUDv2  dataset which has RGB-D indoor scene images. We use the segmentation labels provided in  for which the labels are processed into classes. We use the standard training set which contains images and the test set which contains images. We train our models only on RGB images without using the depth information.
Results are shown in Table I. Some prediction examples are shown in Fig. 10 Unless otherwise specified, our models are initialized using the VGG-16 network. VGG-16 is also used in the competing method FCN . our contextual model with CNN pairwise potentials achieves the best performance, which sets new state-of-the-art result on the NYUDv2 dataset, Note that we do not use any depth information in our model.
We evaluate the performance contribution of different components of the FeatMap-Net for capture patch-background context on the NYUDv2 dataset. We present the results of adding different components in FeatMap-Net, which are shown in Table II. We start from a baseline setting of our FeatMap-Net (“FullyConvNet Baseline” in the result table), for which multi-scale and sliding pooling is removed. This baseline setting is the conventional fully convolution network for segmentation, which can be considered as our implementation of the FCN method in . The result shows that our CNN baseline implementation (“FullyConvNet”) achieves very similar performance (slightly better) than the FCN method. Applying multi-scale network design and sliding pyramid pooling significantly improve the performance, which clearly shows the benefits of encoding rich background context in our approach. Applying the dense CRF method  for boundary refinement gains further improvement. Finally, adding our contextual CNN pairwise potentials brings significant further improvement, for which we achieve the best performance in this dataset.
We compare our CRF model with contextual pairwise potentials against the simple ensemble of multiple unary-only models. Four unary-only networks are independently trained in this experiment. Results are shown in Table III. To clearly evaluate the effectiveness, we use 1 type of pairwise potential which corresponds to the surrounding relations in our CRF model. The result shows that using our CRF model with 1 pairwise potential and 1 unary potential (“1 pairwise + 1 unary”) outperforms the ensembles of multiple unary networks, which verifies the effectiveness of learning pairwise potentials. Moreover, using extra unary networks, i.e., an ensemble of 2 unary networks, in our CRF model can further improve the performance, as shown by the entry “1 pairwise + 2 unary” in the result table. It indicates that our pairwise potential is able to capture different information and complementary to the multi-unary ensemble.
PASCAL VOC 2012  is a well-known segmentation evaluation dataset which consists of 20 object categories and one background category. This dataset is split into a training set, a validation set and a test set, which respectively contain , and images. Following a conventional setting in [24, 5], the training set is augmented by extra annotated VOC images provided in , which results in training images. We verify our performance on the PASCAL VOC 2012 test set. We compare with a number of recent methods with competitive performance. Since the ground truth labels are not available for the test set, we evaluate our method through the VOC evaluation server.
The IoU scores are shown in the last column of Table IV. Prediction examples of our method are shown in Fig. 11. We first train our model only using the VOC images. We achieve an IoU score of , which is the best result amongst methods that only use the VOC training data.111The result link at the VOC evaluation server: http://host.robots.ox.ac.uk:8080/anonymous/KEFFM4.html
To improve the performance, following the setting in recent work [5, 8], we train our model with the extra images from the COCO dataset . With these extra training images, we achieve an IoU score of .
As described in Sec. 6, our deep structured model generates low-resolution coarse prediction, which is of the input image size. To obtain the final high-resolution prediction we apply a simple yet effective approach: we first perform bilinear upsampling of the coarse score map and then apply the boundary refinement post-processing . To improving this simple approach, we exploit the feature maps from middle layers to refine the coarse prediction and produce high-resolution prediction, which is similar to the methods in [5, 39, 23]. With this improved refinement approach, we finally achieve an IoU score of , which is best reported result on this challenging dataset. 222The result link at the VOC evaluation server: http://host.robots.ox.ac.uk:8080/anonymous/MVTNTX.html
The feature maps from the middle layers encode lower level visual information (from edge patterns to texture/object part patterns) and have higher resolution than the final output, thus it is expected that learning extra layers on these feature maps helps to predict details in the object boundaries. Specifically, we add refinement layers on top of the feature maps from the first max-pooling layers and the score map of the coarse prediction (output by our deep structured model). Details are shown in Fig. 12. These refinement layers play a role of refining the coarse prediction by exploring middle layer features, which increase the resolution of the prediction from (coarse prediction) to of the input image. With this improved prediction, we perform boundary refinement using  to generate the final prediction.
The results for each category are shown in Table IV. We outperform comparing methods in most categories. For only using the VOC training set, our method outperforms the second best method, DPN , on categories out of . For using VOC+COCO training set, our method outperforms DPN  on categories out of .
The large scale outdoor image dataset Cityscapes  contains high-resolution street scene images from different cities. This dataset provides pixel-level semantic segmentation labels of images for classes including road, car, pedestrian, bicycle, sky etc. The provided “trainval” set has image. We use the training set ( images) for training. The ground truth of the test set is not available, and we evaluate our method through their evaluation server. We follow the provided protocol for dataset evaluation: classes are valid for evaluation, and the remaining classes are not considered in evaluation.
Results are shown in Table V. As similar to the setting for the PASCAL VOC dataset, we train a refinement network which is described in Fig. 12 to obtain high resolution prediction. Here we set the output resolution in the refinement network as of the input image size. The result clearly shows that our method outperforms other competing methods. Prediction examples on the validation set are shown in Fig. 13.
The PASCAL-Context  dataset provides the segmentation labels of the whole scene (including the “stuff” labels) for the PASCAL VOC images. We use the segmentation labels which contain classes ( classes plus the “ background” class ) for evaluation. We use the provided training/test splits. The training set contains images and the test set contains images.
SUN-RGBD  is a segmentation dataset contains around indoor images and provides pixel labeling masks of classes, which is an extension of the NYUD dataset . Results are shown in Table VII. Our method outperform the existing methods by a large margin, even though we does not make use of the depth information for training.
|method||training data||pixel accuracy||mean accuracy||IoU|
|Liu et al. ||RGB-D||10.0|
|Ren et al. ||RGB-D||36.3|
|Kendall et al. ||RGB||71.2||45.9||30.7|
The COCO dataset  contains more than 1 million images and provide segmentation labels for classes. Since the test set is not available, we generate images for testing and the remaining images are for training. We select the test images on a class balance basis which ensures every category at lease appears in images. Labeling regions which are smaller than pixels are treated as “void” which are not considered in training and evaluation. Results are shown in Table VIII. We compared to two baseline methods which are based on conventional fully convolution networks. The details of these baseline methods are the same as that for the Cityscapes dataset (see Sec. 9.3). The results shows that our method significantly outperforms the baselines.
|method||pixel accuracy||mean accuracy||IoU|
|FullyConvNet + refine||86.7||55.0||41.3|
|method||pixel accuracy||mean accuracy||IoU|
|Liu et al. ||76.7||-||-|
|Tighe et al. ||75.6||41.1||-|
|Tighe et al. (MRF) ||78.6||39.2||-|
|Farabet et al. (balance) ||72.3||50.8||-|
|Farabet et al. ||78.5||29.6||-|
|Pinheiro et al. ||77.7||29.8||-|
We further evaluate our method on the SIFT-flow dataset. This dataset contains images and provides the segmentation labels for classes. We use the standard split for training and evaluation. The training set has images and the test set has images. Since the images are in small sizes, we upscale the image by a factor of for training. Results are shown in Table IX. We achieve the best performance on this dataset.
We perform further evaluation on the KITTI dataset  for road image segmentation. Zhang at el.  provide semantic segmentation labels of classes for images, in which images are for training and the remaining are for testing. We follow the provided training and testing splits for evaluation and report the results in Table X. Clearly, our method performs the best. To further improve the performance, we perform pre-training on COCO images, for which the result is denoted by “ours+” in the result table.
|method||pixel accuracy||mean accuracy||IoU|
|Cadena et al. ||84.1||52.4|
|Zhang et al. ||89.3||65.4|
We have proposed a method which combines CNNs and CRFs to exploit complex contextual information for semantic image segmentation. Basically, we formulate CNN based pairwise potentials for modeling semantic relations between image regions. We have performed comprehensive experiments on challenging segmentation datasets and we achieve state-of-the-art performance on all evaluated dataset including the PASCAL VOC 2012 dataset. The proposed method is potentially widely applicable to other tasks.
This research was supported by Australian Research Council through the ARC Centre for Robotic Vision (CE140100016). C. Shen’s participation was in part supported by an ARC Future Fellowship (FT120100969). I. Reid’s participation was in part supported by an ARC Laureate Fellowship (FL130100102).
Proc. Int. Conf. Machine Learn., 2015.
Proc. European Conf. Computer Vision, 2014.
Conditional random fields as recurrent neural networks.In Proc. Int. Conf. Comp. Vis., 2015.