MATLAB Answers

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

조회 수: 13(최근 30일)
Paresh Kamble
Paresh Kamble 8 Mar 2018
댓글: Paresh Kamble 16 Mar 2018
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

Paresh Kamble
Paresh Kamble 9 Mar 2018
I tried using DAG for testing the CNN, but it does not allow two output layers (classification head and regression head). How should I proceed? Any suggestions?
Krishna Bindumadhavan
Krishna Bindumadhavan 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 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.

댓글을 달려면 로그인하십시오.


Community Treasure Hunt

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

Start Hunting!

Translated by