This repository implements a multimodal crop yield prediction pipeline using TerraMind (IBM/ESA), a geospatial foundation model pretrained on multimodal Earth observation data.
- Backbone:
terramind_v1_base— pretrained on Sentinel-1, Sentinel-2, DEM, and other geospatial modalities - Framework: TerraTorch — fine-tuning framework for geospatial foundation models
- Task: Field-level crop yield prediction (corn & soybean) in Iowa
- Temporal resolution: 24 weekly timesteps (April–September growing season)
Project overview: multimodal inputs (Sentinel-1 SAR, Sentinel-2 optical, soil, synthetic weather, CDL, DEM) across time are encoded by TerraMind, temporally aggregated via Co-Pool, and passed to a downstream decoder to produce field-level yield map predictions. (PDF)
python yld_proc/save_parquet_chunks.pyConvert yearly CSV files into chunked parquet files.
python yld_proc/data_processing.pyCombine chunks into a single parquet file.
python extract_field_coordinates.pyExtract field boundaries into a CSV file to download geospatial data.
python yld_proc/generate_yield_geotiffs.pyGenerate yield GeoTIFFs for each field.
python generate_weather.pyGenerate 10m resolution weather TIF files:
- Input: 1km Daymet weather data
- Process: Identify overlapping 1km pixels per field → compute spatial mean → resample to 10m
- Output: Field-aligned weather TIF files
python generate_data_timeseries.pyGenerate modality data for each field. Only includes dates where all modalities are available.
Check
used_dates_log.txtfor dates used. Use_xrsuffix to save xarray format.
python process_ts_weekly.pyProcess and save field-level data for all modalities.
python gen_splits.pyGenerate train.txt, val.txt, and test.txt for data splitting.
| Config | Description |
|---|---|
| conf_M1 | Frozen encoder, S1+S2+DEM |
| conf_M1_5 | Fine-tuned encoder, S1+S2+DEM |
| conf_M2 | Fine-tuned encoder, all modalities (S1+S2+DEM+Weather+CDL+Soil) |
| conf_M3 | Modality ablation |
| conf_M4 | Cumulative temporal evaluation |
| conf_M5 | Backward temporal elimination |
| conf_M6 | Frozen encoder + optimal timepoints from M5 |
terratorch fit -c conf_M1/s12d_24_corn.yamlTrain the model using the specified config file. Replace with other configs as needed.
terratorch test -c conf_M1/s12d_24_corn.yaml \
--ckpt output/<experiment>/checkpoints/<best_epoch>.ckptEvaluate the model with the specified config and checkpoint. Replace with other configs/ckpts as needed.
Experiment statistics are automatically logged to wandb.
