HGFormer: Hierarchical Grouping Transformer for Domain Generalized Semantic Segmentation

Jian Ding, Nan Xue, Guisong Xia, B. Schiele, Dengxin Dai
2/14/2026

No official code found. Best implementation: dingjiansw101/HGFormer (45 stars, last commit 2023-12-04).

Abstract

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/dingjianswl0l/HGFormer.

View on arXivView PDF

Code Implementations(1)

451C++, CudaFeb 16, 20232 years agoNOASSERTION

Similar Papers

Cite this paper

@article{ding2026hgformer,
  title  = {HGFormer: Hierarchical Grouping Transformer for Domain Generalized Semantic Segmentation},
  author = {Jian Ding and Nan Xue and Guisong Xia and B. Schiele and Dengxin Dai},
  year   = {2026},
  eprint = {2305.13031},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2305.13031},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.13031.svg)](https://codeofpaper.com/paper/2305.13031)

Discussion