This paper presents Contrastive Transformer, a contrastive learning scheme using the Transformer innate patches. Contrastive Transformer enables existing contrastive learning techniques, often used for image classification, to benefit dense downstream prediction tasks such as semantic segmentation. The scheme performs supervised patch-level contrastive learning, selecting the patches based on the ground truth mask, subsequently used for hard-negative and hard-positive sampling. The scheme applies to all vision-transformer architectures, is easy to implement, and introduces minimal additional memory footprint. Additionally, the scheme removes the need for huge batch sizes, as each patch is treated as an image. We apply and test Contrastive Transformer for the case of aerial image segmentation, known for low-resolution data, large class imbalance, and similar semantic classes. We perform extensive experiments to show the efficacy of the Contrastive Transformer scheme on the ISPRS Potsdam aerial image segmentation dataset. Additionally, we show the generalizability of our scheme by applying it to multiple inherently different Transformer architectures. Ultimately, the results show a consistent increase in mean IoU across all classes.
翻译:本文提出了对比Transformer(Contrastive Transformer),一种利用Transformer固有补丁的对比学习方案。该方案使常用于图像分类的现有对比学习技术能够惠及密集下游预测任务(如语义分割)。该方法在监督性补丁级别执行对比学习,基于真实标签掩码选择补丁,并随后用于困难负样本与困难正样本采样。该方案适用于所有视觉Transformer架构,易于实现,且仅引入极小的额外内存开销。此外,该方法将每个补丁视为独立图像,从而消除了对大批量大小的需求。我们针对低分辨率数据、严重类别不平衡及语义类别相似的航拍图像分割任务,应用并测试了对比Transformer。通过在ISPRS Potsdam航拍图像分割数据集上进行大量实验,验证了对比Transformer方案的有效性。同时,通过将该方案应用于多个本质不同的Transformer架构,证明了其泛化能力。最终结果表明,所有类别的平均交并比(mean IoU)均获得一致提升。