ViViT: A Video Vision Transformer[1]

作者是来自Google Research的Anurag Arnab, Mostafa Dehghani, Georg, Heigold, Chen Sun, Mario Lucic, Cordelia Schmid。论文引用[1]:Arnab, Anurag et al. “ViViT: A Video Vision Transformer.” 2021 IEEE/CVF International Conference on Computer Vision (ICCV) (2021): 6816-6826.

Time

  • 2021.Jun

Key Words

  • spatio-temporal tokens
  • transformer
  • regularize model, factorising model along spatial and temporal dimensions to increase efficiency and scalability
阅读全文 »

总结一些使用torch过程中的常用的tips和相关知识点

  1. torch 中的dim:
Dimension
  1. Softmax 和Sigmoid函数:

https://zhuanlan.zhihu.com/p/525276061

https://www.cnblogs.com/cy0628/p/13921725.html

  1. torchscript 是pytorch模型的中间表示,Pytorch提供了一套JIT工具:Just-in-Time,允许用户将模型转换为Torchscript格式;保存后的torchscript模型可以在像C++这种高性能的环境中运行,torchscript是一种从pytorch代码创建可序列化和可优化模型的方法。任何torchscript程序都可以从python进程中加载,并加载到没有python解释器的环境中。torchscript能将动态图转化为静态图。torchscript常和torch.jit合起来用。两种方式:
    • torch.jit.trace:把模型和example输入进去,然后调用模型,记录下模型run的时候所进行的操作,但是有decision branch例如if-else这种,torch.jit.trace只是记录当前代码走的路径,control-flow被抹除了;生成的TorchScript模型可以直接用于推理,而不需要Python解释器。只支持前向传播。这意味着它不能用于训练或反向传播。此外,由于它是通过实际输入数据来跟踪模型的,因此它可能无法处理一些边缘情况或异常输入
    • torch.jit.script:这有分支的情况下,用torch.jit.script。forward方法会被默认编译,forward中被调用的方法也会按照被调用的顺序被编译;相比之下,torch.jit.script允许用户将整个训练循环(包括前向传播和反向传播)转换为TorchScript模型。这意味着它可以直接用于模型的训练和验证。torch.jit.script可以处理更广泛的模型和计算图,并且可以更好地处理异常情况。此外,它还支持自定义类和函数,这使得它更加灵活和强大
    • 如果想要方法不被编译,可以使用 @torch.jit.ignore 或者 @torch.jit.unused
    • 把pytorch模型部署到c++平台上的流程主要是:模型转换、保存序列化模型、C++中加载序列化的pytorch模型以及执行script module
    • 相关链接:
      • https://mp.weixin.qq.com/s/7JjRGgg1mKlIRuSyPC9tmg
      • https://blog.csdn.net/hxxjxw/article/details/120835884
      • Pytorch中文翻译的网站:https://pytorch.ac.cn/docs/stable/index.html
      • https://developer.baidu.com/article/detail.html?id=2995518
      • https://pytorch.panchuang.net/EigthSection/torchScript/
  2. 常用的注意力模块的一些链接:
    • https://www.cnblogs.com/wxkang/p/17133460.html,各种注意力机制
    • https://www.cnblogs.com/Fish0403/p/17221430.html, SE和CBAM
    • https://cloud.tencent.com/developer/article/1776357, Vision Transformer的综述
  3. 一个好用的可视化工具:torchinfo:
    • pip install torchinfo,能够查看网络模型的输入输出,尺寸,参数量等各类型的指标,方便理解模型。

RCNN[1]、Fast RCNN[2]、Faster RCNN[3] Mask RCNN[4]系列

  1. 目标检测的two-stage 方法的系列,从RCNN 到Faster RCNN,RCNN的作者是来自UC Berkeley的Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik;Fast RCNN的作者是来自Microsoft Research的Ross Girshick;Faster RCNN的作者是来自Microsoft Research的Shaoqing Ren, Kaiming He, Ross Girshick, 和孙剑; Mask RCNN的作者是论文引用[1]:Girshick, Ross B. et al. “Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation.” 2014 IEEE Conference on Computer Vision and Pattern Recognition (2013): 580-587. [2]:Girshick, Ross B.. “Fast R-CNN.” (2015).,[3]:>作者是来自Microsoft Research的Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun.[4]:

相关资源

这是一个openmmlab中算法的一些教程和学习资料,介绍的还不错

openmmlab Book

这个是百度PaddlePaddle的资料:

PaddlePaddle Edu

Time

  • RCNN: 2013.Nov
  • Fast RCNN: 2015.Apr
  • Faster RCNN: 2015.Jun
阅读全文 »

An Image is Worth \(16 \times 16\) Words:Transformers For Image Recognition at Scale[1]

作者比较多,都是来自Google Research, Brain Team的Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer,Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby. 论文引用[1]:Dosovitskiy, Alexey et al. “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale.” ArXiv abs/2010.11929 (2020): n. pag.

Time

  • 2020.Oct

Key Words

  • Vision Transformer
  • Image patches (in Vision) \(\Leftrightarrow\) tokens (words) in NLP
  • larger scale training

总结

  1. 自注意力机制的dominant approach is 在large text corpus预训练,然后在smaller task-specific dataset上进行微调。Thanks to Transformers' computational efficiency 和可扩展性(scalability), 训练一个over 100B parameters、unprecedented size的model成为可能。随着model和dataset的growing,没有饱和的迹象(no sign of saturating performance)
阅读全文 »

