【AIGC】2022-NIPS-视频扩散模型

视频扩散模型

作者:Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, David J. Fleet
单位:Google
论文地址2022-NIPS-Video Diffusion Models

摘要

 生成时间连贯的高保真视频是生成模型研究的一个重要里程碑。我们提出了一种视频生成扩散模型,并取得了非常有希望的初步结果,朝着这一里程碑迈进了一步。我们的模型是标准图像扩散架构的自然延伸,它能够从图像和视频数据进行联合训练,我们发现这可以减少小批量梯度的方差并加快优化速度。为了生成长视频和高分辨率视频,我们引入了一种新的条件采样技术,用于空间和时间视频扩展,其性能优于以前提出的方法。我们展示了大型文本条件视频生成任务的第一批结果,以及视频预测和无条件视频生成的既定基准的最新结果。补充材料可在 https://video-diffusion.github.io/ 上找到。

1. 引言

 扩散模型最近在图像生成和音频生成中产生了高质量的结果 [例如 28, 39, 40, 16, 23, 36, 48, 60, 42, 10, 29],并且人们对在新的数据模式中验证扩散模型有着浓厚的兴趣。在这项工作中,我们展示了使用扩散模型进行视频生成的初步结果,包括无条件和条件设置。

我们表明,可以使用高斯扩散模型 [46] 的标准公式生成高质量视频,除了简单的架构更改以在深度学习加速器的内存限制内容纳视频数据外,几乎不需要修改。我们使用 3D U-Net 扩散模型架构训练生成固定数量视频帧的模型,并使用一种新的条件生成方法自回归地应用该模型,从而生成更长的视频。我们还展示了联合训练对视频和图像建模目标的好处。我们在视频预测和无条件视频生成上测试了我们的方法,我们获得了最先进的样本质量分数,并且我们还在文本条件视频生成上展示了有希望的初步结果。

2. 背景

 连续时间 [53, 48, 10, 28] 中指定的扩散模型 [46, 47, 22] 是一个生成模型,其潜在向量 z = { z t ∣ t ∈ [ 0 , 1 ] } \mathbf{z}=\left\{\mathbf{z}_t|t\in\left[0,1\right]\right\} z={ztt[0,1]} 服从从数据 x ∼ p ( x ) \mathbf{x}\sim p\left(\mathbf{x}\right) xp(x) 开始的前向过程 q ( z ∣ x ) q\left(\mathbf{z}|\mathbf{x}\right) q(zx)前向过程是满足马尔可夫结构的高斯过程

公式 1

 其中 0 ≤ s < t ≤ 1 0\le s<t\le1 0s<t1 σ t ∣ s 2 = ( 1 − e λ t − λ s ) σ t 2 \sigma_{t|s}^2=\left(1-e^{\lambda_t-\lambda_s}\right)\sigma_t^2 σts2=(1eλtλs)σt2,且 α t , σ t \alpha_t,\sigma_t αt,σt 指定一个可微分噪声计划,其对数信噪比 λ t = log ⁡ [ α t 2 / σ t 2 ] \lambda_t=\log\left[\alpha_t^2/\sigma_t^2\right] λt=log[αt2/σt2] t t t 减小,直到 q ( z 1 ) ≈ N ( 0 , I ) q\left(\mathbf{z}_1\right)\approx\mathcal{N}\left(\mathbf{0},\mathbf{I}\right) q(z1)N(0,I)

训练学习逆转生成的正向过程可以归结为学习将 z t ∼ q ( z t ∣ x ) \mathbf{z}_t\sim q\left(\mathbf{z}_t|\mathbf{x}\right) ztq(ztx) 去噪为对所有 t t t 的估计 x ^ θ ( z t ,   λ t ) ≈ x \hat{\mathbf{x}}_\theta\left(\mathbf{z}_t,\ \lambda_t\right)\approx\mathbf{x} x^θ(zt, λt)x(我们将放弃对 λ t \lambda_t λt 的依赖以简化符号)。我们使用加权均方误差损失训练这个去噪模型 x ^ θ \hat{\mathbf{x}}_\theta x^θ

