Warm tip: This article is reproduced from serverfault.com, please click

Faster RCNN Anchor Generation

发布于 2020-12-05 08:27:31

I am trying to understand the concept of Faster RCNN.

For example, in an image(224×224), there are only two objects. To create a mini-batch of anchors of length 256(128-Foreground, 128-background) from the image, I get only 30 anchors which IOU is greater than 0.7 when compared with the ground truth bounding box.

In this situation, how should I make the foreground objects balanced with background?

Questioner
user12914245
Viewed
0
David S 2020-12-05 16:52:16

You can just get rid or set a predefined ratio between the foreground to the background.

In the following link, he set the ratio of foreground to background to be 1/3.

https://dongjk.github.io/code/object+detection/keras/2018/05/21/Faster_R-CNN_step_by_step,_Part_I.html

The github of this tutorial is:

https://github.com/dongjk/faster_rcnn_keras/blob/master/RPN.py

It's a full tutorial that walks through the steps before training a Faster-RCNN, in your case the RPN script in the GitHub has the solution you are after.

Note that you do not want a full balance but a reasonable ratio, because in most cases the background is the majority of the image in case of a very specific dataset that this is not the case.