Prompt-and-Transfer: Dynamic Class-aware Enhancement for Few-shot Segmentation
Hanbo Bi, Yingchao Feng, Wenhui Diao, Peijin Wang, Yongqiang Mao, Kun Fu, Hongqi Wang, Xian Sun
TL;DR
This work tackles the limitation of fixed, class-agnostic encoders in few-shot segmentation by introducing PAT, a prompt-driven framework that dynamically tunes the encoder to the target class in a given task. PAT leverages cross-modal language initialization (via CLIP), Semantic Prompt Transfer (SPT) with Gaussian suppression, and Part Mask Generator (PMG) to produce diverse, region-specific prompts that steer the encoder toward task-relevant objects. Through iterative prompting and transferring across the encoder, PAT achieves state-of-the-art results on standard FSS benchmarks and demonstrates strong cross-domain, weak-label, and zero-shot performance, underscoring its versatility and practical impact. The approach shifts emphasis from decoder-centric improvements to adaptive, class-aware encoding, offering a scalable path for robust generalization in flexible segmentation scenarios.
Abstract
For more efficient generalization to unseen domains (classes), most Few-shot Segmentation (FSS) would directly exploit pre-trained encoders and only fine-tune the decoder, especially in the current era of large models. However, such fixed feature encoders tend to be class-agnostic, inevitably activating objects that are irrelevant to the target class. In contrast, humans can effortlessly focus on specific objects in the line of sight. This paper mimics the visual perception pattern of human beings and proposes a novel and powerful prompt-driven scheme, called ``Prompt and Transfer" (PAT), which constructs a dynamic class-aware prompting paradigm to tune the encoder for focusing on the interested object (target class) in the current task. Three key points are elaborated to enhance the prompting: 1) Cross-modal linguistic information is introduced to initialize prompts for each task. 2) Semantic Prompt Transfer (SPT) that precisely transfers the class-specific semantics within the images to prompts. 3) Part Mask Generator (PMG) that works in conjunction with SPT to adaptively generate different but complementary part prompts for different individuals. Surprisingly, PAT achieves competitive performance on 4 different tasks including standard FSS, Cross-domain FSS (e.g., CV, medical, and remote sensing domains), Weak-label FSS, and Zero-shot Segmentation, setting new state-of-the-arts on 11 benchmarks.
