FlowNet: Learning Optical Flow with Convolutional Networks | AGIDaily
AGI Daily
资讯日报词条论文人物新创
返回论文列表

暂无章节

返回论文列表
目录

FlowNet: Learning Optical Flow with Convolutional Networks

收录于 ICCV 2015 会议论文被引 5,313 次
打开论文来源

FlowNet: Learning Optical Flow with Convolutional Networks

Alexey Dosovitskiy∗, Philipp Fischer†∗, Eddy Ilg∗, Philip Häusser, Caner Hazırbaş, Vladimir Golkov†

University of Freiburg
Technical University of Munich

{fischer,dosovits,ilg}@cs.uni-freiburg.de,
{haeusser,hazirbas,golkov}@cs.tum.edu

Patrick van der Smagt
Technical University of Munich
smagt@brml.org

Daniel Cremers
Technical University of Munich
cremers@tum.de

Thomas Brox
University of Freiburg
brox@cs.uni-freiburg.de

∗These authors contributed equally
†Supported by the Deutsche Telekom Stiftung

Abstract

摘要

Convolutional neural networks (CNNs) have recently been very successful in a variety of computer vision tasks, especially on those linked to recognition. Optical flow estimation has not been among the tasks CNNs succeeded at. In this paper we construct CNNs which are capable of solving the optical flow estimation problem as a supervised learning task. We propose and compare two architectures: a generic architecture and another one including a layer that correlates feature vectors at different image locations. Since existing ground truth data sets are not sufficiently large to train a CNN, we generate a large synthetic Flying Chairs dataset. We show that networks trained on this unrealistic data still generalize very well to existing datasets such as Sintel and KITTI, achieving competitive accuracy at frame rates of 5 to 10 fps.

卷积神经网络(CNN)近来在多种计算机视觉任务上取得很大成功,尤其是与识别相关的任务。光流估计还没有成为 CNN 能够做好的任务之一。本文构造了能够把光流估计作为监督学习任务来求解的 CNN。我们提出并比较了两种结构:一种是通用结构,另一种则包含一层,用来对图像不同位置上的特征向量做相关。由于现有带真值的数据集还不够大,不足以训练 CNN,我们生成了一个大规模合成数据集 Flying Chairs。我们表明,即便只在这些并不真实的数据上训练,网络仍然能够很好地泛化到 Sintel 和 KITTI 等已有数据集,在 5 到 10 fps 的帧率下达到可竞争的精度。

  1. Introduction
  1. 引言

Convolutional neural networks have become the method of choice in many fields of computer vision. They are classically applied to classification [25, 24], but recently presented architectures also allow for per-pixel predictions like semantic segmentation [28] or depth estimation from single images [10]. In this paper, we propose training CNNs end-to-end to learn predicting the optical flow field from a pair of images.

卷积神经网络已成为计算机视觉许多领域里的首选方法。它们经典地用于分类 [25, 24],但近来提出的结构也可以做逐像素预测,例如语义分割 [28],或从单幅图像估计深度 [10]。本文提出以端到端方式训练 CNN,从一对图像中学习预测光流场。

While optical flow estimation needs precise per-pixel localization, it also requires finding correspondences between two input images. This involves not only learning image feature representations, but also learning to match them at different locations in the two images. In this respect, optical flow estimation fundamentally differs from previous applications of CNNs.

光流估计既需要精确的逐像素定位,也要在两幅输入图像之间找到对应关系。这不但要学习图像的特征表示,还要学会在两幅图的不同位置上匹配这些特征。就这一点而言,光流估计与 CNN 以往的应用有根本不同。

FlowNet 示意图:一对图像输入卷积网络,先收缩再扩展,输出光流场

Figure 1. We present neural networks which learn to estimate optical flow, being trained end-to-end. The information is first spatially compressed in a contractive part of the network and then refined in an expanding part.

图 1. 我们给出能够学习估计光流的神经网络,并以端到端方式训练。信息先在网络的收缩部分做空间压缩,再在扩展部分得到细化。

Since it was not clear whether this task could be solved with a standard CNN architecture, we additionally developed an architecture with a correlation layer that explicitly provides matching capabilities. This architecture is trained end-to-end. The idea is to exploit the ability of convolutional networks to learn strong features at multiple levels of scale and abstraction and to help it with finding the actual correspondences based on these features. The layers on top of the correlation layer learn how to predict flow from these matches. Surprisingly, helping the network this way is not necessary and even the raw network can learn to predict optical flow with competitive accuracy.

当时还不清楚这项任务能否用标准 CNN 结构来完成,因此我们另外设计了一种带相关层(correlation layer)的结构,显式提供匹配能力。该结构以端到端方式训练。想法是利用卷积网络在多种尺度和抽象层次上学习强特征的能力,并借助这些特征去寻找真正的对应关系。相关层之上的各层则学习如何由这些匹配结果预测光流。出乎意料的是,这样帮助网络并非必要,即便是未经这种设计的原始网络,也能学会以可竞争的精度预测光流。

Training a network to predict generic optical flow requires a sufficiently large training set. Although data augmentation does help, the existing optical flow datasets are still too small to train a network on par with state of the art. Getting optical flow ground truth for realistic video material is known to be extremely difficult [7]. Trading in realism for quantity, we generate a synthetic Flying Chairs dataset which consists of random background images from Flickr on which we overlay segmented images of chairs from [1]. These data have little in common with the real world, but we can generate arbitrary amounts of samples with custom properties. CNNs trained on just these data generalize surprisingly well to realistic datasets, even without fine-tuning.

要训练网络去预测通用光流,需要足够大的训练集。数据增广固然有帮助,但现有的光流数据集仍然太小,不足以训练出与当时最优方法相当的网络。为真实视频材料获取光流真值,一向极为困难 [7]。我们用数量换取真实感,生成了合成数据集 Flying Chairs:从 Flickr 随机取背景图像,再叠加上来自 [1] 的椅子分割图像。这些数据与真实世界几乎没有共同点,但我们可以按自定义属性生成任意数量的样本。仅在这些数据上训练的 CNN,即便不做微调,也能出人意料地很好地泛化到真实数据集。

Leveraging an efficient GPU implementation of CNNs, our method is faster than most competitors. Our networks predict optical flow at up to 10 image pairs per second on the full resolution of the Sintel dataset, achieving state-of-the-art accuracy among real-time methods.

借助高效的 CNN GPU 实现,我们的方法比多数竞争方法更快。网络在 Sintel 数据集的全分辨率上,最高可以每秒预测 10 对图像的光流,在实时方法中达到当时最优精度。

  1. Related Work
  1. 相关工作

Optical Flow. Variational approaches have dominated optical flow estimation since the work of Horn and Schunck [19]. Many improvements have been introduced [29, 5, 34]. The recent focus was on large displacements, and combinatorial matching has been integrated into the variational approach [6, 35]. The work of [35] termed DeepMatching and DeepFlow is related to our work in that feature information is aggregated from fine to coarse using sparse convolutions and max-pooling. However, it does not perform any learning and all parameters are set manually. The successive work of [30] termed EpicFlow has put even more emphasis on the quality of sparse matching as the matches from [35] are merely interpolated to dense flow fields while respecting image boundaries. We only use a variational approach for optional refinement of the flow field predicted by the convolutional net and do not require any handcrafted methods for aggregation, matching and interpolation.

光流。自 Horn 与 Schunck [19] 的工作以来,变分方法一直主导着光流估计。其间出现了许多改进 [29, 5, 34]。近来的重点转向大位移,组合匹配也被纳入变分方法之中 [6, 35]。[35] 中称为 DeepMatching 与 DeepFlow 的工作与本文有相近之处:它用稀疏卷积和最大池化,把特征信息由细到粗加以汇聚。不过它不做任何学习,全部参数都是手工设定的。后续的 [30] 称为 EpicFlow,更加看重稀疏匹配的质量,因为来自 [35] 的匹配只是在尊重图像边界的前提下插值成稠密流场。我们只用变分方法对卷积网络预测出的流场做可选的细化,并不需要任何手工设计的汇聚、匹配和插值方法。

