Learning to Segment Every Thing

Ronghang Hu, Piotr Dollár, Kaiming He, Trevor Darrell, Ross B. Girshick

Abstract

Most methods for object instance segmentation require all training examples to be labeled with segmentation masks. This requirement makes it expensive to annotate new categories and has restricted instance segmentation models to ~100 well-annotated classes. The goal of this paper is to propose a new partially supervised training paradigm, together with a novel weight transfer function, that enables training instance segmentation models on a large set of categories all of which have box annotations, but only a small fraction of which have mask annotations. These contributions allow us to train Mask R-CNN to detect and segment 3000 visual concepts using box annotations from the Visual Genome dataset and mask annotations from the 80 classes in the COCO dataset. We evaluate our approach in a controlled study on the COCO dataset. This work is a first step towards instance segmentation models that have broad comprehension of the visual world.

The Vocabulary Bottleneck in Instance Segmentation

Instance segmentation—the task of detecting objects and outlining their exact pixels—is notoriously data-hungry. While massive datasets exist for object detection (bounding boxes), very few exist for segmentation (masks) because masks are significantly more expensive and time-consuming to annotate.

Consequently, state-of-the-art models like Mask R-CNN are typically restricted to the ~80–100 categories found in datasets like COCO. This creates a "vocabulary bottleneck." This research addresses a fundamental question: Can we train a model to segment categories it has only ever seen in bounding boxes by leveraging what it learned from a small set of categories that do have masks?

Method: Mask$^X$ R-CNN and Weight Transfer

The authors propose a "partially supervised" training paradigm called Mask$^X$ R-CNN. It builds on the standard Mask R-CNN architecture but introduces a novel weight transfer function ($T$) to bridge the gap between detection and segmentation.

The Mask$^X$ R-CNN architecture uses a weight transfer function to predict mask weights from box weights.

Key Components:

  1. Weight Transfer: In a standard model, the "box head" (classification) and "mask head" (segmentation) have independent parameters. Mask$^X$ R-CNN assumes that the weights used to recognize an object’s appearance in a box ($w_{det}$) contain sufficient information to help predict how to segment it ($w_{seg}$).
  2. The Function $T$: A small neural network (a multi-layer perceptron) is trained to map $w_{det}$ to $w_{seg}$. During training, for classes with available masks, the model learns this mapping. At inference, the model takes the box weights of a new category and predicts the weights needed to segment it.
  3. Fused Mask Heads: Combining a standard Fully Convolutional Network (FCN) head with an MLP head improved results. The FCN captures fine spatial details, while the MLP captures the global shape of the object.
  4. The "Stop Gradient" Trick: To ensure generalization, the authors prevent mask loss from updating box weights via backpropagation. This keeps box weights as a pure representation of visual appearance.

Scaling to 3,000 Classes

The approach was validated using two primary datasets:

  • COCO: Used for controlled experiments where the 80 classes were split into "seen" (with masks) and "unseen" (only boxes) to measure transfer performance.
  • Visual Genome (VG): Used for a large-scale demonstration. VG contains over 7,000 categories with bounding boxes but zero masks. The authors successfully trained the model on 3,000 of these categories.
Qualitative results on Visual Genome showing the model's ability to segment diverse objects like knobs, burners, and handles.

Key Insights and Results

  • Significant Performance Gains: On the COCO dataset, Mask$^X$ R-CNN improved mask accuracy (AP) on "unseen" categories by up to 40% relative over a class-agnostic baseline.
  • Broad Visual Comprehension: The model demonstrated qualitative success on 3,000 classes in Visual Genome, segmenting complex concepts—like shadows, refrigerator handles, and paths—despite never seeing a single mask for those specific categories during training.
  • Appearance as an Embedding: The weights of a pre-trained object detector act as a high-dimensional "visual embedding." By learning a meta-function to transform these embeddings, the model can generalize segmentation knowledge from a "dog" to a visually similar but mask-less "cheetah."

Limitations and Future Work

While a major step forward, the model sometimes struggles with "stuff" categories (like forests) that lack well-defined boundaries compared to distinct "things" (like trees). Additionally, very fine details, such as the thin legs of a chair, can be missed if the transfer function doesn't capture those nuances from the box weights. Future research may explore incorporating bottom-up segmentation proposals or advanced visual-semantic embeddings to further bridge the supervision gap.

Summary updated

BibTeX
@inproceedings{hu2018learning,
  author = {Ronghang Hu and Piotr Dollár and Kaiming He and Trevor Darrell and Ross B. Girshick},
  title = {{Learning to Segment Every Thing}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=SkxOhRWObB},
}
Figure