Deep Learning: How do I add regression ground truth data to an imageDatastore?

조회 수: 1 (최근 30일)
Tomas
Tomas 2017년 12월 13일
답변: Daniel Cohen 2021년 1월 13일
if I train my network with newnet=trainNetwork(imageDatastore_traindata,net,options) imageDatastore_traindata.Labels need to be categorical, i.e. not regression but classification labels. So for regression, it seems I need to use newnet=trainNetwork(X,Y,net,options)
and give my regression labels as Y, but then I can't use the imageDatastore as X, so I'll run into memory problems. Is there no way to do regression with an imageDatastore?
  댓글 수: 1
Bashar Saad
Bashar Saad 2018년 12월 28일
hi friend i have same the problem i do not know how to load my own dataset in deep learning could you help me plase ?

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

답변 (2개)

Amy
Amy 2017년 12월 19일
You can use an image datastore to get the image file names (without having to load the images from the dataset into memory at all), then create a table with the file names in the first column and your regressors in the other columns, and feed that into trainNetwork.
(see the trainedNet = trainNetwork(tbl,layers,options) syntax for trainNetwork.)
  댓글 수: 5
Simone Scaringi
Simone Scaringi 2020년 2월 20일
Also joining Christoph Block with same question: i.e. is there a way to parse the tbl argument and allow the trainNetwork function to read files using e.g. a custom ReadFcn ?
Simone Scaringi
Simone Scaringi 2020년 2월 21일
I've spent way too much time getting my head around this.
What I ended up doing to "fix" it, is to save my data files as .png images. In my case these are just 1D "images", but I guess you can save the 3D matrix as an image as well. If you do this then train proceeds as expected since the table with file paths have .png "images" in them.
Hope this helps to whoever reads this!

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


Daniel Cohen
Daniel Cohen 2021년 1월 13일
% trainedNet = trainNetwork(ds, layers, options) trains and returns a
% network trainedNet using the datastore ds. For single-input networks,
% the datastore read function must return a two-column table or
% two-column cell array, where the first column specifies the inputs to
% the network and the second column specifies the expected responses. For
% networks with multiple inputs, the datastore read function must return
% a cell array with N+1 columns, where N is the number of inputs. The
% first N columns correspond to the N inputs and the final column
% corresponds to the responses.
What what does that mean for this situation?

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by