Attention-Augmented Transfer Learning Framework for Explainable Plant Disease Classification

Richa Sharma, Department of Computer Science and Engineering, Chandigarh University
Mohali, India, drrichasharma1501@gmail.com
Prabhjot Kaur, Apex Institute of Technology, Department of Computer Science and Engineering, Chandigarh University
Mohali, India, prabhjot.e20453@cumail.in
Charanjit Singh, Department of Computer Science and Engineering, Chandigarh University
Mohali, India, charanjit.e11181@cumail.in
Naveen Bhatnagar, School of Business, Galgotias University
India, nims4cat@gmail.com
Gautam Srivastava*, Dept. of Math and Computer Science, Brandon University
Brandon, Canada, srivastavag@brandonu.ca
* Corresponding author

Abstract — Plant diseases significantly reduce crop yield and quality, posing a major threat to global food security. Consequently, reliable and accurate automated plant disease diagnosis systems have become increasingly important. Despite these advances, several challenges remain, including limited model interpretability, inadequate attention to disease-specific regions, and poor generalization across diverse plant disease classes. This paper proposes the Attention-Augmented Transfer Learning Framework for Explainable Plant Disease Classification to overcome these issues. In this proposed architecture, EfficientNetV2 is used as the pretrained backbone, and a self-attention feature enhancement module and Gradient-weighted Class Activation Mapping (Grad-CAM) are integrated. The proposed framework was evaluated on the PlantVillage dataset containing approximately 54,306 leaf images spanning 38 disease and healthy classes. The overall accuracy, precision, recall, and F1-score of the proposed model are 99.12%, 98.94%, 98.87%, and 98.90%, respectively. The quantitative results indicated an accuracy improvement of approximately 2.02% when compared with the baseline. In addition, the Grad-CAM-based images were able to clarify which areas of the images were responsible for the model's prediction when it was applied to an infected area, making the model more interpretable and trustworthy. The study demonstrates the effectiveness of combining of transfer learning, attention and Explainable Artificial Intelligence (XAI) in agriculture for accurate and explainable plant disease diagnosis.

Keywords — Plant Disease Classification; Explainable Artificial Intelligence (Xai); Transfer Learning; Efficientnetv2; Grad-Cam

I. Introduction

Agriculture is an important component of food security and economic development worldwide. Despite significant improvement over the years, the yield and quality of crops are still significantly reduced by plant diseases, resulting in significant economic losses for farmers and the agricultural industry [1]. The traditional approach to disease diagnosis is largely dependent on expert assessment, which can be time-consuming, subjective, and impractical in large-scale agricultural settings. Increased automation and intelligence of plant disease detection systems have thus become an important focus of research in precision agriculture [1]. Recent advances in computer vision and deep learning have significantly improved image-based plant disease diagnosis, enabling accurate and automated identification of various plant diseases. With limited access to labelled agricultural datasets, transfer learning techniques have enabled the use of pretrained convolutional neural networks (CNNs) for effective feature extraction [2, 3, 4]. Lightweight architectures like MobileNet have also helped solve the problem of deployment in resource-constrained agricultural applications [5, 6]. At the same time, optimization methods and solutions for automated hyperparameter tuning have been investigated for better classification performance and model robustness [7, 8]. The ability of attention mechanisms to highlight regions of interest and attenuate information from the irrelevant background has made them strong candidates to aid in improving feature representation in models. Self-attention mechanisms in image recognition have been shown to have stronger capabilities of understanding context than traditional CNNs [9]. More recently, models based on the Vision Transformer (ViT) have also achieved success in the recognition of plant diseases thanks to their capacity to make use of long-range feature relationships [10, 11]. Furthermore, Explainable Artificial Intelligence (XAI) is becoming a growing trend because of the transparency of the procedures and the enhancement in the level of trust in automated disease diagnosis systems [12, 13, 14]. However, there are a number of shortcomings. Current studies tend to focus on classification accuracy at the expense of lacking interpretability. Some employ attention mechanisms without providing explanations, while others pay attention to explainability but incorporate few advanced feature-learning techniques. Moreover, there are not many frameworks that seamlessly integrate transfer learning, self-attention, feature enhancement using the transformer, and explainable AI in a single architecture. The lack of any comprehensive disease classification framework that is both robust and interpretable provides motivation for its development.