公式 2

 在均匀采样时间 t ∈ [ 0 , 1 ] t\in\left[0,1\right] t[0,1] 上。将生成过程简化为去噪过程,可以通过优化扩散模型下数据对数似然的加权变分下限来证明,也可以作为去噪分数匹配的一种形式 [56, 47, 22, 28]。实践中,我们使用 ϵ \boldsymbol{\epsilon} ϵ- 预测参数化,定义为 x ^ θ ( z t ) = ( z t − σ t ϵ θ ( z t ) ) / α t \hat{\mathbf{x}}_\theta\left(\mathbf{z}_t\right)=\left(\mathbf{z}_t-\sigma_t\boldsymbol{\epsilon}_\theta\left(\mathbf{z}_t\right)\right)/\alpha_t x^θ(zt)=(ztσtϵθ(zt))/αt,并使用 ϵ \boldsymbol{\epsilon} ϵ 空间中的均方误差训练 ϵ θ \boldsymbol{\epsilon}_\theta ϵθ,其中 t t t 按照余弦计划(cosine schedule)采样 [37]。这对应于特定权重 w ( λ t ) w\left(\lambda_t\right) w(λt),用于学习缩放分数估计 ϵ θ ( z t ) ≈ − σ t ∇ z t l o g p ( z t ) \boldsymbol{\epsilon}_\theta\left(\mathbf{z}_t\right)\approx-\sigma_t\nabla_{\mathbf{z}_t}logp\left(\mathbf{z}_t\right) ϵθ(zt)σtztlogp(zt),其中 p ( z t ) p\left(\mathbf{z}_t\right) p(zt) x ∼ p ( x ) \mathbf{x}\sim p\left(\mathbf{x}\right) xp(x) z t \mathbf{z}_t zt 的真实密度 [22, 28, 48]。我们还使用 v \mathbf{v} v- 预测参数化对某些模型进行训练 [42]。

采样。我们在本研究中使用了各种扩散模型采样器。一种是离散时间祖先采样器 [22],其采样方差来自反向过程熵的下限和上限 [46, 22, 37]。要定义此采样器,首先请注意,正向过程可以反向描述为 q ( z s ∣ z t ,   x ) = N ( z s ;   μ ~ s ∣ t ( z t ,   x ) ,   σ ~ s ∣ t 2 I ) q\left(\mathbf{z}_s|\mathbf{z}_t,\ \mathbf{x}\right)=\mathcal{N}\left(\mathbf{z}_s;\ \boldsymbol{\widetilde{\mu}}_{s|t}\left(\mathbf{z}_t,\ \mathbf{x}\right),\ {\widetilde{\sigma}}_{s|t}^2\mathbf{I}\right) q(zszt, x)=N(zs; μ st(zt, x), σ st2I)(注意 s < t s<t s<t),其中

公式 3

 从 z 1 ∼ N ( 0 , I ) \mathbf{z}_1\sim\mathcal{N}\left(\mathbf{0},\mathbf{I}\right) z1N(0,I) 开始,祖先采样器遵循规则

公式 4

 其中 ϵ \boldsymbol{\epsilon} ϵ 是标准高斯噪声, γ \gamma γ 是控制采样器随机性的超参数 [37], s ,   t s,\ t s, t 遵循从 1 到 0 的均匀间隔序列。

 我们发现,另一个采样器对于我们的新条件生成方法(第 3.1 节)特别有效,即预测校正采样器 [48]。我们的此采样器版本在祖先采样器步骤 (4) 和 Langevin 校正步骤之间交替,其形式为

公式 5

 其中 δ \delta δ 是步长,我们在此将其固定为 0.1, ϵ ′ \boldsymbol{\epsilon}^\prime ϵ 是标准高斯噪声的另一个独立样本。Langevin 步骤的目的是帮助采样器生成的每个 z s \mathbf{z}_s zs 的边缘分布与从 x ∼ p ( x ) \mathbf{x}\sim p\left(\mathbf{x}\right) xp(x) 开始的前向过程下的真实边缘相匹配

 在条件生成设置中,数据 x \mathbf{x} x 配备了条件信号 c \mathbf{c} c,它可以表示类标签、文本标题或其他类型的条件。要训练扩散模型以拟合 p ( x ∣ c ) p\left(\mathbf{x}|\mathbf{c}\right) p(xc),唯一需要做的修改是将 c \mathbf{c} c 作为 x ^ θ ( z t ,   c ) {\hat{\mathbf{x}}}_\theta\left(\mathbf{z}_t,\ \mathbf{c}\right) x^θ(zt, c) 提供给模型。在此设置中,可以使用无分类器指导来提高样本质量 [20]。该方法使用调整后的模型预测 ϵ ~ θ \boldsymbol{\widetilde{\epsilon}}_\theta ϵ θ 进行采样,通过以下方式构建

3. 视频扩散模型

我们使用扩散模型生成视频的方法是使用第 2 节中描述的标准扩散模型形式和适合视频数据的神经网络架构。我们的每个模型都经过训练,以固定的空间分辨率联合建模固定数量的帧。为了将采样扩展到更长的帧序列或更高的空间分辨率,我们将使用第 3.1 节中稍后描述的调节技术重新利用我们的模型。

 在之前的图像建模工作中,图像扩散模型中 x ^ θ \mathbf{\widehat{x}}_\theta x θ 的标准架构是 U-Net [38, 44],这是一种神经网络架构,由空间下采样通道和空间上采样通道构成,并与下采样通道激活进行跳过连接。该网络由多层 2D 卷积残差块构成,例如 Wide ResNet [65] 的风格,每个这样的卷积块后面都有一个空间注意块 [55, 58, 11]。条件信息(例如 c \mathbf{c} c λ t \lambda_t λt)以嵌入向量的形式提供给网络,这些嵌入向量被添加到每个残差块中(我们发现,在添加之前使用多个 MLP 层处理这些嵌入向量对我们的模型很有帮助)。

