Effacer les filtres
Effacer les filtres

How do i increse the accuracy for my dataset beyond 78 %?

3 vues (au cours des 30 derniers jours)
Atiya latif
Atiya latif le 27 Jan 2021
imds = imageDatastore('ck_dataset', ...
'IncludeSubfolders',true,'LabelSource','foldernames')
[imdstrain, imdsvalid, imdstest]=splitEachLabel(imds,.8, 0.1);
aTest = augmentedImageDatastore([48 48], imdstest, 'ColorPreprocessing','gray2rgb')
CountLabel = imds.countEachLabel
aa=read(imds);
size(aa)
net = alexnet
layers = [
imageInputLayer([48 48 1])
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(5)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'InitialLearnRate',0.001, ...
'MaxEpochs',15, ...
'Shuffle','every-epoch', ...
'ValidationFrequency',50, ...
'MiniBatchSize',32,...
'Verbose',false, ...
'Plots','training-progress');
convnet = trainNetwork(imdstrain,layers,options);
YPred = classify(convnet,imdsvalid);
YValidation = imdsvalid.Labels;
accuracy = sum(YPred == YValidation)/numel(YValidation)
plotconfusion(YValidation,YPred)

Réponses (1)

Vidip
Vidip le 7 Mai 2024
Improving the accuracy of a model, especially one based on convolutional neural networks (CNNs) like in your case, can be approached from several angles like data augmentation, it artificially increases the size and variability of your training dataset by applying a series of transformations (e.g., rotations, translations, flipping, scaling, etc.), you can use ‘imageDataAugmenter’ as it configures a set of preprocessing options for image augmentation, such as resizing, rotation, and reflection. This can help the model generalize better. Also, consider adding or removing layers accordingly, hyperparameter tuning and transfer learning.
For more information, you can refer to the documentation links below –

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by