Learning Joint 2D-3D Representations for Depth Completion

Yun Chen, Bin Yang, Ming Liang, Raquel Urtasun

Introduction

In the past few years, the use of sensors that contain both image information as well as depth has increased significantly. They are typically used in applications such as self-driving vehicles, robotic manipulation as well as gaming. While passive sensors like cameras typically generate dense data, active sensors like LiDAR (Light Detection and Ranging) produce sparse depth observation of the environment. As a result, this semi-dense representation of the world can be inaccurate at regions close to object boundaries. One solution is to use high-end depth sensors with higher data density, but they are usually very expensive. A more affordable alternative is depth completion (shown in Figure 1), which takes the sparse depth observation and dense image as input, and estimates the dense depth map. In practice, depth completion is often employed as a precursor to downstream perception tasks such as detection, semantic segmentation or instance segmentation.

Despite many attempts to solve the problem, depth completion remains unsolved. Challenges such as the inherent ambiguity in extracting depth from images, as well as the noise and uncertainty in the unstructured sparse depth observation, make depth completion a non-trivial task.

Many approaches reason in the 2D space only by projecting the 3D point cloud to 2D image space. Convolutional neural networks (CNNs) are typically used to learn multi-modality representations in 2D space. However, as the metric space is distorted after the camera projection, such approaches have difficulty capturing precise 3D geometric clues. As a result, auxiliary task like surface normal estimation is added to better supervise the feature learning . Other methods reason in 3D space only by extracting 3D features (e.g. Truncated Signed Distance Function ) from the sparse depth image of the scene and applies 3D CNN to learn 3D representations and complete the scene densely in 3D. The drawback is the lack of exploitation of the dense image data, which can provide discriminative appearance clues.

In contrast, in this paper, we take advantage of representations in both 2D and 3D spaces and design a simple yet effective architecture that fuses the information between these representations at multiple levels. Specifically, we design a 2D-3D fuse block that takes feature map in 2D image space as input, branches into two sub-networks that learn representations in 2D and 3D spaces via multi-scale 2D convolutions and continuous convolutions respectively, and then fuses back into the 2D image space. Thanks to the modular design, we can create networks of various model sizes by simply stacking the 2D-3D fuse blocks sequentially. Compared with other multi-sensor fusion based representations that typically fuse the features from each sensor only once in the whole network, our proposed modular based model has the advantage of dense feature fusion at multiple levels through the network. As a result, while the domain-specific sub-networks inside the block extract specialized 2D and 3D representations separately, stacking such blocks together leads to hierarchical joint representation learning that fully exploits the complementary information between the two sensor modalities.

We validate our approach on the challenging KITTI depth completion benchmark , and show that our approach outperforms all previous state-of-the-art methods in terms of Root Mean Square Error (RMSE) on depth. Note that our model is trained from scratch using KITTI training data only, and still surpasses other methods that exploit external data or multi-task learning. This further showcases the superiority of the proposed model in learning joint 2D-3D representations. We also conduct detailed ablation study to investigate the effect of each component of the model, and show that our model achieves better trade-off in accuracy versus model size compared with the state-of-the-art.

Related Work

In this section, we review previous literatures on the topics of depth estimation from RGB data, depth completion from RGBD data, and representation learning for RGBD data.

Early approaches estimated depth from single RGB images by applying probabilistic graphical models to hand-crafted features. With the recent advance in image recognition by deep convolutional neural networks (CNNs), CNN based methods are applied to depth estimation as well. Eigen et al. designed a multi-scale deep network for depth estimation from a single image. Laina et al. tackled the problem at a single scale by using a deep fully convolutional neural network. Liu et al. combined deep representation with a continuous conditional random field (CRF) to get smoother estimations. Roy and Todorovic proposed to combine deep representations with random forests and achieved a good trade-off between prediction smoothness and efficiency. Recently unsupervised approaches exploited view synthesis as the supervisory signal, while some further extended the idea to videos. However, due to the inherent ambiguity in depth from images, these approaches have difficulty producing high-quality dense depth.

2 Depth Completion from RGBD data

Different from depth estimation, the task of depth completion tries to exploit a sparse depth map (e.g. point cloud scan from a LiDAR sensor) and possibly image data as well to predict high-resolution dense depth. Early work resorted to wavelet analysis to generate dense depth/disparity from sparse samples. Recently, deep learning methods achieve superior performance in depth completion. Uhrig et al. proposed sparse invariant CNNs to extract better representation from sparse input only. Ma et al. proposed to concatenate sparse depth together with RGB image and fed into an encoder-decoder based CNN for depth completion. A similar approach was also applied to the self-supervised setting . Instead of using CNN, Cheng et al. used a recurrent convolution to estimate the affinity matrix for depth completion. Apart from the network architecture side, other methods exploited semantic contexts from multi-task learning. Schneider et al. extracted object boundary cues for cleaner depth estimation. Semantic segmentation task was also exploited to jointly learn better semantic features of the scene . Qiu et al. added the auxiliary task of surface normal estimation to depth completion. Yang et al. learned a depth prior on images by training on large-scale simulation data. Compared with these approaches that focused on better network architecture and exploiting more context or prior from other dataset and labels. Our method improves performance simply by learning better representations. This is achieved by a new neural network block that’s specially designed for RGBD data. We show in experiments that we are able to learn strong joint 2D-3D representations from the RGBD data with the proposed method and achieve state-of-the-art performance in depth completion.

