画像解析の結果について
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
DeepLearningToolboxを使用しています。
下記より使用コード
digitDatasetPath = fullfile('C:\Users\2111105\Desktop\gazou1-7');
imds = imageDatastore(digitDatasetPath,...
'IncludeSubfolders',true,'LabelSource','foldernames');
figure;
perm=randperm(1010,50);
for i=1:50
subplot(5,10,i);
imshow(imds.Files{perm(i)});
end
labelCount=countEachLabel(imds);
jpg=readimage(imds,1);
size(jpg)
numTrainFiles = 7;
[imdsTrain, imdsValidation] = splitEachLabel(imds, numTrainFiles, ...
'randomize');
layers = [
imageInputLayer([150 900 3])
convolution2dLayer(3,8, 'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,8, 'Padding', 'same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'padding', 'same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(101)
softmaxLayer
classificationLayer];
options = trainingOptions ('sgdm','InitialLearnRate',0.01,...
'MaxEpochs',20,'Shuffle','every-epoch','ValidationData',imdsValidation, ...
'ValidationFrequency',1,'Verbose',false,'Plots','training-progress');
net = trainNetwork(imdsTrain,layers,options);
YPred = classify(net,imdsValidation);
YValidation = imdsValidation.Labels;
accuracy = sum(YPred == YValidation)/numel(YValidation);
文字の筆跡を画像データとして読み込ませていた場合
このプログラムから得られる結果は筆跡を識別していることになるでしょうか?
0 comentarios
Respuestas (1)
Naoya
el 23 de Sept. de 2024
こちらは、 trainNetwork のリファレンスとなり、例題が幾つか提供されています。
1つめの例題 「イメージ分類についてのネットワークの学習」が雛形となりますが、こちらの例題を既に参照されていると思います。
スクリプトを確認する限りでは、Deep Learning Toolbox による学習フローを再現されているのではと思います。
0 comentarios
Ver también
Categorías
Más información sobre イメージを使用した深層学習 en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!