Paper Deep Reading · TMLR November 2022

Random-Mask
Video Diffusion

把同一段视频拆成“保持干净的已知帧”与“逐步加噪的未知帧”。训练时随机改变已知帧的位置和数量,同一个 3D U-Net 因而可以完成未来预测、任意位置插补、稀疏帧补全与无条件生成。

Tobias Höppe · Arash Mehrjou · Stefan Bauer · Didrik Nielsen · Andrea DittadiarXiv:2206.07696v3TMLR 11/202222 页 · Appendix A–G64 × 64 视频
01 · Research motivation

一个模型覆盖多种时间缺失模式

视频的未来具有多解性,确定性预测容易把不同未来平均成模糊画面;GAN 与 VAE 能表达随机性,却往往针对固定任务训练。RaMViD 的研究问题是:能否把图像扩散模型扩展到视频,并以一种不增加额外条件分支的训练方式,让同一网络处理预测、插补和补全?

1
同一 3D U-Net
3+
预测、插补、补全与生成
K=4
Kinetics 与 UCF 的最大条件帧数

现有条件方式的负担

常见条件扩散把条件帧经额外网络处理,或在通道维度拼接。无条件模型配合 RePaint 式反复去噪与再加噪也能强制协调,但视频维度使多次重采样代价很高,条件帧稀少时尤为明显。

论文的核心直觉

把干净条件帧直接放回视频原位置,网络可以从“干净/有噪”的差异识别条件。随机采样条件位置后,训练分布覆盖不同缺失模式;推理时只需固定任意条件集合 \(\mathcal C\)。

Figure 1 frame 1Figure 1 frame 2Figure 1 frame 3Figure 1 frame 4Figure 1 frame 5Figure 1 frame 6Figure 1 frame 7Figure 1 frame 8
Figure 1 · 论文原始帧。给定首两帧与末两帧,模型生成中间十二帧。论文用这一例子说明任务超出相邻两帧的局部 interpolation:生成必须同时满足起点动作和终点状态。
Paper verified论文在 BAIR 与 Kinetics-600 上量化预测,在 BAIR 与 Kinetics-600 上量化多种插补模式,并在 UCF-101 上量化无条件生成。
Author claim作者把视频预测与插补能力联系到 agent planning、轨迹估计等应用。本文没有训练 agent、没有执行规划任务,也没有用下游控制收益验证这一联系。
02 · Problem formulation

已知帧保持干净,未知帧承担扩散过程

视频与索引集合

视频 \(\mathbf x_0\in\mathbb R^{L\times W\times H\times C}\)。条件帧索引为 \(\mathcal C\),未知帧索引为 \(\mathcal U\),两者互斥且并集为 \(\{0,\ldots,L-1\}\)。条件帧数 \(k=|\mathcal C|\)。

模型输入与输出

输入 \(\mathbf x_t\) 在 \(\mathcal C\) 位置保留原始帧 \(\mathbf x_0^{\mathcal C}\),在 \(\mathcal U\) 位置放入加噪帧 \(\mathbf x_t^{\mathcal U}\)。网络输出与整段视频同形的噪声或 score 预测,损失只读取 \(\mathcal U\) 位置。

训练条件

以概率 \(p_U\) 设置 \(\mathcal C=\varnothing\),形成无条件样本;其他时候先从 \(\{1,\ldots,K\}\) 均匀采样 \(k\),再均匀抽取 \(k\) 个帧索引。

推理条件

用户指定任意 \(\mathcal C\):前缀条件得到 prediction,首尾条件得到 infilling,均匀稀疏条件得到 completion/时间上采样,空集得到 unconditional generation。

\[ \mathcal U\cap\mathcal C=\varnothing,\qquad \mathcal U\cup\mathcal C=\{0,1,\ldots,L-1\},\qquad \mathbf x_0=\mathbf x_0^{\mathcal U}\oplus\mathbf x_0^{\mathcal C}. \]

运算 \(\oplus\) 按索引把两组帧放回原时间位置。它不是通道拼接,视频长度和网络输入通道数均保持不变。

\[ \left(\mathbf a^{\mathcal U}\oplus\mathbf b^{\mathcal C}\right)^i= \begin{cases} \mathbf a^i,&i\in\mathcal U,\\ \mathbf b^i,&i\in\mathcal C. \end{cases} \]
Figure 3 frame 1Figure 3 frame 2Figure 3 frame 3Figure 3 frame 4Figure 3 frame 5Figure 3 frame 6Figure 3 frame 7Figure 3 frame 8
Figure 3 · 论文原始帧。\(\mathcal C=\{0,8\}\) 时,第 0 与第 8 帧保持干净,其他位置处于扩散时刻 \(t\)。网络从完整时间轴同时读取条件与噪声状态。
03 · Mathematical model