我们建议将这种图像扩散模型架构扩展到视频数据,由一个固定帧数的块给出,使用一种在空间和时间上分解的特殊类型的 3D U-Net [13]。首先,我们通过将每个 2D 卷积更改为仅限空间的 3D 卷积来修改图像模型架构,例如,我们将每个 3x3 卷积更改为 1x3x3 卷积(第一个轴索引视频帧,第二个和第三个索引空间高度和宽度)。每个空间注意块中的注意力仍然是对空间的注意力;即,第一个轴被视为批处理轴。其次,在每个空间注意块之后,我们插入一个时间注意块,该块对第一个轴执行注意力并将空间轴视为批处理轴。我们在每个时间注意块中使用相对位置嵌入 [45],以便网络可以区分帧的顺序,而不需要绝对的视频时间概念。我们在图 1 中可视化了模型架构。

图 1

图 1:扩散模型中 \mathbf{x}\widehat_\theta 的 3D U-Net 架构。每个块代表一个 4D 张量,轴标记为帧×高度×宽度×通道,以第 3 节中所述的时空分解方式处理。输入是嘈杂(noisy)的视频 \mathbf{z}_t、条件 \mathbf{c} 和对数 SNR \lambda_t。下采样/上采样块通过 K 个块中的每一个将空间输入分辨率高度×宽度调整为 2 倍。使用通道乘数 M_1,\ M_2,\ \cdots,\ M_K 指定通道数,上采样过程与下采样过程具有级联跳过连接。

 众所周知,在视频 Transformer 中使用分解式时空注意力是一种不错的选择,因为它具有计算效率 [2, 5, 21]。我们的分解式时空架构的一个优势(这是我们视频生成设置所独有的)是,可以特别直接地屏蔽模型以在独立图像而不是视频上运行,只需移除每个时间注意力块内的注意力操作并修复注意力矩阵以精确匹配每个视频时间步长上的每个键和查询向量即可。这样做的好处是,它允许我们在视频和图像生成上联合训练模型。我们在实验中发现,这种联合训练对于样本质量很重要(第 4 节)。

3.1. 重建引导采样以改进条件生成

 我们考虑建模的视频通常包含数百到数千帧,帧率至少为每秒 24 帧。为了满足训练模型的计算要求,我们每次仅对一小部分(比如 16 帧)进行训练。然而,在测试时,我们可以通过扩展样本来生成更长的视频。例如,我们可以先生成由 16 帧组成的视频 x a ∼ p θ ( x ) \mathbf{x}^a\sim p_\theta\left(\mathbf{x}\right) xapθ(x),然后用第二个样本 x b ∼ p θ ( x b | x a ) \mathbf{x}^b\sim p_\theta\left(\mathbf{x}^b\middle|\mathbf{x}^a\right) xbpθ(xb xa) 对其进行扩展。如果 x b \mathbf{x}^b xb x a \mathbf{x}^a xa 之后的帧组成,我们就可以将采样的视频自回归扩展为任意长度,我们将在第 4.3.3 节中对此进行演示。或者,我们可以选择 x a \mathbf{x}^a xa 来表示帧率较低的视频,然后将 x b \mathbf{x}^b xb 定义为 x a \mathbf{x}^a xa 帧之间的帧。这允许人们在时间上对视频进行上采样,类似于 [34] 通过空间上采样生成高分辨率图像的方式。

这两种方法都需要从条件模型 p θ ( x b ∣ x a ) p_\theta\left(\mathbf{x}^b|\mathbf{x}^a\right) pθ(xbxa) 中抽样。这个条件模型可以明确训练,但也可以通过插补从我们的非条件模型 p θ ( x ) p_\theta\left(\mathbf{x}\right) pθ(x) 中近似推导出来,这样做的好处是不需要单独训练模型。例如,[48] 提出了一种从联合训练的扩散模型 p θ ( x = [ x a ,   x b ] ) p_\theta\left(\mathbf{x}=\left[\mathbf{x}^a,\ \mathbf{x}^b\right]\right) pθ(x=[xa, xb]) 中进行条件抽样的一般方法:在从 p θ ( x b ∣ x a ) p_\theta\left(\mathbf{x}^b|\mathbf{x}^a\right) pθ(xbxa) 抽样的方法中,更新 z s b \mathbf{z}_s^b zsb 的抽样程序与从 p θ ( z s ∣ z t ) p_\theta\left(\mathbf{z}_s|\mathbf{z}_t\right) pθ(zszt) 抽样的标准方法没有变化,其中 z s = [ z s a ,   z s b ] \mathbf{z}_s=\left[\mathbf{z}_s^a,\ \mathbf{z}_s^b\right] zs=[zsa, zsb],但在每次迭代中, z s a \mathbf{z}_s^a zsa 的样本都被来自前向过程 q ( z s a ∣ x a ) q\left(\mathbf{z}_s^a|\mathbf{x}^a\right) q(zsaxa) 的精确样本所取代。然后,样本 z s a \mathbf{z}_s^a zsa 在构造上具有正确的边际分布,样本 z s b \mathbf{z}_s^b zsb 将通过其对去噪模型 x ^ θ ( [ z t a ,   z t b ] ) \mathbf{\widehat{x}}_\theta\left(\left[\mathbf{z}_t^a,\ \mathbf{z}_t^b\right]\right) x θ([zta, ztb]) 的影响与 z s a \mathbf{z}_s^a zsa 相一致。类似地,我们可以从 q ( z s a | x a ,   z t a ) q\left(\mathbf{z}_s^a\middle|\mathbf{x}^a,\ \mathbf{z}_t^a\right) q(zsaxa, zta) 中抽取 z s a \mathbf{z}_s^a zsa,除了正确的边际分布外,它还遵循正确的条件分布。我们将这两种方法称为从扩散模型进行条件抽样的替代方法

