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
load('gTruth.mat')smokedetection = selectLabels(gTruth,'smoke');if isfolder(fullfile('TrainingData')) cd TrainingDataelse mkdir TrainingDataend addpath('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]) reluLayer("Name","relu") averagePooling2dLayer([3 3],"Name","avgpool","Stride",[2 2]) fullyConnectedLayer(2,"Name","fc_rcnn","BiasL2Factor",1,"BiasLearnRateFactor",10,"WeightLearnRateFactor",20,"WeightsInitializer","narrow-normal") softmaxLayer("Name","softmax") classificationLayer("Name","classoutput")];trainingData = objectDetectorTrainingData(smokedetection,'SamplingFactor',1,...'WriteLocation','TrainingData');detector = trainRCNNObjectDetector(trainingData, layers, options, ... 'NegativeOverlapRange', [0 0.3]);save('Detector.mat','detector');
Best Answer