ffdamage-xbd: int8 ONNX, checkpoint, model card
#1
by MikyLanfra - opened
- ffdamage_xbd/README.md +97 -0
- ffdamage_xbd/SHA256SUMS +4 -0
- ffdamage_xbd/ffdamage_xbd.onnx +3 -0
- ffdamage_xbd/ffdamage_xbd.pt +3 -0
- ffdamage_xbd/meta.json +20 -0
ffdamage_xbd/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-sa-4.0
|
| 3 |
+
library_name: onnxruntime
|
| 4 |
+
pipeline_tag: object-detection
|
| 5 |
+
tags:
|
| 6 |
+
- building-damage
|
| 7 |
+
- disaster-response
|
| 8 |
+
- remote-sensing
|
| 9 |
+
- dinov3
|
| 10 |
+
- lora
|
| 11 |
+
- centernet
|
| 12 |
+
- fair
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# ffdamage-xbd
|
| 16 |
+
|
| 17 |
+
Footprint-free building damage detection from a single post-event satellite image. The model returns one point per
|
| 18 |
+
building with a detection `score` and the probability `p_damaged` that the building is damaged (minor, major or
|
| 19 |
+
destroyed in xBD terms, against no damage). It needs no building footprints and no pre-event image.
|
| 20 |
+
|
| 21 |
+
Code, fine-tuning and the HOT fAIr adapter: [github.com/MikyLanfra/ffdamage](https://github.com/MikyLanfra/ffdamage)
|
| 22 |
+
(tag `v0.1.0`).
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
|
| 26 |
+
| file | what it is |
|
| 27 |
+
|---|---|
|
| 28 |
+
| `ffdamage_xbd.onnx` | serving model, 245 MB: int8 weights on MatMul/Gemm (per channel), convolutions fp32 |
|
| 29 |
+
| `ffdamage_xbd.pt` | full PyTorch checkpoint, 810 MB (LoRA merged), used for fine-tuning |
|
| 30 |
+
| `meta.json` | input resolution (`gsd_m` 0.5), normalisation, stride, default thresholds, licence |
|
| 31 |
+
| `SHA256SUMS` | checksums |
|
| 32 |
+
|
| 33 |
+
## Architecture
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
RGB image, resampled to 0.5 m/px, sides padded to a multiple of 32
|
| 37 |
+
-> DINOv3 ConvNeXt-L encoder (frozen), LoRA rank 16 on the two pointwise (MLP) layers of every block
|
| 38 |
+
-> stage outputs at stride 8, 16, 32, each projected to 256 channels (1x1 conv + GroupNorm + 3x3 conv + GroupNorm)
|
| 39 |
+
-> top-down fusion to stride 8 (upsample + add + 3x3 conv), two 3x3 conv + GroupNorm + GELU layers
|
| 40 |
+
-> three heads on the stride-8 grid:
|
| 41 |
+
heat 1 channel, sigmoid: building-centre heatmap
|
| 42 |
+
offset 2 channels: sub-cell position of the centre
|
| 43 |
+
damage 2-layer MLP on the cell feature, sigmoid: p_damaged
|
| 44 |
+
-> decode: 3x3 max-pool peak finding, top 600 peaks, score cutoff -> points (x, y, score, p_damaged)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
- Encoder: `facebook/dinov3-convnext-large-pretrain-lvd1689m`. About 200 M parameters in total, almost all in the
|
| 48 |
+
encoder. The LoRA adapters are merged into the encoder weights in both released files, so they add no inference cost.
|
| 49 |
+
- Training targets follow CenterNet: a Gaussian at each building's centre (polygon centroid, or an interior point when
|
| 50 |
+
the centroid falls outside), penalty-reduced focal loss on the heatmap, L1 on the offset, and binary cross-entropy on
|
| 51 |
+
`p_damaged` at the centre cell. Buildings with unknown damage train detection only.
|
| 52 |
+
- Large images are processed in 1024 px windows with 128 px overlap; each point is kept only from the core of the
|
| 53 |
+
window that found it, so there are no duplicates across windows.
|
| 54 |
+
|
| 55 |
+
## Training
|
| 56 |
+
|
| 57 |
+
xBD (xView2), all events, post-event images only, binary damage labels. 1024 px crops at native resolution (about
|
| 58 |
+
0.5 m), random flips and 90-degree rotations, batch 4, AdamW at learning rate 1e-4, LoRA rank 16 (alpha 32), 12 epochs
|
| 59 |
+
with early stopping on validation (patience 4), one L40S GPU, about 2.6 h.
|
| 60 |
+
|
| 61 |
+
## Evaluation (xBD test split, released int8 model)
|
| 62 |
+
|
| 63 |
+
2,184 test tiles, 80,400 buildings, 19,123 of them damaged. A point counts as a hit when it lies inside a building
|
| 64 |
+
footprint buffered by 1.5 m; matching is one-to-one by descending score. Cutoffs are chosen on the validation split.
|
| 65 |
+
|
| 66 |
+
| operating point | building recall | precision | damaged recall (p >= 0.5) | damage AUROC |
|
| 67 |
+
|---|---|---|---|---|
|
| 68 |
+
| best F1 on validation (cutoff 0.30) | 0.713 | 0.775 | 0.565 | 0.979 |
|
| 69 |
+
|
| 70 |
+
The fp32 model scores the same within 0.01 on every metric (recall 0.707, precision 0.782, AUROC 0.979). The default
|
| 71 |
+
`confidence_threshold` 0.306 is the best-F1 cutoff of the fp32 validation run.
|
| 72 |
+
|
| 73 |
+
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
|
| 74 |
+
memory under 2 GB.
|
| 75 |
+
|
| 76 |
+
## Intended use and limits
|
| 77 |
+
|
| 78 |
+
- Rapid post-disaster triage on satellite or aerial RGB at about 0.3 to 0.6 m. Points mark buildings to inspect; they
|
| 79 |
+
are not a damage assessment by themselves.
|
| 80 |
+
- Not trained on drone imagery. For drone data, fine-tune at the drone resolution (`gsd_m`, `lora_rank` in the fAIr
|
| 81 |
+
adapter).
|
| 82 |
+
- Damage is binary; severity levels are not predicted.
|
| 83 |
+
- Harder cases (recall at the best-F1 cutoff, xBD test): dense areas 0.51 against 0.84 in sparse ones, small buildings
|
| 84 |
+
0.48 against 0.90 for large ones, and destroyed buildings 0.51 against about 0.73 for the other damage classes.
|
| 85 |
+
Recall per event ranges from 0.51 (Hurricane Matthew) to 0.90 (Moore tornado).
|
| 86 |
+
- Clouds and haze hide buildings; the model cannot see through them.
|
| 87 |
+
|
| 88 |
+
## Licence
|
| 89 |
+
|
| 90 |
+
Weights: CC BY-NC-SA 4.0, inherited from the xBD training data (non-commercial). The encoder weights are under the DINOv3 License
|
| 91 |
+
(see [facebook/dinov3-convnext-large-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-convnext-large-pretrain-lvd1689m)). Code: AGPL-3.0-only.
|
| 92 |
+
|
| 93 |
+
## Citation
|
| 94 |
+
|
| 95 |
+
Developed as part of an EPFL master's thesis (VITA lab), in collaboration with the Humanitarian OpenStreetMap Team
|
| 96 |
+
(fAIr). Training data: Gupta et al., 2019, [xBD: A Dataset for Assessing Building Damage from Satellite
|
| 97 |
+
Imagery](https://arxiv.org/abs/1911.09296). Encoder: Siméoni et al., 2025, [DINOv3](https://arxiv.org/abs/2508.10104).
|
ffdamage_xbd/SHA256SUMS
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
d670ed4f69135c49ace795e1e0f7c48774b30307ac35ffdf78a518eff119d0e2 ffdamage_xbd.onnx
|
| 2 |
+
1fc4dcfc61b70ccb788fcc7619831ff12fc798bf505ccaed30d5b71216d3ec9b ffdamage_xbd.pt
|
| 3 |
+
fdf23073e838a06d1f52e7b606ef2ac83274b403eea918eace5802b26ef0014b meta.json
|
| 4 |
+
fc62e899bab47ffff18445819e64afbcba6fa4383f40f38715fa910a4891e7a3 README.md
|
ffdamage_xbd/ffdamage_xbd.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d670ed4f69135c49ace795e1e0f7c48774b30307ac35ffdf78a518eff119d0e2
|
| 3 |
+
size 245137174
|
ffdamage_xbd/ffdamage_xbd.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1fc4dcfc61b70ccb788fcc7619831ff12fc798bf505ccaed30d5b71216d3ec9b
|
| 3 |
+
size 809597662
|
ffdamage_xbd/meta.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stride": 8,
|
| 3 |
+
"mean": [
|
| 4 |
+
0.48500001430511475,
|
| 5 |
+
0.4560000002384186,
|
| 6 |
+
0.4059999883174896
|
| 7 |
+
],
|
| 8 |
+
"std": [
|
| 9 |
+
0.2290000021457672,
|
| 10 |
+
0.2240000069141388,
|
| 11 |
+
0.22499999403953552
|
| 12 |
+
],
|
| 13 |
+
"gsd_m": 0.5,
|
| 14 |
+
"score_threshold": 0.3062147796154022,
|
| 15 |
+
"source_run": "thesis run cnx_centernet_point_r1_lora16 (xBD, all events)",
|
| 16 |
+
"threshold_source": "best F1 on the xBD validation split",
|
| 17 |
+
"onnx_precision": "int8mm",
|
| 18 |
+
"damage_threshold": 0.5,
|
| 19 |
+
"licence": "CC-BY-NC-SA-4.0 (weights); DINOv3 License (encoder)"
|
| 20 |
+
}
|