当我们尝试用替换法进行条件采样时,发现它对我们的视频模型效果不佳:尽管样本 x b \mathbf{x}^b xb 单独看起来不错,但它们通常与 x a \mathbf{x}^a xa 不一致。这是由这种替换采样方法的一个根本问题引起的。也就是说,潜在向量 z b \mathbf{z}^b zb 按照 x ^ θ b ( z t ) ≈ E q [ x b ∣ z t ] \mathbf{\widehat{x}}_\theta^b\left(\mathbf{z}_t\right)\approx\mathbb{E}_q\left[\mathbf{x}^b|\mathbf{z}_t\right] x θb(zt)Eq[xbzt] 提供的方向进行更新,而我们需要的是 E q [ x b ∣ z t ,   x a ] \mathbb{E}_q\left[\mathbf{x}^b|\mathbf{z}_t,\ \mathbf{x}^a\right] Eq[xbzt, xa]。将其写成数据分布的分数,我们得到 E q [ x b ∣ z t ,   x a ] = E q [ x b ∣ z t ] + ( σ t 2 / α t ) ∇ z t b log ⁡ q ( x a ∣ z t ) \mathbb{E}_q\left[\mathbf{x}^b|\mathbf{z}_t,\ \mathbf{x}^a\right]=\mathbb{E}_q\left[\mathbf{x}^b|\mathbf{z}_t\right]+\left(\sigma_t^2/\alpha_t\right)\nabla_{\mathbf{z}_t^b}\log{q}\left(\mathbf{x}^a|\mathbf{z}_t\right) Eq[xbzt, xa]=Eq[xbzt]+(σt2/αt)ztblogq(xazt),其中替换方法中缺少第二项。假设有一个完美的去噪模型,插入这个缺失项将使条件采样变得精确。然而,由于 q ( x a ∣ z t ) q\left(\mathbf{x}^a|\mathbf{z}_t\right) q(xazt) 不是闭式形式(closed form),我们建议使用形式为 q ( x a ∣ z t ) ≈ N [ x ^ θ a ( z t ) ,   ( σ t 2 = α t 2 ) I ] q\left(\mathbf{x}^a|\mathbf{z}_t\right)\approx\mathcal{N}\left[\mathbf{\widehat{x}}_\theta^a\left(\mathbf{z}_t\right),\ \left(\sigma_t^2=\alpha_t^2\right)\mathbf{I}\right] q(xazt)N[x θa(zt), (σt2=αt2)I] 的高斯函数来近似它,其中 x ^ θ a ( z t ) \mathbf{\widehat{x}}_\theta^a\left(\mathbf{z}_t\right) x θa(zt) 是我们去噪模型提供的条件数据 x a \mathbf{x}^a xa 的重构。假设模型完美,当 t → 0 t\rightarrow0 t0 时,此近似值变得精确,并且根据经验,我们发现它对于较大的 t t t 也有效。代入近似值并添加加权因子 w r w_r wr,我们提出的条件采样方法是替换方法的一种变体,使用调整后的去噪模型 x ~ θ b \mathbf{\widetilde{x}}_\theta^b x θb,其定义为

公式 7

 该表达式中的附加梯度项可以解释为基于模型对条件数据的重建的一种指导形式 [16, 20],因此我们将这种方法称为重建引导采样,或简称为重建引导。与其他形式的指导一样,我们发现选择较大的加权因子 w r > 1 w_r>1 wr>1 往往会提高样本质量。我们在第 4.3.3 节中对重建指导进行了实证研究,我们发现它效果出奇地好,尤其是与使用朗之万扩散的预测校正采样器结合使用时 [48]。

