|
Download ffdamage_xbd/README.md from hotosm/tech4dev-damage: direct link, hf CLI and curl.
- Browser
- Download file 5.07 kB
-
https://huggingface.co/hotosm/tech4dev-damage/resolve/refs%2Fpr%2F1/ffdamage_xbd/README.md
- Command line
-
hf download hf://hotosm/tech4dev-damage@refs/pr/1/ffdamage_xbd/README.md
-
curl -L -o README.md https://huggingface.co/hotosm/tech4dev-damage/resolve/refs%2Fpr%2F1/ffdamage_xbd/README.md
5.07 kB
| license: cc-by-nc-sa-4.0 | |
| library_name: onnxruntime | |
| pipeline_tag: object-detection | |
| tags: | |
| - building-damage | |
| - disaster-response | |
| - remote-sensing | |
| - dinov3 | |
| - lora | |
| - centernet | |
| - fair | |
| # ffdamage-xbd | |
| Footprint-free building damage detection from a single post-event satellite image. The model returns one point per | |
| building with a detection `score` and the probability `p_damaged` that the building is damaged (minor, major or | |
| destroyed in xBD terms, against no damage). It needs no building footprints and no pre-event image. | |
| Code, fine-tuning and the HOT fAIr adapter: [github.com/MikyLanfra/ffdamage](https://github.com/MikyLanfra/ffdamage) | |
| (tag `v0.1.0`). | |
| ## Files | |
| | file | what it is | | |
| |---|---| | |
| | `ffdamage_xbd.onnx` | serving model, 245 MB: int8 weights on MatMul/Gemm (per channel), convolutions fp32 | | |
| | `ffdamage_xbd.pt` | full PyTorch checkpoint, 810 MB (LoRA merged), used for fine-tuning | | |
| | `meta.json` | input resolution (`gsd_m` 0.5), normalisation, stride, default thresholds, licence | | |
| | `SHA256SUMS` | checksums | | |
| ## Architecture | |
| ``` | |
| RGB image, resampled to 0.5 m/px, sides padded to a multiple of 32 | |
| -> DINOv3 ConvNeXt-L encoder (frozen), LoRA rank 16 on the two pointwise (MLP) layers of every block | |
| -> stage outputs at stride 8, 16, 32, each projected to 256 channels (1x1 conv + GroupNorm + 3x3 conv + GroupNorm) | |
| -> top-down fusion to stride 8 (upsample + add + 3x3 conv), two 3x3 conv + GroupNorm + GELU layers | |
| -> three heads on the stride-8 grid: | |
| heat 1 channel, sigmoid: building-centre heatmap | |
| offset 2 channels: sub-cell position of the centre | |
| damage 2-layer MLP on the cell feature, sigmoid: p_damaged | |
| -> decode: 3x3 max-pool peak finding, top 600 peaks, score cutoff -> points (x, y, score, p_damaged) | |
| ``` | |
| - Encoder: `facebook/dinov3-convnext-large-pretrain-lvd1689m`. About 200 M parameters in total, almost all in the | |
| encoder. The LoRA adapters are merged into the encoder weights in both released files, so they add no inference cost. | |
| - Training targets follow CenterNet: a Gaussian at each building's centre (polygon centroid, or an interior point when | |
| the centroid falls outside), penalty-reduced focal loss on the heatmap, L1 on the offset, and binary cross-entropy on | |
| `p_damaged` at the centre cell. Buildings with unknown damage train detection only. | |
| - Large images are processed in 1024 px windows with 128 px overlap; each point is kept only from the core of the | |
| window that found it, so there are no duplicates across windows. | |
| ## Training | |
| xBD (xView2), all events, post-event images only, binary damage labels. 1024 px crops at native resolution (about | |
| 0.5 m), random flips and 90-degree rotations, batch 4, AdamW at learning rate 1e-4, LoRA rank 16 (alpha 32), 12 epochs | |
| with early stopping on validation (patience 4), one L40S GPU, about 2.6 h. | |
| ## Evaluation (xBD test split, released int8 model) | |
| 2,184 test tiles, 80,400 buildings, 19,123 of them damaged. A point counts as a hit when it lies inside a building | |
| footprint buffered by 1.5 m; matching is one-to-one by descending score. Cutoffs are chosen on the validation split. | |
| | operating point | building recall | precision | damaged recall (p >= 0.5) | damage AUROC | | |
| |---|---|---|---|---| | |
| | best F1 on validation (cutoff 0.30) | 0.713 | 0.775 | 0.565 | 0.979 | | |
| The fp32 model scores the same within 0.01 on every metric (recall 0.707, precision 0.782, AUROC 0.979). The default | |
| `confidence_threshold` 0.306 is the best-F1 cutoff of the fp32 validation run. | |
| Inference cost (ONNX Runtime, CPU, 2 threads): about 3.2 s per 1024 x 1024 window (about 12 s/km² at 0.5 m), peak | |
| memory under 2 GB. | |
| ## Intended use and limits | |
| - Rapid post-disaster triage on satellite or aerial RGB at about 0.3 to 0.6 m. Points mark buildings to inspect; they | |
| are not a damage assessment by themselves. | |
| - Not trained on drone imagery. For drone data, fine-tune at the drone resolution (`gsd_m`, `lora_rank` in the fAIr | |
| adapter). | |
| - Damage is binary; severity levels are not predicted. | |
| - Harder cases (recall at the best-F1 cutoff, xBD test): dense areas 0.51 against 0.84 in sparse ones, small buildings | |
| 0.48 against 0.90 for large ones, and destroyed buildings 0.51 against about 0.73 for the other damage classes. | |
| Recall per event ranges from 0.51 (Hurricane Matthew) to 0.90 (Moore tornado). | |
| - Clouds and haze hide buildings; the model cannot see through them. | |
| ## Licence | |
| Weights: CC BY-NC-SA 4.0, inherited from the xBD training data (non-commercial). The encoder weights are under the DINOv3 License | |
| (see [facebook/dinov3-convnext-large-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-convnext-large-pretrain-lvd1689m)). Code: AGPL-3.0-only. | |
| ## Citation | |
| Developed as part of an EPFL master's thesis (VITA lab), in collaboration with the Humanitarian OpenStreetMap Team | |
| (fAIr). Training data: Gupta et al., 2019, [xBD: A Dataset for Assessing Building Damage from Satellite | |
| Imagery](https://arxiv.org/abs/1911.09296). Encoder: Siméoni et al., 2025, [DINOv3](https://arxiv.org/abs/2508.10104). | |