フィルターのクリア

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

3 ビュー (過去 30 日間)
Atiya latif
Atiya latif 2021 年 1 月 27 日
回答済み: Vidip 2024 年 5 月 7 日
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)

回答 (1 件)

Vidip
Vidip 2024 年 5 月 7 日
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 –

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by