随机掩码改变 score matching 的作用域

论文先用连续时间 SDE 解释 score-based diffusion,再在实现中采用离散的 1000 步 DDPM。方法的关键差异集中在噪声支持集与损失支持集:条件帧既不加噪,也不进入误差平均。

\[ d\mathbf x_t=f(\mathbf x_t,t)\,dt+g(t)\,dw,\qquad p(\mathbf x_t\mid\mathbf x_0)= \mathcal N\!\left(\mathbf x_t;\mathbf x_0,\left(\sigma^2(t)-\sigma^2(0)\right)\mathbf I\right). \]

前向过程把数据逐步变为简单噪声分布。\(f\) 是 drift,\(g\) 是 diffusion coefficient,\(w\) 是 Brownian motion。上式的高斯条件分布对应论文举例的 variance-exploding 过程:\(f=0\),\(g(t)=\sqrt{\mathrm{d}\sigma^2(t)/\mathrm{d}t}\);一般 drift 下不能直接使用这个均值不变的表达式。本文的推导随后只对未知子张量 \(\mathbf x_t^{\mathcal U}\) 应用该过程。

\[ J_t^{\mathrm{DSM}}(\theta)= \mathbb E_{\mathbf x_0}\mathbb E_{\mathbf x_t\mid\mathbf x_0} \left[ \left\|s_\theta(\mathbf x_t,t)-\nabla_{\mathbf x_t}\log p(\mathbf x_t\mid\mathbf x_0)\right\|_2^2 \right]. \]

标准 denoising score matching 让 \(s_\theta\) 学习加噪样本的条件 score。RaMViD 把网络输入替换为干净与加噪帧的交织序列,并把预测与 target 都限制到未知位置。

\[ \mathbf x_t^{\mathcal U}\sim \mathcal N\!\left( \mathbf x_0^{\mathcal U}, \left(\sigma^2(t)-\sigma^2(0)\right)\mathbf I \right),\qquad \mathbf x_t=\mathbf x_t^{\mathcal U}\oplus\mathbf x_0^{\mathcal C}. \]
\[ J_t^{\mathrm{RaMViD}}(\theta)= \mathbb E_{\mathbf x_0} \mathbb E_{\mathbf x_t^{\mathcal U}\mid\mathbf x_0} \left[ \left\| s_\theta(\mathbf x_t,t)^{\mathcal U} -\nabla_{\mathbf x_t^{\mathcal U}} \log p(\mathbf x_t^{\mathcal U}\mid\mathbf x_0) \right\|_2^2 \right]. \]

这条目标函数计算未知帧上的误差。条件帧仍进入 3D U-Net 的卷积和 attention,因此能影响未知帧预测;它们没有直接的 denoising target。

\[ d\mathbf x_t^{\mathcal U}= \left[ f(\mathbf x_t^{\mathcal U},t) -g^2(t)\nabla_{\mathbf x_t^{\mathcal U}} \log p(\mathbf x_t^{\mathcal U}\mid\mathbf x_0^{\mathcal C}) \right]dt+g(t)\,dw^{\prime}. \]

逆过程的 score 条件于干净帧 \(\mathbf x_0^{\mathcal C}\)。实现层面,每个 reverse step 开始前都把条件位置覆盖为原始干净帧,再计算一次去噪更新。

01 · Sample video从数据中截取长度 \(L\) 的随机连续子序列。
02 · Sample mask按 \(p_U\) 选空集,或随机选择 1 到 \(K\) 个条件帧。
03 · Add noise仅向 \(\mathcal U\) 位置加入时刻 \(t\) 的 Gaussian noise。
04 · Mix sequence将干净条件帧写回对应时间位置。
05 · 3D U-Net联合处理空间与时间邻域,预测未知位置噪声。
06 · Masked loss只在 \(\mathcal U\) 上平均 MSE 并更新参数。
Figure 2 frame 1Figure 2 frame 2Figure 2 frame 3Figure 2 frame 4Figure 2 frame 5Figure 2 frame 6Figure 2 frame 7Figure 2 frame 8
Figure 2 · 论文原始帧。纯无条件模型配合重采样仍出现背景与条件帧不协调。这个失败例支持“训练阶段显式暴露干净条件帧”的必要性,但论文没有给出重采样次数与量化比较。
04 · Architecture

Improved DDPM U-Net 改为 3D 卷积

空间与时间

所有卷积使用 \(3\times3\times3\) kernel。encoder 经过三次下采样把空间分辨率 \(64\to32\to16\to8\),论文明确不压缩时间维度。官方代码在 scale_time_dim=0 时使用 stride \((1,2,2)\)。

