← All answersObject detection concepts

How does a Region Proposal Network (RPN) work in Faster R-CNN?

Short answer

The RPN is a small network that slides over the backbone's feature map. At every location it looks at a fixed set of anchor boxes and outputs two things per anchor: an 'objectness' score (is there an object here or just background?) and four offsets that nudge the anchor toward the real object. The high-scoring, refined anchors become the region proposals passed to the second stage.

Faster R-CNN's key trick was making region proposals cheap by learning them inside the network instead of using a slow, hand-crafted method. The RPN is that learned proposer.

What it does at each location

  • Places k anchor boxes of different scales and aspect ratios centered on that point.
  • Predicts an objectness score for each anchor (object vs background).
  • Predicts 4 regression offsets that shift and resize the anchor to better fit an object.

After scoring every anchor across the feature map, non-max suppression trims the overlapping candidates, and the top few hundred proposals go to stage two for classification and final box refinement. So the RPN doesn't say what an object is, only where one probably is.

This is also the conceptual ancestor of anchors in one-stage detectors: same idea of pre-placed reference boxes, just used directly for the final prediction instead of feeding a second stage.

In practice

I bring up the RPN mainly so the anchor concept makes sense - because in real deployments I almost never reach for a two-stage detector. Faster R-CNN can edge out accuracy on small or dense objects, but the extra proposal stage kills the frame rate you need for live video, and modern one-stage YOLO models have closed most of the gap. Unless you're doing offline, accuracy-at-all-costs analysis, you'll ship one-stage.

Stuck on this in a real project?

Book a free call and I’ll give you a straight answer on your specific case.

Book a consultation