Semantic Instance Segmentation via Deep Metric Learning

Alireza Fathi, Zbigniew Wojna, Vivek Rathod, Peng Wang, Hyun Oh Song, Sergio Guadarrama, Kevin P. MurphyarXiv 2017

Abstract

We propose a new method for semantic instance segmentation, by first computing how likely two pixels are to belong to the same object, and then by grouping similar pixels together. Our similarity metric is based on a deep, fully convolutional embedding model. Our grouping method is based on selecting all points that are sufficiently similar to a set of "seed points", chosen from a deep, fully convolutional scoring model. We show competitive results on the Pascal VOC instance segmentation benchmark.

Introduction

Instance segmentation—the task of identifying and masking every individual object in an image—has traditionally been dominated by top-down, proposal-based methods. These approaches typically detect a bounding box first and then segment the pixels within it. However, bounding boxes are often poor representations for "spindly" or overlapping objects, such as a person's limbs or a chair's legs.

This paper introduces a "box-free" alternative that leverages deep metric learning to map every pixel into a high-dimensional embedding space. By grouping pixels that are close together in this space around automatically discovered "seed points," the model can segment complex, non-rectangular objects more naturally than traditional methods. This approach addresses the semantic consistency challenge of bottom-up methods, ensuring that disparate parts of an object (like a person's shirt and pants) are recognized as a single instance.

Methodology

The proposed architecture is built upon a fully convolutional network (DeepLab v2 with a ResNet-101 backbone) featuring two specialized output heads: the Embedding Head and the Classification/Seediness Head.

Overview of the proposed instance segmentation pipeline, showing the dual-head architecture for embeddings and seediness scores.

The Embedding Head

The Embedding Head maps each pixel to a 64-dimensional vector. The network is trained using a similarity metric: if two pixels belong to the same object instance, their vectors should be close together; if they belong to different instances or the background, they should be far apart. The loss function employs sigmoid cross-entropy on the distance between pairs of sampled pixels, forcing the network to learn a feature space where "belonging to the same object" is the primary distance metric.

The Classification and Seediness Head

This head predicts two critical values for every pixel:

  1. Category: The object class (e.g., "cow," "car") the resulting mask would belong to if it originated at this pixel.
  2. Seediness: A score representing how "typical" or central a pixel is to its object. High seediness indicates a pixel is an ideal starting point for growing a mask.

Inference and Mask Generation

During inference, the model generates embedding vectors and a seediness map. It greedily selects the most "seedy" pixels as starting points (seeds). To ensure diversity, seeds are chosen such that they are distant from one another in the embedding space. For each seed, a mask is "grown" by selecting all pixels whose embedding vectors are sufficiently similar to the seed's vector. This process is highly efficient; by only computing distances between pixels and a few hundred seed points, the operation is reduced to a fast tensor multiplication.

Key Insights

A major advantage of this method is its move beyond geometric centers. Many objects, such as a "U" shaped pipe or a person sitting, lack a well-defined geometric center. "Seediness" provides a more robust metric for identifying starting points for segmentation. Furthermore, the high-dimensional embedding space allows the network to resolve complex overlaps. Two pixels may be adjacent in image space but distant in embedding space if they belong to different instances.

Visualization of the learned embedding space across various categories. Pixels belonging to the same instance are mapped to similar colors.

Results and Evaluation

The model was evaluated on the PASCAL VOC 2012 validation set, achieving a competitive 62.21% mAP (mean Average Precision) at a 0.5 IoU threshold. At the time of publication, this significantly outperformed previous proposal-free methods. The authors also demonstrated that their seed-selection strategy is highly efficient, with the top 100 seeds being sufficient to cover nearly all objects in an image. Qualitatively, the method proved particularly adept at segmenting large, complex objects like trains and dogs.

Limitations and Future Work

Despite its success, the model encountered difficulties with specific categories, most notably bicycles. This was attributed to a discrepancy in training data: training masks were often coarse "blobs," while evaluation required fine segmentation of individual spokes. This mismatch confused the metric learning process. Future work may involve making the region-growing step fully differentiable to allow for end-to-end training and exploring ways to reduce the computational overhead of the current multi-scale image pyramid approach.

Summary updated

BibTeX
@misc{fathi2017semantic,
  author = {Alireza Fathi and Zbigniew Wojna and Vivek Rathod and Peng Wang and Hyun Oh Song and Sergio Guadarrama and Kevin P. Murphy},
  title = {{Semantic Instance Segmentation via Deep Metric Learning}},
  year = {2017},
  eprint = {1703.10277},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.10277},
}
Figure