Hierarchical Prompt Injector for Domain Generalization Segmentation
Abstract
Domain Generalized Semantic Segmentation (DGSS) is achallenging task, as vision models often rely on low-level appearancecues that change across domains. In contrast, structural attributes ex-hibit cross-domain stability, motivating the use of structural priors forDGSS. Existing methods use prompt learning to transfer such priorsinto DGSS models, but typically encode each class as a single holisticprompt. Moreover, these methods apply prompts uniformly to all pixels,offering no mechanism to adapt when only a subset of object regions isvisible due to viewpoint changes, occlusion, and environmental variation.We address this with Spatial Hierarchical Prompts (SHP) that en-rich each class with region-level geometric anchors capturing structuralappearance from distinct viewing angles, ensuring complementary cov-erage under arbitrary viewpoints. Additionally, we propose the Hier-archical Prompt Injector (HPI), which enables spatially adaptiveprompt injection in foundation models. HPI spatially grounds promptsby modeling their semantic relevance and spatial influence with visualfeatures. Considering the difficulty of learning spatially and semanti-cally aware prompt injection, we further introduce auxiliary supervi-sion to align hierarchical prompts with their corresponding object re-gions. We achieve 70.62% and 72.74% mIoU on synthetic-to-real andreal-to-real benchmarks, respectively. Code and checkpoints are releasedat https://github.com/MosukFate/HPI.