重建指导还扩展到空间插值(或超分辨率)的情况,其中均方误差损失被施加于模型预测的下采样版本,并通过此下采样执行反向传播。在这种情况下,我们有低分辨率地面真实视频 x a \mathbf{x}^a xa(例如,64x64 空间分辨率),它可能是由低分辨率模型生成的,我们希望使用无条件高分辨率扩散模型 x ^ θ \mathbf{\widehat{x}}_\theta x θ 将它们上采样为高分辨率视频(例如,128x128 空间分辨率)。为了实现这一点,我们对高分辨率模型进行了如下调整

公式 8

 其中 x ^ θ a ( z t ) \mathbf{\widehat{x}}_\theta^a\left(\mathbf{z}_t\right) x θa(zt) 是我们的模型根据 z t \mathbf{z}_t zt 对低分辨率视频的重建,它是通过使用可微分下采样算法(例如双线性插值)对模型的高分辨率输出进行下采样而获得的。请注意,也可以同时对低分辨率视频进行条件处理,同时使用相同的重建指导方法在高分辨率下自回归扩展样本。在图 2 中,我们展示了这种方法的样本,使用 9x128x128 扩散模型将帧跳跃 4 处的 16x64x64 低分辨率样本扩展到帧跳跃 1 处的 64x128x128 样本。

4. 实验

 我们报告了无条件视频生成(第 4.1 节)、条件视频生成(视频预测)(第 4.2 节)和文本条件视频生成(第 4.3 节)的视频扩散模型的结果。我们使用标准指标(例如 FVD [54]、FID [19] 和 IS [43])评估我们的模型;下面每个基准旁边提供了评估详细信息。示例和其他结果在 https://video-diffusion.github.io/ 上提供。附录 A 中列出了架构超参数、训练详细信息和计算资源。

4.1. 无条件视频建模

 为了展示我们在无条件生成方面的方法,我们使用了 Soomro 等人 [49] 的流行基准,用于视频的无条件建模。基准由人们执行 101 项活动之一的短片组成,最初是为了训练动作识别模型而收集的。我们从这个数据集中建模 16 帧的短片段,下采样到 64x64 的空间分辨率。在表 1 中,我们展示了由我们的模型生成的视频的感知质量得分,并与文献中的方法进行了比较,发现我们的方法大大改进了之前的最新技术

 我们使用 TensorFlow Datasets [1] 提供的数据加载器,无需进一步处理,我们对所有 13,320 个视频进行训练。与以前的方法类似,我们使用 C3D 网络 [51] 2 来计算 FID 和 IS,使用从我们的模型生成的 10,000 个样本。 C3D 内部将输入数据调整为 112x112 的空间分辨率,因此即使数据最初以不同的分辨率采样,感知分数也大致相当。如 [64] 所述,遗憾的是,文献中的方法在所使用的数据预处理中并不总是一致的,这可能导致论文之间报告的分数略有差异。我们为真实数据计算出的 Inception Score(≈ 60)与 [26] 报告的一致,他们还报告了以 128x128 分辨率采样的数据的真实数据 Inception 分数更高,约为 90,这表明我们的 64x64 模型可能与以更高分辨率生成的模型相比处于劣势。尽管如此,我们的模型获得了我们在文献中可以找到的最佳感知质量指标

表 1

表 1:UCF101 上的无条件视频建模结果。

我们使用在 github.com/pfnet-research/tgan2 [41] 实现的 C3D 模型。

4.2. 视频预测

 评估视频生成模型的常见基准任务是视频预测,其中模型被赋予视频的第一帧(或几帧),并被要求生成剩余部分。在这个条件生成任务上表现良好的模型通常是针对这个条件设置进行明确训练的,例如通过跨帧自回归。虽然我们的模型只是无条件训练的,但我们可以使用第 3.1 节中提出的指导方法使它们适应视频预测设置。在这里,我们在两个流行的视频预测基准上评估了这种方法,获得了最先进的结果

BAIR Robot Pushing。我们在 BAIR Robot Pushing [17] 上评估视频预测性能,这是视频文献中的标准基准,由大约 44000 个 64x64 空间分辨率的机器人推动动作视频组成。此基准的方法以 1 帧为条件并生成接下来的 15 帧。结果列于表 2 中。按照 [4] 和其他人的评估协议,我们使用 I3D 网络 [8] 通过将 100×256 个模型样本与评估集中的 256 个示例进行比较来计算 FVD [54]。

表 2

表 2:BAIR 机器人推动的视频预测。

Kinetics-600。我们还在 Kinetics-600 基准 [27, 9] 上评估了视频预测性能。Kinetics-600 包含大约 40 万个训练视频,描述了 600 种不同的活动。我们以 64×64 的分辨率在此数据集上训练无条件模型,并对从测试集中随机采样的 5 万个视频进行评估,其中我们以 5 帧的随机采样子序列为条件并生成接下来的 11 帧。与之前的研究一样,我们使用 I3D 网络 [8] 计算 FVD 和 Inception Score。结果见表 3。在我们报告的结果中,我们对测试视频进行了无放回采样,并使用相同的随机选择的子序列来生成模型样本和定义基本事实,因为这会导致报告的 FVD 指标中的偏差和方差最低。然而,从个人交流中我们了解到 [33, 14] 改为进行放回采样,并在对基本事实数据进行采样时使用了不同的随机种子。我们发现,这种评估方式略微提高了我们模型获得的 FVD,从 16:2 提高到了 16:9。Inception Score 不受影响。

