Crop nutrition deficiency poses a major challenge to achieving optimal yield, particularly in smallholder farming systems where timely expert diagnosis is limited. Early detection is crucial to minimize losses and reduce unnecessary fertilizer or pesticide usage. While deep learning offers potential for automated visual diagnosis, most existing approaches operate as black boxes and lack interpretability, explainability, or actionable recommendations. In this work, we present a neurosymbolic framework for early nutrient deficiency detection in ash gourd leaves using the EarlyNSD dataset. Our approach integrates a ResNet-50 backbone with a dual-head design: a classification head for deficiency prediction and a concept-prediction head that quantifies physiologically meaningful visual patterns such as yellowing, edge discoloration, spots, and vein greenness. These concept scores are combined with predefined domain rules to guide the learning of the neural component and to generate transparent, human-aligned explanations for each diagnosis. Building on the model outputs, we incorporate a Retrieval Augmented Generation (RAG)-based pipeline along with an agricultural knowledge base to generate targeted recommendations. This approach overcomes key shortcomings of pure neural models by incorporating domain knowledge in the form of differentiable fuzzy logic rules. The study demonstrates that the proposed framework improves both classification performance and interpretability compared to standard ResNet baselines. Grad-CAM analysis demonstrates that concept-guided attention aligns with symptom-specific regions, such as yellowed areas for Nitrogen deficiency or marginal discoloration for Potassium deficiency, providing visual validation of the reasoning process. Since EarlyNSD is limited in scale and visual diversity, the results are not directly comparable to large open-field datasets. Overall, our results establish a proof of concept for integrating neural detection with symbolic reasoning, enabling interpretable, actionable, and domain-informed nutrient management for practical applications.
Concept and Rule Guided Neural Network for Early Crop Leaf Nutrient Deficiency Diagnosis
Ferraro Antonino;Pecorelli Fabiano;Iammarino Martina;De Pietro Giuseppe
2026-01-01
Abstract
Crop nutrition deficiency poses a major challenge to achieving optimal yield, particularly in smallholder farming systems where timely expert diagnosis is limited. Early detection is crucial to minimize losses and reduce unnecessary fertilizer or pesticide usage. While deep learning offers potential for automated visual diagnosis, most existing approaches operate as black boxes and lack interpretability, explainability, or actionable recommendations. In this work, we present a neurosymbolic framework for early nutrient deficiency detection in ash gourd leaves using the EarlyNSD dataset. Our approach integrates a ResNet-50 backbone with a dual-head design: a classification head for deficiency prediction and a concept-prediction head that quantifies physiologically meaningful visual patterns such as yellowing, edge discoloration, spots, and vein greenness. These concept scores are combined with predefined domain rules to guide the learning of the neural component and to generate transparent, human-aligned explanations for each diagnosis. Building on the model outputs, we incorporate a Retrieval Augmented Generation (RAG)-based pipeline along with an agricultural knowledge base to generate targeted recommendations. This approach overcomes key shortcomings of pure neural models by incorporating domain knowledge in the form of differentiable fuzzy logic rules. The study demonstrates that the proposed framework improves both classification performance and interpretability compared to standard ResNet baselines. Grad-CAM analysis demonstrates that concept-guided attention aligns with symptom-specific regions, such as yellowed areas for Nitrogen deficiency or marginal discoloration for Potassium deficiency, providing visual validation of the reasoning process. Since EarlyNSD is limited in scale and visual diversity, the results are not directly comparable to large open-field datasets. Overall, our results establish a proof of concept for integrating neural detection with symbolic reasoning, enabling interpretable, actionable, and domain-informed nutrient management for practical applications.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
