UPDF AI

XAI-Crop: Explainable Counterfactual Crop Recommendation via Ensemble Learning

Abdullah Al Mahmud Joy,Md. Faizer Islam,2 Authors,Md. Mamun Hossain

2026 · DOI: 10.1109/ICECTE69292.2026.11429373
0 Citations

Abstract

Timely, data-driven crop selection is critical to crop productivity. While predictive accuracy is frequently emphasised in traditional crop recommendation systems, interpretability and actionable guidance features are lacking. This paper introduces XAI-Crop Ensemble, an interpretable and ensemble-based crop recommendation framework that uses a weighted soft-voting ensemble to achieve accuracy and robustness by integrating high-performance machine learning models, namely Random Forest, XGBoost, LightGBM, and CatBoost. A balanced dataset with seven agronomic features—nitrogen (N), phosphorus (P), potassium (K), temperature, humidity, pH, and rainfall—across 22 crop types was used to train and validate the framework. The ensemble outperformed or matched the best single model (CatBoost) with a classification accuracy of 99.77%.Temperature and pH had moderate effects, while humidity, potassium (K), and phosphorus (P) were the most influential features, according to SHapley Additive exPlanations (SHAP). DiCE and manual simulation counterfactual analyses produced useful farmer-level insights, such as modifying rainfall (+68 mm), N (+24 kg/ha), P (+25 kg/ha), and K (+37 kg/ha) to change the suitability of growing papaya instead of oranges. Consistent performance across all crop categories was confirmed by the fairness evaluation.All things considered, the XAI-Crop Ensemble provides an open and equitable framework that makes data-driven and understandable agricultural decision-making possible.