表 3

表 3:Kinetics-600 上的视频预测。

4.3. 文本条件视频生成

 报告的其余实验是关于文本条件视频生成的。在这个文本条件视频生成设置中,我们使用了 1000 万个带字幕视频的数据集,并使用注意力池处理 BERT-large 嵌入 [15] 形式的字幕来条件扩散模型。我们考虑了两种模型大小:一个用于联合训练消融的小模型,以及一个用于生成剩余结果的大模型(两种架构都在附录 A 中详细描述),我们探索了联合视频图像训练、无分类器指导和我们新提出的重建指导方法对自回归扩展和同时空间和时间超分辨率的影响。我们在本节中报告了 4096 个样本的以下指标:视频指标 FVD,以及基于 Inception 的图像指标 FID 和 IS,通过平均跨帧激活(FID/IS-avg)和仅测量第一帧(FID/IS-first)来测量。对于 FID 和 FVD,我们报告了两个分别针对训练和验证集测量的数字。对于 IS,我们报告两个数字,分别是 1 次样本分割和 10 次样本分割的平均分数。

图 2

图 2:来自两个模型级联的文本条件视频样本。第一个样本由 16x64x64 帧跳过 4 模型生成。然后,这些样本被视为基本事实,使用 9x128x128 帧跳过 1 模型同时进行超分辨率和自回归扩展到 64x128x128。这两个模型都以文本提示为条件。在此图中,文本提示、低分辨率帧和高分辨率帧按顺序可视化。有关更多示例,请参见图 5。

4.3.1 视频与图像建模的联合训练

 如第 3 节所述,我们的视频架构的主要优势之一是它使我们能够轻松地针对视频和图像生成建模目标联合训练模型。为了实现这种联合训练,我们将随机独立的图像帧连接到从数据集中采样的每个视频的末尾,并在时间注意块中屏蔽注意力,以防止视频帧和每个单独的图像帧之间的信息混合。我们从同一数据集内的随机视频中选择这些随机独立的图像;在未来的工作中,我们计划探索从其他更大的纯图像数据集中选择图像的效果。

 表 4 报告了对文本条件 16x64x64 视频进行的实验结果,其中我们考虑对每个视频的另外 0、4 或 8 个独立图像帧进行训练。随着更多独立图像帧的添加,可以看到视频和图像样本质量指标的明显改善。添加独立图像帧可以降低梯度的方差,但会以视频建模目标的一些偏差为代价,因此可以将其看作是一种内存优化,以在批处理中容纳更多独立示例。

表 4

表 4:由于文本到视频生成的图像-视频联合训练而提高的样本质量。

4.3.2 无分类器指导的效果

 表 5 报告了验证无分类器指导 [20] 在文本到视频生成方面的有效性的结果。正如预期的那样,随着指导权重的增加,类似 Inception Score 的指标有明显的改善,而类似 FID 的指标则随着指导权重的增加而先改善后降低。在文本到图像生成方面也报告了类似的发现 [36]。

表 5

表 5:无分类器指导对文本转视频生成的影响(大型模型)。报告了在帧跳过 1 和 4 数据上训练的 16x64x64 模型的样本质量。该模型在每个 16 帧视频的 8 个独立图像帧上进行联合训练。

 图 3 显示了无分类器指导 [20] 对文本条件视频模型的影响。与其他使用无分类器指导对文本条件图像生成 [36] 和类别条件图像生成 [20, 16] 进行研究的结果类似,添加指导可提高每个单独图像的样本保真度,并强调条件信号的效果。

图 3

图 3:由我们的 16x64x64 文本条件模型生成的随机视频示例帧。左:无引导样本,右:使用无分类器引导的引导样本。

4.3.3 更长序列的自回归视频扩展

 在第 3.1 节中,我们提出了从扩散模型中进行条件采样的重建指导方法,这是对 [48] 的替换方法的改进。在表 6 中,我们展示了使用这两种技术生成更长视频的结果,并发现我们提出的方法在感知质量得分方面确实比替换方法有所改进

表 6

表 6:使用 16x64x64 模型的自回归扩展生成 64x64x64 视频。

 图 4 显示了我们的重建指导方法的条件采样样本与替换方法(第 3.1 节)的比较,目的是以块自回归方式生成长样本(第 4.3.3 节)。替换方法的样本清楚地显示出缺乏时间连贯性,因为整个生成的视频中来自不同块的帧似乎是不相关的样本(以 c \mathbf{c} c 为条件)。相比之下,重建指导方法的样本在整个自回归生成过程中显然具有时间连贯性。图 2 还展示了使用重建指导方法同时以低频、低分辨率视频为条件,同时以高分辨率进行自回归时间延伸的样本。

