[论文解读] OneFormer: One Transformer to Rule Universal Image Segmentation
OneFormer 提出了一种基于 Transformer 的统一框架,仅通过一次在全景分割标注数据上的训练,即在语义分割、实例分割和全景分割任务上均实现了最先进(SOTA)的性能。该方法采用任务条件化的联合训练策略,结合任务标记和查询-文本对比损失,实现多任务泛化,尽管训练资源仅为其他专用 Mask2Former 模型的三分之一,但在 ADE20K、Cityscapes 和 COCO 数据集上的表现仍优于后者。
Universal Image Segmentation is not a new concept. Past attempts to unify image segmentation in the last decades include scene parsing, panoptic segmentation, and, more recently, new panoptic architectures. However, such panoptic architectures do not truly unify image segmentation because they need to be trained individually on the semantic, instance, or panoptic segmentation to achieve the best performance. Ideally, a truly universal framework should be trained only once and achieve SOTA performance across all three image segmentation tasks. To that end, we propose OneFormer, a universal image segmentation framework that unifies segmentation with a multi-task train-once design. We first propose a task-conditioned joint training strategy that enables training on ground truths of each domain (semantic, instance, and panoptic segmentation) within a single multi-task training process. Secondly, we introduce a task token to condition our model on the task at hand, making our model task-dynamic to support multi-task training and inference. Thirdly, we propose using a query-text contrastive loss during training to establish better inter-task and inter-class distinctions. Notably, our single OneFormer model outperforms specialized Mask2Former models across all three segmentation tasks on ADE20k, CityScapes, and COCO, despite the latter being trained on each of the three tasks individually with three times the resources. With new ConvNeXt and DiNAT backbones, we observe even more performance improvement. We believe OneFormer is a significant step towards making image segmentation more universal and accessible. To support further research, we open-source our code and models at https://github.com/SHI-Labs/OneFormer
研究动机与目标
- 将语义分割、实例分割和全景分割任务统一于单一架构与模型之中。
- 消除为每项任务单独训练和存储模型的需求,降低资源消耗。
- 使单一模型能够在推理阶段动态适应不同分割任务。
- 通过任务引导的注意力机制和对比学习,增强联合训练中任务间与类别间的区分能力。
- 通过单一统一的训练过程,在所有三项分割任务上均实现最先进性能。
提出的方法
- 提出一种任务条件化的联合训练策略,在训练过程中对语义分割、实例分割和全景分割的真值样本进行均匀采样。
- 使用任务输入标记(如“任务是全景”)来条件化模型,使其能够基于单一模型实现任务动态推理。
- 通过学习到的查询与真实标签文本嵌入之间的查询-文本对比损失,增强任务间与类别间的判别能力。
- 在训练过程中,从全景标注中衍生出语义和实例标签,仅需全景数据集即可完成训练。
- 采用基于 Transformer 的架构,使用初始化为任务标记的可学习查询,实现动态任务特定特征学习。
- 采用文本提示模板“a photo with a {CLS}”生成类别特定的文本嵌入,消融实验表明其具备强大基线性能。
实验结果
研究问题
- RQ1为何现有全景分割架构在联合训练时无法在语义分割、实例分割和全景分割任务间实现良好泛化?
- RQ2如何使单一模型在无需单独训练的情况下,学习到任务间与类别间的有意义区分?
- RQ3任务条件化的输入标记与对比损失是否能提升通用图像分割中的多任务泛化能力?
- RQ4仅在全景数据上进行统一训练,其性能是否优于或可媲美使用更多资源进行任务专用训练的方案?
- RQ5单一模型是否能在推理阶段无需微调即可动态适应不同分割任务?
主要发现
- 在 ADE20K 上,OneFormer 实现了 49.8 PQ、35.9 AP 和 57.0 mIoU,优于分别针对每项任务单独训练的专用 Mask2Former 模型。
- 使用 Swin-L 主干网络时,OneFormer 在联合训练中相较 Mask2Former-Joint 基线,PQ 提升 +1.1%,AP 提升 +2.2%,mIoU 提升 +0.8%。
- 当输入提示为“the task is instance”时,OneFormer 实现 PQ 为 33.1,PQ^Th 为 48.8,表现出对独立物体实例的强聚焦能力。
- 在语义分割任务中,PQ^St 保持在 50.2% 的高水平,而 PQ^Th 降至 1.5%,证实了模型在“stuff”区域中抑制“thing”预测的能力。
- 定性结果表明,类别误分类现象减少——例如,将“fence”错误预测为“wall”的错误显著少于 Mask2Former。
- OneFormer 在 COCO、Cityscapes 和 ADE20K 上的所有三项分割任务中均实现了最先进性能,仅使用单一模型和三分之一的训练计算资源。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。