Explainable lightweight deep learning architectures for crop anomaly detection using enhanced Grad-CAM and transfer learning
Abstract
This study improves the interpretability of convolutional neural networks (CNNs) for crop anomaly detection while identifying architectures suitable for deployment on resource constraints edge devices. Six CNNs, including the proposed hybrid, were evaluated across 10 crop species and 29 classes, leveraging 43,000 RGB images. Matthews correlation coefficient (MCC), confusion matrix, and receiver operating characteristic (ROC) curves were used to assess model performance. The hybrid model and ResNet18_weight consistently outperformed other architectures, achieving near-perfect MCC values for several crops and area under curve (AUROC), including0.99 for rice and 0.97 for kidney bean. In contrast, MobileNetV2 performed optimally for rice but was inconsistent in some other crops, while SqueezeNet1_1 was competitive for maize and kidney bean. Over and above this, gradient-weighted class activation mapping (Grad-CAM) was used to map the model interpretability, and anomalous regions were visually highlighted using Canny edge and contour overlays, revealing that top-performing models produced sharp, focused saliency maps, whereas lighter models such as MobileNetV2 and SqueezeNet1_1 generated more diffuse but computationally efficient attention patterns suitable for central processing unit (CPU) based deployment. Overall top-performing models achieved test accuracies exceeding 98%, revealing that the hybrid and ResNet18_weight models provide accurate, interpretable, and scalable solutions for real-time crop anomaly detection, supporting cost-effective, scalable field deployment.
// Source
Authors: Bikas Basnet, Santosh Bhandari, Roshan Ghimire
Institutions: Agriculture and Forestry University, Tribhuvan University, Florida Department of Citrus