通道与 attention

首层 128 channels,64 分辨率的 channel multiplier 为 \((1,2,3,4)\),因此各级为 128、256、384、512。16 与 8 分辨率插入 4-head self-attention。

ResNet blocks

BAIR 每个分辨率 2 个 block,约 235M 参数;Kinetics-600 与 UCF-101 每级 3 个 block,约 308M 参数。模型保留 diffusion timestep embedding,论文所说“不编码时间维度”指视频帧轴不做 positional encoding/压缩。

输出与方差

论文采用 score-based “simple” objective。固定提交的默认 learn_sigma=False,输出 3 channels 并使用 FIXED_LARGE variance;README 命令没有覆盖该选项。

论文附录第 15 页,包含 Figure 7 架构图
Figure 7 · 原论文附录页。图中展示 noisy/clean 混合视频进入 3D U-Net,最后仅对 corrupted frames 计算 loss;\(c=128\),\(l\) 表示视频长度。整页嵌入保留了原始图的矢量文字布局。
术语边界:视频帧轴始终存在于 3D tensor,并由 3D convolution 混合。“不编码时间维度”不能理解为模型忽略时间;准确含义是 encoder 不对时间轴执行 stride reduction。
05 · Data, training & inference

三套数据,共享同一训练机制

数据集训练视频序列/任务Batch / micro-batch迭代与算力采样步数
BAIR robot pushing64 × 64;随机长度 20 子序列给 1 帧预测 15;首尾插补 1432 / 16250k;8 × A100 40GB;约 3 天750;附录另测 250/500
Kinetics-600约 500k 个 10 秒片段;resize + center crop 64 × 64;长度 165→11 prediction;\(\{0,1,14,15\}\) 与 \(\{0,5,10,15\}\) completion64 / 16500k;8 × A100 40GB;附录约 10 天500
UCF-10113,320 视频;160 × 120 resize + center crop 64 × 64;长度 16unconditional generation64 / 16450k;8 × A100 40GB;约 9 天500

统一超参数

learning rate \(2\times10^{-5}\),线性 noise schedule,\(T=1000\),uniform timestep sampler,EMA rate \(0.9999\)。论文没有报告 optimizer 名称、weight decay、warmup 或 scheduler;官方代码默认 AdamW、weight decay 0、无 LR annealing。

随机掩码分布

\(b\sim\mathrm{Bernoulli}(p_U)\)。若 \(b=1\),\(\mathcal C=\varnothing\);其余样本均匀选择 \(k\in\{1,\ldots,K\}\),再不放回抽取帧索引。BAIR 扫描 \(p_U\in\{0,0.25,0.5,0.75\}\) 与 \(K\in\{2,4,8\}\)。

条件采样

未知位置从 Gaussian noise 开始。每个 DDPM reverse step 前,把 \(\mathcal C\) 位置覆盖为 \(\mathbf x_0^{\mathcal C}\);默认 resample_steps=1,因此主实验没有额外 forward-backward harmonization loop。

EMA 与 respacing

从 EMA checkpoint 采样。代码通过 timestep_respacing 从 1000 个训练步选择较少的采样时刻;附录显示少于 500 步会显著损害 FVD。

项目页与附录时间差异:项目页把 Kinetics 训练描述为约 9 天,论文 Appendix D 写约 10 天。本页将论文附录数字作为主要复现记录,同时保留项目页差异。
06 · Quantitative results

全部五张主表

Table 1 · BAIR prediction:给定一帧预测十五帧

MethodFVD ↓Parameters
Latent Video Transformer125.8—
SAVP116.4—
DVD-GAN-FP109.8—
TrIVD-GAN-FP103.3—
VideoGPT103.340M
Video Transformer94.0373M
FitVid93.6302M
MCVD89.5251.2M
NÜWA86.9—
RaMViD \(p_U=0,K=4\)86.41235M
RaMViD \(p_U=0.25,K=4\)85.3 ± 1.8235M
RaMViD \(p_U=0.5,K=4\)85.03235M
RaMViD \(p_U=0.75,K=4\)86.05235M
RaMViD \(p_U=0.25,K=2\)87.39235M
RaMViD \(p_U=0.25,K=8\)82.64235M
RaMViD \(p_U=0.25\), fixed89.01235M

baseline 数字来自 FitVid 作者提供的统一评估流程;表内只有 \(p_U=0.25,K=4\) 报告多次运行误差条。其余 RaMViD 行为单次结果,差值不应被解释为稳定显著性。

Table 2 · BAIR infilling:条件帧 \(\mathcal C=\{0,15\}\)

