How To Test my CNN system

14 ビュー (過去 30 日間)
Mustapha Mahmoud
Mustapha Mahmoud 2021 年 1 月 22 日
コメント済み: Shashank Gupta 2021 年 3 月 8 日
Kindly, I created a system using the Network designer (CNN) and it gave me accuracy 95% :) . I pressed export Matlab Code and things went well.
However, How can I test my code for new images? in other words how can I test my system for new stuff?
Appreciating your kind cooperation.

回答 (1 件)

Anmol Dhiman
Anmol Dhiman 2021 年 1 月 27 日
編集済み: Anmol Dhiman 2021 年 1 月 27 日
Hi Mustapha,
The steps are
1) Train model on DeepNetworkDesigner
2) Export Network to workspace(It will give lgraph, you need to convert lgraph to net)
3) AssembleNetwork(lgraph) (this will convert to network)
4) Use the above link to predict the image output.
Hope it helps
  2 件のコメント
Mustapha Mahmoud
Mustapha Mahmoud 2021 年 1 月 29 日
Thank you so much for answering, but I quite didn't understand the procedure of step 2
At the begining the data was divided it seems into training and validation only no test data !
And What I got at the end is the following command
Import Data
Import training and validation data.
imdsTrain = imageDatastore("C:\Users\musta\OneDrive\Desktop\NEW CNN\CNNtest1\MerchData","IncludeSubfolders",true,"LabelSource","foldernames");
[imdsTrain, imdsValidation] = splitEachLabel(imdsTrain,0.6,"randomized");
% Resize the images to match the network input layer.
augimdsTrain = augmentedImageDatastore([224 224 3],imdsTrain);
augimdsValidation = augmentedImageDatastore([224 224 3],imdsValidation);
Train Network
[net, traininfo] = trainNetwork(augimdsTrain,lgraph,opts);
Shashank Gupta
Shashank Gupta 2021 年 3 月 8 日
I think what @Anmol Dhiman implies by step 2 is to export the network. Looking at your comment, it seems like you exported the training script, you don't need to export the training script. you can simply the train the model in deep network designer with pretty UI and then just export the trained network. I think after that the above answer sums up your query.
I hope this helps.
Cheers

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by