Several authors have applied machine learning techniques to optical flow before. Sun et al. [32] study statistics of optical flow and learn regularizers using Gaussian scale mixtures; Rosenbaum et al. [31] model local statistics of optical flow with Gaussian mixture models. Black et al. [4] compute principal components of a training set of flow fields. To predict optical flow they then estimate coefficients of a linear combination of these ’basis flows’. Other methods train classifiers to select among different inertial estimates [21] or to obtain occlusion probabilities [27].

此前已有若干作者把机器学习技术用到光流上。Sun 等 [32] 研究光流的统计性质,并用高斯尺度混合来学习正则项;Rosenbaum 等 [31] 用高斯混合模型刻画光流的局部统计。Black 等 [4] 计算一组训练流场的主成分,再估计这些“基流”线性组合的系数,以此来预测光流。还有一些方法训练分类器,在不同的惯性估计之间做选择 [21],或得到遮挡概率 [27]。

There has been work on unsupervised learning of disparity or motion between frames of videos using neural network models. These methods typically use multiplicative interactions to model relations between a pair of images. Disparities and optical flow can then be inferred from the latent variables. Taylor et al. [33] approach the task with factored gated restricted Boltzmann machines. Konda and Memisevic [23] use a special autoencoder called ‘synchrony autoencoder’. While these approaches work well in a controlled setup and learn features useful for activity recognition in videos, they are not competitive with classical methods on realistic videos.

也有工作用神经网络模型,无监督地学习视频各帧之间的视差或运动。这类方法通常用乘法交互来建模一对图像之间的关系,再从隐变量中推断视差和光流。Taylor 等 [33] 用因子化的门控受限玻尔兹曼机来做这件事。Konda 与 Memisevic [23] 使用一种称为“同步自编码器”(synchrony autoencoder)的特殊自编码器。这些方法在受控设置下表现良好,也能学到对视频动作识别有用的特征,但在真实视频上还无法与经典方法竞争。

Convolutional Networks. Convolutional neural networks trained with backpropagation [25] have recently been shown to perform well on large-scale image classification by Krizhevsky et al. [24]. This gave the beginning to a surge of works on applying CNNs to various computer vision tasks.

卷积网络。Krizhevsky 等 [24] 近来表明,用反向传播训练的卷积神经网络 [25] 在大规模图像分类上表现很好。由此兴起了大量把 CNN 用于各类计算机视觉任务的工作。

While there has been no work on estimating optical flow with CNNs, there has been research on matching with neural networks. Fischer et al. [12] extract feature representations from CNNs trained in supervised or unsupervised manner and match these features based on Euclidean distance. Zbontar and LeCun [36] train a CNN with a Siamese architecture to predict similarity of image patches. A drastic difference of these methods to our approach is that they are patch based and leave the spatial aggregation to post-processing, whereas the networks in this paper directly predict complete flow fields.

虽然还没有用 CNN 估计光流的工作,但已有用神经网络做匹配的研究。Fischer 等 [12] 从有监督或无监督训练的 CNN 中提取特征表示,再按欧氏距离匹配这些特征。Zbontar 与 LeCun [36] 训练一种孪生结构的 CNN,来预测图像块的相似度。这些方法与我们做法的一个显著差别在于:它们是基于图块的,把空间汇聚留给后处理;而本文的网络直接预测完整的流场。

Recent applications of CNNs include semantic segmentation [11, 15, 17, 28], depth prediction [10], keypoint prediction [17] and edge detection [13]. These tasks are similar to optical flow estimation in that they involve per-pixel predictions. Since our architectures are largely inspired by the recent progress in these per-pixel prediction tasks, we briefly review different approaches.

CNN 近来的应用包括语义分割 [11, 15, 17, 28]、深度预测 [10]、关键点预测 [17] 和边缘检测 [13]。这些任务与光流估计相似,都涉及逐像素预测。我们的结构很大程度上受到这些逐像素预测任务近期进展的启发,因此在此简要回顾不同做法。

The simplest solution is to apply a conventional CNN in a ‘sliding window’ fashion, hence computing a single prediction (e.g. class label) for each input image patch [8, 11]. This works well in many situations, but has drawbacks: high computational costs (even with optimized implementations involving re-usage of intermediate feature maps) and per-patch nature, disallowing to account for global output properties, for example sharp edges. Another simple approach [17] is to upsample all feature maps to the desired full resolution and stack them together, resulting in a concatenated per-pixel feature vector that can be used to predict the value of interest.

最简单的办法是以“滑动窗口”的方式使用常规 CNN,从而对每个输入图像块计算一个预测(例如类别标签)[8, 11]。这在许多情形下效果不错,但也有缺点:计算代价高(即便采用会复用中间特征图的优化实现也是如此),以及逐块处理的本质,使得无法顾及输出的全局性质,例如尖锐边缘。另一种简单做法 [17] 是把所有特征图上采样到所需的全分辨率再堆叠起来,得到逐像素拼接的特征向量,用来预测所关心的量。

Eigen et al. [10] refine a coarse depth map by training an additional network which gets as inputs the coarse prediction and the input image. Long et al. [28] and Dosovitskiy et al. [9] iteratively refine the coarse feature maps with the use of ‘upconvolutional’ layers(^{1}). Our approach integrates ideas from both works. Unlike Long et al., we ‘upconvolve’ not just the coarse prediction, but the whole coarse feature maps, allowing to transfer more high-level information to the fine prediction. Unlike Dosovitskiy et al., we concatenate the ‘upconvolution’ results with the features from the ‘contractive’ part of the network.

Eigen 等 [10] 再训练一个网络,以粗预测和输入图像为输入,来细化粗深度图。Long 等 [28] 与 Dosovitskiy 等 [9] 则使用“上卷积”(upconvolutional)层(^{1}),迭代地细化粗特征图。我们的方法综合了这两类工作的想法。与 Long 等不同,我们不只对粗预测做“上卷积”,而是对整幅粗特征图都做,以便把更多高层信息传到精细预测中。与 Dosovitskiy 等不同,我们把“上卷积”的结果与网络“收缩”部分的特征拼接在一起。

(^{1})These layers are often named ’deconvolutional’, although the operation they perform is technically convolution, not deconvolution

(^{1})这些层常被称作“反卷积”(deconvolutional),但它们执行的运算在技术上是卷积,并不是反卷积

FlowNetSimple 与 FlowNetCorr 两种网络结构,绿色漏斗表示后续的扩展细化部分

Figure 2. The two network architectures: FlowNetSimple (top) and FlowNetCorr (bottom). The green funnel is a placeholder for the expanding refinement part shown in Fig 3. The networks including the refinement part are trained end-to-end.

图 2. 两种网络结构:FlowNetSimple(上)与 FlowNetCorr(下)。绿色漏斗是图 3 所示扩展细化部分的占位。包含细化部分的网络以端到端方式训练。

FlowNet 将粗特征图逐步细化到较高分辨率预测的扩展部分

Figure 3. Refinement of the coarse feature maps to the high resolution prediction.

图 3. 把粗特征图细化到高分辨率预测。

  1. Network Architectures
  1. 网络结构

Convolutional neural networks are known to be very good at learning input–output relations given enough labeled data. We therefore take an end-to-end learning approach to predicting optical flow: given a dataset consisting of image pairs and ground truth flows, we train a network to predict the (x)–(y) flow fields directly from the images. But what is a good architecture for this purpose?