3 Representation for RGBD data

Song et al. extracted multiple hand-crafted features (TSDF , point density, 3D normal, 3D shape) from depth image for 3D object detection. In RGBD based joint representation was learned by applying 3D CNN to a 3D volume of depth image and 2D CNN to the RGB image and concatenating them together. Chen et al. extracted 3D features by applying 2D CNN on multi-view projection of the 3D point cloud and combining with image features at ROI level. Xu et al. used the similar approach but adopted a PointNet to extract 3D features on raw points directly. In the same representation was further extended to pixel-level by fusing pixel feature with point feature. Liang et al. first discretized the sparse LiDAR points into a dense bird’s eye view voxel representation, and applied 2D CNN to extract BEV representations. The 2D image features are fused back to BEV space densely via continuous convolution to interpolate the sparse correspondence. Compared with these methods, our approach uses domain specific network for 2D and 3D representation learning, and both features are fused back to 2D image space at multiple levels across the whole network instead of only fusing once. As a result, we are able to learn more densely fused representation from the RGBD data.

Learning Joint 2D-3D Representations

We tackle the problem of depth completion from RGBD sensors. Existing approaches typically rely on either 2D or 3D representations to solve this task. In contrast, in this paper, we take advantage of both types of representations and design a simple yet effective architecture that fuses the information between these representations at multiple levels. In particular, we propose a new building block for neural networks that operates on RGBD data. It is composed of two branches that live in different metric spaces. In one branch we use traditional 2D convolutions to extract appearance features from dense pixels in 2D metric space. In the other branch, we use continuous convolutions to capture geometric dependencies from sparse points in 3D metric space. Our approach can be seen as spreading features to both 2D and 3D metric spaces, learning appearance and geometric features in each metric space separately, and then fusing them together.

We build our depth completion networks simply by stacking the 2D-3D fuse blocks. This modular design has two benefits. First, the network is able to learn joint 2D and 3D representations which are fully fused at multiple levels (all blocks). Second, the network architecture is simple and convenient to modify for the desired trade-off of performance and efficiency.

The remainder of the section is organized as follows: we first introduce our 2D-3D fuse block. We then give an example of deploying the proposed block to build a neural network for depth completion. Finally, we provide training and inference details of our depth completion network.

We show a diagram of the proposed 2D-3D fuse block in Figure 2. The block takes as input a 2D feature map of shape C×H×WC\times H\times W and a set of 3D points of shape N×3N\times 3. We assume that we are also given the projection matrix with which we can project the points from the 3D metric space to the 2D feature map. The output of the block is a 2D feature map with the same resolution as the input, which makes it straightforward to build a network by stacking the blocks for pixel-wise prediction tasks like depth completion. Inside the block, its architecture can be divided as two sub-networks: a multi-scale 2D convolution network and a 3D continuous convolution network. The input features are distributed to and processed in each sub-network, and their outputs are combined with a simple fusion layer. We refer readers to Figure 2 for an illustration of our method.

We use a 2D convolution network to extract appearance features. We denote a 2D convolutional layer as conv(kk, ss, cc), where kk represents k×kk\times k filter size, ss denotes the convolution stride, and cc denotes the number of output channels. We adopt a two-branch network structure in order to extract multi-scale features. The first branch has the same resolution as the input and we simply apply conv(3, 1, CC). The second branch consists of conv(3, 2, CC), conv(3, 1, CC) and upsample(2), where the first layer down-samples the feature map by 22, and the last layer up-samples the feature map back to original resolution via bilinear interpolation. Batch normalization and ReLU non-linearity are used after each convolution. The outputs of both branches have the same shape C×H×WC\times H\times W as the input, and we combine them simply by element-wise summation.

D continuous convolution net:

We exploit continuous convolutions directly on the 3D points to learn geometric features in 3D metric space. The key concept of continuous convolution is the same as traditional 2D convolution, in that the output feature of each point is a weighted sum of transformed features of neighbors in a geometric space. But they use different ways to find neighbors and perform the weighted sum. For 2D convolution the data is grid-structured so it is natural to use surrounding pixels as the neighbors of a center pixel. Moreover, each neighbor has its corresponding weight which is used to transform its feature before the summation. However, 3D points can be arbitrarily placed and their neighbors are not so natural as in grid data. In continuous convolution, we use K-Nearest-neighbors algorithms to find the KK neighbors of a point based on the Euclidean distance. We also parameterize the weighting function using a Multi-layer Perceptron (MLP). In practice, we use the following implementation of continuous convolution:

