Convolution Neural Network on my dataset

조회 수: 2 (최근 30일)
Muhammad Usman
Muhammad Usman 2017년 11월 27일
답변: Javier Pinzón 2017년 12월 1일
Hey all, My data set contains around 1200 entries. Each entry contains 81 images in it. I have one folder (it contains 81 images for one record) and a class label against it. I am confused, how do I give it to my CNN?
Thanks Already!

답변 (1개)

Javier Pinzón
Javier Pinzón 2017년 12월 1일
Hello Muhammad,
Iif i understood, you have 1200 categories, and 81 data information in each category, split in folders.
If you what to get the categories, the best way i to locate ALL the category folders in 1 main folder, for example "/training/" folder, i that way you can get all the Folders labels automatically using this code line:
%%Training Dataset
location = '*path*/training';
imds = imageDatastore(location,'IncludeSubfolders',1,'LabelSource','foldernames');
*path is the complet address to get the training folder. It will give you all the data directions and labels writen en each folder.
To enter it to the CNN, you can use this other part:
trainingDS = imds;
% Convert labels to categoricals
trainingDS.Labels = categorical(trainingDS.Labels);
So you get a imagedatastore variable with "categories", and finally, enter it to the network with your defined layers and options:
[net, info] = trainNetwork(trainingDS, layers, opts);
Hope it helps, and thanks if this answer is accepted.
Any question, feel free to ask.
Regards,
Javier

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by