deep learning 回帰学習データセットの作成方法

画像分類には,imagedatastoreを用いて,ラベルごとに画像を学習させていたのですが,
回帰学習に応用する場合にはclassificationlayer→regressionLayerに変換した上で,同様に画像入力の際にはimagedatastoreを使用できるのでしょうか.
また,各画像のラベルつけはどのようにしたら良いでしょうか.
上記の回帰のデータセットの作成時のように,画像とラベルを4次元配列にする必要があるのでしょうか.

 Accepted Answer

Kenta
Kenta on 11 Jun 2020
Edited: Kenta on 14 Jun 2020

1 vote

こんにちは、回帰の場合には、imagedatastoreではなく、画像を4次元配列にしたほうが簡単だと思います。その場合、正解ラベルはn×1のベクトルとして用意すれば大丈夫です。
ただ、datastoreにtransform関数を作用させて画像からの回帰をすることも可能かとは思います。ただ、コーディングの上で少し煩雑になる気もして、比較的簡単にできる、4次元配列を用いた回帰のほうがよいと思います。ただ、大規模なデータセットで行うとメモリに乗りきらない恐れもあるかと思います。

4 Comments

masakazu sugino
masakazu sugino on 14 Jun 2020
ありがとうございます.大変勉強になりました.
やはり,四次元配列にしたほうがよいのですね.
transform関数を作用させる方法も自分で勉強した上で応用していきたいと思います.
Kenta
Kenta on 14 Jun 2020
はい、お役に立ててよかったです。以上、imagedatastore自体は使わないという話になったとは思いますが、データ拡張(水増し)をする際は、4次元配列であっても、augment datastoreを介してうまくできます。https://jp.mathworks.com/help/deeplearning/ref/augmentedimagedatastore.html
masakazu sugino
masakazu sugino on 26 Jun 2020
私の理解が足りていないのかもしれないので,確認したいのですが,4次元配列は(画像の縦(~pixels),画像の横(~pixels),RGB(1or3),入力画像の数)でよいのでしょうか.
Kenta
Kenta on 26 Jun 2020
はい、そうです。

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2019b

Asked:

on 11 Jun 2020

Commented:

on 26 Jun 2020

Community Treasure Hunt

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

Start Hunting!