how to improve accuracy in matlab.?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 30 Mai 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
Réponses (1)
vaibhav mishra
le 30 Juin 2020
Modifié(e) : vaibhav mishra
le 30 Juin 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 commentaires
Voir également
Catégories
En savoir plus sur Image Data Workflows dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!