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

[question] Is it possible to use transfer learning if my dataset consists of 1d images instead od RGB? #206

Closed
tugot17 opened this issue Jul 13, 2020 · 3 comments

Comments

@tugot17
Copy link

tugot17 commented Jul 13, 2020

I have seen PR #85, however as far as I understand it replaces pretrained weights with new initialization. I have a 1 dim images and was wondering what can I do to benefit from pretrained weights while using single channel images.
Any ideas?

@lukemelas
Copy link
Owner

If you pass in_channels=1 and pretrained=True, it will load the pretrained weights correctly (and replace the first layer with random initialization. You might then want to freeze all but the first layer and train the network (i.e. just the first layer) to convergence. That make sense?

@tugot17
Copy link
Author

tugot17 commented Jul 14, 2020

Yeah it does, thanks.
And wouldn't it be a good idea to instead of initializing it with random numbers to use start from the filters for e.g. red channel (or a mean of three channels)? As far as I understand it the first channel is mostly about detecting simple edges so maybe it would help the model if it started from weights that actually already to that (of course for different domain but maybe still better then starting "from scratch")?

@lukemelas
Copy link
Owner

Great!

Yes, I agree that starting with the channelwise mean is probably better than starting from random (though it shouldn't really make a difference if you then train that layer to convergence with a reasonable number of single-channel images).

Closing this -- feel free to reopen if you have any more questions / issues.

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