Confidence Guided Stereo 3D Object Detection with Split Depth Estimation

Accurate and reliable 3D object detection is vital to safe autonomous driving. Despite recent developments, the performance gap between stereo-based methods and LiDAR-based methods is still considerable. Accurate depth estimation is crucial to the performance of stereo-based 3D object detection methods, particularly for those pixels associated with objects in the foreground. Moreover, stereo-based methods suffer from high variance in the depth estimation accuracy, which is often not considered in the object detection pipeline. To tackle these two issues, we propose CG-Stereo, a confidence-guided stereo 3D object detection pipeline that uses separate decoders for foreground and background pixels during depth estimation, and leverages the confidence estimation from the depth estimation network as a soft attention mechanism in the 3D object detector. Our approach outperforms all state-of-the-art stereo-based 3D detectors on the KITTI benchmark.


I. INTRODUCTION
3D object detection is vital to applications such as autonomous driving. Many LiDAR-based methods [1], [2], [3] achieve strong performance due to the accurate depth information that LiDAR provides. Compared with LiDAR, a stereo camera setup is less expensive and provides more dense information. In addition, stereo detection could add redundancy to an autonomous driving system and help reduce safety risks in combination with LiDAR methods. Recent stereo-based methods [4], [5], [6], [7] have shown promising performance, although the detection performance gap between stereo and LiDAR configurations is still considerable.
One recent state-of-the-art stereo-based approach is Pseudo-LiDAR [4], [5], which first estimates disparities with a stereo matching network, converts the estimated disparities into a 3D point cloud, and then feeds the estimated point cloud to a LiDAR-based 3D object detector. However, compared with the LiDAR point cloud, the estimated point cloud often has poor depth estimation, particularly as depth increases, where it no longer preserves the shape of the objects. One attribute of this method is that the stereo matching algorithm jointly estimates both foreground and background pixels and does not learn specifically the depth and shape of the foreground objects. [8] shows that the depth distribution and pattern for foreground pixels and background pixels are different, and treating foreground and background pixels equally leads to sub-optimal results in a monocular depth estimation pipeline. In this paper, we propose to use two separate decoders for foreground and background pixels in a Authors are with the University of Toronto Institute for Aerospace Studies. email: (chengyao.li@mail.utoronto.ca), (kujason.ku@mail.utoronto.ca), (stevenw@utias.utoronto.ca) Fig. 1: A comparison between our proposed depth estimation module with our baseline HD 3 on KITTI dataset. Using LIDAR measurements (shown in white) as a reference, our proposed method (shown in dark cyan) is able to learn the depth and shape of the car more accurately compared with our baseline (shown in yellow). The 3D bounding box is shown in red.
stereo matching network to provide better estimates of object shape and depth. The foreground and background masks can be obtained from image segmentation. In cooperation with the point cloud loss from [9], we show in Fig. 1 that with our approach the depth and shape of the object can be significantly improved. With further experiments, we show that such improvement also leads to better 3D object detection performance.
In contrast to LiDAR measured point clouds, the accuracy of stereo point clouds greatly varies across a scene. For constant pixel-level disparity error, the depth error increases as depth increases because of the effect of triangulation. In addition, the estimated point clouds also suffer from poor depth estimates at object boundaries, because it can be hard for a stereo matching algorithm to determine whether a pixel belongs to the object or the background [6]. In the original Pseudo-LiDAR pipeline [4], [5], the estimated point cloud is directly fed into a 3D object detector which does not consider any uncertainty information. To address this issue, we propose to encode the uncertainty output from the depth estimation module as an additional layer in the point cloud serving as a soft attention mechanism. This method allows the network to focus on points with high confidence and mitigates the effect of low confidence points such as points Fig. 2: A comparison between object bounding box detections without confidence (shown in teal) and with confidence (shown in green). Ground truth bounding box is shown in red. In the right image, points with higher confidence are shown in lighter colors. With confidence as an additional layer, the network is able to focus more on the points with high confidence (cycled in yellow) and ignore the points at object boundaries that have low confidence (cycled in white).
on the object boundary, as shown in Fig. 2.
In this paper, we propose CG-Stereo, a confidence guided stereo 3D object detection pipeline. To summarize, our main contributions are as follows: • We propose the use of separate depth decoders for foreground and background pixels in the stereo matching network, which leads to improved depth estimation accuracy of the foreground pixels and improved object detection performance. • We propose the use of confidence estimates from the stereo matching algorithm as a soft attention mechanism to guide the object detector network to focus more on the points with higher quality depth information, leading to further improvement in object detection accuracy. • We demonstrate state-of-the-art performance that exceeds existing stereo-based methods on the challenging KITTI 3D object detection benchmark [10] for all three object classes. Specifically, our approach surpasses the next best-performing method by 1.4%, 6.7%, and 12.7% AP at 0.7 IOU on cars, pedestrians and cyclists, respectively.
II. RELATED WORK Stereo depth estimation. For stereo vision, depth is often estimated by determining the stereo correspondences between the left and right images. Stereo matching is a well-established field of research [11], with a long history of classical methods [12], [13], [14]. With the recent development of deep learning, end-to-end learning methods have shown significant improvements in this task. A standard learning approach of stereo matching is to construct a 3D cost volume to minimize the matching cost [15], [16], [17].
Chang et al. [15] propose a pyramid pooling module for incorporating global context followed by a stacked hourglass 3D CNN. Yin et al. [17] determine the stereo matching by decomposing the full match density into multiple scales hierarchically first and then compose a global match density. This method not only achieves state-of-the-art results on established benchmarks but also predicts a confidence map that indicates the certainty of the estimation for each pixel. Our stereo 3D detection method takes advantage of the confidence estimation and demonstrates they can be used to improve stereo 3D object detection performances.
LiDAR-based 3D object detection. LiDAR-based object detection methods have shown strong performances and are widely used in autonomous driving since LiDAR provides accurate point clouds in terms of object depth and shape. Recent methods either use voxelization [2], [1], [18], [19], PointNet [20], [3], or a combination of the two [21], [22], [23] to learn features from point cloud data. Taking advantage of the mature pipeline of LiDAR-based detectors, the performance is transferable to stereo-based detectors.
Stereo-based 3D object detection. In recent years, stereo-based 3D object detection methods have shown promising improvements in performance. Stereo R-CNN [7] combines 2D proposals from both left and right images along with the sparse keypoints to generate coarse 3D bounding boxes, and then refines the bounding box using the photometric alignment of left and right regions of interest (ROIs). TLNet [24] projects the predefined anchor box to stereo images to obtain a pair of RoIs, learns to offset these RoIs, and uses triangulation to localize the objects. RT3DStereo [25] proposes to use semantic information together with disparity information to recover 3D bounding boxes. However, they do not take advantage of the semantic information to obtain better depth estimation. Pseudo-LiDAR [4], [5] proposes to mimic the LiDAR signal by converting the depth map to a point cloud, and then feed this point cloud to a LiDAR-based detector. This intuitive method reduces the performance gap between the stereo-based methods and LiDAR-based methods. However, the point cloud from stereo matching preserves streaking artifacts at the object boundaries, leading to inaccurate bounding box estimates. OC-Stereo [6] tries to solve this issue by estimating disparity only on the associated 2D bounding box area. However, this approach requires the 2D detection of the objects to be successful in both left and right images, which is difficult for objects that are truncated on image boundaries or are occluded from one view. It also completely ignores the background pixels which provide context to the 3D scene. Our method estimates the point cloud for both foreground and background pixels and keeps the points belonging to the ground plane since they contain useful contextual information in the 3D detection phase. The most recent state-of-the-art method, DSGN [26], proposes the use of a differentiable 3D volumetric representation of the environment to solve stereo 3D object detection. Their The stereo matching network then estimates the disparities of the foreground and background pixels separately using two decoders and outputs the confidence associated with the estimation for each pixel. The disparity map is converted into a 3D point cloud with a confidence score as an additional layer. Points belonging to the background are filtered out except for the ones belonging to the ground plane. The resulting point cloud is then fed into a point cloud-based 3D object detector.
method achieves remarkable results on the KITTI car class, but the performances on pedestrians are not as competitive with the state-of-the-art. In comparison, our decomposed architecture allows us to perform well on pedestrians and cyclists even with the limited training data available for these classes in the KITTI dataset.

