how to improve accuracy in matlab.?

조회 수: 4 (최근 30일)
Ronak Patel
Ronak Patel 2020년 5월 30일
편집: vaibhav mishra 2020년 6월 30일
Here code below attachment its my accuracy image i want accuracy 90% above can u help how to improve my accuracy.?
clear
clc
imds = imageDatastore('E:\MATLAB\coursework\dataset\BloodCellDataSet','IncludeSubfolders',true, ...
'FileExtensions','.jpeg','LabelSource','foldernames');
figure;
perm = randperm(9957,20);
for i = 1:20
subplot(4,5,i);
%imshow(imds.Files{i});
imshow(imds.Files{perm(i)});
end
label = countEachLabel(imds);
minsetcount = min(imds.countEachLabel{:,2});
trainingNumfiles = round(minsetcount);
rng(1);
[imdsTrain,imdsValidation] = splitEachLabel(imds,trainingNumfiles,'randomize');
inputSize=[240 320 3];
netLayers = [
imageInputLayer(inputSize)
convolution2dLayer(3,8,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(4)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'InitialLearnRate',0.001, ...
'MaxEpochs',6, ...
'Shuffle','every-epoch', ...
'ValidationData',imdsValidation, ...
'ValidationFrequency',30, ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(imdsTrain,netLayers,options);
YPred = classify(net,imdsValidation);
YValidation = imdsValidation.Labels;
accuracy = sum(YPred == YValidation)/numel(YValidation);
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 5월 30일
I used to be involved with a lot of data classification work. We never got into Deep Learning, but with the other techniques we used, even with complicated automatic determination of methods, getting 90% or more was very rare. Getting above roughly 84% was uncommon

댓글을 달려면 로그인하십시오.

답변 (1개)

vaibhav mishra
vaibhav mishra 2020년 6월 30일
편집: vaibhav mishra 2020년 6월 30일
hi, ways to improve your validation accuracy are to apply regularization on your loss, or to apply some dropout so that model generalizes well and if possible try to decrease the learning rate, or use more training data.
You can use above methods to see the increase in your accuracy.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by