Full text
Article Depth Estimation and Semantic Segmentation from a Single RGB Image Using a Hybrid Convolutional Neural Network Xiao Lin 1,2*, Dalila Sánchez-Escobedo 2, Josep R. Casas 2, and Montse Pardàs2, 1 2 3 4 5 6 7 8 9 10 11 12 13 1 Visual Interactions and Communication Technologies (Vicomtech), Donostia/San Sebastián 20009, Spain 2 Image Processing Group, TSC Department, Technical University of Catalonia (UPC), Barcelona, 08034, Spain; [email protected] (D.S.-E.); [email protected] (J.R.C.); [email protected] (M.P.) * Correspondence: [email protected] Version April 14, 2019 preprint accepted for Journal Sensors Abstract: Semantic segmentation and depth estimation are two important tasks in computer vision, and many methods have been developed to tackle them. Commonly these two tasks are addressed independently, but recently the idea of merging these two problems into a sole framework has been studied under the assumption that integrating two highly correlated tasks may benefit each other to improve the estimation accuracy. In this paper, depth estimation and semantic segmentation are jointly addressed using a single RGB input image under a unified convolutional neural network. We analyze two different architectures to evaluate which features are more relevant when shared by the two tasks and which features should be kept separated to achieve a mutual improvement. Likewise, our approaches are evaluated under two different scenarios designed to review our results versus single-task and multi-task methods. Qualitative and quantitative experiments demonstrate that the performance of our methodology outperforms the state of the art on single-task approaches, while obtaining competitive results compared with other multi-task methods. Keywords: depth estimation; semantic segmentation; convolutional neural networks; hybrid architecture 14 1. Introduction15 Semantic segmentation and depth information are intrinsically related, and both pieces of 16 information need to be considered in an integrated manner to succeed in challenging applications, such 17 as robotics [ 1 ] or autonomous navigation [ 2 ]. In robotics, performing tasks in interactive environments 18 requires identification of objects as well as their distance from the camera. Likewise, autonomous 19 navigation applications need a 3D reconstruction of the scene as well as semantic information to 20 ensure that the agent device has enough information available to carry out the navigation in a safe 21 and independent manner. Although RGB-D sensors are currently being used in many applications, 22 most systems only provide RGB information. Therefore, addressing depth estimation and semantic 23 segmentation under a unified framework is of special interest.24 On the other hand, deep learning techniques have shown extraordinary success in both tasks [ 3 ] in 25 recent years. In this context, the feature-extraction process for a specific task is modeled as a parameter 26 estimation problem in Convolutional Neural Networks (CNNs) which is based on a set of training 27 data. In other words, the feature extractors are created by learning from the prior knowledge that we 28 have. This provides a possibility of combining different tasks (different sources of prior knowledge) 29 when training the feature extractors, in particular for highly correlated tasks such as depth estimation 30 and semantic segmentation. Specifically, the idea of integrating the depth estimation and semantic 31 segmentation into a sole structure is motivated by the fact that both segmentation information and 32 Preprint accepted for Sensors Journal, pages 1 – 20 www.mdpi.com/1424-8220/19/8/1795
Version April 14, 2019 preprint accepted for Sensors Journal 2 of 20 depth maps represent geometrical information of a scene. In this manner, the feature extractors can be 33 better trained due to the enriched prior knowledge.34 In this paper, we introduce a hybrid convolutional network that integrates depth estimation 35 and semantic segmentation into a unified framework. We propose to build a model where the 36 features extracted are suitable for both tasks, thus leading to an improved accuracy in the estimated 37 information. One of the main advantages of the proposed approach is the straightforward manner 38 semantic segmentation and depth map are estimated from a single image, providing a feasible solution 39 to these problems.40 2. Related Work41 Depth estimation and semantic segmentation are two widely studied problems in the image 42 processing community and recently have been tackled through deep learning techniques due to its 43 successful results in terms of accuracy and efficiency. This section makes a review of the state of the art 44 introducing, first, single-task approaches, and, afterwards, methods focused on solving multiple tasks. 45 2.1. Single-Task Approaches46 2.1.1. Semantic Segmentation47 Semantic segmentation is a methodology which approaches the image segmentation problem by 48 performing pixel-level classifications. Compared to the traditional image segmentation approaches, such 49 as superpixel segmentation methods [ 4 , 5 ], active contour methods [ 6 , 7 ] and watershed segmentation 50 methods [ 8 , 9 ], it introduces semantics in an image segmentation process by employing a classifier 51 trained on the annotated data. Although semantic segmentation methods generally have limited 52 genericity due to the predefined semantics in the annotations, the advantage of semantic segmentation 53 is obvious. The introduced semantics provide higher level knowledge which helps obtain more 54 meaningful segments in comparison to homogeneous regions.55 Before CNN-based techniques were applied to semantic segmentation; handcrafted features 56 were usually employed to represent pixels when training the classifier [ 10 ]. The emergence of 57 CNN-based techniques provide an approach that trains neural networks to extract features with 58 higher discriminative power. One of the first well known works that applies CNNs to semantic 59 segmentation is Fully Convolutional Networks (FCN) [ 11 ]. It popularizes CNN architectures for dense 60 predictions without any fully connected layers. This allowed segmentation maps to be generated for 61 images of any size and it also reduces the number of parameters in the architecture since no fully 62 connected layers are involved. Almost all the subsequent state-of-the-art approaches on semantic 63 segmentation adopted this paradigm.64 Apart from fully connected layers, one of the main problems of using CNNs for segmentation are 65 the pooling layers. Pooling layers increase the field of view and are able to aggregate the context while 66 discarding the ‘where’ information. However, semantic segmentation requires the exact alignment 67 of class maps and thus, needs the ‘where’ information to be preserved. Two different classes of 68 architectures evolved in the literature to tackle this issue.69 The first one is the encoder-decoder architecture. The encoder gradually reduces the spatial 70 dimension with pooling layers and the decoder gradually recovers the object details and spatial 71 dimension. There are usually shortcut connections from the encoder to the decoder to help the decoder 72 recover the object details better. U-Net [ 12 ] is a popular architecture from this class. It consists of 73 a contracting path to capture context in the encoder and a symmetric expanding path from the encoder 74 layers to the decoder layers that enables precise localization. Seg-Net [ 13 ] is proposed based on 75 FCN. It introduces more shortcut connections between the encoder and the decoder. Furthermore, 76 it copies the indices from the max-pooling layers in the encoder to the decoder instead of copying 77 the encoder features as in FCN, which makes easier for SegNet to recover the spatial information and 78 provides more memory efficiency than FCN. Ghiasi et al. [ 14 ] present a Laplacian pyramid for semantic 79
Version April 14, 2019 preprint accepted for Sensors Journal 3 of 20 segmentation refinement incorporating, into the decoding step, the spatial information contained in 80 the high-resolution feature maps to keep the spatial information destroyed after pooling. Thus, a better 81 dense pixel-accurate labeling is obtained.82 Architectures in the second class use what are known as dilated/atrous convolutions [ 15 – 17 ]. 83 Pooling layers help in classification networks because they increase the receptive field of a network. 84 However, as mentioned, this is not suitable for a semantic segmentation task since pooling drops the 85 spatial information and decreases the resolution. Dilated/Atrous convolutions can compute responses 86 at all image positions with an n times larger receptive field if the full resolution image is convolved 87 with a filter ‘with holes’, in which the original filter is upsampled by a factor n , and zeros are introduced 88 in between filter values. Although the effective filter size increases, it is only necessary to take into 89 account the non-zero filter values, hence both the number of filter parameters and the number of 90 operations per position stay constant.91 2.1.2. Depth Estimation92 One of the first works to tackle the depth estimation problem using CNNs is the one presented 93 in [ 18 ]. They used a novel network architecture made of two main components. First, a coarse-scale 94 network estimates a low-resolution depth map from a single image. Then, this depth estimation along 95 with the original image becomes the input of the fine-scale network. In this way, the local network can 96 incorporate finer-scale details in the global prediction. Additionally, they also apply a scale-invariant 97 error to help measure depth relations instead of scale.98 Likewise, a similar work based on [ 18 ] is presented in [ 19 ]. In this approach the authors included 99 an extra part to the model presented by [ 18 ] that estimates gradient information. The idea behind 100 this additional part is to improve the fine-tuning part by adding gradient information along with the101 global depth estimation and the input image. Additionally, a normalized loss function was applied 102 resulting in a better depth estimation.103 2.2. Multi-Task Approaches104 Approaches addressing depth estimation and semantic segmentation with multi-task learning 105 schemes are receiving large attention due to its potential of improving the performance of multiple 106 tasks. The idea of merging tasks in one architecture is motivated by the fact that different correlated 107 tasks commonly share some basic attributes in the parsing process. Approaching them together 108 may be mutually beneficial. In practice, multi-task approaches in the state of the art seek to extract 109 features suitable to perform diverse tasks at a time, which lead to an improvement in both estimated 110 information and simplification of systems where multiple modalities are required, such as autonomous 111 navigation [2], robotics [1] or augmented reality [20].112 In [ 21 ], the authors provide a common network which can be used for different tasks, including 113 the estimation of depth map, surface normals, and semantic segmentation. Although these tasks are 114 not all addressed jointly, it proves that a network for a specific task can be obtained by fine-tuning 115 a network with the same architecture trained for another correlated task. The results obtained by [ 21 ] 116 outperformed the ones presented in [ 18 ] proving how the strategy of tackling multiple tasks with 117 a common network may lead to a better performance.118 In [ 22 ] a unified framework was proposed, which incorporates global and local prediction where 119 the consistency between depth and semantic segmentation is learned through a joint training process. 120 From an input image, they first used a CNN to jointly predict a global depth map and semantic labels. 121 Then, they decompose the image into local regions to train another CNN which predicts the depth 122 map and the semantic labels for each region. With global and local predictions, they re-formulate 123 the problem into a two-layer hierarchical conditional random field to produce the final depth and 124 semantic map.125 A more recent multi-task approach is introduced in [ 23 ]. The methodology proposed in this work 126 makes initial estimations for depth and semantic label at a pixel level through a joint network. Later, 127
Version April 14, 2019 preprint accepted for Sensors Journal 4 of 20 depth estimation is used to solve possible confusions between similar semantic categories and thus to 128 obtain the final semantic segmentation.129 Another multi-task approach by Teichmann et al. [ 24 ] presents a network architecture named 130 MultiNet that can perform classification, semantic segmentation, and detection simultaneously. They 131 incorporate these three tasks into a unified encoder-decoder network where the encoder stage is 132 shared among all tasks and specific decoders for each task produce outputs in real time. These 133 work efforts were focused on improving the computational efficiency for real-time applications as 134 autonomous driving.135 A similar approach is Pixel-Level Encoding and Depth Layering (PLEDL) [ 25 ], this work extended 136 a FCN [ 11 ] with three output channels jointly trained to estimate semantic labeling, direction to the 137 instance center and depth at pixel level.138 Table 1presents a brief comparison on the pros and cons between different types of methods. 139 Traditional image segmentation approaches [ 4 – 9 ] usually perform low-level segmentation, which 140 obtain the segments with more general assumptions, such as local homogeneity. On the other hand, 141 semantic segmentation methods [ 10 , 11 , 13 , 16 , 26 ] improve image segmentation by introducing semantic 142 annotations, which provide higher level meaning (semantics at object level) rather than low-level 143 features exploited in traditional methods. Approaches under multi-task learning schemes, such as 144 the proposed approach and [ 21 , 25 ] exploit the correlation between semantic segmentation and depth 145 estimation to benefit each of the tasks, which generate both image segmentation and depth estimation 146 taking as input a single-color image. Unlike the multi-task methods in the state of the art [ 21 , 25 ], the 147 proposed approach focuses on separating the commons and distinctions between the two tasks, which 148 obtains promising results shown in our experiments.149 Table 1. A comparison of different types approaches. Unsupervised Object Level Segm. Depth Estimation Joint Estimation Ours × Eigen [21]× × PLEDL [25]× Superpixel [4,5]× × - Active Contour [6,7]× × - Watershed [8,9]× × - Semantic Segm. [10,11,13,16,26]××- Depth Prediction [19]× × - 2.3. Our Proposal150 Multi-task approaches aim to directly estimate the segmentation and depth maps from an input 151 color image by unifying CNNs working for a single task into a sole hybrid convolutional neural 152 network. Most of the state-of-the-art works unify tasks under a feature-extraction block whose output 153 becomes the input of a group of decoders designed to carry out each task.154 In our preliminary work [ 27 ], we presented a hybrid network for a multi-task learning scheme 155 that benefits both semantic segmentation and depth estimation, and its application to autonomous 156 driving scenes. This hybrid network employs a global depth estimation network to estimate separately 157 the global layout of a scene from the input image additionally to the common feature extraction.158 In this paper, we focus on comparing different hybrid network unifying strategies and 159 investigating how those two tasks help each other. More specifically, we employ two unifying 160 strategies, one from the hybrid architecture proposed in our previous work [ 27 ] and the other from 161 the state-of-the-art works [ 21 , 23 , 24 ]. In the experiments, we compare the performances obtained from 162 different hybrid architectures, named HybridNet A1 and A2 (see Figures 1and 2), by applying different 163 unifying strategies to the same single-task architectures, in order to clarify how the two tasks help 164 each other in a hybrid system. We also apply them to the more challenging indoor scenes to verify the 165 validity of the unifying strategy.166
Version April 14, 2019 preprint accepted for Sensors Journal 5 of 20 Refining Network Upsampling Network Color Image Features Network Semantic Segmetnation Network Depth Estimation Network Depth Map Segmentation Mask Input/Output Semantic Segmentation Network Figure 1. Architecture 1 Figure 2. Architecture 2 The rest of the paper is organized as follows: in Section 3we introduce the proposed methodology; 167 the detailed explanation of the proposed architectures is presented in Section 4, as well as the training 168 details. In Section 5, we present the experiment results of our approach in different datasets and 169 compare our approach with state-of-the-art approaches. Finally, conclusions are drawn in Section 6.170 3. Hybrid Convolutional Framework171 In this section, a general explanation of our hybrid convolutional neural network and its 172 application to depth estimation and semantic segmentation is presented. To this end, a description 173 about the two single-task architectures [ 16 , 19 ] employed in our approach is first presented. Then, we 174 describe the proposed hybrid architecture along with a discussion to approach the problem of how to 175 unify two tasks under one sole framework.176 The depth estimation architecture [ 19 ], denoted as DepthNet in this paper, is made of three 177 components: global depth network, gradient network, and refining network, as shown in Figure 3. 178 These three components all follow AlexNet structure. DepthNet first estimates a depth map of the 179 scene at a global level from the single input RGB image via a global depth network. Meanwhile, 180 it predicts two depth gradient maps from the input RGB image via a gradient network. Finally, 181 a refining network uses the input image along with depth gradient maps to locally refine the global 182 depth map and thus produce a better detailed depth map. As explained in [ 19 ], the three components 183 in DepthNet are trained separately. For training the global depth network, the downsampled depth 184 maps are used as the ground truth. Beside the global depth network, the gradient network is trained 185 based on the magnitude of depth gradient on x and y direction computed from the depth map. Along 186 with the global depth network and gradient network, the refining network is again trained on the 187 downsampled depth maps in the training data.188 There are two main reasons to consider employing DepthNet as the depth estimation component 189 in our approach: (1) DepthNet follows the state-of-the-art framework for depth estimation which is 190 representative for a bunch of methods. (2) DepthNet has a modularized architecture, which allows us 191 to analyze each of the components in it and better integrate DepthNet into a hybrid architecture.192
Version April 14, 2019 preprint accepted for Sensors Journal 6 of 20 Figure 3. Depth estimation network. The semantic segmentation architecture [ 16 ] shown in Figure 4, is divided into two main parts: 193 feature network and atrous upsampling network. For the feature network, it follows the VGGNet 194 architecture proposed in [ 28 ]. It is in charge of extracting robust features from the input image, which 195 benefits from the deep structure of the network. On the other hand, the atrous upsampling network is 196 a group of atrous spatial pyramid pooling layers [ 16 ] which outputs a class score map with the number 197 of channels equal to the number of labels. Atrous upsampling layers allows us to explicitly control 198 the resolution at which feature responses are computed within the architecture, while enlarging the 199 field of view of filters to incorporate larger context in the semantic segmentation task. The semantic 200 segmentation architecture is denoted as DeepLab-Atrous Spatial Pyramid Pooling (DeepLab-ASPP) in 201 this paper. In DeepLab-ASPP, all parts are trained together.202 Figure 4. Semantic segmentation network. DeepLab-ASPP is employed as the semantic segmentation component in our approach due to its 203 outstanding performance in this task.204 Unifying Single-Task Architectures for Multi-Tasks205 Considering the functionality of each component in DepthNet and DeepLab-ASPP, we propose 206 and compare two different hybrid architectures for the joint depth estimation and semantic 207 segmentation task.208 Architecture 1: An intuitive way to unify two tasks in a sole architecture is to totally share the 209 feature-extraction process for both tasks. It follows the idea from the most representative architectures 210 in the state of the art [ 21 , 23 , 24 ], in which a common convolutional network is shared for extracting 211 features. Following the feature-extraction block, customized layers are used for each task, to decode the 212 commonly extracted features and apply them in different tasks. Sharing the feature-extraction process 213 for different tasks with a common convolutional network links the two tasks, since the parameters 214 of the shared network are optimized with respect to the losses defined on both tasks in the training 215 phase. The advantage of this architecture is obvious. Since most of the layers are shared for both tasks, 216 less parameters are involved in the training process, which makes it easy to be trained. In practice, 217 we exploit the VGG structure [ 28 ] as the feature-extraction network for both tasks. Based on the 218
Version April 14, 2019 preprint accepted for Sensors Journal 7 of 20 extracted features, the atrous upsampling network in DeepLab-ASPP is employed for the semantic 219 segmentation task, while the refining network in DepthNet is leveraged as the decoder for the depth 220 estimation task. We denote the architecture 1 as HybridNet A1 in the rest of this paper.221 Architecture 2: The motivation of building this architecture is to further clarify the common and 222 specific attributes in the two tasks. Thus, we build the hybrid network by substituting the gradient 223 network in DepthNet by a common feature-extraction network for the two tasks, while keeping the 224 global depth estimation network only for the depth task. The advantages of this hybrid architecture 225 are two-fold. On one hand, the strong power of extracting object information from a color image 226 learned in the semantic segmentation task can also benefit depth layering when predicting a depth 227 map, while the strong power of extracting rich depth boundaries from a color image learned in the 228 depth estimation task is shared in the semantic segmentation task to improve segmentation accuracy229 on object boundaries. On the other hand, the global layout of the scene which is more relevant in depth 230 estimation than in semantic segmentation is estimated independently by a global network in the depth 231 estimation task. This avoids interfering the common feature extraction for both tasks. In practice, 232 we keep the global network and refining network in DepthNet without changes, while replacing the 233 structure of the gradient network with the VGG structure, in order to keep the structure consistent 234 with the feature network in DeepLab-ASPP. We denote the architecture 2 as HybridNet A2 in the rest 235 of this paper.236 4. Architecture Details237 Since the proposed architectures are assembled with basic components in the two single-task 238 architectures, we explain the detail of the proposed architectures by describing the two single-task 239 architectures in this section.240 4.1. Depth Estimation Network241 As described in Section 3, the depth estimation network is modularized to calculate a refined 242 depth map from a single input image through a three stages convolutional network. As shown in 243 Figure 3, the global depth network is formed by 5 convolutional layers and two fully connected layers, 244 which corresponds to the architecture of AlexNet [ 29 ]. Following each convolutional layer, a Rectified 245 Learner Unit (ReLU) is introduced as an activation function to provide non-linearity to the system. 246 Local normalization is also performed after each convolutional layer in a Local Response Normalization 247 layer (LRN), which helps the generalization of the system. Max-pooling layers are placed after the first 248 and the last convolutional layer to provide basic translation invariance to the internal representation 249 and reduce the number of parameters of the system. In this network max-pooling is performed over 250 a 3 × 3 window with a stride of 2. Since the global depth network aims at describing the global layout 251 of the scene, we introduce two fully connected layers following the last convolutional layer, to capture 252 the information contained in the intermediate representation with the full receptive field. In practice, 253 1024 neurons are included in the first fully connected layer while 1681 neurons are included in the 254 second fully connected layer. We reshape the 1681 neurons to a 41 by 41 matrix which is treated as the 255 output of the global depth network. In this manner, we predict a global depth map with 1 8resolution256 for an input image with size 321 by 321.257 The gradient network aims at estimating depth gradient from an input color image. In practice, 258 we employ the same architecture used in global depth estimation except for the fully connected layers. 259 Finally, the refining network takes the concatenation of the output from the global depth network, 260 the gradient network, and the color image as input and computes a refined depth map. The refining 261 network improves the rough estimate from the global depth network, using gradients estimated by 262 the gradient network and an input color image. In practice, the first convolutional layer processes the 263 input color image, followed by a ReLU layer, an LRN layer, and a max-pooling layer, which produces 264 the feature maps extracted from the color image. These feature maps are concatenated with outputs of 265 the global depth network and the gradient network, then are fed to the remaining four convolutional 266
Version April 14, 2019 preprint accepted for Sensors Journal 8 of 20 layers. Each of them is followed by a ReLU layer. The output from the 5th convolutional layer in the 267 refining network is treated as the output (a refined depth map with size 81 by 81).268 4.2. Semantic Segmentation Network269 Figure 4presents an overview of semantic segmentation network. This figure shows in a detailed 270 manner how the input image is processed by first going through a group of convolutional layers for 271 feature extraction (feature network) and then through an upsampling procedure which finally provides 272 the segmentation map (upsampling network). Dividing this architecture into two parts helps us to 273 understand it as a single-task network but also how it can be integrated into a hybrid model.274 The feature network contains 5 groups of convolutional layers, forming a deep architecture. 275 All these convolutional layers have the same kernel size 3 × 3. For simplicity, we only plot 276 the convolutional kernel in the first convolutional layer in the feature network. Following each 277 convolutional layer, a ReLU layer is provided as the activation function. Pooling layers are placed after 278 each group of convolutional layers to reduce the computational cost by downsampling the internal 279 representation, as well as to provide basic translation invariance to the internal representation.280 On the other hand, the atrous upsampling network contains 4 parallel groups of three 281 convolutional layers, to perform upsampling operation at different scales. Each branch upsamples the 282 output from the feature network at the first convolutional layer with an atrous convolution. An atrous 283 convolution employs a dilated convolution template, in which a convolution template is enlarged by284 filling zeros with respect to a defined rate. In this manner, we can explicitly control the resolution 285 of the upsampling operation and enlarge the field of view of filters to incorporate larger context in 286 the semantic segmentation task without introducing more parameters. In practice, we employ atrous 287 convolutions with rates 6, 12, 18, 24 respectively for each branch. The other 2 convolutional layers in 288 each branch perform 1 × 1 convolutions, which increases the non-linearity of the decision function 289 without affecting the receptive fields of the convolutional layers. Taking the output of the 4 branches 290 of upsampling layers as input, a soft-max layer produces the final semantic segmentation mask.291 4.3. Training Details292 As explained in the Section 3, the two proposed architectures (HybridNet A1 and A2) are based on 293 DeepLab-ASPP [ 16 ] and DepthNet [ 19 ]. Although HybridNet A1 and A2 are constructed by merging 294 single-task architectures, the training process for the hybrid architectures are not always performed as 295 in those single-task architectures.296 In HybridNet A1, we initialize the feature network and the atrous upsampling network with the 297 model provided by DeepLab [ 16 ] which was pre-trained for classification purpose on ImageNet. The 298 other parts in HybridNet A1 are initialized using a Random Number Generator (RNG). The RNG is 299 set to be a Gaussian distribution with zero mean and 0.1 variance.300 In HybridNet A2, we initialize the feature network and upsampling network before the training 301 process using again the model provided by DeepLab [ 16 ]. Additionally, we initialize the global depth 302 network using the model provided in [ 19 ]. The other parts in HybridNet A2 are randomly initialized 303 using the same RNG.304 Once we have the initialization for our hybrid architecture, all of its components are trained 305 simultaneously. Both hybrid architectures are trained for 100 K iterations with a learning rate 2.5 × 10 −6 , 306 polynomial learning rate decay policy. The momentum is set to 0.9 and weight decay 0.005. The input 307 image is randomly cropped with a size 320 × 320. We set batch size to 7, regarding the maximum 308 allowance of memory.309 The loss function used in both architectures is the same. For the semantic segmentation task, LS 310 is the sum of the cross-entropy terms for each spatial position in the output class score map, being 311 our targets the ground truth labels. All positions and labels of the output class score map are equally 312 weighted in the overall loss function except for those unlabeled pixels which are ignored. The loss 313 function used for the depth estimation task is made by two Euclidean loss layers LDabs and LDmvn . 314
Version April 14, 2019 preprint accepted for Sensors Journal 9 of 20 LDabs computes the Euclidean distance between absolute values of a depth map in the ground truth 315 and the estimated depth map, while the LDmvn computes the Euclidean distance between estimation 316 and ground truth after performing a mean variance normalization on both of them. LDabs stands 317 for a pixel-level metric which evaluates locally how well the estimated depth value matches the 318 ground truth regardless of the geometry of the scene. On the other hand, LDmvn introduces a global 319 regularization in the depth estimation by aligning depth values in both the estimation and the ground 320 truth to zero mean and unit variance.321 The hybrid loss function LHis therefore defined as the linear combination of them:322 LH=αLS+ (LDabs +LDmvn )(1) where α is the term used to balance the loss functions of the depth estimation and semantic 323 segmentation tasks. In our experiments, α is set to 1000, given an analysis on the values of LDabs +LDmvn 324 and LSrespectively, when training them separately in the single-task architectures.325 5. Experiments326 We quantify the performance of the proposed architectures on both semantic segmentation and 327 depth estimation in different scenes using our Caffe implementation. We first evaluate the proposed 328 architectures in road scenes which is of current practical interest for various autonomous driving 329 related problems. Secondly, the proposed architectures are evaluated in indoor scenes which is of 330 immediate interest to possible augmented reality (AR) applications.331 5.1. Road Scene332 In this section, we present the evaluation of the proposed architectures in road scenes. Several 333 road scene datasets are available for semantic parsing [ 30 – 32 ]. Since we evaluate the proposed 334 architecture from both semantic segmentation and depth estimation perspective, we employ Cityscapes 335 dataset [ 32 ] in our experiment, which provides not only the ground truth of semantic labels but the 336 depth information of each frame. Cityscapes contains 5000 RGB images manually selected from 337 27 different cities for dense pixel-level annotation to ensure high diversity of foreground objects, 338 background, and overall scene layout. Along with each of the 5000 RGB images, Cityscapes dataset 339 provides the depth map obtained from a stereo vision system. The 5000 images in the dataset are split 340 into 2975 training RGB images of size 1024 × 2048 along with their corresponding 2D ground truth 341 object labels for 19 outdoor scenes classes and depth information, 500 RGB images for test validation 342 with their corresponding annotations and, for benchmarking purposes, 1525 test RGB images.343 In practice, the training process of our approach was performed using the 2975 images of 344 Cityscapes training set that provides a depth map and object labels of 19 classes for each RGB 345 image. To evaluate the performance of the proposed architectures, we group the 500 images of 346 the validation set and the 1525 images of the test set in the Cityscapes dataset into a single evaluation 347 set of 2025 images. In the training phase, images in the training set are shuffled and randomly cropped 348 to fit the input image size of the hybrid architecture. Training data augmentation is done by flipping 349 and mirroring the original images, to enlarge the training set. In the testing phase, we crop the test 350 image with the original size of 1024 × 2048 into a group of images with the size of 321 by 321 which 351 cover the whole test image while having the minimum overlapped area. These images are tested one 352 by one and grouped to obtain the final prediction of the segmentation mask and depth map. Please 353 note that a score map is obtained for each image, which shows the degree that a pixel belongs to a label. 354 For the overlapped area, we compare the normalized score maps and take the label with higher score 355 as predicted labels on the segmentation mask. Likewise, for the overlapped area, the predicted depth 356 values on the depth map are computed as the mean values.357 Our first aim is to determine if the features obtained in the shared part of the proposed 358 architectures solving the two tasks simultaneously provide better results than the ones that we would 359
Version April 14, 2019 preprint accepted for Sensors Journal 16 of 20 Figure 9). Each of the VGG structures takes the output of the previous one along with the input color 518 image as its input. Among the three tasks, depth estimation, and surface normal estimation are two 519 tasks tackled jointly, which means that these two tasks share the network in scale 1 while the networks 520 in scale 2-3 are separately assembled for each task. For the semantic segmentation task, the architecture 521 shown in Figure 9is used again. However, different from the other two tasks, the architecture of 522 semantic segmentation allows two additional input channels which are depth and normal channels. 523 This architecture is only fine-tuned from the model previously trained on depth and normal estimation 524 to generate semantic segmentation masks.525 Figure 9. The hybrid architecture proposed in Eigen [21]. Although the source code of this method was not available, the performance evaluation is reported 526 in a public dataset (NYU Depth V2 dataset [ 35 ]). To make the comparison with this approach, we 527 trained and evaluated our approach on NYU Depth V2 dataset. This data set includes RGB images 528 and their corresponding 2D ground truth object labels for 40 indoor scene classes and depth map. 529 NYU depth V2 dataset is divided into 795 images for training and 654 for testing. Due to the small 530 number of images available for training, we augment the training set by random cropping, flipping, 531 and mirroring.532 Tables 7and 8show the quantitative results of HybridNet A2 for both tasks and provides 533 a comparison with the approach proposed in [ 21 ], denoted as Eigen. Semantic segmentation results in 534 Table 7show that HybridNet A2 outperforms Eigen in class average accuracy (C) and mean intersection 535 over union (mIoU) while keeping similar results than Eigen in Global accuracy (G). It also illustrates 536 that addressing RGB-D-based semantic segmentation task under a multi-task learning scheme better 537 uses the depth information than directly feeding the depth information to the network as an extra 538 input channel. On the other hand, depth estimation results in Table 8show that HybridNet A2 has 539 a better performance in the relative measure SIE, while in the absolute measures Eigen outperforms 540
Version April 14, 2019 preprint accepted for Sensors Journal 17 of 20 HybridNet A2. The better performance of HybridNet A2 in the relative measure shows that HybridNet 541 A2 has a better depth layering capability than Eigen, which is more relevant in real applications. For 542 absolute measures, we believe that the worse performance of HybridNet A2 is due to the weaker 543 ability in describing the global layout of the scene. HybridNet A2 employs a much simpler architecture 544 (AlexNet structure) for global depth network compared with the network of scale 1 (VGG structure) 545 in Eigen.546 Table 7. Quantitative segmentation results on NYU V2: G, C and mIoU (best results in bold). G C mIoU HybridNet A2 64.7 48.4 36.5 Eigen [21]65.6 45.1 34.1 Table 8. Depth estimation results on NYU V2 Quantitative evaluation: PP, PP-MVN, ARD, SRD, RMSE-linear, RMSE-log, and SIE (best results in bold). HybridNet A2 Eigen [21] γ<1.25 (MVN) 0.7293 - SIE 0.1571 0.171 γ<1.25 0.5006 0.769 γ<1.2520.8013 0.95 γ<1.2530.9422 0.98 ARD 0.2787 0.158 SRD 0.3236 0.121 RMSE-linear 0.9423 0.64 RMSE-log 0.3219 0.214 6. Conclusions and Future Work547 In this paper, we have introduced a methodology for depth estimation and semantic segmentation 548 from a single image using a unified convolutional network. The main goal of the proposed method 549 is to seek for a better hybrid architecture of CNNs that modularizes the feature-extraction process 550 by separating it into distinct feature extraction for a specific task and common feature extraction for 551 both tasks. In this manner, both tasks can benefit from the extracted common features without being 552 affected by those features only relevant to one task, which leads to a better performance. We also 553 prove that solving correlated tasks such as semantic segmentation and depth estimation together can 554 improve the performance of methods tackling the tasks separately.555 The qualitative and quantitative results shown in Section 5demonstrate that the unifying strategy 556 employed in HybridNet A2 produces a better hybrid architecture for semantic segmentation and 557 depth estimation compared to Hybrid A1. Hybrid A2 outperforms the results obtained by single-task 558 approaches, which proves that sharing underlying feature extraction helps to improve the final 559 performance in both tasks. Likewise, it is also proved that our methodology obtains comparable results 560 to benchmarking hybrid approaches.561 On the other hand, there are also some interesting problems pending for a future study:562 • Designing better loss functions for a multi-task learning scheme. The loss function employed in the 563 state-of-the-art approaches is normally a balanced linear combination of losses for single tasks. 564 However, these losses may have totally different physical meaning regarding the tasks (e.g., 565 cross entropy and Euclidean loss), which makes it hard to combine them. Finding higher level 566 evaluation metrics helps define the loss function for a multi-task learning system. For instance, 567 evaluating on the prediction of the 3D oriented bounding box of objects requires using both 568 semantic segmentation and depth estimation result, which naturally combines the loss function 569 for both tasks.570
Version April 14, 2019 preprint accepted for Sensors Journal 18 of 20 • Applying to higher level tasks requiring 3D analysis. Since the proposed approach produces an 571 object level segmentation and a depth map of an input image, applying the estimated result to 572 applications requiring 3D analysis (such as traffic violation detection) will be of great interest.573 Author Contributions: Conceptualization, X.L., J.R.C. and M.P.; Formal analysis, X.L.; Investigation, X.L. 574 and D.S.-E.; Methodology, X.L. Supervision, J.R.C. and M.P.; Validation, D.S.-E.; Writing—original draft, X.L.; 575 Writing—review & editing, X.L., D.S.-E., J.R.C. and M.P.576 Funding: This work has been developed in the framework of project MALEGRA TEC2016-75976-R, financed by577 the Spanish Ministerio de Economia y Competitividad and the European Regional Development Fund (ERDF).578 Conflicts of Interest: The authors declare no conflict of interest.579 References580 1. Ball, D.; Ross, P.; English, A.; Milani, P.; Richards, D.; Bate, A.; Upcroft, B.; Wyeth, G.; Corke, P. Farm workers 581 of the future: Vision-based robotics for broad-acre agriculture. IEEE Robot. Autom. Mag. 2017,24, 97–107.582 2. Shah, U.; Khawad, R.; Krishna, K.M. DeepFly: Towards complete autonomous navigation of MAVs with 583 monocular camera. In Proceedings of the Tenth Indian Conference on Computer Vision, Graphics and Image 584 Processing, Guwahati, India, 18–22 December 2016; ACM: New York, NY, USA, 2016; p. 59.585 3. Leo, M.; Furnari, A.; Medioni, G.G.; Trivedi, M.; Farinella, G.M. Deep Learning for Assistive Computer 586 Vision. In Proceedings of the European Conference on Computer Vision, Munich, Germany, 8–14 September 587 2018; pp. 3–14.588 4. Yang, J.; Gan, Z.; Li, K.; Hou, C. Graph-based segmentation for RGB-D data using 3-D geometry enhanced 589 superpixels. IEEE Trans. Cybern. 2015,45, 927–940.590 5. Stutz, D.; Hermans, A.; Leibe, B. Superpixels: An evaluation of the state-of-the-art. Comput. Vis. Image 591 Underst. 2018,166, 1–27.592 6. Ciecholewski, M. An edge-based active contour model using an inflation/deflation force with a damping 593 coefficient. Expert Syst. Appl. 2016,44, 22–36.594 7. Ding, K.; Xiao, L.; Weng, G. Active contours driven by local pre-fitting energy for fast image segmentation.595 Pattern Recognit. Lett. 2018,104, 29–36.596 8. Cousty, J.; Bertrand, G.; Najman, L.; Couprie, M. Watershed cuts: Thinnings, shortest path forests, and 597 topological watersheds. IEEE Trans. Pattern Anal. Mach. Intell. 2010,32, 925–939.598 9. Gaetano, R.; Masi, G.; Poggi, G.; Verdoliva, L.; Scarpa, G. Marker-controlled watershed-based segmentation 599 of multiresolution remote sensing images. IEEE Trans. Geosci. Remote Sens. 2015,53, 2987–3004.600 10. Shotton, J.; Johnson, M.; Cipolla, R. Semantic texton forests for image categorization and segmentation. 601 In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Anchorage, AK, USA, 602 23–28 June 2008; pp. 1–8.603 11. Long, J.; Shelhamer, E.; Darrell, T. Fully convolutional networks for semantic segmentation. In Proceedings 604 of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; 605 pp. 3431–3440.606 12. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. 607 In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted 608 Intervention, Munich, Germany, 5–9 October 2015; pp. 234–241.609 13. Badrinarayanan, V.; Kendall, A.; Cipolla, R. Segnet: A deep convolutional encoder-decoder architecture for 610 image segmentation. arXiv 2015, arXiv:1511.00561.611 14. Ghiasi, G.; Fowlkes, C.C. Laplacian pyramid reconstruction and refinement for semantic segmentation. 612 In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 613 2016; pp. 519–534.614 15. Yu, F.; Koltun, V. Multi-scale context aggregation by dilated convolutions. arXiv 2015, arXiv:1511.07122.615 16. Chen, L.C.; Papandreou, G.; Kokkinos, I.; Murphy, K.; Yuille, A.L. Deeplab: Semantic image segmentation 616 with deep convolutional nets, atrous convolution, and fully connected crfs. arXiv 2016, arXiv:1606.00915.617 17. Chen, L.C.; Papandreou, G.; Schroff, F.; Adam, H. Rethinking Atrous Convolution for Semantic Image 618 Segmentation. arXiv 2017, arXiv:1706.05587.619
Version April 14, 2019 preprint accepted for Sensors Journal 19 of 20 18. Eigen, D.; Puhrsch, C.; Fergus, R. Depth map prediction from a single image using a multi-scale deep 620 network. In Proceedings of the Advances in Neural Information Processing Systems, Lake Tahoe, NV, USA, 621 3–8 December 2014; pp. 2366–2374.622 19. Ivaneck ` y, B.J. Depth Estimation by Convolutional Neural Networks. Master’s Thesis, Brno University of 623 Technology, Brno, Czechia, 2016.624 20. Abdi, L.; Meddeb, A. Driver information system: A combination of augmented reality and deep learning. 625 In Proceedings of the Symposium on Applied Computing, Marrakech, Morocco, 4–6 April 2017; ACM: New 626 York, NY, USA, pp. 228–230.627 21. Eigen, D.; Fergus, R. Predicting depth, surface normals and semantic labels with a common multi-scale 628 convolutional architecture. In Proceedings of the IEEE International Conference on Computer Vision, 629 Santiago, Chile, 13–16 December 2015; pp. 2650–2658.630 22. Wang, P.; Shen, X.; Lin, Z.; Cohen, S.; Price, B.; Yuille, A.L. Towards unified depth and semantic prediction 631 from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 632 Bostion, MA, USA, 8–10 June 2015; pp. 2800–2809.633 23. Mousavian, A.; Pirsiavash, H.; Košecká, J. Joint Semantic Segmentation and Depth Estimation with Deep 634 Convolutional Networks. In Proceedings of the Fourth International Conference on 3D Vision (3DV), 635 Stanford, CA, USA, 25–28 October 2016; pp. 611–619.636 24. Teichmann, M.; Weber, M.; Zoellner, M.; Cipolla, R.; Urtasun, R. MultiNet: Real-time Joint Semantic 637 Reasoning for Autonomous Driving. arXiv 2016, arXiv:1612.07695.638 25. Uhrig, J.; Cordts, M.; Franke, U.; Brox, T. Pixel-level encoding and depth layering for instance-level 639 semantic labeling. In Proceedings of the German Conference on Pattern Recognition, Hannover, Germany, 640 12–15 September 2016; pp. 14–25.641 26. Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. 642 Going deeper with convolutions. In Proceedings of the IEEE conference on Computer Vision and Pattern 643 Recognition, Boston, MA, USA, 8–10 June 2015, pp. 1–9.644 27. Sanchez-Escobedo, D.; Lin, X.; Casas, J.R.; Pardas, M. Hybridnet for depth estimation and semantic 645 segmentation. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal 646 Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 1563–1567.647 28. Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014 , 648 arXiv:1409.1556.649 29. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. 650 In Proceedings of the Advances in Neural Information Processing Systems, Lake Tahoe, AK, USA, 3–8 651 December 2012; pp. 1097–1105.652 30. Brostow, G.J.; Fauqueur, J.; Cipolla, R. Semantic object classes in video: A high-definition ground truth 653 database. Pattern Recognit. Lett. 2009,30, 88–97.654 31. Geiger, A.; Lenz, P.; Urtasun, R. Are we ready for autonomous driving? The kitti vision benchmark suite. 655 In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Rhode, Island, 18–20 656 June 2012; pp. 3354–3361.657 32. Cordts, M.; Omran, M.; Ramos, S.; Rehfeld, T.; Enzweiler, M.; Benenson, R.; Franke, U.; Roth, S.; Schiele, B. 658 The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE Conference on 659 Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 3213–3223.660 33. Papandreou, G.; Chen, L.C.; Murphy, K.; Yuille, A.L. Weakly-and semi-supervised learning of a DCNN for 661 semantic image segmentation. arXiv 2015, arXiv:1502.02734.662 34. Song, S.; Lichtenberg, S.P.; Xiao, J. Sun rgb-d: A rgb-d scene understanding benchmark suite. In Proceedings 663 of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 8–10 June 2015; 664 pp. 567–576.665 35. Silberman, N.; Hoiem, D.; Kohli, P.; Fergus, R. Indoor segmentation and support inference from rgbd 666 images. In Proceedings of the European Conference on Computer Vision, Firenze, Italy, 7–13 October 2012; 667 pp. 746–760.668 36. Janoch, A.; Karayev, S.; Jia, Y.; Barron, J.T.; Fritz, M.; Saenko, K.; Darrell, T. A category-level 3d object dataset: 669 Putting the kinect to work. In Consumer Depth Cameras for Computer Vision; Springer: London, UK, 2013; 670 pp. 141–165.671
Version April 14, 2019 preprint accepted for Sensors Journal 20 of 20 37. Xiao, J.; Owens, A.; Torralba, A. Sun3d: A database of big spaces reconstructed using sfm and object labels. 672 In Proceedings of the IEEE International Conference on Computer Vision, Portland, OR, USA, 25–27 June 673 2013; pp. 1625–1632.674 38. Noh, H.; Hong, S.; Han, B. Learning deconvolution network for semantic segmentation. In Proceedings of 675 the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1520–1528. 676 c 2019 by the authors. Submitted to Journal Not Specified for possible open access 677 publication under the terms and conditions of the Creative Commons Attribution (CC BY) license 678 (http://creativecommons.org/licenses/by/4.0/).679