π General geospatial foundation model β π― one controlled change β πΊοΈ ISPRS Potsdam land-cover segmentation
| π§ͺ | |
|---|---|
| What is this? | KAO-TerraMind-B-Postdam is TerraMind-1.0-base fine-tuned on ISPRS Potsdam with variant B: loss - stronger overlap (Dice) term for small / rare classes. |
| Task | 6-class semantic segmentation Β· aerial RGB, 5 cm |
| Test mIoU | 78.66 (0.00 pp vs. the identically trained TerraMind-1.0-base, rank 4 / 7) |
| Overall accuracy | 86.57 % |
| Cost | 97.60 M parameters Β· 15.23 ms / 224 x 224 tile (T4, fp16, batch 1) |
| Purpose | π¬ Public, fully-specified checkpoint for reproducing the CVPR 2027 submission |
π§Ύ Training code is intentionally not included while the paper is under review. This repository ships the inference-only helper, the exact architecture / recipe config, and the full benchmark results.
| Property | Value |
|---|---|
| π·οΈ Model | KAO-TerraMind-B-Postdam |
| π§ Backbone | TerraMind-1.0-base (terramind_v1_base), initialised from ibm-esa-geospatial/TerraMind-1.0-base |
| π§© Decoder | UperNet (TerraTorch EncoderDecoderFactory) |
| ποΈ Input modality | RGB patch embedding Β· 3 x 224 x 224 Β· aerial RGB (R, G, B), 8-bit |
| π― Output | per-pixel logits over 6 classes |
| π Parameters | 97.60 M |
| π§ͺ Variant | B - Loss: stronger overlap (Dice) term for small / rare classes |
| ποΈ Dataset | ISPRS Potsdam - Aerial RGB orthophotos, 5 cm GSD, 38 tiles of 6000 x 6000 px |
| π¦ Checkpoint file | terramind_v1_kaoB_best.pt |
| π§ Library | TerraTorch >=1.2.4 |
KAO-TerraMind is a family of three controlled, single-factor adaptations of TerraMind-1.0-base. Everything else (data, seed, epochs, batch size, sampler, schedule, metrics) is identical to the baselines, so every difference can be attributed to one change.
TerraMind-1.0-base (identical training recipe)
β
ββββββββββββββββββββΌβββββββββββββββββββ
βΌ βΌ βΌ
π₯ KAO-A π― KAO-B π§© KAO-C
Optimisation Loss Decoder
backbone LR β Dice weight β wider UperNet
weight decay β deeper taps
This repository = π― KAO-B (Loss) - doubles the Dice term next to the class-weighted cross-entropy to push harder on small and rare classes.
| Setting | TerraMind-1.0-base (reference) | KAO-B |
|---|---|---|
| Dice loss weight | 0.5 | 1.0 |
| Hyper-parameter | Value |
|---|---|
| Optimiser | AdamW (backbone LR = base LR x multiplier, decoder LR = 1e-4) |
| Base learning rate / backbone multiplier | 1e-4 / 0.1 (variant A: 0.3) |
| Weight decay | 0.01 (variant A: 0.05) |
| Loss | class-weighted cross-entropy (sqrt-inverse-frequency weights) + Dice (weight 0.5; variant B: 1.0) |
| Epochs / early-stopping patience | 30 / 8 (checkpoint chosen on validation mIoU) |
| Batch size | 16 (same for every model) |
| Sampler | class-balanced, 6,000 windows per epoch |
| Window size / train stride | 224 x 224 / 112 px |
| Augmentation | random horizontal + vertical flips and 90Β° rotations |
| Precision / grad-clip | fp16 autocast / 1.0 |
| Normalisation | TerraMind RGB pre-training statistics (0-255 scale) |
| Seed | 42 |
| Hardware | 1 x NVIDIA Tesla T4 |
ISPRS Potsdam - Aerial RGB orthophotos, 5 cm GSD, 38 tiles of 6000 x 6000 px.
| ID | Class | Map colour | |
|---|---|---|---|
| 0 | π£οΈ | Impervious surfaces | #ffffff |
| 1 | π’ | Building | #0000ff |
| 2 | π± | Low vegetation | #00ffff |
| 3 | π³ | Tree | #00ff00 |
| 4 | π | Car | #ffff00 |
| 5 | ποΈ | Clutter | #ff0000 |
Mean metrics (mIoU / F1 / Prec. / Rec. / mAP) are averaged over the 5 foreground classes (Clutter excluded), the usual ISPRS convention. OA uses all pixels.
| Split | 224 x 224 windows |
|---|---|
| Train | 56,180 |
| Validation | 2,916 (up to 1,500 sampled per epoch for model selection) |
| Test | 10,206 |
4_12 does not use the standard ISPRS colour palette (all of its label pixels are mapped to ignore), and tile 6_7 has 0.68 % off-palette pixels. Both are training tiles.π ISPRS Potsdam is distributed for research use by ISPRS / BSF Swissphoto. Please check the dataset terms before using these weights beyond research.
All seven models are fine-tuned with the same recipe, seed and data, and evaluated on the same test windows. Best value per column in bold.
| Model | OA | mIoU | F1 | Prec. | Rec. | mAP | Params (M) | Latency (ms) |
|---|---|---|---|---|---|---|---|---|
| KAO-TerraMind-A | 87.07 | 79.37 | 88.36 | 87.31 | 89.46 | 94.90 | 97.60 | 15.04 |
| KAO-TerraMind-B β¬ this repo | 86.57 | 78.66 | 87.93 | 87.03 | 88.87 | 94.71 | 97.60 | 15.23 |
| KAO-TerraMind-C | 86.56 | 78.59 | 87.89 | 86.81 | 89.01 | 94.77 | 119.97 | 18.26 |
| TerraMind-1.0-tiny | 82.08 | 71.43 | 83.18 | 81.87 | 84.68 | 91.23 | 12.87 | 14.06 |
| TerraMind-1.0-small | 84.05 | 74.53 | 85.25 | 84.04 | 86.56 | 92.90 | 30.19 | 14.66 |
| TerraMind-1.0-base | 86.62 | 78.67 | 87.94 | 86.85 | 89.09 | 94.81 | 97.60 | 15.19 |
| TerraMind-1.0-large | 86.73 | 78.86 | 88.05 | 87.11 | 89.06 | 94.49 | 317.86 | 25.01 |
Latency: mean over 100 runs, batch 1, 224 x 224, fp16 autocast, NVIDIA Tesla T4. Mean metrics (mIoU / F1 / Prec. / Rec. / mAP) are averaged over the 5 foreground classes (Clutter excluded), the usual ISPRS convention. OA uses all pixels.
| Model | Changed factor | Overrides | mIoU | Ξ mIoU vs. base (pp) |
|---|---|---|---|---|
| TerraMind-1.0-base | - (reference) | - | 78.67 | +0.00 |
| KAO-TerraMind-A | optimisation: stronger backbone adaptation | backbone_lr_mult=0.3, weight_decay=0.05 |
79.37 | +0.70 |
| KAO-TerraMind-B β¬ | loss: stronger overlap (Dice) term for small / rare classes (e.g. car) | dice_weight=1.0 |
78.66 | -0.00 |
| KAO-TerraMind-C | decoder: wider UperNet, deeper-biased feature taps, more dropout | decoder_channels=512, head_dropout=0.2, indices=[3, 6, 9, 11] |
78.59 | -0.08 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| π£οΈ Impervious surfaces | 90.01 | 89.50 | 89.25 | 85.99 | 87.37 | 89.44 | 89.75 |
| π’ Building | 94.20 | 93.36 | 93.47 | 89.16 | 91.49 | 93.41 | 93.66 |
| π± Low vegetation | 83.35 | 83.03 | 83.15 | 78.92 | 80.86 | 83.29 | 83.14 |
| π³ Tree | 84.56 | 84.31 | 84.42 | 77.64 | 80.29 | 84.42 | 84.52 |
| π Car | 89.67 | 89.46 | 89.16 | 84.17 | 86.25 | 89.14 | 89.16 |
| ποΈ Clutter | 49.35 | 50.01 | 48.62 | 44.38 | 42.46 | 49.28 | 48.77 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| π£οΈ Impervious surfaces | 81.83 | 80.99 | 80.58 | 75.42 | 77.57 | 80.89 | 81.41 |
| π’ Building | 89.03 | 87.54 | 87.74 | 80.44 | 84.31 | 87.63 | 88.08 |
| π± Low vegetation | 71.46 | 70.98 | 71.16 | 65.19 | 67.87 | 71.37 | 71.15 |
| π³ Tree | 73.25 | 72.88 | 73.05 | 63.45 | 67.07 | 73.03 | 73.20 |
| π Car | 81.27 | 80.92 | 80.43 | 72.67 | 75.82 | 80.41 | 80.44 |
| ποΈ Clutter | 32.76 | 33.34 | 32.11 | 28.52 | 26.95 | 32.69 | 32.25 |
pip install "terratorch>=1.2.4" "diffusers==0.30.0" huggingface_hub pillow tifffile numpy torch
# downloads kao_terramind_inference.py + terramind_v1_kaoB_best.pt from this repo
hf download kaopanboonyuen/KAO-TerraMind-B-Postdam --local-dir KAO-TerraMind-B-Postdam # older huggingface_hub: huggingface-cli download
cd KAO-TerraMind-B-Postdam
python kao_terramind_inference.py \
--input my_tile.tif \
--output prediction.png \
--device cuda
Use --ckpt path/to/terramind_v1_kaoB_best.pt for a local checkpoint, --overlap 56 for smoother large-scene mosaics, and --save-index to also write the raw class-index map.
from kao_terramind_inference import load_model, predict_image, colorize, read_image
net, ck = load_model("terramind_v1_kaoB_best.pt", device="cuda")
img = read_image("my_tile.tif") # (H, W, 3) uint8
pred = predict_image(net, img, ck, device="cuda") # (H, W) class ids, any image size
rgb = colorize(pred) # (H, W, 3) uint8 map in the dataset palette
π Input contract: aerial RGB (R, G, B), 8-bit, any size (processed in 224 x 224 windows with zero-padded borders, exactly like the evaluation protocol). Normalisation statistics are read from the checkpoint.
| File | Description |
|---|---|
π README.md |
This model card |
βοΈ config.json |
Architecture arguments, class map, normalisation, recipe and test metrics |
π kao_terramind_inference.py |
Inference-only helper (checkpoint loading, tiled prediction, colour maps, CLI) |
π§ terramind_v1_kaoB_best.pt |
Fine-tuned weights (backbone + decoder + architecture arguments) |
If you use this model, please cite:
@article{panboonyuen2027kaoterramind,
title = {KAO-TerraMind: Targeted Adaptation of Geospatial Foundation Models for Dense Prediction},
author = {Panboonyuen, Teerapong},
note = {Manuscript in preparation for submission to the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2027)},
year = {2027}
}
KAO-TerraMind builds on TerraMind; please also cite:
@inproceedings{jakubik2025terramind,
title = {Terramind: Large-scale generative multimodality for earth observation},
author = {Jakubik, Johannes and Yang, Felix and Blumenstiel, Benedikt and Scheurer, Erik and Sedona, Rocco and Maurogiovanni, Stefano and Bosmans, Jente and Dionelis, Nikolaos and Marsocci, Valerio and Kopp, Niklas and others},
booktitle = {2025 IEEE/CVF International Conference on Computer Vision (ICCV)},
pages = {7383--7394},
year = {2025},
organization = {IEEE}
}
π TerraMind (IBM Β· ESA) Β· π₯ TerraTorch Β· π€ Hugging Face Β· ποΈ ISPRS Potsdam dataset creators Β· πΉπ Chulalongkorn University
Teerapong Panboonyuen, Ph.D. (Kao) Vice President of AI, Government Savings Bank C2F Postdoctoral Fellow, Chulalongkorn University Adjunct Professor, Khon Kaen University πΉπ Thailand
Research interests: Geospatial AI Β· Earth Observation Β· Foundation Models Β· Remote Sensing Β· Dense Prediction
From pixels to representations. From representations to intelligence.
KAO-TerraMind-B-Postdam Β· CVPR 2027 reproducibility release
ibm-esa-geospatial/TerraMind-1.0-base