DA3 DFC2023: AI model for building height estimation from satellite imagery
2 min readupdated
The model is designed to predict the normalized digital surface model (nDSM: height above ground in meters for each pixel) from a single RGB satellite image. It is built on Depth Anything 3 Base (DA3-BASE) using the ViT-B (Vision Transformer) architecture and trained on the DFC2023 dataset as part of an academic project. The tool evaluates how height model quality degrades when transferred to unseen cities (direct transfer). The solution targets computer vision and remote sensing researchers.
Key features
- Base architecture: uses the ViT-B encoder from Depth Anything 3, but without the standard camera encoder and decoder.
- Cross-city training: trained on tiles from six source cities (Berlin, Copenhagen, Portsmouth, New Delhi, Sydney, Sao Luis) without using target data.
- Height regression: the output layer produces values in meters with linear activation, and negative predictions are clipped to zero.
- Open source: distributed under the Apache 2.0 license for research tasks.
What you can do
- Cross-city analysis: explore the quality of height model transfer to new geographic regions and building types.
- Satellite processing: estimate building heights from high-resolution RGB tiles (such as SuperView-1 and Gaofen-2).
- Benchmarking: use the model as a baseline for further research on domain adaptation in remote sensing tasks.
Example
Loading the model and predicting heights for a satellite tile:
import json, torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from src.train import build_model
from src.data.dataset import to_input
repo = "AmmarAlmzayek/dfc2023-crosscity-da3-e2s0"
cfg = json.load(open(hf_hub_download(repo, "config.json")))
model = build_model(cfg["encoder"], pretrained=False, model=cfg["model"])
model.load_state_dict(load_file(hf_hub_download(repo, "model.safetensors")))
model = model.cuda().eval()
rgb = ... # (512, 512, 3) uint8 tile
with torch.no_grad(), torch.autocast("cuda", dtype=torch.float16):
height_m = model(to_input(rgb)[None].cuda()).float().clamp_min(0)[0, 0]
Read more
DetailsBenchmarks (RMSE on target cities): New York - 22.42 m (px) / 34.63 m (bldg); Barcelona - 9.22 m / 10.72 m; Rio - 9.15 m / 14.26 m; San Diego - 2.26 m / 3.53 m; Brasilia - 2.64 m / 4.39 m.
Training: 5000 steps, effective batch size 8, AdamW optimizer (lr 5e-5 for the head, 5e-6 for ViT), fp16 mixed precision.
Limitations: the model has not been tested on other sensors and is not intended for engineering or construction tasks; tall buildings are often underestimated.










Comments