where ii is the index of points, kk is the index of neighbors, x\mathbf{x} denotes the 3-dimensional location of points, fk\mathbf{f}_{k} and hi\mathbf{h}_{i} denote the features, WW is a weight matrix, and ⊙\odot denotes element-wise product. Note that the output of MLP has the shape as fk\mathbf{f}_{k}. This implementation can be regarded as a continuous version of separable convolution. The MLP and weighted sum perform depth-wise convolution, while the linear transformation resembles 1×11\times 1 convolution. We make this separation to reduces the memory and computation overhead.

In our block, we first query the feature of each 3D point by projecting the point to the 2D feature map and extracting the feature at the projected pixel. After this step, we get 3D points of shape N×3N\times 3 along with point features of shape N×CN\times C. We then apply two continuous convolutions to the point feature. We use a two-layer MLP whose hidden feature dimension and output feature dimensions are C/2C/2 and CC respectively. Each continuous convolution is followed by batch normalization and ReLU non-linearity. We then project the N×3N\times 3 3D points back to an empty 2D feature map and assign the N×CN\times C point features to corresponding projected pixels. In this way, we obtain a sparse 2D feature map as the output of the 3D sub-network. The output has the same shape as the outputs of the 2D sub-network.

Fusion:

Since the output feature maps of the 2D and 3D sub-networks have the same shape, we fuse them simply by element-wise summation. We then apply a conv(3, 1, CC) layer to get the output of the 2D-3D fuse block. To facilitate training, we also add a shortcut connection from the input to the output when they have the same feature dimension.

Figure 3 illustrates the receptive field of 2D convolution and continuous convolution. While 2D convolution operates on neighboring pixels on grid-structured image feature maps, continuous convolution finds neighbors based on distance in 3D geometric space. By fusing the outputs of the two branches, the learned representation captures correlations in both spaces. At object boundaries, where depth estimation is usually hard for 2D convolution based methods, our approach has the potential to capture non-smooth representations for more accurate shape reconstruction by leveraging the geometric features in 3D space. We will show in experiments that our model predicts sharper and clear borders than other 2D representation methods.

2 Stack 2D-3D Fuse Blocks into a Network

Our 2D-3D fuse block can be used as a basic module to build the network. We simply stack a set of blocks plus a few convolution layers at the input and output stages to get our depth completion model. In Figure 4 we show the architecture of an example network with NN 2D-3D fuse blocks.

The inputs to the network include a depth image and an RGBD image. We first apply two convolution layers separately to each of the inputs. For the depth image, we use conv(3, 2, 16) and conv(3, 1, 16). For the RGBD image, we use conv(3, 2, 32) and conv(3, 1, 32). We then concatenate the two outputs and feed them to a stack of NN 2D-3D fuse blocks. The 3D points are obtained from the depth image and used by the blocks. We up-sample the output of the block set by 2 so that it has the same size as the input images. Finally, we apply another two convolution layers to obtain the output dense depth image. By stacking the blocks, the deep network is able to capture both large-scale context and local-scale clues, and the geometric and appearance features are fully fused in multiple levels.

3 Learning and Inference

where did_{i} and lil_{i} are the predicted and ground truth depth, respectively.

Note that some other approaches use multi-task objective functions which leverage other tasks such as semantic segmentation to improve depth completion. Although we expect further performance gain with the multi-task objective function, we opt for the single task loss as the objective function is orthogonal to this work. During both training and inference, we pre-compute the indexes of nearest neighbors for all 3D points for continuous convolution, and apply the network to RGBD data and get the predicted results. No post-processing is required.

Experimental Evaluation

We conduct extensive experiments on KITTI depth completion benchmark to validate the effectiveness of our approach. Specifically, we compare with other depth completion methods on the test set by submitting to the KITTI evaluation server and show that our approach surpasses all previous state-of-the-art methods. We also conduct extensive ablation studies on the validation set to compare and analyze different model variants. Lastly, we provide some qualitative results of our approach.

The KITTI depth completion benchmark contains 86,89886,898 frames for training, 1,0001,000 frames for validation, and 1,0001,000 frames for testing. Each frame has one sweep of LiDAR scan and an RGB image from the camera. The LiDAR and camera are calibrated already with the known transformation matrix. For each frame, a sparse depth image is generated by projecting the 3D LiDAR point cloud to the image. The ground-truth for depth completion is represented as a dense depth image, which is generated by accumulating multiple sweeps of LiDAR scans and projecting to the image. Note that depth outliers that are inconsistent with the stereo disparity label (caused by occlusion, dynamic objects or measurement artifacts) are removed from the ground-truth by ignoring the corresponding pixels during training and evaluation. We use both the RGB image and the sparse depth image as the input to our model.

