Repository navigation
feat(models): add unet_roads road surface segmentation model - #80
Open
RafaelCardoso990 wants to merge 1 commit into
Open
RafaelCardoso990 wants to merge 1 commit into
RafaelCardoso990 wants to merge 1 commit into
Conversation
Add a fine-tunable U-Net (ResNet34 encoder) that segments roads in very high resolution RGB imagery and returns the road surface as polygons. - pipeline: training, evaluation, ONNX export and inference; chips of a request are mosaicked before vectorising, so a road is one polygon across chip edges - training labels: polygons burned as drawn, lines buffered to a road width - colour and zoom augmentation for satellite-to-drone transfer - STAC-MLM item, model card, Dockerfile and tests - weights: https://huggingface.co/Rafael990/unet-roads (CC-BY-SA-4.0)
RafaelCardoso990
force-pushed
the
feat/unet-roads
branch
from
November 5, 2026 17:51
72985b1 to
0430003
Compare
Author
|
Hi @kshitijrajsharma, this PR adds a road surface segmentation model for the Open Call for EO GeoAI Models. The application form and the email to fair@hotosm.org were sent on 5 November. The workflows are waiting for maintainer approval. Could you approve them when convenient? As with #68 and #77, "Build Model Images" and "Test Single Model" will also need the model image in ghcr, which a PR from a fork cannot push. Everything else passes locally, as described in the PR. Thank you! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
models/unet_roads/: a fine-tunable base model that segments roads in VHR RGB imagery and returns the road surface as polygons. Open call category: Transportation infrastructures. It supports both inference and fine-tuning.Only
models/unet_roads/is touched.How it works
road_width_m. BCE + Dice loss, flips and rotations, plus zoom and colour jitter. Spatial block split.Training data and results
Base stage on SpaceNet 3 roads (Khartoum, Paris). Fine-tuning stage on OpenAerialMap drone imagery with OpenStreetMap highways (Maputo, Freetown, Dar es Salaam).
The OSM reference on the drone sets is incomplete, so I also reviewed the predicted masks by eye, chip by chip. Chip-level accuracy among chips with a road: 80% on a hard sample of 60 Khartoum validation chips, 78% on 90 Maputo chips (mostly in the fine-tuning set) and 69% on 120 Banepa chips, which the model never saw in training. Details and limitations are in the model card.
What I ran locally
Same commands as the workflows, on this branch, with no changes outside
models/unet_roads/:style:ruff check,ruff format --diff,ty check,pytestforfair(526 passed, 1 skipped)validate-stac:validate_stac_items.py(including the asset URL checks) andvalidate_model.pybuild-model-images: test image, 11 step tests inside it,models/test_integration.py, runtime and inference images, and both inference smoke tests (published ONNX and fine-tuned ONNX) on the Banepa bboxtest-model: I ran the flow on a local kind cluster (just up,just example unet_roads,scripts/test_serve.py). Registration, fine-tuning in the pod, promotion, batch prediction and the serving test all passed, with one deviation: the image is not inghcr.io/hotosm/fair-models, so for that run I pointedmlm:trainingandmlm:inferenceat the digest of the image loaded into kind. The STAC item in this PR uses the normal:latesttags.What I expect to fail in CI, and why
As in #68 and #77, a PR from a fork cannot push to
ghcr.io/hotosm/fair-models:Build Model Imagesstops at "Push runtime image".Test Single Modelstops at registration withImage digest resolution failed: ghcr.io/hotosm/fair-models/unet_roads:latest ... 403 Forbidden.Could a maintainer run these from a branch on your side?
Notes for reviewers
fair-py-opsversion: the Dockerfile pins0.3.17, like the other models. With0.3.25the integration test fails for this model at promotion (Evaluation metrics do not match the base model's fair:metrics_spec):models/conftest.pymocks the metric logging for every test, and promotion now validates those metrics. With the mock disabled the test passes on0.3.25.examples/run.pytrains every model on thebuildings-banepa-*polygon sample, which alinemodel fails the compatibility check against. I kept this PR to polygons so it runs with the existing sample data. A centreline variant of the same network is ready (mask skeletonised and traced into LineStrings), and I can open a follow-up PR if you tell me how you would like line models tested.Checklist
stac-item.jsondeclaresfair:metrics_spec,fair:split_specandfair:hyperparameters_speckeywordshas a feature tag, a task value and exactly one geometry typelicenseis a supported SPDX identifier (CC-BY-SA-4.0)just validatepasses for the model and STAC item