Crop recommendation is a vital part of precision agriculture as it helps farmers choose appropriate crops according to the nutrient profile and environmental conditions. This paper presents a crop recommendation framework in which Multi-Layer Perceptron (MLP), XGBoost, and Tab Transformer are first evaluated as baseline prediction models, followed by the proposed Krill Herd Optimization (KHO)-based explainable framework integrated with Explainable Artificial Intelligence (XAI). These eleven parameters are created based on agronomic and environmental aspects, namely: Nitrogen, Phosphorus, Potassium, Copper, Iron, Magnesium, Sulphur, Temperature, Rainfall, pH and Humidity. For better model transparency and to aid informed decision-making, model explanations with SHAP (SHapley Additive Explanations) and LIME (Local Interpretable Model-Agnostic Explanations) are used to identify feature contributions to crop predictions both locally and globally. The experimental results showed that Tab Transformer significantly outperformed the other models, with an accuracy of 0.99, precision of 0.98, recall of 0.99 and F1-score of 0.98. The proposed framework further incorporates Krill Herd Optimization (KHO) to generate optimized nutrient and climate profiles, while Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Simulated Annealing (SA) are used for comparative evaluation of optimization performance. By combining explainable AI with optimization methods, the framework improves crop suitability prediction and provides transparent insights into the factors influencing crop recommendations, ensuring reliable decision support for practical farming applications. The proposed framework supports precision agriculture by enabling data-driven crop selection, reducing unnecessary fertilizer usage, optimizing crop productivity, and promoting sustainable farming practices.
Smart crop recommendation: fusing nutrient and climate data with Krill Herd Optimization and explainable AI
P. Kumaresan