图 4

图 4:比较替换方法(左)与重建引导方法(右)对从 16 帧模型中分块自回归生成 64 帧的条件作用。视频帧随时间从左到右显示;每行都是一个独立样本。与重建引导方法不同,替换方法缺乏时间连贯性。

5. 相关工作

 先前的视频生成工作通常采用其他类型的生成模型,特别是自回归模型、VAE、GAN 和正则化流 [例如 3, 4, 32, 30, 14, 59, 62, 57]。与扩散模型类似的模型类的相关工作包括 [25, 24]。并行工作 [63] 提出了一种基于扩散的视频生成方法,该方法使用图像扩散模型来预测 RNN 时间自回归模型中的每一帧。相比之下,我们的视频扩散模型使用具有交错空间和时间注意的 3D 视频架构对整个视频(帧块)进行联合建模,并且我们通过填充帧或自回归时间扩展来扩展到长序列长度。

6. 结论

我们引入了用于视频建模的扩散模型,从而将使用扩散模型进行生成建模的最新进展引入了视频领域。我们已经证明,通过将用于二维图像建模的传统 U-Net 架构直接扩展到三维时空,并使用分解的时空注意块,人们可以使用扩散模型的标准公式学习有效的视频数据生成模型。这包括无条件模型、文本条件模型和视频预测模型

我们还展示了联合图像视频训练和无分类器指导对视频扩散模型在视频和图像样本质量指标方面的优势,我们还引入了一种新的重建引导条件采样方法,该方法优于现有的无条件训练模型条件采样替换或归纳方法。我们的重建引导方法可以使用帧插值(或时间超分辨率)或自回归方式的外推来生成长序列,也可以执行空间超分辨率。我们期待在更广泛的条件设置中研究这种方法

我们这项工作的目标是推动生成模型方法的研究,我们的方法有可能对下游的创造性应用产生积极影响。然而,与生成模型领域的前期工作一样,我们的方法有可能造成有害影响,并可能增强生成模型的恶意或不道德使用,例如生成虚假内容、骚扰和传播错误信息,因此我们决定不发布我们的模型。与所有生成模型一样,我们的模型反映了其训练数据集的偏见,因此可能需要进行管理以确保采样结果公平。特别是,我们的文本转视频模型继承了前期文本转图像模型所面临的挑战,我们未来的工作将涉及审核各种形式的社会偏见,类似于 [6, 7, 50, 12] 的图像转文本和图像标记模型。我们认为我们的工作只是进一步研究视频传播模型及其社会影响的起点,我们的目标是探索视频生成环境中社会和文化偏见的基准评估,并取得必要的研究进展来解决这些问题

参考文献

