I want to test the performance of each convolutional layer of my Convolutional Neural Network(CNN) architecture using SVM. I am using MatConvNet Matlab toolbox.
Layers are like that: Conv1 Relu1 Pool1 (3x3, 32 features) -> Conv2 Relu2 Pool2 (3x3, 64 features) -> Conv3 Relu3 Pool3 (3x3, 128 features) ->Conv4 Relu4 (1x1, 256 features) -> Conv5 (1x1, 4 features)-> Softwamxloss
After training, I removed the loss layer
net.layers=net.layers(1 : end - 1);
I have the network looks like that
I can extract the features like that:
feats = vl_simplenn(net, im) ;
Feautre_L1(fea,:) = squeeze(feats(end).x);
similarly, I remove 2 more layers and extract 256 features from Conv4.
But when I moved to Conv3 the output feature is 7x7x128.
I want to know that how can I used these features
i) Making a single vector
ii) Averaging the values in depth?