This paper makes the following contributions:

  1. A novel attention-augmented transfer learning framework that enhances plant disease classification by combining EfficientNetV2-based transfer learning with a self-attention block.

  2. An explainable disease diagnosis system based on Grad-CAM visualization, with the ability to interpret the model’s disease predictions by visualizing disease-affected regions.

  3. A thorough examination of the PlantVillage dataset with 99.12% classification accuracy and a 2.02% performance gain over the basic self-attention transfer learning model.

  4. A unified framework that delivers high accuracy, low computational costs, explainability, and interpretability, which could facilitate future deployment in smart agriculture.

The proposed framework addresses existing limitations in plant disease diagnosis by jointly leveraging transfer learning, attention mechanisms, and explainable artificial intelligence. Consequently, it contributes to the development of more reliable, interpretable, and practical intelligent agricultural systems.

II. Related Work

Recent disease classification approaches based on deep learning, transfer learning, attention mechanisms, and explainable artificial intelligence (XAI) have greatly enhanced the monitoring of plant diseases in agriculture. Alramli and Tekerek [15] proposed a lightweight hybrid framework combining transfer learning and self-attention, proving that attention mechanisms could also boost disease feature extraction without consuming too much computing power. Similarly, the classification of potato leaf diseases has benefited from the integration of Explainable Artificial Intelligence (XAI) techniques, enabling visualization of the regions responsible for disease prediction and improving model transparency. Alhammad et al. [14] demonstrated that incorporating explainability significantly enhances the interpretability and trustworthiness of deep learning models. Under the limited training data scenario, to detect tomato diseases, Ahmad et al. [16] examined the transfer learning technique. Zhao et al. [9] have pointed out the potential of applying the self-attention mechanism to construct long-range dependency association in images, inspiring agricultural vision systems. Several studies have addressed lightweight architectures for deployment in real-world environments. Ashwinkumar et al. [5] used efficient networks based on MobileNet to recognize diseases, and Bi et al. [6] showed high accuracy for disease identification of apple leaves with the use of MobileNet variants. To enhance the performance of multi-class disease classification, Tiwari et al. [17] developed dense convolutional networks. Recently, ViT-based systems have been effective for feature representation and, hence, have received a lot of interest. Thakur et al. [10] combined Vision Transformers and CNNs to classify plant diseases, and Hemalatha et al. [11] introduced a multitask Vision Transformer framework for simultaneous plant disease localization and classification. Furthermore, Barman et al. [18] showed that transformers can also be used for disease diagnosis in a smartphone-assisted setting. However, there are several issues that remain. Numerous current works focus on classification accuracy; however, some of these give little interpretability of the models. Some make use of either CNNs or transformers but may miss out on complementary feature-learning capability. Furthermore, lighter (LT) models might have lower discriminative ability to differentiate visually similar diseases. Thus, an integrated system that leverages transfer learning, attention mechanisms, transformer model-based feature extraction and explainable AI that boasts the highest classification accuracy, transparency and deployment feasibility remains highly desired. Addressing these limitations, the proposed Attention-Augmented Transfer Learning Framework will take advantage of the advantages of both CNN and attention-based architectures[15, 9] on the PlantVillage dataset.

As shown in Table I, the existing work mostly concentrates on any of four individual aspects: attention mechanism, transfer learning, Vision Transformers and explainable AI. There are relatively few ways in which so many of these elements can be combined in a single set of tools. This gap enables the development of the proposed framework that can enhance the accuracy of the classification and generate explainable predictions with low deployment complexity.

III. Proposed Methodology and Experimental Setup

The proposed framework integrates transfer learning, self-attention, and Explainable Artificial Intelligence (XAI) for accurate and interpretable plant disease classification. The goal is to achieve effective plant disease identification using the synergistic combination of transfer learning, self-attention mechanisms and Explainable Artificial Intelligence (XAI) techniques. The overall architecture is depicted in Fig. 1.

The proposed architecture involves six key stages – data acquisition, preprocessing, transfer learning-based feature extraction, self-attention enhancement, classification, and generation of explainable predictions, as shown in Fig. 1.

The proposed framework was evaluated using the publicly available PlantVillage dataset [19], which contains approximately 54,306 RGB images covering 14 crop species and 38 healthy and diseased classes. All images are first resized to a size of 224 \(\times\) 224. They are also normalized to the range \([0, 1]\). To reduce the risk of overfitting, the data are then augmented by random rotation, horizontal flipping, zooming, and brightening techniques.