AVA: A Video Dataset of Spatio-temporally Localized Atomic Visual Actions[1]

作者是来自Google Research、Inria Laboratoire Jean Kuntzmann, Grenoble, France, UC Berkeley的Chunhui Gu、Chen Sun、David A.Ross等人。论文引用[1]:Gu, Chunhui et al. “AVA: A Video Dataset of Spatio-Temporally Localized Atomic Visual Actions.” 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (2017): 6047-6056.

Time

  • 2017.May

Key Words

  • aotmic visual actions rather than composite actions
  • precise spatio-temporal annotations with possibly multiple annotations for each person
  • exhaustive annotation of these atomic actions over 15-minute video clips
  • people temporally linked across consecutive segments

总结

  1. dataset is sourced from 15th - 30th minute time intervals of 430 different movies, which given 1 Hz sampling frequency gives us nearly 900 keyframes for each movie. In each keyframe, every person is labeled with (possibly multiple) actions from AVA vocabulary. Each person is linked to the consecutive keyframes to provide short temporal sequences of action labels.

    阅读全文 »

Kalman Filtering(卡尔曼滤波)

  1. 卡尔曼滤波是最常用最重要的状态估计算法之一。卡尔曼滤波能从不确定且非精确的测量中估计隐藏状态,同时还可以根据历史估计值对未来系统状态进行预测。滤波算法以 Rudolf E.Kalman的名字命名。在1960年,卡尔曼发表了著名的论文,描述了一个离散数据的线性滤波问题的递归算法。如今它被广泛应用于目标追踪、定位和导航系统、控制系统等领域。
阅读全文 »

一些参数的用法及含义

*args**kwargs 主要用于函数定义,可以将不定数量的参数传递给一个函数。这里的不定的意思是:预先并不知道, 函数使用者会传递多少个参数给你, 所以在这个场景下使用这两个关键字。 *args 是用来发送一个非键值对的可变数量的参数列表给一个函数.

**kwargs

  1. **kwargs 允许将不定长度的 键值对,作为参数传递给一个函数,如果要在一个函数里处理带名字的参数,应该使用 **kwargs.

*args

  1. *args是用来发送一个非键值对的可变数量的参数列表给一个函数

标准参数与 *args、**kwargs的使用顺序:

some_func(fargs, *args, **kwargs)

阅读全文 »

Hiera: A Hierachical Vision Transformer without the Bells-and-Whistles[1]

作者是来自Meta、Georgia Tech和John Hopkins 的Chaitanya Ryali, Yuan-Ting Hu, Daniel Bolya, Chen Wei, Haoqi Fan, Po-Yao Huang, Vaibhav Aggarwal, Arkabandhu Chowdhury, Omid Poursaeed, Judy Hoffman, Jitendra Malik, Yanghao Li, Christoph Feichtenhofer. 论文引用[1]:Ryali, Chaitanya K. et al. “Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles.” ArXiv abs/2306.00989 (2023): n. pag.

Time

  • 2023.Jun

Key Words

  • visual pretext task:MAE
  • hierarchical(multiscale) vision transformer
  • Mask unit attention vs Window attention
  • add spatial bias by teaching it to model using a strong pretext task like MAE instead of vision-specific modules like shifted windows or convs.
  • 一句话总结:就用MAE对MViTv2(encoder)进行预训练, 而不是vanilla ViT,同时去掉了MViTv2中的一些设计,用了mask unit attention,取得了很好的效果。

动机

  1. 现在很多hierarchical ViT加了很多vision-specific component,为了追求监督的分类性能,同时这些components带来了不错的精度和FLOP counts,增加的复杂度使得这些transformer比对应的vanilla ViT更慢。作者argue: 这些额外的bulk是不必要的,通过预训练一个强的visual pretext task(MAE),可以去掉很多花里胡哨的东西,同时也不降低精度。所以作者提出了Hiera.
阅读全文 »

Masked Video Distillation: Rethinking Masked Feature Modeling for Self-supervised Video Representation Learning[1]

作者是来自复旦大学和Microsoft Cloud+ AI团队的 Rui Wang, Dongdong Chen, Zuxuan Wu, Yinpeng Chen, Xiyang Dai, Mengchen Liu, Lu Yuan, Yu-Gang Jiang.论文引用[1]:Wang, Rui et al. “Masked Video Distillation: Rethinking Masked Feature Modeling for Self-supervised Video Representation Learning.” 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022): 6312-6322.

Time

  • 2022.Dec

Key Words

  • Masked Video Modeling/Masked Image Modeling
  • High-level features from video teacher and image teacher for continued masked feature prediction
  • spatial-temporal co-teaching
  • 简单地说,就是用MIM/MVM预训练的image 和video model作为masked feature prediction target, 用作student的teacher,从而实现视频表征学习。

动机

  • 对于自监督视觉表征学习,最近的MIM方法,例如MAE,BEiT,PeCO,用Vision transformer实现了很好的性能。这样的预训练范式,用在了video domain,使video transformer有了显著的提升。代表性的MVM(masked video modeling) 的工作包括:BEVT,VideoMAE和ST-MAE。跟着MAE和BEiT,现有的masked video modeling的方法通过重建low-level features来预训练video transformers,例如raw pixel values or low-level VQVAE tokens。然而,用low-level的features重建目标,通常存在噪声,由于视频数据的高度冗余,对于MVM很容易学习到shortcuts,因此造成在下游任务上有限的迁移性能。为了缓解这个问题,MVM通常用了更大的masking ratios。
阅读全文 »
0%