U-Net EfficientNet-B4 (dist4, 60 ep, + Open Cities): VHR building instance segmentation (autorun v2)
Successor to nilsho01/unet-buildings-autorun-v1 (same recipe, same architecture). The only
change is the training data: 3,293 chips from Open Cities AI Challenge (tier 1) were
added to the training pool (19,199 train chips instead of 15,906). Validation is unchanged:
clean CV fold 3, the same 2,651 chips. Produced by an unattended run (2026-10-13) on branch
autorun/2026-10-12 of fair-models. The checkpoint is the best-validation-PQ epoch (60 of 60).
Results
Same script (scripts/autorun_eval.py) and protocol as v1: PQ on populated chips, GT instances
are connected components of the label mask, instances under 30 px ignored, d4 TTA, decode
config selected on validation (nothing tuned on the benchmark).
| val PQ | val SQ | val RQ | bench PQ | bench SQ | bench RQ | |
|---|---|---|---|---|---|---|
current unet-effb4-dist3-buildings | 56.06 | 79.03 | 70.93 | 49.30 | 76.28 | 64.63 |
| autorun v1 | 56.74 | 79.25 | 71.59 | 49.95 | 76.37 | 65.40 |
| this model | 57.30 | 79.53 | 72.06 | 51.08 | 76.69 | 66.60 |
| Δ vs v1 | +0.56 | +0.27 | +0.46 | +1.13 | +0.31 | +1.21 |
Validation is clean CV fold 3 (2,651 chips, 1,532 populated). The benchmark is
nilsho01/vhr-buildings-benchmark-v1 (400 chips). These are single runs (one seed); the
earlier from-scratch reproduction of the current model matched to the second decimal, so
differences of about 0.5 PQ were stable there, but this was not measured for this model.
Breakdown (PQ), v1 → this model
| stratum | val v1 | val this | Δ | bench v1 | bench this | Δ |
|---|---|---|---|---|---|---|
| size 0–8 px | 13.49 | 12.64 | −0.86 | 12.66 | 11.58 | −1.07 |
| size 8–12 px | 32.99 | 33.02 | +0.03 | 28.89 | 29.67 | +0.78 |
| size 12–16 px | 45.24 | 46.27 | +1.03 | 42.27 | 43.30 | +1.03 |
| size 16–24 px | 57.58 | 58.53 | +0.95 | 53.00 | 54.59 | +1.58 |
| size 24–40 px | 67.08 | 67.54 | +0.46 | 58.21 | 59.14 | +0.93 |
| size 40+ px | 69.35 | 69.40 | +0.05 | 60.97 | 62.11 | +1.14 |
| density 1–9 | 60.62 | 60.78 | +0.16 | 57.70 | 56.76 | −0.94 |
| density 10–49 | 59.39 | 59.84 | +0.46 | 50.64 | 51.61 | +0.97 |
| density 50+ | 47.96 | 49.13 | +1.17 | 47.89 | 49.54 | +1.65 |
| Africa | 56.70 | 57.07 | +0.37 | 50.18 | 51.49 | +1.32 |
| Myanmar | 56.68 | 57.36 | +0.68 | 51.14 | 52.08 | +0.94 |
| Other | 57.41 | 58.23 | +0.82 | 41.85 | 43.32 | +1.47 |
| pixel IoU | 77.45 | 77.75 | +0.30 | 74.21 | 74.41 | +0.20 |
| empty chips with ≥1 FP | 10.2 % | 10.2 % | 9.9 % | 10.9 % |
Size is the side of the square of equal area. Known weaknesses: buildings under 8 px are still weak (and slightly worse than v1), sparse chips (1–9 buildings) on the benchmark lost 0.9 PQ, and the false-positive rate on empty benchmark chips is 10.9 %. The Open Cities chips from Zanzibar are mostly empty rural imagery, which was kept as negative examples.
Usage
Identical to v1: four sigmoid outputs (mask, normalised distance, boundary, centreness);
seed a marker-controlled watershed with h-maxima of the centreness channel inside the mask.
Decode config is in best_threshold.json["decode"] (mask 0.5, h 0.4, min 30 px, d4 TTA).
import json, torch, segmentation_models_pytorch as smp
from huggingface_hub import hf_hub_download
repo = "nilsho01/unet-buildings-autorun-v2"
net = smp.Unet(encoder_name="efficientnet-b4", encoder_weights=None, in_channels=3, classes=4)
net.load_state_dict(torch.load(hf_hub_download(repo, "best.pth"), map_location="cpu"))
net.eval()
See the v1 card for the full decode snippet. model.onnx is the same network at opset 18
with a dynamic batch dimension; output is (N,4,256,256) logits, matching torch to 6e-5.
Training
smp.Unet, ImageNet-pretrained EfficientNet-B4, dist4 head, 60 epochs, batch 32, Adam at
2e-3 (decoder) / 2e-4 (encoder), EMA 0.99, 256×256, seed 42, --legacy-seg-loss --sep-weight 10 --sep-sigma 4 --boundary-weight 4. Data: nilsho01/vhr-buildings-automatic-annotation-v3-oc
(the v2 pool plus Open Cities chips), split file cv_folds_clean_oc/cv_folds.csv (fold 3;
all Open Cities chips are in train). Full arguments in config.json.
Licence and attribution
Model weights: Apache-2.0.
Imagery and base labels: hotosm/vhr-building-segmentation (imagery © OpenAerialMap
contributors; labels © OpenStreetMap contributors, ODbL-1.0). Please attribute
"© OpenStreetMap contributors, OpenAerialMap".
Added in this version: Open Cities AI Challenge tier 1 (GFDRR Labs, Radiant MLHub, 2020; doi 10.34911/rdnt.f94cxb): imagery CC BY 4.0, labels ODbL-1.0. Please attribute "Open Cities AI Challenge, GFDRR Labs / Radiant MLHub, 2020".
No CC BY-NC data (e.g. RAMP) was used for this model.