Bounding boxe problems when use fasterRCNN with resnet50

6 views (last 30 days)
I used the same database to train model by fasterRCNN.
When I use resnet50 as the network, there comes a warning
'Invalid bounding boxes from 110 out of 477 training images were removed. The following rows in trainingData have invalid bounding box data' and
'Bounding boxes must be fully contained within their associated image and must have positive width and height.'
However, I don't meet this problem when use alexnet as the network.
I also check the bounding box in the list images, and guess may be some of the bounding box are lying the the boundary of the image.
So I pading the image by one pixel on each side and run again. But there still comes these warning but 74 out of 477 image were removed.
Because every time the training data were select randomly, I'm not sure if pading is helpful.
Is there some parameter should be modified in resnet50?

Answers (2)

Suprit Bansod
Suprit Bansod on 21 Nov 2018
Hi Mu..
The problem of Invalid bounding boxes is related to input image dimensions (x,y,w,h) which are provided as input to trainFasterRCNNObjectDetector command. In rcnnObjectDetector (one of internal) function "isValidROI" checks for every bounding box height and width, whether that bounding box fits within image boundary.
Make sure size of every bounding box must be less than image dimensions.
  3 Comments
Beatriz Martins
Beatriz Martins on 22 Dec 2019
I'm having the same problem, did you find the solution to this problem?
Jash Luna
Jash Luna on 19 Oct 2020
For the ROI layers to train properly, you must have some space between the edge selon les bounding boxes and the acutal edge. like if your image is 1000px by 1000 px, the actual edges are x = 0, x = 1000, y =0 y = 1000 but you shouldnt have a bounding box outside of x = 20,x = 980,y = 20,y=980(assuming 20px on each side).20 px on each side worked for me but depending on your model might be different for you.

Sign in to comment.


liangkui lin
liangkui lin on 14 Aug 2018
How to use resnet50 in fasterRCNN?

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!