unet_segmentation: swap tree-crown base checkpoint for a building-pre… - #58
unet_segmentation: swap tree-crown base checkpoint for a building-pre…#58nilshof01 wants to merge 1 commit into
Conversation
…trained base The shipped base (unet_resnet34_oam_rgb_tcd) is a tree-crown delineation model: zero-shot it scores building F1 0.00 on both held-out splits of hotosm/vhr-building-segmentation (n=7,237 val / 7,236 test chips), and fine-tuning from it reaches 50.0 pooled test F1 at 32 chips (6 regions x 5 folds) - below random decoder init (52.4). An identical-architecture base pretrained on hotosm/vhr-building-segmentation reaches 59.3 pooled (+9.3) with the unchanged fine-tune recipe, scores 0.40/0.51 building F1 zero-shot on the dataset val/test splits, and cuts fold variance. It is a raw smp state dict loading via the existing torch.load(weights_only=True) + load_state_dict(strict=False) path with 0 missing / 0 unexpected keys. The checkpoint asset is pinned to the upload revision; training provenance is documented in the model README and on the checkpoint's model card (hf.co/nilsho01/unet-resnet34-vhr-buildings). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the PR , Can you explain a bit more what you are contributing to ? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #58 +/- ##
========================================
Coverage 97.07% 97.07%
========================================
Files 48 48
Lines 4271 4271
========================================
Hits 4146 4146
Misses 125 125
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi, thank you for your reply and I hope I can contribute a bit :) As far as I understand it, the current pipeline for building segmentation has two options: a UNET baseline or a transformer. There are pros and cons in choosing either of them which is not part of this PR. However, I could see that the UNET baseline is a tree crown model, meaning that it finds trees and not buildings. It might still seem good enough for fine-tuning on chips, but in my measurements it is actually slightly worse than starting from a randomly initialized decoder. Hence, I trained a UNET base (resnet-34 backbone) on the dataset provided by hotosm for building segmentation (hotosm/vhr-building-segmentation). Across 6 distinct regions (Banepa, Jakarta, Accra, Bogota, Manila and Nairobi, 5-fold cross-validation each) the building-pretrained base reaches a pooled F1 of 59.3 as a fine-tuning warm start, versus 50.0 for the tree-crown base and 52.4 for no base at all — and comes close to the transformer (60.4) at a fifth of its size. So this PR is just about choosing the right UNET base checkpoint in the fine-tuning pipeline. It pins an exact updated version of the original model architecture, so nothing else in the pipeline needs to change. You can read more about the study here with the different metrics here: https://huggingface.co/nilsho01/unet-resnet34-vhr-buildings. |
|
Hey, I think it would be nice to discuss it since it is a simple change and has a more or less strong scientific foundation. Br, |
…trained base
The shipped base (unet_resnet34_oam_rgb_tcd) is a tree-crown delineation model: zero-shot it scores building F1 0.00 on both held-out splits of hotosm/vhr-building-segmentation (n=7,237 val / 7,236 test chips), and fine-tuning from it reaches 50.0 pooled test F1 at 32 chips (6 regions x 5 folds) - below random decoder init (52.4).
An identical-architecture base pretrained on
hotosm/vhr-building-segmentation reaches 59.3 pooled (+9.3) with the unchanged fine-tune recipe, scores 0.40/0.51 building F1 zero-shot on the dataset val/test splits, and cuts fold variance. It is a raw smp state dict loading via the existing torch.load(weights_only=True) + load_state_dict(strict=False) path with 0 missing / 0 unexpected keys.
The checkpoint asset is pinned to the upload revision; training provenance is documented in the model README and on the checkpoint's model card (hf.co/nilsho01/unet-resnet34-vhr-buildings.
For more insights into the study have a look here for more insights: https://huggingface.co/nilsho01/unet-resnet34-vhr-buildings