[论文解读] Rethinking Patch Dependence for Masked Autoencoders
本文提出 CrossMAE,一种新型掩码自编码框架,用可见标记的交叉注意力替代掩码块之间的自注意力,实现部分重建并动态利用多层级编码器特征。CrossMAE 在性能上与或优于 MAE 的同时,将解码计算量减少 2.5–3.7 倍,表明块内掩码自注意力并非学习强表示的关键。
In this work, we examine the impact of inter-patch dependencies in the decoder of masked autoencoders (MAE) on representation learning. We decompose the decoding mechanism for masked reconstruction into self-attention between mask tokens and cross-attention between masked and visible tokens. Our findings reveal that MAE reconstructs coherent images from visible patches not through interactions between patches in the decoder but by learning a global representation within the encoder. This discovery leads us to propose a simple visual pretraining framework: cross-attention masked autoencoders (CrossMAE). This framework employs only cross-attention in the decoder to independently read out reconstructions for a small subset of masked patches from encoder outputs. This approach achieves comparable or superior performance to traditional MAE across models ranging from ViT-S to ViT-H and significantly reduces computational requirements. By its design, CrossMAE challenges the necessity of interaction between mask tokens for effective masked pretraining. Code and models are publicly available: https://crossmae.github.io
研究动机与目标
- 探究 MAE 中掩码块之间的自注意力是否对学习有效视觉表征至关重要。
- 通过仅重建部分掩码标记,降低掩码自编码中的计算成本。
- 通过允许解码器块关注多个层级的编码器特征(而不仅最后层),提升表征学习能力。
- 通过减少解码器中的序列长度和 FLOPS,使掩码自编码可扩展至更长序列(如高分辨率图像或视频)
提出的方法
- 用一种查询可见标记以重建掩码块的交叉注意力机制,替代 MAE 中标准的自注意力解码器。
- 通过使每个掩码标记的解码条件独立,实现部分重建,从而在训练期间仅重建部分补丁。
- 引入一种轻量级的块间注意力机制,使每个解码器块能够动态关注不同层级的编码器特征图(来自早期和晚期块)。
- 使用残差连接和线性重建头,将最终重建分解为每个解码器块的贡献,实现逐块可视化。
- 在主要实验中采用 25% 的预测比例,以在保持性能的同时提升效率。
- 可视化注意力图和逐块贡献,分析不同解码器块及编码器特征对重建的贡献。

实验结果
研究问题
- RQ1掩码块之间的自注意力在掩码自编码器中是否真正对学习强视觉表征至关重要?
- RQ2解码器是否能在不牺牲下游性能的前提下,仅重建部分掩码块?
- RQ3通过块间注意力利用多层级编码器特征,是否相比仅使用最后一层编码器特征能提升表征学习?
- RQ4该模型是否能通过降低计算成本,扩展至更长输入序列(如高分辨率图像)?
主要发现
- CrossMAE 在 ImageNet 分类任务上达到 83.5% 的 top-1 准确率,超过全重建 MAE 基线。
- 在 COCO 实例分割任务上,CrossMAE 达到 52.1 AP 和 46.3 AP,与相同计算预算下的 MAE 相比表现更优。
- CrossMAE 相较于 MAE 将解码 FLOPS 减少 2.5 至 3.7 倍,同时保持或提升性能。
- 该模型在长序列上泛化良好:在 224×224 分辨率下准确率为 83.5%,在 448×448 分辨率下提升至 84.1%,显示出良好的可扩展性。
- 逐块可视化显示,后期解码器块对高频细节贡献最大,验证了多层级特征融合的必要性。
- 块间注意力图显示,后期解码器块关注早期编码器特征,而早期解码器块关注后期特征,证实了动态特征混合的存在。
![Figure 2 : Example reconstructions of ImageNet validation images. For each set of 5 images, from left to right, are the original image, masked image with a mask ratio of 75%, MAE [ 31 ] , CrossMAE (trained to reconstruct 25% of image tokens, or 1/3 of the mask tokens), and CrossMAE (trained to recon](https://ar5iv.labs.arxiv.org/html/2401.14391/assets/x2.png)
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。