众所周知,只要有足够的标注数据,卷积神经网络就很擅长学习输入–输出关系。因此我们采取端到端学习的方式来预测光流:给定由图像对和光流真值组成的数据集,训练网络直接从图像预测 (x)–(y) 流场。那么,怎样的结构适合这个目的?

Pooling in CNNs is necessary to make network training computationally feasible and, more fundamentally, to allow aggregation of information over large areas of the input images. But pooling results in reduced resolution, so in order to provide dense per-pixel predictions we need to refine the coarse pooled representation. To this end our networks contain an expanding part which intelligently refines the flow to high resolution. Networks consisting of contracting and expanding parts are trained as a whole using backpropagation. Architectures we use are depicted in Figures 2 and 3. We now describe the two parts of networks in more detail.

CNN 中的池化是必要的,一是为了让网络训练在计算上可行,更根本的是为了在输入图像的大范围上汇聚信息。但池化会降低分辨率,所以要给出稠密的逐像素预测,还需要细化这种经过池化的粗表示。为此,我们的网络包含一个扩展部分,有针对性地把光流细化到高分辨率。由收缩部分和扩展部分组成的网络作为整体用反向传播训练。我们使用的结构见图 2 和图 3。下面更详细地说明网络的这两个部分。

Contracting part. A simple choice is to stack both input images together and feed them through a rather generic network, allowing the network to decide itself how to process the image pair to extract the motion information. This is illustrated in Fig. 2 (top). We call this architecture consisting only of convolutional layers ‘FlowNetSimple’.

收缩部分。一种简单选择是把两幅输入图像叠在一起,送入一个相当通用的网络,让网络自己决定如何处理图像对以提取运动信息。如图 2(上)所示。我们把这种仅由卷积层组成的结构称为 FlowNetSimple。

Another approach is to create two separate, yet identical processing streams for the two images and to combine them at a later stage as shown in Fig. 2 (bottom). With this architecture the network is constrained to first produce meaningful representations of the two images separately and then combine them on a higher level. This roughly resembles the standard matching approach when one first extracts features from patches of both images and then compares those feature vectors. However, given feature representations of two images, how would the network find correspondences?

另一种做法是为两幅图像建立两条分开但结构相同的处理支路,再在较后的阶段把它们结合起来,如图 2(下)所示。这种结构迫使网络先分别为两幅图像产生有意义的表示,再在更高层把它们结合起来。这大致类似于标准的匹配做法:先从两幅图的图块中提取特征,再比较这些特征向量。不过,给定两幅图像的特征表示,网络又该如何找到对应关系?

To aid the network in this matching process, we introduce a ‘correlation layer’ that performs multiplicative patch comparisons between two feature maps. An illustration of the network architecture ‘FlowNetCorr’ containing this layer is shown in Fig. 2 (bottom). Given two multi-channel feature maps (f_1, f_2 : \mathbb{R}^2 \to \mathbb{R}^c), with (w), (h), and (c) being their width, height and number of channels, our correlation layer lets the network compare each patch from (f_1) with each path from (f_2).

为了帮助网络完成这一匹配过程,我们引入“相关层”,在两幅特征图之间做乘法式的图块比较。包含该层的网络结构 FlowNetCorr 如图 2(下)所示。给定两幅多通道特征图 (f_1, f_2 : \mathbb{R}^2 \to \mathbb{R}^c),其中 (w)、(h) 和 (c) 分别是它们的宽度、高度和通道数,相关层让网络把 (f_1) 中的每个图块与 (f_2) 中的每个 path 进行比较。

For now we consider only a single comparison of two patches. The ’correlation’ of two patches centered at (x_1) in the first map and (x_2) in the second map is then defined as

我们先只考虑两个图块的单次比较。以第一幅特征图中 (x_1) 为中心、第二幅特征图中 (x_2) 为中心的两个图块,其“相关”定义为

c(x1,x2)=∑o∈[−k,k]×[−k,k]⟨f1(x1+o),f2(x2+o)⟩(1)c(x_1, x_2) = \sum_{o \in [-k,k]\times[-k,k]} \langle f_1(x_1 + o), f_2(x_2 + o)\rangle \qquad (1)c(x1​,x2​)=o∈[−k,k]×[−k,k]∑​⟨f1​(x1​+o),f2​(x2​+o)⟩(1)

for a square patch of size (K := 2k + 1). Note that Eq. 1 is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other data. For this reason, it has no trainable weights.

其中方形图块的边长为 (K := 2k + 1)。需要说明,式 (1) 与神经网络中卷积的一步完全相同,只不过它不是用滤波器去卷积数据,而是用另一份数据去卷积数据。因此,它没有可训练的权重。

Computing (c(x_1, x_2)) involves (c \cdot K^2) multiplications. Comparing all patch combinations involves (w^2 \cdot h^2) such computations, yields a large result and makes efficient forward and backward passes intractable. Thus, for computational reasons we limit the maximum displacement for comparisons and also introduce striding in both feature maps.

计算 (c(x_1, x_2)) 需要 (c \cdot K^2) 次乘法。若比较所有图块组合,则需要进行 (w^2 \cdot h^2) 次这样的计算,结果会非常大,高效的前向和反向传播也变得不可行。因此,出于计算上的考虑,我们限制比较时的最大位移,并在两幅特征图上都引入步幅。

Given a maximum displacement (d), for each location (x_1) we compute correlations (c(x_1, x_2)) only in a neighborhood of size (D := 2d + 1), by limiting the range of (x_2). We use strides (s_1) and (s_2), to quantize (x_1) globally and to quantize (x_2) within the neighborhood centered around (x_1).

给定最大位移 (d),对每个位置 (x_1),我们通过限制 (x_2) 的范围,只在大小为 (D := 2d + 1) 的邻域内计算相关 (c(x_1, x_2))。我们使用步幅 (s_1) 和 (s_2),在全局对 (x_1) 量化,并在以 (x_1) 为中心的邻域内对 (x_2) 量化。

In theory, the result produced by the correlation is four-dimensional: for every combination of two 2D positions we obtain a correlation value, i.e. the scalar product of the two vectors which contain the values of the cropped patches respectively. In practice we organize the relative displacements in channels. This means we obtain an output of size ((w \times h \times D^2)). For the backward pass we implemented the derivatives with respect to each bottom blob accordingly.

理论上,相关运算的结果是四维的:对每一对二维位置的组合,我们得到一个相关值,也就是分别容纳两个裁剪图块取值的两个向量的标量积。实践中,我们把相对位移组织到通道里,从而得到大小为 ((w \times h \times D^2)) 的输出。在反向传播中,我们相应地实现了对每个底层 blob 的导数。

Expanding part. The main ingredient of the expanding part are ‘upconvolutional’ layers, consisting of unpooling (extending the feature maps, as opposed to pooling) and a convolution. Such layers have been used previously [38, 37, 16, 28, 9]. To perform the refinement, we apply the ‘upconvolution’ to feature maps, and concatenate it with corresponding feature maps from the ’contractive’ part of the network and an upsampled coarser flow prediction (if available). This way we preserve both the high-level information passed from coarser feature maps and fine local information provided in lower layer feature maps. Each step increases the resolution twice. We repeat this 4 times, resulting in a predicted flow for which the resolution is still 4 times smaller than the input. Overall architecture is shown in Figure 3. We found that further refinement from this resolution does not significantly improve the results, compared to a computationally less expensive bilinear upsampling to full image resolution.