III. ARCHITECTURE
The overall pipeline of our method is shown in Fig. 3. First, a semantic segmentation network determines the foreground pixels and background pixels in the left image. We define foreground pixels as the pixels that belong to the objects of interest and background as all other pixels. Then, the stereo matching network estimates the disparities of the foreground and background pixels separately with two separate decoders. It also generates a confidence map associated with each pixel representing the certainty of the network's estimation. The disparity map is converted into a 3D point cloud with confidence as an additional layer. Points belonging to the background are filtered out except for the ones that lie on the ground plane. We use the same method as 3DOP [27] for stereo ground plane generation. The remaining point cloud is finally fed into a LiDAR-based 3D object detector.

A. Semantic Segmentation
For the 3D object detection task, it is common to segment the sensor input depending on the objects of interest. Pseudo-LiDAR [4], [5] converts the stereo image pair to a point cloud and then relies on a LiDAR-based 3D object detector to find objects. However, compared with LiDAR point clouds, the estimated point clouds have lower accuracy and thus are harder to segment. In addition, the texture and color information is lost in this process. We argue that it is possible to leverage image segmentation information in stereo object detection for improved detection accuracy, rather than relying on the LiDAR-based 3D detector exclusively. We also show that the foreground and background masks from semantic segmentation improve the depth estimation of the foreground pixels in Section III-B, which contributes to higher 3D object detection accuracy.

