Skip to content
Other

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 moreDetails
Benchmarks (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.
Discuss Telegram 0

Will it run?

Runs in F32

Fits without quantisation.

  • F32weights 0.4 GB · ready files0.9 GB
  • BF16weights 0.2 GB0.7 GB
  • FP8 / INT8recommendedweights 0.1 GB0.6 GB
  • 4-bitweights 0.1 GB0.6 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · F32 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # AmmarAlmzayek/dfc2023-crosscity-da3-e2s0
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download AmmarAlmzayek/dfc2023-crosscity-da3-e2s0 --local-dir ~/models/dfc2023-crosscity-da3-e2s0
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b41from November 25, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of DA3-BASE (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 10All on Hugging Face
Fine-tunes 6All on Hugging Face

About the model

AmmarAlmzayek/dfc2023-crosscity-da3-e2s0
Author
AmmarAlmzayek
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments