Resources of semantic segmantation based on Deep Learning model
This paper proposes a new deep convolutional neural network (DCNN) architecture that learns pixel embeddings, such that pairwise distances between the embeddings can be used to infer whether or not the pixels lie on the same region. That is, for any two pixels on the same object, the embeddings are trained to be similar; for any pair that straddles an object boundary, the embeddings are trained to be dissimilar. Experimental results show that when this embedding network is used in conjunction with a DCNN trained on semantic segmentation, there is a systematic improvement in per-pixel classification accuracy. Our contributions are integrated in the popular Caffe deep learning framework, and consist in straightforward modifications to convolution routines. As such, they can be exploited for any task involving convolution layers.READ FULL TEXT VIEW PDF
Recent advances in deep learning, especially deep convolutional neural
Currently, Segmentation of bitewing radiograpy images is a very challeng...
In multi-temporal SAR interferometry (MT-InSAR), persistent scatterer (P...
Despite recent improvements using fully convolutional networks, in gener...
Deep convolutional semantic segmentation (DCSS) learning doesn't converg...
We propose a highly structured neural network architecture for semantic
Semantic segmentation, like other fields of computer vision, has seen a
Resources of semantic segmantation based on Deep Learning model
Deep convolutional neural networks (DCNNs) (LeCun et al., 1998) are the method of choice for a variety of high-level vision tasks (Razavian et al., 2014). Fully-convolutional DCNNs have recently been a popular approach to semantic segmentation, because they can be efficiently trained end-to-end for pixel-level classification (Sermanet et al., 2014; Chen et al., 2014; Long et al., 2014).
A weakness of DCNNs is that they tend to produce smooth and low-resolution predictions, partly due to the subsampling that is a result of cascaded convolution and max-pooling layers. Many different strategies have been explored for sharpening the boundaries of predictions produced by fully-convolutional DCNNs. One popular strategy is to add a dense conditional random field (CRF) to the end of the DCNN, introducing contextual information to the segmentation via long-range dependencies in the CRF(Chen et al., 2014; Lin et al., 2015). Another strategy is to reduce the subsampling effected by convolution and pooling, by using the “hole” algorithm for convolution (Chen et al., 2014). A third strategy is to add trainable up-sampling stages to the network via “de-convolution” layers in the DCNN (Noh et al., 2015; Long et al., 2014).
This paper’s strategy, which is complementary to those previously explored, is to train the network to produce segmentation-like internal representations, so that foreground pixels and background pixels within local patches can be treated differently. In particular, the aim is to increase the sharpness of the DCNN’s final output by using local pixel affinities to filter and re-weight the final layer’s activations. For instance, as can be seen in Figure 1, if a DCNN is centered on a “boat” pixel, but the surrounding patch includes some pixels from an occluder or the background, the DCNN’s final prediction will typically reflect the presence of the distractors by outputting a mix of “boat” and “background”. The approach of this paper is to learn and use semantic affinities between pixels, so that the DCNN output centered at the “boat” pixel can be strengthened by using information from other “boat” pixels within the patch. More generally, the approach allows the prediction at any pixel to be replaced with a weighted average of the similar neighboring predictions. This has the effect of sharpening the predictions at object boundaries, while making predictions within object boundaries more uniform.
The key to accomplishing this is to have the network produce internal representations that lend themselves to pairwise comparisons, such that any pair that lies on the same object will produce a high affinity measure, and pairs that straddle a boundary produce a low affinity measure. Prior work has investigated the use of affinity cues in similar contexts (Ren & Malik, 2003; Dai et al., 2014), but these required handcrafted algorithms for computing the affinity information, and would typically be pre-computed in a separate process. The current work is unique for learning the cues directly from image data, and for computing the affinities densely and “on the fly” within a DCNN.
The learned embeddings and their distance functions are implemented efficiently as convolution-like layers in Caffe (Jia et al., 2014). The embedding layers can either be trained independently, or integrated in the full DCNN pipeline and trained end-to-end (with or without per-pixel labels). Source code and trained embeddings will be publicly released.
This work is closely related to three major research topics in feature learning and computer vision: metric learning, segmentation-aware descriptor construction, and DCNNs.
The goal of metric learning is to produce features from which one can estimate similarity between pixels or regions in the input(Frome et al., 2007). Bromley et al. (1994) influentially began learning these descriptors in a convolutional network, and subsequent related work has yielded compelling results for tasks such as wide-baseline stereo correspondence (Han et al., 2015; Zagoruyko & Komodakis, 2015; Žbontar & LeCun, 2014). Recently, the topic of metric learning has been studied extensively in conjunction with image descriptors, such as SIFT and SID (Trulls et al., 2013; Simo-Serra et al., 2015), improving the applicability of those descriptors to patch-matching problems. Most prior work in metric learning has concerned the task of finding one-to-one correspondences between pixels seen from different viewpoints. The current work, in contrast, concerns the task of matching all pairs of points that lie on the same region. This requires a higher degree of invariance than has previously been necessary – not only to rotation, scale, and partial occlusion, but to objects’ interior details.
Segmentation-aware descriptors. The purpose of a segmentation-aware descriptor is to capture the appearance of the foreground while being invariant to changes in the background or occlusions. To date, most work in this domain has been on developing handcrafted segmentation-aware descriptors. For instance, soft segmentation masks (Ott & Everingham, 2009; Leordeanu et al., 2012) and boundary cues (Maire et al., 2008; Shi & Malik, 2000) have been used to augment features like SIFT and HOG, to suppress contributions from pixels likely to come from the background (Trulls et al., 2013, 2014). The intervening contours algorithm (Fowlkes et al., 2003) provides another type of affinity measure, used previously for image segmentation. The current work’s “embeddings” are a first attempt at developing fully-learned segmentation-aware descriptors. As a secondary contribution, the current work also implements intervening contours as a layer in a DCNN, using deep-learned boundary cues from another work Xie & Tu (2015). Since the boundary cues require a separate DCNN, this is meant to represent a costly alternative to the learned embeddings featured here.
DCNNs for semantic segmentation. Fully-convolutional DCNNs are fast and effective semantic segmentation systems (Long et al., 2014)
. Part of the appeal of DCNNs is they can be trained end-to-end, without the need for any handcrafted feature representations. However, DCNNs’ repeated subsampling (through strided convolution and max-pooling) presents an issue, because it reduces the resolution at which the DCNN can make predictions. This has been partially addressed by trainable up-sampling layers(Long et al., 2014), and the “hole” algorithm for convolution Chen et al. (2014), but state-of-the-art systems also attach a dense CRF Krähenbühl & Koltun (2011) to the DCNN to increase the sharpness of the output. The CRF can be trained as a separate module (Chen et al., 2014), or jointly with the DCNN (Lin et al., 2015), though both cases are at significant added computational cost. Another approach to the subsampling issue, more in line with the current paper, is to incorporate segmentation cues into the DCNN. Dai et al. (2014) recently used superpixels to generate masks for convolutional feature maps, enforcing sharp contours in their outputs. The current paper takes this idea further, by replacing the sparse handcrafted segmentation cues with dense learnable variants.
Contributions. In the light of the related work, this paper’s main contributions are as follows. First, the paper uses a DCNN architecture to learn pixel embeddings, such that pairwise distances between the embeddings indicate whether or not the pixels belong to the same region. Second, these embeddings (and their distance functions) are implemented as convolution-like layers in Caffe, with minimal computational overhead. Third, the learned embeddings are integrated with the state-of-the-art DeepLab semantic segmentation system, and this is shown to improve performance on the VOC2012 segmentation task.
This section establishes (1) how segmentation embeddings can be learned from pixel-wise labels, (2) how the embeddings can be merged with convolution, such that they can be learned without pixel-wise labels, and finally (3) how contour cues can be used to create an alternative affinity measure.
The goal of the current work is to train a set of convolutional layers to create dense “embeddings”, which can be used to calculate pixel affinities relating to the semantic similarity of the underlying regions. Pixels pairs that share a semantic category should produce similar embeddings ( _meaning:NTF . i.e _catcode:NTF a i.e. i.e., a high affinity), and pairs that do not share a semantic category should produce dissimilar embeddings ( _meaning:NTF . i.e _catcode:NTF a i.e. i.e., a low affinity).
This goal is represented in a loss function, which accumulates the quality of embedding pairs sampled across the image. In this work, pairwise comparisons are made between each pixel and its spatial neighbours . Collecting pairs within a fixed window lends simplicity and tractability, although in general the pairs can be collected at any range. Denoting the quality of a particular pair of embeddings with , the overall loss is defined as
The network is trained to minimize this loss through stochastic gradient descent.
The inner loss function represents how well a pair of embeddings and respect the affinity goal. Pixel-wise labels are a convenient resource for quantifying this loss, since they can provide information on whether or not the pixels belong to the same region. Using this information, the distance between embeddings can be optimized according to label parity. That is, same-label pairs can be optimized to have a small distance, and different-label pairs can be optimized to have a large distance. Denoting the label of pixel with , and the embedding at that pixel with , the inner loss is defined as
where and are design parameters that specify the “near” and “far” thresholds against which the embedding distances are compared. In this work, , and are used.
The embedding distances can be computed with any distance function. In this work, and norms were tried. Embeddings learned from both distances produced visually appealing masks, but the -based embeddings were found to be easier to train. Specifically, it was found that the -based embeddings can safely be trained with a higher learning rate than -based ones, because they are less vulnerable to the problem of exploding gradients. Figure 2 shows visualizations of the -based embeddings learned by the network.
Once these embeddings are learned, they can be used to create segmentation masks. For a pixel and a neighbour pixel , one can define
to be the weight applied to pixel in a mask centered on , where is a parameter specifying the hardness of the mask. This parameter can be learned inside a DCNN. The exponential function scales the masks to the range , where similar pixels are given values near , and dissimilar pixels are given values near .
These masks can be applied convolutionally, so that the output at location becomes
where is the input at location . If
is a vector, the mask is simply applied to every element of the vector. The effect of this is to replace each input with a weighted average of its similar neighbours. Since the affinities capture semantic similarity, this is expected to improve the quality of the output.
Finally, each output is normalized the sum total of the mask, so that the output magnitudes do not change as a function of neighbourhood size. With normalization, the masking equation (4) becomes
Note that if is an RGB value, and is a Gaussian that jointly captures RGB and geometric distance between pixels and , the masking equation (4) is equivalent to the bilateral filter (Tomasi & Manduchi, 1998), which is a well-known technique in signal processing for smoothing while preserving edges. Since the filter in the current work depends on the embeddings, and the embeddings are learned in a DCNN, the current approach represents a generalization of the bilateral filter. Interestingly, the Krähenbühl & Koltun (2011) algorithm for dense CRFs is also related to the bilateral filter, in the sense that the inference step, through mean field approximation, essentially accomplishes a repeated application of a non-linear filter. This shared connection is appropriate, since CRFs and embedding-based segmentation masks have common goals: to sharpen predictions at object boundaries while smoothing in the interior.
When the embeddings are integrated into a larger network that uses them for masks, the embedding loss function (1) is no longer necessary. Since all terms of the normalized masking equation (5) are differentiable, the global objective ( _meaning:NTF . e.g _catcode:NTF a e.g. e.g., classification accuracy) can be used to tune not only the input term , but also the mask term . Therefore, the embeddings can be learned end-to-end in the network when used to create masks.
In this work, the embeddings are trained first with a dedicated loss, then fine-tuned in the larger pipeline as masks. Figure 2 shows examples of the learned embeddings and masks, as compared with masks created by photometric color distances.
This work also explores the use of contour cues to generate pixel affinities. In particular, the interest is to see how contour-based affinities compare with the embedding-based affinities. Automatic boundary detection with DCNNs has recently attained excellent results (Xie & Tu, 2015), so contour-based affinity cues should be a strong baseline to compare against.
For contour cues, this work uses the learned contour cues of a state-of-the-art DCNN trained for the task, named the Holistically-nested Edge Detection (HED) network (Xie & Tu, 2015). For each pixel , the intervening contours algorithm (Fowlkes et al., 2003) is computed for each of its neighbours
, to determine the maximum probability of a contour being on a line that travels fromto . If two pixels and lie on different objects, there is likely to be a boundary separating them; the intervening contours step returns the probability of that boundary, as provided by the boundary cue. As with the embeddings, this step is implemented entirely within the DCNN. Intervening contours are computed with a specialized layer for the task.
This section first describes how the ideas of the technical approach were integrated in a DCNN architecture, and then establishes details on how the individual components were implemented efficiently as convolution-like DCNN layers.
Figure 3 illustrates the full network featured in this paper. The input image is sent to two parallel processing streams, which merge later: a DeepLab network (Chen et al., 2014), and an embeddings network. Both networks are modelled after the VGG-16 network (Chatfield et al., 2014). The DeepLab network is the multi-scale large field-of-view model from Chen et al. (2014).
The embeddings network has the following design. The first five layers are initialized from the earliest convolutional layers in VGG-16. There is a pooling layer after the second layer, and after the fourth layer, so the five layers capture information at different scales. The output from each of these layers is sent to pairwise distance computations () followed by a loss, so that each layer develops embedding-like representations. The idea of using a loss at each intermediate layer is inspired by Xie & Tu (2015), who used this strategy to learn boundary cues in a DCNN.
The outputs from the intermediate embedding layers are upsampled to a common resolution, concatenated, and sent to a randomly-initialized convolutional layer with filters and outputs. This layer learns a weighted average of the first five convolutional layers’ outputs, and creates the final 64-dimensional embeddings. The output of this layer trained in the same way as the others (with
and a loss), and is used as the final embeddings. The final embeddings are used to mask the output of DeepLab’s final convolutional layer ( _meaning:NTF . i.e _catcode:NTF a i.e. i.e., “fc-fusion”), and then sent to a softmax layer to form prediction scores.
To allow an evaluation that treats the embeddings as a modular upgrade to existing semantic segmentation systems, the DeepLab network was kept as a fixed component, and never fine-tuned with the masks. Better performance can be achieved by training the full pipeline end-to-end.
Although the size of the window used for computing embedding distances has an important effect at test time (since it specifies the radius in which to search for contributing information), the window size was not found to have a substantial effect at training time. The embeddings used in the experiments were trained with losses computed in windows, with a stride of .
To implement the intervening contours approach to pixel affinities, the state-of-the-art HED network Xie & Tu (2015) was used to compute boundary cues, and affinities were computed with the intervening contours algorithm. Cross-validation with a step size of 5 on the hardness parameter led to the choice of . Since the HED network has considerable memory requirements, achieving results directly comparable to those computed with embedding-based affinities is not actually feasible in the memory constraints of a Tesla K-40 GPU. To overcome this constraint, boundary cues were pre-computed for the entire PASCAL VOC validation set.
This section provides the implementation details that were required to efficiently integrate the embeddings, masks, and intervening contours, with DCNNs. Source code for this work will be made available online. All new layers are implemented both for CPU and GPU, and are as fast as im2col.
Computing pairwise distances densely across the image is a computationally expensive process. The current work implements this efficiently by solving it in the same way Caffe (Jia et al., 2014) realizes convolution: via an image-to-column (im2col) transformation, followed by matrix multiplication.
The current work implements dense local distance computation in a new DCNN layer named im2dist. For every position in the feature-map provided by the layer below, a patch of features is extracted from the neighborhood , and local distances are computed between the central feature and its neighbours. These distances are arranged into a column vector of length , where is the total dimensionality of a patch. This process turns an feature-map into an matrix, where each element in the dimension holds a distance.
To turn these distances into masks, the matrix is passed through an exponential function with a particular hardness. This corresponds to the mask term definition (3), where the hardness parameter is specified by . In this work, was chosen, based on cross-validation with a step size of .
To perform the actual masking, the input to be masked must simply be processed by (producing another matrix), then multiplied pointwise with the masking matrix, and summed across . This accomplishes the masking equation (4).
The resulting matrix of predictions can optionally be normalized. To create the normalizing coefficients, _meaning:NTF . i.e _catcode:NTF a i.e. i.e., the denominator in the normalized masking equation (5), the masking matrix must simply be summed across to create a mask sum for every location. The masked output can then be pointwise divided with the mask sums, creating the final normalized masked output.
The loss function for the embeddings (1) is implemented using similar computational techniques. First, the label image is processed with a new layer named . This creates an matrix in which for each pixel , the -dimensional column specifies (with ) whether or not the local neighbours have the same label. The result of this process can then be straightforwardly combined with the result of , to penalize each distance according to the correct loss case and threshold in the pairwise loss equation (2).
Finally, the intervening contours algorithm is implemented in a similar way, in a layer named im2interv. For every position in a boundary probability map provided by the layer below, a -dimensional column vector is generated, representing the intervening contour output for each position in a neighborhood centered on . Specifically, for each position in this neighborhood, a straight line is traced from that position to the center position (using the Bresenham (1965) algorithm), and the maximum boundary probability along that line is stored. The output of this process can be used in exactly the same way as the output of .
The baseline for the evaluation is the current best publicly-released DeepLab network (“Deep-MSc-Coco-LargeFOV”; Chen et al. (2014)
), which is a strong baseline for semantic segmentation. This model was initialized from a VGG network trained on ImageNet, then trained on the Microsoft COCO training and validation sets(Lin et al., 2014), and finally fine-tuned on training and validation sets of the PASCAL VOC 2012 challenge (Everingham et al., 2012). This network is augmented with embeddings learned on the COCO dataset. Additional baselines are provided by RGB distances, pre-computed state-of-the-art handcrafted Leordeanu et al. (2012) 8-dimensional embeddings (with default parameters), and pre-computed intervening contour affinities. All baselines were tested using a affinity window (applied as mask once).
Evaluation on the PASCAL VOC validation set is presented in Table 2. Note that the publicly-released DeepLab model was trained on the VOC trainval set, so results on the validation set cannot be understood to reflect performance at test time, but rather reflect training error. However, since the embeddings were not trained on any VOC data, improvements to this performance do reflect general improvements in the model. Accordingly, the experiments of this paper show that improvements on the validation set translate to improvements on the test set.
The results first of all show that using learned embeddings to mask the output of DeepLab systematically provides a 0.5% to 1.5% improvement in mean intersection-over-union (IOU) accuracy. , the improvements exceed those attainable by RGB, intervening contours, or handcrafted Leordeanu et al. (2012) embeddings. While the numerical difference between the performance of these affinity cues is small ( _meaning:NTF . e.g _catcode:NTF a e.g. e.g., there is a 0.03% difference between handcrafted embeddings and learned embeddings when both are computed in a and applied once), it is important to emphasize that the learned embeddings are uniquely capable of being fine-tuned. That is, this initial comparison uses the learned embeddings “off-the-shelf” (as they were learned from the COCO dataset), but realistic use would involve fine-tuning on all available data. The current work’s experiments on the VOC test set benefit from this fine-tuning.
Additional validation experiments reported in Table 2 explore the effects of two design critical parameters: filter window size, and the number of times to apply the filter. A wider window, though more expensive, is expected to improve performance by allowing information from a wider radius to contribute to each prediction. The approach was evaluated at window sizes of , , , and finally . The results confirm that increasing the filter size improves performance.
The second design parameter is the number of times to apply the filter. Once the embeddings and masks are computed, it is trivial to run the masking process repeatedly. Applying the process multiple times is expected to improve performance, by strengthening the contribution from similar neighbours in the radius. This second parameter also effectively increases the number of contributing neighbours: after filtering with filters, each new region effectively contains information from an area in the original input. Therefore, along with results from applying each filter once, results are presented for applying each filter the maximum possible number of times, given the memory constraints of a Tesla K-40 GPU. As expected, repeating the application of the filter improves performance. The best model applied a mask seven times recursively.
The best embedding configuration determined from the PASCAL VOC validation set was fine-tuned end-to-end in its full pipeline on the VOC trainval set, and submitted to the VOC test server. As shown in Table 2, improvement on the test set was approximately 1.2% over the baseline, roughly consistent with the results observed on the validation set.
As discussed earlier, dense CRFs are often used to sharpen the predictions produced by DCNN-based semantic segmentation systems like DeepLab. To test if the improvement offered by embedding-based masks continues through the application of the CRF, a dense CRF (Krähenbühl & Koltun, 2011) was trained on top of the mask-sharpened outputs, using the PASCAL VOC validation set for cross-validation of its hyper-parameters. As shown in Table 2, the embedding-augmented DeepLab outperforms the DeepLab-CRF baseline by 0.4%. Visualizations of the results are shown in Figure 4.
|DeepLab, RGB x1||78.30|
|DeepLab, Leo x1||78.86|
|DeepLab, IC x1||78.85|
|DeepLab, embeds x1||78.70|
|DeepLab, embeds x12||79.68|
|DeepLab, embeds x1||78.89|
|DeepLab, embeds x7||79.69|
|DeepLab, embeds x1||79.03|
|DeepLab, embeds x4||79.64|
|DeepLab, embeds x1||79.39|
|DeepLab, embeds x7||71.54|
|DeepLab-CRF, embeds x7||74.00|
This paper proposed a new deep convolutional neural network architecture for learning embeddings. Results showed that integrating the embeddings into a strong baseline DCNN systematically improved results by a noticeable margin on both validation and testing in the PASCAL VOC 2012 dataset. Compared to results achieved through RGB distances, intervening-contour based affinities with state-of-the-art boundary cues, and state-of-the-art handcrafted embeddings, the performance of learned embeddings is higher, despite having a much smaller memory footprint. This approach to improvement is orthogonal to many others pursued in semantic segmentation, and it is implemented efficiently in the popular Caffe deep-learning framework, making it a useful and straightforward augmentation to existing semantic segmentation frameworks. Finally, although semantic segmentation is the targeted application of the current work, the overall approach does not depend on pixel-wise labels, and the embedding and masking layers can be used in any task involving DCNNs.
Learning globally-consistent local distance functions for shape-based image retrieval and classification.In ICCV, pp. 1–8, 2007.