We propose a novel deep learning architecture for regressing disparity from a rectified pair of stereo images. We leverage knowledge of the problem's geometry to form a cost volume using deep feature representations. We learn to incorporate contextual information using 3-D convolutions over this volume. Disparity values are regressed from the cost volume using a proposed differentiable soft argmin operation, which allows us to train our method end-to-end to sub-pixel accuracy without any additional post-processing or regularization. We evaluate our method on the Scene Flow and KITTI datasets and on KITTI we set a new state-of-the-art benchmark, while being significantly faster than competing approaches.READ FULL TEXT VIEW PDF
In this paper, a new deep learning architecture for stereo disparity
State-of-the-art deep learning based stereo matching approaches treat
Stereo reconstruction from rectified images has recently been revisited
Accurate layout estimation is crucial for planning and navigation in rob...
Our goal is to significantly speed up the runtime of current state-of-th...
Recent deep learning based approaches have outperformed classical stereo...
Given a pair of rectified images, the goal of stereo matching is to esti...
Course project for CS231A
. These examples demonstrate that deep convolutional neural networks are very effective for understanding semantics. They excel at classification tasks when supervised with large training datasets. We observe that a number of these challenging problems for stereo algorithms would benefit from knowledge of global semantic context, rather than relying solely on local geometry. For example, given a reflective surface of a vehicle’s wind-shield, a stereo algorithm is likely to be erroneous if it relies solely on the local appearance of the reflective surface to compute geometry. Rather, it would be advantageous to understand the semantic context of this surface (that it belongs to a vehicle) to infer the local geometry. In this paper we show how to learn a stereo regression model which can be trained end-to-end, with the capacity to understand wider contextual information.
Stereo algorithms which leverage deep learning representations have so far been largely focused on using them to generate unary terms [48, 32]. Applying cost matching on the deep unary representations performs poorly when estimating pixel disparities [32, 48]. Traditional regularization and post processing steps are still used, such as semi global block matching and left-right consistency checks . These regularization steps are severely limited because they are hand-engineered, shallow functions, which are still susceptible to the aforementioned problems.
This paper asks the question, can we formulate the entire stereo vision problem with deep learning using our understanding of stereo geometry? The main contribution of this paper is an end-to-end deep learning method to estimate per-pixel disparity from a single rectified image pair. Our architecture is illustrated in Figure 1. It explicitly reasons about geometry by forming a cost volume, while also reasoning about semantics using a deep convolutional network formulation. We achieve this with two key ideas:
We learn to incorporate context directly from the data, employing 3-D convolutions to learn to regularize the cost volume over dimensions,
We use a soft argmin function, which is fully differentiable, and allows us to regress sub-pixel disparity values from the disparity cost volume.
Section 3 introduces this model and illustrates these components in more detail. In Section 4 we evaluate our model on the synthetic Scene Flow dataset  and set a new state-of-the-art benchmark on the KITTI 2012 and 2015 datasets [14, 35]. Finally, in Section 4.3 we present evidence that our model has the capacity to learn semantic reasoning and contextual information.
provides a taxonomy of stereo algorithms as performing some subset of: matching cost computation, cost support aggregation, disparity computation and optimization, or disparity refinement. This survey also described the first Middlebury dataset and associated evaluation metrics, using structured light to provide ground truth. The KITTI dataset[14, 35] is a larger dataset from data collected from a moving vehicle with ground truth supplied by LIDAR. These datasets first motivated improved hand-engineered techniques for all components of stereo, of which we mention a few notable examples.
The matching cost is a measure of pixel dissimilarity for potentially corresponding image locations , of which absolute differences, squared differences, and truncated differences are examples. Local descriptors based on gradients  or binary patterns, such as CENSUS  or BRIEF [7, 22], can be employed. Instead of aggregating neighboring pixels equally as patch-based matching costs do, awareness of the image content can more heavily incorporate neighboring pixels possessing similar appearance, under the assumption that they are more likely to come from the same surface and disparity. A survey of these techniques is provided by Tombari et al. . Local matching costs may also be optimized within a global framework, usually minimizing an energy function combining a local data term and a pairwise smoothness term. Global optimization can be accomplished using graph cuts  or belief propagation , which can be extended to slanted surfaces . A popular and effective approximation to global optimization is the Semi-Global Matching (SGM) of Hirschmüller , where dynamic programming optimizes a pathwise form of the energy function in many directions.
In addition to providing a basis for comparing stereo algorithms, the ground truth depth data from these datasets provides the opportunity to use machine learning for improving stereo algorithms in a variety of ways. Zhang and Seitz alternately optimized disparity and Markov random field regularization parameters. Scharstein and Pal  learn conditional random field (CRF) parameters, and Li and Huttenlocher 
train a non-parametric CRF model using the structured support vector machine. Learning can also be employed to estimate the confidence of a traditional stereo algorithm, such as the random forest approach of Haeusler et al.. Such confidence measures can improve the result of SGM as shown by Park and Yoon .
Deep convolutional neural networks can be trained to match image patches . A deep network trained to match image patches, followed by non-learned cost aggregation and regularization, was shown by Žbontar and LeCun [47, 49] to produce then state-of-the-art results. Luo et al. presented a notably faster network for computing local matching costs as a multi-label classification of disparities using a Siamese network . A multi-scale embedding model from Chen et al.  also provided good local matching scores. Also noteworthy is the DeepStereo work of Flynn et al. , which learns a cost volume combined with a separate conditional color model to predict novel viewpoints in a multi-view stereo setting.
Mayer et al. created a large synthetic dataset to train a network for disparity estimation (as well as optical flow) , improving the state-of-the-art. As one variant of the network, a 1-D correlation was proposed along the disparity line which is a multiplicative approximation to the stereo cost volume. In addition, this volume is concatenated with convolutional features from a single image and succeeded by a series of further convolutions. In contrast, our work does not collapse the feature dimension when computing the cost volume and uses 3-D convolutions to incorporate context.
Though the focus of this work is on binocular stereo, it is worth noting that the representational power of deep convolutional networks also enables depth estimation from a single monocular image . Deep learning is combined with a continuous CRF by Liu et al. . Instead of supervising training with labeled ground truth, unlabeled stereo pairs can be used to train a monocular model .
In our work, we apply no post-processing or regularization. Our network can explicitly reason about geometry by forming a fully differentiable cost volume. Our network learns to incorporate context from the data with a 3-D convolutional architecture. We don’t learn a probability distribution, cost function, or classification result. Rather, our network is able to directly regress a sub-pixel estimate of disparity from a stereo image pair.
Rather than design any step of the stereo algorithm by hand, we would like to learn an end-to-end mapping from an image pair to disparity maps using deep learning. We hope to learn a more optimal function directly from the data. Additionally, this approach promises to reduce much of the engineering design complexity. However, our intention is not to naively construct a machine learning architecture as a black box to model stereo. Instead, we advocate the use of the insights from many decades of multi-view geometry research  to guide architectural design. Therefore, we form our model by developing differentiable layers representing each major component in traditional stereo pipelines . This allows us to learn the entire model end-to-end while leveraging our geometric knowledge of the stereo problem.
Our architecture, GC-Net (Geometry and Context Network) is illustrated in Figure 1, with a more detailed layer-by-layer definition in Table 1. In the remainder of this section we discuss each component in detail. Later, in Section 4.1, we present quantitative results justifying our design decisions.
Output Tensor Dim.
|Unary features (section 3.1)|
5 conv, 32 features, stride 2
|2||33 conv, 32 features||12H14WF|
|3||33 conv, 32 features||12H14WF|
add layer 1 and 3 features (residual connection)
|4-17||(repeat layers 2,3 and residual connection) 7||12H12WF|
3 conv, 32 features, (no ReLu or BN)
|Cost volume (section 3.2)|
|Learning regularization (section 3.3)|
|19||3-D conv, 333, 32 features||12D12H12WF|
|20||3-D conv, 333, 32 features||12D12H12WF|
|21||From 18: 3-D conv, 333, 64 features, stride 2||14D14H14W2F|
|22||3-D conv, 333, 64 features||14D14H14W2F|
|23||3-D conv, 333, 64 features||14D14H14W2F|
|24||From 21: 3-D conv, 333, 64 features, stride 2||18D18H18W2F|
|25||3-D conv, 333, 64 features||18D18H18W2F|
|26||3-D conv, 333, 64 features||18D18H18W2F|
|27||From 24: 3-D conv, 333, 64 features, stride 2||116D116H116W2F|
|28||3-D conv, 333, 64 features||116D116H116W2F|
|29||3-D conv, 333, 64 features||116D116H116W2F|
|30||From 27: 3-D conv, 333, 128 features, stride 2||132D132H132W4F|
|31||3-D conv, 333, 128 features||132D132H132W4F|
|32||3-D conv, 333, 128 features||132D132H132W4F|
|33||333, 3-D transposed conv, 64 features, stride 2||116D116H116W2F|
|add layer 33 and 29 features (residual connection)||116D116H116W2F|
|34||333, 3-D transposed conv, 64 features, stride 2||18D18H18W2F|
|add layer 34 and 26 features (residual connection)||18D18H18W2F|
|35||333, 3-D transposed conv, 64 features, stride 2||14D14H14W2F|
|add layer 35 and 23 features (residual connection)||14D14H14W2F|
|36||333, 3-D transposed conv, 32 features, stride 2||12D12H12WF|
|add layer 36 and 20 features (residual connection)||12D12H12WF|
|37||333, 3-D trans conv, 1 feature (no ReLu or BN)||DHW1|
|Soft argmin (section 3.4)|
Summary of our end-to-end deep stereo regression architecture, GC-Net. Each 2-D or 3-D convolutional layer represents a block of convolution, batch normalization and ReLU non-linearity (unless otherwise specified).
First we learn a deep representation to use to compute the stereo matching cost. Rather than compute the stereo matching cost using raw pixel intensities, it is common to use a feature representation. The motivation is to compare a descriptor which is more robust to the ambiguities in photometric appearance and can incorporate local context.
In our model we learn a deep representation through a number of 2-D convolutional operations. Each convolutional layer is followed by a batch normalization layer and a rectified linear non-linearity. To reduce computational demand, we initially apply a 55 convolutional filter with stride of two to subsample the input. Following this layer, we append eight residual blocks  which each consist of two 33 convolutional filters in series. Our final model architecture is shown in Table 1. We form the unary features by passing both left and right stereo images through these layers. We share the parameters between the left and right towers to more effectively learn corresponding features.
We use the deep unary features to compute the stereo matching cost by forming a cost volume. While a naive approach might simply concatenate the left and right feature maps, forming a cost volume allows us to constrain the model in a way which preserves our knowledge of the geometry of stereo vision. For each stereo image, we form a cost volume of dimensionality heightwidth(max disparity + 1)feature size. We achieve this by concatenating each unary feature with their corresponding unary from the opposite stereo image across each disparity level, and packing these into the 4D volume.
Crucially, we retain the feature dimension through this operation, unlike previous work which uses a dot product style operation which decimates the feature dimension . This allows us to learn to incorporate context which can operate over feature unaries (Section 3.3). We find that forming a cost volume with concatenated features improves performance over subtracting features or using a distance metric. Our intuition is that by maintaining the feature unaries, the network has the opportunity to learn an absolute representation (because it is not a distance metric) and carry this through to the cost volume. This gives the architecture the capacity to learn semantics. In contrast, using a distance metric restricts the network to only learning relative representations between features, and cannot carry absolute feature representations through to cost volume.
Given this disparity cost volume, we would now like to learn a regularization function which is able to take into account context in this volume and refine our disparity estimate. The matching costs between unaries can never be perfect, even when using a deep feature representation. For example, in regions of uniform pixel intensity (for example, sky) the cost curve will be flat for any features based on a fixed, local context. We find that regions like this can cause multi modal matching cost curves across the disparity dimension. Therefore we wish to learn to regularize and improve this volume.
We propose to use three-dimensional convolutional operations to filter and refine this representation. 3-D convolutions are able to learn feature representations from the height, width and disparity dimensions. Because we compute the cost curve for each unary feature, we can learn convolutional filters from this representation. In Section 4.1 we show the importance of these 3-D filters for learning context and significantly improving stereo performance.
The difficulty with 3-D convolutions is that the additional dimension is a burden on the computational time for both training and inference. Deep encoder-decoder tasks which are designed for dense prediction tasks get around their computational burden by encoding sub-sampled feature maps, followed by up-sampling in a decoder . We extend this idea to three dimensions. By sub-sampling the input with stride two, we also reduce the 3-D cost volume size by a factor of eight. We form our 3-D regularization network with four levels of sub-sampling. As the unaries are already sub-sampled by a factor of two, the features are sub-sampled by a total factor of 32. This allows us to explicitly leverage context with a wide field of view. We apply two 333 convolutions in series for each encoder level. To make dense predictions with the original input resolution, we employ a 3-D transposed convolution to up-sample the volume in the decoder. The full architecture is described in Table 1.
Sub-sampling is useful to increase each feature’s receptive field while reducing computation. However, it also reduces spatial accuracy and fine-grained details through the loss of resolution. For this reason, we add each higher resolution feature map before up-sampling. These residual layers have the benefit of retaining higher frequency information, while the up-sampled features provide an attentive feature map with a larger field of view.
Finally, we apply a single 3-D transposed convolution (deconvolution), with stride two and a single feature output. This layer is necessary to make dense prediction in the original input dimensions because the feature unaries were sub-sampled by a factor of two. This results in the final, regularized cost volume with size HWD.
Typically, stereo algorithms produce a final cost volume from the matching cost unaries. From this volume, we may estimate disparity by performing an argmin operation over the cost volume’s disparity dimension. However, this operation has two problems:
it is discrete and is unable to produce sub-pixel disparity estimates,
it is not differentiable and therefore unable to be trained using back-propagation.
To overcome these limitations, we define a soft argmin111Note that if we wished for our network to learn probabilities, rather than cost, this function could easily be adapted to a soft argmax operation. which is both fully differentiable and able to regress a smooth disparity estimate. First, we convert the predicted costs, (for each disparity, ) from the cost volume to a probability volume by taking the negative of each value. We normalize the probability volume across the disparity dimension with the softmax operation, . We then take the sum of each disparity, , weighted by its normalized probability. A graphical illustration is shown in Figure 2 and defined mathematically in (1):
This operation is fully differentiable and allows us to train and regress disparity estimates. We note that a similar function was first introduced by  and referred to as a soft-attention mechanism. Here, we show how to apply it for the stereo regression problem.
However, compared to the argmin operation, its output is influenced by all values. This leaves it susceptible to multi-modal distributions, as the output will not take the most likely. Rather, it will estimate a weighted average of all modes. To overcome this limitation, we rely on the network’s regularization to produce a disparity probability distribution which is predominantly unimodal. The network can also pre-scale the matching costs to control the peakiness (sometimes called temperature) of the normalized post-softmax probabilities (Figure 2). We explicitly omit batch normalization from the final convolution layer in the unary tower to allow the network to learn this from the data.
We train our entire model end-to-end from a random initialization. We train our model with supervised learning using ground truth depth data. In the case of using LIDAR to label ground truth values (e.g. KITTI dataset[14, 35]) these labels may be sparse. Therefore, we average our loss over the labeled pixels, . We train our model using the absolute error between the ground truth disparity, , and the model’s predicted disparity, , for pixel . This supervised regression loss is defined in (2):
In the following section we show that formulating our model as a regression problem allows us to regress with sub-pixel accuracy and outperform classification approaches. Additionally, formulating a regression model makes it possible to leverage unsupervised learning losses based on photometric reprojection error.
|Model||px||px||px||MAE (px)||RMS (px)||Param.||Time (ms)|
|1. Comparison of architectures|
|Unaries only (omitting all 3-D conv layers 19-36) w Regression Loss||97.9||93.7||89.4||36.6||47.6||0.16M||0.29|
|Unaries only (omitting all 3-D conv layers 19-36) w Classification Loss||51.9||24.3||21.7||13.1||36.0||0.16M||0.29|
|Single scale 3-D context (omitting 3-D conv layers 21-36)||34.6||24.2||21.2||7.27||20.4||0.24M||0.84|
|Hierarchical 3-D context (all 3-D conv layers)||16.9||9.34||7.22||2.51||12.4||3.5M||0.95|
2. Comparison of loss functions
|GC-Net + Classification loss||19.2||12.2||10.4||5.01||20.3||3.5M||0.95|
|GC-Net + Soft classification loss ||20.6||12.3||10.4||5.40||25.1||3.5M||0.95|
|GC-Net + Regression loss||16.9||9.34||7.22||2.51||12.4||3.5M||0.95|
|GC-Net (final architecture with regression loss)||16.9||9.34||7.22||2.51||12.4||3.5M||0.95|
In this section we present qualitative and quantitative results on two datasets, Scene Flow  and KITTI [14, 35]. Firstly, in Section 4.1 we experiment with different variants of our model and justify a number of our design choices using the Scene Flow dataset . In Section 4.2 we present results of our approach on the KITTI dataset and set a new state-of-the-art benchmark. Finally, we measure our model’s capacity to learn context in Section 4.3.
For the experiments in this section, we implement our architecture using TensorFlow
. All models are optimized end-to-end with RMSProp and a constant learning rate of . We train with a batch size of 1 using a randomly located crop from the input images. Before training we normalize each image such that the pixel intensities range from to . We trained the network (from a random initialization) on Scene Flow for approximately 150k iterations which takes two days on a single NVIDIA Titan-X GPU. For the KITTI dataset we fine-tune the models pre-trained on Scene Flow for a further 50k iterations. For our experiments on Scene Flow we use F=32, H=540, W=960, D=192 and on the KITTI dataset we use F=32, H=388, W=1240, D=192 for feature size, image height, image width and maximum disparity, respectively.
In Table 2 we present an ablation study to compare a number of different model variants and justify our design choices. We wish to evaluate the importance of the key ideas in this paper; using a regression loss over a classification loss, and learning 3-D convolutional filters for cost volume regularization. We use the synthetic Scene Flow dataset  for these experiments, which contains training and testing images. We use this dataset for two reasons. Firstly, we know perfect, dense ground truth from the synthetic scenes which removes any discrepancies due to erroneous labels. Secondly, the dataset is large enough to train the model without over-fitting. In contrast, the KITTI dataset only contains 200 training images, and we observe that the model is susceptible to over-fitting to this very small dataset. With tens of thousands of training images we do not have to consider over-fitting in our evaluation.
The first experiment in Table 2 shows that including the 3-D filters performs significantly better than learning unaries only. We compare our full model (as defined in Table 1) to a model which uses only unary features (omitting all 3-D convolutional layers 19-36) and a model which omits the hierarchical 3-D convolution (omitting layers 21-36). We observe that the 3-D filters are able to regularize and smooth the output effectively, while learning to retain sharpness and accuracy in the output disparity map. We find that the hierarchical 3-D model outperforms the vanilla 3-D convolutional model by aggregating a much large context, without significantly increasing computational demand.
The second experiment in Table 2
compares our regression loss function to baselines which classify disparities using hard or soft classification as proposed in
. Hard classification trains the network to classify disparities in the cost volume as probabilities using cross entropy loss with a ‘one hot’ encoding. Soft classification (used by
) smooths this encoding to learn a Gaussian distribution centered around the correct disparity value. In Table2 we observe that our regression approach outperforms both hard and soft classification. This is especially noticeable for the pixel accuracy metrics and the percentage of pixels which are within one pixel of the true disparity, because the regression loss allows the model to predict with sub-pixel accuracy.
Figure 3 plots validation error during training for each of the networks compared in this section. We observe that the classification loss converges faster, however the regression loss performs best overall.
In Table 3 we evaluate the performance of our model on the KITTI 2012 and 2015 stereo datasets [14, 35]. These consist of challenging and varied road scene imagery collected from a test vehicle. Ground truth depth maps for training and evaluation are obtained from LIDAR data. KITTI is a prominent dataset for benchmarking stereo algorithms. The downside is that it only contains training images, which handicaps learning algorithms. for this reason, we pre-train our model on the large synthetic dataset, Scene Flow . This helps to prevent our model from over-fitting the very small KITTI training dataset. We hold out 40 image pairs as our validation set.
Table 2(a) and 2(b) compare our method, GC-Net (Geometry and Context Network), to other approaches on the KITTI 2012 and 2015 datasets, respectively222Full leaderboard: www.cvlibs.net/datasets/kitti/. Our method achieves state of the art results for both KITTI benchmarks, by a notable margin. We improve on state-of-the-art by 9% and 22% for KITTI 2015 and 2012 respectively. Our method is also notably faster than most competing approaches which often require expensive post-processing. In Figure 4 we show qualitative results of our method on KITTI 2012, KITTI 2015 and Scene Flow.
Our approach outperforms previous deep learning patch based methods [48, 32] which produce noisy unary potentials and are unable to predict with sub-pixel accuracy. For this reason, these algorithms do not use end-to-end learning and typically post-process the unary output with SGM regularization  to produce the final disparity maps.
The closest method to our architecture is DispNetC , which is an end-to-end regression network pre-trained on SceneFlow. However, our method outperforms this architecture by a notable margin for all test pixels. DispNetC uses a 1-D correlation layer along the disparity line as an approximation to the stereo cost volume. In contrast, our architecture more explicitly leverages geometry by formulating a full cost volume by using 3-D convolutions and a soft argmin layer, resulting in an improvement in performance.
In this section we present evidence which shows our model can reason about local geometry using wider contextual information. In Figure 5 we show some examples of the model’s saliency with respect to a predicted pixel’s disparity. Saliency maps  shows the sensitivity of the output with respect to each input pixel. We use the method from  which plots the predicted disparity as a function of systematically occluding the input images. We offset the occlusion in each stereo image by the point’s disparity.
These results show that the disparity prediction for a given point is dependent on a wide contextual field of view. For example, the disparity on the front of the car depends on the input pixels of the car and the road surface below. This demonstrates that our model is able to reason about wider context, rather than simply local patches like previous deep learning patch-similarity stereo methods [50, 32].
We propose a novel end-to-end deep learning architecture for stereo vision. It is able to learn to regress disparity without any additional post-processing or regularization. We demonstrate the efficacy of our method on the KITTI dataset, setting a new state-of-the-art benchmark.
We show how to efficiently learn context in the disparity cost volume using 3-D convolutions. We show how to formulate it as a regression model using a soft argmin layer. This allows us to learn disparity as a regression problem, rather than classification, improving performance and enabling sub-pixel accuracy. We demonstrate that our model learns to incorporate wider contextual information.
For future work we are interested in exploring a more explicit representation of semantics to improve our disparity estimation, and reasoning under uncertainty with Bayesian convolutional neural networks.
Conference on Computer Vision and Pattern Recognition (CVPR), 2012.