R-CNN
Regions with CNN features
R-CNN was the first major architecture to apply Convolutional Neural Networks to the task of object detection, paving the way for models like fast-r-cnn.
How it Works
The R-CNN architecture (Girshick et al., 2014) operates in four sequential steps:
- Region Proposal: Uses an external, non-neural algorithm called Selective Search to find about 2,000 regions (bounding boxes) that possibly contain objects in the image.
- Warping: Since CNNs require fixed-size inputs, each of these 2,000 regions is warped to a standard size (e.g., 227x227).
- Feature Extraction: The major breakthrough: each of the 2,000 regions is passed independently through a CNN (usually AlexNet) to extract a feature vector.
- Classification and Regression:
-
The feature vector is passed to linear SVMs (one for each class) to classify the object.
-
The vector also feeds a linear regressor that fine-tunes the bounding box coordinates. This regressor learns to transform the initial proposal into the predicted ground truth box through translations and log-space scale transformations:
Eq. 1: Translation and scale transformations in R-CNN's linear Bounding Box regression.
Where:
- : coordinates of the center , width, and height of the refined bounding box.
- : coordinates of the center , width, and height of the original region proposal .
- : linear transformations learned by the regressor (the predicted offsets or deltas).
-
The Problem with R-CNN (Why it evolved?)
Despite being revolutionary in accuracy, R-CNN had critical performance problems:
- ⚠️ Extremely Slow: Because the CNN runs independently for ~2,000 regions per image, there is no computation sharing. Inference took almost 50 seconds per image.
- ⚠️ Complex Training: It was a multi-stage pipeline (train the CNN, then SVMs, then regressors). It was not an end-to-end trained model.
Related: fast-r-cnn · object-detection