MATLAB Answers

Training the RCNN Detector with multivariable from groundtruth

1 view (last 30 days)
Hi guys
Hope you are doing well
I have one code which is for Traning the RCNN object detector for detecting the smoke
i made dataset for labelling set of images which have many variable such as sky cars people smoke however i want in my code that to train the detector to detect smoke and not to detect the other variables which are labelled
currently in my code i can only make selecetlabels for smoke and traning the detector with smoke but i want to know how to select other variables and train the detector not to detect or select other variables
herein my code
smokedetection = selectLabels(gTruth,'smoke');
if isfolder(fullfile('TrainingData'))
cd TrainingData
mkdir TrainingData
options = trainingOptions('sgdm', ...
'MiniBatchSize', 32, ...
'InitialLearnRate', 1e-6, ...
'MaxEpochs', 10);
layers = [
imageInputLayer([32 32 3],"Name","imageinput")
convolution2dLayer([5 5],32,"Name","conv","BiasLearnRateFactor",2,"Padding",[2 2 2 2],"WeightsInitializer","narrow-normal")
maxPooling2dLayer([3 3],"Name","maxpool","Stride",[2 2])
averagePooling2dLayer([3 3],"Name","avgpool","Stride",[2 2])
trainingData = objectDetectorTrainingData(smokedetection,'SamplingFactor',1,...
detector = trainRCNNObjectDetector(trainingData, layers, options, ...
'NegativeOverlapRange', [0 0.3]);

Accepted Answer

Kritika Bansal
Kritika Bansal on 13 Sep 2019
As per my understanding, you need a way to train the RCNN object detector to detect classes other than smoke.
Assuming you are using MATLAB R2019a, you can use the following functions to select the ground truth data for a set of labels:
  1. selectLabelsByGroup():
  2. selectLabelsByName():

More Answers (0)

Community Treasure Hunt

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

Start Hunting!