MethodFVD ↓
RaMViD \(p_U=0,K=4\)85.68
RaMViD \(p_U=0.25,K=4\)85.02
RaMViD \(p_U=0.5,K=4\)87.04
RaMViD \(p_U=0.75,K=4\)87.85
RaMViD \(p_U=0.25,K=2\)83.83
RaMViD \(p_U=0.25,K=8\)87.11
RaMViD \(p_U=0.25\), fixed119.76

固定 prediction mask 的任务专用模型在 infilling 上明显失效;随机位置训练带来的跨任务泛化是这张表最直接的证据。

Figure 4 frame 1Figure 4 frame 2Figure 4 frame 3Figure 4 frame 4Figure 4 frame 5Figure 4 frame 6Figure 4 frame 7Figure 4 frame 8Figure 4 frame 9Figure 4 frame 10Figure 4 frame 11Figure 4 frame 12Figure 4 frame 13Figure 4 frame 14Figure 4 frame 15Figure 4 frame 16
Figure 4 · 论文原始帧。Kinetics-600 上给前 5 帧预测后 11 帧。原图用两段序列说明背景云层与水面纹理可以保持连续。

Table 3 · Kinetics-600 prediction:给定五帧预测十一帧

MethodFVD ↓Parameters
Video Transformer170 ± 5373M
DVD-GAN-FP69 ± 1—
CCVS55 ± 1366M
TrIVD-GAN-FP26 ± 1—
RaMViD \(p_U=0\)18.69308M
RaMViD \(p_U=0.25\)17.53 ± 1.07308M
RaMViD \(p_U=0.5\)17.61308M
RaMViD \(p_U=0.75\)27.64308M

\(p_U=0.25\) 将 FVD 从最佳外部 baseline 的 26 降至 17.53;当 \(p_U\) 提升到 0.75 时,conditional prediction 下降到 27.64。作者把这个 tipping point 归因于复杂数据上 conditional 与 unconditional distribution 差异更大,这属于解释性推测。

Table 4 · Kinetics-600 两种 completion mask

Method\(\mathcal C=\{0,1,14,15\}\) FVD ↓\(\mathcal C=\{0,5,10,15\}\) FVD ↓
RaMViD \(p_U=0\)10.686.28
RaMViD \(p_U=0.25\)10.854.91
RaMViD \(p_U=0.5\)10.865.90
RaMViD \(p_U=0.75\)17.337.29

均匀条件帧的 FVD 明显更低,因为每段缺口更短。这个任务可以解释为 temporal upsampling,但论文没有训练高 FPS 专用模型或报告真实 FPS 上采样指标。

Figure 11 frame 1Figure 11 frame 2Figure 11 frame 3Figure 11 frame 4Figure 11 frame 5Figure 11 frame 6Figure 11 frame 7Figure 11 frame 8Figure 11 frame 9Figure 11 frame 10Figure 11 frame 11Figure 11 frame 12Figure 11 frame 13Figure 11 frame 14Figure 11 frame 15Figure 11 frame 16Figure 11 frame 17Figure 11 frame 18Figure 11 frame 19Figure 11 frame 20Figure 11 frame 21Figure 11 frame 22Figure 11 frame 23Figure 11 frame 24Figure 11 frame 25Figure 11 frame 26Figure 11 frame 27Figure 11 frame 28Figure 11 frame 29Figure 11 frame 30Figure 11 frame 31Figure 11 frame 32
Figure 11 · 论文原始帧。\(\mathcal C=\{0,1,14,15\}\) 的 Kinetics infilling;四行展示多个样本,模型需要连接开头与结尾的运动状态。
Figure 12 frame 1Figure 12 frame 2Figure 12 frame 3Figure 12 frame 4Figure 12 frame 5Figure 12 frame 6Figure 12 frame 7Figure 12 frame 8Figure 12 frame 9Figure 12 frame 10Figure 12 frame 11Figure 12 frame 12Figure 12 frame 13Figure 12 frame 14Figure 12 frame 15Figure 12 frame 16Figure 12 frame 17Figure 12 frame 18Figure 12 frame 19Figure 12 frame 20Figure 12 frame 21Figure 12 frame 22Figure 12 frame 23Figure 12 frame 24Figure 12 frame 25Figure 12 frame 26Figure 12 frame 27Figure 12 frame 28Figure 12 frame 29Figure 12 frame 30Figure 12 frame 31Figure 12 frame 32
Figure 12 · 论文原始帧。\(\mathcal C=\{0,5,10,15\}\) 的 sparse completion。条件帧均匀分散,运动没有直接给出,模型需要从静态关键帧推断中间动态。