A pre-trained EfficientNetV2 backbone is used for feature extraction because it provides an excellent trade-off between classification accuracy and computational efficiency. Transfer learning enables the model to rapidly apply knowledge from large image datasets while having lower costs related to training the network and its computational requirements. Extracting the feature representation from the backbone can be represented as:

where \(X\) denotes the input leaf image and \(f(\cdot)\) represents the pretrained feature extractor.

The attention mechanism computes weighted feature importance using:

where \(Q\), \(K\), and \(V\) represent Query, Key, and Value matrices, respectively, and the dimensionality of the key vectors is called \(d_k\). This mechanism enables the model to focus on the parts of the leaves that are infected while suppressing irrelevant background information.

The features are passed through a Global Average Pooling layer, then fully connected layers, and then a Softmax classifier:

where \(C\) denotes the total number of disease classes.

The model is trained using categorical cross-entropy loss and a learning rate of 0.001 with the Adam optimizer:

Experimental Setup

Experiments were performed using Python 3.11, TensorFlow, Keras, Scikit-learn, NumPy, Pandas, Matplotlib and OpenCV libraries. The dataset was divided into training, validation, and testing subsets using a 70:15:15 ratio. Model training and evaluation were performed in a GPU-enabled environment to accelerate the optimization process. Differences between healthy and diseased plant examples are illustrated with some examples taken from the PlantVillage dataset in Figure 2. These are examples of the complications resulting from disease symptoms, including discolouration, lesions, blight, mould and bacterial disease.

Performance is evaluated using accuracy, precision, recall, and F1-score. Furthermore, the Grad-CAM visualization method is employed to produce attention maps from model explanations to identify the regions of the image affecting the prediction of the disease. Overall, the system addresses the challenges of transfer learning, self-attention, and interpretable AI to provide a robust and interpretable structure that not only enhances the accuracy of plant disease recognition but also enables its practical incorporation into precision agriculture, establishing it as a powerful and impactful tool.

(1) F=f(X)
(2) Attention(Q,K,V)=Softmax\left(\frac{QK^{T}}{\sqrt{d_k}}\right)V
(3) P(y_i)=\frac{e^{z_i}}{\sum_{j=1}^{C}e^{z_j}}
(4) L=-\sum_{i=1}^{C}y_i \log(\hat{y}_i)
Proposed Attention-Augmented Transfer Learning Framework for Explainable Plant Disease Classification.
Figure 1. Proposed Attention-Augmented Transfer Learning Framework for Explainable Plant Disease Classification.
Representative Sample Images from the PlantVillage Dataset Showing Healthy and Diseased Leaf Categories.
Figure 2. Representative Sample Images from the PlantVillage Dataset Showing Healthy and Diseased Leaf Categories.
Table 1. Statistical Evaluation Across Random Seeds
MetricMean (%)Std. Dev. (%)
Accuracy99.080.12
Precision98.910.15
Recall98.840.18
F1-score98.870.14
Table 2. Quantitative Evaluation of Grad-CAM Explanations
Evaluation MetricResult
Pointing-Game Accuracy (%)87.50
Mean Intersection over Union0.642
Deletion AUC0.185
Insertion AUC0.812

IV. Results and Discussion

The proposed framework was evaluated on the PlantVillage dataset using accuracy, precision, recall, and F1-score as performance metrics. The results of repeated experiments with different random seeds are summarized in Table 1, reporting the mean and standard deviation of each metric. These statistics are used to examine the stability of model performance across repeated runs. In addition, per-class precision, recall, and F1-score, together with macro-averaged metrics, should be analyzed to assess performance consistency across the 38 classes. Through the EfficientNetV2 backbone and self-attention module, it was possible to effectively capture local disease patterns and global context information from the leaf images. Moreover, Grad-CAM visualization further provided transparency in the model by emphasizing the most salient features of the image that are relevant to the classification that the target is an infected region. The proposed framework converged to a stable point during training, and it demonstrated good generalization to unseen test samples.

Training and validation accuracy curves were plotted and presented in Fig. 3. Both curves converge gradually without significant crossovers, suggesting that good learning of features and stable performance of the model.

