Current semantic segmentation models have achieved great success under the independent and identically distributed (i.i.d.) condition. However, in real-world applications, test data might come from a different domain than training data. Therefore, it is important to improve model robustness against domain differences. This work studies semantic segmentation under the domain generalization setting, where a model is trained only on the source domain and tested on the unseen target domain. Existing works show that Vision Transformers are more robust than CNNs and show that this is related to the visual grouping property of self-attention. In this work, we propose a novel hierarchical grouping transformer (HGFormer) to explicitly group pixels to form part-level masks and then whole-level masks. The masks at different scales aim to segment out both parts and a whole of classes. HGFormer combines mask classification results at both scales for class label prediction. We assemble multiple interesting cross-domain settings by using seven public semantic segmentation datasets. Experiments show that HGFormer yields more robust semantic segmentation results than per-pixel classification methods and flat grouping transformers, and outperforms previous methods significantly. Code will be available at https://github.com/dingjiansw101/HGFormer.
翻译:当前语义分割模型在独立同分布条件下已取得巨大成功。然而,在实际应用中,测试数据可能来自与训练数据不同的域,因此提升模型对域差异的鲁棒性至关重要。本文研究域泛化设置下的语义分割,即模型仅在源域上训练,并在未见过的目标域上测试。现有研究表明,Vision Transformer比CNN具有更强的鲁棒性,且这一特性与自注意力的视觉分组性质相关。本文提出一种新颖的分层分组Transformer(HGFormer),通过显式地对像素进行分组,先生成部件级掩码,再生成整体级掩码。不同尺度的掩码旨在同时分割类别的部件与整体。HGFormer融合两个尺度的掩码分类结果进行类别标签预测。我们利用七个公开语义分割数据集构建了多个有趣的跨域设置。实验表明,HGFormer比逐像素分类方法和扁平分组Transformer能产生更鲁棒的语义分割结果,并显著优于先前方法。代码将在https://github.com/dingjiansw101/HGFormer开源。