deep-learning-models icon indicating copy to clipboard operation
deep-learning-models copied to clipboard

How to interpret the output of the feature extractor?

Open lazywei opened this issue 7 years ago • 1 comments

Hi,

I followed the instruction on the README to extract feature from an image by using VGG16 model. When I did

features = model.predict(x)

I found the dimension of the features is of (1, 7, 7, 512). I thought for feature extraction, each image should be represented as a single vector? I'm wondering how to interpret this output and the dimension properly?

Thanks.

lazywei avatar Feb 16 '17 16:02 lazywei

The problem is that on VGG16 the last layer prior to the top classification ones is a Pooling Layer, therefore you are basically getting the output of this layer, which if I'm not mistaken are 512 7x7 pooling windows. You could apply a dense layer after it in order to get a 1D vector, just remember to use it on all the images that you want to extract the features, so it is possible to make a fair comparison between them.

gugarosa avatar Mar 20 '17 15:03 gugarosa