B. Stereo Split Depth Estimation
Our stereo depth estimation is performed via stereo matching and the proposed formulation is agnostic to any stereo matching algorithm. We build on top of HD 3 due to its state-of-the-art performance and ability to run in real-time. In addition, due to its probabilistic framework for match distribution estimation, an uncertainty associated with the estimate at every pixel can be naturally derived [17].
Stereo Matching Architecture. HD 3 is designed for learning probabilistic pixel correspondences in both optical flow and stereo matching tasks [17], and we employ their stereo matching implementation as a baseline. The core idea of HD 3 is to decompose the full discrete match distributions of pixel-wise correspondences into multiple scales hierarchically, estimate the local matching distributions at each scale, and then compose them from all levels. The resulting distributions at each pixel in the reference image are referred to as match densities. At each image scale level l, a cost volume is constructed to find the correlation between the pixels in both images and a density decoder is trained to estimate the decomposed match density p l . For more details, readers may refer to the original HD 3 paper [17].
Our modified version of the HD 3 network is shown in Fig. 4. We only show one level for simplicity. Instead of relying on one density decoder for the entire image, we have two parallel density decoders with the same structure for foreground and background pixels, respectively. At each level l, each decoder takes the feature maps F l , cost volume, and the density embedding from the previous level E l−1 f g Fig. 4: Modified HD 3 network at the l th level. Instead of one density decoder for the entire image, we use separate density decoders for foreground pixels and background pixels, respectively, which allows us to optimize the weights specifically for each task.
or E l−1 bg as input, and outputs an estimated match density p l f g or p l bg , and the density embedding at the current level E l f g or E l bg . Then, we use the foreground and background masks, denoted as m l f g and m l bg , to mask out the output from the two decoders, and then fuse them. The match density is then converted into an estimated residual disparity E[g l ] at the current level. The model-inherent uncertainty can be estimated by applying a softmax operation and a max-pooling operation to the estimated match density at the highest level.
Loss Function. We adapt the foreground-background sensitive loss function from a monocular-based method [8] and add the point cloud loss from [9]. The total loss is defined as where λ f is the weight coefficient representing the degree of preference for foreground pixels. L f g and L bg are the Kullback-Leibler divergence loss for foreground pixels and background pixels, respectively, α is a weight coefficient, and L pc is the point cloud loss, which is set to be a smooth L1 loss of the difference between the foreground point cloud p c with its ground truth point cloud p gt in camera frame. We include the loss for background pixels because there is interdependence between foreground and background pixels for inferring the depth [8], and background provides context and support for 3D box regression [3]. We include a point cloud loss because it directly penalizes the estimated 3D point cloud and further improves the 3D detection accuracy as demonstrated in Sec. V-B.

C. Point Cloud Generation
The disparity map is converted to 3D points using the camera projection model as shown in Eq. 2.
where x, y, z is the position of the points, (c u , c v ) is the camera center, (f u , f v ) is the focal length, b is the baseline, and d is the estimated disparity for a given pixel. Image segmentation is a relatively mature field and can provide robust results. As a consequence, rather than feeding the entire point cloud to the 3D object detector, we leverage the segmentation masks and feed only the points that are estimated to be from the foreground pixels. We also keep the points that belong to the ground plane as they provide useful contextual information and supporting information for generating proposals in the detection stage.

