BA-N ET : D ENSE B UNDLE A DJUSTMENT N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
This paper introduces a network architecture to solve the structure-from-motion (SfM) problem via feature-metric bundle adjustment (BA), which explicitly enforces multi-view geometry constraints in the form of feature-metric error.
The whole pipeline is differentiable, so that the network can learn suitable features that make the BA problem more tractable.
Furthermore, this work introduces a novel depth parameterization to recover dense per-pixel depth.
The network ﬁrst generates several basis depth maps according to the input image, and optimizes the ﬁnal depth as a linear combination of these basis depth maps via feature-metric BA.
The basis depth maps generator is also learned via end-to-end training.
The whole system nicely combines domain knowledge (i.e. hard-coded multi-view geometry constraints) and deep learning (i.e. feature learning and basis depth maps learning) to address the challenging dense SfM problem.
Experiments on large scale real data prove the success of the proposed method.
I NTRODUCTION
The Structure-from-Motion (SfM) problem has been extensively studied in the past a few decades.
Almost all conventional SfM algorithms (Agarwal et al., 2011; Wu et al., 2011; Schönberger &
Frahm, 2016; Engel et al., 2018; Delaunoy & Pollefeys, 2014) jointly optimize scene structures and camera motion via the Bundle-Adjustment (BA) algorithm (Triggs et al., 2000; Agarwal et al., 2010), which minimizes the geometric (Agarwal et al., 2011; Wu et al., 2011; Schönberger & Frahm, 2016) or photometric (Engel et al., 2014; 2018; Delaunoy & Pollefeys, 2014) error through the
Levenberg-Marquardt (LM) algorithm (Nocedal & Wright, 2006).
Some recent works (Ummenhofer et al., 2017; Zhou et al., 2017; Wang et al., 2018) attempt to solve SfM using deep learning techniques, but most of them do not enforce the geometric constraints between 3D structures and camera motion in their networks.
For example, in the recent work DeMoN (Ummenhofer et al., 2017), the scene depths and the camera motion are estimated by two individual sub-network branches.
This paper formulates BA as a differentiable layer, the BA-Layer, to bridge the gap between classic methods and recent deep learning based approaches.
To this end, we learn a feed-forward multilayer perceptron (MLP) to predict the damping factor in the LM algorithm, which makes all involved computation differentiable.
Furthermore, unlike conventional BA that minimizes geometric or photometric error, our BA-layer minimizes the distance between aligned CNN feature maps.
Our novel feature-metric BA takes CNN features of multiple images as inputs and optimizes for the scene structures and camera motion.
This feature-metric BA is desirable, because it has been observed by Engel et al.
(2014; 2018) that the geometric BA does not exploit all image information, while the photometric BA is sensitive to moving objects, exposure or white balance changes, etc.
Most importantly, our BA-Layer can back-propagate loss from scene structures and camera motion to learn appropriate features that are most suitable for structure-from-motion and bundle adjustment.
In this way, our network hard-codes the multi-view geometry constraints in the BA-Layer and learns suitable feature representations from training data.
We strive to estimate a dense per-pixel depth, because dense depth is critical for many tasks such as object detection and robot navigation.
A major challenge in solving dense per-pixel depth is to ﬁnd a compact parameterization.
Direct per-pixel depth is computational expensive, which makes the network training intractable.
So we train a network to generate a set of basis depth maps for an arbitrary input image and represent the result depth map as a linear combination of these basis depth maps.
The combination coefﬁcients will be optimized in the BA-Layer together with camera motion.
This novel parameterization guarantees a smooth depth map with good consistency with object boundaries.
It also reduces the number of unknowns and makes dense BA possible in networks.
Similar depth parameterization is introduced in a recent work, CodeSLAM (Bloesch et al., 2018).
The major difference is that our method learns the basis depth map generator through the gradients back-propagated from the BA-Layer, while CodeSLAM learns the generator separately and uses its results for a standalone optimization component.
Thus, our basis depth map generator has the chance to be better trained for the SfM problem.
Furthermore, we use a different network structure to generate basis depth maps.
CodeSLAM employs a variational auto-encoder (VAE), while we use a standard encoder-decoder.
This design enables us to use the same backbone network for both feature learning and basis depth map learning, making joint training of the whole network possible.
To demonstrate the effectiveness of our method, we evaluate on the ScanNet (Dai et al., 2017a) and
KITTI (Geiger et al., 2012) dataset.
Our method outperforms DeMoN (Ummenhofer et al., 2017),
LS-Net (Clark et al., 2018), as well as several conventional baselines.
Due to page limit, we move the ablation studies, evaluation on DeMoN’s dataset, multi-view SfM (up to 5 views), and comparison with CodeSLAM on the EuroC dataset (Burri et al., 2016) to the appendix.
R ELATED W ORK
Monocular Depth Estimation Networks Estimating depth from a monocular image is an ill-posed problem because an inﬁnite number of possible scenes may have produced the same image.
Before the raise of deep learning based methods, some works predict depth from a single image based on
MRF (Saxena et al., 2005; 2009), semantic segmentation (Ladický et al., 2014), or manually designed features (Hoiem et al., 2005).
Eigen et al.
(2014) propose a multi-scale approach for depth prediction with two CNNs, where a coarse-scale network ﬁrst predicts the scene depth at the global level and then a ﬁne-scale network will reﬁne the local regions.
This approach was extended in Eigen & Fergus (2015) to handle semantic segmentation and surface normal estimation as well.
Recently, Laina et al.
(2016) propose to use ResNet (He et al., 2016) based structure to predict depth, and Xu et al.
(2017) construct multi-scale CRFs for depth prediction.
In comparison, we exploit monocular image depth estimation network for depth parameterization, which only produces a set of basis depth maps and the ﬁnal result will be further improved through optimization.
Structure-from-Motion Networks
Recently, some works exploit CNNs to resolve the SfM problem.
Handa et al.
(2016) solve the camera motion by a network from a pair of images with known depth.
Zhou et al.
(2017) employ two CNNs for depth and camera motion estimation respectively, where both CNNs are trained jointly by minimizing the photometric loss in an unsupervised manner.
Wang et al.
(2018) implement the direct method (Steinbruecker et al., 2011) as a differentiable component to compute camera motion after scene depth is estimated by the method in Zhou et al.
In
Ummenhofer et al.
(2017), the scene depth and the camera motion are predicted from optical ﬂow features, which help to make it generalizing better to unseen data.
However, the scene depth and the camera motion are solved by two separate network branches, multi-view geometry constraints between depth and motion are not enforced.
Recently, Clark et al.
(2018) propose to solve nonlinear least squares in two-view SfM using a LSTM-RNN (Hochreiter et al., 2001) as the optimizer.
Our method belongs to this category.
Unlike all previous works, we propose the BA-Layer to simultaneously predict the scene depth and the camera motion from CNN features, which explicitly enforces multi-view geometry constraints.
The hard-coded multi-view geometry constraints enable our method to reconstruct more than two images, while most deep learning methods can only handle two images.
Furthermore, we propose to minimize a feature-metric error instead of the photometric error in (Zhou et al., 2017;
Wang et al., 2018; Clark et al., 2018) to enhance robustness.
B UNDLE A DJUSTMENT R EVISITED
Before introducing our BA-Net architecture, we revisit the classic BA to have a better understanding about where the difﬁculties are and why feature-metric BA and feature learning are desirable.
We only introduce the most relevant content and refer the readers to Triggs et al.
(2000) and Agarwal et al.
for a comprehensive introduction.
Given images I =
{ I i | i = 1 · · · N i } , the geometric BA (Triggs et al., 2000; Agarwal et al., 2010) jointly optimizes camera poses T
= { T i | i = 1 · · · N i } and 3D scene point coordinates P = { p j | j = 1 · · · N j } by minimizing the re-projection error:
[Equation]
where the geometric distance
[Equation]
measures the difference between a projected scene point and its corresponding feature point.
The function π projects scene points to image space, q i,j =
[ x i,j , y i,j , 1] is the normalized homogeneous pixel coordinate, and
X =
[ T 1 , T 2 · · · T N i , p 1 , p 2 · · · p N j ] (cid:62) contains all the points’ and the cameras’ parameters.
The general strategy to minimize Equation (1) is the Levenberg-Marquardt (LM) (Nocedal & Wright, 2006; Lourakis & Argyros, 2005) algorithm.
At each iteration, the LM algorithm solves for an optimal update ∆ X ∗ to the solution by minimizing:
[Equation]
Here, E ( X ) =
[ e g 1 , 1 ( X ) , e g 1 , 2 ( X ) · · · e gN i ,N j ( X )] , and J ( X ) is the Jacobian matrix of E ( X ) respect to X , D
( X ) is a non-negative diagonal matrix, typically the square root of the diagonal of the approximated Hessian J ( X )
(cid:62) J ( X ) .
The non-negative value λ controls the regularization strength.
The special structure of J ( X ) (cid:62) J ( X ) motivates the use of Schur-Complement (Brown, 1958).
This geometric BA with re-projection error is the golden standard for structure-from-motion in the last two decades, but with two main drawbacks:
• Only image information conforming to the respective feature types, typically image corners, blobs, or line segments, is utilized.
• Features have to be matched to each other, which often result in a lot of outliers.
Outlier rejection like RANSAC is necessary, which still cannot guarantee correct result.
These two difﬁculties motivate the recent development of direct methods (Engel et al., 2014; 2018;
Delaunoy & Pollefeys, 2014) which propose the photometric BA algorithm to eliminate feature matching and directly minimizes the photometric error (pixel intensity difference) of aligned pixels.
The photometric error is deﬁned as:
[Equation]
where d j ∈ D = { d j | j = 1 · · · N j } is the depth of a pixel q j at the image
I 1 , and d j · q j upgrade the pixel q j to its 3D coordinate.
Thus, the optimization parameter is X =
[ T 1 , T 2 · · · T N i , d 1 , d 2 · · · d N j ] (cid:62) .
The direct methods have the advantages of using all pixels with sufﬁcient gradient magnitude.
They have demonstrated superior performance, especially at less textured scenes.
However, these methods also have some drawbacks:
• They are sensitive to initialization as demonstrated in (Mur-Artal et al., 2015) and (Tang et al., 2017) because the photometric error increases the non-convexity (Engel et al., 2018).
• They are sensitive to camera exposure and white balance changes.
An automatic photometric calibration is required (Engel et al., 2018; 2016).
• They are more sensitive to outliers such as moving objects.
T HE BA-N ET A RCHITECTURE
To deal with the above challenges, we propose a feature-metric BA algorithm which estimates the same scene depth and camera motion parameters X as in photometric BA, but minimizes the feature-metric difference of aligned pixels:
[Equation]
where F = { F i | i = 1 · · · N i } are feature pyramids of images
I =
{ I i | i = 1 · · · N i } .
Similar to the photometric BA, our feature-metric BA considers more pixels than corners or blobs.
It has the potential to learn more suitable features for SfM to deal with exposure changes, moving objects, etc.
We learn features suitable for SfM via back-propagation, instead of using pre-trained CNN features for image classiﬁcation (Czarnowski et al., 2017).
Therefore, it is crucial to design a differentiable optimization layer, our BA-Layer, to solve the optimization problem, so that the loss information can be back-propagated.
The BA-Layer predicts the camera poses T and the dense depth map D during forward pass and back-propagates the loss from T and D to the feature pyramids F for training.
[Figure]
[Figure] [Figure]
D
4. O VERVIEW
As illustrated in Figure 1, our BA-Net receives multiple images and then feed them to the backbone
DRN-54.
We use DRN-54 (Yu et al., 2017) because it replaces max-pooling with convolution layers and generates smoother feature maps, which is desirable for BA optimization.
Note the original DRN is memory inefﬁcient due to the high resolution feature maps after dilation convolutions.
We replace the dilation convolution with ordinary convolution with strides to address this issue.
After DRN-54, a feature pyramid is then constructed for each input image, which are the inputs for the BA-Layer.
At the same time, the basis depth maps generator generates multiple basis depth maps for the image
I 1 , and the ﬁnal depth map is represented as a linear combination of these basis depth maps.
Finally, the BA-Layer optimizes for the camera poses and the dense depth map jointly by minimizing the feature-metric error deﬁned in Equation (4), which makes the whole pipeline end-to-end trainable.
4. F EATURE P YRAMID
The feature pyramid learns suitable features for the BA-Layer.
Similar to the feature pyramid networks (FPN) for object detection (Lin et al., 2017), we exploit the inherent multi-scale hierarchy of deep convolutional networks to construct feature pyramids.
A top-down architecture with lateral connections is applied to propagate richer context information from coarser scales to ﬁner scales.
Thus, our feature-metric BA will have a larger convergence radius.
As shown in Figure 2(a), we construct a feature pyramid from the backbone DRN-54.
We denote the last residual blocks of conv1, conv2, conv3, conv4 in DRN-54 as { C 1 , C 2 , C 3 , C 4 } , with strides { 1 , 2 , 4 , 8 } respectively.
We upsample a feature map C k +1 by a factor of 2 with bilinear interpolation and concatenate the upsampled feature map with C k in the next level.
This procedure is iterated until the ﬁnest level.
Finally, we apply a 3 × 3 convolution on the concatenated feature maps to reduce its
[Figure]
[Equation]
(RGB)
[Figure]
+ + (a) Inputs -10 -
2 4 6 8 10 Offset-X -10-
8- -420246810 O
ff s e t - Y 0.
(b) RGB -
2 4 6 8 10 Offset-X -10-
8- -420246810 O
ff s e t - Y 0.
(c) C-10 -
-6 -4 -2 0 2 4 6 8 10 Offset-X -10-
8- -420246810 O
ff s e t - Y 0.
(d) F
We visualize some typical channels from the raw image
I (i.e. the RGB channels), the pre-trained
DRN-54 C 3 and our learned F 3 in Figure 2(b).
It is evident that, after training with our BA-Layer, the feature pyramid becomes smoother and each channel correspondences to different regions in the image.
Note that our feature pyramids have higher resolution than FPN to facilitate precise alignment.
To have a better intuition about how much the BA optimization beneﬁts from our learned features, we visualize different distances in Figure 3.
We evaluate the distance between a pixel marked by a yellow cross in the top image in Figure 3 (a) and all pixels in a neighbourhood of its corresponding point in the bottom image of Figure 3 (a).
The distances evaluated from raw RGB values, pretrained feature C 3 , and our learned feature F 3 are visualized in (b), (c), and (d) respectively.
All distances are normalized to [0 , 1] and visualized as heat maps.
The x -axis
and y -axis are the offsets to the ground-truth corresponding point.
The RGB distance in (b) (i.e. e p in Equation (3)) has no clear global minimum, which makes the photometric BA sensitive to initialization (Engel et al., 2014; 2018).
The distance measured by the pretrained feature C 3 has both global and local minimums.
Finally, the distance measured by our learned feature F 3 has a clear global minimum and smooth basin, which is helpful in gradient based optimization such as the LM algorithm.
4. B UNDLE A DJUSTMENT L AYER
After building feature pyramids for all images, we optimize camera poses and a dense depth map by minimizing the feature-metric error in Equation (4).
Following the conventional Bundle Adjustment principle, we optimize Equation (4) using the Levenberg-Marquardt (LM) algorithm.
However, the original LM algorithm is non-differentiable because of two difﬁculties:
• The iterative computation terminates when a speciﬁed convergence threshold is reached.
This if-else based termination strategy makes the output solution X non-differentiable with respect to the input F (Domke, 2012).
• In each iteration, it updates the damping factor λ based on the current value of the objective function.
It raises λ if a step fails to reduce the objective; otherwise it reduces λ .
This if-else decision also makes X non-differentiable with respect to F .
When the solution X is non-differentiable with respect to F , feature learning by back-propagation becomes impossible.
The ﬁrst difﬁculty has been studied in Domke (2012) and the author proposes to ﬁx the number of iterations, which is refered as ‘incomplete optimization’.
Besides making the optimization differentiable, this ‘incomplete optimization’ technique also reduces memory consumption because the number of iterations is usually ﬁxed at a small value.
The second difﬁculty has never been studied.
Previous works mainly focus on gradient descent (Domke, 2012) or quadratic minimization (Amos & Kolter, 2017; Schmidt & Roth, 2014).
In this section, we propose a simple yet effective approach to soften the if-else decision and yields a differentiable LM algorithm.
We send the current objective value to a MLP network to predict λ .
This technique not only makes the optimization differentiable, but also learns to predict a better damping factor λ , which helps the optimization to reach a better solution within limited iterations.
To start with, we illustrate a single iteration of the LM optimization as a diagram in Figure 4 by interpreting intermediate variables as network nodes.
During the forward pass, we compute the solution update ∆ X from feature pyramids F and current solution X as the following steps:
[Figure]
• We compute the feature-metric error E ( X ) =
[ e f 1 , 1 ( X ) , e f 1 , 2 ( X ) · · · e fN i ,N j ( X )] with Equation (4) on all N i images and N j pixels, where X is the solution from the previous iteration; • We then compute the Jacobian matrix J ( X ) ,
the Hessian matrix J ( X ) (cid:62) J ( X ) and its diagonal matrix D ( X ) ; • To predict the damping factor λ , we use global average pooling to aggregate the aboslute value of E ( X ) over all pixels for each feature channel, and get a 128D feature vector.
We then send it to a MLP sub-network to predict λ ; • Finally, the update ∆ X to the current solution is computed as a standard LM step:
[Equation]
In this way, we can consider λ as an intermediate variable and denote each LM step as a function g about features pyramids F and the solution X from the previous iteration.
In other words, ∆ X = g ( X ; F ) .
Therefore, the solution after the k -th iteration is:
[Equation] [Equation]
Here, ◦ denotes parameters updating, which is addition for depth and SE(3) exponential mapping for camera poses.
Equation (6) is differentiable with respect to the feature pyramids F , which makes back-propagation possible through the whole pipeline for feature learning.
The MLP that predicts λ is also shown in Figure 4.
We stack four fully-connected layers to predict λ from the input 128D vector.
We use ReLU as the activation function to guarantee λ is non-negative.
Following the photometric
BA (Engel et al., 2014; 2018), we solve our feature-metric BA using a coarse-to-ﬁne strategy with feature map warping at each iteration.
We apply the differentiable LM algorithm for 5 iterations at each pyramid level, leading to 15 iterations in total.
All the camera poses are initialized with identity rotation and zero translation, and the initialization of depth map will be introduced in Section 4.4.
4. B ASIS D EPTH M APS G ENERATION
Parameterizing a dense depth map by a per-pixel depth value is impractical under our formulation.
Firstly, it introduces too many parameters for optimization.
For example, an image of 320 ×pixels results in 76 .
8 k parameters.
Secondly, in the beginning of training, many pixels will become invisible in the other views because of the poorly predicted depth or motion.
So little information can be back-propagated to improve the network, which makes training difﬁcult.
To deal with these problems, we use the convolutional network for monocular image depth estimation as a compact parameterization, rather than using it as an initialization as in Tateno et al.
(2017) and Yang et al.
We use a standard encoder-decoder architecture for monocular depth learning as in Laina et al.
We use DRN-54 as the encoder to share the same backbone features with our feature pyramids.
For the decoder, we modify the last convolutional feature maps of Laina et al.
(2016) to 128 channels and use these feature maps as the basis depth maps for optimization.
The ﬁnal depth map is generated as the linear combination of these basis depth maps, which is:
[Equation]
Here, D is the h · w depth map that contains depth values for all pixels, B is a 128 × h · w matrix, representing 128 basis depth maps generated from network, w is the linear combination weights of these basis depth maps.
The w will be optimized in our BA-Layer.
The ReLU activation function guarantees the ﬁnal depth is non-negative.
Once B is generated from the network, we ﬁx B and use w as a compact depth parameterization in BA optimization, and the feature-metric distance becomes:
[Equation]
where B [ j ] is the j -th column of B , and ReLU ( w (cid:62) B
[ j ]) is the corresponding depth of q j .
To further speedup convergence, we learn the initial weight w 0 as a 1D convolution ﬁlter for an arbitrary image, i.e. D 0 = ReLU ( w (cid:62) 0 B ) .
The B of various images are visualized in the appendix.
4. T RAINING
The BA-Net learns the feature pyramid, the damping factor predictor, and the basis depth maps generator in a supervised manner.
We apply the following commonly used loss for training, though more sophisticated ones might be designed.
Camera Pose Loss
The camera rotation loss is the distance between rotation quaternion vectors
L rotation = (cid:107) q − q ∗ (cid:107) .
Similarly, translation loss is the Euclidean distance between prediction and groundtruth in metric scale,
[Equation]
Depth Map Loss For each dense depth map we applies the berHu Loss (Zwald & Lambert-Lacroix, 2012) as in Laina et al.
We initialize the back-bone network from DRN-54 (Yu et al., 2017), and the other components are trained with ADAM (Kingma & Ba, 2015) from scratch with initial learning rate 0.001, and the learning rate is divided by two when we observe plateaus from the Tensorboard interface.
E VALUATION 5. D ATASET
ScanNet ScanNet (Dai et al., 2017a) is a large-scale indoor dataset with 1,513 sequences indifferent scenes.
Camera poses and depth maps are not perfect, because they are estimated via
BundleFusion (Dai et al., 2017b).
The metric scale is known in all data from ScanNet, because the data are recorded with a depth camera which returns absolute depth values.
To sample image pairs for training, we apply a simple ﬁltering process.
We ﬁrst ﬁlter out pairs with a large photo-consistency error, to avoid image pairs with large pose or depth error.
We also ﬁlter out image pairs, if less than 50% of the pixels from one image are visible in the other image.
In addition, we also discard a pair if their roundness score (Beder & Steffen, 2006) is less than 0.001, which avoids pairs with too narrow baselines.
We split the whole dataset into the training and the testing sets.
The training set contains the ﬁrst 1,413 sequences and the testing set contains the rest 100 sequences.
We sample 547,991 training pairs and 2,000 testing pairs from the training and testing sequences respectively.
KITTI KITTI (Geiger et al., 2012) is a widely used benchmark dataset collected by car-mounted cameras and a LIDAR sensor on streets.
It contains 61 scenes belonging to the "city", "residential", or "road" categories.
Eigen et al.
(2014) select 28 scenes for testing and 28 scenes from the remaining for training.
We use the same data split, to make a fair comparison with previous methods.
Since ground truth pose is unavailable from the raw KITTI dataset, we compute camera poses by LibVISO2 (Geiger et al., 2011) and take them as ground truth after discarding poses with large errors.
5. C OMPARISONS WITH O THER M ETHODS
ScanNet To evaluate the results’ quality, we use the depth error metrics suggested in Eigen &
Fergus (2015), where RMSE (linear, log, and log, scale inv.) measure the RMSE of the raw, the logarithmical, and aligned logarithmical depth values, while the other two metrics measure the mean of the ratios that divide the absolute and square error by groundtruth depth..
The errors in camera poses are measured by the rotation error (the angle between the ground truth and the estimated camera rotations), the translation direction error (the angle between the ground truth and estimated camera translation directions) and the absolute position error (the distance between the ground truth and the estimated camera translation vectors).
In Table 1, we compare our method with DeMoN (Ummenhofer et al., 2017) and the conventional photometric and geometric BA.
Note that we cannot get DeMoN trained on the ScanNet.
For fair comparison, we train our network on the same training data as DeMoN and test both networks
[Table]
on our testing data 1 .
We also show the results of our network trained on ScanNet.
Our BA-Net consistently performs better than DeMoN no matter which training data is used.
Since DeMoN does not recover the absolute scale, we align its depth map with the groundtruth to recover its metric scale for evaluation.
We further compare with conventional geometric
(Nister, 2004; Agarwal et al.) and photometric (Engel et al., 2014)
BA.
Again, our method produces better results.
The geometric BA works poorly here, because feature matching is difﬁcult in indoor scenes.
Even the RANSAC process cannot get rid of all outliers.
While for photometirc BA, the highly non-convex objective function is difﬁcult to optimize as described in Section 3.
KITTI We use the same metrics as the comparisons on ScanNet for depth evaluation.
To evaluate the camera poses, we follow (Zhou et al., 2017; Wang et al., 2018) to use the Absolute Trajectory
Error (ATE), which measures the Euclidean differences between two trajectories (Steinbruecker et al., 2011), on the 9th and 10th sequences from the KITTI odometry data.
In this experiment, we create short sequences of 5 frames by ﬁrst computing 5 two-view reconstructions from our BA-Net and then align the two-view reconstructions in the coordinate system anchored at the ﬁrst frame. minimize the photometric error. [Table]
Table 2 summarizes our results on KITTI.
Our method outperforms the supervised methods (Eigen et al., 2014) as well as recent unsupervised methods (Zhou et al., 2017; Wang et al., 2018; Godard et al., 2017).
Our method also achieves more accurate camera trajectories than Zhou et al.
(2017) and Wang et al.
We believe this is due to our feature-metric BA with features learned speciﬁcally for SfM problem, which makes the objective function closer to convex and easier to optimize as discussed in Section 4.2.
In comparison, Zhou et al.
(2017) and Wang et al.
More comparison with DeMoN, ablation studies, and multi-view SfM (up to 5 views) are reported in the appendix due to page limit.
C ONCLUSIONS AND F UTURE W ORKS
This paper presents the BA-Net, a network that explicitly enforces multi-view geometry constraints in terms of feature-metric error.
It optimizes scene depths and camera motion jointly via feature-metric bundle adjustment.
The whole pipeline is differentiable and thus end-to-end trainable, such that the features are learned from data to facilitate structure-from-motion.
The dense depth is parameterized as a linear combination of several basis depth maps generated from the network.
Our BA-Net nicely combines domain knowledge (hard-coded multi-view geometry constraint) with deep learning (learned feature representation and basis depth maps generator).
It outperforms conventional BA and recent deep learning based methods.
A PPENDIX A: I MPLEMENTATION D ETAILS
[Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure]
Network Architecture Details Figure 5 illustrates the detailed network architectures for the backbone DRN-54 and the depth basis generator.
The architecture of the feature pyramid has been provided in Figure 2(a).
We modify the dilated convolution of the original DRN-54 to convolution with strides and discard the conv7 and conv8 as shown in Figure 5(a).
C 1 to C 6 are layers with {1,2,4,8,16,32} strides and {16,32,256,512,1024,2048} channels, where C 1 and C 2 are basic convolution layers, while C 3 to C 6 are standerd bottleneck blocks as in ResNet (He et al., 2016).
Figure 5(b) visualizes our depth basis generator which adopts the up-projection structure proposed in Laina et al.
The depth basis generator is a stander decoder that takes the output of C 6 as input and stacks ﬁve up-projection blocks to generate 128 basis depth maps, and each of the basis depth maps is half the resolution of the input image.
The up-projection block is shown on the right of
Figure 5(b) which upsample the input by 2 × and then apply convolutions with projection connection.
Evaluation Time To evaluate the running time of our method, we use the Tensorﬂow proﬁler tool to retrieve the time in ms for all network nodes and then summarize the results corresponding to each component in our pipeline.
As shown in Table 3, our method takes 95.21 ms to reconstruct two 320 × 240 images, which is slightly faster than DeMoN that takes 110 ms for two 256 × 192 images.
The current computation bottleneck is the BA-Layer which contains a large amount of matrix operations and can be further speeded up by direct CUDA implementation.
Since we explicitly hard-code the multi-view geometry constraints in the BA-Layer, it is possible to share the backbone
DRN-54 with other high-level vision tasks, such as semantic segmentation and object detection, to maximize reuse of network structures and minimize extra computation cost.
[Table]
A PPENDIX B: A BLATION S TUDIES
Learned Features vs Pre-trained Features Our learned feature pyramid improves the convexity of the objective function to facilitate the optimization.
We compare our learned features with features
[Table]
pre-trained on ImageNet for classiﬁcation tasks.
As shown in Table 4, the pre-trained features (i.e. w/o Feature Learning) produce larger error.
This proves the discussion in Section
Bundle Adjustment Optimization vs SE(3) Pose Estimation Our BA-Layer optimizes depth and camera poses jointly.
We compare it to the SE(3) camera pose estimation with ﬁxed depth map (e.g. the initialized depth D 0 in Section 4.4), and similar strategy is adopted in Wang et al.
To make a fair comparison, we also use our learned feature pyramids for the SE(3) camera pose estimation.
As shown in Table 4, without BA optimization (i.e. w/o Joint Optimization), both the depth maps and camera poses are worse, because the errors in the depth estimation will degrades the camera pose estimation.
Differentiable Levenberg-Marquardt vs Gauss-Newton To make the whole pipeline end-to-end trainable, we makes the Levenberg-Marquardt algorithm differentiable by learning the damping factor from the network.
We ﬁrst compare our method against vanilla Gauss-Newton without damping factor λ (i.e. λ = 0 ).
Since the objective function of feature-metric BA is non-convex, the Hessian matrix J ( X ) (cid:62) J ( X ) might not be positive deﬁnite, which makes the matrix inversion by Cholesky decomposition fail.
To deal with this problem, we use QR decomposition instead for training with Gauss-Newton.
As shown in Table 4, the Gauss-Newton algorithm (i.e. w/o λ ) generates much larger error, because the
BA optimization is non-convex and the Gauss-Newton algorithm has no guaranteed convergence unless the initial solution is sufﬁciently close to the optimal (Nocedal & Wright, 2006).
This comparison reveals that, similar to conventional BA, our differnetiable Levenberg-Marquardt algorithm is superior than the Gauss-Newton algorithm for feature-metric BA.
[Figure]
Predicted vs Constant λ Another way to make the Levenberg-Marquardt algorithm differentiable is to ﬁx the λ during the iterations.
We compare with this strategy.
As shown in Figure 6(a), increasing λ makes the both rotation and translation error decreases, until λ = 0 .
5 , and then increases.
The reason is that a small λ makes the algorithm close to the Gauss-Newton algorithm, which has convergence issues.
A large λ leads to a small update at each iteration, which makes it difﬁcult to reach a good solution within limited iterations.
While in Figure 6(b), increasing λ always makes depth errors decrease, probably because a larger λ leads to a small update and makes the ﬁnal depth close to the initialed depth, which is better than the optimized one with small constant λ .
Using constant λ value consistently generates worse results than using a predicted λ from the MLP network, because there is no optimal λ for all data and it should be adapted to different data and different iterations.
We draw the errors of our method in Figure 6(a) and Figure 6(b) as the ﬂat dash lines for a reference.
A PPENDIX C: E VALUATION ON D E M O N DATASET
Table 5 summarizes our results on the DeMoN dataset.
For a comparison, we also cite the results from DeMoN (Ummenhofer et al., 2017) and the most recent work LS-Net (Clark et al., 2018).
We further cite the results from some conventional approaches as reported in DeMoN, indicated as
Oracle , SIFT , FF , and Matlab respectively.
Here, Oracle uses ground truth camera poses to solve the multi-view stereo by SGM (Hirschmuller, 2005), while SIFT , FF , and Matlab further use sparse features, optical ﬂow, and KLT tracking respectively for feature correspondence to solve camera poses by the 8-pt algorithm (Hartley, 1997).
[Table]
Our method consistently outperforms DeMoN (Ummenhofer et al., 2017) at both camera motion and scene depth, except on the ‘Scenes11’ data, because we enforce multi-view geometry constraint in the
BA-Layer.
Our results are poorer on the ‘Scene11’ dataset, because the images there are synthesized with random objects from the ShapeNet (Chang et al., 2015) without physically correct scale.
This setting is inconsistent with real data and makes it harder for our method to learn the basis depth map generator.
When compared with LS-Net Clark et al.
(2018), our method achieves similar accuracy on camera poses but better scene depth.
It proves our feature-metric BA with learned feature is superior than the photometric BA in the LS-Net.
A PPENDIX D: M ULTI -V IEW S TRUCTURE - FROM -M OTION
Our method can be easily extended to reconstruct multiple images.
We evaluate our method in the multi-view setting on the ScanNet (Dai et al., 2017a) dataset.
To sample multi-view images for training, we randomly select two-view image pairs that shares a common image to construct N -view sequences.
Due to the limited GPU memory (12G), we limit N to 5.
As shown in the Table 6, the accuracy is consistently improved when more views are included, which demonstrates the strength of the multi-view geometry constraints.
Instead, most existing deep learning approaches can only handle two views at a time, which is sub-optimal as known in structure-from-motion literature.
[Table]
A PPENDIX E: Q UANTITATIVE C OMPARISONS WITH C ODE SLAM
We compare our method with CodeSLAM (Bloesch et al., 2018) which adopts similar idea for depth parameterization.
But the difference is that CodeSLAM learns the conditioned depth auto-encoder separately and uses the depth codes in a standalone photometric BA component, while our method learns the feature pyramid and basis depth maps generator through feature-metric BA end-to-end.
Since there is no public code for CodeSLAM, we directly cite the results from their paper.
2 To get the trajectory on the EuroC MH02 sequence of our method, we select one frame every four frames and concatenate the reconstructed groups that contains every ﬁve selected frames.
Then we use the same evaluation metrics as in CodeSLAM, which measures the translation errors correspond to different traveled distances.
[Figure] [Figure]
[Table]
[Figure]
r a
[Figure]
l a t i
[Figure]
o r ( m )
[Figure]
[Table] [Table]
[Table] [Table]
[Figure]
T r a n s l a t i on E rr o r ( m )
Ours
CodeSLAM CodeSLAM
Ours
Travel Distance (m) 0.
T r a n s l a t i on E rr o r ( m )
Ours
CodeSLAM
As shown in Figure 7, our method outperforms CodeSLAM.
Our median error is less than the half of
CodeSLAM’s error, i.e. CodeSLAM exhibits an error of roughly 1 m for a traveled distance of 9 m, while our method’s error is about 0.4 m. This comparison demonstrates the superiority of end-to-end learning with feature pyramid and feature-metric BA over learning depth parameterization only.
A PPENDIX F: V ISUALIZATION OF B ASIS D EPTH M APS
In Figure 8, we visualize four typical basis depth maps as heat maps for each of the four images.
An interesting observation is that one basis depth map has higher responses on close objects while another oppositely has higher responses to the far background.
Some other basis depth maps have smoothly varying responses and correspond to the layouts of scenes.
This observation reveals that our learned basis depth maps have captured the latent structures of scenes.
A PPENDIX G: Q UALITATIVE C OMPARISONS WITH OTHER METHODS
Finally, we show some qualitative comparison with the previous methods.
Figure 9 shows the recovered depth map by our method and DeMoN Ummenhofer et al.
(2017) on the ScanNet data.
As we can see from the regions highlighted with a red circle, our method recovers more shape details.
This is consistent with the quantitative results in Table 1.
Figure 11 shows the recovered depth maps by our method, Wang et al.
(2018), and Godard et al.
(2017) respectively.
Similarly, we observe more shape details in our results, as reﬂected in the quantitative results in Table 2.
[Figure]