> For the complete documentation index, see [llms.txt](https://jgoodman8.gitbook.io/iron-data-science-notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jgoodman8.gitbook.io/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/two-stage-detectors/fast-r-cnn.md).

# Fast R-CNN

Improvements w\.r.t. [R-CNN](/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/two-stage-detectors/r-cnn.md)are:

1. **ROI Pooling**: to extract an equal-length vector from all the proposed regions
2. **Single stage model**
3. Shares the CNN layers across all regions, thanks to the ROI Pooling.
4. No disk caching
5. Higher accuracy

<figure><img src="https://569842953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmjpNbCRLUyGiAxD8kn%2Fuploads%2F2bgj7aTnqKLmUc9HIWpi%2Fimage.png?alt=media&amp;token=bcb07a64-c1fd-4f94-8235-17e64cc50db2" alt=""><figcaption></figcaption></figure>

The feature map from the last convolutional layer is fed to an ROI Pooling layer to extract a fixed-length vector from each region. ROI Pooling splits the region in a grid and applies **max pooling** on each cell.

For further info, check the [ROI Pooling](/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/techniques/roi-pooling.md) section.

The ROI Pooling output is fed into a FC layer that splits into two branches:

1. **Softmax layer** to predict class scores
2. **FC layer** with a regression head to predict bounding boxes

**Drawbacks**

* Depends on Selective Search -> very slow
