how to improve accuracy in matlab.?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Walter Roberson
il 30 Mag 2020
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
Risposte (1)
vaibhav mishra
il 30 Giu 2020
Modificato: vaibhav mishra
il 30 Giu 2020
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 Commenti
Vedere anche
Categorie
Scopri di più su Image Data Workflows in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!