Data and Source Code for the FiLM-MTL Crop Recommendation Framework

Published: 6 September 2026| Version 1 | DOI: 10.17632/v3ny75bp5m.1
Contributor:
Leopord UWAMAHORO

Description

This repository contains the data and source code supporting the FiLM-MTL framework for joint crop recommendation, yield prediction, and climate-stress assessment. The study uses four heterogeneous agricultural datasets. Dataset I was derived by enriching the Rwanda Soil Nutrient Balance dataset available from Zenodo (Record 7112371) with historical weather and environmental information. Datasets II–IV originate from publicly available agricultural datasets. Original data sources and applicable licence information are documented in the accompanying README file. The repository also contains the source code and supporting materials used for preprocessing, model training, evaluation, climate-perturbation analysis, and crop recommendation.

Files

Steps to reproduce

Download and extract the repository ZIP file. Install the required Python packages, including PyTorch, NumPy, pandas, scikit-learn, Matplotlib, joblib, and Gradio. Dataset I is included in the repository. Datasets II–IV should be downloaded from their original public repositories using the links provided in the README file and placed in the corresponding dataset directory. Open Multask_Source_code.ipynb and run the cells sequentially to reproduce the data preprocessing, FiLM-MTL model training, crop recommendation, yield prediction, climate-stress assessment, climate-perturbation analysis, and model evaluation. Saved model and preprocessing artifacts are provided under models/Dataset III/. The deployed crop recommendation interface can be run using python app_v2.py, which generates the top three crop recommendations together with predicted yield, climate-risk level, confidence, and suitability score.

Institutions

Categories

Computer, Agriculture

Licence