How to use Bag of features with inceptionv3?

1 visualización (últimos 30 días)
Chinatip
Chinatip el 22 de Ag. de 2022
Respondida: Udit06 el 22 de Nov. de 2024
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

Respuestas (1)

Udit06
Udit06 el 22 de Nov. de 2024
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.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by