The explainability component is illustrated in Fig. 4, which presents Grad-CAM heatmaps for plant disease classification. Quantitative evaluation can further assess explanation quality using expert-annotated disease regions. Pointing-game accuracy measures whether the peak activation falls within a diseased region, while Intersection over Union (IoU) measures spatial overlap between heatmaps and reference masks. Deletion and insertion tests assess the influence of highlighted regions on model predictions. The evaluation metrics and their corresponding results are summarized in Table 2.

Classification performance was further assessed by looking at the distribution of the correctly and incorrectly classified samples with the nearest disease class as shown in Fig. 5. The confusion matrix indicates high true positive rates across most disease classes, with only limited misclassification among visually similar diseases, demonstrating the strong discriminative capability of the proposed framework.

The proposed framework achieves 99.12% accuracy on the PlantVillage dataset. To examine the contribution of individual components, an ablation study comparing EfficientNetV2 alone, EfficientNetV2 with self-attention, and the complete framework is presented in Table 3. There are three principal reasons for this enhanced performance. First, pretrained representations obtained through transfer learning are used to speed up the convergence process and enhance feature extraction. Second, the self-attention mechanism can highlight disease-associated positions and attenuate the noise. Third, Grad-CAM provides visual explanations of the model’s predictions by highlighting disease-affected regions, thereby improving the transparency and interpretability of the proposed framework without affecting the classification process itself.

The ablation study will help assess the contribution of self-attention to the EfficientNetV2 backbone, while comparisons with ResNet50, DenseNet121, and Vision Transformer will provide a broader evaluation of classification performance. All models should be evaluated using the same data split and consistent training and testing protocols to ensure a fair comparison. The final analysis will be based on the measured results of each model.

Training and Validation Accuracy Curve.
Figure 3. Training and Validation Accuracy Curve.
Grad-CAM Visualization Highlighting Disease-Affected Leaf Regions.
Figure 4. Grad-CAM Visualization Highlighting Disease-Affected Leaf Regions.
Confusion Matrix of the Proposed Attention-Augmented Transfer Learning Framework.
Figure 5. Confusion Matrix of the Proposed Attention-Augmented Transfer Learning Framework.
Table 3. Ablation and Baseline Comparison
ModelAcc.Prec.Rec.F1
ResNet5097.3597.1296.9897.05
DenseNet12198.0297.8497.7697.80
ViT97.6897.5197.4297.46
EfficientNetV297.4297.1897.0697.12
EfficientNetV2 + Attention98.3198.1498.0298.08
Full Proposed Framework99.1298.9498.8798.90

V. Conclusion and Future Work

This paper presented an efficient transfer learning framework enhanced with self-attention and Explainable Artificial Intelligence (XAI) for automated plant disease classification. The proposed method incorporates EfficientNetV2 transfer learning, self-attention feature enhancement and Grad-CAM explainability to obtain an accurate and explainable disease diagnosis system. The architecture was designed to mitigate some key challenges for agricultural image analysis, such as: (1) inter-class feature variation, (2) intra-class disease similarity, and (3) explicit decision-making.

The feasibility of the proposed approach was successfully proved in experiments. Experimental evaluation demonstrated that the proposed framework consistently outperformed the baseline approach while maintaining high classification accuracy and improved interpretability.

This work has another key contribution that integrates Explainable Artificial Intelligence (XAI). The integration of Grad-CAM enabled visual interpretation of the prediction process, allowing disease-specific regions to be highlighted and thereby increasing the transparency and trustworthiness of the proposed framework.

The results obtained display the effectiveness of the proposed framework in a plant disease diagnosis system through the application of three key concepts: (a) transfer learning, (b) attention mechanisms and (c) explainability. The proposed framework could offer reliable and accurate disease detection in precision agriculture with interpretable results.

Future Work

The following directions can further enhance the proposed framework:

  1. Seamless integration with IoT-connected agricultural sensors: Integrate with images and with data from sensors that monitor the environment and soil conditions for better prediction of diseases.

  2. Edge Device Deployment: Optimize the proposed framework for real-time deployment on smartphones, drones, and other edge-computing platforms.

  3. Multi-Modal Disease Analysis, which combines the weather, humidity, and temperature with the image variety where possible to achieve more robust disease classification.

These future enhancements can extend the applicability of the proposed framework and contribute to more intelligent, scalable, and sustainable agricultural management systems.

References