Table 5 · UCF-101 unconditional generation

MethodIS ↑ParametersResolution
VGAN8.31 ± 0.09—64 × 64
MoCoGAN12.42 ± 0.033.3M64 × 64
TGAN-F13.62 ± 0.0617.5M64 × 64
progressive VGAN14.56 ± 0.05—64 × 64
TGAN-F22.91 ± 0.1970M128 × 128
VideoGPT24.69 ± 0.3200M128 × 128
TGANv226.60 ± 0.47200M64 × 64
DVD-GAN32.97 ± 1.7—128 × 128
RaMViD \(p_U=0.5\)20.84 ± 0.08308M64 × 64
RaMViD \(p_U=0.75\)21.71 ± 0.21308M64 × 64

RaMViD 在无条件生成上属于 competitive result,并未达到最佳。TGAN-F、VideoGPT 与 DVD-GAN 的 128 × 128 训练分辨率对用 112 × 112 输入计算的 IS 有一定优势;TGANv2 同为 64 × 64,仍高于 RaMViD。

Figure 5 frame 1Figure 5 frame 2Figure 5 frame 3Figure 5 frame 4Figure 5 frame 5Figure 5 frame 6Figure 5 frame 7Figure 5 frame 8Figure 5 frame 9Figure 5 frame 10Figure 5 frame 11Figure 5 frame 12Figure 5 frame 13Figure 5 frame 14Figure 5 frame 15Figure 5 frame 16
Figure 5 · 论文原始帧。UCF-101 无条件生成。静态背景较真实,快速运动的人体出现明显形变,和 Table 5 的有限 IS 一致。
07 · Ablation & evaluation protocol

掩码分布同时控制通用性与任务精度

\(p_U\) 消融

BAIR 上 \(p_U\) 从 0 到 0.75 的 prediction FVD 差异较小;Kinetics 上 0.25/0.5 最佳,0.75 明显下降。更高无条件比例帮助无条件生成,也减少模型看到带条件样本的频率。

\(K\) 消融

BAIR prediction 的最佳行是 \(K=8\),infilling 的最佳行是 \(K=2\)。单个 \(K\) 没有在所有任务占优,支持作者关于 task-dependent mask schedule 的后续方向。

随机位置与 fixed mask

fixed prediction model 的 BAIR prediction FVD 89.01,略差于随机 mask 多数设置;infilling FVD 119.76,显著差于随机 mask。证据表明随机位置扩大任务覆盖范围。

缺少的消融

论文没有独立比较 2D 与 3D convolution、是否使用 attention、cosine 与 linear schedule 的完整数值,也没有把“只对未知帧计算 loss”与“全帧 loss”量化比较。

数据集评价样本重复指标实现
BAIR256 个 test videos;每个视频预测一条序列整个流程 100 次,FVD 取平均I3D Kinetics-400 latent statistics
Kinetics-600test set 取 50,000 视频,每个预测一条序列仅 \(p_U=0.25\) 行报告误差条预测与 ground truth 的 FVD
UCF-101无条件采样 10,000 视频重复 3 次TGANv2 public video IS implementation
公平性限制:BAIR 与 Kinetics baseline 数字来自相关作者在查询评估流程后的汇总,参数量也来自论文或作者联系。论文没有统一重新训练全部 baseline,部分 baseline 参数量为空。只有少数 RaMViD 设置报告误差条。
08 · Appendix results

速度、长视频与失败案例

采样步数与计算成本

数据/模型250 steps500 steps750 steps10,000 videos 时间
BAIR \(p_U=0.25\)FVD 101.54FVD 85.07FVD 84.20500 steps 约 7 小时
Kinetics-600FVD 49FVD 16FVD 14500 steps 约 9 小时
UCF-101未报告主实验使用未报告500 steps 约 9 小时

附录因此建议 DDPM sampler 至少使用 500 steps。论文没有报告 DDIM、DPM-Solver 或蒸馏采样的结果。

