mapbox / robosat

Semantic segmentation on aerial and satellite imagery. Extracts features such as: buildings, parking lots, roads, water, clouds
MIT License
2.02k stars 382 forks source link

Implements topology-aware loss function; resolves #133 #135

Open daniel-j-h opened 5 years ago

daniel-j-h commented 5 years ago

First try at a topology-aware loss function

The idea is to optimize for topology like connectivity directly instead of just for pixel-wise loss.

Here is an high-level example from the first paper of what we want to achieve:

top-loss

Here's a quick rundown of how it works:

This is a bit experimental right now; we need to


This could be interesting to you @DragonEmperorG and @ocourtin since you've been contributing the road extraction and the recent loss function changes, respectively.

daniel-j-h commented 5 years ago

I have a dataset to test this on now; need to tune it some more and run the tasks listed above out.

roads

ocourtin commented 5 years ago

Daniel,

Would it be possible to publish your roads dataset online ? (anyhow having a common dataset to compare results with would be great. For buildings the INRIA one is good enough, but dunno anything related, with same quality for roads)

And as you could imagine would be interesting to compare with the others losses (mIoU and Lovasz)

daniel-j-h commented 5 years ago

Hey I'm currently not allowed to push internal data outside.

That said you can create such a dataset on your own using the rs extract road handler and the Mapbox satellite endpoint to fetch aerial imagery tiles for cities in North America via https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}@2x.webp?access_token=.

ocourtin commented 5 years ago

Well, the point for a decent roads extraction opendataset is less the imagery than the labels :)

daniel-j-h commented 5 years ago

To be honest right now for trying things out I'm really just using the road extractor on OpenStreetMap data.

daniel-j-h commented 4 years ago

Another idea I had is to optimize graph based connectivity directly in the loss function as in: set up floyd warshall all-pair shortest path as a loss function and let's optimize the adjacency matrix to change graph based edge weights for edges where there are roads.

Sketched out in https://gist.github.com/daniel-j-h/7b8c43fcdb9ddacaf0f490efe614d717