Reputation: 323
I am training Faster R-CNN to detect small objects from UAV photography: 25x25 to 30x30 pixels. So far, I have done this with the default anchor dimensions given in the .config file:
first_stage_anchor_generator {
grid_anchor_generator {
height_stride: 16
width_stride: 16
scales: 0.25
scales: 0.5
scales: 1.0
scales: 2.0
aspect_ratios: 0.5
aspect_ratios: 1.0
aspect_ratios: 2.0
However, I read in the literature the following:
The original Faster-RCNN model parameters are trained on datasets taken with front-view datasets so we retrained the models by reducing the size of anchors to (8, 16, 32, 64, 128) to fit the top view UAV images better. This combination of the network and its modifications significantly improved the accuracy and recall rate of the model on our datasets.
I have been reading a lot through the websites but still cannot figure out exactly which parameters should I modify to adjust the anchor sizes to the ones suggested by the literature, (8, 16, 32, 64, 128).
Any help would be very appreciated!
Upvotes: 0
Views: 1266
Reputation: 1
You can find the default values for grid anchor generator in the grid_anchor_generator.proto . Shown as below
message GridAnchorGenerator {
// Anchor height in pixels.
optional int32 height = 1 [default = 256];
// Anchor width in pixels.
optional int32 width = 2 [default = 256];
I think, adding parameters below to faster r-cnn config file will solve your problem.
first_stage_anchor_generator {
grid_anchor_generator {
scales: [1.0, 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ]
aspect_ratios: [0.5, 1.0, 2.0]
height_stride: 16
width_stride: 16
height: 8 # or you can change any value you desired (default = 256)
width: 8 # or you can change any value you desired (default = 256)
}
}
Upvotes: 0