[1] TensorFlow Datasets, a collection of ready-to-use datasets. https://www.tensorflow.org/ datasets, 2022.
[2] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia ´ Schmid. ViViT: A video vision transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6836–6846, 2021.
[3] Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017.
[4] Mohammad Babaeizadeh, Mohammad Taghi Saffar, Suraj Nair, Sergey Levine, Chelsea Finn, and Dumitru Erhan. FitVid: Overfitting in pixel-level video prediction. arXiv preprint arXiv:2106.13195, 2021.
[5] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding. arXiv preprint arXiv:2102.05095, 2(3):4, 2021.
[6] Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Conference on Fairness, Accountability and Transparency, FAT 2018, 23-24 February 2018, New York, NY, USA, Proceedings of Machine Learning Research. PMLR, 2018.
[7] Kaylee Burns, Lisa Hendricks, Trevor Darrell, and Anna Rohrbach. Women also snowboard: Overcoming bias in captioning models. In European Conference on Computer Vision (ECCV), 2018.
[8] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017.
[9] Joao Carreira, Eric Noland, Andras Banki-Horvath, Chloe Hillier, and Andrew Zisserman. A short note about kinetics-600. arXiv preprint arXiv:1808.01340, 2018.
[10] Nanxin Chen, Yu Zhang, Heiga Zen, Ron J Weiss, Mohammad Norouzi, and William Chan. WaveGrad: Estimating gradients for waveform generation. International Conference on Learning Representations, 2021.
[11] Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. PixelSNAIL: An improved autoregressive generative model. In International Conference on Machine Learning, pages 863–871, 2018.
[12] Jaemin Cho, Abhay Zala, and Mohit Bansal. Dall-eval: Probing the reasoning skills and social biases of text-to-image generative transformers. arxiv:2202.04053, 2022.
[13] Özgün Çiçek, Ahmed Abdulkadir, Soeren S Lienkamp, Thomas Brox, and Olaf Ronneberger. 3d u-net: learning dense volumetric segmentation from sparse annotation. In International conference on medical image computing and computer-assisted intervention, pages 424–432. Springer, 2016.
[14] Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019.
[15] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT, pages 4171–4186. Association for Computational Linguistics, 2019.
[16] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat GANs on image synthesis. Advances in Neural Information Processing Systems, 34, 2021.
[17] Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In CoRL, pages 344–356, 2017.
[18] Cade Gordon and Natalie Parde. Latent neural differential equations for video generation. In NeurIPS 2020 Workshop on Pre-registration in Machine Learning, pages 73–86. PMLR, 2021.
[19] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, pages 6626–6637, 2017.
[20] Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021.
[21] Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv preprint arXiv:1912.12180, 2019.
[22] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, pages 6840–6851, 2020.
[23] Jonathan Ho, Chitwan Saharia, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. arXiv preprint arXiv:2106.15282, 2021.
[24] Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. Advances in Neural Information Processing Systems, 34, 2021.
[25] Zahra Kadkhodaie and Eero P Simoncelli. Solving linear inverse problems using the prior implicit in a denoiser. arXiv preprint arXiv:2007.13640, 2020.
[26] Emmanuel Kahembwe and Subramanian Ramamoorthy. Lower dimensional kernels for video discriminators. Neural Networks, 132:506–520, 2020.
[27] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
[28] Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. arXiv preprint arXiv:2107.00630, 2021.
[29] Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. DiffWave: A versatile diffusion model for audio synthesis. In 9th International Conference on Learning Representations, ICLR, 2021.
[30] Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. VideoFlow: A flow-based generative model for video. arXiv preprint arXiv:1903.01434, 2019.
[31] Guillaume Le Moing, Jean Ponce, and Cordelia Schmid. Ccvs: Context-aware controllable video synthesis. Advances in Neural Information Processing Systems, 34, 2021.
[32] Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
[33] Pauline Luc, Aidan Clark, Sander Dieleman, Diego de Las Casas, Yotam Doron, Albin Cassirer, and Karen Simonyan. Transformation-based adversarial video prediction on large-scale data. arXiv preprint arXiv:2003.04035, 2020.
[34] Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. In International Conference on Learning Representations, 2019.
[35] Charlie Nash, João Carreira, Jacob Walker, Iain Barr, Andrew Jaegle, Mateusz Malinowski, and Peter Battaglia. Transframer: Arbitrary frame prediction with generative models. arXiv preprint arXiv:2203.09494, 2022.
[36] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
[37] Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML, 2021.
[38] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 234–241. Springer, 2015.
[39] Chitwan Saharia, William Chan, Huiwen Chang, Chris A Lee, Jonathan Ho, Tim Salimans, David J Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. arXiv preprint arXiv:2111.05826, 2021.
[40] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636, 2021.
[41] Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal GAN. International Journal of Computer Vision, 128(10):2586–2606, 2020.
[42] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. In International Conference on Learning Representations, 2021.
[43] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pages 2234–2242, 2016.
[44] Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. PixelCNN++: Improving the PixelCNN with discretized logistic mixture likelihood and other modifications. In International Conference on Learning Representations, 2017.
[45] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
[46] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265, 2015.
[47] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pages 11895–11907, 2019.
[48] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021.
[49] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. A dataset of 101 human actions classes from videos in the wild. CRCV-TR-12-01, 2012.
[50] Ryan Steed and Aylin Caliskan. Image representations learned with unsupervised pre-training contain human-like biases. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’21, page 701–713. Association for Computing Machinery, 2021.
[51] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015.
[52] Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1526–1535, 2018.
[53] Belinda Tzen and Maxim Raginsky. Neural stochastic differential equations: Deep latent gaussian models in the diffusion limit. arXiv preprint arXiv:1905.09883, 2019.
[54] Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv preprint arXiv:1812.01717, 2018.
[55] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017.
[56] Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 23(7):1661–1674, 2011.
[57] Jacob Walker, Ali Razavi, and Aäron van den Oord. Predicting video with vqvae. arXiv preprint arXiv:2103.01950, 2021.
[58] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7794–7803, 2018.
[59] Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. In International Conference on Learning Representations, 2019.
[60] Jay Whang, Mauricio Delbracio, Hossein Talebi, Chitwan Saharia, Alexandros G Dimakis, and Peyman Milanfar. Deblurring via stochastic refinement. arXiv preprint arXiv:2112.02475, 2021.
[61] Chenfei Wu, Jian Liang, Lei Ji, Fan Yang, Yuejian Fang, Daxin Jiang, and Nan Duan. NÜWA: Visual synthesis pre-training for neural visual world creation. arXiv preprint arXiv:2111.12417, 2021.
[62] Wilson Yan, Yunzhi Zhang, Pieter Abbeel, and Aravind Srinivas. Videogpt: Video generation using vq-vae and transformers. arXiv preprint arXiv:2104.10157, 2021.
[63] Ruihan Yang, Prakhar Srivastava, and Stephan Mandt. Diffusion probabilistic modeling for video generation. arXiv preprint arXiv:2203.09481, 2022.
[64] Vladyslav Yushchenko, Nikita Araslanov, and Stefan Roth. Markov decision process for video generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019.
[65] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值