TL;DR
Painter is a generalist vision model that treats diverse computer vision tasks—from depth estimation to semantic segmentation—as a unified image-to-image "inpainting" problem. By training on stitched pairs of input and output images, the model achieves "in-context learning," allowing it to perform new or out-of-domain tasks simply by being shown a single example pair as a visual prompt.
What Problem Does This Paper Address?
In Natural Language Processing (NLP), models like GPT-3 have popularized "in-context learning," where a model performs a task based on a few examples provided in the prompt, without any weight updates. Achieving this in computer vision has been difficult because vision tasks are fragmented: semantic segmentation outputs category masks, depth estimation outputs continuous values, and keypoint detection outputs coordinates.
Traditionally, this required task-specific "heads" and specialized loss functions. While recent "generalist" vision models have tried to bridge this gap by converting vision tasks into sequences of discrete tokens (like language), this often leads to quantization errors and loses the inherent spatial structure of images. The authors of Painter ask: Can we create a generalist model that uses images themselves as the universal interface?
Methods
The core philosophy of Painter is that "images speak in images." The researchers reformulate diverse vision tasks into a single format: image inpainting.
- Redefining Outputs as Images: Every task's output is converted into a 3-channel RGB image.
- Depth Estimation: Continuous depth values are mapped to a [0, 255] integer range.
- Semantic Segmentation: Category IDs are mapped to specific RGB colors using a base-$b$ number system to ensure distinctness.
- Keypoint Detection: One channel represents a heatmap for localization, while the other two encode the keypoint category.
- Masked Image Modeling (MIM) on Stitched Pairs: During training, the model is fed a "stitch" of two image pairs from the same task. For example, it might see $[Input_1, Output_1, Input_2, Output_2]$ all in one large grid. A large portion (75%) of $Output_2$ is masked, and the model is trained to reconstruct these missing pixels.
- Architecture: The model uses a vanilla Vision Transformer (ViT) encoder (specifically ViT-Large) and a very simple three-layer head. To save computation, early features of the input and output images are merged after a few transformer blocks.
Datasets
Painter was trained and evaluated on a diverse suite of standard benchmarks:
- High-level understanding: NYUv2 (depth), ADE20K (semantic segmentation), and MS-COCO (instance/panoptic segmentation and human keypoints).
- Low-level processing: SIDD (denoising), LoL (low-light enhancement), and a merged dataset for image deraining.
- Generalization: The FSS-1000 dataset was used to test the model's ability to segment 1,000 novel, unseen object classes.
Key Insights and Ideas
- The Power of Visual Context: By training on pairs, the model learns to look at the "prompt" (the first pair) to understand the transformation required for the second pair. This enables in-context inference: to perform a new task at test time, you simply provide one example pair as a prompt.
- Continuous vs. Discrete: Unlike models that discretize vision into "words," Painter keeps the output space continuous and image-centric. This reduces quantization errors, which is particularly beneficial for regression-heavy tasks like depth estimation.
- Task Synergy: The authors found that joint training on multiple tasks generally improved performance compared to training on each task separately. This suggests that the model learns shared visual features that benefit both high-level semantics and low-level pixel restoration.
- Prompt Tuning for Vision: Just as NLP researchers "engineer" text prompts, the authors found they could optimize the visual prompt. By either searching for the best example pair in the training set or learning a set of "prompt tensors," they could significantly boost performance without changing the model's weights.
Key Results
Painter achieves highly competitive results across the board, often outperforming specialized models:
- Depth Estimation: Set a new state-of-the-art on NYUv2 with an RMSE of 0.288, significantly beating the previous best specialized model, BinsFormer (0.330).
- Keypoint Detection: Outperformed the generalist Pix2Seq v2 by 7.3 AP on COCO.
- Generalization: The model successfully performed "out-of-domain" tasks it was never explicitly trained for, such as segmenting a koala or detecting keypoints on a horse, simply by being shown one example.
Limitations and Future Work
While Painter is a powerful generalist, the authors note a few hurdles:
- Panoptic Segmentation: Performance on this complex task still lags behind the best specialized models (like Mask2Former), partly due to the lower input resolution ($448 \times 448$) used by Painter compared to the $1024 \times 1024$ typically used by specialists.
- Language Integration: The current image-only interface isn't naturally suited for tasks involving language instructions. Finding a way to unify continuous visual signals with discrete language tokens remains an open challenge.
- The "GPT-3 Moment": The authors view Painter as a step toward a true "GPT-3 moment" for vision, where a single model can handle any visual task through simple prompting.
Summary updated