(English)
This demo shows how to implement convolutional neural network (CNN) for image classification with multi-input. As an example, a dataset of hand-written digits called MNIST was divided into the upper half and down half as shown below and the upper and down part were fed into the multi input CNN.
(日本語)
2種類の画像を入力できる畳み込みニューラルネットワークのデモです。2つの入力層があって、例えば、入力層Aには、動物の顔の画像を入力し、入力層Bには、その動物の足の画像を入力する、などです。2019bバージョンからカスタムループと呼ばれる方法が可能になり、深層学習のより詳細なカスタマイズが可能となりました。簡単にためせるように、手書き数字の上半分と下半分をそれぞれ別の入力層からインプットし、畳み込みなどを行った後に得られた特徴量を結合させ、さらに全結合層などで計算を進めています。よりこの例に適切なデータや課題などがございましたら教えていただけると幸いです。まだまだ作りこみ不足なところもあり、今後も更新していければよいと考えています。
Kenta (2021). Image Classification using CNN with Multi Input 複数の入力層を持つCNN (https://www.mathworks.com/matlabcentral/fileexchange/74760-image-classification-using-cnn-with-multi-input-cnn), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Gret idea for fusion. I am going to follow your idea for my research. How can I use my SDUMLA finger vein database instead of DigitTrain4DArrayData?
how i can use my dataset (image)
you did a great job , i am asking for use your code with another dataset with only 2 classes
i am receiving this error
Error using dlfeval (line 43)
Size of predictions and target values
arguments must match.
Error in Run_TwoStreams (line 121)
[gradients1,gradients2,gradients3,loss]
=
dlfeval(@modelGradients_demo,dlnet1,dlnet2,dlnet3,dlX1,dlX2,dlarray(Y));
any sugeestions???
Great work.
When run the code, got the error message "The value of 'Name' is invalid. It must satisfy the function: iIsValidName." Any suggestion to solve it ? Thanks.
An interesting idea and a great example code. Thanks :)