Official implementation of DFYP: A Dynamic Fusion Framework with Spectral Channel Attention and Adaptive Operator Learning for Crop Yield Prediction
Accepted by IEEE Transactions on Geoscience and Remote Sensing (TGRS), 2026
Paper: https://doi.org/10.1109/TGRS.2026.3684831
Crop yield prediction is a fundamental task in precision agriculture, requiring effective modeling of complex spatial, temporal, and cross-modal dependencies from remote sensing and environmental observations. In this work, we propose DFYP, a dynamic fusion framework for crop yield prediction that integrates spectral channel attention with adaptive operator learning to improve representation quality and prediction robustness. The framework is designed to better capture informative spectral responses, exploit complementary cues across modalities, and adaptively model interactions that vary across regions and growing conditions.
conda create -n dfyp python=3.9
conda activate dfyp
git clone https://github.com/onef1shy/DFYP.git
cd DFYP
pip install -r requirements.txtDownload the datasets and place them under ./datasets/.
- MODIS branch (processed dataset): We provide a processed dataset that can be used directly at https://huggingface.co/datasets/onef1shy/Crop-Yield-Prediction-MODIS. No additional preprocessing is required. The preprocessing pipeline can be referenced from pycrop-yield-prediction.
- Sentinel-2 branch (Tiny-CropNet): https://huggingface.co/datasets/fudong03/Tiny-CropNet/tree/main
After downloading the Sentinel-2 data, generate the provided json split files with:
python data/build_sentinel_json.pyThe datasets directory should look like:
datasets/
├── modis/
│ └── processed_data/
│ ├── histogram_all_full.npz
│ ├── 2003_17_1.npy
│ ├── 2003_17_3.npy
│ ├── ...
│ └── 2016_5_95.npy
└── sentinel2/
├── Sentinel-2 Imagery/
├── USDA/
├── WRF-HRRR/
└── json/
├── corn/
│ ├── corn_train.json
│ └── corn_test.json
├── cotton/
│ ├── cotton_train.json
│ └── cotton_test.json
├── soybean/
│ ├── soybean_train.json
│ └── soybean_test.json
└── winterwheat/
├── winterwheat_train.json
└── winterwheat_test.json
Download the released checkpoints from Google Drive: Google Drive, and place them under ./checkpoints/.
You can then evaluate the released checkpoints directly.
Evaluate a MODIS checkpoint:
python run.py eval_modis --checkpoint_path=checkpoints/modis/2015.pth --predict_year=2015Evaluate a Sentinel-2 checkpoint:
python run.py eval_sentinel --checkpoint_path=checkpoints/sentinel2/corn.pth --crop=cornIf you want to retrain the model or use different operator settings, you can use the following commands.
Train the MODIS branch:
python run.py train_modisTrain the Sentinel-2 branch:
python run.py train_sentinelTrain a single Sentinel-2 crop:
python run.py train_sentinel --crop=cornFor the MODIS branch, the operator used for each prediction year is fixed from the stage-1 validation RMSE based selection procedure described in the paper:
2009:scharr2010:scharr2011:sobel2012:learnable2013:scharr2014:learnable2015:sobel
If you want to change the MODIS year-specific operators:
python run.py train_modis \
--year_operator_map="2009:scharr,2010:scharr,2011:sobel,2012:learnable,2013:scharr,2014:learnable,2015:sobel"For the Sentinel-2 branch, the selected operators for the four crops are:
corn:sobelcotton:scharrsoybean:sobelwinter wheat:scharr
If you find this repository useful in your research, please cite the paper:
@article{zhang2026dfyp,
title={DFYP: A Dynamic Fusion Framework with Spectral Channel Attention and Adaptive Operator learning for Crop Yield Prediction},
author={Zhang, Juli and Yan, Zeyu and Zhang, Jing and Miao, Qiguang and Wang, Quan},
journal={IEEE Transactions on Geoscience and Remote Sensing},
year={2026},
publisher={IEEE}
}