D. Confidence Map
In comparison with LiDAR point clouds, the estimated point clouds often suffer from high variance in the accuracy of depth. To consider this difference, we take advantage of the confidence estimation from the stereo matching algorithm and encode this information in the point cloud simply as an additional layer as shown in Eq. 3.
where σ represents the confidence for each point. Fig. 5 shows the relationship between the confidence estimation and the estimation error for all the pixels belonging to cars on KITTI validation set. The inverse relationship shown in Fig. 5 proves that the confidence estimates indicate the accuracy of the estimation and the quality of the estimated point clouds. Adding the confidence estimation as an additional layer is shown to improve object detection performance in Section V-B. Fig. 5: Disparity Error vs. Confidence Estimation from modified HD 3 for all pixels belonging to cars in the validation set on KITTI object detection benchmark [10]. Each box represents a 5% range in confidence. The median is shown on top of the box. There is a trend that a higher confidence estimation indicates a higher quality of the estimation output. We do not include plots with confidence lower than 50%, because they contain significantly fewer samples.

E. 3D Box Regression Network.
In the detection phase, we choose the open-source PointR-CNN as our 3D object detector for its strong performance, and because it works directly on point clouds without voxelization, allowing us to encode the confidence estimation into the points.

Semantic
Segmentation. We employ VideoProp-LabelRelax [28] as the semantic segmentation network during inference. Since the KITTI semantic segmentation dataset [10] has only 200 labelled images, the network and model was instead trained on Mapillary [29] and Cityscapes [30] before being finetuned on KITTI. There is a class discrepancy between the object detection benchmark and the semantic segmentation benchmark on KITTI. On the object detection benchmark, the cyclist class is a single stand-alone class, but on the semantic segmentation benchmark, the rider and bike classes are separate. To solve this issue, we dilate the rider masks and check if they overlap with a bike mask. If there is an overlap, we keep the union of the original rider mask and the bike mask as a cyclist mask. All other bike masks are discarded. Stereo Depth Estimation. For our stereo matching algorithm, we use the model pretrained on the FlyingThings3D Dataset [31], and then train the proposed two-decoder network on the training split of the KITTI object detection dataset. The foreground and background decoders have the same pre-trained weights before training on KITTI. To train on KITTI, we use the depth map generated by depth completion [32] and their corresponding point clouds as ground truth. To obtain the ground truth instance segmentation masks used during training, we follow [9] and project ground truth points within the 3D labels to the image as the foreground masks. Training is performed for 375 epochs, with a batch size of 32 and a learning rate of 5 × 10 −4 . The learning rate decays by 0.5 at the 125 th , 187 th , and 250 th epochs. We apply horizontal flipping as data augmentation. Specifically, we increase the number of training samples by switching the left image and right image and horizontally flipping both of them. For this module, We train one model for cars, and another model for pedestrians and cyclists.
3D Object Detection. The region proposal network of PointRCNN is trained for 200 epochs with a batch size of 16 and a learning rate of 0.001, and the 3D box refinement network is trained for 50 epochs with a batch size of 8 and a learning rate of 0.001. For augmentations, we follow the original paper of PointRCNN [3]. Similar to PointRCNN, we subsample 16,384 points for each scene. Specifically, we sample half of the points that have depth larger than 20 m.

V. EXPERIMENTAL RESULTS
We evaluate our proposed method on the widely used KITTI 3D object detection dataset [10]. Specifically, we first compare the 3D object detection results with the state-of-the-art stereo-based detectors, then validate each contribution through ablation studies, and finally show qualitative results. KITTI contains 7,481 stereo image-pairs for training and 7,518 for testing. The benchmark also has annotations for 3 classes, which are cars, pedestrians and cyclists. Each annotation is categorized as easy, moderate, and hard based on the 2D box height, occlusion, and truncation. We follow the same training and validation split as other methods [4], [6], [7]. We also submit our results for all three classes to the online KITTI test server. KITTI recently changed its evaluation metrics on the test server. For the results on test set and in the ablation studies, we use the new KITTI metric which is mean average precision with 40 recall positions. For a fair comparison with other approaches, the results on the validation set are compared using the original KITTI metric with 11 recall positions.

