🌍 General geospatial foundation model → 🎯 one controlled change → 🗺️ LoveDA land-cover segmentation
| 🧪 | |
|---|---|
| What is this? | KAO-TerraMind-A-LoveDa is TerraMind-1.0-base fine-tuned on LoveDA with variant A: optimisation - stronger backbone adaptation. |
| Task | 7-class semantic segmentation · satellite RGB, 0.3 m |
| Test mIoU | 48.88 (+0.27 pp vs. the identically trained TerraMind-1.0-base, rank 2 / 7) |
| Overall accuracy | 67.28 % |
| Cost | 97.60 M parameters · 26.28 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-A-LoveDa |
| 🧠 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 · satellite RGB (R, G, B), 8-bit |
| 🎯 Output | per-pixel logits over 7 classes |
| 📐 Parameters | 97.60 M |
| 🧪 Variant | A - Optimisation: stronger backbone adaptation |
| 🗂️ Dataset | LoveDA - Urban + Rural satellite RGB scenes, 0.3 m GSD, 1024 x 1024 px tiles |
| 📦 Checkpoint file | terramind_v1_kaoA_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-A (Optimisation) - lets the pretrained TerraMind encoder move further away from its pre-training solution (3x larger backbone learning rate, 5x larger weight decay).
| Setting | TerraMind-1.0-base (reference) | KAO-A |
|---|---|---|
| Backbone LR multiplier | 0.1 | 0.3 |
| Weight decay | 0.01 | 0.05 |
| 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 |
LoveDA - Urban + Rural satellite RGB scenes, 0.3 m GSD, 1024 x 1024 px tiles.
| ID | Class | Map colour | |
|---|---|---|---|
| 0 | 🏞️ | Background | #ffffff |
| 1 | 🏢 | Building | #ff0000 |
| 2 | 🛣️ | Road | #ffff00 |
| 3 | 💧 | Water | #0000ff |
| 4 | 🏜️ | Barren | #9f81b7 |
| 5 | 🌲 | Forest | #00ff00 |
| 6 | 🌾 | Agriculture | #ffc380 |
Val/ folder (Urban + Rural), because the official LoveDA test masks are not public.Train/ minus 10 % of the images (drawn separately from Urban and Rural, fixed seed) used only for checkpoint selection and early stopping. Test images are never used for any decision.All metrics are averaged over the 7 classes (Background included, no-data excluded), the usual LoveDA protocol.
| Split | 224 x 224 windows |
|---|---|
| Train | 183,789 |
| Validation | 6,325 (up to 1,500 sampled per epoch for model selection) |
| Test | 41,725 |
📜 LoveDA is released for non-commercial academic research (CC BY-NC-SA 4.0). 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 ⬅ this repo | 67.28 | 48.88 | 64.94 | 69.95 | 63.03 | 68.89 | 97.60 | 26.28 |
| KAO-TerraMind-B | 67.15 | 48.49 | 64.60 | 69.65 | 62.77 | 68.03 | 97.60 | 29.56 |
| KAO-TerraMind-C | 66.91 | 48.85 | 65.05 | 68.75 | 64.46 | 69.41 | 119.97 | 18.67 |
| TerraMind-1.0-tiny | 63.95 | 44.67 | 61.32 | 61.37 | 63.75 | 66.13 | 12.87 | 13.84 |
| TerraMind-1.0-small | 66.21 | 47.52 | 63.88 | 66.35 | 63.70 | 67.52 | 30.19 | 22.44 |
| TerraMind-1.0-base | 67.09 | 48.61 | 64.81 | 68.85 | 63.54 | 68.30 | 97.60 | 16.13 |
| TerraMind-1.0-large | 67.81 | 49.72 | 65.62 | 69.41 | 64.38 | 69.39 | 317.86 | 24.79 |
Latency: mean over 100 runs, batch 1, 224 x 224, fp16 autocast, NVIDIA Tesla T4. All metrics are averaged over the 7 classes (Background included, no-data excluded), the usual LoveDA protocol.
| Model | Changed factor | Overrides | mIoU | Δ mIoU vs. base (pp) |
|---|---|---|---|---|
| TerraMind-1.0-base | - (reference) | - | 48.61 | +0.00 |
| KAO-TerraMind-A ⬅ | optimisation: stronger backbone adaptation | backbone_lr_mult=0.3, weight_decay=0.05 |
48.88 | +0.27 |
| KAO-TerraMind-B | loss: stronger overlap (Dice) term for small / rare classes (e.g. car) | dice_weight=1.0 |
48.49 | -0.12 |
| KAO-TerraMind-C | decoder: wider UperNet, deeper-biased feature taps, more dropout | decoder_channels=512, head_dropout=0.2, indices=[3, 6, 9, 11] |
48.85 | +0.23 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| 🏞️ Background | 67.94 | 68.16 | 67.02 | 66.22 | 67.09 | 68.06 | 68.19 |
| 🏢 Building | 76.23 | 75.28 | 74.30 | 68.19 | 71.26 | 75.19 | 76.08 |
| 🛣️ Road | 68.15 | 68.09 | 67.60 | 58.30 | 64.44 | 67.71 | 69.10 |
| 💧 Water | 74.39 | 73.89 | 75.13 | 72.69 | 76.30 | 73.67 | 77.94 |
| 🏜️ Barren | 43.66 | 43.58 | 48.00 | 47.83 | 48.83 | 45.93 | 44.63 |
| 🌲 Forest | 58.26 | 57.38 | 55.89 | 55.25 | 54.47 | 57.30 | 57.52 |
| 🌾 Agriculture | 65.94 | 65.83 | 67.39 | 60.73 | 64.75 | 65.76 | 65.90 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| 🏞️ Background | 51.45 | 51.70 | 50.40 | 49.50 | 50.47 | 51.59 | 51.74 |
| 🏢 Building | 61.58 | 60.36 | 59.11 | 51.73 | 55.35 | 60.24 | 61.40 |
| 🛣️ Road | 51.69 | 51.62 | 51.05 | 41.14 | 47.54 | 51.19 | 52.79 |
| 💧 Water | 59.22 | 58.59 | 60.17 | 57.10 | 61.68 | 58.32 | 63.86 |
| 🏜️ Barren | 27.93 | 27.86 | 31.58 | 31.43 | 32.30 | 29.81 | 28.72 |
| 🌲 Forest | 41.10 | 40.23 | 38.79 | 38.17 | 37.42 | 40.16 | 40.37 |
| 🌾 Agriculture | 49.19 | 49.07 | 50.82 | 43.61 | 47.88 | 48.99 | 49.14 |
pip install "terratorch>=1.2.4" "diffusers==0.30.0" huggingface_hub pillow tifffile numpy torch
# downloads kao_terramind_inference.py + terramind_v1_kaoA_best.pt from this repo
hf download kaopanboonyuen/KAO-TerraMind-A-LoveDa --local-dir KAO-TerraMind-A-LoveDa # older huggingface_hub: huggingface-cli download
cd KAO-TerraMind-A-LoveDa
python kao_terramind_inference.py \
--input my_tile.tif \
--output prediction.png \
--device cuda
Use --ckpt path/to/terramind_v1_kaoA_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_kaoA_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: satellite 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_kaoA_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 · 🗂️ LoveDA 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-A-LoveDa · CVPR 2027 reproducibility release
ibm-esa-geospatial/TerraMind-1.0-base