扩展部分。扩展部分的主要组成是“上卷积”层,由反池化(扩展特征图,与池化相反)和一次卷积构成。这类层此前已被使用 [38, 37, 16, 28, 9]。做细化时,我们对特征图施加“上卷积”,再把它与网络“收缩”部分中对应的特征图,以及上采样后的更粗光流预测(若已有)拼接起来。这样既能保留从更粗特征图传来的高层信息,也能保留较低层特征图提供的精细局部信息。每一步把分辨率提高一倍。我们重复 4 次,得到的预测光流分辨率仍比输入小 4 倍。整体结构如图 3 所示。我们发现,从这个分辨率再继续细化,相比计算量更小的双线性上采样到全图分辨率,并不能显著改进结果。

变分细化的效果:小位移时预测被明显改正,大位移时流场变平滑、终点误差下降

Figure 4. The effect of variational refinement. In case of small motions (first row) the predicted flow is changed dramatically. For larger motions (second row), big errors are not corrected, but the flow field is smoothed, resulting in lower EPE.

图 4. 变分细化的效果。小运动时(第一行),预测出的光流会被大幅度改正。较大运动时(第二行),大的误差不会被纠正,但流场会被平滑,从而得到更低的 EPE。

Variational refinement. In an alternative scheme, at this very last stage instead of bilinear upsampling we use the variational approach from [6] without the matching term: we start at the 4 times downsampled resolution and then use the coarse to fine scheme with 20 iterations to bring the flow field to the full resolution. Finally, we run 5 more iterations at the full image resolution. We additionally compute image boundaries with the approach from [26] and respect the detected boundaries by replacing the smoothness coefficient by (\alpha = \exp(-\lambda b(x, y)^{\kappa})), where (b(x, y)) denotes the thin boundary strength resampled at the respective scale and between pixels. This upscaling method is more computationally expensive than simple bilinear upsampling, but adds the benefits of variational methods to obtain smooth and subpixel-accurate flow fields. In the following, we denote the results obtained by this variational refinement with a ‘+v’ suffix. An example of variational refinement can be seen in Fig. 4.

变分细化。另一种做法是,在这最后一步不用双线性上采样,而使用 [6] 中的变分方法,并去掉匹配项:从下采样 4 倍的分辨率开始,再用由粗到精的格式做 20 次迭代,把流场带到全分辨率。最后再在全图分辨率上多跑 5 次迭代。我们另外用 [26] 的方法计算图像边界,并用 (\alpha = \exp(-\lambda b(x, y)^{\kappa})) 替换平滑系数,以尊重检测出的边界,其中 (b(x, y)) 表示在相应尺度上、在像素之间重采样得到的细边界强度。这种放大方法比简单的双线性上采样计算代价更高,但能吸收变分方法的优点,得到平滑且具有亚像素精度的流场。下文中,我们把经过这种变分细化得到的结果用后缀 “+v” 表示。变分细化的例子可见图 4。

  1. Training Data
  1. 训练数据

Unlike traditional approaches, neural networks require data with ground truth not only for optimizing several parameters, but to learn to perform the task from scratch. In general, obtaining such ground truth is hard, because true pixel correspondences for real world scenes cannot easily be determined. An overview of the available datasets is given in Table 1.

与传统方法不同,神经网络不但要用带真值的数据去优化若干参数,还要用它们从头学习完成这项任务。总的来说,获取这样的真值很难,因为真实场景中真正的像素对应关系不易确定。已有数据集的概况见表 1。

4.1. Existing Datasets

4.1. 已有数据集

The Middlebury dataset [2] contains only 8 image pairs for training, with ground truth flows generated using four different techniques. Displacements are very small, typically below 10 pixels.

Middlebury 数据集 [2] 的训练集只有 8 对图像,光流真值由四种不同技术生成。位移非常小,通常在 10 像素以下。

Frame pairs Frames with ground truth Ground truth density per frame
Middlebury 72 8 100%
KITTI 194 194 ∽50%
Sintel 1,041 1,041 100%
Flying Chairs 22,872 22,872 100%

Table 1. Size of already available datasets and the proposed Flying Chair dataset.

图像对数量 带真值的帧数 每帧真值密度
Middlebury 72 8 100%
KITTI 194 194 ∽50%
Sintel 1,041 1,041 100%
Flying Chairs 22,872 22,872 100%

表 1. 已有数据集与本文提出的 Flying Chair 数据集的规模。

The KITTI dataset [14] is larger (194 training image pairs) and includes large displacements, but contains only a very special motion type. The ground truth is obtained from real world scenes by simultaneously recording the scenes with a camera and a 3D laser scanner. This assumes that the scene is rigid and that the motion stems from a moving observer. Moreover, motion of distant objects, such as the sky, cannot be captured, resulting in sparse optical flow ground truth.

KITTI 数据集 [14] 更大(194 对训练图像),也包含大位移,但只涵盖一种非常特殊的运动类型。真值来自真实场景:用相机和三维激光扫描仪同时记录场景。这假定场景是刚性的,运动来自移动的观察者。此外,天空等远处物体的运动无法被捕捉,因此光流真值是稀疏的。

The MPI Sintel [7] dataset obtains ground truth from rendered artificial scenes with special attention to realistic image properties. Two versions are provided: the Final version contains motion blur and atmospheric effects, such as fog, while the Clean version does not include these effects. Sintel is the largest dataset available (1,041 training image pairs for each version) and provides dense ground truth for small and large displacement magnitudes.

MPI Sintel [7] 数据集的真值来自渲染出的人工场景,并特别注意图像性质的真实感。数据提供两个版本:Final 版包含运动模糊和雾一类的大气效果,Clean 版则不含这些效果。Sintel 是当时可用的最大数据集(每个版本有 1,041 对训练图像),并为小位移和大位移都提供稠密真值。

4.2. Flying Chairs

The Sintel dataset is still too small to train large CNNs. To provide enough training data, we create a simple synthetic dataset, which we name Flying Chairs, by applying affine transformations to images collected from Flickr and a publicly available set of renderings of 3D chair models [1]. We retrieve 964 images from Flickr(^{2}) with a resolution of 1,024 (\times) 768 from the categories ‘city’ (321), ‘landscape’ (129) and ‘mountain’ (514). We cut the images into 4 quadrants and use the resulting 512 (\times) 384 image crops as background. As foreground objects we add images of multiple chairs from [1] to the background. From the original dataset we remove very similar chairs, resulting in 809 chair types and 62 views per chair available. Examples are shown in Figure 5.

Sintel 数据集仍然太小,不足以训练大型 CNN。为了提供足够的训练数据,我们对从 Flickr 收集的图像以及一套公开的三维椅子模型渲染图 [1] 施加仿射变换,构造了一个简单的合成数据集,命名为 Flying Chairs。我们从 Flickr(^{2}) 检索了 964 张分辨率为 1,024 (\times) 768 的图像,类别为 “city”(321 张)、“landscape”(129 张)和 “mountain”(514 张)。把图像切成 4 个象限,得到 512 (\times) 384 的裁剪图作为背景。前景物体则是把 [1] 中多把椅子的图像加到背景上。我们从原始数据集中去掉非常相似的椅子,最终可用的是 809 种椅子类型、每种 62 个视角。示例见图 5。

To generate motion, we randomly sample 2D affine transformation parameters for the background and the chairs. The chairs’ transformations are relative to the background transformation, which can be interpreted as both the camera and the objects moving. Using the transformation parameters we generate the second image, the ground truth optical flow and occlusion regions.

为了生成运动,我们为背景和椅子随机采样二维仿射变换参数。椅子的变换是相对于背景变换的,可以理解为相机和物体都在运动。利用这些变换参数,我们生成第二幅图像、光流真值以及遮挡区域。

All parameters for each image pair (number, types, sizes and initial positions of the chairs; transformation parameters) are randomly sampled. We adjust the random distributions of these parameters in such a way that the resulting displacement histogram is similar to the one from Sintel (details can be found in the supplementary material). Using this procedure, we generate a dataset with 22,872 image pairs and flow fields (we re-use each background image multiple times). Note that this size is chosen arbitrarily and could be larger in principle.