A. AP Comparison with State-of-the-Art Methods
We compare our method with state-of-the-art stereo-based methods on the KITTI benchmark in Tables I, II and III. For the car class, our approach outperforms all state-of-the-art methods on the KITTI validation split in all categories. On the test set, our method ranked the first among all stereobased methods on all three difficulties in both AP 3D and AP BEV . Specifically for moderate difficulty, we show a 1.40% increase in AP 3D , and a 1.39% increase in AP BEV . For pedestrians and cyclists, our proposed method outperforms all other stereo-based methods by significant margins. Most noticeably, on the test server, we have 6.73% and    12.72% AP increase in the 3D moderate category at 0.7 IoU for pedestrians and cyclists, respectively. For classes with limited data, our decomposed pipeline allows us to pretrain the sub-modules using additional datasets, which performs significantly better than other methods that lack this ability. The total inference time of our method is 0.57s on average on a GeForce RTX 2080 Ti GPU, which is faster than the current state-of-the-art method DSGN (0.68s) [26] and is comparable with other stereo-based methods on the KITTI leaderboard [10].

B. Ablation Studies
We analyze the effect of each added modules in Table. IV. The baseline is the original HD 3 network with background points filtered out and PointRCNN as the 3D detector.
For depth estimation, we follow [8] and use mean absolute relative error (absRel) and scale invariant logarithmic error (SILog) as the evaluation metrics. To better observe depth estimation accuracy improvements from the modifications made to HD3 for the more challenging but underrepresented pixels at greater depths, we present depth estimation errors for all foreground pixels with greater than 20 m depth.

Effect of Split Depth Estimation.
To investigate the effect of split depth estimation, we train the modified HD 3 network without the point cloud loss and feed the resulting point cloud directly to the 3D detector without a confidence score layer. The separate decoders allow us to improve the depth estimation for foreground pixels by 29.8% (from 0.047 to 0.033 absRel), and this leads to improvements in the AP 3D by 1.81% and AP BEV by 1.31%.
Effect of Point Cloud loss. We analyze the effect of point cloud loss by feeding the point cloud to the 3D detector without confidence estimation. Point cloud loss further improves the foreground depth estimation from 0.033 to 0.027 absRel. Including a point cloud loss in the pipeline also helps to obtain better 3D object detection accuracy, improving the AP 3D by 2.27% and AP BEV by 0.29%.
Effect of Confidence Estimation. Finally, adding confidence estimation as an additional layer in the 3D detector boosts the 3D detection performance by another 1.02% and BEV performance by another 1.73%. This shows that the 3D detection network benefits from the confidence estimation generated by the depth estimation module.  Sensitivity to Semantic Segmentation. The performance of our method depends on the quality of the semantic segmentation. On the KITTI benchmark, there are only 200 images with semantic ground truth for training, which limits the performance of the semantic segmentation network. To investigate the performance upper bound of our method, we perform experiments using the labels that are generated from [33] as the segmentation masks on the KITTI validation split. Table V shows that with the labelled masks, there is a 5.36% and a 3.84% improvement in AP 3D and AP BEV . This experiment suggests that our proposed method has the potential to obtain even better performance on other datasets with more accurate semantic segmentation.

C. Qualitative Results
Fig . 6 shows the estimated point cloud, the ground truth bounding box, and the final detections of our proposed method on the KITTI validation split. The right image suggests that even with the significant improvements compared with the previous state-of-the-art methods, pedestrian and cyclist classes remain challenging for our stereo-based detector because of the limited training samples and the high intra-class variation.

VI. CONCLUSIONS
In this paper, we present CG-Stereo, a confidence-guided stereo 3D object detection pipeline with split depth estimation. Taking advantage of the mature development of image segmentation, the stereo matching network can learn the depth for foreground and background pixels separately, and achieve better foreground depth estimation and 3D object detection performance as a result. We also show that encoding the confidence estimation from the stereo matching network into the point cloud as a soft attention mechanism guides the 3D object detector to focus more on the accurate points and further boosts 3D object detection accuracy. Our proposed method outperforms all state-of-theart stereo-based methods on the KITTI 3D object detection benchmark. Future work includes evaluating our proposed method on other autonomous driving datasets [34], [35], [36].