Sign-guided neurosymbolic AI approach for coffee leaf macronutrients (NPK) deficiency detection and remedy recommendation
Macronutrient deficiencies, including nitrogen (N), phosphorus (P), and potassium (K), are a major cause of yield loss and reduced crop quality in precision agriculture. Although deep learning models have demonstrated strong performance in visual plant disease and nutrient deficiency recognition, their black-box nature limits interpretability, trust, and practical adoption by agronomists and farmers. In this work, we propose a sign-guided neurosymbolic framework for coffee leaf nutrient deficiency diagnosis that explicitly integrates agronomic knowledge with deep visual perception. The proposed approach introduces a sign-guided learning paradigm in which eight agronomically meaningful visual symptom indicators are first predicted from coffee leaf images using a ResNet-50 backbone. These indicators are then processed by a differentiable fuzzy rule engine that encodes expert-defined nutrient–symptom relationships to infer deficiencies. Unlike conventional CNNs, the model provides both class predictions and interpretable intermediate reasoning through sign activation scores and rule-based decision traces. The framework is further extended with a retrieval-augmented generation (RAG) module to provide knowledge-grounded explanations and remedy suggestions based on curated agronomic information. The framework is evaluated on a combined coffee leaf dataset constructed from the CoLeaf and BRACOL benchmarks. Experimental results demonstrate strong performance, achieving an accuracy of 0.88, F1-score of 0.87, AUC-ROC of 0.93, and PR-AUC of 0.91. Qualitative analysis using Grad-CAM and sign-activation visualizations demonstrates that the proposed approach provides semantically aligned explanations beyond conventional visual attribution methods. The proposed framework establishes an interpretable decision-support approach for coffee nutrient deficiency analysis, while further validation across diverse crops and field conditions remains necessary.
Authors
- Semanto Mondal (ORCID: https://orcid.org/0009-0000-2306-4478)
- Fabiano Pecorelli (ORCID: https://orcid.org/0000-0003-2446-4291)
- Martina Iammarino (ORCID: https://orcid.org/0000-0001-8025-733X)
- Giuseppe De Pietro (ORCID: https://orcid.org/0000-0002-4675-5957)
- Antonino Ferraro (ORCID: https://orcid.org/0000-0002-1326-0325)
Institutions
- Pegaso University (IT)
- University of Naples Federico II (IT)
Publication Details
- Journal
- Computers and Electronics in Agriculture
- Published
- 2026-11-06
- DOI
- https://doi.org/10.1016/j.compag.2026.112458
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00