Multi stream CNN implementation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/418923/image.png)
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 Kommentar
Antworten (0)
Siehe auch
Kategorien
Mehr zu Recognition, Object Detection, and Semantic Segmentation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!