Figure 6 frame 1Figure 6 frame 2Figure 6 frame 3Figure 6 frame 4Figure 6 frame 5Figure 6 frame 6Figure 6 frame 7Figure 6 frame 8Figure 6 frame 9Figure 6 frame 10Figure 6 frame 11Figure 6 frame 12Figure 6 frame 13Figure 6 frame 14Figure 6 frame 15Figure 6 frame 16Figure 6 frame 17Figure 6 frame 18
Figure 6 · 论文原始帧。给定 5 帧后自回归生成 45 帧。每次把最近生成帧作为下一段条件;误差随 segment 递推,约 30 帧后质量经常明显下降。
Figure 8 frame 1Figure 8 frame 2Figure 8 frame 3Figure 8 frame 4Figure 8 frame 5Figure 8 frame 6Figure 8 frame 7Figure 8 frame 8Figure 8 frame 9Figure 8 frame 10Figure 8 frame 11Figure 8 frame 12Figure 8 frame 13Figure 8 frame 14Figure 8 frame 15Figure 8 frame 16Figure 8 frame 17Figure 8 frame 18Figure 8 frame 19Figure 8 frame 20Figure 8 frame 21Figure 8 frame 22Figure 8 frame 23Figure 8 frame 24Figure 8 frame 25Figure 8 frame 26Figure 8 frame 27Figure 8 frame 28Figure 8 frame 29Figure 8 frame 30Figure 8 frame 31Figure 8 frame 32
Figure 8 · 论文原始帧。BAIR 上 \(p_U=0,0.25,0.5,0.75\) 四行无条件样本。作者观察到较高 \(p_U\) 更能生成箱内物体细节,但没有报告该任务的 quantitative metric。

快速物体运动

背景能保持,快速运动主体会拉伸、融化或变形。3D convolution 与全序列去噪仍未显式建模 optical flow 或刚体/人体结构。

快速相机运动

首尾构图差异过大时,模型可能让主体在开头消失、末尾重新出现,形成外观插值,无法恢复合理 camera trajectory。

UCF 过拟合

每类动作约 25 个不同 setting,生成视频常与训练样本很相近。论文没有报告 nearest-neighbor distance 或 memorization audit。

分辨率限制

所有实验均为 64 × 64。作者明确把 super-resolution module 列为未来方向,本文没有实现空间超分模块。

Figure 9 frame 1Figure 9 frame 2Figure 9 frame 3Figure 9 frame 4Figure 9 frame 5Figure 9 frame 6Figure 9 frame 7Figure 9 frame 8Figure 9 frame 9Figure 9 frame 10Figure 9 frame 11Figure 9 frame 12Figure 9 frame 13Figure 9 frame 14Figure 9 frame 15Figure 9 frame 16
Figure 9 · 论文原始帧。Kinetics prediction 的快速运动失败:背景较稳定,主体产生不真实形变。
Figure 10 frame 1Figure 10 frame 2Figure 10 frame 3Figure 10 frame 4Figure 10 frame 5Figure 10 frame 6Figure 10 frame 7Figure 10 frame 8
Figure 10 · 论文原始帧。\(\mathcal C=\{0,1,14,15\}\) 的快速相机运动失败:模型无法生成必要的镜头移动,只在首尾状态之间做外观过渡。
Figure 13 frame 1Figure 13 frame 2Figure 13 frame 3Figure 13 frame 4Figure 13 frame 5Figure 13 frame 6Figure 13 frame 7Figure 13 frame 8Figure 13 frame 9Figure 13 frame 10Figure 13 frame 11Figure 13 frame 12Figure 13 frame 13Figure 13 frame 14Figure 13 frame 15Figure 13 frame 16Figure 13 frame 17Figure 13 frame 18Figure 13 frame 19Figure 13 frame 20Figure 13 frame 21Figure 13 frame 22Figure 13 frame 23Figure 13 frame 24Figure 13 frame 25Figure 13 frame 26Figure 13 frame 27Figure 13 frame 28Figure 13 frame 29Figure 13 frame 30Figure 13 frame 31Figure 13 frame 32
Figure 13 · 论文原始帧。UCF-101 无条件生成补充结果。低运动场景更稳定,同时更容易接近训练集。
Figure 14 frame 1Figure 14 frame 2Figure 14 frame 3Figure 14 frame 4Figure 14 frame 5Figure 14 frame 6Figure 14 frame 7Figure 14 frame 8Figure 14 frame 9Figure 14 frame 10Figure 14 frame 11Figure 14 frame 12Figure 14 frame 13Figure 14 frame 14Figure 14 frame 15Figure 14 frame 16Figure 14 frame 17Figure 14 frame 18Figure 14 frame 19Figure 14 frame 20Figure 14 frame 21Figure 14 frame 22Figure 14 frame 23Figure 14 frame 24Figure 14 frame 25Figure 14 frame 26Figure 14 frame 27Figure 14 frame 28Figure 14 frame 29Figure 14 frame 30Figure 14 frame 31Figure 14 frame 32Figure 14 frame 33Figure 14 frame 34Figure 14 frame 35Figure 14 frame 36Figure 14 frame 37Figure 14 frame 38Figure 14 frame 39Figure 14 frame 40Figure 14 frame 41Figure 14 frame 42Figure 14 frame 43Figure 14 frame 44Figure 14 frame 45Figure 14 frame 46Figure 14 frame 47Figure 14 frame 48
Figure 14 · 论文原始帧。BAIR 上 RaMViD(每组三行中的上方预测)与 VideoGPT 的原论文比较。作者认为整体视觉差异较小,VideoGPT 在交互物体上更易出现 artifact。
Figure 15 frame 1Figure 15 frame 2Figure 15 frame 3Figure 15 frame 4Figure 15 frame 5Figure 15 frame 6Figure 15 frame 7Figure 15 frame 8Figure 15 frame 9Figure 15 frame 10Figure 15 frame 11Figure 15 frame 12Figure 15 frame 13Figure 15 frame 14Figure 15 frame 15Figure 15 frame 16Figure 15 frame 17Figure 15 frame 18Figure 15 frame 19Figure 15 frame 20Figure 15 frame 21Figure 15 frame 22Figure 15 frame 23Figure 15 frame 24Figure 15 frame 25Figure 15 frame 26Figure 15 frame 27Figure 15 frame 28Figure 15 frame 29Figure 15 frame 30Figure 15 frame 31Figure 15 frame 32Figure 15 frame 33Figure 15 frame 34Figure 15 frame 35Figure 15 frame 36Figure 15 frame 37Figure 15 frame 38Figure 15 frame 39Figure 15 frame 40Figure 15 frame 41Figure 15 frame 42Figure 15 frame 43Figure 15 frame 44Figure 15 frame 45Figure 15 frame 46Figure 15 frame 47Figure 15 frame 48
Figure 15 · 论文原始帧。Kinetics 上 RaMViD 与 CCVS 比较。作者认为 RaMViD 对一般运动建模更好;静态视频差异不明显,两者面对快速主体或相机运动都表现较差。
09 · Paper vs. implementation

