TL;DR
TaskPrompter is a unified transformer framework that uses learnable "task prompts" to solve multiple dense prediction tasks (like segmentation and depth estimation) simultaneously. By embedding these prompts directly into every layer of the network, the model learns task-specific features and cross-task relationships in an end-to-end manner, achieving state-of-the-art results with impressive parameter efficiency.
What Problem Does This Paper Address?
In computer vision, "dense scene understanding" involves predicting a value for every pixel—think identifying objects (semantic segmentation), estimating distance (depth), or finding edges (boundary detection). Doing this for multiple tasks at once is called Multi-Task Learning (MTL).
The traditional approach to MTL involves a "shared" backbone for general features and "private" heads for task-specific ones, often with complex, hand-crafted "bridges" to help tasks talk to each other. The authors argue this is suboptimal. These separate modules decouple the learning process, making it harder for the model to use its full capacity to optimize all objectives together. The challenge is: how do we model task-generic features, task-specific features, and cross-task interactions all within the same network layers?
Methods
The authors introduce TaskPrompter, which treats tasks as learnable tokens (prompts) that travel alongside image tokens through a transformer.
- Spatial-Channel Task Prompts: For each task (e.g., depth), the model initializes a learnable "prompt" token. These tokens are concatenated with the standard image patch tokens.
- Spatial-Channel Task Prompt Learning: In every transformer layer, the prompts interact with image tokens across two dimensions:
- Spatial Interaction: Prompts attend to specific regions of the image to learn where task-relevant information is.
- Channel Interaction: Prompts attend to specific feature channels to learn what characteristics matter for that task. To prevent losing spatial structure during channel attention, they use a "window partition" strategy.
- Dense Prompt Decoding: Instead of using a heavy, separate decoder, TaskPrompter uses the attention maps (affinities) generated during the encoding process. It "queries" the shared image tokens using the learned task prompts to extract pixel-wise task-specific features.
- Cross-task Reweighting: The model looks at how task prompts attend to each other to model task relationships, effectively allowing the tasks to inform and refine one another's predictions.
Datasets
The model was evaluated on three major benchmarks:
- NYUD-v2: An indoor dataset featuring semantic segmentation, depth estimation, surface normals, and boundary detection.
- PASCAL-Context: An outdoor dataset featuring semantic segmentation, human parsing, saliency detection, surface normals, and boundary detection.
- Cityscapes-3D: A challenging urban driving dataset where the authors adapted the model to handle 3D object detection alongside segmentation and depth.
Key Insights and Ideas
- Affinities are Features: One of the most elegant "aha" moments is using the attention mechanism itself as the decoder. If a "segmentation prompt" attends strongly to a specific patch, that attention weight is essentially a task-specific feature.
- Unified Architecture: By putting task-specific logic (the prompts) inside the backbone, the model doesn't need complex architectural "wiring." The transformer's self-attention naturally handles the interaction between generic image data and specific task requirements.
- Scaling Efficiency: Because the bulk of the work is done by shared image tokens and the transformer layers, adding a new task is incredibly "cheap." Adding one task prompt is a negligible increase in parameters compared to adding an entire task-specific decoder head.
Key Results
TaskPrompter established new state-of-the-art (SOTA) performances across all tested benchmarks:
- Superior Accuracy: On NYUD-v2, it boosted semantic segmentation performance from the previous best of 53.56 to 55.30 mIoU. On PASCAL-Context, it improved segmentation from 79.03 to 80.89 mIoU.
- Parameter Efficiency: The model is remarkably scalable. Moving from a single-task model to a 5-task model on PASCAL-Context only increased the parameter count by 10.16% and FLOPs by 27.76%.
- Qualitative Clarity: Visualizations show that TaskPrompter produces much sharper details in segmentation boundaries and depth maps compared to previous transformer-based methods like InvPT.
Limitations and Future Work
While TaskPrompter performs exceptionally well, the authors note the "multi-task competition" issue—where tasks sometimes compete for model capacity, occasionally leading to a slight dip in a specific task's performance compared to a dedicated single-task model (though the overall "Multi-Task Gain" remains positive).
Future directions could include applying this prompting logic to even more diverse task sets (like combining 2D and 3D tasks more deeply) or exploring how these prompts could be used for "zero-shot" task adaptation where a model is prompted for a task it wasn't explicitly trained on.
Summary updated