# Fast R-CNN

Improvements w\.r.t. [r-cnn](https://jgoodman8.gitbook.io/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/two-stage-detectors/r-cnn "mention")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&#x26;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](https://jgoodman8.gitbook.io/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/techniques/roi-pooling "mention") 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jgoodman8.gitbook.io/iron-data-science-notebook/ml-datascience/computer-vision/object-detection/two-stage-detectors/fast-r-cnn.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
