how to improve accuracy in matlab.?
조회 수: 7 (최근 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
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
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!