Mask R-CNN Architecture
What you'll learn: How Mask R-CNN extends Faster R-CNN by adding a parallel branch that predicts pixel-perfect masks for each detected object instance.
The Core Idea
Mask R-CNN takes the proven two-stage Faster R-CNN detector and adds a third parallel branch specifically for mask prediction. While Faster R-CNN gives you bounding boxes and class labels, Mask R-CNN simultaneously predicts a binary segmentation mask for each detected instance.
Think of it like upgrading from drawing rectangles around objects to carefully tracing their exact outline with pixel-level precision—all while still identifying what they are and where their bounding boxes lie.
The Architecture Extension
Mask R-CNN maintains Faster R-CNN's two stages:
- Region Proposal Network (RPN) generates candidate object locations
- Detection head classifies and refines bounding boxes
But it adds a crucial third head: a small fully convolutional network that operates on each RoI (Region of Interest) to predict a binary mask for that instance. This mask branch runs in parallel with the classification and bounding box regression branches.
Why This Works
The mask branch predicts a separate binary mask for each class, allowing the network to decouple mask prediction from classification. For a detected "person," it outputs a person-shaped mask; for a "car," a car-shaped mask. This per-class mask strategy avoids competition between classes and produces cleaner segmentations.
The masks are predicted at higher resolution than in semantic segmentation approaches, preserving fine details for each instance independently.
Key Takeaway: Mask R-CNN extends Faster R-CNN with a parallel mask prediction branch, enabling pixel-accurate instance segmentation by predicting binary masks alongside bounding boxes and class labels—achieving true instance-level understanding of images.