Deep Learning Markov Random Field for Semantic Segmentation
Shell : Bare Demo of IEEEtran.cls for Computer Society Journals
segmentation is a fundamental and long-standing problem in computer vision. It is defined as a multi-label classification problem, aiming to assign each pixel with a category label. There are two widely adopted research realms, including semantic image segmentation  and semantic video segmentation . The former employs a static image as input, while the latter employs a video sequence. The obtained per-pixel segmentation results are extremely useful for several applications like smart editing , scene understanding  and automated driving .
Since pixels in natural images or videos generally exhibit strong correlation, jointly modeling label distribution in all locations is desirable. To capture these contextual information, Markov random field (MRF) and conditional random field (CRF)  are commonly used as classic frameworks for semantic segmentation. They model the joint distribution of labels by defining both unary term and pairwise terms. Unary term reflects the per-pixel confidence of assigning labels while pairwise terms capture the inter-pixel constraints.
Most previous studies focus on designing pairwise terms that possess strong expressive power. For example, Krähenbühl et al.  attained accurate segmentation boundary by inferring on a fully-connected graph. Vineet et al.  extended  by defining both high-order and long-range terms between pixels. Global or local semantic contexts between labels were also investigated by . However, their performance are limited by the relatively shallow models (e.g. SVM or Adaboost) used as unary term. As deep learning gradually takes over in many image recognition fields , researchers have also explored the possibility of designing effective deep architecture for semantic segmentation. For instance, Long et al.  transformed fully-connected layers of CNN into convolutional layers, making accurate per-pixel classification possible using contemporary CNN architectures that were pre-trained on ImageNet . Chen et al.  improved  by feeding the outputs of CNN into a MRF with simple pairwise potentials, but it treated CNN and MRF as separate components. A recent advance was made in joint training CNN and MRF by passing the error of MRF inference backward into CNN . Nonetheless, an iterative inference of MRF such as the mean field algorithm (MF)  is required for each training image during the back-propagation (BP). Zheng et al.  further showed that the procedure of MF inference can be represented as a Recurrent Neural Network (RNN), but their computational costs are similar to that of .
We observed that a direct combination of CNN and MRF as above is inefficient, posing challenges on both optimization difficulty and inference speed. Since CNN typically has millions of parameters and MRF typically has thousands of latent variables, they are cumbersome to jointly optimize and infer. Even worse, incorporating complex pairwise terms into a MRF becomes impractical, limiting the performance of the entire system. In this study, we propose a novel Deep Parsing Network (DPN), which is an end-to-end system enabling jointly training of CNN and complex pairwise terms. DPN has several appealing properties:
(1) DPN solves MRF with a single feed-forward pass, reducing computational cost and meanwhile maintaining high performance. Specifically, DPN models unary terms by extending the VGG-16 network (VGG)  pre-trained on ImageNet, while additional layers are carefully designed to model complex pairwise terms. The learning of these terms is transformed into deterministic end-to-end computation by BP, instead of embedding MF into BP as  did. Although MF can be represented by a RNN , it needs to recurrently compute the forward pass so as to achieve good performance and thus the process is time-consuming, e.g. each forward pass contains hundred thousand of weights. DPN approximates MF by using only one iteration of inference. This is made possible by joint learning strong unary terms and rich pairwise information.
(2) Pairwise terms determine the graphical structure. In previous studies, if the former is changed, so is the latter as well as its inference procedure. But with DPN, modifying the complexity of pairwise terms, e.g. range of pixels and contexts, is as simple as modifying the receptive fields of convolutions, without varying BP. Furthermore, DPN is capable of representing multiple types of pairwise terms, making many previous works  as its special cases.
Our contributions are summarized as below. (1) We propose the novel DPN to jointly train VGG for unary terms with rich pairwise information, i.e. mixture of label contexts and high-order relations. In comparison to existing deep models, DPN approximates MF with only one iteration of inference, reducing computational cost but still maintaining high performance. (2) We show that multiple types of MRFs can be represented in DPN, making many previous works such as RNN  and DeepLab  as its special cases. (3) We conduct extensive experiments to investigate which component of DPN is crucial to achieve high performance. We demonstrate the generalizability of DPN model by showing its state-of-the-art performance on several standard semantic image/video segmentation benchmarks, including PASCAL VOC 2012 , CityScapes dataset  and CamVid dataset .
In comparison to our earlier version of this work , we propose a generic deep learning framework, Deep Parsing Network (DPN) to model and solve -Dimension (-D) high-order Markov Random Field (MRF). Our previous study  only shows the possibility on 2-Dimension image segmentation problem. Specifically, we employ dynamic node linking to construct graph in -D space, which results in a model of -D high-order MRF. To solve this high-dimensional and high-order MRF, we re-formulate the mean field (MF) update process into a feed-forward pass of Convolutional Neural Network (CNN). -D local and global convolutional layers are designed to approximate different terms in a MF solver. Apart from the methodology, the paper was also substantially improved by providing more technical details and more extensive experimental evaluations.
Existing studies  on semantic segmentation focus on either constructing specific graph structure so that contextual information and long-term dependencies can be captured, or designing suitable network architecture to leverage the power of deep learning. In the following, we summarize recent research advances with respect to these two aspects.
Markov Random Field. Markov Random Field (MRF) or Conditional Random Field (CRF) has achieved great successes in semantic image segmentation, which is one of the most challenging problems in computer vision. Researchers improved labeling accuracy by exploring rich information to define the pairwise functions, including long-range dependencies , high-order potentials , and semantic label contexts . For example, Krähenbühl et al.  attained accurate segmentation boundary by inferring on a fully-connected graph. Vineet et al.  extended  by defining both high-order and long-range terms between pixels. Global or local semantic contexts between labels were also investigated by . Although they accomplished promising results, they modeled the unary terms as SVM or Adaboost, whose learning capacity becomes a bottleneck. The learning and inference of complex pairwise terms are often expensive.
MRF and CRF have also been utilized in semantic video segmentation by extending their graph structure to spatio-temporal domain. For example, Wang et al.  unified foreground object segmentation, tracking and occlusion reasoning into a carefully designed MRF model. Optical flow based long-term trajectories  were also exploited to discover moving objects. Liu et al.  employed fully-connected CRF augmented with object potentials for efficient multi-class inference. However, these methods are based on hand-crafted features, thus lacking sufficient learning capacity.
Convolutional Neural Network. More recently, Convolutional Neural Network (CNN) has been leveraged as a strong unary classifier. With deep models, existing works  demonstrated encouraging segmentation results through using just simple definition of the pairwise function or even neglecting it. For instance, Long et al.  transformed fully-connected layers of CNN into convolutional layers, making accurate per-pixel classification possible using the contemporary CNN architectures that were pre-trained on ImageNet . Chen et al.  improved  by feeding the outputs of CNN into a MRF with simple pairwise potentials, but it treated CNN and MRF as separated components. A recent advance was obtained by , which jointly trained CNN and MRF by passing the error of MRF inference backward into CNN, but iterative inference of MRF such as the mean field algorithm (MF)  is required for each training image during the back-propagation (BP). Zheng et al.  further showed that the procedure of MF inference can be represented as a Recurrent Neural Network (RNN), but their computational costs are similar to that of .
Little attempts have been made to develop unified deep learning framework for semantic video segmentation. Recent efforts in this direction include SegNet , which adopted an encoder-decoder architecture but did not take temporal relationships into consideration. Here we extend DPN to further include temporal voxels into the joint learning and inference process, which results in an end-to-end trainable system with rich spatio-temporal information encoded.
We develop a unified framework, DPN, for modeling and solving high-order MRF. The architecture of DPN is shown in Figure 1(a). Our model imposes no restrictions on the dimension of MRF. For example, it can be either -Dimension (2-D) for images segmentation, -Dimension (3-D) for video segmentation, or -Dimension (N-D) for sensor data. DPN learns MRF by extending VGG to model unary terms and additional layers are carefully designed to model pairwise terms. In the following, we describe the formulation of DPN in terms of -D MRF. Note that it can be easily resorted to -D cases or extended to -D cases by removing or adding relationships between nodes.
Markov Random Field.
MRF  is an undirected graph where each node represents a voxel in a video, , and each edge represents relation between voxels, as shown in Figure 1(b). Each node is associated with a binary latent variable, , indicating whether a voxel has label . Here, indicates a voxel’s spatial index with respect to an image, and is its temporal index with respect to a sequence. We have , representing a set of labels. The energy function of MRF is written as
where , , and denote a set of latent variables, nodes, and edges, respectively. is the unary term, measuring the cost of assigning label to voxel . For instance, if voxel belongs to the first category other than the second one at time , we should have . Moreover, is the pairwise term that measures the penalty of assigning labels to a pair of voxel respectively.
Dynamic Node Linking.
Traditional approaches  usually define the edges on rectangular grid in -D space. However, when large motion exists, the actual temporal trajectory for certain pixel will not reside inside a rigid cube, which means the rectangular grid assumption does not hold. To better preserve the contextual information in a spatio-temporal space, we employ dynamic node linking to construct edges in DPN. Specifically, we keep the 2-D structure in the spatial domain, as illustrated in Figure 1(c). In the temporal domain, the neighboring voxels and are defined as those lie on the same temporal trajectories . This trajectory can be estimated by standard optical flow techniques . The formulation of edges in the temporal domain is
In this setting, adjacent nodes in the temporal space would be more likely to belong to the same category, making the label contexts more easily to be captured.
Unary and Pairwise Terms.
Intuitively, the unary terms represent per-voxel classifications, while the pairwise terms represent a set of smoothness constraints. The unary term in Eqn. (Equation 1) is typically defined as
where indicates the probability of the presence of label at voxel , modeling by VGG. To simplify discussions, we abbreviate it as . The smoothness term can be formulated as
where the first term learns the penalty of global co-occurrence between any pair of labels. For example, the output value of is large if and should not coexist. In Eqn.(Equation 4), the second term calculates the distances between voxels. We have
where indicates a feature vector such as RGB values extracted from the input video for voxel , denote coordinates of voxels’ positions, and are the constant weights. Eqn. (Equation 4) implies that if two voxels are close and look similar, they are encouraged to have labels that are compatible. This formulation has been adopted by most of the recent deep models  for semantic image segmentation.
However, Eqn. (Equation 4) has two main drawbacks. First, its first term captures the co-occurrence frequency of two labels in the training data, but neglects the spatial context between objects. For example, ‘person’ may appear beside ‘table’, but not at its bottom. This spatial context is a mixture of patterns, as different object configurations may appear in different images, such as ‘person’ standing beside ‘table’ and ‘person’ sitting behind ‘table’. Second, it defines only the pairwise relations between pixels, missing their high-order interactions.
To resolve these issues, we define the smoothness term by leveraging rich information between voxels, which is one of the advantages of DPN over existing deep models. We have
The first term in Eqn. (Equation 5) learns a mixture of local label contexts, penalizing label assignment in a local cube, where is the number of components in the mixture and is an indicator, determining which component is activated. We define and . An intuitive illustration is given in Figure 2(a), where the dots in red and blue represent a center voxel and its neighboring voxels , i.e. , and indicates assigning label to voxel . Here, outputs labeling cost between and with respect to their relative positions. For instance, if represent ‘person’ and ‘table’, the learned penalties of positions that are at the bottom of voxel should be large. The second term of Eqn. (Equation 5) basically models a triple penalty, which involves voxels , , and ’s neighbors, implying that if and are compatible, then should be also compatible with ’s nearby pixels , , as shown by the purple arrows in Figure 2(b).
Learning parameters (i.e. weights of VGG and costs of label contexts) in Eqn. (Equation 1) requires us to minimize the distances between ground-truth label map and the predicted label , which needs to be inferred subject to the smoothness constraints.
by using a fully-factorized proposal distribution
where each is a variable we need to estimate, indicating the predicted probability of assigning label to voxel . The Kullback-Leibler divergence between them is then calculated as
Since is a constant, minimizing the Kullback-Leibler divergence between and is equivalent to minimizing the former terms in Eqn. (Equation 6), which is denoted as free energy . To simplify the discussion, we denote and as and , respectively. And we can further substitute Eqn.(Equation 1) into . We have
Specifically, the first term in Eqn. (Equation 7) characterizes the cost of each voxel’s predictions, while the second term characterizes the consistencies of predictions between voxels. The last term denotes the entropy, measuring the confidences of predictions. Then, a constrained optimization problem regarding could be formulated as
To solve this minimization problem, we define by introducing Lagrange multipliers . The final closed-form solution can be obtained by differentiating w.r.t. to and equating the resulting expression to zero
such that the predictions for each voxel is independently attained by repeatedly calculating Eqn. (Equation 8), which implies whether voxel have label is proportional to the estimated probabilities of all its neighboring voxels, weighted by their corresponding smoothness penalties. Substituting Eqn. (Equation 5) into Eqn. (Equation 8), we have
In the following, DPN approximates one iteration of Eqn. (Equation 9) by decomposing it into two steps. Let be a predicted label map of the -th category. In the first step as shown in Figure 2(c), we calculate the triple penalty term in Eqn. (Equation 9) by applying a filter on each position , where each element of this filter equals , resulting in . indicates the time span. Apparently, this step smoothes the prediction of voxel with respect to the distances between it and its neighborhood. In the second step as illustrated in Figure 2(d), the labeling contexts can be obtained by convolving with a filter, each element of which equals , penalizing the triple relations as shown in Figure 2(a).
Figure 3 depicts the semantic meaning of the triple penalty and the mixture of local label contexts term in the spatial-temporal domain. From Figure 3(a) we can see that the triple penalty term tracks the movement of local pixels, such as ‘pole’, ‘car’ and ‘road’. These temporal trajectories combined with local regions are subsequently used to smooth original predictions. Figure 3(b) demonstrates that a mixture of local label contexts term not only captures label co-occurrence in a single image, but also encodes the change of label configurations along time. For example, as the observer vehicle drives, ‘tree’ will move backward and get nearer to ‘road’.
3Deep Parsing Network
This section describes the implementation of Eqn. (Equation 9) in a Deep Parsing Network (DPN). DPN extends VGG to model the unary term and with additional layers to approximate one iteration of MF inference as the pairwise term. The hyper-parameters of VGG and DPN are compared in Table 1.
As listed in Table 1, the first row represents the name of layer and ’-’ in the second row represents the size of the receptive field and the stride of convolution, respectively. For instance, ‘3-1’ in the convolutional layer implies that the receptive field of each filter is 33 and it is applied on every single pixel of an input feature map, while ‘2-2’ in the max-pooling layer indicates each feature map is pooled over every other pixel within a 22 local region. On the other hand, ‘3-50-1’ implies a 3D convolution of size 50503, where ‘3’ suggests that this 3D filter is applied on three consecutive frames. The last three rows show the number of the output feature maps, activation functions, and the size of output feature maps, respectively. represents the number of frames in the underlying video sequence.
As summarized in Table 1(a), VGG contains thirteen convolutional layers, five max-pooling layers, and three fully-connected layers. These layers can be partitioned into twelve groups, each of which covers one or more homogeneous layers. For example, the first group comprises two convolutional layers with 33 receptive field and 64 output feature maps, each of which is 224224.
3.1Modeling Unary Terms
To make full use of VGG, which is pre-trained by ImageNet, we adopt all its parameters to initialize the filters of the first ten groups of DPN. To simplify the discussions, we take PASCAL VOC 2012 (VOC12)  as an example. Note that DPN can be easily adapted to any other semantic image segmentation dataset by modifying its hyper-parameters. VOC12 contains 21 categories and each image is rescaled to 512512 in training. Therefore, DPN needs to predict a total of 51251221 labels, i.e. one label for each pixel. To this end, we extends VGG in two aspects.
In particular, let a and b denote the -th group in Table 1(a) and (b), respectively. First, we increase the resolution of VGG by removing its max pooling layers at a8 and a10, since most of the information is lost after pooling, e.g. a10 reduces the input size by 32 times, i.e. from 224224 to 77. As a result, the smallest size of feature map in DPN is 6464, keeping much more information compared with VGG. Note that the filters of b8 are initialized as the filters of a9, but the 33 receptive field is padded into 55 as shown in Figure 4(a), where the cells in white are the original values of the a9’s filter and the cells in gray are zeros. This step is performed because a8 is not presented in DPN, therefore each filter in a9 should be convolved on every other pixel of a7. To maintain the convolution with one stride, we pad the filters with zeros. Furthermore, the feature maps in b11 are up-sampled to 512512 by bilinear interpolation. Since DPN is trained with label maps of the entire images, the missing information in the preceding layers of b11 can be recovered by BP. The supervision signals in the interpolated pixels will guide the feature learning for full-resolution images.
Second, two fully-connected layers at a11 are transformed into two convolutional layers at b9 and b10, respectively. As shown in Table 1(a), the first ‘fc’ layer learns 775124096 parameters, which can be altered to 4096 filters in b9, each of which is 2525512. Since a8 and a10 have been removed, the 77 receptive field is padded into 2525 similar as above and shown in Figure 4 (b). The second ‘fc’ layer learns a 40964096 weight matrix, corresponding to 4096 filters in b10. Each filter is 114096.
Overall, b11 generates the unary labeling results, producing twenty-one 512512 feature maps, each of which represents the probabilistic label map of each category.
3.2Modeling Smoothness Terms
The last four layers of DPN, i.e. from b12 to b15, are carefully designed to smooth the unary labeling results.
b12. As listed in Table 1 (b), ‘lconv’ in b12 indicates a 3D locally convolutional layer. A counterpart of it (i.e. 2D locally convolutional layer) is widely used in face recognition  to capture different information from different facial positions. Similarly, distinct spatial positions of b12 have different filters, and each filter is shared across 21 input channels, as shown in Figure 4(c). It can be formulated as
where representing the linear activation function, ’’ is the convolutional operator, and is a 505031 filter at position of channel . The choice and effect of filter size will be discussed in the experiments (Sec.Section 4.1). We have shared across 21 channels. indicates a local cube in b11, while is the corresponding output of b12. Since b12 has a stride of one, the result of is scalar. In summary, b12 has 512512 different filters and produces 21 output feature maps.
Eqn. (Equation 10) implements the triple penalty of Eqn. (Equation 9). Recall that each output feature map of b11 indicates a probabilistic label map of a specific object appearing in the frame. As a result, Eqn. (Equation 10) suggests that the probability of object presented at position is updated by weighted averaging over the probabilities at its nearby positions. Thus, as shown in Figure 2(c), corresponds to a cube of centered at , which has values , . Similarly, is initialized by , implying each filter captures dissimilarities between positions. These filters remain fixed during BP, other than learned as in conventional CNN
b13. As shown in Table 1(b) and Figure 5(a), b13 is a 3D global convolutional layer that generates 105 feature maps by using 105 filters of size 99321. For example, the value of is attained by applying a 99321 filter at positions . In other words, b13 learns a filter for each category to penalize the probabilistic label maps of b12, corresponding to the local label contexts in Eqn.(Equation 9) by assuming and , as shown in Figure 2 (d).
b14. As illustrated in Table 1 and Figure 5(b), b14 is a block min pooling layer that pools over every 11 region with one stride across every 5 input channels, leading to 21 output channels, i.e. 105521. Layer b14 activates the contextual pattern with the smallest penalty.
b15. This layer combines both the unary and smoothness terms by summing the outputs of b11 and b14 in an element-wise manner similar to Eqn. (Equation 9),
where probability of assigning label to voxel is normalized over all the labels.
Relation to Previous Deep Models.
Many existing deep models such as  employed Eqn. (Equation 4) as the pairwise terms, which are the special cases of Eqn. (Equation 9). To see this, let , and omit (i.e. ), the right hand side of Eqn. (Equation 9) reduces to
where and represent the global label co-occurrence and pairwise pixel similarity of Eqn. (Equation 4), respectively. This is because is a constant, , and . Eqn. (Equation 11) is the corresponding MF update equation of (Equation 4).
We describe the training strategy of DPN and also its time complexity and efficient implementation.
The first ten groups of DPN are initialized by VGG
First, we add a loss function to b11 and fine-tune the weights from b1 to b11 without the last four groups, in order to learn the unary terms. Second, to learn the triple relations, we stack b12 on top of b11 and update its parameters (i.e. in the distance measure), but the weights of the preceding groups (i.e. b1b11) are fixed. Third, b13 and b14 are stacked onto b12 and similarly, their weights are updated with all the preceding parameters fixed, so as to learn the local label contexts. Finally, all the parameters are jointly fine-tuned.
DPN transforms Eqn. (Equation 9) into convolutions and poolings in the groups from b12 to b15, such that filtering at each pixel can be performed in a parallel manner. Assume we have input and output feature maps, pixels, filters with receptive field, and a mini-batch with samples. b12 takes a total operations, b13 takes operations, while both b14 and b15 require operations. For example, when 10 as in our experiment, we have 2151250101.310 operations in b12, which has the highest complexity in DPN. If we parallelize these operations using matrix multiplication on GPU as  did, the operation in b12 can be computed within 30ms. The total runtime of the last four layers of DPN is 75ms. Note that convolutions in DPN can be further speeded up by low-rank decompositions  of the filters and model compressions .
In contrast, existing works  employ fast Gaussian filtering  to accelerate the direct calculation of Eqn. (Equation 9). For a mini-batch of ten 512512 images, a recently optimized implementation  needs 3.510 operations and takes 114ms on GPU to compute one iteration of (). In DPN, simultaneous message passing is enabled over every training image, in the sense that parallelization is obtained in image level. Therefore, DPN makes (Equation 9) easier to be parallelized and speeded up.
As mentioned in Eqn. (Equation 4), the local filters in b12 are computed by the distances between RGB values of the pixels. XY coordinates are omitted here because they could be pre-computed. To accelerate the computation of local convolution, the lookup table-based filtering approach is employed. Specifically, we first construct a lookup table storing distances between any two pixel intensities (ranging from 0 to 255), which results in a matrix. Then when we perform local convolution, the kernels’ coefficients can be obtained efficiently by just looking up the table.
In this section, we demonstrate the effectiveness of DPN and benchmark it against other state-of-the-art semantic segmentation methods. Below, we give an overview of the dataset and evaluation metrics used in these experiments. Representative methods are also introduced. In the following experiments, we denote -D DPN as DPN and -D DPN as spatial-temporal DPN.
We compare DPN with the state-of-the-art methods on PASCAL VOC 2012 (VOC12)  , Cityscapes  and CamVid  datasets. VOC12 is a well-known benchmark for generic image segmentation and Cityscapes dataset focuses on parsing urban street scenes. We choose those two benchmarks to evaluate the original DPN. On the other hand, CamVid dataset is composed of several video sequences, which is suitable for the evaluation of spatial-temporal DPN. We summarize the information of all datasets we used in Table 2.
All existing works employed mean pixelwise intersection-over-union (denoted as mIoU)  to evaluate their performance. To fully examine the effectiveness of DPN, we introduce another three metrics, including tagging accuracy (TA), localization accuracy (LA), and boundary accuracy (BA). (1) TA compares the predicted image-level tags with the ground truth tags, calculating the accuracy of multi-class image classification. (2) LA evaluates the IoU between the predicted object bounding boxes
DPN is compared with the state-of-the-art segmentation methods, including FCN , Zoom-out , DeepLab , WSSL , BoxSup , Piecewise , RNN , SuperParsing , Dilation10 , ALE , Multiclass , and SegNet . All these methods are based on CNNs or MRFs. They can be grouped according to different aspects: (1) joint-train: Piecewise and RNN; (2) w/o joint-train: DeepLab, WSSL, FCN, and BoxSup; (3) pre-train on COCO: RNN, WSSL, and BoxSup. The first and the second groups are the methods with and without joint training CNNs and MRFs, respectively. Methods in the last group also employed MS-COCO  to pre-train deep models. To conduct a comprehensive comparison, the performance of DPN are reported on both settings, i.e. , with and without pre-training on COCO.
In the following, Section 4.1 investigates the effectiveness of different components of DPN on the VOC12. Section 4.2 evaluates the spatial-temporal DPN on the CamVid. Section 4.3 provides detailed analysis of the DPN system and its performance. Section 4.4 compares DPN with the state-of-the-art methods on the benchmarks.
4.1Effectiveness of DPN
All the models evaluated in this section are trained on the training set and tested on the validation set of VOC12.
The receptive field of b12 indicates the range of triple relations for each pixel. We examine different settings of the receptive fields, including ’1010’, ’5050’, and ’100100’, as shown in Table ?(a), where ’5050’ achieves the best mIoU, which is sightly better than ’100100’. For a 512512 image, this result implies that 5050 neighborhood is sufficient to capture relations between pixels, while smaller or larger regions tend to under-fit or over-fit the training data. Moreover, all models of triple relations outperform the ‘baseline’ method that models dense pairwise relations, i.e. VGG+denseCRF .
Receptive field of b13 indicates the range of local label context. To evaluate its effectiveness, we fix the receptive field of b12 as 5050. As summarized in Table ?(b), ’99 mixtures’ improves preceding settings by 1.7, 0.5, and 0.2 percent respectively. We observe large gaps exist between ’11’ and ’55’. Note that the 11 receptive field of b13 corresponds to learning a global label co-occurrence without considering local spatial contexts. Table ?(c) shows that the pairwise terms of DPN are more effective than DSN and DeepLab
More importantly, mIoU of all the categories can be improved through increasing the size of receptive field and learning a mixture. Specifically, for each category, the improvements of the last three settings in Table ?(b) over the first one are 1.20.2, 1.50.2, and 1.70.3, respectively.
We also visualize the learned label compatibilities and contexts in Figure 6(a) and (b), respectively. Figure 6(a) is obtained by summing each filter in b13 over a 99 region, indicating how likely a column object would present when a row object is presented. Blue color represents high favorability. It is worth pointing out that Figure 6(a) is non-symmetry. For example, when a ‘horse’ is presented, a ‘person’ is more likely to present than the other objects. On the other hand, when a ‘person’ presents in an image, it is more likely to find a ‘bike’ (than a ‘horse’). The ‘bkg’ (background) is compatible with all the objects. Figure 6(b) visualizes some contextual patterns, where ‘A:B’ indicates that when ‘A’ is presented, where ‘B’ is more likely to present. For example, ‘bkg’ is around ‘train’, ‘motor bike’ is below ‘person’, and ‘person’ is sitting on ‘chair’.
|Unary Term (mIoU)||59.67||59.67|
|+ Triple Penalty||59.93||
|+ Label Contexts||60.06||
4.2Effectiveness of Spatial-temporal DPN
In this section, we quantitatively investigate the effectiveness of the pairwise term in spatial-temporal DPN. CamVid train are used for training and performance are reported on CamVid test. Images in CamVid are captured from a moving vehicle, thus exhibiting certain temporal regularization.
In spatial-temporal DPN, the b12 is a 3D local convolutional layer and b13 is a 3D global convolutional layer. In Table 3, we evaluate the performance gain of each stage on DPN. According to Table ?(a), we set the receptive field of b12 as 5050 and b13 as 99 in 2D setting. In 3D pairwise term, the receptive field of b12 is 50503 and b13 is 773. We observe that applying 2D and 3D pairwise terms on unary term both improves the performance. Since 3D pairwise terms capture the information between successive frames, it performs slightly better than 2D pairwise terms.
In Figure 7, we visualize the 3D learned label compatibilities and contexts across frames.
Figure 7(a) depicts the possibility of column object would present in the - frame when a row object is presented in the - frame. Blue color indicates high favorability. For instance, when ‘pavement’ is presented in the - frame, ‘road’ is more likely to present around in the - frame. However, if ‘sky’ is presented in the - frame, the pairwise term will penalize the probability which ‘road’ is presented in the - frame.
Figure 7(b) visualizes the spatialtemporal contextual patterns. In each row, ‘A:B’ indicates how ‘A’ influences ‘B’.The figures suggest that when ‘A’ is presented in the - or the - frame, where ‘B’ is more likely to present in the - frame. In the first row, (1) represents that when ‘sky’ is presented in the - frame, its neighborhood is more likely to be ‘sky’. (2) means when ‘sky’ is presented in the - frame, it is more likely presented above this position in the - frame. As shown in Figure 8, (a) and (b) are neighboring video frames, when the vehicle moves forward from (a) to (b), ‘sky’ region (yellow) shifts upward in the scene. So compared with the favor region in Figure 7(b)-(1), the favor region also shifts upward in (2). In the second row of Figure 7(b), (3) and (4) represent that when ‘pedestrian’ is presented in the - or the - frame, ‘building’ is more likely presented above in the - frame. We observe that the shifting from (3) to (4) is similar with the shifting of ‘pedestrian’(orange) in Figure 8 from (a) to (b).
All the analysis in this section are conducted on the validation set of VOC12.
As discussed in Section 3.3, DPN is trained in an incremental manner. The right hand side of Table ?(a) demonstrates that each stage leads to performance gain compared to its previous stage. For instance, ‘triple penalty’ improves ‘unary term’ by 2.3 percent, while ‘label contexts’ improves ‘triple penalty’ by 1.8 percent. More importantly, joint fine-tuning all the components (i.e. unary terms and pairwise terms) in DPN achieves another gain of 1.3 percent. A step-by-step visualization is provided in Figure 9.
We also compare ‘incremental learning’ with ‘joint learning’, which fine-tunes all the components of DPN at the same time. The training curves of them are plotted in Figure 10 (a), showing that the former leads to higher and more stable accuracies with respect to different iterations, while the latter may get stuck at local minima. This difference is easy to understand – incremental learning only introduces new parameters until all existing parameters have been fine-tuned.
DPN approximates one iteration of MF. Figure 10(b) illustrates that DPN reaches a good accuracy with one MF iteration. A CRF  with dense pairwise edges needs more than 5 iterations to converge. It also has a large gap compared to DPN. Note that the existing deep models such as  required 510 iterations to converge as well.
|Tripathi et al.||74.2||67.9||91||66.5||23.6||90.7||26.2||28.5||
|Liu and He||66.8||66.6||90.1||62.9||21.4||85.8||28||17.8||8.3||63.5||8.5||47.2|
We further evaluate DPN using three metrics. The results are given in Figure 11. For example, (a) illustrates that the tagging accuracy can be improved in the third stage, as it captures label co-occurrence with a mixture of contextual patterns. However, TA decreases a little after the final stage. Since joint tuning maximizes segmentation accuracies by optimizing all components together, extremely small objects, which rarely occur in VOC training set, are discarded. As shown in (b), accuracies of object localization are significantly improved in the second and the final stages. This is intuitive because the unary prediction can be refined by long-range and high-order pixel relations, and joint training further improves results. (c) discloses that the second stage also captures object boundary, since it measures dissimilarities between pixels.
Table ?(a) reports the per-class accuracies of four evaluation metrics, where the first four rows represent the mIoU of four stages, while the last three rows represent TA, LA, and BA, respectively. We have several valuable observations, which motivate future researches. (1) Joint training benefits most of the categories, except animals such as ‘bird’, ‘cat’, and ‘cow’. Some instances of these categories are extremely small so that joint training discards them for smoother results. (2) Training DPN with pixelwise label maps implicitly models image-level tags, since it achieves a high averaged TA of 96.4%. (3) Object localization always helps. However, for objects with complex boundary such as ‘bike’, its mIoU is low even it can be localized, e.g. ‘bike’ has high LA but low BA and mIoU. (4) Failures of different categories have different factors. With these three metrics, they can be easily identified. For example, the failures of ‘chair’, ‘table’, and ‘plant’ are caused by the difficulties to accurately capture their bounding boxes and boundaries. Although ‘bottle’ and ‘tv’ are also difficult to localize, they achieve moderate mIoU because of their regular shapes. In other words, mIoU of ‘bottle’ and ‘tv’ can be significantly improved if they can be accurately localized.
We evaluate the performance of DPN and spatio-temporal DPN on several standard semantic segmentation benchmarks.
The VOC12 dataset is one of the most popular benchmarks for semantic image segmentation. This dataset contains 20 indoor and outdoor object categories and one background category. As previously mentioned, we employ images for training, images for validation, and images for testing. Results are given Table ? (b), we compare DPN with the best-performing methods
DPN outperforms several existing methods that were trained on VOC12, but DPN needs only one MF iteration to solve MRF, other than 10 iterations of RNN, DeepLab, and Piecewise. By averaging the results of two DPNs, we achieve 74.1% accuracy on VOC12 without outside training data. As discussed in Section 3.3, MF iteration is the most complex step even when it is implemented as convolutions. Therefore, DPN at least reduces 10 runtime compared to previous works.
Following , we pre-train DPN with COCO, where 20 object categories that are also presented in VOC12 are selected for training. A single DPN has achieved 77.5% mIoU on VOC12 test set. The system in  has incorporated multi-scale pyramid training and mid-level feature refinement, which we believe is complementary to our contribution and can boost the performance of DPN as well. As shown in Table (b), we observe that DPN achieves competitive performances among multiple object classes.
Cityscapes dataset focuses on street scenes segmentation. All images are captured from a moving vehicle in various seasons and cities. This dataset is highly different from VOC12. Because of the great depth of images, the street scenes have large scale variations even in a single image. It defines 19 object categories for evaluation. There are 2975 training, 500 validation and 1525 testing images with fine pixel-level annotations and extra 20000 images with cores annotations. To conduct a fair comparison, we only use the images with fine pixel-level annotations in our experiment.
As shown in Table 4, DPN achieves 66.8% on Cityscapes dataset, which is the second best method, and it is close to the first place 67.1% .  takes a multi-scale aggregation strategy, which can be easily integrated into DPN to further boost the performance. Our method shows advantages on objects with arbitrary shape (i.e. ‘road’, ‘building’, ’vegetation, ‘terrain’ and ‘sky’) which can be easily confused with other objects. Thanks to our high-order and long-range pairwise term, DPN captures their appearance and segments them from other objects accurately.
CamVid dataset consists of 367 training and 233 testing images with 11 classes annotations. All images are extracted from three video sequences at 1Hz. Similar to Cityscapes dataset, these video sequences are also captured from a moving vehicle. As shown in Table 5, DPN outperforms all existing methods, and spatial-temporal pairwise term further improves the performance to 60.25%. Considering the relatively sparse sampling rate (one frame per second) and strong unary term used, our 3-D MRF can indeed leverage temporal contextual information for joint inference.
We can observe that DPN achieves much better performance than other methods, especially on narrow and small objects (i.e. ‘pole’ and ‘sign’), which are very difficult in segmentation task. Since our triple penalty captures the appearance of pixels, we can predict more accurate boundary on those objects. The spatial-temporal pairwise term further improves the performance. Spatial-temporal DPN encodes the relationship between successive frames, which improve the performance on some specific categories like ‘tree’, ‘sky’ and ‘road’, because they have flexible shape and are continuous in successive frames. It is also worthwhile to note that our spatial-temporal DPN achieves best performances on 7 object categories out of 11.
4.5Visual Quality Comparisons
In the following, we inspect visual quality of obtained label maps. Figure 12 demonstrates the comparisons of DPN with FCN  and DeepLab . We use the publicly released model
We also include some typical failure modes of DPN in Figure 13. In the first case, the object with atypical pose is hard to be found. Further considering well-trained object detector as additional unary potential might be a potential solution to this challenge. The second case suggests that scale and illumination are also important factors that influence the performance. This problem can be partially alleviated by augmenting or adding the variance of training data.
We proposed Deep Parsing Network (DPN) to address semantic image/video segmentation. DPN has several appealing properties. First, DPN unifies the inference and learning of unary term and pairwise terms in a single convolutional network. No iterative inference is required during back-propagation. Second, high-order relations and mixtures of label contexts are incorporated to its pairwise terms modeling, making existing works as special cases. Third, DPN is built upon conventional operations of CNN, thus easy to be parallelized and speeded up.
DPN achieves state-of-the-art performance on VOC12, Cityscapes and CamVid datasets. Multiple valuable facts about semantic segmentation are revealed through extensive experiments, such as the interplay between tagging, localization and boundary accuracies along different processing stages. Future directions include investigating the generalizability of DPN to more challenging scenarios with large number of object classes and substantial appearance/scale variations.
This work is supported by SenseTime Group Limited and the General Research Fund sponsored by the Research Grants Council of the Hong Kong SAR (CUHK 416713, 14241716, 14224316. 14209217).
received his B.E. degree in Department of Electronics and Information Engineering in 2013, from Huazhong University of Science and Technology, Wuhan, China. He is currently a PhD student at the Department of Information Engineering, The Chinese University of Hong Kong. His research interests include computer vision, machine learning and computational photography, with focus on human-centric visual understanding and deep learning.
received his B.E. degree in Department of Computer Science and Technology from Tsinghua University in 2014. He is currently a PhD student at the Department of Information Engineering, The Chinese University of Hong Kong. His research interests include computer vision and machine learning, especially image segmentation and deep learning.
received his PhD degree in 2014 in Information Engineering, Chinese University of Hong Kong (CUHK). He is currently a Research Assistant Professor in Electronic Engineering, CUHK. His research interests focus on deep learning and computer vision, including optimization, face recognition, web-scale image and video understanding. He has published 40+ peer-reviewed articles in top-tier conferences such as CVPR, ICML, NIPS and journals such as TPAMI and IJCV. He received a number of awards for his academic contribution, such as Microsoft Research Fellow Award in 2013 and Hong Kong PhD Fellow in 2011. He is a member of IEEE.
Chen Change Loy
(S’06-M’10-SM’17) received the PhD degree in computer science from the Queen Mary University of London in 2010. He is currently a research assistant professor in the Department of Information Engineering, Chinese University of Hong Kong. Previously, he was a postdoctoral researcher at Queen Mary University of London and Vision Semantics Ltd. His research interests include computer vision and pattern recognition, with focus on face analysis, deep learning, and visual surveillance. He serves as an Associate Editor of IET Computer Vision Journal. He is a senior member of the IEEE.
(S’93-M’96-SM’02-F’09) received the B.S. degree from the University of Science and Technology of China, Hefei, in 1990, and the M.S. degree from the University of Rochester, Rochester, NY, in 1991. He received the Ph.D. degree from the Massachusetts Institute of Technology, Cambridge, in 1996. He is a Professor and the Chairman of the Department of Information Engineering, Chinese University of Hong Kong. He worked as the group manager of the Visual Computing Group at the Microsoft Research Asia from 2005 to 2008. His research interests include computer vision, pattern recognition, and video processing. He received the Best Paper Award at the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2009 and Outstanding Student Paper Award at the AAAI 2015. He was a program chair of the IEEE International Conference on Computer Vision (ICCV) 2009 and served as an associate editor of the IEEE Transactions on Pattern Analysis and Machine Intelligence and International Journal of Computer Vision. He is now the Editor-in-Chief of the International Journal of Computer Vision. He is a fellow of the IEEE.
- Each filter in b12 actually represents a distance metric between pixels in a specific region. In VOC12, the patterns of all the training images in a specific region are heterogeneous, because of various object shapes. Therefore, we initialize each filter with Euclidean distance. Nevertheless, Eqn. (Equation 10) is a more general form than the triple penalty in Eqn. (Equation 9), i.e. filters in Eqn. (Equation 10) can be automatically learned from data, if the patterns in a specific region are homogeneous, such as face or human images, which have more regular shapes than images in VOC12.
- We use the released VGG model, which is publicly available at http://www.robots.ox.ac.uk/~vgg/research/very_deep/
- They are the bounding boxes of the predicted segmentation regions.
- The other deep models such as RNN and Piecewise did not report the exact improvements after combining unary and pairwise terms.
- The results of these methods were presented in either the published papers or arXiv pre-prints.
- J. Shi and J. Malik, “Normalized cuts and image segmentation,” TPAMI, vol. 22, no. 8, 2000.
- P. F. Felzenszwalb and D. P. Huttenlocher, “Efficient belief propagation for early vision,” IJCV, vol. 70, no. 1, 2006.
- C. Liu, J. Yuen, and A. Torralba, “Nonparametric scene parsing via label transfer,” TPAMI, vol. 33, no. 12, 2011.
- C. Farabet, C. Couprie, L. Najman, and Y. LeCun, “Learning hierarchical features for scene labeling,” TPAMI, vol. 35, no. 8, 2013.
- M. Mostajabi, P. Yadollahpour, and G. Shakhnarovich, “Feedforward semantic segmentation with zoom-out features,” in CVPR, 2015.
- J. Long, E. Shelhamer, and T. Darrell, “Fully convolutional networks for semantic segmentation,” in CVPR, 2015.
- Z. Liu, X. Li, P. Luo, C.-C. Loy, and X. Tang, “Semantic image segmentation via deep parsing network,” in ICCV, 2015.
- C. Gu and M.-C. Lee, “Semiautomatic segmentation and tracking of semantic video objects,” TCSVT, vol. 8, no. 5, 1998.
- G. J. Brostow, J. Fauqueur, and R. Cipolla, “Semantic object classes in video: A high-definition ground truth database,” Pattern Recognition Letters, 2008.
- J. Lezama, K. Alahari, J. Sivic, and I. Laptev, “Track to the future: Spatio-temporal video segmentation with long-range motion cues,” in CVPR, 2011.
- A. Jain, S. Chatterjee, and R. Vidal, “Coarse-to-fine semantic video segmentation using supervoxel trees,” in ICCV, 2013.
- B. Liu and X. He, “Multiclass semantic video segmentation with object-level active inference,” in CVPR, 2015.
- S. Tripathi, S. Belongie, Y. Hwang, and T. Nguyen, “Semantic video segmentation: Exploring inference efficiency,” in ISOCC, 2015.
- A. Kundu, V. Vineet, and V. Koltun, “Feature space optimization for semantic video segmentation,” in CVPR, 2016.
- P. Isola and C. Liu, “Scene collaging: Analysis and synthesis of natural images with semantic layers,” in ICCV, 2013.
- M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele, “The cityscapes dataset for semantic urban scene understanding,” in CVPR, 2016.
- M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul, “An introduction to variational methods for graphical models,” Machine learning, vol. 37, no. 2, 1999.
- P. Krähenbühl and V. Koltun, “Efficient inference in fully connected crfs with gaussian edge potentials,” in NIPS, 2011.
- V. Vineet, J. Warrell, and P. H. Torr, “Filter-based mean-field inference for random fields with higher-order terms and product label-spaces,” in ECCV, 2012.
- J. Yang, B. Price, S. Cohen, and M.-H. Yang, “Context driven scene parsing with attention to rare classes,” in CVPR, 2014.
- K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” in ICLR, 2015.
- J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “Imagenet: A large-scale hierarchical image database,” in CVPR, 2009.
- L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, and A. L. Yuille, “Semantic image segmentation with deep convolutional nets and fully connected crfs,” in ICLR, 2015.
- A. G. Schwing and R. Urtasun, “Fully connected deep structured networks,” arXiv:1503.02351v1, 2015.
- M. Opper, O. Winther et al., “From naive mean field theory to the tap equations,” 2001.
- S. Zheng, S. Jayasumana, B. Romera-Paredes, V. Vineet, Z. Su, D. Du, C. Huang, and P. Torr, “Conditional random fields as recurrent neural networks,” in ICCV, 2015.
- G. Lin, C. Shen, I. Reid, and A. Hengel, “Efficient piecewise training of deep structured models for semantic segmentation,” in CVPR, 2016.
- M. Jaderberg, A. Vedaldi, and A. Zisserman, “Speeding up convolutional neural networks with low rank expansions,” in BMVC, 2014.
- S. Chetlur, C. Woolley, P. Vandermersch, J. Cohen, J. Tran, B. Catanzaro, and E. Shelhamer, “cudnn: Efficient primitives for deep learning,” in NIPS Deep Learning Workshop, 2014.
- M. Everingham, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman, “The pascal visual object classes (voc) challenge,” IJCV, vol. 88, no. 2, 2010.
- X. Ren and J. Malik, “Learning a classification model for segmentation,” in ICCV, 2003.
- M. Szummer, P. Kohli, and D. Hoiem, “Learning crfs using graph cuts,” in ECCV, 2008.
- B. Fulkerson, A. Vedaldi, and S. Soatto, “Class segmentation and object localization with superpixel neighborhoods,” in ICCV, 2009.
- P. Arbelaez, M. Maire, C. Fowlkes, and J. Malik, “Contour detection and hierarchical image segmentation,” TPAMI, vol. 33, no. 5, 2011.
- G. Wang, P. Luo, L. Lin, and X. Wang, “Learning object interactions and descriptions for semantic image segmentation,” in CVPR, 2017.
- P. Luo, G. Wang, L. Lin, and X. Wang, “Deep dual learning for semantic image segmentation,” in ICCV, 2017.
- P. Krähenbühl and V. Koltun, “Parameter learning and convergent inference for dense random fields,” in ICML, 2013.
- V. Vineet, G. Sheasby, J. Warrell, and P. H. Torr, “Posefield: An efficient mean-field based method for joint estimation of human pose, segmentation, and depth,” in Energy Minimization Methods in Computer Vision and Pattern Recognition, 2013.
- R. Mottaghi, X. Chen, X. Liu, N.-G. Cho, S.-W. Lee, S. Fidler, R. Urtasun, and A. Yuille, “The role of context for object detection and semantic segmentation in the wild,” in CVPR, 2014.
- C. Wang, M. de La Gorce, and N. Paragios, “Segmentation, ordering and multi-object tracking using graphical models.” in ICCV, 2009.
- P. Luo, X. Wang, and X. Tang, “Hierarchical face parsing via deep learning,” in CVPR, 2012.
- P. Luo, X. Wang, and X. Tang, “Pedestrian parsing via deep decompositional network,” in ICCV, 2013.
- G. Papandreou, L.-C. Chen, K. Murphy, and A. L. Yuille, “Weakly-and semi-supervised learning of a dcnn for semantic image segmentation,” in ICCV, 2015.
- V. Badrinarayanan, A. Kendall, and R. Cipolla, “Segnet: A deep convolutional encoder-decoder architecture for image segmentation,” arXiv preprint arXiv:1511.00561, 2015.
- W. T. Freeman, E. C. Pasztor, and O. T. Carmichael, “Learning low-level vision,” IJCV, vol. 40, no. 1, 2000.
- Z. Liu, L. Yuan, X. Tang, M. Uyttendaele, and J. Sun, “Fast burst images denoising,” TOG, vol. 33, no. 6, 2014.
- Z. Liu, R. A. Yeh, X. Tang, Y. Liu, and A. Agarwala, “Video frame synthesis using deep voxel flow,” in ICCV, 2017.
- C. Liu, J. Yuen, and A. Torralba, “Sift flow: Dense correspondence across scenes and its applications,” TPAMI, vol. 33, no. 5, 2011.
- A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in NIPS, 2012.
- Y. Sun, X. Wang, and X. Tang, “Deep learning face representation by joint identification-verification,” in NIPS, 2014.
- Y. Taigman, M. Yang, M. Ranzato, and L. Wolf, “Deepface: Closing the gap to human-level performance in face verification,” in CVPR, 2014.
- Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in ICCV, 2015.
- G. E. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” in NIPS Deep Learning Workshop, 2014.
- A. Adams, J. Baek, and M. A. Davis, “Fast high-dimensional filtering using the permutohedral lattice,” in Eurographics, 2010.
- G. J. Brostow, J. Shotton, J. Fauqueur, and R. Cipolla, “Segmentation and recognition using structure from motion point clouds,” in ECCV, 2008.
- B. Hariharan, P. Arbeláez, L. Bourdev, S. Maji, and J. Malik, “Semantic contours from inverse detectors,” in ICCV, 2011.
- J. Dai, K. He, and J. Sun, “Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation,” in ICCV, 2015.
- J. Tighe and S. Lazebnik, “Superparsing: scalable nonparametric image parsing with superpixels,” in ECCV, 2010.
- F. Yu and V. Koltun, “Multi-scale context aggregation by dilated convolutions,” in ICLR, 2016.
- C. Russell, P. Kohli, P. H. Torr et al., “Associative hierarchical crfs for object class image segmentation,” in ICCV, 2009.
- T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick, “Microsoft coco: Common objects in context,” in ECCV, 2014.