官方代码固定提交审计

官方仓库 Tobi-r9/RaMViD 固定核查提交 d04802577e0afe4964a86029791a700f22881892(2023-11-11)。仓库基于 OpenAI Improved Diffusion,并公开训练、采样和长视频脚本。

项目论文描述固定提交行为判断
Mask sampling\(p_U\) 选空集;否则 \(k\sim U\{1,\ldots,K\}\)每个 batch item 调用 Bernoulli、randint(1,K) 与 random.sample一致
干净条件帧条件帧不加噪noise 乘 mask;\(\mathbf x_t\) 在 mask=0 位置替换为 \(\mathbf x_0\)一致
Masked loss只在 \(\mathcal U\) 上计算MSE 乘 mask,再按有效元素归一一致
Sampling conditionreverse diffusion 条件于 clean frames每个 reverse step 前执行 img[:,:,cond_frames] = cond_img一致
Video convolution\(3\times3\times3\),仅空间降采样Conv3d;scale_time_dim=0 产生 stride \((1,2,2)\)一致
Variance正文没有说明是否 learned variance默认 learn_sigma=False,使用 FIXED_LARGE需要复现者明确记录
Optimizer正文未报告训练循环使用 AdamW;默认 weight decay 0代码补充信息
README batch全局 batch 32/64README 分布式示例为每 rank 4/8,并要求按 rank 数手动除8 GPU 时一致
Micro-batch正文 Section 4.1 写 size 2;Appendix D 写 16README 每 rank microbatch=2;全局表述可对应 16两个文档口径可由 per-rank/global 解释
短视频填充训练随机子序列MP4 loader 对不足 \(L\) 的视频补零;GIF loader 没有同样补零未在论文说明的格式差异
随机种子未报告训练脚本的 seed 设置被注释;采样 seed=0 时不会进入 seed 分支复现随机性未固定
实现限制:仓库发布了模型链接与核心脚本,但没有内置 FVD/IS 评估程序、数据下载预处理 pipeline、训练日志或产生论文五张表的完整命令。代码可以核查机制,无法单独重算论文全部数字。
能力边界:代码支持条件视频 prediction、infilling、completion、无条件 sampling 与 autoregressive long sampling。仓库没有 agent loop、planner、reward、environment interaction 或动作控制接口。
10 · Reproduction checklist

复现需要固定的执行协议

数据

  • BAIR 原始 64 × 64 数据与 256 test videos
  • Kinetics public downloader 的具体 snapshot 与失效视频清单
  • UCF-101 全量 13,320 视频
  • 随机连续子序列选择和 center crop

模型

  • 128 base channels,multiplier 1/2/3/4
  • BAIR 2 blocks,其余 3 blocks
  • attention resolutions 16/8,4 heads
  • 3D convolution,时间 stride 固定为 1