Evaluation metrics:

Four metrics are reported by the KITTI depth completion benchmark, which are Root Mean Square Error and Mean Absolute Error on depth (RMSE, MAE) and inverse depth (iRMSE, iMAE) respectively. We mainly focus on RMSE among all these metrics when comparing to other methods as it measures the error directly on depth and penalizes more on larger errors. The KITTI leaderboard also ranks methods based on RMSE. Additionally, we conduct an ablation study where we optimize the model with different objective functions and show that trade-off in different metrics can be controlled by different objective functions. Finding the best objective function for depth completion is out of the scope of this paper and we leave that for future work.

Implementation details:

2 Comparison with State-of-the-art

We evaluate our best single model on the KITTI test set, which has N=12N=12 blocks stacked sequentially in the network, each with C=64C=64 feature channels. We show the comparison results with other state-of-the-art methods on the KITTI depth completion benchmark in Table 1. For a fair comparison, we mark methods that use external training data and labels in addition to KITTI training data. For example, DDP exploits the Virtual KITTI dataset to learn the conditional prior of dense depth given an image. DeepLiDAR pre-trains the model on the synthetic dataset generated from the CARLA simulator to jointly learn the dense depth and surface normal tasks. FusionNet uses pre-trained semantic segmentation network on Cityscapes dataset . These methods rely on more data and various types of labels to learn good representations for depth completion. In contrast, our model, which is trained on KITTI training data only, outperforms all these methods considerably. This shows the superiority of the proposed model in learning joint 2D-3D representations from RGBD data over other methods. Specifically, our model significantly surpasses the second-best method with/without external data by 20/62 mm in RMSE respectively. We also achieve state-of-the-art results in other three metrics among methods that are trained on KITTI data only.

3 Ablation Studies

We conduct extensive ablation studies on the validation set of KITTI depth completion benchmark to justify the micro and macro design choices in the proposed model. We first compare different variants of the 2D-3D fuse block and then analyze the effect of different network configurations and objective functions. For faster experimentation, we conduct ablation studies on different network configurations with 100 training epochs only.

The proposed 2D-3D fuse block is composed of three branches, one 2D convolution branch, another 2D convolution branch with stride 2, and one 3D continuous convolution branch. Since we have varied the receptive fields of the 2D convolution by explicitly enumerating two different scales (stride 1 and stride 2), we wonder how to choose the receptive field of the 3D continuous convolution branch, which is controlled by the number of nearest neighbors. We show the ablation results in Table 2, where we can see that the model is quite robust to this hyper-parameter. In practice, we use K=9K=9 nearest neighbors.

Architecture of the 2D-3D fuse block:

We compare different architecture design of the 2D-3D fuse block in Table 3. In particular, we want to know how much each convolution branch: the stride 1 and stride 2 2D convolutions and the continuous convolution, contributes to the final performance. As shown in Table 3, multi-scale 2D convolution and continuous convolution are complementary. We rely on stride 1 convolution to extract the local features and continuous convolution to get 3D geometric features. Also, we need stride 2 convolution to extract better global features and propagate the sparse 3D geometric feature to a larger field. The results indicate that these three components are all necessary to the design of the 2D-3D fuse block for depth completion.

Network configuration:

We compare different network configuration by varying the width (number of feature channel CC) and depth (number of blocks NN) of the network. As a result, we are able to achieve different trade-offs between performance and model size. We plot the results in comparison with other methods in Figure 5, where we show that our model achieves better performance with a smaller model size compared with other methods.

Objective function:

4 Qualitative Results

We show some qualitative results of the proposed method in comparison with two state-of-the-art methods NConv-CNN and Sparse2Dense on the test set of KITTI depth completion benchmark. As shown in Figure 6, due to the use of continuous convolution that captures accurate 3D geometric features, our approach produces cleaner and sharper object boundaries in both near and distant regions. We get significantly better results for distant objects where 2D convolution can barely handle due to limited appearance clues. This suggests that in the task of depth completion, the description of the scale-invariant geometric feature in 3D is very important, and the proposed 2D-3D fuse block provides a simple yet effective solution to learn joint 2D and 3D representations.

Conclusion

In this paper, we have proposed a simple yet effective architecture that fuses information between 2D and 3D representations at multiple levels. We have demonstrated the effectiveness of our approach on the challenging KITTI depth completion benchmark and show that our approach outperforms the state-of-the-art. In the future, we plan to extend our approach to fuse other sensors and reason about video sequences.

References