Attention-Augmented Transfer Learning Framework for Explainable Plant Disease Classification
Gautam Srivastava*, Brandon University
srivastavag@brandonu.ca
Richa Sharma, Department of Computer Science and Engineering, Chandigarh University
Mohali, India, drrichasharma1501@gmail.com
Prabhjot Kaur, Apex Institute of Technology, Chandigarh University
Mohali, India, prabhjot.e20453@cumail.in
Charanjit Singh, Department of Computer Science and Engineering, Chandigarh University
Mohali, India, nims4cat@gmail.com
* Corresponding author
Abstract — lant 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 advancements, 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 architecture, EfficientNetV2 is used as the pretrained backbone, with a self-attention feature enhancement module and Gradient-weighted Class Activation Mapping (Grad-CAM) for visual explanations. 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 enhancement of 2.02 percentage points 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 clearly shows the efficiency of the fusion of transfer learning, attention and Explainable Artificial Intelligence (XAI) in agriculture for accurate and explainable plant disease diagnosis.
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 lost due to plant diseases, which translate to significant economic losses to farmers and the agricultural industry [1]. The traditional approach to disease diagnosis is largely dependent on experienced diagnosis, which can be time-consuming, subjective, and impractical in expansive 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 helped to use pretrained convolutional neural networks (CNNs) for effective feature extraction [2, 3]. Lightweight architectures like MobileNet have also helped solve the problem of deployment in resource-constrained agricultural applications [4, 5]. At the same time, optimization methods and solutions for automated hyperparameter tuning have been investigated for better classification performance and model robustness [6, 7]. 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 [8]. More recently, models based on the Vision Transformer (ViT) have also been achieving success in the recognition of plant diseases thanks to their capacity to make use of long-range feature relationships [9, 10]. 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 [11, 12, 13]. However, there are a number of shortcomings. Current studies tend to focus on classification accuracy at the expense of lacking interpretability. Some of them take a non-explainable focus on their attention mechanism, while others pay attention to explainability but scantily incorporate sophisticated feature-learning techniques. Moreover, there are not many frameworks that seamlessly integrate transfer learning, self-attention, attention-based feature enhancement, 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 brings significant contributions to the literature:
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 make a transparent interpretation of the disease prediction from the model by visualizing the area with the disease.
3. A thorough examination of the PlantVillage dataset with 99.12% classification accuracy and a 2.02-percentage-point accuracy gain over the basic self-attention transfer learning model.
4. A unified framework that combines high classification accuracy with visual explanations and offers potential for 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 include deep learning, transfer learning, attention mechanisms, and Explainable Artificial Intelligence (XAI), which have enhanced plant disease monitoring in agriculture. Alramli and Tekerek [14] 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. [13] 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. [15] examined the transfer learning technique. Zhao et al. [8] have pointed out the potential of applying the self-attention mechanism to construct long-range dependency association in images, inspiring agricultural vision systems. There are a few studies which have addressed lightweight architectures to be deployed in a real-world environment. Ashwinkumar et al. [4] used efficient networks based on MobileNet to recognize diseases, and Bi et al. [5] 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. [16] 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. [9] combined Vision Transformers and CNNs to classify plant diseases, and Hemalatha et al. [10] introduced a multitask Vision Transformer framework for simultaneous plant disease localization and classification. Furthermore, Barman et al. [17] 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, lightweight models might have lower discriminative ability to differentiate visually similar diseases. Thus, an integrated system that leverages transfer learning, attention mechanisms, attention-based feature enhancement 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 combines the strengths of both CNN and attention-based architectures [14, 8] on the PlantVillage dataset.
As shown in Table 1, 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 potential for agricultural applications.
Table 1. Comparative Analysis of Recent Plant Disease Classification Studies
Ref.
Author & Year
Focus
Methodology
Dataset
Key Achievement
Limitation
Alramli and Tekerek (2025)
Plant disease classification
Transfer Learning + Self-Attention
PlantVillage
Lightweight and accurate classification framework
Limited explainability
Alhammad et al. (2025)
Explainable disease diagnosis
CNN + XAI
Potato Leaf Dataset
Improved model transparency
Focused on a single crop
Ahmad et al. (2020)
Tomato disease detection
Optimized Pretrained CNNs
Tomato Leaf Dataset
Effective transfer learning strategy
No attention mechanism
Tiwari et al. (2021)
Multiclass disease classification
Dense CNN
Plant Leaf Images
Improved feature extraction
Computationally intensive
Ashwinkumar et al. (2022)
Lightweight disease recognition
MobileNet-based CNN
Plant Leaf Dataset
Fast inference and deployment
Reduced interpretability
Thakur et al. (2023)
Transformer-based classification
CNN + Vision Transformer
PlantVillage
Enhanced global feature learning
High computational cost
Hemalatha et al. (2024)
Disease localization and classification
Multitask Vision Transformer
Plant Disease Images
Simultaneous localization and classification
Limited explainability support
Nigar et al. (2024)
Explainable disease prediction
Deep Learning + XAI
Plant Disease Dataset
Better transparency and trust
No attention-guided transfer learning
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 [18], which contains approximately 54,306 RGB images covering 14 crop species and 38 healthy and diseased classes. All the images are rescaled first to a size of 224 × 224. They are also normalized to the range [0,1]. To reduce the risk of overfitting, the data is 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:
F = f(X)
where X denotes the input leaf image and f(⋅) represents the pretrained feature extractor.
The attention mechanism computes weighted feature importance using:
Attention(Q, K, V) = softmax(QKᵀ / √dₖ)V
where Q, K, and V represent Query, Key, and Value matrices, respectively, and the dimensionality of the key vectors is called dₖ. 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:
P(yᵢ) = exp(zᵢ) / Σⱼ₌₁ᶜ exp(zⱼ)
where C denotes the total number of healthy and diseased classes and zᵢ is the logit for class i.
The model is trained using categorical cross-entropy loss and a learning rate of 0.001 with the Adam optimizer:
L = −Σᵢ₌₁ᶜ yᵢ log(ŷᵢ)
Experimental Setup
Experiments are 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 Fig. 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 class activation maps to explain 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.
Figure 1. Proposed Attention-Augmented Transfer Learning Framework for Explainable Plant Disease ClassificationFigure 2. Representative Sample Images from the PlantVillage Dataset Showing Healthy and Diseased Leaf Categories.
The proposed framework was tested on the PlantVillage dataset. Experimental results demonstrate that the proposed transfer learning framework, enhanced with self-attention and Explainable Artificial Intelligence (XAI), achieves superior classification performance compared with the baseline approach.
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 showed a good capability in generalization on unseen samples for testing.
Training and validation accuracy curves were plotted and presented in Fig. 3. After comparison, it can be seen that both curves tend to converge gradually with similar trends, suggesting stable learning on the training and validation subsets.
The explainability part of the framework is depicted in Fig. 4, where heat maps were created based on the Grad-CAM model. The highlighted regions correspond closely to the visible disease symptoms, suggesting that the model attends to symptom-related areas in these examples.
Performance of classification was further assessed by looking at the distribution of the correctly and incorrectly classified samples across disease classes, 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.
As presented in Table 2, the proposed model gives an accuracy of 99.12%, which is higher than the baseline by 2.02 percentage points. Similar enhancements are observed in the precision, recall and F1-score, reflecting greater disease discrimination ability. Transfer learning and self-attention may contribute to this enhanced performance, while Grad-CAM provides post-hoc explanations. Firstly, rich representations that are pre-trained through the process of transfer learning are used to speed up the convergence process and enhance feature extraction. Second, the self-attention mechanism can well highlight disease-associated positions and attenuate the noise. In addition, 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.
Figure 3. Training and Validation Accuracy Curve.Figure 4. Grad-CAM Visualization Highlighting Disease-Affected Leaf Regions.Figure 5. Confusion Matrix of the Proposed Attention-Augmented Transfer Learning Framework.
Table 2. Performance Comparison Between the Proposed Framework and the Baseline Model
Method
Accuracy (%)
Precision (%)
Recall (%)
F1-score (%)
Baseline Hybrid Lightweight DNN with Self-Attention [14]
97.10
96.80
96.70
96.75
Proposed Attention-Augmented Transfer Learning Framework
99.12
98.94
98.87
98.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) intra-class feature variation, (2) inter-class disease similarity, and (3) limited decision interpretability.
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] 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.
[5] 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.
[6] A. H. Victoria and G. Maragatham, “Automatic tuning of hyperparameters using bayesian optimization,” Evolving Systems, vol. 12, no. 1, pp. 217–223, 2021.
[7] 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.
[8] 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.
[9] 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.
[10] 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.
[11] 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.
[12] 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.
[13] 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.
[14] 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.
[15] 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.
[16] 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.
[17] U. Barman, R. Choudhury, and A. Dutta, “Vision transformer and smartphone-based plant disease recognition system,” Agronomy, vol. 14, no. 2, p. 327, 2024.
[18] 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.