How to extract features from different layers in GoogLeNet?

7 ビュー (過去 30 日間)
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman 2017 年 11 月 28 日
回答済み: michael scheinfeild 2018 年 7 月 22 日
Commonly we extract features using:
net = googlenet()
%Extract features
featureLayer = 'pool5-drop_7x7_s1';
How to extract features from a different layer earlier in the network? I attempting extracting from a different layer but the output of the layer is in 4D. I tried to squeeze it but its not working for those layers. Kindly assist with the syntax for other layers as well.

採用された回答

michael scheinfeild
michael scheinfeild 2018 年 7 月 22 日
use some layer as the feature . then you can use it for other classifier
net = googlenet;
inputSize = net.Layers(1).InputSize;
imds = imageDatastore(dbpathSave)
augimdsTrain = augmentedImageDatastore(inputSize(1:2),imds );
%%Extract Image Features
layer = 'loss3-classifier';%1000
featuresTrain = activations(net,augimdsTrain,layer,'OutputAs','rows');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by