How to combine trained classification and regression heads of a CNN during testing?

3 views (last 30 days)
I am building a 3 class object detector using CNN. Since my classes are less, I am using a smaller CNN called VGG-M which is pre-trained on ImageNet dataset. I am using transfer learning to train the model to act as a 3 class classifier as well as regressor. I trained the model for classification and regression by attaching the classification and regression heads respectively after the fully connected layers of the original model. However, during testing, I want my model should give me class of the object in the image as well as its bounding box. In Matlab 2017b, I am not able to find a suitable way of doing it. Experts are requested to suggest a solution. Thank you in advance!
  3 Comments
Krishna Bindumadhavan
Krishna Bindumadhavan on 16 Mar 2018
Could you try designing an object detector using Faster R-CNN? You can refer to the example here to get started.
Paresh Kamble
Paresh Kamble on 16 Mar 2018
I already tried object detectors based on RCNN, Fast RCNN and Faster RCNN for my application of ball detection and tracking. Object detector based on RCNN gave comparatively better results. Now, I am using pre-trained VGG-M architecture for designing my own detector. I have a students version of Matlab 2017b (upgraded to Matlab 2018a yesterday). Today, I tried to design a DAG using the above said architecture and with two outputs as discussed in main question. It is still not allowing two outputs in a DAG (though showing a provision in the link DAGNetwork). The error is _ Error using nnet.internal.cnn.util.validateLayersForLayerGraph>iAssertOnlyOneInputAndOutputLayer (line 75) Unable to add output layer to layer graph because the graph already contains one output layer. Layer graphs can contain only one output layer._ Kindly suggest a solution.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!