How to increase the training and testing accuracy in CNN training?

5 ビュー (過去 30 日間)
Ravish Raj
Ravish Raj 2017 年 6 月 20 日
回答済み: Salma Hassan 2017 年 11 月 20 日
I am using MATLAB for CNN training. I have a data set of 27,000 images and angles corresponding to that images. My sample code is : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
layers = [imageInputLayer([32 32 1])
convolution2dLayer(5,50)
reluLayer()
maxPooling2dLayer(2,'Stride',2)
fullyConnectedLayer(size(categories(trainAngle)))
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', 'MaxEpochs', 50,'InitialLearnRate', 0.0003);
convnet = trainNetwork(trainZ, trainAngle, layers,options);
% trainZ is my 4D matrix of images and trainAngle is 2D array of angles corresponding to images!
resultant_Train = classify(convnet,trainZ); %Training data
resultant_Valid = classify(convnet,validZ); %Validation data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My training accuracy is 70%
but test accuracy is only 2%;
I am completely blank what to do next. Do you have any suggestion? How can I improve my test accuracy?
Can someone also suggest how can i use adam in place of sgdm in optimizer?
  1 件のコメント
MatlabUserN
MatlabUserN 2017 年 6 月 21 日
Well increase the number of layers. minimum number of network layers should be 7. Make the network denser as the name suggest deep CNN. increase the number of epochs.

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

回答 (1 件)

Salma Hassan
Salma Hassan 2017 年 11 月 20 日
hi sir did you find any solution for your problem , i have the same on

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by