FasterViT: Fast Vision Transformers with Hierarchical Attention
本文引入了层次注意力(Hierarchical Attention)的Carrier Token(CT),该令牌以低成本获得比局部窗口更大的注意力足迹。
层次注意力具体步骤为:
- 划分输入特征图为 n × n n\times n n×n局部窗口,得到特征图 x ^ 1 \hat{x}_{1} x^1。
- CT计算。首先通过卷积和池化初始化CT。 x ^ c = Conv 3 × 3 ( x ) x ^ c t = AvgPool H 2 → n 2 L ( x ^ c ) , \begin{aligned} \hat{\mathbf{x}}_{\mathbf{c}} & =\operatorname{Conv}_{3 \times 3}(\mathbf{x}) \\ \hat{\mathbf{x}}_{\mathbf{c t}} & =\operatorname{AvgPool}_{H^{2} \rightarrow n^{2} L}\left(\hat{\mathbf{x}}_{\mathbf{c}}\right), \end{aligned} x^cx^ct=Conv3×3(x)=AvgPoolH2→n