π General-purpose geospatial foundation model β π― one controlled change β πΉπ Thailand-specific GeoAI
| π§ͺ | |
|---|---|
| What is this? | KAO-TerraMind-A is TerraMind-1.0-base fine-tuned on GISTDA Thailand with variant A: optimisation - stronger backbone adaptation. |
| Task | 10-class semantic segmentation Β· Sentinel-2 L2A, 12 bands |
| Test mIoU | 40.81 (-0.02 pp vs. the identically trained TerraMind-1.0-base, rank 4 / 7) |
| Overall accuracy | 78.61 % |
| Cost | 99.37 M parameters Β· 15.16 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 |
| π§ Backbone | TerraMind-1.0-base (terramind_v1_base), initialised from ibm-esa-geospatial/TerraMind-1.0-base |
| π§© Decoder | UperNet (TerraTorch EncoderDecoderFactory) |
| ποΈ Input modality | S2L2A patch embedding Β· 12 x 224 x 224 Β· Sentinel-2 L2A surface reflectance (x10000), 12 bands (B1, B2, B3, B4, B5, B6, B7, B8, B8A, B9, B11, B12) |
| π― Output | per-pixel logits over 10 classes |
| π Parameters | 99.37 M |
| π§ͺ Variant | A - Optimisation: stronger backbone adaptation |
| ποΈ Dataset | GISTDA Thailand - GISTDA Earth Observation data over Thailand (~40,000 kmΒ²), Sentinel-2 L2A, pre-cut 224 x 224 chips |
| π¦ 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 pre-cut chips (no sliding window in training) |
| Augmentation | random horizontal + vertical flips and 90Β° rotations |
| Precision / grad-clip | fp16 autocast / 1.0 |
| Normalisation | TerraMind S2L2A pre-training statistics (raw reflectance scale, per band) |
| Seed | 42 |
| Hardware | 1 x NVIDIA Tesla T4 |
GISTDA Thailand - GISTDA Earth Observation data over Thailand (~40,000 kmΒ²), Sentinel-2 L2A, pre-cut 224 x 224 chips.
| ID | Class | Map colour | |
|---|---|---|---|
| 0 | π½ | Maize | #d81bf0 |
| 1 | πΎ | Sugarcane | #9b1c2c |
| 2 | π± | Cassava | #5bb5ee |
| 3 | π | Rice | #e07bc0 |
| 4 | πΏ | Other Crops | #e8a000 |
| 5 | π§ | Water | #2a74d0 |
| 6 | π³ | Trees | #0a8a0a |
| 7 | π | Flooded Veg. | #20a880 |
| 8 | ποΈ | Built Area | #e04848 |
| 9 | πΊοΈ | Other | #4a3aa8 |
All metrics are macro-averaged over the 10 classes present in the test set; OA uses all labelled pixels.
| Split | 224 x 224 chips |
|---|---|
| Train | 30,638 |
| Validation | 5,462 (used for model selection only) |
| Test | 13,974 |
config.json and the test metrics in this card are the reproducibility artefacts.π The GISTDA data is not redistributed here and remains subject to GISTDA's own terms. 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 | 78.61 | 40.81 | 52.48 | 50.59 | 55.78 | 52.69 | 99.37 | 15.16 |
| KAO-TerraMind-B | 78.31 | 40.97 | 52.74 | 50.61 | 56.27 | 52.76 | 99.37 | 19.65 |
| KAO-TerraMind-C | 78.90 | 41.13 | 52.80 | 50.60 | 56.44 | 53.03 | 121.74 | 19.39 |
| TerraMind-1.0-tiny | 75.00 | 37.18 | 48.61 | 46.56 | 54.03 | 49.31 | 13.31 | 15.09 |
| TerraMind-1.0-small | 77.75 | 39.05 | 50.58 | 48.12 | 54.62 | 50.85 | 31.08 | 14.13 |
| TerraMind-1.0-base | 78.44 | 40.82 | 52.57 | 49.84 | 56.75 | 52.63 | 99.37 | 15.15 |
| TerraMind-1.0-large | 76.34 | 40.13 | 52.04 | 49.05 | 58.58 | 52.70 | 320.22 | 24.95 |
Latency: mean over 100 runs, batch 1, 224 x 224, fp16 autocast, NVIDIA Tesla T4. All metrics are macro-averaged over the 10 classes present in the test set; OA uses all labelled pixels.
| Model | Changed factor | Overrides | mIoU | Ξ mIoU vs. base (pp) |
|---|---|---|---|---|
| TerraMind-1.0-base | - (reference) | - | 40.82 | +0.00 |
| KAO-TerraMind-A β¬ | optimisation: stronger backbone adaptation | backbone_lr_mult=0.3, weight_decay=0.05 |
40.81 | -0.02 |
| KAO-TerraMind-B | loss: stronger overlap (Dice) term for rare crop classes | dice_weight=1.0 |
40.97 | +0.14 |
| KAO-TerraMind-C | decoder: wider UperNet, deeper-biased feature taps, more dropout | decoder_channels=512, head_dropout=0.2, indices=[3, 6, 9, 11] |
41.13 | +0.30 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| π½ Maize | 12.75 | 13.36 | 12.06 | 8.64 | 12.41 | 12.98 | 13.61 |
| πΎ Sugarcane | 36.90 | 37.09 | 36.83 | 32.84 | 35.27 | 37.39 | 37.28 |
| π± Cassava | 21.19 | 21.61 | 21.39 | 16.67 | 17.94 | 21.29 | 21.45 |
| π Rice | 41.77 | 41.84 | 41.60 | 39.41 | 38.83 | 41.31 | 42.04 |
| πΏ Other Crops | 78.59 | 78.16 | 79.07 | 74.76 | 78.65 | 78.52 | 74.71 |
| π§ Water | 82.11 | 82.41 | 82.54 | 78.41 | 80.08 | 81.99 | 81.21 |
| π³ Trees | 91.86 | 91.82 | 91.94 | 90.43 | 90.93 | 91.73 | 91.76 |
| π Flooded Veg. | 26.83 | 27.55 | 28.46 | 21.44 | 23.77 | 27.13 | 26.21 |
| ποΈ Built Area | 85.30 | 85.22 | 85.41 | 81.29 | 83.34 | 85.01 | 84.88 |
| πΊοΈ Other | 47.55 | 48.28 | 48.68 | 42.24 | 44.58 | 48.36 | 47.22 |
| Class | KAO-A | KAO-B | KAO-C | TM-Tiny | TM-Small | TM-Base | TM-Large |
|---|---|---|---|---|---|---|---|
| π½ Maize | 6.81 | 7.16 | 6.42 | 4.52 | 6.62 | 6.94 | 7.30 |
| πΎ Sugarcane | 22.62 | 22.77 | 22.57 | 19.65 | 21.41 | 22.99 | 22.91 |
| π± Cassava | 11.85 | 12.11 | 11.98 | 9.09 | 9.85 | 11.91 | 12.01 |
| π Rice | 26.39 | 26.46 | 26.26 | 24.54 | 24.10 | 26.03 | 26.61 |
| πΏ Other Crops | 64.73 | 64.15 | 65.39 | 59.69 | 64.81 | 64.64 | 59.63 |
| π§ Water | 69.65 | 70.09 | 70.27 | 64.49 | 66.78 | 69.48 | 68.36 |
| π³ Trees | 84.94 | 84.88 | 85.08 | 82.53 | 83.36 | 84.73 | 84.77 |
| π Flooded Veg. | 15.49 | 15.98 | 16.59 | 12.01 | 13.49 | 15.69 | 15.08 |
| ποΈ Built Area | 74.36 | 74.25 | 74.54 | 68.48 | 71.44 | 73.93 | 73.74 |
| πΊοΈ Other | 31.19 | 31.82 | 32.17 | 26.77 | 28.68 | 31.89 | 30.91 |
pip install "terratorch>=1.2.4" "diffusers==0.30.0" huggingface_hub rasterio tifffile numpy torch
# downloads kao_terramind_inference.py + terramind_v1_kaoA_best.pt from this repo
hf download kaopanboonyuen/KAO-TerraMind-A --local-dir KAO-TerraMind-A # older huggingface_hub: huggingface-cli download
cd KAO-TerraMind-A
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, 12) float32 reflectance
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: a 12-band Sentinel-2 L2A GeoTIFF with surface reflectance scaled x10000, bands in this order: B1, B2, B3, B4, B5, B6, B7, B8, B8A, B9, B11, B12. Any size is accepted (processed in 224 x 224 windows with zero-padded borders). 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 Β· πΉπ GISTDA Earth Observation data Β· πΉπ 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 Β· CVPR 2027 reproducibility release
ibm-esa-geospatial/TerraMind-1.0-base