Skip to main content
QUICK REVIEW

[论文解读] MatteFormer: Transformer-Based Image Matting via Prior-Tokens

GyuTae Park, SungJoon Son|arXiv (Cornell University)|Mar 29, 2022
Image Enhancement Techniques被引用 6
一句话总结

本文提出 MatteFormer,一种基于 Transformer 的图像抠图模型,通过引入先验令牌(prior-tokens)——即对 trimap 区域(前景、背景、未知区域)的全局表征——并将其通过新型 PAST 模块整合到自注意力机制中,从而提升性能。该方法在 Composition-1k 和 Distinctions-646 数据集上取得最先进结果,在 Composition-1k 上达到 23.80 的 SAD 和 4.03 的 MSE,显著优于先前方法。

ABSTRACT

In this paper, we propose a transformer-based image matting model called MatteFormer, which takes full advantage of trimap information in the transformer block. Our method first introduces a prior-token which is a global representation of each trimap region (e.g. foreground, background and unknown). These prior-tokens are used as global priors and participate in the self-attention mechanism of each block. Each stage of the encoder is composed of PAST (Prior-Attentive Swin Transformer) block, which is based on the Swin Transformer block, but differs in a couple of aspects: 1) It has PA-WSA (Prior-Attentive Window Self-Attention) layer, performing self-attention not only with spatial-tokens but also with prior-tokens. 2) It has prior-memory which saves prior-tokens accumulatively from the previous blocks and transfers them to the next block. We evaluate our MatteFormer on the commonly used image matting datasets: Composition-1k and Distinctions-646. Experiment results show that our proposed method achieves state-of-the-art performance with a large margin. Our codes are available at https://github.com/webtoon/matteformer.

研究动机与目标

  • 开发一种基于 Transformer 的图像抠图架构,有效利用用户提供的 trimap 作为全局上下文信息。
  • 通过从 trimap 区域提取的先验令牌,解决标准 Transformer 在图像抠图任务中捕捉全局上下文的局限性。
  • 设计一种改进的 Swin Transformer 块(PAST),将先验令牌整合到自注意力机制中,以提升特征表示能力。
  • 在标准图像抠图基准上评估先验令牌、先验记忆机制以及整体架构的有效性。

提出的方法

  • 该方法将先验令牌作为来自 trimap 输入的每个区域(前景、背景、未知)的全局上下文嵌入。
  • 提出一种名为 PAST(Prior-Attentive Swin Transformer)的新模块,通过引入 PA-WSA(Prior-Attentive Window Self-Attention)扩展 Swin Transformer,使其同时关注空间令牌和先验令牌。
  • 先验记忆机制将前序编码器块中的先验令牌累积并传递至后续块,实现分层的全局上下文整合。
  • 模型采用简单的编码器-解码器架构并结合跳跃连接,其中在每个 PAST 模块中利用 trimap 信息生成先验令牌。
  • 由于 Transformer 编码器本身具有大的感受野,因此避免使用 ASPP(空洞空间金字塔池化),因其被发现是冗余的。
  • PA-WSA 中的自注意力机制在连接后的空间令牌与先验令牌集合上计算注意力,使局部特征能够关注到全局区域级别的先验信息。

实验结果

研究问题

  • RQ1从 trimap 区域提取的先验令牌是否能提升基于 Transformer 的图像抠图模型性能?
  • RQ2将全局先验信息整合到自注意力机制中,对图像抠图中的特征表示有何影响?
  • RQ3先验记忆机制是否增强了模型在编码器各阶段维持并传播全局上下文的能力?
  • RQ4在具有固有大感受野的基于 Transformer 的图像抠图模型中,ASPP 是否具有实际益处?
  • RQ5与标准 Swin Transformer 块相比,所提出的 PAST 模块在注意力动态和性能表现上如何?

主要发现

  • MatteFormer 在 Composition-1k 数据集上达到最先进水平的 SAD(23.80)和 MSE(4.03),显著优于先前方法。
  • 消融实验表明,加入先验令牌(尤其是未知区域的先验令牌)可使 SAD 相较于无先验令牌的基线模型降低最多 2.63 个点。
  • 先验记忆机制有助于性能提升,完整 MatteFormer 模型的 SAD 为 23.80,而无先验记忆的版本为 24.19。
  • 无 ASPP 的模型优于含 ASPP 的版本,表明在基于 Transformer 的编码器中,ASPP 因其固有的大感受野而显得冗余。
  • 注意力图可视化结果表明,先验令牌(尤其是未知区域的先验令牌)在多个注意力头中均受到显著关注,证实其具有信息量。
  • 尽管性能显著提升,模型仍保持较低的参数量(44.8M)和 FLOPs(57.2G),体现出良好的效率。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。