Extract Image Features for regression

2 visualizzazioni (ultimi 30 giorni)
Mehrdad Arashpour
Mehrdad Arashpour il 20 Mag 2021
Hello,
I have converted MobileNet to a regression Model by replacing relevant layers. Training and testing were successfully done and x,y coordinates of keypoints of interest are predicted.
Now I am trying to extract features of the trained network for prediction
layer='regressionoutput'
featuresTrain = activations(BodyEstimate,Train,layer,"OutputAs","rows")
featuresTest = activations(BodyEstimate,Test,layer,'OutputAs','rows')
whos featuresTrain
The code returns 'featresTrain' as 3011x2 single (2 is related to x,y ccordinates). I have been unsuccessful to fit a regression model using the following code:
regressor=fitrauto(featuresTrain,Y)
How should I prepare 'Response data' in 'Y', conseidering that responses are x,y coordinates of keypoints in images?
Thanks
  2 Commenti
Shashank Gupta
Shashank Gupta il 26 Mag 2021
Hi,
Help me understand few things, I am assuming it is supervised problem where you have the information of coordinates of keypoints in images, So what is stopping you to prepare the response data. I am trying to understand the difficulty in preparation. Also you mentioned, you changed some layers for MobileNet model and then train and test it, what exactly you train? what is the response data you used to train that model. It is unclear and not trivial for me to make any assumption or understand it. Help me understand it.
Cheers.
Mehrdad Arashpour
Mehrdad Arashpour il 27 Mag 2021
Hi Shashank,
Yes, this is supervised learning and the training is done by feeding a set of images and also a table containg 'image path' and x,y coordinates of keypoints (known). For validation and testing, there are 2 other sets of images and tables of coordinates.
The problem starts with fitrauto(featuresTrain,Y) since 'Y' cannot be a table. I have tried using matrix, double, vector... formats but it returns this error: 'Y should be a single or double vector'.
I have only succeeded to fit separate regression models for x and then y coordinates. Is there a way to define 'Y' so that one regression model predicts both x,y coordinates at once? The workflow is straightforward for classification but NOT for regression.
Thanks

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by