robosat icon indicating copy to clipboard operation
robosat copied to clipboard

Allow arbitrary number of input channels in ResNet encoder (not only RGB)

Open daniel-j-h opened this issue 7 years ago • 2 comments

With https://github.com/mapbox/robosat/pull/46 we are changing our model architecture from training the encoder and decoder from scratch to using a pre-trained ResNet for the encoder. The pre-trained ResNet uses three channels (RGB) for the input layer through.

We need to be able to add arbitrary channels, say, RGB + water mask + elevation + lidar. To to this we need to construct a wrapper module architecture extending the ResNet architecture, copying weights over, and initializing the new channels with zero. In addition the channel-wise mean and std dev needs to be adapted.

Tasks

  • [ ] Figure out how to extend the ResNet input channels
  • [ ] Figure out how to copy over the pre-trained ResNet parts
  • [ ] Let users construct a model with arbitrary channels
  • [ ] Adapt mean and std dev

daniel-j-h avatar Jun 29 '18 14:06 daniel-j-h

Is there any concern with initializing channels with 0 instead of a value that implies 'missing'? Or is this just me misunderstanding the process?

Looking forward to seeing this develop, regardless!

mikoontz avatar Sep 23 '18 21:09 mikoontz

If you check out Kaggle competitions with multi-spectral data or in general more channels most of them either initialize additional channels with zero, randomly initialize, or copy the rgb channels over. I've seen zero initialization working best for most winning solutions.

daniel-j-h avatar Sep 24 '18 15:09 daniel-j-h