Enhancing Crop Prediction with Explainable AI: A SHAP-Based Approach
Enhancing Crop Prediction with Explainable AI: A SHAP-Based Approach
Himanshu Gupta,Aakarshan Sharma,Shashwat Sharma,V. Dixit
Abstract
Optimal agricultural outcomes demand precise crop prediction and effective monitoring of environmental stress factors. A robust machine learning framework for enhancing crop recommendation and health assessment is introduced in this study, utilizing LightGBM - an efficient algorithm optimized for large-scale tabular data. Predicting crop outcomes (such as yield or optimal crop variety) from complex, multi-source data. Preprocessing steps include strategic handling of missing values, Synthetic Minority Over-sampling Technique (SMOTE) for class balancing, and label encoding for categorical transformation. Preprocessed data are then used to train and evaluate predictive models. To enhance interpretability and transparency, SHapley Additive exPlanations (SHAP) are applied to the LightGBM outputs, offering global and instance-level explanations that quantify each feature's contribution to model decisions. The LightGBM model demonstrated outstanding performance with 98.64% accuracy, 98.77% precision, and 98.64% recall. Alternative architectures, including traditional classifiers, were surpassed by these metrics. These results beat ResNet, CNN, and Logistic Regression. Minimal misclassifications were revealed by the confusion matrix, and strong model generalization across diverse crop and environmental conditions was indicated. Execution efficiency was maintained with fast training times, supporting the model's deployment potential in real-time agronomic systems. By integrating model explainability, high accuracy, and agronomic domain knowledge, the proposed system significantly advances smart farming applications. Precision agriculture is supported through the provision of actionable and trustworthy crop recommendations aligned with environmental constraints and soil health-allowing farmers to be empowered with transparent and sustainable decision-making tools.