每对图像的全部参数(椅子的数量、类型、尺寸和初始位置,以及变换参数)都是随机采样的。我们调整这些参数的随机分布,使得到的位移直方图与 Sintel 的相近(细节见补充材料)。用这一流程,我们生成了包含 22,872 对图像和流场的数据集(每张背景图像会被多次使用)。需要说明,这一规模是任意选定的,原则上还可以更大。

(^{2})Non-commercial public license. We use the code framework by Hays and Efros [18]

(^{2})非商业公共许可。我们使用 Hays 与 Efros [18] 的代码框架。

4.3. Data Augmentation

4.3. 数据增广

A widely used strategy to improve generalization of neural networks is data augmentation [24, 10]. Even though the Flying Chairs dataset is fairly large, we find that using augmentations is crucial to avoid overfitting. We perform augmentation online during network training. The augmentations we use include geometric transformations: translation, rotation and scaling, as well as additive Gaussian noise and changes in brightness, contrast, gamma, and color. To be reasonably quick, all these operations are processed on the GPU. Some examples of augmentation are given in Fig. 5.

数据增广是提高神经网络泛化能力的常用策略 [24, 10]。尽管 Flying Chairs 数据集已经相当大,我们仍发现使用增广对避免过拟合至关重要。增广在网络训练过程中在线进行。我们使用的增广包括几何变换:平移、旋转和缩放,以及加性高斯噪声,还有亮度、对比度、伽马和颜色的变化。为了足够快,这些操作全部在 GPU 上处理。若干增广示例如图 5 所示。

As we want to increase not only the variety of images but also the variety of flow fields, we apply the same strong geometric transformation to both images of a pair, but additionally a smaller relative transformation between the two images.

我们不但要增加图像的多样性,也要增加流场的多样性,因此对一对图像中的两幅图施加相同的强几何变换,另外再在两幅图之间施加一个较小的相对变换。

Specifically we sample translation from a the range ([-20%, 20%]) of the image width for (x) and (y); rotation from ([-17^{\circ}, 17^{\circ}]); scaling from ([0.9, 2.0]). The Gaussian noise has a sigma uniformly sampled from ([0, 0.04]); contrast is sampled within ([-0.8, 0.4]); multiplicative color changes to the RGB channels per image from ([0.5, 2]); gamma values from ([0.7, 1.5]) and additive brightness changes using Gaussian with a sigma of 0.2.

具体来说,平移从图像宽度的区间 ([-20%, 20%]) 中为 (x) 和 (y) 采样;旋转从 ([-17^{\circ}, 17^{\circ}]) 采样;缩放从 ([0.9, 2.0]) 采样。高斯噪声的标准差在 ([0, 0.04]) 上均匀采样;对比度在 ([-0.8, 0.4]) 内采样;每幅图像 RGB 通道的乘性颜色变化取自 ([0.5, 2]);伽马值取自 ([0.7, 1.5]);加性亮度变化则使用标准差为 0.2 的高斯分布。

  1. Experiments
  1. 实验

We report the results of our networks on the Sintel, KITTI and Middlebury datasets, as well as on our synthetic Flying Chairs dataset. We also experiment with fine-tuning of the networks on Sintel data and variational refinement of the predicted flow fields. Additionally, we report runtimes of our networks, in comparison to other methods.

我们报告网络在 Sintel、KITTI 和 Middlebury 数据集以及合成数据集 Flying Chairs 上的结果。我们也实验了在 Sintel 数据上对网络做微调,以及对预测流场做变分细化。此外,我们报告网络的运行时间,并与其他方法比较。

5.1. Network and Training Details

5.1. 网络与训练细节

The exact architectures of the networks we train are shown in Fig. 2. Overall, we try to keep the architectures of different networks consistent: they have nine convolutional layers with stride of 2 (the simplest form of pooling) in six of them and a ReLU nonlinearity after each layer. We do not have any fully connected layers, which allows the networks to take images of arbitrary size as input. Convolutional filter sizes decrease towards deeper layers of networks: (7 \times 7) for the first layer, (5 \times 5) for the following two layers and (3 \times 3) starting from the fourth layer. The number of feature maps increases in the deeper layers, roughly doubling after each layer with a stride of 2. For the correlation layer in FlowNetC we chose the parameters (k = 0), (d = 20), (s_1 = 1), (s_2 = 2). As training loss we use the endpoint error (EPE), which is the standard error measure for optical flow estimation. It is the Euclidean distance between the predicted flow vector and the ground truth, averaged over all pixels.

我们所训练网络的具体结构如图 2 所示。总体来说,我们尽量保持不同网络的结构一致:它们都有九个卷积层,其中六层的步幅为 2(最简单的池化形式),每层之后都有 ReLU 非线性。我们不使用全连接层,因此网络可以接受任意尺寸的图像作为输入。卷积滤波器的尺寸随网络加深而减小:第一层为 (7 \times 7),随后两层为 (5 \times 5),从第四层起为 (3 \times 3)。特征图数量在更深的层中增加,大致在每个步幅为 2 的层之后加倍。对于 FlowNetC 中的相关层,我们选择参数 (k = 0)、(d = 20)、(s_1 = 1)、(s_2 = 2)。训练损失采用终点误差(EPE),这是光流估计的标准误差度量,即预测流向量与真值之间的欧氏距离在全部像素上的平均。

Flying Chairs 生成的图像对与彩色编码光流,以及数据增广后的对应结果

Figure 5. Flying Chairs. Generated image pair and color coded flow field (first three columns), augmented image pair and corresponding color coded flow field respectively (last three columns).

图 5. Flying Chairs。生成的图像对与彩色编码流场(前三列),以及增广后的图像对与对应的彩色编码流场(后三列)。

For training CNNs we use a modified version of the caffe [20] framework. We choose Adam [22] as optimization method because for our task it shows faster convergence than standard stochastic gradient descent with momentum. We fix the parameters of Adam as recommended in [22]: (\beta_1 = 0.9) and (\beta_2 = 0.999). Since, in a sense, every pixel is a training sample, we use fairly small mini-batches of 8 image pairs. We start with learning rate (\lambda = 1e-4) and then divide it by 2 every 100k iterations after the first 300k. With FlowNetCorr we observe exploding gradients with (\lambda = 1e-4). To tackle this problem, we start by training with a very low learning rate (\lambda = 1e-6), slowly increase it to reach (\lambda = 1e-4) after 10k iterations and then follow the schedule just described.

训练 CNN 时,我们使用经过修改的 caffe [20] 框架。优化方法选用 Adam [22],因为在我们的任务上,它比带动量的标准随机梯度下降收敛更快。Adam 的参数按 [22] 的建议固定为 (\beta_1 = 0.9) 和 (\beta_2 = 0.999)。在某种意义上,每个像素都是一个训练样本,因此我们使用相当小的小批量,每批 8 对图像。学习率从 (\lambda = 1e-4) 开始,在前 300k 次迭代之后每隔 100k 次迭代除以 2。对 FlowNetCorr,我们在 (\lambda = 1e-4) 时观察到梯度爆炸。为解决这一问题,我们先用非常低的学习率 (\lambda = 1e-6) 开始训练,再缓慢提高,在 10k 次迭代后达到 (\lambda = 1e-4),随后按刚才所述的日程继续。

To monitor overfitting during training and fine-tuning, we split the Flying Chairs dataset into 22,232 training and 640 test samples and split the Sintel training set into 908 training and 133 validation pairs.

为了在训练和微调过程中监视过拟合,我们把 Flying Chairs 数据集分成 22,232 个训练样本和 640 个测试样本,并把 Sintel 训练集分成 908 对训练和 133 对验证。

