Authors: Satrughan Kumar, S. S. Aravinth, Sreedhar Kollem, Munish Kumar, Quadri Noorulhasan Naveed, Azath Mubarakali, Abhishek Bhattacherjee, Addisu Frinjo Emma
Categories: Article, Deep learning, EfficientNet-B3, Spatial attention, Crop management, Food security, Plant sciences, Mathematics and computing
Source: Scientific Reports
Authors: Satrughan Kumar, S. S. Aravinth, Sreedhar Kollem, Munish Kumar, Quadri Noorulhasan Naveed, Azath Mubarakali, Abhishek Bhattacherjee, Addisu Frinjo Emma
The maintenance of agricultural productivity is critically dependent on the efficient and accurate identification of plant diseases. As observed, the manual inspection to the illness is often inefficient and error-prone, particularly under conditions such as inconsistent lighting, leaf deformities, and subtle distinctions between disease symptoms. To address these challenges, we introduce an enhanced crop disease classification framework that incorporates EfficientNet-B3 with an ancillary convolutional layer and a spatial attention module (ACSA). EfficientNet-B3 offers a strong foundation for feature extraction due to its compound scaling and efficient computation, while the spatial attention module improves classification accuracy by directing the model to focus on critical regions of diseased leaves. Additionally, the integration of ancillary convolutional layer to this architecture enhances the ability of the model to detect subtle disease variations. To further improve the adaptability, the proposed method incorporates a preprocessing and data augmentation techniques. Together, these enhancements create a more effective process for identifying disease pattern in wide range of plant species. The model was evaluated using an extensive crop disease dataset and against state-of-the-art methods such as EffiNet-TS, PlantXViT, and MobileNet V2 to assess its effectiveness. The proposed approach achieved an accuracy of 99.89% and a recall rate of 99.87%, demonstrating its suitability for crop classification with minimal computational overhead. Ablation studies further validate the significant contributions of the spatial attention module and the ancillary convolutional layer to the overall performance of the proposed model.
Diagnosing crop diseases is essential for sustainable agriculture as it reduces yield losses and dependency on agrochemicals. In primary food production, understanding the early symptoms of a disease process in a crop is important to avoid losses and protect food security^1^. According to their causative agents, plant diseases are grouped into biotic and abiotic. Biotic diseases are caused by living organisms such as bacteria, viruses, and fungi, whereas abiotic diseases are caused by non-living factors such as weather, chemicals, and soil anomalies. Bacterial infections caused by rain, wind, machines, and insects result in soft rot, leaf spots, and wilt. Fungal diseases infect tend to thrive in humid environments and be dispersed by spores through wind, water, or insect movement, resulting in mold, rust, mildew, and canker infections. Viral infections, although not visible, contribute to mosaic patterns on leaves, stunting plants and causing yellows and curls, all of which greatly impact crop health and yield^2^.
The advancements in the application of machine learning, especially deep learning, have transformed abnormality detection, lesion identification, and predictive analysis in a variety of fields^3^. Furthermore, deep learning has revolutionized the automated classification of disease, risk evaluation, and precision medicine making it one of the most important technologies in contemporary healthcare and agricultural disease surveillance^4^. With these developments, earlier detection of cancer, some neurological disorders, and infectious diseases has become possible, which has greatly improved patient prognosis. When abundant training data is available, deep neural networks outperform traditional machine learning techniques in anomaly and occlusion detection, as well as pathological pattern recognition in disease diagnosis^5,6^. Therefore, the promptness and proficiency with which such diseases are diagnosed and categorized are most critical. This work seeks to solve the problem of diagnosing crop diseases by improving the accuracy and efficiency of classifying leaf images to identify the exact disease. Most classical techniques aimed at detecting and classifying crop diseases rely on visual inspection, which has several obvious shortcomings. Such methods are time-consuming and less accurate, require a great deal of manpower, hence not appropriate to bridge the gap in quick disease diagnosis of crops. On the other hand, advances in computer vision and machine learning offer new opportunities for classifying crop diseases.
Artificial intelligence incorporates machine learning (ML) and deep learning (DL) for crop disease detection. Some ML approaches, such as SVM (support Vector Machine) and Random Forest, employ hand-crafted features^7^. On the other hand, CNNs (Convolutional Neural Network) provide a higher level of abstraction as they extract features directly from images. They are especially skilled at differentiating between hierarchical features. In the initial layers, they recognize low-level attributes such as edges and textures, and they progress to more sophisticated constructs such as complex shapes in deeper layers. Because of this, CNNs can identify complex and subtle patterns in images which significantly improves their efficiency for crop disease identification. Unlike many ML techniques, CNNs do not need detailed feature specification; they are able to determine what the relevant features are during the training phase^8,9^.
The classification of crop diseases makes use of various methodologies. Segmentation based approach is known to improve the accuracy of classification by the precise identification of diseased areas. Models based on shallow networks, like shallow pyramid scene network (Shal-PSN) and shallow pyramid context network (Shal PCN), improve disease detection through adversarial learning and residual connections. Meanwhile, densely connected convolutional network-121 (DenseNet-121) in LinkNet-34 surpassed the performance of segmentation network (SegNet) and pyramid scene parsing network (PSPNet) and holds a 95% dice coefficient and 93.2% Jaccard Index^10,11^. Other hybrid methods such as the generative adversarial network (GAN) based transfer learning models further improve the localization of the disease, which now holds 98.78% of accuracy^12^. Nevertheless, these approaches face challenges stemming from dataset annotation within a real-world context. It requires various other optimization methods to tackle. For real-time monitoring of diseases, YOLO (You Only Look Once) models, especially YOLOv8, allow for fast classification and recognition of images, thus, making them suited for real-time agricultural surveillance^13^. Despite being efficient and rapid, model reliability is still critically affected by environmental variability and quality of the dataset. On the other hand, Vision Transformers (ViTs) and Swin Transformers, block-based models, propose a different approach by utilizing self-attention to capture long-range dependency relationships within the image. Transformers have an exceptional understanding of global context, which makes them very efficient at identifying structural deformations in leaves like pattern distortions and color spread. Due to global self-attention, a transformer can model long-range dependencies within an image. This allows the network comprehensively leverages inter-regional context, which, in turns, identifies complex multi-pattern diseases occurring over larger regions of a plant leaf^14^. As observed, transformers require large datasets and enormous computational resources to address fine-grained feature in plant disease classification. Global attention often oversimplifies critical details. To overcome these shortcomings, hybrid models with CNN and transformers provide an effective solution by merging local feature extraction with spatial context, strengthening the overall plant disease classification system. Other than CNNs, some different strategies from deep learning, like recurrent neural networks, autoencoders, LSTM (Long Short-Term Memory) networks, and generative adversarial networks have been investigated. RNNs (Recurrent Neural Network) are meant for sequential data but looking at the nature of the data, its scope in image-based tasks is very limited. Though, they can aid in capturing the progression of a disease over time^15–17^. Different methods have been employed for the classification of diseases, and transfer learning has been particularly impressive with deep learning, such as in the case of crop disease detection. This method applies CNNs that were trained beforehand on datasets like ImageNet which contains a vast number of images belonging to hundreds of different classes and categories. Because of the larger dataset, these pre-trained models are able to capture specific details from smaller deep-learning datasets, hence the model can be tailored to meet specific requirements using very little training data and time. Several CNN models have been used to classify plant diseases, including ResNet-50 (Residual Network-50)^18^, EfficientNet^19^, InceptionV3, and VGG-16 (Visual Geometry Group-16)^20^, all of which had outstanding outcomes. For example, certain studies have shown the success of using pretrained models such as ResNet-50 to classify diseases on grape and mango leaves with accuracies exceeding 97%. These advancements in deep learning have greatly impacted the domain of precision agriculture by providing an effective, economical approach to the detection and management of plant diseases. The accuracy and efficiency of CNNs in classifying plants’ diseases has greatly benefited from optimization algorithms and attention mechanisms. Attention mechanisms enable CNNs to focus on the diseased regions of leaves, and therefore captures more relevant features, improving the overall representation. This method employs an attention-weighting technique to exploit useful neighborhood data and achieve state-of-the-art results on various plant datasets. The feature extraction and explainability of the models are enhanced by incorporating pre-trained CNN models DenseNet121 and MobileNetV2 with attention modules^21^. Attention and Grad-CAM (Gradient-weighted Class Activation Mapping) techniques aid in highlighting key regions of interest within leaf images, improving the model’s reliability and accuracy^22^. Attention modules including CBAM (Convolutional Block Attention Module), spatial and channel attention, as well as triplet attention have been studied extensively in the context of plant disease classification. These methods seek to optimize deep learning models by attending to the most important areas to improve accuracy and dependability. Classification results are also improved when salient features receive attention in both the spatial and channel domains. Spatial attention allows focusing on the localization of disease symptoms, while channel attention performs the extraction of relevant feature channels.
Further, triplet attention builds spatial and channel relationships to streamline feature extraction processes^23^. Like many other techniques, there exists a balance between accuracy and efficiency, particularly for practical applications. The attention mechanism improves the accuracy and reliability of the network since it allows the system to focus on pertinent features like the regions of plant leaves affected by diseases. As observed, model performance and generalization also improve when rotation, flipping, and brightness adjustments are applied. These methods are crucial for enhancing the robustness of CNNs against diverse image conditions^14^.
EfficientNet-B3 is one of the most researched networks due to its high accuracy and low resource consumption. It is especially useful for agricultural monitoring systems because it scales optimally with model size and performance, efficiently utilizing resources for real-time processing^19^. In this study^8^, the authors explored its application in crop disease classification and demonstrated its powerful classification capabilities. Advanced EfficientNet models which are capable of classifying complex images of plant diseases are especially useful in precision agriculture, where rapid calculations and instant decisions are essential. The integration of the attention mechanism with EfficientNet has created new opportunities to address plant disease classification challenges. These techniques improve not only model performance but also the model’s explainability and efficiency.
In this study, we develop an efficient deep learning model based on EfficientNet-B3 to classify crop diseases using deep learning techniques. An ancillary convolutional layer along with a spatial attention module is added to the EfficientNet-B3 base model. With the additional convolutional layer and the incorporation of spatial attention, EfficientNet-B3 is able to capture a more comprehensive feature set. The additional convolutional layer enhances formation of local patterns while the spatial attention mechanism improves focus on areas of the image impacted by the disease. All these methods work together to improve the feature vector that represents detailed patterns as well as the overall structure.
Our study focuses on addressing gaps in generalizability to enable the model to attend to the more informative portions of the images. The focus on spatial allocation allows the network to concentrate on the diseased parts of the images, improving input feature extraction while keeping computational requirements low. If a plant leaf exhibits multiple diseases, a larger feature vector facilitates the storage of disease-specific information, thereby enhancing the model’s multi-label classification performance. This approach boosts feature extraction from the images without any significant increase in computational demands^19^.
Our contributions to this study are as
We propose a unified architecture that employs ancillary convolutional operations and spatial attention for localized feature extraction to enhance reliable performance in diagnosis of plant disease.The study aims to employ data augmentation to increase the diversity of the training dataset, alongside hyperparameter tuning to reduce overfitting and improve performance on unseen data.We have focused on reducing computational overhead while maintaining reliable accuracy to achieve real-time adaptability.A preprocessing stage is employed to improve the contrast and color associated with the symptoms of the diseases on leaves to improve visibility.
The structure of this research is as follows. In Section. “Introduction”, we present the introduction. In Section “Literature review”, we provide the review of the literature on recent advancements in crop disease classification. In Section “Proposed methodology”, we describe the proposed model, including preprocessing, architecture, and attention mechanism. In Section “Experimental results”, we analyze the experimental results and performance comparison. In Section 5, we summarize the key findings and conclusions.
The current literature survey aims at presenting some of existing seminal works that have impacted the field. This section explores advancements in plant disease classification. Subsection 2.1 covers new methods in CNN, pre-trained model and attention-based methods, highlighting their role in feature extraction. Segment 2.2 focuses on architectural enhancements and key contributions in the proposed model.
Recently, there has been considerable interest in applying deep learning algorithms to plant disease classification, owing to the efforts made by sophisticated frameworks and methodologies toward improving diagnostic accuracy. Attempts with deep learning techniques in plant disease classification have uncovered a rich and multifaceted set of methodologies, architectures, and performance metrics aimed at enhancing agricultural productivity through accurate disease diagnosis.
Several existing works highlight the power of transfer learning and ensemble techniques in improving the classification problem by utilizing multiple feature representations. A study^2^ in utilized deep feature extraction from the convolutional layers of VGG16, which achieved an accuracy of 96.56% accurately on PlantVillage dataset. With the addition of fine-tuning and hybrid architectures, the model gains richer feature representations, making it more robust and scalable for effective agricultural disease monitoring. They focus on dimensionality reduction methods to improve computational efficiency, ensuring that only disease-related features relevant for classification are retained. In a similar approach, the authors^8^ in analyzed pre-trained models including VGG16, ResNet50, InceptionV3, MobileNetV2, AlexNet, and EfficientNet and conducted the experiment on PlantVillage dataset. Out of all these models, EfficientNet performed the best, achieving a staggering 97.5% accuracy in determining whether leaves were healthy or diseased. They highlighted that, compared to traditional CNN models, the compound scaling and attention mechanisms in EfficientNet capture the detailed and discriminative features, which supports its high applicability in practical agriculture. In this study^9^the authors propose two ensemble models, PDDNet-AE (Plant Disease Detection Network – Autoencoder) and PDDNet-LVE (Plant Disease Detection Network - Latent Variable Estimation), which combine nine pre-trained CNNs into a single model for plant disease identification. On PlantVillage dataset spanning 38 categories, the models reached accuracies of 96.74% and 97.79%, respectively. They suggested data augmentation to improve its generalizability for agricultural applications. In this study^23^, the authors modified ResNet50 by adding dynamic convolution and triplet attention for maize leaf disease classification. The triplet attention mechanism enhances feature extraction by considering relationships across the height, width, and channel dimensions. Its representation consists of three branches, each attending to different spatial relations. One branch emphasizes height-channel interactions, another focuses on width-channel interactions, and the third reduces spatial dimensions directly. Each branch applies Z-pooling, convolution, batch normalization, and sigmoid to produce refined attention weights. This approach adaptively adjusts convolution kernel weights by creating spatial and channel relationships. Models built using this architecture surpassed the current leading models, achieving 98.79% validation accuracy on the PlantVillage maize dataset and 97.47% on the Corn Leaf Disease Dataset using cross-validation. However, the Tri-Attention mechanism places a heavier strain on computational costs, resulting in intensive weight updates and slower convergence unless adequately tuned.
The authors in this study^24^, offered the EfficientNetB3-Adaptive Augmented Deep Learning (AADL) model, which attained an accuracy of 98.71% using transfer learning and adaptive data augmentation. The model applies adaptive augmentation techniques to optimize and enhance training datasets, which in turn leads to attain improved generalization under diverse surrounding conditions. In this study^25^, the authors added attention mechanisms to MobileNetV2, including spatial and channel attention modules. MobileNetV2 is a lightweight architecture with fewer feature extraction layers and parameters. Fewer layers along with depth-wise convolution operations improve its computational efficiency and inference time. It relies on data augmentation for better adaptability. As observed, its narrow feature extraction layers and parameters limit capacity to capture intricate structures. Though, depth wise separable convolutions enable faster computation, they are less effective at capturing discriminative feature compared to deeper models like EfficientNet or ResNet.
In this study^26^, the authors proposed EffiNet-TS, which is built upon the EfficientNetV2 framework and employs a Teacher/Student architecture. This consists of EffiNet-Teacher, a Decoder and EffiNet-Student. They applied DscDF block, which is Dual Skip Connection Deconvolution Fusion that helps to improve feature extraction and visualization. The use of skip connections lessens the effects of the vanishing gradient problem, improving performance. The model achieved 99% accuracy on agriculture plant diseases dataset. In this study^18^, the authors utilized ResNet-50 model for the classification of tomato leaf diseases. ResNet-50 allows deeper networks to be trained more effectively by the use of residual connections. The residual connections alleviate the vanishing gradient issue and enhance the ability of model to capture complex disease features. In this study^27^, a lightweight CNN was developed for real-time plant disease detection, that achieved an accuracy of 98.2% accuracy on a dataset of 7012 images. They reduced the depth of the layers and pooling operation to improve the computation speed and avoid the overfitting. However, the shallow architecture limited the network’s ability to learn hierarchical features and intricate patterns of diseases. Moreover, relying on convolutions with small 3 × 3 kernels limited the receptive field, which in turn restricted its efficacy on multiregional diseased area in an image.
In this study^28^, the effectiveness of deep learning models for plant disease classification was validated, with DenseNet achieving the highest accuracy of 98.27%, reinforcing the importance of model selection. Similarly, a comparable study^20^ on plant disease detection using DenseNet, VGG-16, and ResNet showed that DenseNet still had the highest accuracy with 98.27%. Both studies strongly reinforced the claim that careful model selection and training regimens are necessary for accurate disease classification.
Hybrid models have emerged as the latest advancement to enhance classification accuracy. In this study^15^, authors presented a deep learning approach for classifying paddy leaf disease images. They employed a Modified Bi-directional LSTM (MBi-LSTM) and adaptive feature selection. Texture and color feature extraction were done using the green band. Key features were selected using a combined approach with SV-RFE and ARFA. The MBi-LSTM achieved 97.16% accuracy in classifying Blast, Bacterial Leaf Blight, Tungro, and Healthy images. Authors in^17^ developed a CNN-LSTM hybrid model for maize disease classification. CNNs captured spatial features while LSTMs analyzed temporal sequences. Both static and sequential approaches improved accuracy. However, such methods may be impractical for real-time use due to high computational costs.
In this study^29^, the authors proposed DFNet, a Dense Fusion Convolutional Neural Network for plant leaf disease classification. It incorporates features from two pretrained MobileNetV2 and NASNetMobile. This dual feature extraction strategy improves both the diversity and discrimination of features. The model achieved 97.53% accuracy for corn leaf diseases and 94.65% accuracy for coffee leaf diseases, surpassing single-CNN performance. However, the fusion of two CNNs increases complexity, making deployment on devices with limited resources difficult and real-time usage challenging.
The authors^30^ demonstrated the impact of Vision Transformers (ViTs) on vision tasks and also explored this architecture for the plant disease identification. They utilized the vision transformers along with CNNs to leverage both local feature extraction and global context learning. As observed, due to the diverse feature sets, they obtained remarkable accuracy in complex corn disease classification tasks. ViTs apply self-attention to the entire leaf to analyze its spatial relations. This capability helps in understanding subtle changes in disease spread over the leaves. However, integrating CNN features with ViTs helps to address the disease spread across different regions with in the image. The authors^31^ utilized the Vision Transformer (ViT) and emphasized its role in improving accuracy and efficiency in maize disease classification. They effectively processed large volumes of real-field data and demonstrated the scalability of the transformer model for timely decision-making. The research leveraged a large and diverse dataset and employed ViTs to capture global dependencies within images to improve crop productivity and sustainability. In this study^32^, authors proposed PlantXVit model to address the plant disease classification with an explainable AI framework. They integrated ViTs with CNN to improve the generatability and interpretability to their approach and gained insights into which part of plant were influential in capturing the disease.
In this study^33^, authors investigated the enhancement of deep learning-based plant disease classification by integrating attention mechanisms. The study applied EfficientNetB0, one of the lightweight CNNs, to analyze the model’s performance with and without attention layers. The focus was on evaluating classification accuracy, generalization, and computational cost. On testing over various datasets and basis of statistical inference, EfficientNetB0 was recognized for its low inference time.
In general, the literature emphasizes the need to employ modern deep learning frameworks, efficient transfer learning, and novel approaches toward achieving precision and efficiency in classifying plant diseases. Every study is unique in its methodologies and conclusions, and together these form a cohesive corpus on the use of advanced architectures in agriculture. These works, however, still seem to struggle with capturing the full range of performance dimensionalities for multi-class diseased data categorization, alongside accuracy limitations.
Across multiple studies, the implementation of EfficientNet variants, spatial attention mechanism, and hybrid architectures have been identified as useful aids in providing work in the domain of plant disease classification. These methods appear to be more effective in increasing feature extraction, accuracy, as well as overall efficiency. CNNs, or EfficientNets in this specific case, were found to be the most efficient in performing plant disease classification using deep learning techniques. The performance of EfficientNet can be attributed due to its ability to balance depth, width, and resolution, which optimizes the model’s overall efficiency^8,33^. Attention mechanisms are important for enhancing feature selection and localization in deep learning models^21^. Spatial and channel attention is explored in MobileNetV2, demonstrating its ability to improve classification^25^. NASNetMobile is a smaller neural network that develops its network architecture via Neural Architecture Search (NAS) to create efficient cell operations^41^. The model maintains balanced accuracy and speed while requiring larger memory storage than other models and showing less direct interpretation capability. These models work well on limited-resource platforms but their performance declines when faced with tasks that need deep contextual understanding or complex visual patterns. The lighter models struggle with complex disease patterns due to its lightweight architecture and limited feature extraction capabilities. Similarly, spatial and channel attention is incorporated in EfficientNetB0, enhancing feature selection but slightly increasing inference time^32^. Ensemble and hybrid models have also been explored for plant disease classification. Plant disease classification has also been approached using ensemble and hybrid models. In this study^9^, authors proposed PDDNet, a hybrid of nine pre-trained CNNs, achieving an accuracy of 97.79% due to various feature extraction strategies. In the same way, authors^26^ proposed an EffiNet-TS model based on an EfficientNetV2 with a Teacher/Student learning schema. Their approach used skip connections and fusion methods, yielding 99.0% accuracy. Their method incorporated skip connections and fusion techniques, achieving 99.0% accuracy.
Even with dominant strides in plant disease classification using CNNs and attention techniques, some hurdles still remain. Prior work has shown the classification accuracy improvement achieved with variants of EfficientNet, hybrid models, and attention-based techniques. Still, most suffer from poor computational efficiency, multi-class classification capabilities, and feature extraction. The following key gaps have been
Trade-Off Between Accuracy and Computational Efficiency: Ensemble and hybrid techniques like PDDNet and EffiNet-TS are accurate, but also complicated in terms of computation. Optimized systems that improve classification accuracy without computational demand, while also employing a practical architecture for real world agricultural settings, are required.Challenges in Multi-Class Categorization and Accuracy: Substantial feature extraction in lightweight structures such as MobileNetV2 that has a smaller depth result in less efficient classification.Limited diverse Feature Extraction and Localization: While EfficientNet variants and attention-based approaches improve classification, models still struggle with classifying complex diseases. Previous approaches using spatial and channel attention experienced challenges with feature diversity without increasing computational costs and precise feature localization.
Our proposed EfficientNetB3 model with ancillary convolution and spatial attention (EfficientNetB3-ACSA) optimizes computation and achieves higher accuracy in classifying and locating different tasks. Building upon these findings, my proposed EfficientNetB3-ACSA model integrates spatial attention and an ancillary convolution layer to further enhance feature extraction and classification performance. This modification allows the model to focus more effectively on disease-affected regions. Attention mechanisms play a crucial role in improving feature selection and localization in deep learning models. Unlike previous studies that applied spatial or channel attention separately, my model integrates spatial attention within EfficientNetB3, ensuring precise feature localization without significantly increasing computational cost.
In contrast to these ensemble models, the proffered EfficientNetB3-ACSA model is a single unified structure that is low in weight, making it optimal for use agricultural purposes. The broader feature space strengthens generalization, enabling better classification of unseen data. A well-represented feature set also reduces overfitting by preventing reliance on limited patterns. Greater feature diversity enhances discriminative power, helping the model distinguish between different classes. Moreover, increasing feature diversity enhances discriminative power, allowing the model to distinguish between different classes more effectively. This works improves plant disease classification by adding spatial attention and an auxiliary convolution layer to EfficientNetB3, making the technique novel for precision agriculture.
Table 1 presents the comparative analysis of accuracy and efficiency of the various methods to underpin the performance of the different models. The performance of a convolutional neural network (CNN) depends on the computation expenditure, size of the dataset, and feature extraction. One of the principal problems with deep models is overfitting. A light weighted model is efficient, but struggles with intricate patterns. While attention improves accuracy, it also adds complexity. Overfitting is controlled through regularization methods, such as dropout and weight decay. Learning rate and batch size as important for optimizing hyperparameters for the model. Careful design of the model architecture enhances resource efficiency without sacrificing accuracy.
Table 1Summary of plant disease classification models.ModelTrainable parametersPlantVillage dataset accuracy (%)Core mechanismDesign constraintsHyperparameters roleDeep feature extraction using VGG16^2^121 M96.56%Pre-trained CNN Backbone, Layer-wise Feature CaptureIncreased Computational Demand, Susceptibility to OverfittingLearning rate, dropout rate, data augmentation impact feature generalizationEfficientNet B0^8^5.3 M97.5%MBConv (Mobile Inverted Bottleneck Convolution)Less Optimized for Small Datasets, Fixed Scaling StrategyCompound scaling factor, dropout, weight decay for regularizationEnsemble learning with nine pre-trained CNNs^9^100 M97.79%Pre-trained deep CNN model for multi-class classificationComputational Cost, Model ComplexityWeighting strategy for ensemble fusion, optimizer settingsEfficientNetB3-AADL for enhanced data augmentation^24^12 M98.71%EfficientNetB3, AADL: Augmented Attention-Driven LearningIncreased Computational Demand, Susceptibility to OverfittingAttention module parameters, augmentation intensity, learning rate scheduleMobileNetV2 with attention mechanisms^25^10 M93.7%Squeeze-and-Excitation, CBAMIncreased Complexity, Overfitting (small datasets)SE reduction ratio, learning rate, batch size influence optimizationEfficientNetV2-based EffiNet-TS^26^32 M99%Fused-MBConv Blocks, Squeeze-and-Excitation (SE) AttentionLimited Interpretability, Potential Overfitting in Low-Data ScenariosTraining epochs, optimizer choice, batch normalization effectivenessViT^32^86 M98%Image to Patches, Linear Embedding, Transformer EncoderHigh Computational Cost, sluggish Inductive BiasPatch size, number of transformer heads, learning rate decayResNet50 with dynamic convolution & triplet attention^23^25 M98.79%ResNet50 Backbone, Dynamic Convolution, Triplet AttentionHigh Computational Cost, OverfittingWeight decay, triplet margin, batch size effect on trainingHybrid CNN-LSTM with attention mechanisms^17^15 M97.68%CNN, LSTM (Attention Mechanism)Computational Complexity, OverfittingLSTM hidden units, dropout for temporal dependencies, optimizer tuningMobileNetV2 & NASNetMobile^41^4 M97.53%Depthwise Separable Convolutions, Inverted Residual BlocksStruggles with complex feature extraction for high-resolution or large-scale datasetsBatch normalization, dropout, weight decay for lightweight optimization
In this part, we outline our advanced framework for identifying crop diseases from images of leaves. The proposed methodology relies on EfficientNetB3 as the backbone for classifying diseases of crops, which is further improved by adding an additional convolution layer and a spatial attention unit. This new architecture strives to improve feature extraction by focusing on specific areas pertinent to the diseases within the image by using the best hyperparameter values. Moreover, we add several auxiliary methods in the pipeline intending to improve the overall robustness and accuracy of the classification model. Initially, the input images undergo preprocessing steps, which include colour correction and contrast adjustment to improve symptom visibility. These steps also facilitate more accurate image analysis for detecting and categorizing the disease-related changes. Subsequently, we applied substantial image data augmentation techniques to alleviate the issues such as class imbalance and variability in factors like illumination, image quality, and leaf shape. The implementation of the proposed work is explained in the subsequent subsection.
We have integrated three openly accessible datasets to train, test, and validate the experiment. The PlantVillage dataset is a publicly accessible repository for image-based disease categorization.
It contains a comprehensive database for plant disease classification, comprising 54,309 labeled images spanning 14 diverse crop types. An overview of the three publicly available datasets tailored for plant disease classification is provided in Table 2. The PlantVillage dataset encompasses 38 classes with 44,193 training images, implementing an 20 split for validation and testing. The Tomato-Village dataset consists of four classes of tomato diseases and contains 3,551 training samples. Additionally, a hybrid dataset that combines images of tomatoes taken in the field with those from PlantVillage consists of 38 classes with 46,761 training samples. These datasets enhance deep learning models by providing both controlled and real-world conditions, improving the generalization and robustness of systems for classifying plant diseases.
Table 2Datasets information and training samples distribution.S. No.Web SourceDatasetsClassesTraining samplesValidation samplesTesting samples1 https://www.kaggle.com/datasets/abdallahalidev/plantvillage-dataset PlantVillage Dataset3844,193552455252 https://github.com/mamta-joshi-gehlot/Tomato-Village Tomato-Village435514414413 https://www.kaggle.com/datasets/ashishmotwani/tomato Tomato Leaves field dataset + PlantVillage dataset3846,76158455856
Data augmentation is a vital preprocessing procedure that enhances the performance of deep learning (DL) models in disease identification through image analysis. The challenge of obtaining high-quality labeled plant disease datasets often limits the effectiveness of model training and generalization. Data augmentation techniques effectively address this issue by artificially expanding the training dataset, thereby improving model versatility and accuracy. The purpose of incorporating data augmentation is to introduce randomness into the training data without altering its inherent information content. These variations are introduced by applying a variety of transformations to the training set images to create new synthetic training samples^34^.
This diversity allows the model to experience multiple views of an image, preventing overfitting and improving generalization to unseen data. Various standard data augmentation techniques help generate diverse perspectives in crop leaf disease images. Geometric transformations such as random cropping, flipping, and rotation effectively create different viewpoints of an image. Moreover, color augmentation techniques, including adjustments to brightness, contrast, and saturation, simulate diverse lighting conditions.
Data augmentation is particularly beneficial for EfficientNetB3, as it excels at extracting high-level features from images. Manipulating the training data diversifies feature representations and increases the model’s awareness of unseen data, helping the architecture learn better representations relevant to disease classification. Data augmentation leverages the model’s ability to extract invariances in high-level features and helps address the class imbalance problem by increasing the number of samples in underrepresented classes.
Furthermore, noise augmentation can be incorporated by adding random noise to images, enhancing their resilience against real-world degradation. Table 3 presents our data augmentation strategy.
Table 3Data augmentation and range in proposed experimental setting.Data augmentationRangeImage Horizontal flipTrueImage Rotation20Image Height shift0.2Image Vertical flipTrueImage zoom range0.2Image Width shift0.2Image Shear range0.2
For dataset pre-processing purposes, augmentation techniques such as rescaling, rotation, width/height shifts, shear, zoom, and horizontal flips were performed specifically on underrepresented classes (sample size below 800) in an effort to balance the dataset and mitigate over fitting. Data handling for class distribution was crucial due to the limitation of field images, which made augmentation necessary for thorough training. In the two datasets, which are the Tomato-Village dataset and the Tomato Leaves field dataset mixed with PlantVillage dataset, sample size is adequate for training. Figure 1 shows class-wise original and augmented samples for PlantVillage dataset.
Fig. 1Actual and augmented images in proposed experimental setting for PlantVillage dataset.
However, during model training, the data augmentation techniques described in Table 3 are applied through the train generator to all classes in both datasets. The application of data augmentation within the domain of crop leaf disease detection offers numerous advantages including increased model accuracy and generalization, as well as a decrease in over fitting. Incorporating augmented datasets during training increases the ability of the model to withstand changes in image quality, illumination, and disease symptoms. This allows for more accurate timely decision-making, enhances disease management and intervention strategies, and improves agricultural practices overall. As the field images were limited, so data augmentation was needed necessary for managing class distribution and to employ robust training. The inclusion of real-world field images makes the model more valuable in addressing the challenge of real farming conditions instead of just lab-based settings.
Pre-processing plays a crucial role in analyzing images for crop disease diagnosis, as it improves the quality of the input data, thereby enhancing the model’s capacity to diagnose diseases accurately. This methodology focuses on two major preprocessing color correction and contrast enhancement^35^. Color correction attempts to manipulate raw pixel values to reduce the detrimental effects of lighting variations on classification. Here, it is formulated by equalizing the histogram of the input images to adjust pixel intensities. All pixel intensities are equalized to establish a uniform histogram.
Let ‘I’ be the input image, and ‘I (p, q)’ denote the intensity of the pixel at position (p, q)). The histogram H (I) determines the probability of a pixel appearing at a certain intensity level. The cumulative distribution function (CDF) distributes the intensity more evenly, allowing for a wider range of colors. The CDF is mathematically computed as 1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{cdf}=\sum_{\text{i}=0}^{L}\left(\text{H(i)}\right)
In Eq. (1), ‘L’ represents the number of intensity of pixel. The corrected intensity value ‘I~c~’ is computed by mapping the original intensity values through the CDF:2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{I}}_{\text{c}}\left(\text{p},\text{q}\right)=\frac{\text{cdf}\left(\text{I}\left(\text{p},\text{q}\right)-\text{min}\left(\text{cdf}\right)\right)}{\text{max}\left(\text{cdf}\right)-\text{min}\left(\text{cdf}\right)}\times \left(\text{L}-1\right) $$\end{document} In Eq. (2), the terms ‘min (cdf)’ and ‘max (cdf)’ denote the lowest and highest non-zero ‘cdf’ value, respectively. This change spreads the intensity values over the entire range, increasing the overall variability and making the symptoms of disease more pronounced. Contrastive learning-based contrast adjustment increases the appearance of disease by focusing on specific areas of the image. The adaptive illumination compensation dynamically adjusts lighting conditions across the image to standardize contrast and reveal disease-related features. We used the Adaptive Gamma Correction with Weighting Distribution (AGCWD) method to increase the contrast^36^. This method dynamically adjusts the gamma value based on the histogram distribution of the image, providing adaptive contrast enhancement without introducing excessive noise. AGCWD modifies the traditional gamma correction formula, which is given as 3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{I}}_{\text{en}}={\left(\frac{{\text{I}}_{\text{c}}\left(\text{p},\text{q}\right)}{\text{L}-1}\right)}^{{\upgamma }}\times \left(\text{L}-1\right). $$\end{document} In Eq. (3), γ (p, q) is determined adaptively based on the weighted distribution of pixel 4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\upgamma }\left(\text{p},\text{q}\right)=\frac{\text{log}(1+({\text{I}}_{\text{c}}(\text{p},\text{q}))}{\text{log}(1+\text{WD}({\text{I}}_{\text{c}}\left(\text{p},\text{q}\right))}. $$\end{document} In the above Eq. (4), ‘I~c~(p, q)’ is the original intensity of the pixel, and WD(I(p, q)) represents the weighted distribution function, which is computed by formulating the probability and cumulative distribution function of the improved image^36^. This adaptive gamma value allows the method to enhance low-intensity regions more aggressively while avoiding over-enhancement in already bright areas. The result is a more balanced contrast enhancement, which is particularly useful for highlighting subtle features associated with disease symptoms in leaf images. ### Selection of EfficientNet-B3 architecture for plant disease diagnosis The architecture of EfficientNetB3 is focused on improving the efficiency of computing feature extraction. It applies depth-wise separable convolutions along with squeeze-and-excitation layers which enhance the classification accuracy^19^. Depth-wise convolutions is the process of applying independent filters to every input channel. This practice reduces the overall parameter size without compromising the quality of features. SE modules enhance feature selection by jointly adjusting channel-wise features, allowing critical patterns to receive sufficient attention during training, which weakens irrelevant patterns and boosts useful ones. The integration of these techniques allows EfficientNetB3 to perform well on tasks like plant disease classification, which are difficult because of multiple overlapping symptoms, numerous leaf textures, and high variation in lighting. Unlike architectures like ResNet, which use sequential learning of hierarchical structures, EfficientNetB3 uses parallel learning of hierarchical structures and spatial dependencies, making it easier to differentiate between diseased and healthy leaves. With features of the framework, diagnosis of visually salient diseases in crops such as tomatoes, maize, and wheat become a less complicated process. Unlike EfficientNetB3, CNNs only scale in one dimension. EfficientNetB3, however, scales in all three dimensions simultaneously and within a predefined computational resource. This makes it highly suitable for deployment on low-power agricultural monitoring systems, mobile devices, and edge computing platforms. Table 4 comparison metric shows that EfficientNetB3 achieves higher accuracy with fewer FLOPS than competing architectures. Given the same computational cost, EfficientNetB3 extracts refined, high-resolution features, which significantly improves classification performance. Additionally, its efficient memory utilization enables the processing of high-resolution plant images without excessive computational demands, making real-time disease diagnosis in agricultural fields more feasible. Each EfficientNet variant has a trade-off between accuracy and computational complexity. Table 4Comparison of EfficientNet variants and other CNN models based on parameters, flops, and Accuracy.ModelParametersInput resolutionFLOPsAccuracy (%)(Top-1, ImageNet)Feature Size (After GAP)EfficientNetB05.3 M224 × 2240.39B77.3%1280EfficientNetB17.8 M240 × 2400.70B79.2%1280EfficientNetB29.2 M260 × 2601.0B80.3%1408EfficientNetB312M300 × 3001.8B81.6%1536EfficientNetB419 M380 × 3804.2B82.9%1792EfficientNetB530 M456 × 4569.9B83.6%2048EfficientNetB643 M528 × 52819B84.0%2304EfficientNetB766 M600 × 60037B84.4%2560ResNeXt-10184 M224 × 22432B80.9%2048DenseNet-16914 M224 × 2243.5B76%1664Inception-V448 M299 × 29913B80%1536 As observed from Table 4, EfficientNet-B3 strikes a balance between accuracy and computational complexity, offering 81.6% Top-1 accuracy, which is significantly better than B0–B2 while maintaining a reasonable number of parameters and FLOPs^19^. In contrast, EfficientNet-B4 to B7 only improve accuracy by 2–3%, but require dramatically more computational resources, with FLOPs ranging from 4.2B to 37B. When considering training efficiency and inference speed, EfficientNet-B3 stands out with 1.8B FLOPs, making it computationally feasible for real-time applications. Meanwhile, models B4 to B7, with FLOPs increasing up to 37B, are significantly slower, limiting their suitability for edge devices such as Jetson Nano, TPUs, or Raspberry Pi. For crop disease classification, the input resolution of 300 by 300 in EfficientNet-B3 ensures that the model does not exceed the computational limit, while still allowing it to efficiently identify disease specific patterns. The other models (B4–B7) do not achieve the desired results while operating within a resolution of up to 600 by 600, resulting in increased costs without additional increases in accuracy. Moreover, EffficientNet-B3 performs well in the areas of memory efficiency and feasibility of deployment with only 12 M parameters, which makes it simple to train, fine-tune, and combine with agricultural datasets. Meanwhile, B4–B7 models are more demanding in terms of GPU memory, which could severely limit large scale usage in precision agriculture or real-time monitoring. For these reason, EfficientNet-B3 remains the most practical option for plant disease classification, as it ensures optimal accuracy, efficiency, and easiness of deployment. For a neural network, its feature size is important for both representation and generalization. EfficientNet-B3, for example, can reach a feature size of 1536 and capture rich representations of disease-specific patterns without overly complicating the model. Other variants, such as EfficientNet-B5 to B7, have larger features, ranging from 2048 to 2816. Although these models capture more details, they demand greater computational power. It is evident that light architectures, including EfficientNet-B3, perform more efficiently compared to deep ones. These models improve inference speeds and memory consumption, enhancing their applicability to mobile and edge devices. B4–B7 models are classified as deeper models and are better at capturing hierarchical features. However, they increasingly suffer from accuracy stagnation in relation to FLOPs and memory consumption. This trade-off shows that in the context of agriculture, a model like B3 becomes more practical and efficient because it provides low latency, high accuracy, and optimal resource consumption. EfficientNetB3 has a number of benefits for the diagnosis of plant diseases because it captures the disease features at a higher detail level aiding differentiation of more closely resembling symptoms. It’s efficient from a resource consumption perspective, which makes it suitable for use on edge AI, drones, and other devices, significantly lowering the cost of monitoring large populations of crops. Additionally, its performance with varying levels of environmental occlusion and illumination changes increases practicality. Its support of transfer learning for several datasets on plant disease also reduces the need for extensive retraining. All these aspects enable EfficientNetB3 to enhance the efficacy and accuracy of detecting plant diseases in real-time. ### The EfficientNet-B3 architecture EfficientNet-B3 gives impressively good results in a wide variety of tasks with relatively low numbers of parameters and computational requirements. EfficientNet-B0 serves as the baseline model, and the other version such as EfficientNet-B1, B2, and B3 are derived from it with some deviation in depth, width, and resolution levels. EfficientNet-B3 is the third variant in the EfficientNet family. Fig. 2Block diagram of the EfficientNet B3 model. It is a contemporary CNN model that provides high accuracy while having a moderate model size. It achieves high accuracy with low computational cost, outperforming other high-level algorithms. The model architecture incorporates depth-wise separable convolutions and offers compound scaling. To balance model accuracy with computational resource trade-offs, the model employs compound scaling. Figure 2 shows the block diagram of Efficient Net-B3^19,24^. The B3 variant has the same depth structure as the B0 variant, however, it increases the width by a factor of 1.3 and the resolution by a factor of 1.2. This enables EfficientNet-B3 to achieve greater detail by using a greater number of filters at each layer and working at a higher spatial resolution. Consequently, it enhances the precision of image classification tasks, particularly those that require distinguishing intricate visual elements. The optimized input dimensions for color images are set to 224 × 224 × 3. The model has a 3 × 3 convolutional layer at the beginning for performing shape and texture extraction from the images. The network then goes through a series of mobile convolutional blocks, which are referred to as MConv and utilize depth-wise separable convolutions. Because of these convolutions, the model is able to reduce the computation cost in comparison to other forms of convolutions. The inverted residual connections (IRC) employed in these blocks aid in maintaining the integrity of the feature map while enabling efficient calculations. Overall, MConv combined with IRC enables EfficientNet-B3 to achieve high performance at a low cost. One of the main modules of the architecture is the squeeze-and-excitation (SE) blocks, which serve to further increase model’s attention to relevant channels within the model. The SE blocks permit model response to feature maps to be modulated which helps the model in recognizing disease-associated features in the images better. After convolution and attention, global average pooling (GAP) is employed to further compress the feature map and reduce its dimensions spatially in order to streamline the data to be fed into the densely connected layers. The Global Average Pooling (GAP) layer is the most important part of EfficientNet-B3 because it allows GAP scaling. GAP lowers the dimension of the feature map to 1 × 1, transforming it into a feature vector with no loss of significant information. The last classification layer is performed using SoftMax function that gives class probabilities for a multi-class classification problem. The attention mechanisms along with efficient convolutions and scalable network architecture enable EfficientNet-B3 to excel in precision-intensive tasks that require low computational load. This attribute also makes it demanding for crop disease classification, where accurate feature representation and efficient computations are crucial. The GAP layer reduces the feature dimension to 1 × 1 with 1536 channels. The last hidden layer consists of a dense layer followed by a SoftMax activation function, which outputs class probabilities suitable for classification. The implementation of MConv blocks, compound scaling, pooled mapping, Swish activation, and SE layers augment the feature extraction capabilities of EfficientNet. As a result, EfficientNet is appropriate for crop disease classification, particularly when intricate data interpretation is needed with minimal available data and computational resource. The proposed method customizes the classification model based on EfficientNet-B3 by adding convolutional layers and a spatial attention mechanism. The proposed formulation for a customized architecture is represented as 5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Proposed Formulation}=\text{Spatial attention block}+\text{Modified feature extraction block}. $$\end{document} ### The spatial attention module Convolutional Neural Networks (CNNs) have been exceptionally successful in the area of plant disease identification due to their capability of capturing hierarchical features from images. Nonetheless, standard CNNs allocate the same importance to all spatial locations within an image, which can result in poor performance in more challenging cases where there is symptom localization of plant diseases. Spatial attention mechanisms augment CNNs by allowing models to concentrate on certain image areas and filter out the irrelevant ones^21^. Attention mechanisms aid in enabling a model to focus on the more pertinent parts of an image that have more information relevant to disease identification. By placing class relevant weights or attention scores over different regions of an image, these mechanisms allow the model to focus on features which signify the disease while ignoring confusing or focusing features which do not provide any assistance. Selective attention can significantly improve accuracy in classification of diseases, even when those diseases have a number of features in common. The attention mechanism tries to mimic the functioning of human systems which leave out a lot of information and focuses on unique attributes. Since the creation of deep neural networks, there has been substantial uptake of attention mechanisms in a variety of tasks. The primary feature map is obtained from the base model which includes multiple level patterns and textures. While these features possess important spatial and semantic information, they are spread out across several channels without clear assignment of significance to any specific area. The base feature map ‘X~b~’ from EfficientNetB3 has dimensions (7 × 7 × 1536). A 1 × 1 convolution is applied to reduce the number of channels from 1536 to 6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{F}}^{s1}={\text{R}}_{\text{e}}\left({\text{W}}_{a*}{X}_{\text{b}}+{\text{b}}_{1}\right). $$\end{document} In Eq. (6), ‘W~a~’ represents the weights of the 1 × 1 convolutional filter ((1 × 1 × 1536) → 512 filters). ‘b~1~’ is the bias term. R~e~(⋅) refers to rectified linear unit ( ReLU) activation function. This operation transforms the feature map from (7 × 7 × 1536) → (1 × 1 × 1536). A second 1 × 1 convolution is applied to compute the spatial attention 7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{F}}_{\text{At}}=\upsigma\left({\text{W}}_{b*}{\text{F}}^{s1}+{\text{b}}_{2}\right). $$\end{document} In Eq. (7), ‘W~b~’ represents the weights of the 1 × 1 convolutional filter ((1 × 1 × 512) → 1 filter). ‘b~2~’ is the bias term. ‘σ (⋅)’ refers to sigmoid function, which ensures values are between 0 and 1, giving an attention weight to each spatial location. This results in an attention map of size (1 × 1 × 512). The computed attention map is element-wise multiplied with the base feature 8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{F}}^{\text{SA}}={X}_{\text{b}}\odot {\text{F}}_{\text{At}}. $$\end{document} In Eq. (8), ‘F~b~’ represents the original base feature map (7 × 7 × 1536). ‘F~at~’ belongs to attention map (7 × 7 × 1) (broadcasted across all 1536 channels). The operator ‘⊙’ represents element-wise multiplication. While EfficientNetB3 serves as a robust feature extractor, it does not intrinsically draw attention to particular areas where disease indicators appear. By embedding spatial attention, the model can underscore important regions, making certain visual patterns associated with plant diseases more significant during the classification process. This fosters better feature representation and allows the network to better differentiate between visually similar disease types. ### Proposed architecture and implementation The proposed approach aims to further improve the EfficientNetB3-based classification model by adding ancillary convolutional operations and employing spatial attention on underlying images. Figure 3 illustrates the proposed architecture for leaf-based disease classification. The EfficientNet-B3 model, which is pre-trained on a large dataset, generates the initial feature maps of the input image. While EfficientNet-B3 is well-suited for general feature extraction, it is less specialized for specific tasks such as crop disease detection. To tailor it for this specific task, we introduce an additional convolutional operation in the proposed architecture. This layer increases the non-linearity of the feature maps and enhances the model’s ability to learn distinctive patterns associated with crop diseases. This mechanism strengthens the base model’s discriminative power between different crop diseases, thereby improving classification performance. Moreover, the convolutional branch serves as an additional feature extraction mechanism that can be used in conjunction with pre-trained features, allowing the model to adapt better to the dataset. It captures local features that may be crucial in distinguishing between crop diseases, such as discoloration, spots, or leaf texture variations. This is particularly beneficial when precise classification is required, such as differentiating between various crop diseases. Furthermore, the architecture of EfficientNetB3, which includes MConv blocks, compound scaling, Swish activation, and SE layers, ensures high efficiency and performance. Such advanced feature extraction and scaling strategies in the pre-trained EfficientNet model also improve performance, particularly in cases with limited data. Additionally, the proposed architecture incorporates spatial attention to enhance the detection of disease-affected regions. Spatial attention improves the model’s ability to focus on disease-related areas while minimizing distractions from other parts of the image. Compared to the original structure, we have integrated here a spatial attention module into the top layer of the fine-tuned base model. Base features are extracted using EfficientNetB3. These features are then refined by the spatial attention module to emphasize the most relevant spatial locations, likely corresponding to disease-affected regions. This module learns to identify the most informative regions of the image for disease discrimination. The attention mechanism employs average pooling and max pooling to highlight key areas of interest, such as lesions or leaf discoloration. We employ the max pooling operation in this architecture. This improves the distinction between healthy and diseased regions in plant leaves. The cascaded structure of features from different layers ensures that both general and attention-focused features are examined, enhancing disease localization. We set the input shape to (224, 224, 3) to match the input size of the preferred model. EfficientNetB3, which uses pre-trained weights learned from the ImageNet dataset, is aligned for base feature extraction. Initially, a few top layers are discarded, and the base architecture is adapted for the crop leaf dataset to be used in disease classification. Thereafter, we employ ancillary convolution operation. This enhances the ability of the model to capture more details, which improves the strength of the model’s feature maps. The ancillary convolution layer (Conv. Layer 1) contains 128 filters with a kernel size of 3 × 3 and is activated with ReLU. A kernel size of 3 × 3 allows the convolutional layer to focus on small spatial regions of the input feature map so that spatial hierarchies are preserved. The computation of the output feature map at this layer is as 9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}^{ac}=(\text{conv}\left({\text{X}}_{b},{\text{W}}_{\text{c}}\right)+{\text{b}}_{3}). $$\end{document} In Eq. (9), ‘X~b~’ represents the input base feature vector obtained at the previous layer, and ‘W~c~’ and ‘b~3~’ are the convolutional layer’s weights and biases at the input to the newly added convolution layer. Additional convolutional layer generates finer feature maps. Fig. 3Proffered architecture diagram based on EfficientNet-B3 model and spatial attention module. As observed, when the activations are normalized by batch normalization, the model becomes more stable and converges more quickly^37^. Batch normalization involves eliminating the batch mean from each input value and then dividing it by the batch’s standard deviation. First, a learnable parameter ‘γ’ is employed to normalize the activations, and another learnable parameter ‘β’ is employed to shift the normalized activations. The batch normalization is applied as 10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}_{\text{b}}^{ac}=\left({\upgamma }\left(\frac{\left({\text{X}}^{\text{ac}}-{{\upmu }}_{\text{batch}}\right)}{\sqrt{{{\upsigma }}_{\text{batch}}^{2}-\in }}\right)+{\upbeta }\right). $$\end{document} In Eq. (10), ‘µ~batch~’ represents the mean, while ‘σbatch’ stands for standard deviation of mini batches. The variables ‘’ and ‘β’ scale and shift the normalized input, and these are learnt while training the model. ‘ReLu’ activation enables non-linearity in the model’s layers to adopt intricate relationships and patterns into the data. The ‘ReLu’ sets zero to negative value in feature map while giving linear response for positive inputs. The activation ‘ReLU’ is employed in Eq. (11) as 11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Re}\left({\text{X}}_{\text{b}}^{ac}\right)=\left|\begin{array}{ll}{\text{X}}_{\text{b}}^{\text{ac}} &\quad \text{if }{\text{X}}_{\text{b}}^{\text{ac}}\ge 0\\ 0 &\quad {\text{X}}_{\text{b}}^{\prime \prime }<0.\end{array}\right. $$\end{document} Subsequently, a max-pooling followed by a convolution operation is employed on ‘X~b~^ac^’. A 1 × 1 convolution layer together with batch normalization is included in order to keep the filter size at 512 and capture cross-spatial correlations. After the 1 × 1 convolution, the resulting feature map is represented as 12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}_{\text{ac}}^{f}=\text{MaxPool}({\text{X}}_{\text{b}}^{\text{ac}},{\text{k}}_{3}). $$\end{document} In Eq. (12), ‘X^f^~ac~’ represents the feature map of size 128 obtained using ancillary convolution module. The function ‘MaxPool’ selects the highest value from the pooling window of size ‘k~3~’, which is set to 7. In parallel to the supplementary convolution layer, the spatial attention module is integrated, which includes the operation of max-pooling across the channel dimension of the feature map. The max-pooling provides the most salient feature in a specific region of the feature map. As observed, the pooling operations reduce the dimensionality of the feature maps and make the representations translation invariant. The activation map extracted using base model is transformed into two 2D feature maps with the help of maximum pooling operations across the channel to obtain a region-specific pattern on the images. To employ the spatial attention, a standard convolution layer featuring a kernel size of 7 × 7 is applied here to convolve the input base attributes maps to produce a new 2D feature map. On commemorating a window size of ‘r×r’ over an input feature map ‘X~i~’, max pooling yields the following output. The Max Pooling chooses the maximum value from each window as 13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{Y}}_{\text{maxpool}}\left(\text{u},\text{v}\right)=\text{max}\left({\text{X}}_{\text{i}}\left(\text{u}\times \text{r}+\text{m},\text{v}\times \text{r}+\text{n}\right)\right). $$\end{document} In Eq. (13), ‘Y~maxpool~ (u, v)’ represents the value of the output feature map at point (u, v). The ‘max’ represents the highest value in the pooling window. The value of ‘r’ is set to 7. A spatial attention module is integrated to refine the feature maps obtained in Eq. (13) by highlighting informative regions. First, a 1 × 1 convolution is applied to reduce dimensionality, followed by a second 1 × 1 convolution with a sigmoid activation function to generate an attention After pooling, the feature maps inside the spatial attention module are computed as 14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}_{\text{p}}=\left(\text{Re}\left({\text{W}}_{j*}{\text{Y}}_{\text{maxpool}}(\text{u},\text{v})+{\text{b}}_{5}\right)\right). $$\end{document} In Eq. (14), ‘W~j~’ represents the 1 × 1 convolutional filter weights, b~5~ is respective bias terms, and R~e~(⋅) denotes the activation function, with ReLU applied in the first convolution. The learned attention mask, ‘X~p~ ∈R^(7 × 7 × 1)^, highlights important spatial regions in the feature map. The output of the feature representation obtained in Eq. (14) is sent through a sigmoid activation function, which scales the output to lie inclusively between 0 and 1. The attention map obtained at sigmoid layer is multiplied to base layer feature map in a pointwise manner. The attention scores produced from these results highlight the specific areas of the image that are most pertinent. This, in turns, augments the feature representation. This allows the model to concentrate on the areas impacted by the ailment, which enhances classification precision. The following equations represent the operations to obtain a refined feature map through attention module.15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}_{\text{a}}^{\text{m}}={\upsigma }(\text{conv}\left({\text{X}}_{\text{p}},{\text{W}}_{k}\right)+{\text{b}}_{z}) $$\end{document}16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{X}}_{\text{refined}}={\text{X}}_{b} \odot {\text{X}}_{\text{a}}^{\text{m}}. $$\end{document} where Eqs. (15) and (16) represent activation maps and attention-modulated feature respectively. ‘σ (⋅)’, represents to sigmoid function. While, ‘W~k~’ and ‘b~z~’ refer to weight and bias. The term ‘X~a~^m^’ denotes sigmoid activation map. In the proposed study, two different configurations incorporating spatial attention, base feature, and ancillary convolution layers are examined. In the first configuration, the spatial feature map along with ancillary convolution feature maps are examined. This operation extracts the most salient features so that the resultant classification is made on the most relevant disease-associated features. This aids, especially with regard to classification of the intricate visual differences distinguishing the various plant diseases and improving classification accuracy. In the second configuration, the model uses the feature map obtained by spatial attention, feature from base model and ancillary convolution. By applying the model in this order, it allows for disease-specific areas to be prioritized. It also removes less useful regions. In addition, it gets rid of repeated or unnecessary information. Before concatenating, the global average pooling step within a 1 × 1×C region is applied to reduce the spatial dimension to one value per channel. This transformation simplifies computation while preserving vital information. The concatenated features are expressed 17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Z}\left(\text{u},\text{v}\right)=\text{concat}\left(\underset{\text{i}=0}{\stackrel{\text{H}-1}{\text{max}}}\underset{\text{j}=0}{\stackrel{\text{W}-1}{\text{max}}}{\text{X}}_{\text{ac}}^{\text{b}}\left(\text{i},\text{j},\text{c}\right),\text{GAP}\left({\text{X}}_{\text{refined}}\left(\text{i},\text{j},\text{c}\right)\right)\right). $$\end{document} In Eq. (17), “H” and “W” refer to height and width respectively of the feature map resulting from the pooling operation. The ‘GAP’ employs a global average pooling function to compute the average responses across the spatial dimension. The study using ancillary convolution and spatial attention shows that fine-grained features from disease areas can be captured effectively. This in turns leads to high accuracy. On the other hand, when combining ancillary convolution, spatial attention, and base network features, the accuracy is nearly the same. This makes the method reliable for disease classification. However, it increases the number of features and slightly raises the computation cost. A dense layer with 512 units, followed by a ReLU non-linear transformation, processes the generated 1D feature vector. The last layer incorporates a Softmax activation function, which generates probabilities of the disease’s presence on different classes. The Softmax operation is applied as 18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{P}}_{\text{f},\text{i}}=\frac{\text{exp}({\text{W}}_{\text{f},\text{i}}Z+{\text{b}}_{\text{f},\text{i}})}{\sum_{\text{j}=1}^{\text{C}}{\text{exp}}({\text{W}}_{\text{f},\text{j}}Z+{\text{b}}_{\text{f},\text{j}})} $$\end{document} where in Eq. (18), the ‘W~f~’ and ‘b~f~’ represent the weight and bias at dense layer. ‘P~f, I~’ indicates the probability that the model forecasts for class ‘i’. Fine-tuning is done using a labeled dataset of crop disease images. Data augmentation is used to help the model adapt better to different variations in the images. The model is trained using the Adamax optimizer, where the categorical cross entropy is selected as the loss function and accuracy is defined as the performance metric. The loss function is defined as 19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Los}{\text{s}}_{\text{cross entrophy}} =-\sum_{\text{c}=1}^{\text{C}}{\text{y}}_{\text{c}}\text{log}{\text{P}}_{\text{f},\text{i}} $$\end{document} where in Eq. (19), the ‘y~c~’ and ‘C’ denote the actual label and the total number of classes respectively. Adamax is another form of Adam that is used in the training in order to obtain the optimal parameters^38^. Instead of the second moment as in Adam, Adamax employs the infinity norm (maximum absolute value), which offers more stability in certain cases and is less sensitive to outlier values. The infinity norm is used to allow the maximum absolute value to avoid cases where the largest gradient in a layer dominates the learning rate adjustment. Using Adamax, the parameters are updated as 20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {{\uptheta }}_{\text{M}}^{\text{t}+1}={{\uptheta }}_{\text{M}}^{\text{t}}-\frac{{\upeta^{\prime}}}{{||{\text{v}}_{\text{t}}||}_{{\infty }}}{\text{m}}_{\text{t}} $$\end{document} where, in above Eq. (20), the ‘θ~M~’ are the model parameters and ‘η'’ represents the learning rate. The terms ‘m~t~’ and ‘v~t~‘ denote the first moment and infinity norm respectively, which are computed as 21\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{m}}_{\text{t}}={{\upbeta }}_{1}{\text{m}}_{\text{t}-1}+(1-{{\upbeta }}_{1})\cdot \text{G}\left(\text{t}\right) $$\end{document}22\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {\text{v}}_{\text{t}}=\text{max}({{\upbeta }}_{2}\cdot {\text{v}}_{\text{t}-1},\left|{\text{G}}_{\text{t}}\right|) $$\end{document} where in the above Eq. (21), ‘m~t~’ is the exponentially weighted moving average of the gradient at time step t, ‘G~t~’ denotes the derivative of the loss in respect of the parameters at time frame ‘t’, and ‘β~1~’ is the decay rate for the first moment estimate. The β~2~ represents the scaling factor in Eq. (22). The study focuses on the tuning of the model’s hyperparameters, such as learning rate, batch size, dropout rate, and optimizer, to improve performance and generalization capabilities. The batch size is set to 16. To exemplify, the model was trained for 160 epochs. The learning process was optimized using Adamax, which is known for efficiently minimizing the loss function. The learning rate was adjusted to 0.0005, which specifies the step size taken towards the point of least loss. To counter overfitting, a dropout of 30–50% was implemented, which implies that half of the neurons were dropped off during each training repetition. this attribution allows the model to generalize better without fixing onto a specific neuron therefore making the network learn more advanced features. The dropout layer performs the role of regularization which helps minimize overfitting by perturbing the input data and injecting randomness during training. After 20 iterations, a 10% weight decay was applied to further regularize the model, improve convergence, and speed up optimization. Weight decay, as a model complexity reduction technique, penalizes large offset weights. This encourages the model to strive for smaller, more accurate generalization. In the current work, we evaluate our proposed architecture against a number of approaches for the classification of plant diseases using the pre-trained CNN ensemble model and compare its performance to other models. Though ensemble diversify the feature, but it is computationally expensive. Some other works focus on enhancing lightweight models like MobileNetV2 by applying spatial and channel attention to increase feature extraction without significantly increasing the computational cost. This model tends to underperform on subtle disease patterns, resulting in less precision with more granular disease classification. Other architectures, such as teacher-student model with dual skip connections, overcome overfitting and enhance feature transfer but do so at the expense of increased training complexity. Enhancing feature extraction in ResNet50 using dynamic convolutions and triplet attention makes these models slower to converge and heavier to compute. Other models apply adaptive data augmentation methods to address the environmental variation problem, but optimal performance involves intricate fine-tuning which raises the computational overhead. With regard to feature extraction and precise localization of diseases within images, our architecture employing ancillary convolution integrated with spatial attention is uniquely tailored with substantial focus on fine-grained features. Unlike other methods, this approach leverages architectural modifications and attention mechanisms, which make it more efficient in the detection processes of crop disease. ## Experimental results We have utilized three publicly available datasets listed in Table 2 for training, testing, and validating the experiment. To maintain precision and dependability, the dataset was meticulously curated and partitioned into training, testing, and validation sets. The partition summary is also reported in Table 2. Images were obtained from controlled settings as well as from real agriculture field locations. For instances, we collected 54,305 images from the PlantVillage dataset to train and test our deep CNN model. As shown in Fig. 1, the dataset consists of 14 crops, encompassing 38 different species and classes of diseases. Random samples of these images with crops like apple, corn, tomato, and potato are shown in Fig. 4. As noted in datasets, some classes of diseases had too few samples and measures for class imbalance. We enhanced the samples in dataset with data augmentation techniques like flipping, rotation, shearing, zooming, and scaling to prevent overfitting. A complete list of the augmentation techniques applied can be found in Table 2 in Sect. 3. Figure 1 shows the image count before and after augmentation. Image preprocessing is applied to meet uniformity and quality standards to model training. All images were resized to 224 × 224 pixels to provide input to the proposed model. The data augmentation was employed to obtain the balanced set for each class. Further, the images were divided into the training, validation and test sets. We allocated 80% of data for model training and the remaining 20% for testing. Fig. 4First three columns show unhealthy leaves and last column shows healthy leaves samples. ### Hardware details and settings of training hyperparameters CNN simulations themselves are computationally intensive and require GPU processors for better efficiency. For this study, a TPU on Google Colab has been used to train the proposed model. The Intel^®^ CoreTM i7-7600U CPU and 16 RAM were included as a part of hardware environment. Our model’s hyperparameters, including learning rate, batch size, dropout rate, and optimizer, were meticulously tuned. Additionally, weight decay at 10% is applied after 20 iterations to regularize and improve convergence. Table 5 provide the detail of hyperparameter settings. Table 5Experimental and hyperparameter settings for proposed method.Hyper parameterProposed ValueDescriptionBatch Size16Number of training samples used in one iteration to update model weights.Number of Epochs200Total number of complete passes through the training dataset.OptimizerAdamaxOptimizer used to minimize the loss function, providing efficient learning.Learning Rate0.0005Determines the step size at each iteration while moving toward a minimum during training.Dropout Rate0.5Prevents overfitting by randomly dropping a percentage of neurons during training.Loss functionCategorical Cross EntropyTo improve accuracy while training.Image Size224 × 224Size of input image. ### Performance analysis metrics We used quantitative analysis techniques to assess the model’s overall performance^39^. The performance of the classification outcomes was evaluated with various performance measures such as accuracy, recall, precision, and F1-score. The true positives (tp~p~), true negatives (‘tn~n~’), false positives (fp~p~), and false negatives (‘fn~n~’) are the fundamental indicators of the model’s reliability, derived from the classification results. True positives (‘tp~p~’) are specifically the number of infected samples that the algorithm correctly classifies. The false positive (fp~p~) metric is the amount of samples wrongly assigned to the infected class. True Negative (tn~n~) is the count of actual non-infected samples that have been classified as non-infected. False Negative (fn~n~) means the Number of samples wrongly classified as healthy. Based on these four metrics, the recall rate, precision, F1 and accuracy performance measures are computed as 23\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Precision}\left(\text{Pr}\right) = {\text{tp}}_{\text{p}}/{\text{tp}}_{\text{p}}+{\text{fp}}_{\text{p}} $$\end{document}24\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Recall}\left(\text{Re}\right) = {\text{tp}}_{\text{p}}/{\text{tp}}_{\text{p}}+{\text{fn}}_{\text{n}} $$\end{document}25\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{F}1-\text{Score}= 2\times \text{Re}\times \text{Pr}/(\text{Pr}+\text{Re}) $$\end{document}26\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \text{Accuracy} = {\text{tp}}_{\text{p}}+{\text{tn}}_{\text{n}}/({\text{tp}}_{\text{p}}+{\text{tn}}_{\text{n}}+{\text{fp}}_{\text{p}}+{\text{fn}}_{\text{n}}) $$\end{document} Recall provides information about the competence of the model to accurately classify the positive instances. It is expressed as the ratio of ‘tp~p~’ to the total of ‘tp~p~’ and ‘fn~n~’. Precision assesses the ratio of ‘tp~p~’ out of the total prophesied positives. The F1-score is the harmonic mean of recall and precision, giving a balanced measure of both. However, accuracy determines the global performance of the model by finding out the ratio of correctly prophesied positive and negative cases to the total number of predictions made. All the performance metrics are represented through Eqs. (23)–(26). ### **Performance results and comparison with existing methods** The PlantVillage dataset, widely used for plant disease classification, contains 38 distinct classes spanning 14 crop species, including both healthy and diseased samples. This dataset serves as a benchmark for evaluating deep learning models. Our proposed method leverages this dataset to demonstrate the performance compared to existing classification approaches. Table 6 provides an insightful evaluation of various methods used in image classification by highlighting key performance metrics. These evaluation measures include accuracy, recall, F1-score, and precision. The proposed method EfficientNetB3-ACSA, which integrates EfficientNet B3 with a spatial attention mechanism, achieves the highest metrics across all categories, including accuracy of 99.89%, precision of 99.89%, recall of 99.81%, and F1-Score of 99.89%. Table 6Comparison of performance between existing methods and the proposed approach (All in percentage).S.No.MethodsAccuracyPrecisionRecallF1-Score1VGG-16 + DNN^2^96.659797972EfficientNetB0^8^97.59493933Voting ensemble and early fusion^9^97.7997.1097.0697.014Resnet50^18^969696965EfficientNet B0^19^92.3492.2992.1892.316EfficientNetB3-adaptive augmented method^24^98.7198,8598.7198.727Attention MobileNet V2^25^989898988EffiNet-TS Method^26^999998.9998.909Light-Weight Sequential CNN Model^27^98.998.998.9998.9010Pre-trained Multiple CNNs^28^94.5694.5794.5394.5611DenseNet121^20^94.5894.6094.5894.5612PlantXViT^32^98.8698.9098.8198.8513Proposed Method [EfficientNetB3-ACSA]99.8999.8999.8799.89 The proposed approach increases the trustworthiness of classification. The attention mechanism and ancillary convolution operation enable the model to be attentive to pertinent features. MobileNet and ResNet50 provided an accuracy of 96% to98%, validating their applicability for generic tasks. However, as compared to the proposed model, these are less efficient. This indicates that there is a lack of sufficient feature extraction mechanism in these architectures. Some studies report results of 97.79% accuracy through model ensemble techniques, where multiple models’ predictions are combined. Voting ensembles and early fusion techniques slightly increase accuracy. However, while this approach enhances accuracy, it also adds to the computational burden. Without an advanced feature extraction method and attention mechanism, transfer learning and deep feature extraction techniques have difficulties in concentrating on focal regions in an image. These methods often fail to prioritize diseased areas, leading to reduced classification accuracy in complex tasks like plant disease detection. Spatial attention addresses this problem by concentrating on lesioned areas and ignoring backgrounds noise. The proposed EfficientNetB3-ACSA model focuses on spatial attention by applying it at an efficient location within the model, resulting in improved accuracy with little increase in computational expense. This balance between accuracy and computational burden improves the model’s efficiency for practical applications. Without strategic implementation, model like EfficientNet B0, tends to showcase less precision, averaging between 92% and 94%. On the other hand, the EfficientNetB3-Adaptive Augmented strategy demonstrates the significance of adaptive augmentation on the model’s generalization capability and overall performance. Adaptive augmentation and attention offer pre-trained models enhanced structures, which drive stronger classification accuracy. The applicability of CNNs and ViTs differ with the size of the dataset, complexity of the task, and available computational resources. When resources are constrained, the dataset is small, or the task is basic image classification with local dependencies, CNNs are preferred. Conversely, when explainability is important, or in multi-modal data scenarios, deeply hierarchical data extraction features require complex large-scale and detailed datasets, making ViTs more suitable. PlantXViT reached around 98–99% accuracy on the PlantVillage dataset, which illustrates its complex pattern recognition and predictive capabilities. The method used in PlantXViT is a hybrid model because it takes advantage of both architectures/ It uses CNNs for feature extraction while employing ViTs for attention-based interpretability. The curves presented in Figs. 5 and 6 illustrate the effectiveness of the proposed approach. We calculated the Coefficient of Variation (CV) to analyze the variation in validation performance from one epoch to another. A normalized CV is obtained by comparing the standard deviation to the mean with the standard deviation divided by the mean expressed as a percentage. A lower CV points to better and more reliable behavior from the model. Based on this fact, epoch 80 was chosen as a good and reliable training point. In this epoch, the network’s accuracy was 0.9991, and its loss had dropped to 0.0034. During epochs 70 to 160, the average validation accuracy was around 0.9993, and the standard deviation was approximately 0.00034, leading to a CV of roughly 0.034%. Furthermore, the mean validation loss was 0.00238, and its standard deviation was 0.00083.This indicates that accuracy was steady, but there were some minor fluctuations in the loss. Epoch 80 marked a turning point where both accuracy and loss became favorable, and the model began to generalize better. Starting with epoch 80, the validation accuracy began to fluctuate, and this could be because of several different reasons. If the validation set includes difficult or unclear cases, it might have resulted in unreliable results. Little swings in accuracy might have resulted from changes in learning rate or the sensitivity of the optimizer. Despite the minor fluctuation, analysis with the CV model confirmed that epoch 80 delivered both high accuracy and well-balanced, steady loss in terms of statistics. Intriguingly, 99.81% accuracy was found in testing, indicating that the model can predict well with unseen data. In later epochs, the model is fine-tuning subtle variations and still adjusting weights to reduce error, even though accuracy remains stable. Some of these samples might have had features that were more ambiguous or closer to decision boundaries, causing the model to predict them correctly but with lower confidence, thereby increasing the loss without affecting the accuracy metric. This phenomenon is acceptable when the accuracy is already saturated and the model is refining small misclassifications. Such fine-tuning behaviors, even with oscillating loss, are part of the complex training dynamics observed in deep networks as they explore the loss landscape. The perfect testing accuracy further reinforces that model training was not prematurely stopped, and that epoch 80, selected based on the coefficient of variation analysis, indeed represented a point of optimal and stable performance. The model, at this stage, had learned sufficiently from the training data to generalize well while avoiding overfitting, even though some minor instability in loss was present during validation. Notably, these results suggest that the proposed method has a high accuracy and generalization capacity, which can classify images properly and efficiently, making it a reasonable method for image classification problems. Using a confusion matrix plot, the reliability and efficacy of the model are investigated in further detail. As shown in Fig. 7, the matrix shows actual vs. predicted classes, where plants along the diagonal are correctly classified and plants in other cells as misclassified plants. Through the confusion matrix, it can be inferred that the proposed EfficientNetB3-ACSA achieves remarkable accuracy in the classification system of plant diseases, thereby proving the effectiveness of the proposed system. Fig. 5Training and validation accuracy curve. Fig. 6Training and validation loss curve. Fig. 7Confusion matrix on test images. A diagonal dominance of the matrix indicates that the true labels are nearly equal to the predicted ones. There are very few incorrect predictions, mostly for diseases that look alike, like some tomato and grape diseases. The visible diagonal line illustrates the correct guesses, therefore confirming the approach used is accurate. The off-diagonal non-zero elements of the matrix correspond to a small number of errors, which are probably the consequence of distinguishing visually similar diseases. In general, the confusion matrix provides evidence that the proposed methodology is reliable and precise in classifying diseases from different species of plants. The strong diagonal values confirm that the model demonstrates a high level of correct classification. It also achieves remarkable accuracy in 70 instances of Apple-Apple Scab, 1320 instances of Blueberry-Healthy, and 157 instances of Tomato-Healthy. These results confirm its accuracy in the classification of healthy and diseased leaves. Moreover, the low off-diagonal values imply that there is a lack of gross misclassification. The model, for instance, successfully distinguishes 552 samples of Tomato diseases except few. Even in difficult cases Grape-Leaf Blight, which the model classifies correctly in 445 instances, the model performs well. Other methods, however, like voting ensembles or ResNet50 fail to discern these differences with the same degree of precision, resulting in lower measure values. The results highlight that the developed approach takes advantage of spatial attention to demonstrate reasoning to focus on attention areas which has a positive impact on the classification accuracy. Fig. 8F1-score comparison for different crop using proposed approach. Fig. 9ROC Curves for each crop class using proposed approach. Figure 8 shows the F1-scores attained by the proposed model for different crops. For most of the crops, including tomato leaf, squash, soybean, blueberry, cherry, grape, and orange yielded an F1-score of 1. This indicates that method is reliable and can predict with minimal false positives and negative. The F1-scores were slightly lower for few classes 99.95%, which indicates that there is a slight variation in the performance for these crops. Figure 9 represents the area under the ROC curve (AUC) summarizes the model’s ability to differentiate between classes, with higher values indicating better performance. The model obtains consistently high true positive rates. This indicates that the model performed well in different cases of crop diseases, and effectively alleviating the challenges in early diagnosis of disease. The receiver operating characteristic (ROC) curves were generated for different classes inclusive of different plant diseases and healthy status for crops. All the classes achieved an area under the curve (AUC) value of ‘1’, reflecting a remarkable classification performance. The results demonstrate that the model is capable of accurately differentiating between diseased and healthy conditions, which indicates broad generalization capabilities. Moreover, AUC values greater than 0.9 in almost all categories validate the efficacy, precision, and reliability of the model’s outputs. This is even more important when considering the shortcomings of existing diagnostic methods with respect to distinguishing disease indices from a healthy state. Thus, the model under consideration offers great promise in the context of plant disease diagnosis and in aiding informed decisions in agriculture. Fig. 10Performance comparison between base models and proposed approach. Fig. 11Performance comparison between state-of-the-arts CNN models on plant disease datasets. In Fig. 10, we present the accuracy, precision, recall, and F1-score values of the proposed model alongside the baseline models, which include ResNet50, MobileNetV2, EfficientNet B0, NASNet (Neural Architecture Search Network - Mobile Version), and AlexNet. MobileNet outperformed ResNet50 with a score of 98% across all metrics, while ResNet50 achieved 96%. NASNet-Mobile and EfficientNet B0 exhibited noticeably lower accuracy and F1 scores, approximately 92%, whereas AlexNet recorded the lowest accuracy at 87%. Contrary to other models, the proposed model was able to attain an accuracy of 99.6% which was the highest of all followed by AlexNet scoring the highest F1 and recall rates. Figure 11 shows different deep learning method accuracy rates during plant disease assessments. The data shows four model groups which include EfficientNet and EfficientNetV2 together with ConvNeXt as well as Vision Transformers. The latest version of EfficientNetV2-M achieves the best result (99.4%) while ConvNeXt-L and EfficientNetV2-S tie at 99.3%, and EfficientNet-B7, ViT-L, and MaxViT finish at 99.2%. EfficientNet-B0 has the lowest accuracy (97.2%). The test results demonstrate that modern architectural models such as ConvNeXt and Vision Transformers effectively identify plant diseases. Figure 11 serves as a valuable resource for picking the most precise model in automatic plant disease detection systems for agricultural use. While deeper models perform better in detail feature extraction for complex classifications, they are computationally expensive and have a tendency to overfit the data. They frequently employ strategy convolutional layers or residuals, as seen in ResNet and EfficientNet, to draw hierarchy features. However, extensive usage of convolutional layers increases memory and inference time, which limits their use in resource-limited environments. In contrast, lightweight models are resource efficient, though they may not have the depth needed to distinguish between visually similar diseases accurately. MobileNet, for example, employs depth wise separable convolutions, breaking standard convolutions into one for depth wise, and the other for pointwise. While this drastically reduces the number of parameters, it also reduces the ability to extract intricate features, which leads to misclassifications in scenarios that necessitate granular scrutiny. Similarly, NASNet, which applies neural architecture search to optimize structure selection, may have a streamlined design that makes it vulnerable to intricate disease patterns. Hybrid approaches, incorporating convolutional networks with Transformers or with the addition of spatial attention, simultaneously adroitness and precision. Models are able to attend to pertinent portions through spatial attention, allowing for improved identification of small, disease-invaded areas. Furthermore, models like ViTs use self-attention to provide contextual understanding and fulfill other limitations, capturing dependencies over long distances and fine differences in disease presentations. ### Evaluation on diverse agricultural datasets To assess the efficacy of the proposed model in crop disease classification, extensive experiments were conducted on Tomato-Village and Tomato leaves field dataset + PlantVillage datasets. The images are collected from publicly available dataset reported in Table 2. As shown in Fig. 12, Tomato-Village datasets comprise multiple disease categories, including Magnesium Deficiency, Nitrogen Deficiency, Potassium Deficiency, and Spotted Wilt Virus. Fig. 12Sample images Tomato-Village dataset showing 4 classes deficiency. We also utilized the combination of Tomato leaves field dataset with PlantVillage dataset to assess the diversity. The sample images for tomato leaves field dataset are shown in Fig. 13. Table 7 presents high precision, recall, and F1-score values for most classes, suggesting the model’s robustness in distinguishing between various plant diseases. The classification results indicate that the model achieves a high level of accuracy, with a reported testing accuracy of 99.55%, demonstrating its robustness in identifying disease patterns across various plant species. The model attains a precision, recall, and F1-score of 99.50%, highlighting its ability to accurately detect and distinguish between different crop diseases. However, Spotted Wilt Virus records a slight drop in recall (98%), indicating minor misclassification instances where a few affected samples were incorrectly classified. Fig. 13Sample images of Tomato leaves field dataset. Table 7Comparison of performance on different dataset using the proposed approach (All in percentage).S. NoDatasetsClassesPrecisionRecallF1-ScoreTesting Accuracy1PlantVillage Dataset3899.8999.8999.8799.892Tomato-Village499.5099.5099.5099.553Tomato Leaves Field + PlantVillage3899.3999.4199.4799.39 The classification results indicate that the model achieved an overall testing accuracy of 99.39%, demonstrating its ability to generalize well across different disease categories. ### Computational efficiency and feasibility for Real-Time applications Table 8 presents a comparison of various models based on their parameters, FLOPs (Floating Point Operations per Second), and inference time. The inference time for each model was recorded while processing the image size of 224 × 224 for 100 iterations on Google Colab’s GPU. The proposed model with 14.21 million parameters and 2.12 billion FLOPs achieves an inference time of 53 milliseconds, which is reasonable for making quick decisions in the agricultural domain. The model’s low FLOPs allow efficient computation, meaning the system can be used on edge devices with restricted resources. High accuracy aids reliable disease detection, enabling timely intervention. The proposed model increases the expressive power by 8.3% compared to EfficientNetB3, capturing additional features associated with the disease. Table 8Comparison of computational efficiency between other models and proposed approach.ModelParameters (M)FLOPs (B)Inference Time (ms)ResNet5025.6 M4.1B58 msVGG16138 M15.5B170 msYOLOv362 M65B190 msEfficientNetB312 M1.8B45 msEfficientNetB419 M4.2B58 msEfficientNetB530 M9.9B63 msEfficientNetB643 M19B115 msEfficientNetB766 M37B190 msProposed Model14.21 M2.12B53 ms In this way, the constructed model achieves an optimal blend of high accuracy and computational efficiency, addressing the challenges posed by lightweight and deeper models. The model is appropriate for real-time application, especially for tasks like crop disease classification that necessitate speed and precision, owing to its accuracy and computational efficiency. Its balance of speed and precision makes it applicable in the field for managing crop diseases and facilitating better operational decisions within agricultural practices. ### Analysis of errors and misclassified samples The misclassified samples are illustrated in Fig. 14. From the analysis, it is noted that almost all of the disease categories are classified with near-absolute accuracy, apart from a couple of samples which were misclassified most likely because of resemblance in symptoms to other deficiencies. Misclassifications are primarily attributed to symptom overlaps, lighting variations, and also with certain disease categories being underrepresented in the training dataset. The statistical measures of mean, standard deviation and kurtosis provide valuable insights into the characteristics of correctly classified and misclassified samples. For correctly classified samples, we obtained mean, standard deviation, and kurtosis values of 0.4893, 0.1814 and − 0.4232 respectively. The mean value of 0.4893 indicates a slightly darker average pixel intensity, fairly close to 0.5. This indicates that the model handles normal lighting conditions effectively. The standard deviation of 0.1844 reflects moderate variation in pixel intensities, signifying some diversity in brightness or contrast without being extreme. The kurtosis value of -0.4232 indicates a platykurtic distribution that shows uniform pixel intensity patterns with few extreme values or outliers. It also designates a smooth and consistent pixel intensity distribution. For misclassified samples, we obtained mean, standard deviation, and kurtosis values of 0.4524, 0.2256 and − 0.7458 respectively. The mean pixel value of 0.4524 for the misclassified images is slightly lower than the correctly classified ones. This indicates an average darker image, possibly due to underexposure effects. The higher standard deviation value of 0.2256 indicates a high variation in pixel intensity. This depicts that the mis-classified samples contain high contrast elements along with noisy or complex features, which prove difficult for the model to analyse. The negative kurtosis value of -0.7458 demonstrates a smooth and flat distribution of intensity values across misclassified images with a minimal extreme pixel. This uniformity may further hinder the model’s detection capability of fine-grained detail, contributing to misclassification. In conclusion, darker images with lower variation in brightness and uniform pixel intensity tend to be misclassified. These insights suggest that the model would require modifications to increase performance under low light, high contrast, and fine-less details in uniform areas. The classification performance may also be enhanced with data augmentation techniques, such as changing contrast and brightness, sharp filtering, as well as employing several attention mechanisms by focusing on important areas of the image. Fig. 14Misclassified sample images while experiments. As observed, when input samples exhibit similar color and shape patterns, making them difficult to distinguish. Likewise, tomato bacterial spot and tomato leaf mold sometimes overlap in predictions because both can cause leaf discolorations and curling that appear alike at certain stages. As observed in Fig. 14, the model predicted “Peach Bacterial” even though the class label was set to “Peach Healthy.” This reveals that misclassification may arise from distance to image capture, low resolution detail, model feature exposure, and disease progression being in an early stage. Overall, these errors often arise because different diseases on the same plant species can produce visually similar leaf lesions. ### Ablation analysis of the proposed model Table 9 presents the results for the simulation performed during the ablation analysis. Ablation analysis is conducted to systematically evaluate the contributions of the spatial attention module, the ancillary convolutional layer, and the integration of baseline EfficientNetB3 features. The analysis includes evaluation of accuracy, precision, recall, and F1-score, as well as an analysis of computer efficiency and feature extraction ability. The first experiment incorporates spatial attention (SA) with the EfficientNetB3 backbone. This modification enables the model to emphasize crucial feature representations, leading to an improved accuracy of 98.63%, compared to a pre-trained CNN. he enhancement in feature selectivity is shown in the improved recall of 98.82% and F1-score of 98.83%. In another test, both spatial attention and an additional convolutional operation were incorporated to baseline model to enhance the diversity in the feature set. The inclusion of the ancillary convolutional AC layer enhances the feature extraction process by allowing the model to capture more local feature representation. This results in a more refined detection of differences in disease manifestation. Consequently, there was an increase in accuracy to 99.89%, while precision and recall also improved to 99.89% and 99.87% respectively. The improvement in spatial resolution provided by the ancillary convolutional layer enhances overall generalization of the model to different types of diseases. We observe slight increase in feature size due to the expanded feature extraction pipeline. The difference is only 128, which just 8% hike in comparison to EfficientNetB3. Table 9Ablation analysis of proposed model using Spatial attention (SA), ancillary Convolution (AC) and baseline Feature.ModelFeature SizeParameters(in Million)Accuracy (%)Precision (%)Recall (%)EfficientNetB3153612.3797.50 ± 0.2597.51 ± 0.2697.51 ± 0.25EfficientNetB3 + SA153612,3798.62 ± 0.1898.61 ± 0.1898.60 ± 0.18EfficientNetB3 + SA + AC(Proposed)166414.2199.89 ± 0.0199.89 ± 0.0199.87 ± 0.01 The results highlight that the integration of spatial attention (SA) significantly improves classification performance by refining feature selection. In summary, the analysis reveals that incorporating SA and AC improves model performance and stability, whereby the model achieves the best balance in accuracy and consistency. The confidence intervals indicate model stability, with EfficientNetB3 + SA + AC (± 0.01%) being the most reliable. ### Statistical pairwise model comparison using paired t-test method A statistical hypothesis testing is conducted ro evaluate the performance of the proposed EfficientNetB3 with an Ancillary Convolution Layer and Spatial Attention (EfficientNetB3-ACSA). The primary objective was to assess whether the EfficientNetB3-ACSA model outperformed individual deep learning architectures, such as ResNet50, DenseNet121, and EfficientNetB0, in classifying plant leaf diseases. The experiment was designed to test the following Null Hypothesis (H~0~): The EfficientNetB3-ACSA model achieves higher classification accuracy than individual CNN models.Alternative Hypothesis (H~1~): The EfficientNetB3-ACSA model does not achieve higher classification accuracy than individual CNN models. In order to provide evidence for these hypotheses, accuracy measures were calculated for 10 iterations from each model. A paired t-test was carried out to determine the differences in mean accuracy between EfficientNetB3-ACSA and the other models^40^. The same testing dataset was maintained throughout the trials in order to eliminate bias during evaluation. The accuracy metric for each model was recorded over 10 independent runs. The overall improvement was captured by averaging all the differences. The standard deviation of the differences was taken to address the inconsistencies in model performance across the trials. The paired t-test is commonly used in experimental research to evaluate whether the means of two related groups differ significantly. The formula for the paired t-test is given 27\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ {t}_{p}=\frac{m}{\alpha /\sqrt{n}} $$\end{document}. Where in Eq. (27), ‘m’ is the mean of the differences between paired observations, ‘α’ is the standard deviation of these differences, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ n $$\end{document} is the number of pairs (observations) being compared. The formulation presumes that the set of data is normally distributed, and the null hypothesis states that the two models being compared do not have any meaningful difference. The paired t-test tests to see if the differences obtained in accuracy are significant or not. For this test, the degrees of freedom (df) are calculated as df = n-1. A p-value was calculated for each model to facilitate comparison, and a p-value lower than 0.05 was considered statistically significant. In Table 10, the results of the paired t-test showed significant improvements in the classification performance of the proposed method over several existing models like ResNet50, EfficientNet B0, and the adaptive augmented EfficientNetB3 methods. The strong statistical significance in the listed comparisons reinforces the effectiveness of the model to capture precise changes in analysis performance measures like accuracy, precision, recall, F1 score, and crop disease detection. Table 10Paired t-Test results for model Comparisons.Model Comparison*p*-valueTest outcomeProposed Method vs. ResNet50^18^0.0015SignificantProposed Method vs. EfficientNet B0^8^0.0001SignificantProposed Method vs. EfficientNetB3-Adaptive Augmented Method^24^0.0003SignificantProposed Method vs. EffiNet-TS Method^26^0.0003SignificantProposed Method vs. Light-Weight Efficient Sequential CNN Model^27^0.0002Significant The table lists p-value results from each comparison performed between the proposed method and other existing models. The results demonstrate that the proposed method is better than the comparative models in crop disease classification. ### Model interpretability using Grad-CAM As shown in Fig. 15, we have employed Grad-CAM^42,43^ to understand which parts of our network pay attention to diseases in the leaves. EfficientNet-B3 provides a strong foundation for feature extraction, and in its Grad-CAM visualizations, we observe broad yellow and red regions spread across the diseased parts. Still, in certain situations, the maps do not pay enough attention to isolated areas that are infected. The spatial attention module helps further by drawing attention to the most significant areas of disease. The corn leaf at the top of Fig. 15 has intense red patches over the vertical lines of lesions, which suggests improvements in spotting the symptoms. Using spatial attention, it is easier to highlight vertical structures and the infected regions in corn leaf disease when compared to EfficientNet-B3 alone. The clear focus on specific regions helps us quickly identify where the disease is present. By visualizing the predictions, these tools enable farmers to build trust in the model even without technical background, while researchers can study its behavior and judge how informative its features are. As a result, the use of the spatial attention mechanism helps improve classification accuracy and supports explainable AI applications in farming. Additionally, the ancillary convolutional layer helps gather details on textures and coloration, and Grad-CAM brings out new red-orange details found at the leaf boundaries and near smaller lesions in the original image. The final combined feature maps blend all levels of information, producing sharper and more targeted Grad-CAM visualizations. These deep red zones are precisely located on the diseased regions, demonstrating that both spatial attention and ancillary convolution modules work together effectively, resulting in better disease detection across crops such as corn, grape, and apple. Fig. 15Visual comparison of feature localization across different modules for disease-affected leaf images using Grad-CAM. ### Results and discussion with ethical considerations The proposed EfficientNetB3-ACSA model is evaluated through a comparative analysis with existing classification models. As shown in Table 6, it effectively distinguishes plant diseases using enhanced feature extraction techniques. Figure 8 highlights its classification performance across various crops. However, minor variations occur for blueberry and tomato due to visually similar disease symptoms. These findings suggest that certain crops require further refinement in feature representation to improve robustness. Figure 9 presents the area under the curve (AUC) values, which measure the model’s ability to differentiate diseased and healthy plants. The consistently high values confirm its effectiveness in early disease detection, demonstrating strong real-world applicability. Table 8 provides insights into computational complexity and inference time. As shown in Fig. 11, the model achieves a balance between efficiency and classification performance, making it suitable for resource-constrained environments. Lightweight models struggle with fine-grained disease differentiation. Conversely, deeper networks improve feature learning but increase computational costs. The proposed model balances accuracy and efficiency, making it ideal for real-time deployment. Figure 14 analyses misclassified samples, identifying key factors such as overlapping symptoms, lighting variations, and early-stage disease progression. Table 9 presents the ablation analysis results, evaluating the impact of spatial attention and ancillary convolutional layers. The statistical analysis in Table 10 confirms that these architectural enhancements significantly improve classification performance compared to traditional models. Addressing ethical issues in AI-powered crop disease identification is essential for equity and efficacy. A model for any machine learning application relies on training data, and if that data is biased, a region or a farmer may be unfairly disadvantaged. Illumination changes, leaf damage, and intricate disease recognition pose additional challenges. Moreover, false negatives may permit the spread of harmful diseases while false positives could result in misuse of chemical treatments and resource wastage. Several integrated strategies have been designed to alleviate these problems. Data preprocessing and robust augmentation steps enable the simulation of numerous real-world scenarios outside the training dataset which improves generalizability. Combining EfficientNet-B3’s pre-training with the integration of diverse feature extracting process allows the system to concentrate on the most relevant features of crop images. As a result, the model’s ability to discriminate the subtle differences in symptoms of similar diseases. symptoms improve. Our model provides high precision and reliability while significantly reducing misclassification. The spatial attention module facilitates diagnosis by focusing on the parts of the crop images that are most relevant which is where the symptoms of the disease are clearly visible. This attention improves the identification of the early and subtle signs of a disease thus enabling quicker and more reliable diagnosis. This allows farmers to receive notifications that help avert losses to crops, resources, and time. This combination increases confidence in the technology and encourages farmers to use AI features to manage their crops effectively and proactively. Our approach promotes ethical responsibility and pragmatism in the implementation of AI for crop disease detection. ## Conclusion In this work, we proposed an improved technique for crop disease classification using an EfficientNet-B3 pre-trained model integrated with a spatial attention unit and an auxiliary convolutional layer. This method overcomes some of the major obstacles associated with the manual disease identification process such as time consumption, errors, and challenges in differentiating complicated disease patterns. The spatial attention approach allows the model to concentrate on the most informative parts of the leaf images, which boosts feature extraction and classification accuracy. At the same time, the added convolutional layer improves feature representation that enables the model to capture fine-grained disease features more effectively. The experiments were performed on the diverse datasets, which is globally accepted for plant disease classification. The results proved that the proffered architecture provides classification accuracy than other existing state-of-the-arts leaf disease classification methods. In order to evaluate the spatial attention and an ancillary convolutional operation in the model, we carried out an ablation analysis where these features were turned off and on in a systematic way. The results indicate that turning off the spatial attention module and convolution operation led to a drop in disease recall, indicating its effectiveness in disease localization and extraction of complex patterns. To further validate the superiority of the proposed method, comparisons were made with other deep learning models, ResNet50 and MobileNet. Moreover, analysis of the confusion matrices verified that the model had a very low rate of misclassification, even in instances where diseases had similar visual features. These results strengthen the evidence for the claimed accuracy and usefulness of the proposed method in practical scenarios, particularly in the automated detection of agricultural diseases. This study examines the potential of pretrained architecture by extracting diverse feature set by incorporating attention and ancillary convolution operation. However, real-world agricultural conditions present challenges such as lighting variations, background complexity, and environmental noise. In order to improve the model’s generalization, future work should include data from uncontrolled fields. Moreover, employing other modalities, such as thermal or hyperspectral imaging, could render additional useful information aiding other sophisticated methods of disease detection. Training data can be enriched with generative models like GANs, which also helps the model cope with new variations of diseases. Furthermore, generative models such as GANs can produce varied training samples, improving a model’s flexibility to novel disease changes. Methods like Grad-CAM can enhance the clarity of model explanations and build confidence in agricultural stakeholders. Working on these aspects can greatly improve the precision and reliability of crop disease management tasks.