How to use Bag of features with inceptionv3?

조회 수: 3 (최근 30일)
Chinatip
Chinatip 2022년 8월 22일
답변: Udit06 2024년 11월 22일 6:24
i have imdsTrain and imdsValidation
Then i want to bring this
bag = bagOfFeatures(trainingSet);
to use with this code
net = inceptionv3;
lgraph = layerGraph(net);
figure('Units','normalized','Position',[0.1 0.1 0.8 0.8]);
plot(lgraph)
net.Layers(1)
inputSize = net.Layers(1).InputSize;
lgraph = removeLayers(lgraph, {'predictions','predictions_softmax','ClassificationLayer_predictions'});
numClasses = numel(categories(imdsTrain.Labels));
newLayers = [
fullyConnectedLayer(numClasses,'Name','fc','WeightLearnRateFactor',10,'BiasLearnRateFactor',10)
softmaxLayer('Name','softmax')
classificationLayer('Name','classoutput')];
lgraph = addLayers(lgraph,newLayers);
lgraph = connectLayers(lgraph,'avg_pool','fc');
pixelRange = [-30 30];
imageAugmenter = imageDataAugmenter( ...
'RandXReflection',true, ...
'RandXTranslation',pixelRange, ...
'RandYTranslation',pixelRange);
augimdsTrain = augmentedImageDatastore(inputSize(1:2),imdsTrain, ...
'DataAugmentation',imageAugmenter);
augimdsValidation = augmentedImageDatastore(inputSize(1:2),imdsValidation);
options = trainingOptions('sgdm', ...
'MiniBatchSize',10, ...
'MaxEpochs',4, ...
'InitialLearnRate',1e-4, ...
'ValidationData',augimdsValidation, ...
'ValidationFrequency',3, ...
'ValidationPatience',Inf, ...
'Verbose',false ,...
'Plots','training-progress');
net = trainNetwork(augimdsTrain,lgraph,options);
i want to know how to use Bag of features as features with inceptionv3

답변 (1개)

Udit06
Udit06 2024년 11월 22일 6:24
You can refer to the following research paper for the same:
Lorente, Ò., Riera, I., & Rana, A. (2021). Image classification with classic and deep learning techniques. arXiv preprint arXiv:2105.04895.

카테고리

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