MATLAB Answers


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

Asked by Ravish Raj on 20 Jun 2017
Latest activity Answered by As Has on 20 Nov 2017
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])
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 Comment

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.

Sign in to comment.

1 Answer

Answer by As Has on 20 Nov 2017

hi sir did you find any solution for your problem , i have the same on


Sign in to comment.