Crop diseases constitute a danger to worldwide food stability, diminishing harvest yield, grade, and total farming efficiency. Conventionally, the identification of plant ailments has depended on lengthy visual assessments by specialists, a method that frequently results in mistakes. Machine learning (ML) and artificial intelligence (AI), in particular Vision Transformers (ViTs) and Convolutional Neural Networks, deliver a swifter, automated substitute for recognizing plant illnesses through leaf image analysis. However, these frameworks are regularly faulted for their "black box" character, which curbs confidence in their outputs due to a lack of clarity. Our outcomes indicate that integrating Explainable AI (XAI) approaches like Grad-CAM, Integrated Gradients, and LIME notably boosts model explainability, rendering it simpler for users to detect the fundamental indicators of plant sicknesses. This investigation not only adds to the area of plant disease recognition but also supplies an original viewpoint on advancing AI openness in actual farming settings through the application of XAI methods. With training accuracy rates of 100.00% for ViT, 96.88% for EfficientNetB7, 93.75% for EfficientNetB0, and 87.50% for ResNet50, and equivalent validation accuracy rates of 96.39% for ViT, 86.98% for EfficientNetB7, and 82.00% for EfficientNetB0, our suggested architectures exceed earlier studies performed on the identical dataset. This illustrates a considerable leap in model capability while upholding clarity and dependability by way of explainable and trustworthy decision procedures.
Remarkable progress has been made in applying deep learning models to distinguish between weed and crop species within agricultural settings. Still, a significant gap persists in the body of work on how models are trained and evaluated when environmental conditions diverge. The dominant tendency involves either dividing a single dataset distribution into training, validation, and test splits or first pooling datasets originating from varied conditions or distributions and then partitioning them. What our study brings forward is an effort to close this gap: we incorporate multiple broadleaf weed categories spanning dissimilar distributions, probe what happens when convolutional neural networks are trained exclusively on condition- or distribution-specific data, and then gauge their behaviour in entirely foreign environments across three experimental setups. By surveying an array of network designs alongside distinct learning modes (fine-tuning versus feature extraction), testing multiple architectures, adopting varied training protocols, and consolidating data, we arrived at straightforward guiding principles that ensure models retain precision and accuracy even under starkly contrasting deployment conditions. Experiment 1, confined to a single uniform environment, produced accuracies of 80%–100% across models and strategies; fine-tuning yielded higher accuracies (94%–99.9%) than feature extraction (80%–92.96%). Experiment 2 showed a steep drop-off in performance: whenever the test partition came from sources other than the training and validation sets, accuracy ranged from 25% to 60%, most often around 40%. Experiment 3, centred on merging datasets and distributions, delivered encouraging numbers — ResNet in fine-tuning mode attained a high of 99.6%, whereas InceptionV3 in feature extraction mode dropped to a low of 69.9%. These core insights underscore that fusing data from mismatched distributions, paired with fine-tuning on modern backbones like ResNet and MobileNet, markedly improves capability, unlike the comparatively modest outputs of leaner architectures such as AlexNet. Our results suggest that accepting data heterogeneity and flexible training regimens are fundamental to sharpening weed classification pipelines. The study provides a workable approach for handling diverse datasets that reflect genuine agricultural variability.