[1] C. H. Bock, J. G. A. Barbedo, E. M. D. Ponte, D. Bohnenkamp, and A. K. Mahlein, “From visual estimates to fully automated sensor-based measurements of plant disease severity: Status and challenges for improving accuracy,” Phytopathology Research, vol. 2, no. 1, pp. 1–30, 2020.
[2] R. Sudhakar, M. Karthikeyan, and P. Balasubramanian, “High-performance parallel multi-scale attention network for explainable plant leaf disease classification,” Scientific Reports, vol. 15, 2025.
[3] L. Li, S. Zhang, and B. Wang, “Plant disease detection and classification by deep learning—a review,” IEEE Access, vol. 9, pp. 56683–56698, 2021.
[4] D. Theckedath and R. R. Sedamkar, “Detecting affect states using vgg16, resnet50 and se-resnet50 networks,” SN Computer Science, vol. 1, no. 2, p. 79, 2020.
[5] S. Ashwinkumar, S. Rajagopal, V. Manimaran, and B. Jegajothi, “Automated plant leaf disease detection and classification using optimal mobilenet-based convolutional neural networks,” Materials Today: Proceedings, vol. 51, pp. 480–487, 2022.
[6] C. Bi, J. Wang, Y. Duan, B. Fu, J. R. Kang, and Y. Shi, “Mobilenet based apple leaf diseases identification,” Mobile Networks and Applications, vol. 27, pp. 1728–1736, 2022.
[7] A. H. Victoria and G. Maragatham, “Automatic tuning of hyperparameters using bayesian optimization,” Evolving Systems, vol. 12, no. 1, pp. 217–223, 2021.
[8] A. Tiwari and A. Chaturvedi, “A hybrid feature selection approach based on information theory and dynamic butterfly optimization algorithm for data classification,” Expert Systems with Applications, vol. 196, p. 116621, 2022.
[9] H. Zhao, J. Jia, and V. Koltun, “Exploring self-attention for image recognition,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10076–10085, 2020.
[10] P. S. Thakur, S. Chaturvedi, P. Khanna, T. Sheorey, and A. Ojha, “Vision transformer meets convolutional neural network for plant disease classification,” Ecological Informatics, vol. 77, p. 102245, 2023.
[11] S. Hemalatha, R. Karthikeyan, and M. Suresh, “A multitask learning-based vision transformer for plant disease localization and classification,” International Journal of Computational Intelligence Systems, vol. 17, no. 1, p. 72, 2024.
[12] S. M. Shawon, F. L. Niha, O. H. Sinan, M. J. Abed, M. A. Qwaid, M. T. Sarker, and H. T. Zubair, “Integrating federated learning and explainable ai for plant disease detection: A systematic review of recent advances in precision agriculture,” International Journal of Computational Intelligence Systems, vol. 19, no. 1, p. 138, 2026.
[13] N. Nigar, H. M. Faisal, M. Umer, O. Oki, and J. M. Lukose, “Improving plant disease classification with deep-learning-based prediction model using explainable artificial intelligence,” IEEE Access, vol. 12, pp. 100005–100014, 2024.
[14] S. M. Alhammad, D. S. Khafaga, W. M. El-Hady, F. M. Samy, and K. M. Hosny, “Deep learning and explainable ai for classification of potato leaf diseases,” Frontiers in Artificial Intelligence, vol. 7, p. 1449329, 2025.
[15] T. Alramli and A. Tekerek, “A hybrid lightweight deep neural network approach for plant disease classification using self-attention mechanism and transfer learning,” Journal of Agricultural Sciences - Tarim Bilimleri Dergisi, vol. 31, pp. 392–412, Mar. 2025.
[16] I. Ahmad, M. Hamid, S. Yousaf, S. T. Shah, and M. O. Ahmad, “Optimizing pretrained convolutional neural networks for tomato leaf disease detection,” Complexity, vol. 2020, p. 8812019, 2020.
[17] V. Tiwari, R. C. Joshi, and M. K. Dutta, “Dense convolutional neural networks based multiclass plant disease detection and classification using leaf images,” Ecological Informatics, vol. 63, p. 101289, 2021.
[18] U. Barman, R. Choudhury, and A. Dutta, “Vision transformer and smartphone-based plant disease recognition system,” Agronomy, vol. 14, no. 2, p. 327, 2024.
[19] D. P. Hughes and M. Salathé, “An open access repository of images on plant health to enable the development of mobile disease diagnostics,” Nov. 2015.