We found that upscaling the input images during testing may improve the performance. Although the optimal scale depends on the specific dataset, we fixed the scale once for each network for all tasks. For FlowNetS we do not upscale, for FlowNetC we chose a factor of 1.25.

我们发现,测试时放大输入图像可能会提高性能。尽管最优尺度取决于具体数据集,我们对每个网络只固定一次尺度,并用于全部任务。FlowNetS 不做放大,FlowNetC 选用的因子为 1.25。

Fine-tuning. The used datasets are very different in terms of object types and motions they include. A standard solution is to fine-tune the networks on the target datasets. The KITTI dataset is small and only has sparse flow ground truth. Therefore, we choose to fine-tune on the Sintel training set. We use images from the Clean and Final versions of Sintel together and fine-tune using a low learning rate (\lambda = 1e-6) for several thousand iterations. For best performance, after defining the optimal number of iterations using a validation set, we then fine-tune on the whole training set for the same number of iterations. In tables we denote finetuned networks with a ‘+ft’ suffix.

微调。所用数据集在物体类型和所含运动上差别很大。标准做法是在目标数据集上微调网络。KITTI 数据集很小,而且只有稀疏的光流真值,因此我们选择在 Sintel 训练集上微调。我们把 Sintel 的 Clean 与 Final 两个版本的图像合在一起使用,并用较低的学习率 (\lambda = 1e-6) 微调数千次迭代。为取得最好性能,先用验证集确定最优迭代次数,再在整个训练集上以同样的迭代次数微调。表格中,经过微调的网络用后缀 “+ft” 表示。

5.2. Results

5.2. 结果

Table 2 shows the endpoint error (EPE) of our networks and several well-performing methods on public datasets (Sintel, KITTI, Middlebury), as well as on our Flying Chairs dataset. Additionally we show runtimes of different methods on Sintel.

表 2 给出了我们的网络以及若干表现良好的方法,在公开数据集(Sintel、KITTI、Middlebury)以及我们的 Flying Chairs 数据集上的终点误差(EPE)。我们另外给出不同方法在 Sintel 上的运行时间。

Method Sintel Clean Sintel Final KITTI Middlebury train Middlebury test Chairs Time (sec)
train test train test train test AEE AAE AEE AAE test CPU GPU
EpicFlow [30] 2.27 4.12 3.57 6.29 3.47 3.8 0.31 3.24 0.39 3.55 2.94 16 -
DeepFlow [35] 3.19 5.38 4.40 7.21 4.58 5.8 0.21 3.04 0.42 4.22 3.53 17 -
EPPM [3] - 6.49 - 8.38 - 9.2 - - 0.33 3.36 - - 0.2
LDOF [6] 4.19 7.56 6.28 9.12 13.73 12.4 0.45 4.97 0.56 4.55 3.47 65 2.5
FlowNetS 4.50 7.42 5.45 8.43 8.26 - 1.09 13.28 - - 2.71 - 0.08
FlowNetS+v 3.66 6.45 4.76 7.67 6.50 - 0.33 3.87 - - 2.86 - 1.05
FlowNetS+ft (3.66) 6.96 (4.44) 7.76 7.52 9.1 0.98 15.20 - - 3.04 - 0.08
FlowNetS+ft+v (2.97) 6.16 (4.07) 7.22 6.07 7.6 0.32 3.84 0.47 4.58 3.03 - 1.05
FlowNetC 4.31 7.28 5.87 8.81 9.35 - 1.15 15.64 - - 2.19 - 0.15
FlowNetC+v 3.57 6.27 5.25 8.01 7.45 - 0.34 3.92 - - 2.61 - 1.12
FlowNetC+ft (3.78) 6.85 (5.28) 8.51 8.79 - 0.93 12.33 - - 2.27 - 0.15
FlowNetC+ft+v (3.20) 6.08 (4.83) 7.88 7.31 - 0.33 3.81 0.50 4.52 2.67 - 1.12

Table 2. Average endpoint errors (in pixels) of our networks compared to several well-performing methods on different datasets. The numbers in parentheses are the results of the networks on data they were trained on, and hence are not directly comparable to other results.

方法 Sintel Clean 训练 Sintel Clean 测试 Sintel Final 训练 Sintel Final 测试 KITTI 训练 KITTI 测试 Middlebury 训练 AEE Middlebury 训练 AAE Middlebury 测试 AEE Middlebury 测试 AAE Chairs 测试 时间 CPU(秒) 时间 GPU(秒)
EpicFlow [30] 2.27 4.12 3.57 6.29 3.47 3.8 0.31 3.24 0.39 3.55 2.94 16 -
DeepFlow [35] 3.19 5.38 4.40 7.21 4.58 5.8 0.21 3.04 0.42 4.22 3.53 17 -
EPPM [3] - 6.49 - 8.38 - 9.2 - - 0.33 3.36 - - 0.2
LDOF [6] 4.19 7.56 6.28 9.12 13.73 12.4 0.45 4.97 0.56 4.55 3.47 65 2.5
FlowNetS 4.50 7.42 5.45 8.43 8.26 - 1.09 13.28 - - 2.71 - 0.08
FlowNetS+v 3.66 6.45 4.76 7.67 6.50 - 0.33 3.87 - - 2.86 - 1.05
FlowNetS+ft (3.66) 6.96 (4.44) 7.76 7.52 9.1 0.98 15.20 - - 3.04 - 0.08
FlowNetS+ft+v (2.97) 6.16 (4.07) 7.22 6.07 7.6 0.32 3.84 0.47 4.58 3.03 - 1.05
FlowNetC 4.31 7.28 5.87 8.81 9.35 - 1.15 15.64 - - 2.19 - 0.15
FlowNetC+v 3.57 6.27 5.25 8.01 7.45 - 0.34 3.92 - - 2.61 - 1.12
FlowNetC+ft (3.78) 6.85 (5.28) 8.51 8.79 - 0.93 12.33 - - 2.27 - 0.15
FlowNetC+ft+v (3.20) 6.08 (4.83) 7.88 7.31 - 0.33 3.81 0.50 4.52 2.67 - 1.12

表 2. 我们的网络与若干表现良好的方法在不同数据集上的平均终点误差(单位:像素)。括号中的数字是网络在它们所训练的数据上的结果,因此不能直接与其他结果比较。

The networks trained just on the non-realistic Flying Chairs perform very well on real optical flow datasets, beating for example the well-known LDOF [6] method. After fine-tuning on Sintel our networks can outperform the competing real-time method EPPM [3] on Sintel Final and KITTI while being twice as fast.

仅在并不真实的 Flying Chairs 上训练的网络,在真实光流数据集上已经表现很好,例如超过了著名的 LDOF [6] 方法。在 Sintel 上微调之后,我们的网络在 Sintel Final 和 KITTI 上可以超过与之竞争的实时方法 EPPM [3],速度还要快一倍。

Sintel. From Table 2 one can see that FlowNetC is better than FlowNetS on Sintel Clean, while on Sintel Final the situation changes. On this difficult dataset, FlowNetS+ft+v is even on par with DeepFlow. Since the average endpoint error often favors over-smoothed solutions, it is interesting to see qualitative results of our method. Figure 6 shows examples of the raw optical flow predicted by the two FlowNets (without fine-tuning), compared to ground truth and EpicFlow. The figure shows how the nets often produce visually appealing results, but are still worse in terms of endpoint error. Taking a closer look reveals that one reason for this may be the noisy non-smooth output of the nets especially in large smooth background regions. This we can partially compensate with variational refinement.

