robosat
robosat copied to clipboard
Handle instance segmentation by adding second output channel for touching borders
At the moment we don't do instance segmentation. This allows our model to be very simple while still achieving amazing results for our current use-cases. Where it breaks down, though, is use cases like extracting buildings in very densely populated areas.
See for example a quick prototype for Tanzania where the segmentation mask alone can not distinguish between touching buildings.

And while proper instance segmentation models are much more complicated, there is one trick we can pull off based on what the folks in https://arxiv.org/abs/1806.00844 propose.
- [ ] Add a second channel to the output. The first channel will be the segmentation mask as it is right now. The second channel will represent touching features - and only the border between features.
- [ ] Train with ground truth segmentation masks and compute and rasterize borders where features touch.
- [ ] After prediction feed results through the watershed transform to divide touching features into multiple features.
As a result we will get instance segmentation and can distinguish between buildings in the use-case above.