PIXELBANKv8.2.1
Menu
Back to Concepts
Instance Segmentation2017

Mask R-CNN

Instance Segmentation Framework

Kaiming He, Georgia Gkioxari, Piotr Dollar, Ross Girshick

Read the Paper on arXiv

Paper Overview

Mask R-CNN extends Faster R-CNN by adding a parallel branch for predicting per-instance segmentation masks, achieving state-of-the-art instance segmentation while maintaining the speed of the two-stage detection framework.

The architecture follows a clear data flow: an input image (e.g., 800x1024) passes through a ResNet-50-FPN or ResNet-101-FPN backbone producing multi-scale feature maps (P2 through P5 at strides 4, 8, 16, 32 respectively, each with 256 channels). A Region Proposal Network generates ~1000 proposals per FPN level, which are filtered to ~300 via NMS. Each proposal is then processed by RoIAlign to extract fixed-size features (7x7x256 for classification/box heads, 14x14x256 for the mask head). Three parallel heads produce the final outputs: class probabilities over K+1 categories, 4 bounding box regression offsets, and K binary masks at 28x28 resolution.

The key insight is that adding a small fully convolutional network (FCN) that predicts a binary mask for each Region of Interest (RoI), running in parallel with the existing classification and bounding box heads, requires minimal additional computation (~20% overhead) while enabling pixel-precise segmentation. Critically, the mask head predicts K independent binary masks rather than a single K-way softmax mask, decoupling mask prediction from classification and eliminating inter-class competition.

Key advances:

  • RoIAlign: Replaces RoI Pooling's integer quantization with bilinear interpolation at exact floating-point coordinates, fixing spatial misalignment that costs ~3 AP in mask quality
  • Parallel mask branch: Per-class binary masks decoupled from classification -- K independent masks, not K-way softmax. This single design choice accounts for +3.6 AP improvement
  • Feature Pyramid Network (FPN): Top-down pathway with lateral connections creates 256-channel feature maps at 4 resolutions (strides 4/8/16/32), enabling detection of objects from ~20px to ~800px
  • Multi-task training: Joint loss (Lcls+Lbox+Lmask\mathcal{L}_{cls} + \mathcal{L}_{box} + \mathcal{L}_{mask}) with equal weighting improves all tasks vs. training separately -- the mask task regularizes the shared backbone
  • Generalizable framework: Same architecture handles instance segmentation, keypoint detection (K=17 for COCO human pose), panoptic segmentation, and DensePose by swapping only the prediction head

COCO benchmark results (ResNet-101-FPN backbone):

  • 37.1 AP on instance segmentation (mask), 39.8 AP on object detection (box)
  • 62.7 AP on keypoint detection using the same framework with a keypoint head
  • Runs at 5 FPS on a single GPU (Nvidia Tesla M40), with the mask branch adding only 20% overhead over Faster R-CNN
  • Total model parameters: ~44M (ResNet-50-FPN) or ~63M (ResNet-101-FPN)

Mask R-CNN established the "detect then segment" paradigm that became the foundation for Detectron2 and countless downstream applications in medical imaging, autonomous driving, robotics, and video analysis.

Chapter Roadmap

Click any topic to jump in

1
Two-Stage Pipeline

RPN proposes regions then a head classifies and refines them.

feeds
2
FPN

Multi-scale feature pyramid for detecting objects across sizes.

3
RoIAlign

Bilinear-interpolation pooling that preserves pixel alignment.

4
Mask Branch

Per-class FCN producing 28x28 masks per RoI.

enables
5
Multi-Task Loss

Joint classification, box regression, and mask losses.

6
Beyond Masks

Same head template extends to keypoints, person parsing, and more.

Premium Content

Upgrade to PixelBank Premium to unlock this content.