Sintel。由表 2 可见,FlowNetC 在 Sintel Clean 上优于 FlowNetS,而在 Sintel Final 上情况则相反。在这个困难的数据集上,FlowNetS+ft+v 甚至与 DeepFlow 相当。由于平均终点误差往往更偏爱过度平滑的解,看一看我们方法的定性结果会很有意思。图 6 给出了两个 FlowNet(未经微调)预测的原始光流示例,并与真值和 EpicFlow 对照。从图中可以看到,网络常常能给出视觉上好看的结果,但在终点误差上仍然较差。仔细观察会发现,一个原因可能是网络的输出带有噪声、不够平滑,在大面积平滑的背景区域尤其如此。这一点我们可以用变分细化来部分弥补。

KITTI. The KITTI dataset contains strong projective transformations which are very different from what the networks encountered during training on Flying Chairs. Still, the raw network output is already fairly good, and additional fine-tuning and variational refinement give a further boost. Interestingly, fine-tuning on Sintel improves the results on KITTI, probably because the images and motions in Sintel are more natural than in Flying Chairs. The FlowNetS outperforms FlowNetC on this dataset.

KITTI。KITTI 数据集包含很强的射影变换,与网络在 Flying Chairs 上训练时见到的情形差别很大。尽管如此,网络的原始输出已经相当不错,再做微调和变分细化还能进一步提高。有意思的是,在 Sintel 上微调也会改进 KITTI 上的结果,这大概是因为 Sintel 中的图像和运动比 Flying Chairs 更自然。在这个数据集上,FlowNetS 优于 FlowNetC。

Flying Chairs 数据集上的光流预测示例,对比 EpicFlow、FlowNetS 与 FlowNetC

Figure 7. Examples of optical flow prediction on the Flying Chairs dataset. The images include fine details and small objects with large displacements which EpicFlow often fails to find. The networks are much more successful.

图 7. Flying Chairs 数据集上的光流预测示例。这些图像包含细节丰富、位移又大的小物体,EpicFlow 常常找不到它们。网络要成功得多。

Flying Chairs. Our networks are trained on the Flying Chairs, and hence are expected to perform best on those. When training, we leave aside a test set consisting of 640 images. Table 2 shows the results of various methods on this test set, some example predictions are shown in Fig. 7. One can see that FlowNetC outperforms FlowNetS and that the nets outperform all state-of-the-art methods. Another interesting finding is that this is the only dataset where the variational refinement does not improve performance but makes things worse. Apparently the networks can do better than variational refinement already. This indicates that with a more realistic training set, the networks might also perform even better on other data.

Flying Chairs。我们的网络是在 Flying Chairs 上训练的,因此理应在其上表现最好。训练时,我们留出由 640 张图像组成的测试集。表 2 给出了各种方法在这个测试集上的结果,若干预测示例见图 7。可以看到 FlowNetC 优于 FlowNetS,而且这些网络超过了所有当时的最优方法。另一个有意思的发现是:这是唯一一个变分细化不但没有提高性能、反而使之变差的数据集。显然,网络在这里已经能做得比变分细化更好。这说明,如果有更真实的训练集,网络在其他数据上或许也能表现得更好。

Timings. In Table 2 we show the per-frame runtimes of different methods in seconds. Unfortunately, many methods only provide the runtime on a single CPU, whereas our FlowNet uses layers only implemented on GPU. While the error rates of the networks are below the state of the art, they are the best among real-time methods. For both training and testing of the networks we use an NVIDIA GTX Titan GPU. The CPU timings of DeepFlow and EpicFlow are taken from [30], while the timing of LDOF was computed on a single 2.66GHz core.

运行时间。表 2 给出了不同方法的每帧运行时间,单位为秒。遗憾的是,许多方法只提供单核 CPU 上的运行时间,而我们的 FlowNet 使用的层只在 GPU 上实现。虽然这些网络的误差还没有达到当时的最优水平,但它们是实时方法中最好的。网络的训练和测试都使用一块 NVIDIA GTX Titan GPU。DeepFlow 和 EpicFlow 的 CPU 时间取自 [30],LDOF 的时间则是在单个 2.66GHz 核心上测得的。

5.3. Analysis

5.3. 分析

Training data. To check if we benefit from using the Flying Chairs dataset instead of Sintel, we trained a network just on Sintel, leaving aside a validation set to control the performance. Thanks to aggressive data augmentation, even Sintel alone is enough to learn optical flow fairly well. When testing on Sintel, the network trained exclusively on Sintel has EPE roughly 1 pixel higher than the net trained on Flying Chairs and fine-tuned on Sintel.

训练数据。为了检查使用 Flying Chairs 数据集而不是 Sintel 是否带来好处,我们只在 Sintel 上训练了一个网络,并留出验证集来控制性能。由于采用了较强的数据增广,即便只用 Sintel,也足以相当好地学习光流。在 Sintel 上测试时,仅在 Sintel 上训练的网络,其 EPE 大致比在 Flying Chairs 上训练再在 Sintel 上微调的网络高 1 个像素。

The Flying Chairs dataset is fairly large, so is data augmentation still necessary? The answer is positive: training a network without data augmentation on the Flying Chairs results in an EPE increase of roughly 2 pixels when testing on Sintel.

Flying Chairs 数据集已经相当大,那么数据增广是否仍然必要?答案是肯定的:在 Flying Chairs 上不使用数据增广来训练网络,在 Sintel 上测试时 EPE 大约会增加 2 个像素。

Comparing the architectures. The results in Table 2 allow to draw conclusions about strengths and weaknesses of the two architectures we tested.

比较两种结构。由表 2 中的结果,可以对我们测试的两种结构的长处和短处作出判断。

First, FlowNetS generalizes to Sintel Final better than FlowNetC. On the other hand, FlowNetC outperforms FlowNetS on Flying chairs and Sintel Clean. Note that Flying Chairs do not include motion blur or fog, as in Sintel Final. These results together suggest that even though the number of parameters of the two networks is virtually the same, the FlowNetC slightly more overfits to the training data. This does not mean the network remembers the training samples by heart, but it adapts to the kind of data it is presented during training. Though in our current setup this can be seen as a weakness, if better training data were available it could become an advantage.

首先,FlowNetS 向 Sintel Final 的泛化好于 FlowNetC。另一方面,FlowNetC 在 Flying chairs 和 Sintel Clean 上优于 FlowNetS。需要说明,Flying Chairs 并不包含 Sintel Final 中那样的运动模糊或雾。这些结果合在一起表明:尽管两个网络的参数量几乎相同,FlowNetC 对训练数据的过拟合略多一些。这并不是说网络把训练样本都记住了,而是它适应了训练时所见到的那类数据。在我们当前的设置里,这可以被看成一个弱点;如果有更好的训练数据,它也可能变成优点。

Second, FlowNetC seems to have more problems with large displacements. This can be seen from the results on KITTI discussed above, and also from detailed performance analysis on Sintel Final (not shown in the tables). FlowNetS+ft achieves s40+ error (EPE on pixels with displacements of at least 40 pixels) of 43.3px, and for FlowNetC+ft this value is 48px. One explanation is that the maximum displacement of the correlation does not allow to predict very large motions. This range can be increased at the cost of computational efficiency.

其次,FlowNetC 在大位移上似乎问题更多。这一点可以从上文讨论的 KITTI 结果看出,也可以从 Sintel Final 上的详细性能分析看出(未在表中列出)。FlowNetS+ft 的 s40+ 误差(位移至少为 40 像素的那些像素上的 EPE)为 43.3 像素,FlowNetC+ft 的这一数值为 48 像素。一种解释是,相关运算的最大位移不允许预测非常大的运动。这一范围可以扩大,但要以计算效率为代价。

Sintel 数据集上的光流预测示例:叠加图像对、真值,以及 EpicFlow、FlowNetS、FlowNetC 的结果

Figure 6. Examples of optical flow prediction on the Sintel dataset. In each row left to right: overlaid image pair, ground truth flow and 3 predictions: EpicFlow, FlowNetS and FlowNetC. Endpoint error is shown for every frame. Note that even though the EPE of FlowNets is usually worse than that of EpicFlow, the networks often better preserve fine details.

