liveBook · Manning

RoI pooling

As explained in Math and Architectures of Deep Learning

A pooling operation that converts variable-sized proposed regions into a fixed-size representation for downstream detection layers.

RoI pooling extracts a fixed-sized feature representation from each variable-sized region proposal. A convolutional backbone processes the whole image once; proposed regions then reuse the resulting feature map instead of requiring a separate CNN pass per region. section 11.3.2 section 11.5

An RoI in image coordinates is mapped onto the convolutional feature map using the backbone's subsampling factor. The embeddings within that mapped region represent the corresponding input area, so features for every RoI can be gathered from one shared map. section 11.4.3

RoI pooling fits into two-stage detection as follows:

  • A region proposal network produces candidate RoIs from convolutional feature maps. section 11.3.3
  • Fully connected classifier and regressor layers consume the pooled features to predict object classes and bounding-box coordinates. section 11.4

Mapping a proposal to the feature map

With a subsampling factor of 16, an image-space RoI of (0, 0, 256, 256) maps to (0, 0, 16, 16) on the convolutional feature map. Pooling that feature-map region yields a fixed-sized representation even when other proposals have different dimensions. section 11.4.3

This shared computation removes R-CNN's repeated proposal-by-proposal forward passes. In Faster R-CNN, the RPN and R-CNN module also share convolutional layers, while the RoI head performs pooling before classification and localization. section 11.3.2 section 11.3.3

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains coordinate mapping from image regions to feature maps and illustrates fixed-size max-pooled outputs.
Examples
Uses a 256 × 256 RoI mapped through a factor-16 backbone and a 2 × 2 pooled-output diagram.
What it assumes
Assumes convolutional feature maps, receptive fields, max pooling, and a subsampling factor from image classification networks.
What you can do after
Apply it via torchvision.ops.roi_pool in a Fast R-CNN RoI head for classification and localization.
How it connects
Connects convolutional backbones, region proposal networks, feature maps, classification, bounding-box regression, and Fast R-CNN.

Also explained in

Compare how 2 books explain RoI pooling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.