作者:请叫我东少 | 已授权转载(源:知乎) https://zhuanlan.zhihu.com/p/370200419
本文讨论了两种直观的输入方式,一种为不同帧之间图像直接按照ViT的处理,转换为tokens,然后按照frames的顺序进行组合,另一种则将多帧直接进行组合,同时获取时间,空间上的一个token,这样能更有效融合时空信息
举个例子, 当输入32frames到模型中,t=4,则我们可以得到8 frames的tokens
简单的将token直接拼接起来,输入到bert中
因为输入token和MSA的计算量成平方关系,所以这种方面效率最低
使用后融合方面,每一组图像分别过L层的Atten,然后再融合,计算量大大减少
计算量为 O((h*w)^2+t*2)
层数会比model 1更多
该结构将时间和空间的交互进行拆分,在空间上交互,只计算单独的attention,然后在时间上再计算一次atten,这样也能降低计算量
We observed that the order of spatial-then-temporal selfattention or temporal-then-spatial self-attention does not make a difference
先时间和先空间没有较大区别
本模型上不适用cls emb,这样更有利于进行维度变换
个模型和Model3十分相似,相当于并行版的Model3
模型是以Vit为基础进行训练的,所以初始化需要进行特殊处理
Position emb: 复制t份出来,来适应多帧的处理
Therefore, at initialisation, all tokens with the same spatial index have the same embedding which is then fine-tuned.
Embedding emb:
2d的输入没什么好说的
对于3d的输入,提供了两种不同的方式
公式9可以实现在初始的情况下,等价于只用的1帧的情况,参数由模型自己去学习
Transformer Weight:
In this case, we initialise the spatial MSA module from the pretrained module, and initialise all weights of the temporal MSA with zeroes
ViViT-B是使用3d输入的ViT,论文的改进版本
We also consider an additional baseline (last row), based on Model 2, where we do not use any temporal transformer, and simply average pool the frame-level representations from the spatial encoder before classifying.
model3和model4虽然参数更少,但是时延都增加了不少,猜测是因为向量维度变换的关系
model1在空间和时间上都可以做到最灵活的特征融合,所以效果也是最好的
论文还附带了几个消融实验,感兴趣的可以查一下原文
L_t为Model2上,单个分支上帧的数量,从这个结果上看,还是提前进行融合,能带来更好的效果
论文中测试了Large和Base两种规模, 从结果上看,L对性能的增益远不及计算量的增加
16x4应该是指16帧图像,按照t=4来进行融合,所以实际输入帧的数量应该为4