Early identification of nutrient deficiencies is essential for maintaining coffee yield, improving bean quality, and supporting sustainable agricultural practices. Visual diagnosis under field conditions is often subjective, whereas laboratory-based analyses are time-consuming, costly, and impractical for routine monitoring. This study presents an explainable artificial intelligence framework for automated classification of coffee leaf nutrient deficiencies using the CoLeaf-DB dataset. The proposed framework identifies eight individual mineral deficiencies, a multiple-deficiency class, and healthy leaves. A comprehensive comparative analysis was conducted by evaluating representative classical machine learning and deep learning models under both controlled conditions and synthetically generated field-like conditions. To enhance model robustness, leaf segmentation, randomized background generation, and photometric augmentation were incorporated into the training pipeline to approximate selected sources of visual variability encountered during field image acquisition. Experimental results demonstrated that the Support Vector Machine achieved the highest classification performance, with accuracies of 74.9% and 75.3% on the clean and simulated field-like test sets, respectively. Among the remaining models, the Multi-Layer Perceptron and XGBoost also achieved competitive simulated field-like accuracies of 73.7% and 73.3%, respectively. Transfer learning substantially improved ResNet50 performance, increasing accuracy from 67.1% under scratch training to 71.4% with transfer learning on the clean dataset and from 62.4% to 70.2% under simulated field-like conditions. Illustrative Grad-CAM, LIME, and SHAP analyses of a representative potassium-deficiency example showed that the examined prediction was associated with chlorotic and necrotic leaf regions rather than the surrounding background. The proposed framework combines predictive modelling with interpretable decision analysis and provides a comparative basis for automated coffee leaf nutrient-deficiency classification; however, the multiple-deficiency class showed very limited diagnostic performance (MCC = 0.087, sensitivity = 0.095, and F1-score = 0.129), indicating that the present framework is substantially less reliable for simultaneous deficiencies than for individual nutrient-deficiency classes. An explainable AI framework was developed for robust coffee leaf nutrient deficiency classification. Support Vector Machine achieved the highest accuracies of 74.9% and 75.3% under clean and realistic conditions Transfer learning improved ResNet50 performance by 4.3 and 7.8 percentage points, respectively. Background randomization reduced shortcut learning and enhanced real-world model generalization. Grad-CAM, LIME, and SHAP confirmed biologically meaningful and transparent model decisions. The proposed framework supports reliable and explainable precision coffee nutrient management.
No takes yet. Share an insight, caveat, or question.
Açıcı et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: