<p>ROI (region of interest) layer is introduced in <a href="https://arxiv.org/pdf/1504.08083.pdf" rel="noreferrer">Fast R-CNN</a> and is a special case of spatial pyramid pooling layer which is introduced in <a href="https://arxiv.org/pdf/1406.4729.pdf" rel="noreferrer">Spatial Pyramid Pooling in Deep Convolutional
Networks for Visual Recognition</a>. The main function of ROI layer is reshape inputs with arbitrary size into a fixed length output because of size constraint in Fully Connected layers. </p>

<p>How ROI layer works is showed below:</p>

<p><a href="https://i.stack.imgur.com/4uCN1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4uCN1.png" alt="enter image description here"></a></p>

<p>In this image, the input image with arbitrary size is fed into this layer which has 3 different window: 4x4 (blue), 2x2 (green), 1x1 (gray) to produce outputs with fixed size of 16 x F, 4 x F, and 1 x F, respectively, where F is the number of filters. Then, those outputs are concatenated into a vector to be fed to Fully Connected layer. </p>
What is the purpose of the ROI layer in a Fast R-CNN?
<p>In <a href="https://leonardoaraujosantos.gitbooks.io/artificial-inteligence/content/object_localization_and_detection.html" rel="noreferrer">this</a> tutorial about object detection, the fast R-CNN is mentioned. The ROI (region of interest) layer is also mentioned.</p>

<p>What is happening, mathematically, when region proposals get resized according to final convolution layer activation functions (in each cell)?</p>