Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VGG models support #1138

Merged
merged 7 commits into from
Sep 25, 2014
Merged

VGG models support #1138

merged 7 commits into from
Sep 25, 2014

Conversation

ksimonyan
Copy link
Contributor

This pull request adds the support for the models described in the BMVC-2014 paper "Return of the Devil in the Details: Delving Deep into Convolutional Nets", K. Chatfield, K. Simonyan, A. Vedaldi, A. Zisserman. This comes down to adding a parameter to the LRN layer, denoted as "k" in [Krizhevsky et al., NIPS 2012].

The models have been converted to the current BVLC caffe format and can be accessed from the Zoo.

An important thing to note is that currently the models expect an RGB input, rather than BGR.

An example of how to use the models can be found in matlab/caffe/matcaffe_demo_vgg.m

@shelhamer
Copy link
Member

@ksimonyan the model zoo format requires you package each model individually so that our scripts can properly parse them. See Sergey's style example in the zoo for reference: https://gist.github.com/sergeyk/034c6ac3865563b69e60

I will follow-up with a model conversion script (in Python) so that you can switch your models to BGR and upload them to the gist urls for download.

@shelhamer
Copy link
Member

@ksimonyan here is the script to swap input channels for ConvolutionLayer weights: https://gist.github.com/shelhamer/bee2a5b2b739fe6cee6f#file-swap_input_channels-py
. Call it like

./channel_surgery.py VGG_CNN_S_deploy.prototxt VGG_CNN_S.caffemodel VGG_CNN_S_BGR.caffemodel conv1 2 1 0

to translate a model from RGB to BGR. Note the caffe + pycaffe must be compiled on a branch including your changes to introduce the k param to the LRNLayer. I have checked the conversion for the VGG_CNN_S model.

Please convert your models and re-upload and then rebase this PR to operate on BGR inputs. With that done and the models split according to the model zoo format these will be ready to share.

Thank you for choosing to share your models!

@shelhamer
Copy link
Member

A last note: the image mean should be distributed as binaryproto instead of mat. You can do the conversion in Python by loading the mat by scipy.io then convert through caffe.io.

@ksimonyan
Copy link
Contributor Author

@shelhamer thanks for preparing the conversion script.

The models are now converted to work with BGR images and the links are added to the Model Zoo.

the image mean should be distributed as binaryproto instead of mat

I'm now sharing the mean in both .mat and .binaryproto formats.

@kloudkl
Copy link
Contributor

kloudkl commented Sep 24, 2014

@ksimonyan, would you like to share your models that won the competition?

@ksimonyan
Copy link
Contributor Author

@kloudkl
Yes, but my ILSVRC models require an option to subtract the mean BGR pixel (instead of the mean image). As far as I know, @sguada was planning to add this feature.

@sguada
Copy link
Contributor

sguada commented Sep 24, 2014

@ksimonyan, yes I will add the BGR pixel mean to the transform_data PR
later today.

Sergio

2014-09-24 7:16 GMT-07:00 ksimonyan notifications@github.com:

@kloudkl https://github.com/kloudkl
Yes, but my ILSVRC models require an option to subtract the mean BGR pixel
(instead of the mean image). As far as I know, @sguada
https://github.com/sguada was planning to add this feature.


Reply to this email directly or view it on GitHub
#1138 (comment).

@den-yan
Copy link

den-yan commented Sep 24, 2014

@ksimonyan
Thanks for making the models available. Are you plainning to share the grayscale model as well?

@shelhamer
Copy link
Member

Thanks for the model support PR! We're looking forward to having the ILSVRC14 models join the zoo too.

@ksimonyan ksimonyan deleted the vgg_models_support branch September 25, 2014 04:03
@ksimonyan
Copy link
Contributor Author

@shelhamer @sguada
ILSVRC-14 VGG models are now in the Zoo. They require #1070 for mean pixel subtraction.

@kloudkl
Copy link
Contributor

kloudkl commented Sep 25, 2014

Awesome! Waiting for #1070 to finish.

mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
RazvanRanca pushed a commit to RazvanRanca/caffe that referenced this pull request Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants