Multi-domain dataset construction
Three publicly accessible picture collections were used to create a multi-domain dataset with 33 plant disease classes: Plant village (
Hughes and Salathé, 2015), Plant Doc
(Singh et al., 2020) and the Mendeley plant leaf disease dataset (
Srivastava and Meena, 2024). PlantDoc has about 2,500 photos taken in natural settings, where illumination changes, background clutter and partial occlusion may occur, while plant village has about 34,000 photos taken mostly under controlled conditions. With almost 31,000 photos, the Mendeley collection offers more visual variety. These sources were chosen to help the assessment of plant disease classification in a variety of visual contexts and to reflect various image acquisition conditions.
Using the crop-condition combination as the foundation for class assignment, the source labels were harmonized into 33 target classes. Standardization was applied to variations in capitalization, punctuation, space and equivalent illness names. While labels for the same illness in various crops were kept as a distinct category, labels for the same disease in the same crop were mapped to a common class. When appropriate, healthy leaves were kept in crop-specific classes. Fig 2 displays the final class distribution and shows how many photos were kept in each group.
About 20,000 photos were kept for the reported experiments after class harmonization and dataset curation and they were reduced to 128 × 128 pixels. As part of the curation process, duplicate detection and the removal of inappropriate photos are recorded, together with the techniques employed and the quantity of photographs eliminated at each stage. The key features of the obtained dataset are listed in Table 1. Combining different sources improves visual diversity, but its impact on generalization cannot be inferred from dataset design alone; instead, it must be determined by experimental evaluation.
The dataset design may support that the intended model is trained using different and representative samples, thus improving its impact on the real-life application.
Class mapping across datasets
The crop-condition pair, not just the illness text, is a convincing mapping key. First, the original labels are standardized for capitalization, space, punctuation and aliases; labels that are biologically identical for the same crop are combined, while similar disease names that appear on various crops are kept in separate categories. For instance, while potato early blight is still its own class, “Tomato_Early_blight” and “Tomato-Early Blight” would translate to a single “Tomato-Early Blight” class. Crop-specific healthy labels are kept on healthy samples. The final class list and source-to-target lookup for all 33 categories.
Duplicate detection and removal
Using a candidate Hamming distance threshold of ≤5, the suggested procedure first computes SHA-256 hashes to detect byte-identical files, followed by perceptual hashes (pHash) for visually comparable images. To safeguard genuine independent samples, candidate near-duplicates would be examined before being eliminated. To avoid the same leaf image appearing in several partitions, duplication detection is carried out prior to training, validation and test splitting and each near-duplicate group is contained within a single partition.
Baseline model performance analysis
A traditional CNN, MobileNetV3, EfficientNet-B0 and ResNet18, which stand for standard convolutional learning, lightweight computation, compound scaling and residual learning, respectively, were the four baseline models that were assessed. Their respective test accuracies were 86.33%, 91.78%, 93.52% and 94.12%. With specific performance indicators shown in Table 2, these findings offer comparable benchmarks for the suggested approach.
All baseline models and the proposed framework were evaluated on the same curated 33-class dataset using consistent experimental conditions.
Proposed model performance
The suggested hybrid model outperformed the ResNet18 baseline (94.12%) by 4.76 percentage points, achieving 98.88% test accuracy. This enhancement is a result of combining the usage of Transformer encoding to characterize interactions between spatial regions, squeeze-and-excitation (SE) attention for channel-wise feature recalibration and EfficientNet-B0 for feature extraction. These components’ contributions are further demonstrated by the ablation findings, which show that accuracy dropped to 97.66% without SE attention and 98.02% without the Transformer, as opposed to 98.88% for the entire model. Only EfficientNet-B0 gave 93.52% accuracy. These results corroborate both components’ contributions to the overall classification performance. Fig 3 represents the accuracy curve of training and validation and it depicts that the model converges steadily.
Fig 4 shows the loss curve, where the training and validation loss steadily decrease.
The training and validation curves remain close over the reported training trajectory, with no obvious severe divergence between them. This pattern is consistent with stable convergence under the reported AdamW optimization, learning-rate scheduling, label smoothing and early stopping strategy; nevertheless, absence of visible divergence alone is not sufficient to prove that overfitting is completely absent.
The proposed model achieved 99.08% validation accuracy (4,954 out of 5000) and 98.88% test accuracy (4,944 out of 5000), a difference of 0.20 percentage points. Table 3 reports validation precision, recall and F1-score of 0.99, compared with 0.98 for the test set. The accuracy and loss curves presented in Figures 2 and 3 provide additional evidence of training behaviour. Figure 5 illustrates the 33-class confusion matrix. The proposed model outperformed ResNet18, which achieved 94.12% accuracy, by 4.76 percentage points.
Confusion matrix analysis
The confusion matrix for the 33-class classification job is shown in Fig 5. While off-diagonal entries suggest incorrect classifications, the majority of diagonal entries show that the majority of test samples were correctly classified. The model obtained F1-scores, recall and precision of 0.98. 4,944 of the 5000 photos in the test set were correctly classified, while 56 were incorrectly classified, yielding an accuracy of 98.88%. Overlapping fungal lesion patterns, modest symptoms on healthy leaves and similarities between early- and late-stage blight symptoms are examples of potential sources of mistakes. Classification may also be impacted by image-related elements including occlusion, low contrast and complicated backdrops. Since examining the improperly categorized photos is necessary to determine individual failure cases, these elements are potential explanations for misclassification rather than established causes.
Grad-CAM explainability analysis
To visualize the areas in the input images that have the strongest impact on the model prediction to make sure the model is transparent and interpretable, Grad-CAM was used. This analysis is especially critical in agricultural use, where trust and interpretability are key to real-world usage. Fig 6 shows representative Grad-CAM heatmaps of various types of disease.
The Grad-CAM heatmaps highlight image regions that contribute strongly to the model’s class score. In many examples these regions may overlap visible lesions, which is useful for qualitative inspection, but the heatmaps should not be described as proof of biological relevance without expert annotations or quantitative localization metrics. Accordingly, Grad-CAM is used here as a post-hoc explainability tool rather than as an independent validation of disease localization.
Comparative analysis with recent studies
To validate the effectiveness of the proposed approach, its performance was compared with recent studies published in 2025-2026. They comprise CNN-based, transformer-based and hybrid architectures that have been used in classifying plant diseases. Previous studies used different datasets and protocols; their reported results provide context rather than directly comparable evidence of model performance. Table 4 gives a comparative overview of recent approaches.