Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to find the confusion matrix of a given network?
    8 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
%%
Folder = 'C:\Users\Vishal\Desktop\Rokesh\NntestCopy\Bacteria';
if ~isdir(Folder)
  Message = sprintf('Error: cant find the folder:\n%s', Folder);
  uiwait(warndlg(Message));
  else Message = sprintf('Folder exists:\n%s', Folder);
       uiwait(warndlg(Message));
  return;
end
%%
DataPath = fullfile(Folder)
%%
imgdts = imageDatastore(DataPath,'IncludeSubfolders',true,'LabelSource','foldernames')
%%
imgdts.countEachLabel
%%
trainingNumFiles = 46;
rng(1)
[imgdtsTrain,imgdtsValidation] = splitEachLabel(imgdts,...
    trainingNumFiles,'randomize')
%%
layers=[...
    imageInputLayer([566 804 3])
    convolution2dLayer(5,20,'stride',2)
    reluLayer
    maxPooling2dLayer(5,'stride',1)
    convolution2dLayer(5,20,'stride',2)
    reluLayer
    maxPooling2dLayer(5,'stride',1)
    convolution2dLayer(5,20,'stride',2)
    reluLayer
    maxPooling2dLayer(5,'stride',1)
    convolution2dLayer(5,4,'stride',2,'padding',[1 1])
    reluLayer
    fullyConnectedLayer(2)
    softmaxLayer
    classificationLayer()]
%analyzeNetwork(layers)
%%
options = trainingOptions('sgdm',...
    'MaxEpochs',25,...
    'ValidationData',{imgdtsTrain,imgdtsValidation},...
    'ValidationFrequency',2,...
    'Momentum',0.8,...
    'ValidationPatience',1,...
    'InitialLearnRate',0.0001,...
    'MiniBatchSize',4,...
    'Verbose',true,...
    'executionenvironment','auto',...
    'Shuffle','every-epoch',...
    'Plots','training-progress')
%%
microbenet=trainNetwork(imgdts,layers,options)
%%
i=imread('ccb23.jpg');
figure,imshow(i);
%%
output=classify(microbenet,i)
Here, I have 104 images and then labeled them as four species as a,b,c,d. Each label consists of 26 images. I wanted a confusion matrix of this network.
1 comentario
  KALYAN ACHARJYA
      
      
 el 30 de Mayo de 2019
				
      Editada: KALYAN ACHARJYA
      
      
 el 3 de Jun. de 2019
  
			At first, it would be better if you go through, what is confusion matrix? 
Respuestas (1)
  Jyotish Kumar
    
 el 3 de Jun. de 2019
        Hi, 
The Deep Learning Toolbox in MATLAB has ‘confusion’ and ‘plotconfusion’ functions to extract the confusion matrix. Please go through the following links for more details: 
I hope it will help you. 
0 comentarios
La pregunta está cerrada.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


