Abstract
Few-shot segmentation (FSS) aims to segment novel object classes using only a few annotated examples. A significant challenge in FSS is the high variance of task-specific features, which complicates the generalization of decoders across different classes. This paper introduces the Task-Adaptive Feature Transformer (TAFT), a lightweight, plug-and-play module that maps volatile task-specific features into a stable, task-agnostic reference space. By utilizing a linear transformation based on the Moore-Penrose pseudo-inverse, TAFT standardizes features for the decoder. Experimental results on the PASCAL-5$^i$ benchmark demonstrate that TAFT, when integrated with a standard DeepLab V3+ architecture, achieves state-of-the-art performance, particularly in 5-shot scenarios.
Introduction
Semantic segmentation has traditionally relied on large-scale datasets with pixel-level annotations. However, the cost of such annotations limits the scalability of these models to new domains. Few-shot segmentation (FSS) addresses this by requiring only a small "support set" (typically 1 to 5 images) to segment a "query" image containing a novel class.
The primary difficulty in FSS lies in effectively conditioning the model on the support set. Common approaches involve extracting "prototypes"—mean feature vectors of the support classes—and comparing them to query features. However, these prototypes are highly sensitive to the specific support images provided, leading to inconsistent feature distributions that a fixed decoder may struggle to process.
Methods: Task-Adaptive Feature Transformer
The proposed Task-Adaptive Feature Transformer (TAFT) is designed to bridge the gap between task-specific encoders and task-agnostic decoders. It is a lightweight module that can be integrated into standard segmentation backbones like ResNet-50.
Linear Transformation and Reference Vectors
The core of TAFT is a linear transformation defined by a matrix $P$. For each task, the model computes:
- Prototypes ($c_k$): Mean feature vectors for foreground and background classes extracted from the support images using the encoder.
- Reference Vectors ($r_k$): Meta-learned parameters that represent a stable target for foreground and background features across all tasks.
- Transformation Matrix ($P$): Computed via a least-squares fit such that $P = RC^+$, where $C$ is the prototype matrix and $C^+$ is its Moore-Penrose pseudo-inverse.
This matrix $P$ is then applied to the high-level feature maps of the query image. This process "standardizes" the features, moving them into a space where the decoder can consistently distinguish between foreground and background, regardless of the specific semantic class.
Decoupling Semantics from Shape
A key design choice in TAFT is its application only to high-level features. High-level features contain semantic information that varies by class, whereas low-level features capture general geometric properties (edges, textures) that are inherently more task-agnostic. The authors found that applying TAFT to low-level features actually degraded performance, confirming that the module's strength lies in normalizing semantic variance.
Experimental Results
The model was evaluated on the PASCAL-5$^i$ dataset, a standard FSS benchmark derived from PASCAL VOC 2012. The dataset is split into four folds, with 15 classes for training and 5 for testing in each fold.
Quantitative Performance
TAFT combined with DeepLab V3+ sets a new state-of-the-art for the 5-shot setting on PASCAL-5$^i$.
As shown in the results table, TAFT achieves a mean mIoU of 63.5% in the 5-shot setting, outperforming previous methods like PGNet (58.5%) and CANet (57.1%). In terms of Binary IoU, the model reaches 76.8% (5-shot), demonstrating its robustness in binary foreground-background separation.
Qualitative Analysis
Qualitative results show that TAFT produces precise masks for a variety of classes, including aeroplanes, buses, and animals. The model maintains high accuracy even when there are significant differences in scale or lighting between the support and query images.
Conclusion and Future Work
TAFT provides a simple yet effective way to adapt standard segmentation architectures for few-shot learning. By using linear algebra to stabilize feature distributions, it allows decoders to generalize to novel classes with minimal additional parameters.
While the 5-shot performance is dominant, the 1-shot performance (52.1% mIoU) suggests that the transformation matrix $P$ can be sensitive to noise when only a single support example is available. Future research may focus on improving prototype robustness in extreme low-data regimes and extending TAFT to multi-way segmentation tasks where multiple novel classes must be identified simultaneously.
Summary updated