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

Image Preprocessing to finetune/predict using pre trained VGG model #391

Closed
sudhashbahu opened this issue Oct 12, 2016 · 4 comments
Closed

Comments

@sudhashbahu
Copy link

sudhashbahu commented Oct 12, 2016

The example at https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network_finetuning.py shows how to fine tune the pre-trained VGG16 model.

However the trained model might have applied mean subtraction and Std normalization where the mean/STD values are calculated over entire training dataset.

if we need to fine-tune the model (or use it as-is for classification) shouldn't we have to apply the exact same preprocessing to new images?

The fine tuning example above applied Normalization to the input image but this will not match that over the entire pre-training dataset.

@aymericdamien
Copy link
Member

You are right! this was missing. I updated the example, you can have a look.

@sudhashbahu
Copy link
Author

Thank you for the quick action.

@sudhashbahu
Copy link
Author

sudhashbahu commented Oct 13, 2016

Are you sure the Normalize=True should be retained in the image preloader?

And the original VGG 16 authors seems to indicate BGR images instead of RGB and they did not apply normalization, only zero mean. It all depends on how the VGG16.tflearn was trained.

@aymericdamien
Copy link
Member

aymericdamien commented Oct 13, 2016

Yes, it has been reversed to RGB, so it should be working as it.
Ops, 'Normalize' is a typo, thanks for pointing that out! I fixed it.

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

No branches or pull requests

2 participants