Borrar filtros
Borrar filtros

how to improve accuracy in matlab.?

2 visualizaciones (últimos 30 días)
Ronak Patel
Ronak Patel el 30 de Mayo de 2020
Editada: vaibhav mishra el 30 de Jun. de 2020
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 comentario
Walter Roberson
Walter Roberson el 30 de Mayo de 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

Iniciar sesión para comentar.

Respuestas (1)

vaibhav mishra
vaibhav mishra el 30 de Jun. de 2020
Editada: vaibhav mishra el 30 de Jun. de 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.

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by