Bad object classification with faster-rcnn

Hey.

I’m using faster-rcnn for custom object detection.
If the network results in bad classification (the bounding box is classified correctly with a right category but has a low probability or the bounding box is not classified correctly) but not so bad detection (it finds most of the correct bounding boxes plus some incorrect ones) can I freeze all the network except for last classifier stage and train only it or it’s more complex than that?

Thanks.

1 Like

Yes when you define the optimizer you can do this

optimizer = optim.Adam(model.roi_heads.box_predictor.cls_score.parameters())

and it will only train the cls_score layer.

2 Likes

Thanks for your answer.

I have another question.
I see the following lines of code of faster-rcnn in torchvision:

anchor_sizes = ((32,), (64,), (128,), (256,), (512,))
aspect_ratios = ((0.5, 1.0, 2.0),) * len(anchor_sizes)

I’m trying to detect manufacter logos/text labels.
They always have small enough size.
Does it mean that I should try to decrease my the rpn anchor_sizes for that case ( since at the moment I also have a problem finding small size bounding boxes) or this settings shouldn’t be changed?

It should still be able to learn smaller boxes but you could mess around with them just to see.

1 Like