Multi stream CNN implementation

2 ビュー (過去 30 日間)
Rd
Rd 2020 年 11 月 19 日
コメント済み: Ankita Jain 2022 年 3 月 3 日
i have designed CNN and it is trained with dataset stored in XTrain image datastore.
layers = [
imageInputLayer([227 227 3],"Name","imageinput")
.
.
.
averagePooling2dLayer([5 5],"Name","avgpool2d_5","Padding","same","Stride",[2 2])
fullyConnectedLayer(10,"Name","fc")
softmaxLayer("Name","softmax")
classificationLayer("Name","classoutput")];
options = trainingOptions('sgdm', ...
'LearnRateSchedule','piecewise', ...
'InitialLearnRate',0.01, ...
'ValidationFrequency',10,...
'MaxEpochs',10, ...
'MiniBatchSize',10, ...
'ValidationData',{input,testinput},...
'Plots','training-progress')
[net, traininfo] = trainNetwork(input,layers,options);
YPred = classify(net,testinput);
accuracy = mean(YPred==YTest)
confusion = plotconfusion(YTest,YPred)
I got a good result.
I have to train my CNN with three different datasets namely input_in, input_mid, input_rin. Reference block is attached below.
After last pooling layer i have to concatenate the features. Then fully connect, softmax and classification layer should appear.
i have try like this:
deepnet1=Layer(input_in);
deepnet2=Layer(input_mid);
deepnet3=Layer(input_rin);
deepnet4=createLayerFullyConnect(numHiddenDimension);
function deepnet=createLayerFullyConnect(numHiddenDimension)
layers = [
imageInputLayer([1 numHiddenDimension*3 1],"Name","imageinput","Normalization","none")
fullyConnectedLayer(30,"Name","fc_1")
fullyConnectedLayer(20,"Name","fc_2")
fullyConnectedLayer(10,"Name","fc_3")];
lgraph = layerGraph(layers);
deepnet = dlnetwork(lgraph);
end
I don't know how to train same network with different images and concatenate them after training. Any help is appriciated. Thanks in advnace.
Regards,
Ramasenthil.
  1 件のコメント
Ankita Jain
Ankita Jain 2022 年 3 月 3 日
Hey.. did you solve this problem? Any help would be appreciated.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by