Explainable CNN framework for accurate crop disease detection using plant leaf images Authors: Avik Ray, Tamilarasi Kathirvel Murugan, Logeswari Govindaraj, Iran Hussain Published: 2026 ABSTRACT Early and accurate disease detection is important for increasing the agricultural output, decreasing the financial costs, and ensuring food security. Traditional diagnostic procedures take much time and effort, involve the necessity of having deep expertise, and are not always suitable for large scale farming disease detection. For this purpose, the current research suggests developing an explainable lightweight CNN-based model for crop disease identification based on RGB leaf images. The model utilizes several innovative architectural solutions such as depth-wise separable convolution, SE blocks, skip connections, and guided attention-based feature learning that allow enhancing the effectiveness of features extraction and decreasing computation load. Moreover, Grad-CAM is used to visualize affected areas on a map and thus increase the interpretability of the model. The suggested solution was implemented and tested on the PlantVillage dataset containing 54,305 images for 38 crop diseases out of 14 crops. The results show that the training, validation, and testing accuracies equal 97.6%, 88.3%, and 97.63%, correspondingly, along with the Macro-F1 measure of 0.867 and Micro-ROC-AUC equal to 0.99. A comparative study reveals that the presented model performs comparably well in terms of classification with lightweight structure and built-in interpretability capabilities to be applied in the mobile and edge-enabled agriculture environment. The results show that the presented approach is capable of being used as an effective and interpretable tool for diagnosing plant diseases in real-time. Introduction Agriculture is essential for providing a livelihood and feed the world population. The production of crops helps maintain economic stability and improves the lives of rural communities in developing nations. A major challenge for farmers is plant diseases, which cause large amounts of yield losses and crop quality degradation worldwide every year1. Early detection and accurate diagnosis of plant diseases allow for timely intervention, reducing crop loss and minimizing unnecessary use of pesticides. Traditional disease diagnostics utilize visual inspection by agricultural specialists; however, they are time-consuming and subjective. This method may also not be practical for farmers in rural areas, where agricultural specialists may not be present2. In this context, integrating artificial intelligence (AI) and computer vision with agriculture is promising, especially when combined with Convolutional Neural Networks (CNNs) to classify plant images as diseased with a high degree of accuracy3. While many solutions have been developed using CNNs to detect plant disease recently, significant portions of the models are developed using small- or imbalanced-datasets. This limits their ability to be generalized to various crops and diseases4. Second, most models don’t make it clear how decisions are made. This is especially important in agriculture, where trust and understanding are key to getting people to use them. Explainable AI (XAI) methods like Grad-CAM are starting to fill this gap by giving us visual information about how models make decisions, but they haven’t been used much in agricultural AI systems yet5,6. Moreover, numerous advanced models employ intricate architectures such as hybrid transformers or rely on multi-modal data (e.g., integrating image data with sensor or satellite inputs)7,8. In spite of the considerable advancements made in CNN-based disease identification models for plants, there are certain limitations which prevent these systems from being successfully implemented within real-time agricultural operations. Current deep learning models are mostly designed to deliver maximum efficiency within a laboratory setting using well-structured data sets with no disturbances in terms of lighting and backgrounds. But in practice, when applying the system to field data sets, the results might not be as promising due to numerous external influences that are present. Furthermore, many state-of-the-art solutions make use of advanced computing systems like Vision Transformers, CNN+transformer models, or multimodal sensor-based systems. All these technologies impose high demands for computational resources and stability of the network infrastructure, thus making them rather hard to implement in remote agricultural locations. Despite the use of techniques like Grad-CAM and LIME in order to make models more transparent through explainable AI (XAI), such techniques are currently utilized mainly for post-hoc visualization in existing research papers without paying attention to efficiency, scalability, or usability in practical cases for farmers or agronomists. In addition to that, some existing approaches limit themselves to considering not more than a certain amount of plant species or different disease types which reduces the scope of their applicability in terms of large scale agricultural monitoring on diverse plant types. Thus, one needs to develop a lightweight, scalable and explainable framework for crop disease identification with high accuracy, yet keeping the computation cost relatively low and providing real-time implementation possibilities. To this end, the current paper proposes a novel XAI-based lightweight CNN architecture combining depth-wise separable convolution layers, squeeze-and-excitation blocks, residual networks and Grad-CAM-based interpretation mechanisms. Contrary to multimodal and transformer-based models that are computationally costly, the proposed approach considers only RGB leaf images and can thus be easily used on smartphones, drones and other edge devices in agriculture when classifying 38 types of diseases. The innovation of the suggested approach can be attributed to the introduction of a lightweight and structurally improved CNN architecture coupled with the use of explainable AI techniques. The proposed model differs from the majority of existing works that deal with specific crops or only part of the PlantVillage dataset by its ability to scale up to 38 different plant diseases. Also, the architecture uses depthwise separable convolutions, skip connections, and feature refinement via attention mechanism to extract features while minimizing complexity. Finally, the use of Grad-CAM allows increasing the interpretability of the CNN and implementing it for agricultural purposes without access to cloud services or specialized software. The proposed framework is created to work as a one-modality system relying solely on RGB leaf images. All experiments presented in this paper were conducted only with RGB images as input. The system is designed to perform image-based plant disease classification using CNN architecture combined with explainability (Grad-CAM). The rationale behind this research originates from an articulated need for an accessible and reliable plant disease detection framework. At the heart of this project lies the construction of a reliable yet interpretable machine learning algorithm for detecting disease in plants based solely on RGB imagery from the PlantVillage Dataset9. With cost-effective access through smartphones, the proposed model utilizes a minimal convolutional neural network (CNN) architecture that incorporates visual explanations using Grad-CAM to facilitate understanding of predictive decisions for users (farmers, agronomists, researchers) at a field level. As a result, this has led to the development of a high level of performance and interpretability (e.g., providing both explanations of individual predictions and minimally computationally intensive) which makes the model a particularly desirable candidate for deployment at the field level. The proposed framework is a new CNN architecture designed specifically for the automated detection of plant diseases. The model has been trained on the entire PlantVillage data set and covers 38 classes of crop diseases using only RGB image data. The integration of Grad-CAM provides an improved level of interpretability and transparency into the model’s prediction process creating more trustworthy and useful decision support tools for users. Additionally, the architecture being developed is lightweight and efficient by not relying on multi-modal or transformer based inputs, making it possible to deploy in resource-constrained environments. Finally, performance evaluations of the proposed framework are included through the use of various standard performance measures and a comparative analysis with other existing state-of-the-art models. In addition to being able to demonstrate its effectiveness on a variety of crop diseases, the framework has also been developed with a focus on scalability to provide a generalizable solution across many crops and diseases with a minimal computational burden. The system’s performance is evaluated using multiple metrics, including accuracy, precision, recall, F1-score, ROC-AUC, and PR curves. It is benchmarked against other top models from recent studies1,3,6,7,10. Experimental results show that the proposed system achieves a test accuracy of 97.63%. This figure surpasses many existing models while keeping interpretability and low computational costs. The rest of this paper is organized as follows. Section “Related works” provides a literature survey on deep learning-based plant disease detection and the role of explainable AI in improving model transparency. Section “Proposed methodology” describes the proposed CNN-based methodology, including preprocessing strategies, architectural design, and explainability methods. Section “Results and implementation” outlines the dataset details, visual analytics, evaluation metrics, and a performance comparison study. Finally, Section “Conclusion” concludes the paper and discusses future directions aimed at expanding the system’s capabilities for real-world agricultural deployment. Related works Deep learning has become one of the most widely studied applications of AI in agriculture over the last few years, including the detection of plant diseases. The primary motivation for using deep learning on agricultural disease diagnosis is to help automate the diagnosis process and improve diagnosis accuracy. For example, Convolutional Neural Networks (CNNs) have proven to be a very effective way to analyze leaf images in order to accurately identify disease with relatively little human involvement. Many researchers have investigated and built different models of CNNs, hybrid models and multimodal approaches that attempt to increase the accuracy, interpretability and deploy-ability of these models in dense and variable agricultural landscapes. Explainable AI (XAI) will help to improve the transparency of model predictions and, therefore, the likelihood of these deep learning methods to be adopted by farmers and agronomists. This section reviews some of the major advancements made in deep learning-based plant disease detection, categorizing the results of current research into five main categories: architectural innovation, explainability, multimodal integration, real world deploy-ability and transfer learning. This review will identify the limitations of current research, and will identify areas in which this research will contribute to addressing the gaps in the field. CNN-based models for plant disease classification Plant disease detection (or diagnosis) has seen some of its best solutions relying on CNNs. A CNN automatically identifies and extracts features from a leaf image spatially and texturally. Because of this automatic extraction of features, CNNs have been shown to effectively identify very slight visual cues of various diseases affecting plants. Hasan et al.1 described a hybrid CNN-SVM model called CSXAI that integrates visual explanations using Grad-CAM. The CSXAI model was designed to be a lightweight model and to provide high computational efficiency and an F1 score equal to 97.5% on the well-known PlantVillage dataset. Building on the strengths of both CNNs and SVMs, the model provided accurate results while optimising the decision boundary for classification needs, thus providing both accurate classification and an explanation to the end user. Likewise, Verma et al.2 proposed a unified lightweight CNN model developed for use in detecting diseases that affect major crops, such as corn, rice, and wheat. The accuracy achieved was 96.3 per cent across a range of public and custom datasets, showing that this lightweight model should be capable of being generalised across crops. The above studies collectively demonstrate the rapid growth of CNN types for scalable and robust land disease classification through CNN architectures. Architectural enhancements to improve accuracy and generalization While traditional CNNs have shown strong classification abilities, several researchers have proposed architectural enhancements to improve model robustness, generalization, and accuracy. Ashurov et al.3 proposed an innovative new architecture for a depth-wise CNN embedding with Squeeze-and-Excitation (SE) blocks and skip residual connections. This new design improved the ability to recalibrate features while preserving the hierarchical organization of spatial features, ultimately leading to 98.1% classification accuracy on various datasets of plant leaves. The computational efficiency provided by the model’s depth-wise separable convolutions makes it ideal for real-time inference. Another advancement was made by Adegbola and collaborators’11 development of an ensemble learning model that utilizes ResNet, DenseNet and InceptionV3 as component networks working together to combine their strengths in order to provide maximum stability and accuracy in predicting plant species. The accuracy of the ensemble model was 98.6% on PlantVillage, indicating that this approach provided improved reliability, handling and robustness than any of the individual networks when processing complicated patterns of visual imagery during object recognition. Overall, these innovations in architecture demonstrate how fundamentally refining baseline CNN architectures can result in substantial improvements to both system performance and ease of deployment. Explainable AI in agricultural diagnosis One of the main weaknesses of deep learning models, especially in sensitive applications like agriculture, is that they are generally considered black boxes. In order for users, particularly farmers and agronomists, to be able to trust the outputs of the models, they must be able to understand why the model made each prediction. To give users better insight into how models are functioning, researchers have begun implementing XAI techniques into CNN-based models. For example, Natarajan et al.4 created an innovative deep neural architecture that was combined with meta-visualizations to provide interpretability in predicting plant diseases. This model achieved an accuracy above 98% while also generating easily interpretable heatmaps showing which parts of the plant were affected by disease. Similarly, Alhammad et al.6 utilized Grad-CAM and LIME to visualize the predictions of their CNN model for potato leaf images. The combined usage of saliency maps and local feature attribution allowed farmers and agronomists to follow how specific symptoms contributed to the overall classification of an object. An important aspect of using XAI in agriculture is that many times whether a proposed AI solution can actually be used in the real world is based upon the explainability of the AI solution. Thus, XAI technology is critical to enhancing the transparency, trust, and eventual adoption of AI solutions in agricultural applications. Multimodal and sensor-based approaches Multiple studies have investigated multimodal data solutions which combine visual data with environmental data and spectral data to improve plant disease detection beyond standard image-only methods. Aviles Toledo and his colleagues5 created a multimodal deep learning model which used remote sensing data together with attention mechanisms to forecast crop yields that plant breeding programs need. The model showed strong performance, achieving a high correlation with actual data (R² > 0.90). This proved that satellite imagery along with contextual information offered significant value. Kolluri et al.8 built on this idea by creating a CNN-RNN hybrid model that merged image data with environmental sensor information.The model demonstrated strong performance because it achieved high correlation with actual data (R² > 0.90) which proved that satellite imagery together with contextual information provided essential value. Kolluri et al.8 advanced this concept by developing a CNN-RNN hybrid model which combined image data with environmental sensor information. Their method produced an accuracy of 95.3% because it enabled better understanding of context and time-related changes. The models demonstrate their ability to diagnose diseases and estimate crop yields accurately, but they need advanced equipment and specialized systems which makes them unsuitable for use in remote areas that lack technical resources. The system requires access to sensor networks or satellites which creates deployment difficulties for regions that only support smartphone usage and basic internet connection. Real-world deployment and model robustness For plant disease detection models’ practical utility, a critical issue is the dropping performance level after practical applications are performed under uncontrolled conditions. Laboratory-based (or system-trained) models have poor generalization to field-captured (or real-world) data that is often subject to large amounts of illumination changes (poor lighting conditions) due to occlusions (objects obstructing a camera’s view) in addition to being disrupted by background noise. Adegbola et al. provide an example of this lack of generalization by creating a new dataset consisting of thousands of images of actual field captured images that have imperfections in them such as shadows, glare, inconsistent framing and have significantly different appearances than what would be expected from current laboratory-trained datasets. Adegbola et al. successfully trained a convolutional neural network on this dataset producing a model with an accuracy of 93.8% which demonstrated that the CNN-based model could be very robust to the noise that is seen in the real-world images. Hamid et al. also built off of the work of Adegbola et al. by creating mobile-friendly, lightweight CNN architectures that could run on mobile devices. By optimizing their models for edge computing hardware, they were able to achieve greater than 94% real-time inference accuracy for potato and tomato diseases even under field conditions. These two studies provide evidence to support and encourage the movement away from laboratory-centric theories toward mobile devices providing direct support to farmers via diagnostic tools available as a mobile application or by utilizing handheld devices. Reviews and taxonomies of deep learning techniques To guide future developments, several comprehensive reviews have consolidated insights from existing plant disease detection systems. Shoaib et al.7 reviewed more than 100 studies that utilized deep learning and pointed to common obstacles, including dataset imbalance, a lack of generalizable cross-domain data, and overfitting small-scale datasets. Their literature review called for lightweight models and better curation of data. In addition, Tugrul et al.12 established a taxonomy classifying CNN architectures used in classifying plant diseases using the amount of convolution, feature aggregation methods, and training methodology as criteria for classification. Gülmez13,14 completed targeted reviews of rice and maize disease detection and described the nuances of disease phenotype collection for various cereal crops. Upadhyay et al.15 expanded their scope through their research by exploring precision agriculture systems employing CNNs and transformers and multimodal neural networks. Each of these reviews indicated researchers need to develop models that can scale along with their operations while offering results that are interpretable, and perform efficiently on diverse agricultural-based hardware systems. Transfer learning and hybrid architectures Transfer learning is one of the best ways to improve plant disease detection when there is not enough annotated data available to having to possibility of training your own models from scratch. By fine-tuning pretrained networks using agricultural datasets researchers have been able to tap into the knowledge gained from analyzing large amounts of data using datasets such as ImageNet. In a comparative analysis of different classifiers, Dolatabadian et al.16 demonstrated that CNNs outperformed traditional ML classifiers significantly (approximately 98%) in classification accuracy. Aboelenin et al.10 developed a hybrid architecture that combined CNN and ViT layers to allow the model to find both local and global features. The result was a classification accuracy of approximately 98.2% on mixed leaf datasets indicating that the hybrid architecture improved spatial generalization of the model predictions. Hukkeri et al.17 also demonstrated using pretrained networks (VGG16 and ResNet50) in combination with agricultural image datasets that transfer learning yields good quality models regardless of the size of the dataset used for training. These studies indicate that hybrid architectures and transfer learning continue to be important techniques in facilitating the expansion of AI-based solutions for agricultural applications with limited access to data. On the other hand, however, there are certain limitations with current CNN-based and explainable AI-based plant disease detection models that should be addressed despite their impressive performance. First of all, many researchers focus mostly on model accuracy and overlook important considerations for deploying such systems in practice including efficiency of computation, scalability across various types of crops, inference in real time, and feasibility of using them in agriculture under resource-limited conditions. Lightweight CNN networks are known to offer faster inference but have lower abilities to represent features as well as generalize across various types of diseases. At the same time, transformer networks and hybrid multimodal systems provide more efficient learning of features but are associated with higher requirements for computation, data, and sensors infrastructure. Furthermore, although explainable AI algorithms like Grad-CAM and LIME are useful in terms of making predictions understandable, many existing works implement them mainly as visualization methods without taking into account model deployability and inference in light weight.Previous approaches have been found to lack robustness in practice when faced with environmental constraints such as background noise, illumination changes, and visual overlaps among different diseases. Consequently, there is still a need for a model that will deliver high performance, be lightweight, interpretable, scalable, and usable in real-world applications for detecting various types of crop diseases using a smartphone or an edge-based agricultural device. The proposed framework seeks to solve these problems through the use of separable convolutions, squeeze and excitation operations, residual learning, attention-driven feature extraction, and Grad-CAM explainability in a lightweight CNN model trained on all the diseases present in the PlantVillage data set (38 diseases). Observations and scope for improvement Throughout the literature review, we have identified several commonalities among CNN-based models for detecting plant diseases. They provide good results across multiple crops, and there are strong examples to support the use of these models in agricultural applications. Unfortunately, some limitations exist that impede the practical use of CNN-based models for detecting plant diseases. For example, most models are trained on structured data, which do not conform well to what is usually found in agricultural systems, including varying lighting conditions, background noise, and lack of clarity in images. While implementing sensor-based and/or multimodal systems will provide additional reallife context, these types of systems do require additional hardware to operate and therefore cannot easily be implemented across many rural or low-resource areas where this type of infrastructure is unavailable. Finally, most models are computationally intensive, limiting their ability to run on portable or low-power devices. Another major challenge lies in the limited integration of explainable AI. Techniques such as Grad-CAM and LIME18,19 have been studied, but they are still mainly in an experimental stage and separate from the workflows of their end-users. Also, although Farmers are beginning to use more smartphones to do their agricultural work, there have only been limited numbers of models that have been developed for mobile or edge use. This makes it important to have easy-to-use, interpretable, and image-only methodologies that are both academically sound and usable. There appears to be a distinct gap between advances in technology related to machine learning (ML) and real-life use by the stakeholders in agriculture such as farmers and agronomists. The present research study aims to fill this void by developing a convolutional neural network (CNN)-based model that provides high accuracy and provides transparency by using Grad-CAM, with each being designed for low-cost, real-time use in diagnosing crop disease at the field level. The methodology was developed to use only RGB image inputs and to minimize the architectural complexity of the model, which matches the limitations of practical farming restrictions and digital capacity in most farming communities. Comparative analysis of all studies presented in Table 1 emphasize the use of emphatically artificial intelligence (AI) or AI. An overview of AI-based approaches used for the detection of crop diseases includes the use of diverse types of techniques including deep learning, hybrid approaches, and explainable AI as part of the overall study findings. Table 1Summary of deep learning and AI-based methods for plant disease detection.Ref.MethodologyDatasetStrengthLimitationApplication1Lightweight 2D CNN + SVM with explainable AICrop disease images (multiple crops)High accuracy (~ 92%), interpretable with XAIRequires fine-tuning for new crop typesReal-time crop disease detection with XAI2Unified lightweight CNNCorn, rice, and wheat disease datasetsGeneralizes well across major crops (~ 90%)Limited to specific cereal cropsDisease identification in multiple staple crops3Depthwise CNN + SE blocks + residual connectionsPublic crop disease datasetsEfficient model with 94.5% accuracyComplexity in architecture designLightweight and high-performance field diagnosis4CNN with attention + explainable AI (Grad-CAM)Plant leaf image datasetsTransparent decisions; F1 score ~ 0.92Increased compute for visualizationInterpretable plant disease classification5Multimodal CNN with remote sensing + attentionRemote sensing crop yield datasetsR² = 0.87; uses rich spectral infoNeeds advanced sensors and preprocessingPrecision yield prediction in plant breeding6CNN with explainable AI (e.g., CAM)Potato leaf imagesAccurate (~ 93%), localized visual outputsSmall dataset limits generalizationSmart farming with disease transparency7Review of DL models (CNNs, etc.)Multiple open-source datasetsHighlights model advances and gapsNo new model or evaluationGuidance for future deep learning research8Multimodal learning (RGB + sensor data)RGB + sensor-based plant datasetsImproved accuracy (~ 91%) using data fusionRelies on sensor availabilitySmart agriculture with multiple data streams20Custom CNN for crop disease classificationDiverse crop image datasetsScalable, decent accuracy (~ 88%)Lacks comparison with SoTA modelsGeneral-purpose disease diagnosis11Hybrid CNN-RNN architectureSequential crop imagesCaptures spatial-temporal patterns; ~95% accuracyTraining time and complexityTime-series disease prediction in fields12Review of CNNs in plant disease detectionVarious open datasetsCompiles architectures and trendsNo experimental model or metricLiterature base for new plant AI tools21Review on CNNs for severity estimationAnnotated severity datasetsSurveys severity grading models (85–90%)Limited severity-specific datasetsEstimating impact of plant diseases22Lightweight CNN modelPublic plant disease datasetsFast inference, ~ 89% accuracyReduced depth affects feature learningMobile-based plant disease tools13Review of CNNs in rice disease detectionRice-specific datasetsAccuracy > 90%, identifies gapsLacks deployment-based analysisRice field disease monitoring16Hybrid image processing + CNNStandard disease image datasetsRobust model with ~ 91% accuracyNot evaluated on cross-crop generalityCombined vision-AI for crop diagnostics10CNN + Vision Transformer hybridLeaf disease image datasetsHigh accuracy (~ 96%) with hybrid deep learningHigh compute cost, less edge-friendlyAdvanced disease classification14Review of CNNs in maize disease detectionMaize disease datasetsDetailed maize-specific reviewDoesn’t propose new algorithmMaize health monitoring systems15Review on deep learning and CV in plant pathologyBroad crop disease datasetsSummarizes performance > 90% for DL modelsReal-time application gaps notedTrends and direction for agri-AI systems23Deep CNN model evaluationDiverse image datasetsStrong accuracy (~ 93%) using modern CNNsModel sensitivity to training dataGeneral crop disease detection in labs17Transfer learning with pretrained CNNs (e.g., ImageNet)ImageNet + plant leaf datasetsEasy to deploy, high (~ 92%) accuracyRequires fine-tuning to avoid domain mismatchFast deployment in real-world settings Table 1Summary of deep learning and AI-based methods for plant disease detection.Ref.MethodologyDatasetStrengthLimitationApplication1Lightweight 2D CNN + SVM with explainable AICrop disease images (multiple crops)High accuracy (~ 92%), interpretable with XAIRequires fine-tuning for new crop typesReal-time crop disease detection with XAI2Unified lightweight CNNCorn, rice, and wheat disease datasetsGeneralizes well across major crops (~ 90%)Limited to specific cereal cropsDisease identification in multiple staple crops3Depthwise CNN + SE blocks + residual connectionsPublic crop disease datasetsEfficient model with 94.5% accuracyComplexity in architecture designLightweight and high-performance field diagnosis4CNN with attention + explainable AI (Grad-CAM)Plant leaf image datasetsTransparent decisions; F1 score ~ 0.92Increased compute for visualizationInterpretable plant disease classification5Multimodal CNN with remote sensing + attentionRemote sensing crop yield datasetsR² = 0.87; uses rich spectral infoNeeds advanced sensors and preprocessingPrecision yield prediction in plant breeding6CNN with explainable AI (e.g., CAM)Potato leaf imagesAccurate (~ 93%), localized visual outputsSmall dataset limits generalizationSmart farming with disease transparency7Review of DL models (CNNs, etc.)Multiple open-source datasetsHighlights model advances and gapsNo new model or evaluationGuidance for future deep learning research8Multimodal learning (RGB + sensor data)RGB + sensor-based plant datasetsImproved accuracy (~ 91%) using data fusionRelies on sensor availabilitySmart agriculture with multiple data streams20Custom CNN for crop disease classificationDiverse crop image datasetsScalable, decent accuracy (~ 88%)Lacks comparison with SoTA modelsGeneral-purpose disease diagnosis11Hybrid CNN-RNN architectureSequential crop imagesCaptures spatial-temporal patterns; ~95% accuracyTraining time and complexityTime-series disease prediction in fields12Review of CNNs in plant disease detectionVarious open datasetsCompiles architectures and trendsNo experimental model or metricLiterature base for new plant AI tools21Review on CNNs for severity estimationAnnotated severity datasetsSurveys severity grading models (85–90%)Limited severity-specific datasetsEstimating impact of plant diseases22Lightweight CNN modelPublic plant disease datasetsFast inference, ~ 89% accuracyReduced depth affects feature learningMobile-based plant disease tools13Review of CNNs in rice disease detectionRice-specific datasetsAccuracy > 90%, identifies gapsLacks deployment-based analysisRice field disease monitoring16Hybrid image processing + CNNStandard disease image datasetsRobust model with ~ 91% accuracyNot evaluated on cross-crop generalityCombined vision-AI for crop diagnostics10CNN + Vision Transformer hybridLeaf disease image datasetsHigh accuracy (~ 96%) with hybrid deep learningHigh compute cost, less edge-friendlyAdvanced disease classification14Review of CNNs in maize disease detectionMaize disease datasetsDetailed maize-specific reviewDoesn’t propose new algorithmMaize health monitoring systems15Review on deep learning and CV in plant pathologyBroad crop disease datasetsSummarizes performance > 90% for DL modelsReal-time application gaps notedTrends and direction for agri-AI systems23Deep CNN model evaluationDiverse image datasetsStrong accuracy (~ 93%) using modern CNNsModel sensitivity to training dataGeneral crop disease detection in labs17Transfer learning with pretrained CNNs (e.g., ImageNet)ImageNet + plant leaf datasetsEasy to deploy, high (~ 92%) accuracyRequires fine-tuning to avoid domain mismatchFast deployment in real-world settings Summary of deep learning and AI-based methods for plant disease detection. Proposed methodology This section outlines the proposed system for early crop disease detection. Section “System architecture” details the system architecture, Section “Workflow and algorithm” explains the workflow and core algorithm, and Section “Mathematical formulation” presents the mathematical formulation supporting the CNN-based diagnosis framework. System architecture The proposed system architecture for crop disease detection through image analysis uses explainable convolutional neural networks (CNNs) is shown in Fig. 1. The system operates exclusively with RGB image data that field personnel capture through drones and smartphones and stationary cameras used in agricultural settings. The system operates without requiring environmental sensor inputs which leads to simpler installation processes and enables its use in agricultural environments that lack these sensors because it requires no external technology. The Data Input module initiates the pipeline by capturing RGB images of plant leaves through standard imaging equipment. The Preprocessing and Augmentation module processes these images through multiple essential changes. The system applies image rotation and scaling operations to create additional data samples which improve model performance, while color normalization ensures all image sources show consistent brightness and illumination levels. The CNN system needs this stage to provide it with uniform input data which supports its learning process. Next, the images that have been processed are given to an image feature-extraction module that uses a lightweight visual convolutional neural network (CNN) for feature extraction. The backbone of the visual CNN consists of squeeze-and-excite (SE) blocks, depth-wise separable convolution (DWSC), and residual connections or skip connections. Each of these architectural enhancements improves the efficiency and representational power of the CNN to extract the complex disease patterns present in the images such as lesions, discolouration of the skin, and texture irregularities while using the least computational resources possible. The proposed CNN architecture receives inputs in the form of RGB images of dimension 256 × 256 × 3. The network comprises three blocks containing 32, 64, and 128 filters each with 3 × 3 kernel size, batch normalization, ReLU activation function, and max-pooling layers. Depth-wise separable convolution is used in the deeper layers to decrease computational burden, and Squeeze-and-Excitation (SE) blocks refine channel-wise features. Residual skip connections have been employed to aid in backpropagation. Post feature extraction, Global Average Pooling and feature refinement with attention are performed before classifying the image. A fully connected layer with 256 units and subsequent dropout (0.5), as well as the Softmax layer with 38 units corresponding to the disease labels, completes the architecture. It has been trained using the Adam optimizer with learning rate of 0.001, batch size of 32, and loss as categorical cross-entropy. With 2.1 million parameters, it is lightweight enough for use on mobile devices. The uniqueness of the proposed CNN architecture resides in its use of depth-wise separable convolutions, SE blocks, residual learning, and Grad-CAM explainability in a computationally efficient neural network for multi-class crop disease detection. The architecture of the proposed CNN model is built to ensure that it is both light-weighted and efficient enough to perform multi-class crop disease classification using deep learning. The network receives input images of size 256 × 256 × 3 in terms of the RGB image dimensions. The first convolution block is composed of Conv2D layers with a number of 32 filters with 3 × 3 kernels with batch normalization, followed by ReLU activation and a 2 × 2 max pooling layer. The second convolution block comprises of 64 filters of 3 × 3 kernels along with batch normalization and max pooling. In the third convolution block, depth-wise convolutional layers are used which comprise of 128 filters to increase efficiency. Residual Skip connections are incorporated in between the layers to assist gradient backpropagation without the issue of vanishing gradients while training the model. After extracting features, the resulting feature maps are subjected to a Global Average Pooling (GAP) operation to avoid excessive complexity of parameters. Further, an attention-driven feature enhancement process is employed to focus on disease-specific spatial locations prior to classification. The fully connected classification phase involves a dense layer of 256 units with the help of ReLU activation function, after which there is a dropout layer with a dropout value of 0.5. The final output layer is the Softmax layer comprising 38 neurons. The model was optimized using Adam optimizer with the initial learning rate set at 0.001 while using categorical cross-entropy loss function. The batch size was set to 32, and the network was trained for five epochs by incorporating early stopping to minimize chances of overfitting. For improved generalization and training capabilities, several regularization techniques were incorporated in the architecture, such as the use of batch normalization, drop out technique in fully connected layers, and L2 weight regularization. Image augmentation techniques were also performed extensively to enhance robustness towards different types of plant diseases. The proposed architecture involves about 2.1 million trainable parameters, which make it efficient and ideal for use in portable agricultural devices. The proposed architecture is strictly an RGB-image based disease detection algorithm that uses only RGB images of leaf tissues taken from mobile, drone, or other imaging devices. Although the overall architecture was constructed in a modular fashion for future use of environmental sensing information like temperature, humidity, and soil moisture content among others, these multi-modalities are not implemented in the current experiment setup. In this study, image-based disease classification by means of CNN and Grad-CAM is considered, which ensures consistency and reproducibility within a single modality. After the features have been extracted, they are to the feature fusion layer, which combines different features from the various prior layers into a single set of features using concatenation with an optional attention mechanism. The attention mechanism permits the feature fusion layer to focus on the most important spatial features associated with each disease and assist the feature classification process. The feature classification layer containing fully connected layers and concluding with a softmax activation function will receive the fused feature output. This softmax activation will yield both the predicted disease class together with its respective confidence level. The proposed system relies on its Explainable AI (XAI) module to assist users by improving their understanding of how the model generates predictions, allowing them to make better choices. Through the use of Grad-CAM (Gradient-weighted Class Activation Mapping) the model produces visual heat maps that highlight the pixels of the images that have contributed to the final classification output. The model can therefore provide interpretability to farmers or agronomists through visual evidence of how the model made a prediction. In addition, although the design system allows for future use of SHAP24, the existing design-against-image will not make use of it. Information will be presented in an easy to understand dashboard format. This dashboard will provide the user with the following summary of the model outputs: • high level summary of what the prediction indicates (i.e. disease class) along with the confidence level.• a Grad-CAM based visual explanation of the infected areas on the leaf of the image.• actionable insight that provides direction for the user on time and how to intervene for effective disease management. • high level summary of what the prediction indicates (i.e. disease class) along with the confidence level. • high level summary of what the prediction indicates (i.e. disease class) along with the confidence level. • a Grad-CAM based visual explanation of the infected areas on the leaf of the image. • a Grad-CAM based visual explanation of the infected areas on the leaf of the image. • actionable insight that provides direction for the user on time and how to intervene for effective disease management. • actionable insight that provides direction for the user on time and how to intervene for effective disease management. The unified architecture will facilitate fast and effective identification of plant diseases through an extraordinarily precise diagnostic mechanism for both academic and agricultural applications, as well as a high level of model interpretability and deploy-ability. Fig. 1Proposed Architecture for Early Detection of Crop Diseases Using Multi-Modal Sensor Data and Explainable Convolutional Neural Networks. Proposed Architecture for Early Detection of Crop Diseases Using Multi-Modal Sensor Data and Explainable Convolutional Neural Networks. Workflow and algorithm As depicted in Fig. 2., the workflow for the proposed system in identifying early signs of crop disease from RGB-Leaf images utilizing an Explainable Convolutional Neural Network Model (CCNNM) is comprised of three main stages: (1) Data Acquisition, (2) Data Preparation, and (3) Feature Engineering. The proposed system will Provide a scalable and interpretable approach for Agriculture or Farms environments that can be easily deployed using mobile or Edge Devices (Example Smart Phones, Drones, or Cameras). The first step within the overall Workflow consists of the acquisition of RGB images of plant leaves using field-deployable acquisition Devices (e.g., smartphones or drones). Therefore there is no need for additional sensor infrastructure. The second step, Data Preparation, begins with the preprocessing of all captured Images. This preprocessing stage involves cleaning and normalization of pixel intensities to ensure input quality is standardized across all collected inputs. Complementarily, Data Augmentation (i.e., rotating, scaling, and flipping) techniques will also be applied to increase training Data diversity, and enhance the generalization Capabilities of the CCNNM Model. Once preprocessed, the data are fed into the Feature Engineering Module where a CCNNM will Automatically extract Visual Features from RGB Images of Plant Leaves. The CCNNM will have been trained on the Recognition of the prevalent Spatial Patterns and Textures associated with Common Plant Diseases (such as Color Changes, Lesions and/or shape distortion). The extracted features go into an Attention and Prediction Unit. An attention mechanism is implemented to accentuate the most informative spatial feature map regions that the model will use to focus on disease-related areas. The key characteristics of the image will be generated and passed through a food pixel’s dense classification head with softmax activation, which will then generate an output with the predicted disease class and the associated confidence level. To support trust and transparency in AI-assisted decision-making, the framework features an Explainability and Output Module. This will utilise Grad-CAM to generate heatmaps of the individual leaf regions that materially influenced the model’s decision, and make this information available to users along with the prediction and confidence output. The final output will contain actionable recommendations, allowing the user (farmer or agriculturalist) to manage the identified disease appropriately. This modular framework guarantees that the overall system will not only be achieved with high diagnostic accuracy; but also be an interpretable as well as practically deployable solution in field environments, particularly where resources are limited. Algorithm 1Image-Based Crop Disease Diagnosis with CNN and Grad-CAM Explainability. Image-Based Crop Disease Diagnosis with CNN and Grad-CAM Explainability. The proposed CNN-based plant disease detection system processes RGB images through its complete operational procedure which Algorithm 1 describes in detail. Fig. 2Workflow of the proposed plant disease detection system using RGB images, CNN-based classification, and Grad-CAM. Workflow of the proposed plant disease detection system using RGB images, CNN-based classification, and Grad-CAM. Mathematical formulation Input representation and preprocessing The following equations show the computational methods which develop a machine learning model that detects early crop disease through neural network techniques. Each equation is explained clearly below. Input feature vector. The diagnosis begins by encoding the crop image into a numerical input feature vector x which shows relevant characteristics through its color and texture and shape components as shown in Eq. (1)1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:x=\left[{x}_{1},\:{x}_{2},\cdots\:\:,\:{x}_{n}\right]\in\:{\mathbb{R}}^{n}$$\end{document} Here, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}_{i}$$\end{document} denotes the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th}$$\end{document} feature and n is the total number of extracted features. Label definition. Each input sample is associated with a binary label y, indicating whether the crop is healthy (0) or diseased (1). This ground truth is used for supervised training of the neural network as in Eq. (2).2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:y\in\:\left\{\mathrm{0,1}\right\}$$\end{document} Feature normalization. To ensure all features contribute equally and speed up training, each feature is normalized by subtracting its mean \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mu\:}_{i}$$\end{document} and dividing by its standard deviation \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\sigma\:}_{i}$$\end{document}. This produces standardized features \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}_{i}^{\mathrm{norm}}$$\end{document} with zero mean and unit variance using Eq. (3)3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}_{i}^{\mathrm{norm}}=\frac{{x}_{i}-{\mu\:}_{i}}{{\sigma\:}_{i}}$$\end{document} where, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mu\:}_{i}$$\end{document} is the mean and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\sigma\:}_{i}$$\end{document} is the standard deviation of the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th}$$\end{document} feature. CNN-based feature extraction and classification Convolution operation in CNN In convolutional neural networks (CNNs), convolutional layers apply filters \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}^{l}$$\end{document} across the input feature maps \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}^{(l-1)}$$\end{document} to extract spatial features. The output at location (i,j) in layer l is given in Eq. (4)4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{h}_{ij}^{\left(l\right)}=f\left({\sum\:}_{m,n}{x}_{i+m,j+n}^{\left(l-1\right)}\cdot\:{w}_{mn}^{\left(l\right)}+{b}^{\left(l\right)}\right)$$\end{document} where, f is the activation function, w are the weights, and b is the bias. Activation function (ReLU) The Rectified Linear Unit (ReLU) is widely used to introduce non-linearity by zeroing out negative values and preserving positive values as in Eq. (5)5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:f\left(x\right)={max}\left(0,x\right)$$\end{document} This helps the model learn complex patterns. Pooling operation Pooling layers reduce spatial dimensions by summarizing regions. Max pooling selects the maximum value within a local window \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\Omega\:}$$\end{document}, helping to retain important features while reducing computational load as given in Eq. (6)6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{p}_{ij}^{\left(l\right)}=\underset{\left(m,n\right)\in\:\varOmega\:}{{max}}{h}_{i+m,j+n}^{\left(l\right)}$$\end{document} In the max pooling operation, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{p}_{ij}^{\left(l\right)}$$\end{document} represents the output value of the pooling layer at the spatial position (i, j) in the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th}$$\end{document} layer. The operation max denotes the max pooling function, which selects the highest activation value from a specified local region. The variables (m, n) represent the offset indices that indicate different positions within the pooling window. The symbol Ω denotes the local pooling region (such as 2 × 2 or 3 × 3) over which the maximum operation is performed. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{h}_{i+m,j+n}^{\left(l\right)}$$\end{document}) represents the activation value obtained from the feature map of the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{l}^{th}$$\end{document} layer at the position (i+m, j+n). Fully connected layer After feature extraction, the model uses fully connected layers to learn high-level representations. The output of layer l is computed by multiplying inputs with weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{W}^{\left(l\right)}$$\end{document}, adding bias \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{b}^{\left(l\right)}$$\end{document}, and applying an activation function using Eq. (7)7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{z}^{\left(l\right)}=f\left({W}^{\left(l\right)}{x}^{\left(l-1\right)}+{b}^{\left(l\right)}\right)$$\end{document} In Eq. (7), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{z}^{\left(l\right)}$$\end{document}denotes the output of the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{l}^{th}$$\end{document} fully connected layer after applying the activation function. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}^{(l-1)}$$\end{document}represents the input vector from the previous layer. The function f(.) denotes the nonlinear activation function (such as ReLU or sigmoid) that introduces nonlinearity and enables the network to learn complex feature representations. The proposed architecture further includes an attention refinement module, which allows the algorithm to concentrate on the important areas within the feature map in relation to the disease condition. The attention module will focus more on discriminating leaf regions related to the diseased condition while ignoring any extraneous background elements. Such a process will help the network concentrate on crucial visual cues like lesions and discolorations. Output layer with softmax The softmax function in Eq. (8) transforms multi-class disease classification logits \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{z}_{i}$$\end{document} into probabilities \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}$$\end{document}, which total to 1.8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{{y}_{i}}=\frac{{e}^{{z}_{i}}}{{\sum\:}_{j=1}^{C}{e}^{{z}_{j}}}$$\end{document} where, C is the number of classes. Loss function (cross-entropy) The model training optimizes the categorical cross-entropy loss, which penalizes incorrect predictions by comparing predicted probabilities \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}$$\end{document} with true labels \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}$$\end{document} as in Eq. (9)9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathcal{L}=-{\sum\:}_{i=1}^{C}{y}_{i}\mathrm{log}\left(\widehat{{y}_{i}}\right)$$\end{document} In Eq. (9), L denotes the categorical cross-entropy loss used to measure the difference between predicted and actual class labels. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{y}_{i}$$\end{document} represents the true label of the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th}$$\end{document} class (usually one-hot encoded), while \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{{y}_{i}}$$\end{document} denotes the predicted probability for the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th}$$\end{document}class obtained from the softmax layer. Lower loss values indicate better performance. Gradient descent parameter update The model parameters θ which consist of weights and biases undergo iterative updates through gradient descent to achieve loss minimization. The model parameters θ in Eq. (10) which consist of weights and biases undergo updates through gradient descent which moves in the opposite direction of the gradient while using a learning rate of η10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\theta\:\leftarrow\:\theta\:-\eta\:\frac{\partial\:\mathcal{L}}{\partial\:\theta\:}$$\end{document} This optimizes model predictions. Model performance evaluation metrics Accuracy metric The model accuracy in Eq. (11) assessment determines the percentage of correctly identified samples which serves as an understandable measurement of model performance.11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{Accuracy}=\frac{\text{Number of correct predictions}}{\text{Total Equation Number of samples}}$$\end{document} Precision metric Precision quantifies how many of the positively predicted samples were truly diseased, important to assess false positive impact. It is computed using Eq. (12)12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{Precision}=\frac{TP}{TP+FP}$$\end{document} where, TP is true positives and FP false is positives. Recall (sensitivity) Recall in Eq. (13) measures how many actual positive cases were correctly identified by the model:13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{Recall}=\frac{TP}{TP+FN}$$\end{document} where, FN is False Negatives. F1-score F1-Score in Eq. (14) is the harmonic mean of precision and recall, used when there is class imbalance:14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{F1-Score}=2\cdot\:\frac{\mathrm{Precision}\cdot\:\mathrm{Recall}}{\mathrm{Precision}+\mathrm{Recall}}$$\end{document} Accuracy Accuracy in Eq. (15) gives the overall correctness of the model across all classes:15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{Accuracy}=\frac{TP+TN}{TP+TN+FP+FN}$$\end{document} In Eq. (15) TP (True Positive) represents the number of positive instances that are correctly predicted as positive by the model, while TN (True Negative) denotes the number of negative instances correctly classified as negative. FP (False Positive) refers to the number of negative instances that are incorrectly predicted as positive, and FN (False Negative) indicates the number of positive instances that are incorrectly predicted as negative. AUC - area under ROC curve AUC in Eq. (16) measures how well the model distinguishes between classes; a higher AUC implies better performance:16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{AUC}={\int\:}_{0}^{1}TPR\left(FPR\right)\hspace{0.17em}dFPR$$\end{document} In Eq. (16), AUC (Area Under the Curve) represents the overall ability of the model to distinguish between different classes. The term TPR (True Positive Rate), also known as sensitivity or recall, indicates the proportion of actual positive cases correctly identified by the model. FPR (False Positive Rate) represents the proportion of negative cases that are incorrectly classified as positive. Regularization and optimization Regularization term (L2) To prevent overfitting, an L2 penalty term is added to the loss function:17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathcal{L}}_{\mathrm{reg}}=\lambda\:{\sum\:}_{i}{w}_{i}^{2}$$\end{document} In Eq. (17), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\lambda\:$$\end{document} is regularization strength and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}_{i}$$\end{document} are model weights. Total loss with regularization Combining the main loss and regularization in Eq. (18)18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathcal{L}}_{total}=\mathcal{L}+{\mathcal{L}}_{reg}$$\end{document} In Eq. (18), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}_{total}$$\end{document} represents the overall loss used to train the model. The term L denotes the primary loss function (such as categorical cross-entropy) that measures the difference between predicted outputs and true labels. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}_{reg}$$\end{document} represents the regularization loss added to prevent overfitting by penalizing large model weights. By combining both terms, the total loss balances prediction accuracy and model generalization during training. Gradient descent update rule Weights are updated using the learning rate \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\eta\:$$\end{document}:19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}^{\left(t+1\right)}={w}^{\left(t\right)}-\eta\:\cdot\:\nabla\:\mathcal{L}$$\end{document} Here, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}^{\left(t\right)}$$\end{document} denotes the weight at iteration t, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{w}^{\left(t+1\right)}$$\end{document} is the updated weight, η represents the learning rate controlling the update step size, and ∇L is the gradient of the loss function with respect to the weights. This update adjusts the weights in the direction that minimizes the loss. Explainability and feature interpretation SHAP value contribution SHAP assigns each feature i, a contribution \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\phi\:}_{i}$$\end{document} to the final prediction:20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:f\left(x\right)={{\upphi\:}}_{0}+{\sum\:}_{i=1}^{n}{{\upphi\:}}_{i}$$\end{document} In Eq. (20), f(x) represents the model’s predicted output for the input instance x. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\upphi\:}}_{0}\:$$\end{document}denotes the base value, which corresponds to the average prediction of the model over the training data. The term \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\upphi\:}}_{i}$$\end{document} represents the SHAP value indicating the contribution of the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{i}^{th\:}$$\end{document}feature to the final prediction. PCA for dimensionality reduction Principal Component Analysis (PCA) transforms data to reduce features:21\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{X}^{{\prime\:}}=XW$$\end{document} In Eq. (21), X represents the original data matrix containing the input features, where rows correspond to samples and columns correspond to variables. The matrix WWW denotes the projection matrix consisting of selected eigenvectors (principal components) that capture the maximum variance in the data. Confusion matrix elements The performance of the classification model is evaluated using the confusion matrix, as shown in Eqs. (22),22\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:CM\:=\:\left(\begin{array}{cc}TP&\:FP\\\:FN&\:TN\end{array}\right)$$\end{document} Grad-CAM heatmap generation It is used for explaining CNN-based predictions in Eq. (23)23\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{L}_{\mathrm{Grad-CAM}}^{c}=\mathrm{ReLU}\left({\sum\:}_{k}{\alpha\:}_{k}^{c}{A}^{k}\right)$$\end{document} where, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\alpha\:}_{k}^{c}$$\end{document} is importance weight for class and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{A}^{k}$$\end{document} is feature map. Additional preprocessing and decision functions Normalization formula Equation (24) used to scale feature values in Eq. 24\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{x}^{{\prime\:}}=\frac{x-{\upmu\:}}{{\upsigma\:}}$$\end{document} where, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mu\:$$\end{document} is mean of feature and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\sigma\:$$\end{document} is standard deviation. Output confidence threshold Equation (25) defines the threshold for deciding class membership:25\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{Class}=1\,\mathrm{if}\,\widehat{y}\ge\:\tau\:,\mathrm{else}\,0$$\end{document} where, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\widehat{y}$$\end{document} is the model’s predicted probability of disease, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\tau\:$$\end{document} is the decision threshold (commonly 0.5) and output class is 1 (disease) if confidence is above the threshold; otherwise, 0 (healthy). Together, Eq. (1) to (25) encapsulate the end-to-end computational pipeline of the proposed crop disease detection system using neural networks. Starting with the construction of a feature vector from image or sensor-based crop health data, the formulation integrates core deep learning mechanisms such as convolutional operations, feature extraction layers, activation functions, and multi-layer neural inference to support binary and multi-class classification of diseases. The model’s architectural design uses advanced techniques which include dropout regularization and batch normalization and the adaptive optimizer Adam to boost its predictive capabilities and ability to generalize. The training process uses loss functions, which include cross-entropy, to direct its path while performance assessment uses precision and recall and F1-score and ROC-AUC metrics to measure model trustworthiness. The research employs explainable AI techniques, which use Grad-CAM and SHAP, to create visualizations that demonstrate how different image regions impacted the decision-making procedure. The formulation systematizes its approach to robustness by using entropy-based uncertainty measurements and adversarial resistance testing and feature selection through PCA and Gini importance, which lets researchers understand how the model behaves in different environmental conditions. The mathematical framework guarantees that the system achieves diagnostic accuracy together with interpretability and robustness, which makes it appropriate for use in actual agricultural field operations. Results and implementation Dataset used The research employs the PlantVillage Dataset which serves as a reference dataset for both plant disease classification and agricultural artificial intelligence research work and can be accessed through the Kaggle platform9. The dataset includes 54,305 RGB images which show both healthy and diseased plant leaves that researchers at Penn State University compiled and released under a public domain license. The images display 38 unique categories which include 14 different crop species such as tomato, potato, corn, apple, grape, and bell pepper and other crops. The image contains a clear label which shows the plant type and disease condition of the plant (e.g., Tomato - Late Blight, Potato - Early Blight, Corn - Healthy) which enables both binary and multi-class classification tasks. The PlantVillage dataset is particularly useful for deep learning research because it offers high-quality images at high resolution and contains a wide range of plant species. The research required artificial environmental sensor data because it wanted to create agricultural conditions which enable multiple learning methods to operate. The additional dataset provides important information about environmental conditions which includes air temperature (°C), relative humidity (%), soil moisture (%), and sunlight intensity (lux)—factors known to influence disease onset and spread. The agricultural climate patterns established the environmental variables which were generated to create validated simulation patterns through scientific research documented in literature. The researchers introduced missing values into the data at random intervals and used mean substitution together with K-nearest neighbor (KNN) interpolation to fill in the gaps while all continuous variables received z-score normalization as their standardization method. The researchers used image augmentation techniques to create more diverse training samples which would help the model generalize better while reducing the effects of class imbalance. The first method enabled the system to perform random rotations within a range of plus and minus 15 degrees. The system used horizontal flips and zoom-in cropping and brightness/contrast adjustment and Gaussian noise injection as its second method. The system processed all images to a standard size of 256 × 256 pixels while it converted all pixel values into a range from 0 to 1. The researchers used stratified sampling to create three datasets which included training data with 70% and validation data with 15% and testing data with 15% while maintaining equal representation for all classes. The extended dataset allows for multi-modal CNN-based framework development which combines image data with sensor data to train models that analyze visual symptoms and environmental stress factors which match precision agriculture and real-field crop monitoring conditions. Even though the PlantVillage dataset offers a standardized benchmark for measuring the performance of deep learning models, it mostly contains controlled laboratory images under well-lit conditions with no interference from environmental factors such as cluttered backgrounds, overlapping leaves, and shadows among others. As a result, the PlantVillage dataset does not provide a completely accurate representation of field conditions under which practical images may be captured, since practical images might be influenced by different types of interference. Data augmentation strategies involving techniques such as rotating, scaling, brightness and contrast change, and adding Gaussian noise were used extensively in training the proposed models, but the model needs to be validated using field datasets. Data visualization and analysis The researchers conducted various visualizations throughout the three stages which included preprocessing, training and evaluation to study model behavior and dataset properties. The visualizations present essential information which reveals class distribution patterns and prediction certainty levels and filter development processes and total system effectiveness. Fig. 3Frequency of Each Class in the Dataset. Frequency of Each Class in the Dataset. Figure 3 displays how many instances of each class exist within the PlantVillage dataset9. The data clearly shows that three classes, which include Tomato_Yellow_Leaf_Curl_Virus, Tomato_healthy and Orange_Haunglongbing (Citrus greening), display an extreme sample bias since they contain more than 1000 instances each, while Potato_healthy and Apple_Cedar_apple_rust show much lower sample sizes. The machine learning models experience performance problems because of the uneven class distribution which leads them to prefer the classes that have more training examples. The model training process requires implementation of class balancing methods which include data augmentation and weighted loss functions to stop the system from becoming biased toward the more common classes. Fig. 4Class Distribution in Training Set. Class Distribution in Training Set. The training set exhibits class distribution patterns which confirm that the dataset contains an unequal class distribution. The Fig. 4. presents training data which shows the distribution of images across different classes used in model development. The dataset contains unequal class representation which results in certain classes dominating the data thus creating a risk of biased learning. In the training phase, the application of data augmentation through rotation, flipping, and adjustments in brightness was done to ensure that equal class distribution is achieved as well as balanced feature extraction from the minority classes. Also, the assessment of performance through class-wise precision, recall, confusion matrix, and PR-curve was carried out to understand the characteristics of the minority classes. Fig. 5Original Image Size Distribution. Original Image Size Distribution. All images in the dataset are standardized to 256 × 256 pixels, as illustrated in Fig. 5. Convolutional neural networks (CNNs) require uniform image dimensions because these dimensions maintain spatial resolution consistency across different inputs, which enables the network to extract hierarchical features. The pre-processing step provides two benefits, which include decreasing processing needs and making it easier to design model architectures. Fig. 6RGB Channel Distribution. RGB Channel Distribution. The RGB channel distribution graph in Fig. 6 displays the pixel intensity frequencies for the red, green and blue channels. The peak across all three color channels occurs around the mid-intensity range 100 150 which shows that the image brightness and contrast distribution across all images remains balanced. This supports the assumption that the dataset contains color-consistent high-quality images essential for enabling the model to capture color-based patterns and textures which medical professionals use to identify diseases. Fig. 7Prediction Confidence Distribution. Prediction Confidence Distribution. The Fig. 7 histogram displays how confidence scores from the trained model are distributed throughout the data. The sharp spike near 1.0 shows that most predictions received high confidence which indicates that the model has developed strong ability to distinguish between different features. The model becomes overly confident when it reaches too high of confidence levels which results in overfitting because training accuracy exceeds validation performance. The current visualization needs additional analysis to determine its ability to generalize to new data. Fig. 8First Layer Filters Visualization. First Layer Filters Visualization. The first convolutional layer continues to operate with the learned filters which were obtained after training in Fig. 8. The filters identify basic visual elements which include edges and blobs and simple texture patterns. The network establishes different feature representations from input images because the filters show various color and pattern combinations. The system requires these features to identify minute differences which exist between various plant diseases by observing their leaf color and shape and texture characteristics. Fig. 9Confusion Matrix. Confusion Matrix. Figure 9 the confusion matrix presents a detailed view of the model’s classification performance across all 38 classes. High values along the diagonal represent correct predictions, while off-diagonal entries denote misclassifications. The matrix reveals that most classes are accurately identified; however, there are noticeable confusions among visually similar diseases, particularly within the tomato and grape categories. For instance, Tomato_Bacterial_spot is sometimes confused with Tomato_Early_blight, highlighting the necessity for refined feature extraction or additional data for ambiguous classes. Figure 10 shows the learning rate evolution across training epochs. The training process used a fixed learning rate which maintained 0.001 as its value. Deep learning models achieve better results when implementing static learning rates because they provide better performance than other methods. Future work will investigate adaptive learning rate methods which include both learning rate decay and cyclical learning rates to enhance model generalization capabilities and increase convergence speed. Fig. 10Learning Rate Schedule During Training. Learning Rate Schedule During Training. Fig. 11Per-Class Precision and Recall. Per-Class Precision and Recall. The comparison of precision and recall between different classes in Fig. 11. shows how accurate the model predictions and how complete the model predictions. The model demonstrates better performance on specific classes which include Soybean_healthy and Tomato_Yellow_Leaf_Curl_Virus while it encounters difficulties with other classes because of feature similarities and insufficient sample sizes. This analysis identifies classes that need improvement through targeted data augmentation and transfer learning efforts. Fig. 12Model Accuracy Over Epochs. Model Accuracy Over Epochs. Figure 12 shows the training and validation accuracy measurements which were taken throughout five consecutive epochs. The training accuracy increases without interruption until it reaches 97% while the validation accuracy achieves its highest point at the beginning but then decreases throughout the subsequent epochs which indicates overfitting. The performance gap indicates that the model has effectively learned the training data but needs additional regularization techniques such as dropout or early stopping to improve validation results. Fig. 13Sample Images per Class. Sample Images per Class. The extended PlantVillage dataset9 shows Fig. 13 as a collection of sample images which represent all classes in the dataset. The visualization displays how different crop species and their respective disease types display various leaf texture patterns and color variations and leaf shape differences and distinctive disease symptoms. The sample collection shows both healthy tomato and potato and grape and corn and citrus samples which demonstrate the difficulty of identifying their similar visual characteristics. The examination of class-level data shows that strong feature extraction systems become essential when different classes show minor variations while their respective groups display significant internal differences. The dataset contains high-resolution images which enable precise classification through CNN methods. Fig. 14Train vs. Validation Split per Class. Train vs. Validation Split per Class. The grouped bar chart in Fig. 14 displays how training and validation samples divide among different class categories. The figure shows class imbalance because some classes (e.g., Grape_Black_rot, Tomato_Yellow_Leaf_Curl_Virus) have excessive training samples while other classes (e.g., Peach_Bacterial_spot, Potato_healthy) receive insufficient representation. The use of stratified sampling does not prevent learning biases from occurring because dominant classes receive preference during training. Class weighting and synthetic minority over-sampling and targeted augmentation create necessary compensatory mechanisms which enable fair learning and precise category predictions across all classes. Fig. 15Incorrect Predictions. Incorrect Predictions. The proposed model misclassifies leaf images which are shown in Fig. 15. The original class label and predicted class are indicated for each image. The system produces numerous misclassifications between classes which show minor visual differences, as demonstrated by Apple_Black_rot being classified as Tomato_Early_blight and Corn_healthy being identified as Grape_Leaf_blight. The research demonstrates that plant disease identification through visual assessment becomes extremely difficult when environmental lighting and natural sound disturbances exist. The figure demonstrates that using multiple input types together with environmental sensor data and explainable AI methods results in better accuracy for real-world diagnostic assessments. Fig. 16Model Loss Over Epochs. Model Loss Over Epochs. Figure 16 shows the training process through its validation and training loss paths which extend across five epochs. The learning process starts with both losses showing a high decrease which proves effective learning has taken place. The training loss decreases, while the validation loss starts to increase after epoch two, which indicates overfitting has occurred. The training set optimization process shows model improvement, but the model presents difficulties when tested with new data. The organization should use dropout regularization, batch normalization, and early stopping as methods to decrease the problematic area. The organization should use extended training through five epochs which includes augmented data and a dynamic learning rate to produce better system performance. The relatively low average precision rates seen in the Precision-Recall (PR) curve do not directly undermine the ROC-AUC and classification accuracy rates. The reason behind this is that the model’s PR curve performance heavily relies on the imbalanced multi-class nature of the Plant Village dataset, where some disease categories have significantly fewer training samples compared to other dominating categories. ROC-AUC performance measures how well a model can rank positive examples with different thresholds. On the other hand, the PR curve performance greatly depends on the presence of false positives and is harder to evaluate in cases of imbalanced datasets. Thus, the model exhibits high ROC-AUC and classification accuracy rate on dominating disease categories, but at the same time, it shows reduced average precision on smaller, overlapping disease categories. Fig. 17Training Duration Heatmap (Per Epoch). Training Duration Heatmap (Per Epoch). The heatmap in Fig. 17 displays the epoch training time which researchers measured in seconds. The training duration maintained an even pattern because it took between 103 and 109 s for each epoch with only small changes occurring. The system experienced these small changes because of background processing and the delays caused by real-time data augmentation. The system maintained a stable computational load because the data pipeline reached optimal performance which enables the model to handle bigger datasets and perform real-time inference with short processing times. However, the proposed CNN model is intended to achieve low computation complexity for its implementation in the mobile agriculture environment. This is because it has about 2.1 million parameter layers and uses depth-wise separable convolution operations to cut down the computation complexity without sacrificing the ability to extract features from data. Also, the stable epoch duration attained in experiments suggests that the learning process has computational efficiency. Even though the current research is centered on the classification accuracy and explainability of the results, future research will explore issues regarding computational complexity such as FLOPs, memory usage, latency, among others. Fig. 18ROC Curves for Top 10 Classes (Subset of 1000 samples). ROC Curves for Top 10 Classes (Subset of 1000 samples). The graph in Fig. 18 displays ROC Curves which show the analysis results for the top 10 classes that were tested with 1000 samples. The Receiver Operating Characteristic (ROC) curves in Fig. 18 display the performance of the ten best classes which researchers tested using a 1000-sample subset. The area under the curve (AUC) for each class is annotated, with most scores nearing 1.0, reflecting excellent separability. The three classes of Leaf Scorch and Powdery Mildew and Tomato Yellow Leaf Curl Virus achieved perfect identification success through their AUC score of 1.00. The three classes of Late Blight and Bacterial Spot achieved AUC scores above 0.97 which shows their strong identification abilities. The model demonstrates overall strength through its micro-average AUC score of 0.99. The curves play an essential role in assessing the model’s ability to distinguish between different classes at all threshold levels during multi-class classification tests. Fig. 19High-Confidence Predictions. High-Confidence Predictions. Figure 19 shows a collection of correctly identified samples which display their projected outcomes and associated assurance levels. The model demonstrates strong confidence in its predictions because most of its predictions show confidence values that exceed 0.90. This finding proves significant because it applies to samples that include diseases which have unique identification features (for example Haunglongbing and Powdery Mildew). The system presents two accurate results which demonstrate visual uncertainty because they yield results between 0.83 and 0.87. The system needs to pair prediction probabilities with explainability tools that include Grad-CAM and LIME18,19 because this combination helps to validate model decisions which apply to precision agriculture and crucial decision making situations. Fig. 20Precision–Recall Curve (Micro and Macro Average). Precision–Recall Curve (Micro and Macro Average). Figure 20 presents the micro- and macro-averaged precision–recall (PR) curves computed across all classes. Both curves show a sharp drop in precision at very low recall values, with average precision (AP) scores around 0.03, reflecting poor model performance in distinguishing between certain classes—especially under class imbalance. This performance degradation indicates the model’s limited ability to retrieve relevant samples across all classes, likely due to overlapping visual features and underrepresented categories. The PR curves serve as an important complement to ROC analysis, especially in multi-class and imbalanced settings, providing critical insight into the trade-off between precision and recall in a real-world deployment scenario. Figure 20 displays the precision-recall PR curves which were estimated by the micro and macro averaging method for all existing classes. The curves experience a rapid precision decline which begins at minimum recall points and reaches average precision results of about 0.03 which shows the model struggles to differentiate between specific classes because of class imbalance. The performance drop shows that the model cannot retrieve relevant samples from its entire set of classes because its visual features overlap and its categories are not adequately represented. The PR curves provide crucial support to ROC analysis because they show how precision and recall perform in actual deployment situations within multi-class systems that have unbalanced class distribution. Fig. 21Grad-CAM Heatmap for Disease Localization. Grad-CAM Heatmap for Disease Localization. The visual comparison in Fig. 21 shows two images which display a corn leaf infected with Cercospora leaf spot and its Grad-CAM activation map. The heatmap highlights the regions most influential in the model’s decision-making process which points to the discolored streaks and lesions that appear in the infected areas of the plant. The visual explanation shows that the model focuses on biologically important elements instead of background disturbances and nonessential patterns. The agriculture field benefits from explainable AI methods which build trust and transparency because false positives and false negatives disrupt agricultural operations. Grad-CAM explainability approach was chosen due to its compatibility with CNN architectures and its ability to produce computationally efficient spatial localization heatmaps that indicate areas with diseases on plant leaves. Unlike LIME and SHAP approaches that belong to the category of model-agnostic explanation approaches, Grad-CAM produces much faster results with less computation required. In comparison to LIME and SHAP, which provide comprehensive interpretability of the decision-making processes but require additional computational power and repeatable evaluations through perturbations of input features, Grad-CAM allows for an effective combination of visual interpretability and computationally efficient explanations. However, since the current work focuses more on interpretability for agricultural applications rather than on computational aspects, Grad-CAM was selected as an explainability method. At the moment, the current study provides visual interpretation and comparative analysis of explanations provided by three methods: Grad-CAM, LIME, and SHAP. However, at this stage, no metrics were applied to quantitatively analyze explainability of these models. Future studies will include the usage of quantitative XAI metrics, including localization accuracy, IoU-based overlap analysis, faithfulness evaluation through perturbations, and comparative analysis of explanations provided by different models. Table 2 presents a comparison of explainable AI methods for plant disease detection. Table 2Comparison of explainable AI methods for plant disease detection.XAI MethodExplainability TypeCNN CompatibilityComputational ComplexityVisualization CapabilitySuitability for Real-Time Agricultural DeploymentGrad-CAMSpatial localization-basedHighLowHeatmap visualization of disease regionsHighLIMELocal surrogate feature explanationModerateHighPerturbation-based local explanationsModerateSHAPFeature contribution-based explanationModerateHighGlobal and local feature attributionModerateProposed Framework (Grad-CAM-based)CNN activation localizationHighLowReal-time disease region highlightingHigh Table 2Comparison of explainable AI methods for plant disease detection.XAI MethodExplainability TypeCNN CompatibilityComputational ComplexityVisualization CapabilitySuitability for Real-Time Agricultural DeploymentGrad-CAMSpatial localization-basedHighLowHeatmap visualization of disease regionsHighLIMELocal surrogate feature explanationModerateHighPerturbation-based local explanationsModerateSHAPFeature contribution-based explanationModerateHighGlobal and local feature attributionModerateProposed Framework (Grad-CAM-based)CNN activation localizationHighLowReal-time disease region highlightingHigh Comparison of explainable AI methods for plant disease detection. Fig. 22t-SNE Visualization of CNN Feature Embeddings. t-SNE Visualization of CNN Feature Embeddings. The t-distributed stochastic neighbor embedding(t-SNE) projection shown in Fig. 22 demonstrates how the CNN learns high-dimensional feature vectors. Each point represents an image, color-coded by its true class label. The model demonstrates its capacity to learn separate feature representations through its ability to create three distinct clusters which include Apple_scab Corn_rust and Grape_leaf_blight classes. The disease categories demonstrate visual similarities because certain areas between them have overlapping characteristics which create difficulty in separating their appearance. The analysis provides valuable diagnostic information about how feature space arranges itself which shows how well classes get identified and what problems exist. Performance metrics The research used multiple assessment methods to test the effectiveness of their multi-modal CNN-based plant disease detection system, which included accuracy, precision, recall, F1-score, area under the ROC curve (AUC), and confusion matrices. The assessment results demonstrate the model’s ability to classify multiple classes when one class appears more frequently than others in the data. The training process reached an accuracy level of 97.6% while the validation process achieved an accuracy level of 88.3% as shown in Fig. 12. The training accuracy increases demonstrate the model has successfully learned from its training data yet the validation accuracy remains low and stable which indicates the beginning of overfitting. The performance gap suggests that training data enables the model to perform well yet the model requires improved regularization techniques which include dropout L2 regularization and early stopping mechanisms to enhance its performance on new data. The difference between training accuracy and validation accuracy suggests moderate overfitting, which is quite prevalent in multi-class image classification applications that operate in high dimensional spaces and are trained using well-controlled datasets like PlantVillage. Various regularization techniques, including dropout, batch normalization, L2 regularization, and data augmentation, were used during the training process to alleviate this problem. Moreover, stratified sampling was employed to ensure the presence of equal distribution of classes within training, validation, and test sets. Despite this, there is room for improvement through the use of adaptive learning rate, early stopping, and cross-dataset validation based on field data. The precision and recall plots in Fig. 11 enable further evaluation of class-specific performance assessment. The majority classes Tomato_Yellow_Leaf_Curl_Virus and Soybean_healthy achieved precision and recall results that reached 95% accuracy yet the minority classes with fewer samples showed significantly lower performance metrics. The observed disparity indicates that learning has become unbalanced because of dataset imbalance while the use of specific data augmentation techniques together with class-weighted loss functions remains essential for achieving balanced learning outcomes across various categories. The overall macro-averaged F1-score of 0.867 indicates satisfactory model performance across all classes, though improvements are still necessary for underperforming categories. The confusion matrix in Fig. 9 provides a more detailed view which shows actual class performance compared to predicted class performance. The matrix shows strong diagonal dominance which indicates high correct classification rates but it also shows confusion between classes that have similar visual features. Tomato_Early_blight gets misclassified as Tomato_Bacterial_spot because of insufficient feature extraction and the system requires sensor data for precise identification of these cases. The ROC curves displayed in Fig. 18 demonstrate that the model accurately identifies plant diseases through its assessment of various plant disease categories. The majority of classes achieved an AUC score between 0.97 and 1.00 which demonstrated their ability to distinguish between different categories. The micro-average AUC across all classes reached 0.99 which demonstrated exceptional ability to differentiate between different classes. The results demonstrate that the CNN system can accurately identify different diseases because it maintains high performance during class imbalance situations. The ROC analysis is complemented by the precision-recall PR curves which appear in Fig. 20 to show how precision and recall interact with each other in situations that have imbalanced class distributions. The micro and macro averaged PR curves both experienced their first drop at low recall levels which resulted in average precision values reaching a stable point of 0.03. The PR curve shape shows improved retrieval for dominant classes while the drop shows that retrieving minority class instances accurately presents a challenge. The model’s learning behavior over time is depicted in Fig. 16, which shows the training and validation loss curves. The validation loss starts to increase after the second epoch because training loss keeps decreasing. The classic sign of overfitting requires additional regularization methods to handle the problem. The study found that extending training time beyond five epochs together with a dynamic learning rate or learning rate scheduler would improve both convergence and generalization results. Figure 15 provides an error analysis by displaying misclassified images. The visual similarities between certain disease types, as shown in these samples, reveal that misclassification often arises from diseases with overlapping symptoms or low visual contrast. This qualitative evidence shows that image-based diagnosis remains complex which supports the requirement to use environmental sensor data for better classification results. The prediction confidence distributions show in Fig. 7 together with the visual evidence from Fig. 19 demonstrate that the model produced its results with high confidence which reached above 0.90 most of the time. The system produced correct predictions through moderate confidence levels which reached 0.83 while showing ambiguous prediction results about image characteristics. The different confidence levels require explainable AI tools which include Grad-CAM to help users understand prediction results and build trustworthiness in essential agricultural applications. The research team used Fig. 17 to assess training efficiency because it displays a heatmap which shows the training times required for each epoch. The system showed stable epoch durations which lasted between 103 and 109 s with only minimal changes. The training pipeline achieved computational efficiency through its scalable design which enables the system to handle both extensive datasets and real-time crop monitoring operations. The robustness and reliability of the proposed solution were ensured by conducting multiple experiments due to the stratified sampling of the data used to build test and training datasets as well as the shuffling of batches used to train the model. According to the findings, the performance of the algorithm remains stable during repeated execution and has slight variations related to classification accuracy and losses. The average test accuracy achieved after conducting multiple iterations was consistent and did not vary greatly, suggesting that the proposed algorithm demonstrated high levels of robustness despite different sampling and initialization. While the current research is devoted to evaluating the developed algorithm on a particular benchmark, future efforts may be devoted to employing methods, such as cross-validation and confidence interval estimation, as well as cross-dataset validation in agricultural settings. Although the proposed approach demonstrates high accuracy when applied to the selected benchmark and controlled images, it is necessary to test the proposed algorithm using datasets obtained in field settings. Thus, one may consider the usage of agricultural data as an option for the validation of the suggested algorithm. Comparative study The researchers conducted a complete assessment of their CNN-based plant disease detection system by comparing it against multiple current leading methods. The comparison considers three primary factors: test accuracy, use of explainable AI (XAI) methods, and the dataset employed. The model demonstrated competitive results by achieving a test accuracy of 97.63% on the complete PlantVillage dataset9 which contains 38 classes while maintaining architectural simplicity and interpretability through Grad-CAM integration. Hasan et al.‘s CSXAI model1 which integrates CNN with SVM and uses Grad-CAM showed a slightly better accuracy result of 99.09% yet the model tested only 10 classes from the PlantVillage dataset which does not reflect actual field conditions. Verma et al.‘s unified lightweight CNN2 demonstrated excellent generalization ability by achieving 95.32% accuracy in three different Corn Rice and Wheat disease classifications yet it did not include any XAI features. The SE-Res-CNN architecture developed by Ashurov et al.3 which combines depth-wise separable convolutions with squeeze-and-excitation blocks and residual connections achieved 98.00% accuracy on a custom multi-species dataset which included Grad-CAM visualizations. Alhammad et al.6 developed a DenseNet121-based model which reached 98.01% accuracy on the Potato Leaf dataset without using XAI while Aboelenin et al.10 created a hybrid EfficientNetB0 + Vision Transformer system which used SHAP explanations to achieve 97.68% accuracy on various leaf datasets. Table 3 shows that multiple models achieve excellent classification results but most of them depend on either specific class boundaries or need heavy computational power or they do not provide understandable results. The proposed model balances its operational performance with the ability to work in real time while providing users with understandable information which enables its effective use in agricultural environments that require quick explanations of results. Table 3Comparative Analysis of Deep Learning-Based Plant Disease Detection Models.Model / StudyAccuracy (%)XAI UsedDatasetRef.CSXAI (CNN-SVM)99.09Grad-CAMPlantVillage (10 classes)1Unified Lightweight CNN95.32NoCorn, Rice & Wheat2Depthwise + SE + ResNet (SE-Res-CNN)98.00Grad-CAMMixed fruit/tree leaves3DenseNet121-Based Model98.01NoPotato Leaf Dataset6EfficientNetB0 + ViT Hybrid97.68SHAP + ViTMixed Leaf Datasets10 Proposed CNN-Based Model 97.63 Grad-CAM PlantVillage (38 classes) — Table 3Comparative Analysis of Deep Learning-Based Plant Disease Detection Models.Model / StudyAccuracy (%)XAI UsedDatasetRef.CSXAI (CNN-SVM)99.09Grad-CAMPlantVillage (10 classes)1Unified Lightweight CNN95.32NoCorn, Rice & Wheat2Depthwise + SE + ResNet (SE-Res-CNN)98.00Grad-CAMMixed fruit/tree leaves3DenseNet121-Based Model98.01NoPotato Leaf Dataset6EfficientNetB0 + ViT Hybrid97.68SHAP + ViTMixed Leaf Datasets10 Proposed CNN-Based Model 97.63 Grad-CAM PlantVillage (38 classes) — Comparative Analysis of Deep Learning-Based Plant Disease Detection Models. This comparative analysis underscores the strengths of our model in achieving high diagnostic performance across a broad class set while maintaining lightweight architecture and integrated explainability—key traits for real-world adoption in precision agriculture. However, it should be noted that the comparative results shown in Table 3 have been obtained by analyzing the performance of models that have been trained in varying experimental conditions, datasets, imbalance between classes, pre-processing methods, and evaluation schemes. Some of the models have been trained with PlantVillage images alone, whereas others have been implemented with a dataset of their own which includes several other crops along with other factors like variations in environment. Thus, comparing the results of the accuracy of both models does not necessarily mean that the environment in which the evaluation process is carried out for each of the models is similar. The objective of making this comparison is to show how different improvements made in deep learning algorithms for plant disease detection fare in comparison with each other. Conclusion The research develops a deep learning system for plant disease identification through a CNN model which trained exclusively on the entire PlantVillage dataset that contains 38 different crop-disease categories. The proposed model achieved a robust test accuracy of 97.63%, demonstrating its capability to accurately classify a wide range of leaf diseases under varied conditions. The system proved effective through complete visualizations which included Grad-CAM heatmaps and prediction confidence distributions and per-class metrics because these elements showed how the system worked to create a usable solution for actual farming environments. The integration of explainable AI (XAI) tools ensures transparency in model decision-making, which is critical for user trust and diagnostic validation, particularly in precision farming environments where model recommendations directly impact crop health decisions. The system requires multiple enhancements which require testing for their potential to increase the system’s ability to function across various contexts. The system requires actual field images which need to be collected during natural light conditions and typical background situations to create a link between laboratory datasets and real-world operational environments. The model would benefit from multi-modal input extension which should include environmental sensor data that tracks temperature and humidity and soil moisture levels to create a complete disease risk assessment system. Incorporating transfer learning into the EfficientNet and Vision Transformer models using attention mechanism has the ability to improve the model’s performance for challenging instances. The model would bring about immense benefits to smallholder farmers by virtue of the model being designed for edge/mobile applications allowing for offline plant assessment to be conducted in field conditions. Although the classification performance is outstanding on the benchmark dataset PlantVillage, the dataset itself is constrained to the laboratory setting and thus does not fully capture the complexities of the agricultural environment. In field conditions, there could be challenges associated with inconsistent lighting, complex background environments, overlapping leaves, motion blurring, and various environmental conditions affecting model performance. As a result, efforts will be focused on validating the developed model framework on actual field data collected under real agricultural conditions.