Clear Filters
Clear Filters

Data format for multiple categories in R-CNN

1 view (last 30 days)
I am trying to train an R-CNN to identify objects of different categories in an image. However, there is one part in the official documentation that I do not understand. It is clear that one needs to increase the number of nodes in the last fully-connected layer to take the categories into account, but I cannot understand the explanation for how the training data table should be structured. It says;
'Labeled ground truth images, specified as a table with two or more columns. The first column must contain path and file names to images that are either grayscale or true color (RGB). The remaining columns must contain bounding boxes related to the corresponding image. Each column represents a single object class, such as a car, dog, flower, or stop sign.'
So each column after the first column corresponds to a category. But what if not every category is present in an image? Should the content in those columns just be an empty cell, or a [0 0 0 0] bounding box? Also, how should one define the bounding box if there are more than one instance of a category in the same image?

Accepted Answer

Farah Sarwar
Farah Sarwar on 1 May 2019
You can design ground truth data/table using "Image Labeler" app in Matlab (available in Image processing and computer vision tool box). Then you can export them in your workspace as a table or ground truth data. These bounding boxes are linked with respective image but are not over the image. You can create as many categories there as you want and annotate the whole data set as per your own requirement. Check following links for more guidance.
To view the same in MATLAB then use the following code:
annotation = 'box';
resultant_Img = insertObjectAnnotation(img1, 'rectangle', BoundingBoxes,annotation);
imagesc(resultant_Img)
But I hope that you have figured it out by now. :)
  1 Comment
Lucas Hedström
Lucas Hedström on 6 May 2019
Thank you for your answer!
I had a look at that tool. It however became unsuitable to use R-CNNs for my project due to the lack of experimental data, but thank you anyway!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!