优化

  • linear beta schedule,1000 training steps
  • LR \(2\times10^{-5}\),EMA 0.9999
  • global batch 与 per-rank micro-batch 分开记录
  • 明确 learn_sigma=False 与 AdamW 默认值

评估

  • 至少 500 DDPM sampling steps
  • BAIR 100 次 FVD 重复
  • Kinetics 50,000 test predictions
  • UCF 10,000 samples × 3 次 IS

论文没有公开的关键值

精确 beta 起止值可从 Improved Diffusion linear schedule 与代码得到;论文正文没有逐项写出。正文也没有报告训练 random seed、数据 loader worker nondeterminism、checkpoint selection rule、gradient clipping 是否触发、mixed precision、optimizer 名称、weight decay、所有模型的完整命令、baseline checkpoint 与统一评估代码。严格复现报告应把这些作为实现选择单列。

11 · Reviewer commentary

条件机制简洁,实验结论有清楚边界

Strengths

  • 条件帧直接占据原时间位置,架构改动很少。
  • 随机 mask 给 prediction、infilling、completion 提供统一训练目标。
  • BAIR 与 Kinetics 的主表包含强 baseline 和参数量。
  • 附录公开算力、数据协议、采样速度与失败案例。
  • 官方代码直接实现了论文最关键的 noise mask 与 loss mask。

Weaknesses

  • 全部实验停留在 64 × 64,细节质量的上限很低。
  • 500–750 步 DDPM 采样成本高,10,000 视频需要 7–9 小时。
  • 快速运动、快速镜头与长时自回归误差仍明显。
  • 多数消融只有单次结果,误差条与统计显著性不足。
  • 掩码训练的贡献没有和 2D/3D、schedule、attention 分别量化。
  • UCF 有 memorization 迹象,缺少正式最近邻审计。

Potential improvements

使用 latent video diffusion 降低空间计算量;加入 motion-aware representation、optical flow 或 trajectory token 处理快速运动;训练分层 temporal model 解决 30 帧后的误差积累;用 consistency model 或现代 solver 减少采样步数;学习 task-conditioned mask curriculum;让条件帧带显式 binary mask channel,消除“靠噪声强度猜条件”的歧义;报告 perceptual、motion、identity 与 memorization 指标。

Paper verified随机 mask 模型在 BAIR prediction/infilling 与 Kinetics prediction/completion 上取得表中结果;UCF 无条件生成未达到最佳;附录明确展示快速运动、相机运动和长时递推失败。
Author claim\(p_U\) 的 tipping point 来自 conditional 与 unconditional distributions 在复杂数据上的差异。论文没有直接测量这两个分布或优化冲突,只用跨数据集现象支持该解释。
Our interpretationRaMViD 可以视为对时间轴做 structured inpainting:随机条件集合定义观测 pattern,3D U-Net 学习其余位置的 conditional score。随机条件集合的训练分布赋予模型多任务能力;论文使用同一个网络处理各类条件集合。
Research extension可以把 mask schedule 变成 learned curriculum:依据运动幅度、遮挡、缺口长度与当前 loss 选择条件帧,训练一个覆盖特定下游任务分布的 observation policy。该方向没有在本文验证。
Research extension面向 agent planning 时,需要把动作、奖励、状态约束与环境反馈加入模型,并用 closed-loop control 指标评估。本文只生成像素视频,不能据此推断规划能力。
12 · Sources & evidence

一手资料

  1. arXiv record · 2206.07696v3:作者、版本历史、TMLR 发表说明、摘要与 PDF。
  2. arXiv HTML full text:主文公式、Algorithm 1、Tables 1–5、Appendix A–G 与 Figures 1–15 图注;与本地 22 页 PDF 逐项交叉核对。
  3. OpenReview · TMLR review forum:正式评审入口。自动页面访问受验证页限制,本页没有引用未读取的评审正文。
  4. Official project page:三项任务设置、训练时长说明与高分辨率动态示例。
  5. Official code · fixed commit d048025:README、3D U-Net、随机 mask loss、sampling condition 与数据 loader 的实现审计。
  6. OpenAI Improved Diffusion:RaMViD 官方代码声明的基础实现。
  7. Official FVD implementation reference:论文采用的 FVD 实现入口。
  8. TGANv2 repository:论文用于 video Inception Score 的公开实现入口。

论文身份:Tobias Höppe 为唯一第一作者,第一机构为 KTH Stockholm。作者列表中的星号脚注表示 Equal advising,没有标记共同第一作者或通讯作者。Andrea Dittadi 仅按 vault 规则保留为未核实的末位通讯候选。页面中的 Figure 1–6、8–15 使用本地 PDF 原始嵌入图像;Figure 7 使用原论文附录整页。