图 6. Sintel 数据集上的光流预测示例。每一行从左到右依次是:叠加后的图像对、光流真值,以及三种预测:EpicFlow、FlowNetS 与 FlowNetC。每帧都标出了终点误差。尽管 FlowNet 的 EPE 通常比 EpicFlow 差,网络却常常能更好地保留细节。

  1. Conclusion
  1. 结论

Building on recent progress in design of convolutional network architectures, we have shown that it is possible to train a network to directly predict optical flow from two input images. Intriguingly, the training data need not be realistic. The artificial Flying Chairs dataset including just affine motions of synthetic rigid objects is sufficient to predict optical flow in natural scenes with competitive accuracy. This proves the generalization capabilities of the presented networks. On the test set of the Flying Chairs the CNNs even outperform state-of-the-art methods like DeepFlow and EpicFlow. It will be interesting to see how future networks perform as more realistic training data becomes available.

在卷积网络结构设计的近期进展之上,我们表明,可以训练一个网络,直接由两幅输入图像预测光流。有意思的是,训练数据不必真实。只包含合成刚体仿射运动的人工数据集 Flying Chairs,就足以在自然场景中以可竞争的精度预测光流。这证明了本文网络的泛化能力。在 Flying Chairs 的测试集上,这些 CNN 甚至超过了 DeepFlow 和 EpicFlow 等当时的最优方法。随着更真实的训练数据出现,未来的网络会有怎样的表现,将是一件有意思的事。

Acknowledgments

致谢

The work was partially funded by the ERC Starting Grants VideoLearn and ConvexVision, by the DFG Grants BR-3815/7-1 and CR 250/13-1, and by the EC FP7 project 610967 (TACMAN).

本工作部分得到 ERC Starting Grants VideoLearn 与 ConvexVision、DFG Grants BR-3815/7-1 与 CR 250/13-1,以及 EC FP7 项目 610967(TACMAN)的资助。

References

参考文献

[1] M. Aubry, D. Maturana, A. Efros, B. Russell, and J. Sivic. Seeing 3d chairs: exemplar part-based 2d-3d alignment using a large dataset of cad models. In CVPR, 2014. 2, 5

[2] S. Baker, D. Scharstein, J. Lewis, S. Roth, M. J. Black, and R. Szeliski. A database and evaluation methodology for optical flow. Technical Report MSR-TR-2009-179, December 2009. 4

[3] L. Bao, Q. Yang, and H. Jin. Fast edge-preserving patchmatch for large displacement optical flow. In CVPR, 2014. 6, 7

[4] M. J. Black, Y. Yacoob, A. D. Jepson, and D. J. Fleet. Learning parameterized models of image motion. In CVPR, 1997. 2

[5] T. Brox, A. Bruhn, N. Papenberg, and J. Weickert. High accuracy optical flow estimation based on a theory for warping. In ECCV, volume 3024, pages 25–36. Springer, 2004. 2

[6] T. Brox and J. Malik. Large displacement optical flow: descriptor matching in variational motion estimation. PAMI, 33(3):500–513, 2011. 2, 4, 6, 7

[7] D. J. Butler, J. Wulff, G. B. Stanley, and M. J. Black. A naturalistic open source movie for optical flow evaluation. In A. Fitzgibbon et al. (Eds.), editor, ECCV, Part IV, LNCS 7577, pages 611–625. Springer-Verlag, Oct. 2012. 1, 5

[8] D. C. Ciresan, L. M. Gambardella, A. Giusti, and J. Schmidhuber. Deep neural networks segment neuronal membranes in electron microscopy images. In NIPS, pages 2852–2860, 2012. 2

[9] A. Dosovitskiy, J. T. Springenberg, and T. Brox. Learning to generate chairs with convolutional neural networks. In CVPR, 2015. 2, 4

[10] D. Eigen, C. Puhrsch, and R. Fergus. Depth map prediction from a single image using a multi-scale deep network. NIPS, 2014. 1, 2, 5

[11] C. Farabet, C. Couprie, L. Najman, and Y. LeCun. Learning hierarchical features for scene labeling. PAMI, 35(8):1915–1929, 2013. 2

[12] P. Fischer, A. Dosovitskiy, and T. Brox. Descriptor matching with convolutional neural networks: a comparison to SIFT. 2014. pre-print, arXiv:1405.5769v1 [cs.CV]. 2

[13] Y. Ganin and V. S. Lempitsky. (N^{4})-fields: Neural network nearest neighbor fields for image transforms. In ACCV, pages 536–551, 2014. 2

[14] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun. Vision meets robotics: The kitti dataset. International Journal of Robotics Research (IJRR), 2013. 5

[15] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. 2

[16] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014. 4

[17] B. Hariharan, P. Arbeláez, R. Girshick, and J. Malik. Hypercolumns for object segmentation and fine-grained localization. CVPR, 2015. 2

[18] J. Hays and A. A. Efros. im2gps: estimating geographic information from a single image. In CVPR, 2008. 5

[19] B. K. P. Horn and B. G. Schunck. Determining optical flow. Artificial Intelligence, 17:185–203, 1981. 2

[20] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. 6

[21] R. Kennedy and C. Taylor. Optical flow with geometric occlusion estimation and fusion of multiple frames. In EMMCVPR. 2015. 2

[22] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 6

[23] K. R. Konda and R. Memisevic. Unsupervised learning of depth and motion. CoRR, abs/1312.3429, 2013. 2

[24] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1106–1114, 2012. 1, 2, 5

[25] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989. 1, 2

[26] M. Leordeanu, R. Sukthankar, and C. Sminchisescu. Efficient closed-form solution to generalized boundary detection. In Proceedings of the 12th European Conference on Computer Vision - Volume Part IV, ECCV’12, pages 516–529, Berlin, Heidelberg, 2012. Springer-Verlag. 4

[27] M. Leordeanu, A. Zanfir, and C. Sminchisescu. Locally affine sparse-to-dense matching for motion and occlusion estimation. ICCV, 0:1721–1728, 2013. 2

[28] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 1, 2, 4

[29] E. Mémin and P. Pérez. Dense estimation and object-based segmentation of the optical flow with robust techniques. 7(5):703–719, May 1998. 2

[30] J. Revaud, P. Weinzaepfel, Z. Harchaoui, and C. Schmid. EpicFlow: Edge-Preserving Interpolation of Correspondences for Optical Flow. In CVPR, Boston, United States, June 2015. 2, 7

[31] D. Rosenbaum, D. Zoran, and Y. Weiss. Learning the local statistics of optical flow. In NIPS, 2013. 2

[32] D. Sun, S. Roth, J. Lewis, and M. J. Black. Learning optical flow. In ECCV, 2008. 2

[33] G. W. Taylor, R. Fergus, Y. LeCun, and C. Bregler. Convolutional learning of spatio-temporal features. In ECCV, pages 140–153, 2010. 2

[34] A. Wedel, D. Cremers, T. Pock, and H. Bischof. Structure- and motion-adaptive regularization for high accuracy optic flow. In ICCV, Kyoto, Japan, 2009. 2

[35] P. Weinzaepfel, J. Revaud, Z. Harchaoui, and C. Schmid. DeepFlow: Large displacement optical flow with deep matching. In ICCV, Sydney, Australia, Dec. 2013. 2, 7

[36] J. Zbontar and Y. LeCun. Computing the stereo matching cost with a convolutional neural network. CoRR, abs/1409.4326, 2014. 2

[37] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In ECCV, 2014. 4

[38] M. D. Zeiler, G. W. Taylor, and R. Fergus. Adaptive deconvolutional networks for mid and high level feature learning. In ICCV, pages 2018–2025, 2011. 4