Abstract
Current instance segmentation methods can be categorized into segmentation-based methods that segment first then do clustering, and proposal-based methods that detect first then predict masks for each instance proposal using repooling. In this work, we propose a one-stage method, named EmbedMask, that unifies both methods by taking advantages of them. Like proposal-based methods, EmbedMask builds on top of detection models making it strong in detection capability. Meanwhile, EmbedMask applies extra embedding modules to generate embeddings for pixels and proposals, where pixel embeddings are guided by proposal embeddings if they belong to the same instance. Through this embedding coupling process, pixels are assigned to the mask of the proposal if their embeddings are similar. The pixel-level clustering enables EmbedMask to generate high-resolution masks without missing details from repooling, and the existence of proposal embedding simplifies and strengthens the clustering procedure to achieve high speed with higher performance than segmentation-based methods. Without any bells and whistles, EmbedMask achieves comparable performance as Mask R-CNN, which is the representative two-stage method, and can produce more detailed masks at a higher speed.
Introduction
Instance segmentation is a fundamental computer vision task that requires both object detection and pixel-level classification. Historically, the field has been divided into two primary approaches: top-down proposal-based methods and bottom-up segmentation-based methods.
Proposal-based methods, exemplified by Mask R-CNN, first detect bounding boxes and then perform RoIAlign to crop features for mask prediction. While robust, this cropping often leads to a loss of spatial resolution and fine details. Conversely, segmentation-based methods perform pixel-level segmentation first and then cluster pixels into instances. While they preserve detail, the clustering step is often complex and computationally expensive.
EmbedMask addresses these limitations by unifying both paradigms into a single-stage framework. It leverages the localization strength of detectors while maintaining the high-resolution detail of segmentation through a novel embedding coupling mechanism.
Methodology
EmbedMask is built upon the FCOS (Fully Convolutional One-Stage) detector. It extends the standard detection architecture with two specialized heads: a Pixel Head and a Proposal Head.
Pixel and Proposal Heads
The Pixel Head generates a high-resolution pixel embedding map for every pixel. Simultaneously, the Proposal Head generates a proposal embedding (a vector in the same $d$-dimensional space) and a learnable margin ($\sigma$) for each detected object proposal.
Embedding Coupling
The core innovation is the coupling of these embeddings. For a given proposal, the model treats the proposal embedding as a "cluster center." The mask is generated by calculating the similarity between the proposal embedding and the pixel embeddings within the proposal's bounding box. This approach eliminates the need for RoIAlign, allowing the model to produce masks that preserve the original image's fine-grained details.
Learnable Margins and Smooth Loss
Unlike previous embedding-based methods that used fixed thresholds, EmbedMask learns a per-instance margin. This flexibility allows the model to adapt to objects of varying sizes and shapes. Furthermore, a "Smooth Loss" is introduced during training to ensure consistency between the averaged embeddings used for optimization and the single-point embeddings used during inference.
Experimental Results
The authors evaluated EmbedMask on the COCO dataset, using the trainval35k set for training and test-dev for final benchmarking.
Quantitative Performance
On COCO test-dev, EmbedMask with a ResNet-101 backbone achieved a mask mAP of 37.7. This performance is competitive with the two-stage Mask R-CNN (38.1 mAP) but is achieved in a more efficient one-stage manner.
Speed and Quality
EmbedMask demonstrates a significant speed advantage, running at 13.7 FPS on a V100 GPU, compared to 8.7 FPS for Mask R-CNN. Qualitatively, EmbedMask produces masks with sharper boundaries and better detail preservation, avoiding the "blocky" artifacts often seen in RoIAlign-based methods.
Conclusion
EmbedMask successfully unifies proposal-based and segmentation-based instance segmentation. By coupling pixel and proposal embeddings through a learnable clustering process, it achieves high-quality, high-resolution masks at a faster inference speed than traditional two-stage methods. Future work may involve optimizing the backbone architecture and improving performance in highly crowded scenes with significant object overlap.
Summary updated