1

I was applying this CNN fine-tuning example from Matlab.

The example shows how to fine-tune a pre-trained CNN on letters to classify images of digits. Now I would like to use this new fine-tuned CNN on new images of digits that i have on my computer. How can I do that?

DukeZhou
  • 6,209
  • 5
  • 27
  • 54
F.Lin
  • 167
  • 2
  • 4

1 Answers1

2

As the question has been left unanswered, for future readers of the questions:

The documentation you link gives the answer to your question.

Given the fact you have a pre-trained model as you say:

YPred = classify(netTransfer,testDigitData);

where netTansfer is the pre-trained model and testDigitData is your test image that you want to predict the label.

Your image(s) need to be loaded following the instruction also given in the documentation:

digitDatasetPath = fullfile(matlabroot,'toolbox','nnet','nndemos', ...
    'nndatasets','DigitDataset');

digitData = imageDatastore(digitDatasetPath, ...
    'IncludeSubfolders',true,'LabelSource','foldernames');

(digitData will become testDigitData if the images that you load are for testing purpose only, which seems to be your case)

Eskapp
  • 260
  • 1
  • 9