What is a Region Proposal Network (RPN)?
A Region Proposal Network (RPN) is a small neural network that suggests which parts of an image might contain objects. In Faster R-CNN, it shares a backbone's feature maps with the final detector, so the detector does not need a separate, slow proposal algorithm.
How are region proposals generated?
- Extract shared features: A CNN backbone turns the image into a feature map.
- Score candidate locations: A small sliding convolution processes the feature map. For each reference anchor, an RPN head predicts an objectness score (object versus background) and four box adjustments.
- Form candidate proposals: Apply the predicted adjustments to obtain bounding boxes in image coordinates; clip boxes to image boundaries and discard invalid or very small candidates as configured.
- Rank and filter: Sort by objectness and retain a configured number of strong candidates. Apply non-maximum suppression (NMS) to reduce highly overlapping proposals, then keep a final proposal budget.
- Pass to the detector: A second-stage head extracts region-specific features, assigns the actual object class (for example, car or dog), and refines the box.
Important: The RPN predicts objectness, not whether a proposed object is a car, bicycle, or pedestrian. Final classification happens in the next detection stage.
Beginner-friendly numerical example
Imagine a feature map of `10 × 10 = 100` locations, with 3 candidate anchors per location.
- Initial candidates:
100 × 3 = 300possible boxes. - The RPN predicts 300 objectness scores and 300 sets of four box-adjustment values.
- Illustrative filtering: Keep the 100 highest-scoring valid proposals before NMS.
- Suppose NMS removes 70 because they overlap higher-scoring proposals too strongly. 30 proposals remain.
- The second stage evaluates these 30 candidate regions and might return 2 cars and 1 pedestrian after classification and final filtering.
The 100 → 30 filtering counts are illustrative, not fixed Faster R-CNN defaults. Real pre-NMS and post-NMS limits, objectness thresholds, and NMS overlap thresholds depend on the implementation and training/inference mode. The original Faster R-CNN demonstrated strong detection with 300 proposals per image.
Why is the RPN useful?
- Fewer regions for expensive processing: The second stage spends computation on promising locations rather than exhaustively classifying many windows.
- Feature sharing: The proposal network and the final detector reuse full-image CNN features.
- Jointly trainable pipeline: Proposal quality improves through supervised objectness and localization objectives, with implementation-specific training strategies.
How is it different from the previous concepts? Anchor boxes are possible *starting rectangles*, and bounding-box regression adjusts their coordinates. The RPN is the complete proposal-generation module that scores, filters, and sends candidate regions to a second-stage detector. Exact NMS mechanics are covered separately later.
Key takeaway: An RPN answers 'Where might any object be?'; the second-stage detector answers 'What is it, and exactly where is it?'
Sources & Research References
Learning Sequence
Deep Learning Curriculum
Explore Related Questions
Deepen your understanding across related Deep Learning topics.