Abstract
Crop diseases significantly reduce agricultural output and are a serious problem, especially in the parts of the world where diagnostic experts are not readily available. Deep learning has recently shown us that it is possible for a computer to identify plant diseases directly from images of the leaves. Nevertheless, to make such solutions available on the web or mobile devices one has to really think about how heavy the calculations will be, how easy the user interface should be, and also the limit on the data used. Here is a paper on a web-based applied deep learning system for disease detection in multiple crops. The system detects disease in eight crops Apple, Banana, Grape, Mango, Cauliflower, Tomato, Potato, and Corn with each crop having several disease classes and healthy samples. Three transfer-learning-based CNN architectures MobileNetV3, EfficientNetB4, and ResNet50 were compared for classification performance on the public datasets collected from PlantVillage, Kaggle, and Mendeley. Considering class-wise accuracy, prediction time, and deployment scenarios, MobileNetV3 was picked as the main model to be integrated into the system. To compensate for the differences in image quality often found in pictures taken by users, an optional super-resolution preprocessing step with Real-ESRGAN is added and quantitatively assessed. Disease prediction with spectral activation maps (Grad-CAM) enhances the model’s interpretability by highlighting image areas where the disease is detected. The resulting model is embedded in a multilingual Progressive Web Application (PWA). The platform enables users to submit their crop images and receive predicted disease names and treatment options, which are generated by a Large Language Model (LLM) using structured disease metadata. The research acknowledges dataset bias and limitations in extrapolating from curated datasets to the general real-world setting although it reports very good performance of the method on the test sets. In summary, the system proposed here is intended as a practical digital agriculture decision-support tool that demonstrates deployment feasibility and raises a few issues for future validation at the field level and improvement.
Keywords: Crop disease detection, Deep learning, Convolutional neural networks (CNNs), MobileNetV3, EfficientNetB4, ResNet50, Fruits and vegetables classification, Progressive web application, Real-time disease diagnosis, Sustainable agriculture
Subject terms: Computational biology and bioinformatics, Engineering, Mathematics and computing, Plant sciences
Introduction
Agriculture is the pillar of human civilization and a key industry for the pursuit of world food security. Fruits and vegetables, in particular, are rich sources of nutrition and income, but their cultivation is extremely vulnerable to a wide range of diseases caused by fungi, bacteria, viruses, and insects. These diseases not only result in significant yield losses but also confer a negative effect on the quality of produce, thereby diminishing market value and profitability for the producers. Referring to the Food and Agriculture Organization (FAO), crop diseases are the reason for nearly 20–40% production loss all over the world annually, which indicates the enormous need for effective and timely disease management practices.
Traditional crop disease diagnosis also heavily relies on observation by farmers or on advice from agricultural specialists. These are subjective, time-consuming, and not available to small-scale farmers or remote or rural farmers where specialist services are not easily accessible. Furthermore, the early symptoms of most crop diseases are visually indistinguishable, and hence identification is challenging without the necessary expertise. Late or inaccurate detection leads to misuse of pesticides and fertilizers, rising cost of cultivation, environmental pollution, and hence lowered productivity.
Deep learning and computer vision techniques have over the past few years become revolutionary in agricultural application, particularly in plant disease detection. Convolutional Neural Networks (CNNs) have proved to be highly effective in image classification since they can learn to automatically extract advanced features from visual information. Various deep learning architectures such as MobileNet, EfficientNet, and ResNet have been employed successfully in high-accuracy and computationally intensive applications. Most of the existing literature up to now, however, has targeted the detection of only one crop’s disease, rendering it unsuitable to employ in real-world monoculture where numerous crops are grown in the same field.
This paper fills this gap through the creation of a multi-crop disease diagnosis system with fruits and vegetables as its target. For fruits, the selected crops are apple, banana, grapes, and mango, all of which have several classes of diseases as well as healthy samples. For vegetables, the system has cauliflower, tomato, potato, and corn as its target with a wide range of frequent diseases that affect them. As the proposed system has several crops and diseases under a single framework, it is designed to be a generalized and scalable agriculture disease management system.
To ensure high performance, we compare three of the state-of-the-art recent deep learning models like MobileNetV3, EfficientNetB4, and ResNet50, based on their classification accuracy, computational expense, and generalization capability. The highest-performing model is integrated into a multilingual, progressive web application with the ability to function even in remote areas with limited internet connectivity. The application enables farmers to upload images of diseased leaves, pre-process and classify them in real-time, and offer disease-specific recommendations for treatment and preventive measures.
The major contributions of this research are as follows:
-
i.
Design of a multi-disease, multi-crop recognition system for fruits and vegetables.
-
ii.
Comparative performance evaluation of MobileNetV3, EfficientNetB4, and ResNet50 for disease classification of plants.
-
iii.
Creation and rollout of a forward-looking, multilingual website available in rural and low-connectivity regions.
The provision of rapid disease identification and actionable guidance to farmers to reduce crop loss and increase productivity. By bridging the gap between cutting-edge deep learning techniques and practical agricultural problems, the current research advances the creation of digital farming technology. It demonstrates the potential of artificial intelligence to provide farmers with early disease detection, which promotes sustainable agriculture and ultimately enhances food security.
Crops and diseases overview
This section is a detailed look at the fruit and vegetable crops that have emerged as the most popular choices over time. In fruits, Banana, Apple, Mango and Grapes and in vegetables, Potato, Cauliflower, Corn and Tomato are those crops which include the list of four major diseases per crop. Selection of the mentioned crops was due to the high agriculture sector importance, the ease of visual signs of the disease for diagnosis, and the large amount of public data. Table 1 represents the detailed information about the fruit crops and its diseases whereas the Table 2 represents the detailed information about the vegetable crops.
Table 1.
Fruit crops and diseases.
| Fruit Crop | Diseases considered | Description |
|---|---|---|
| Apple | Apple Scab, Black Rot, Cedar Apple Rust, Healthy | Apple scab is caused by Venturia inaequalis, leading to dark lesions; black rot by Botryosphaeria obtusa, affecting leaves and fruit; cedar apple rust caused by Gymnosporangium juniperi-virginianae produces orange spots |
| Banana | Panama Disease, Sigatoka, Fusarium Wilt, Healthy | Panama disease (Fusarium wilt) is caused by Fusarium oxysporum f.sp. cubense; Sigatoka (Mycosphaerella spp.) affects leaves; Fusarium wilt also causes vascular damage |
| Grapes | Black Rot, Esca (Black Measles), Healthy | Black rot caused by Guignardia bidwellii leads to dark shriveled berries; Esca causes leaf scorch and black streaks in wood |
| Mango | Powdery Mildew, Gall Midge, Anthracnose, Healthy | Powdery mildew caused by Oidium mangiferae produces white powdery growth; gall midge damages flowers; anthracnose (Colletotrichum gloeosporioides) causes black lesions |
Table 2.
Vegetable crops and diseases.
| Vegetable Crop | Diseases considered | Description |
|---|---|---|
| Cauliflower | Bacterial Spot Rot, Black Rot, Downy Mildew, Healthy | Bacterial spot rot causes water-soaked lesions; black rot (Xanthomonas campestris) leads to V-shaped chlorosis; downy mildew causes yellowing and fuzzy mold |
| Tomato | Bacterial Spot, Early Blight, Spider Mites, Healthy | Bacterial spot affects leaves and fruit; early blight (Alternaria solani) causes concentric leaf spots; spider mites suck sap, causing yellowing |
| Potato | Early Blight, Late Blight, Healthy | Early blight caused by Alternaria solani forms brown spots; late blight (Phytophthora infestans) causes water-soaked lesions and rapid decay |
| Corn (Maize) | Northern Leaf Blight, Leaf Spot, Common Rust, Healthy | Northern leaf blight (Exserohilum turcicum) forms long lesions; leaf spot results in brown spots; common rust (Puccinia sorghi) causes rust pustules on leaves |
Literature review
Plant disease detection has been a subject of extensive research for decades, evolving from traditional visual inspections and laboratory-based methods to advanced deep learning techniques that enable automated, scalable, and real-time diagnosis. Table 3 shows the research details i.e. year, model used, dataset, accuracy and limitations of different researchers across the world.
Table 3.
Machine learning and deep learning related works.
| References | Year / Model(s) & Feature(s) | Dataset | Accuracy | Limitations |
|---|---|---|---|---|
| 1 | 2024 – CNN-based plant disease recognition with dataset analysis | PlantVillage + supplementary datasets | ~ 95–98% | Dominated by lab-controlled images; limited field generalization analysis |
| 2 | 2016 – Early CNN adoption for plant disease identification | PlantVillage | ~ 99% (controlled conditions) | Lack of real-world field images; background bias |
| 3 | 2023 – Deep CNNs with robustness analysis | Mixed public datasets | ~ 93–96% | Performance drop under field conditions; limited cross-dataset testing |
| 4 | 2019 – CNN-based classification with handcrafted preprocessing | PlantVillage | ~ 96–98% | Relies on curated images; weak scalability across crops |
| 5 | 2025 – Advanced deep learning architectures for plant pathology | Large multi-crop datasets | > 97% | Computationally intensive; limited mobile deployment feasibility |
| 6 | 2020 – Super-resolution (GAN-based) for plant disease images | PlantVillage (low-res variants) | Accuracy improvement reported | No ablation against simple upsampling; added computational overhead |
| 7 | 2023 – Transfer learning with EfficientNet variants | Mixed datasets | ~ 95–97% | Domain shift not fully addressed; no field-only evaluation |
| 8 | 2025 – Modified MobileNetV3 (lightweight CNN) | PlantVillage | ~ 98% | Evaluation limited to curated datasets |
| 9 | 2024 – CNN-based banana disease detection system | Banana disease dataset | ~ 97% | Single-crop focus; lacks cross-crop generalization |
| 10 | 2024 – AI-based agricultural decision-support systems | Various public datasets | Not explicitly stated | More system-oriented; limited quantitative evaluation |
| 11 | 2018 – Deep CNNs (AlexNet, VGG, GoogleNet) | PlantVillage | Up to 99.5% | Strong dataset bias; no real-world testing |
| 12 | 2018 – Dataset size & diversity impact study | PlantVillage + subsets | Accuracy varies (85–99%) | Demonstrates overfitting on homogeneous datasets |
| 13 | 2018 – CNN-based crop disease detection | Small curated dataset | ~ 94–96% | Limited dataset size; no robustness evaluation |
| 14 | 2023 – Deep CNN-based disease classification | Public datasets | ~ 96–98% | No explainability or failure analysis |
| 16 | 2025 – Comparative study (MobileNet, ResNet50, InceptionV3) | PlantVillage | MobileNet ~ 96–97% | No field-level validation; inference trade-offs not deeply analyzed |
Traditional methods of disease detection
Traditional plant disease detection methods are usually based on visual inspection by agricultural experts, farmers, or extension workers, along with laboratory-based diagnostic techniques such as microscopy, culturing, and biochemical assays. Although these methods can be precise, they are slow, require a lot of effort, and very much dependent on expert availability and subjective interpretation2,11. Frequently, the initial symptoms of many plant diseases are quite subtle and easily confused visually among different pathogens, so manual diagnosis is error-prone, particularly in field conditions with varying illumination and background noise13.
Later, to automate disease detection, rule-based image processing techniques using handcrafted features such as color, texture, and shape descriptors were introduced4. These methods often consist of segmentation, feature extraction, and classical classifiers like Support Vector Machines or k-Nearest Neighbors. Nevertheless, handcrafted feature-based methods are not robust and do not generalize well because their success depends heavily on changes in image quality, lighting, leaf orientation, and disease severity12. That is why traditional methods have difficulty scaling up successfully for various crops and disease categories and, therefore, are not very useful in real agricultural settings.
Deep learning in plant pathology
Among different computational techniques, deep learning, especially Convolutional Neural Networks (CNNs), has revolutionized plant disease detection by facilitating automatic feature extraction from images. Ferentinos11 showed deep CNN’s power in identifying plant diseases, obtaining very high accuracies on several crop classes using massive image datasets. Later research showed deep learning models’ superiority over conventional machine learning methods, especially with a large enough set of labeled examples12.
One major strategy in plant pathology has been transfer learning due to the scarcity of large, well-labeled agricultural datasets. ResNet, Inception, EfficientNet, and MobileNet represent pre-trained models that have extensively been utilized in crop disease detection works4,14. Among them, MobileNet variants have attracted interest in mobile and edge device implementation because of their less demanding computational and memory resources8,16. Also, recent publications have proposed further changes and fine-tuning of these architectures to enhance the accuracy without losing the efficiency8.
Huge datasets like PlantVillage have enabled fast advancements in model building; however, it was demonstrated that models trained on such highly controlled datasets show a drop in performance when tested in real-field scenarios12,15. The newest articles leave no doubt that there is a great necessity for more diversified datasets and domain adaptation techniques to increase the models’ generalization power3,7.
Comparative studies on crop disease detection systems
Many researchers have done experiments comparing the different CNN architectures for identifying crop diseases. For instance, Jevoor16 explored the differences between MobileNet, ResNet50, and InceptionV3, giving insight on the trade-offs between the accuracy and computational efficiency. Kaliappan and Rafi14 on the other hand showed that, while deeper architectures can produce slightly higher accuracy, they also require more time for inference and use up more resources.
There has been a notable shift in the focus of research from single-crop to multi-crop scenarios in disease detection using deep learning frameworks. Singh et al.9 introduced a banana disease classification system using deep learning and showed how crucial it is to have crop-specific models. On the contrary, the majority of existing works are targeting a small number of crops or diseases which in turn limits their scalability. Some of the latest works, on the other hand, are making an effort to bring together multiple crops and datasets into one framework, however, the problem of cross-dataset generalization is still open5,7.
Several papers that compare different methods, usually report very high accuracy figures, often over 95%, on well-curated datasets, but these figures cannot be trusted to represent the accuracy level in the field where the conditions are not so ideal3,16. Therefore, there is a clear need for standardized evaluation methods that would allow us to differentiate between images taken under the lab conditions and those taken in the field.
Limitations in existing solutions
Considerable advances notwithstanding, plant disease detection methods that exist still have numerous shortcomings, few of which are significant. At the outset, majority of studies rely extensively on PlantVillage1,12 -- a dataset that is artificially constructed and hence lacks background complexity and environmental variability, leading to models that show unrealistically high performance. Next, it has been noted that studies conducting cross-dataset testing for generalizability issues are very sparce5.
Third, image enhancement procedures like super-resolution, for instance, although ventured6, the resultant increment in classification performance is, however, rarely proven quantitatively through ablation studies. Likewise, no in-depth analysis of the aspects of the explanation technique such as both the correct and incorrect use of the Grad-CAM method3 has been given.
Lastly, implementation of recommendation systems or language models into present systems of this kind usually comes with the avowal that the model structure, information on issuing queries as well as experts’ acknowledgements are not known10. These issues pinpoint the need for AI systems designed and tested in such a way that they improve, are interpretable, are efficient in computation, and still feasible in practice—the latter being the primary emphasis of the undertaken experiments and the theoretical narratives of this work.
Methodology
The system proposed for detecting crop disease includes a sequence of steps beginning from data collection and preprocessing, followed by model selection and training, testing, and finally deployment through a web application. A structured method was followed to ensure robustness, scalability, and practicality. The method is described in the subsequent subsections.
Data collection and pre-processing
The dataset was gathered from public databases such as mainly PlantVillage, Kaggle, and Mendeley, etc. The dataset includes images of healthy and diseased leaves of crops, which are different fruits and vegetables. Variability in crop types, disease types, and imaging conditions (background, lighting, resolution) makes the dataset generalizable to real-world scenarios.
The dataset consisted of 69061 images and was split into training (80%), and validation (20%) splits for proper evaluation. Stratified sampling was used to preserve class balance between splits. The table 4 shows the dataset composition. The table 5 shows the fruit crops sample images and the table 6 shows the vegetable crops sample images.
Table 4.
Training and validation dataset distribution.
| Crop | Training images | Validation images | Total images |
|---|---|---|---|
| Apple | 7,771 | 1,943 | 9,714 |
| Banana | 6,964 | 1,957 | 8,921 |
| Grape | 7,222 | 1,805 | 9,027 |
| Mango | 6,000 | 2,000 | 8,000 |
| Cauliflower | 7,360 | 656 | 8,016 |
| Tomato | 7,289 | 1,821 | 9,110 |
| Potato | 5,702 | 1,426 | 7,128 |
| Corn | 7,316 | 1,829 | 9,145 |
| Overall | 55,624 | 13,437 | 69,061 |
Table 5.
Fruit crops sample images.
Table 6.
Vegetable crops sample images.
Data Preprocessing is an essential step to enhance the quality of input data and improve the performance of deep learning models. The following steps were performed:
-
i.
Image Resizing: Input images were resized to fixed dimensions suitable for the chosen models. This includes resizing the images into 224 × 224 pixels for MobileNetV3 and ResNet50, and 380 × 380 pixels for EfficientNetB4.
-
ii.Normalization: The pixel intensity values ranging from 0–255 were normalized to [0, 1] to stabilize and accelerate the training process. The normalized values are represented as x’ and can be given as the formula:Data Augmentation: To minimize overfitting and improve generalization, augmentation techniques such as random rotations, horizontal and vertical flipping, random zooming, brightness/contrast adjustments, and Gaussian noise injection were applied.

1 -
iv.
Label Encoding: The disease categories were encoded using one-hot encoding. For C classes, a label y was represented as a binary vector of size C, where the correct class index was marked as 1 and the others as 0.
Model selection
In this research, the objective of choosing a model was to find a trade-off between precision, computational efficiency, and generalization. For the purpose of image enhancement, the Real ESRGAN model was chosen and for the purpose of disease detection, three cutting-edge convolutional neural network (CNN) architectures were contemplated: MobileNetV3, EfficientNetB4, and ResNet50. Each model comes with different pluses in the architecture and feature representation capability. GradCAM will be associated with the selected model
Real ESRGAN
Real-ESRGAN (Enhanced Super-Resolution Generative Adversarial Network) is an intelligent deep learning framework that strives to magnify resolutions and upgrade the qualitative aspects of visually pleasant images thoroughly. A deliberately improved version of ESRGAN, it generalizes to real-world scenarios and hence specifically deals with photo-noisy, packed, and marred images instead of clean-synthetically degraded ones.
The Table 7 shows the comparison of the Real-ESRGAN with the Bicubic up-sampling method.
Table 7.
Ablation Study on the Effect of Super-Resolution Preprocessing for Low-Resolution Images.
| Input type | Up-sampling method | Validation performance |
|---|---|---|
| Low-res images | Bicubic | Baseline |
| Low-res images | Real-ESRGAN | + 1.2–1.5% improvement |
The primary purpose of Real-ESRGAN is to generate perceptually plausible high-resolution images from noisy or degraded sources. As opposed to traditional super-resolution techniques which abide by theoretically perfect degradation standards (e.g., bicubic down-sampling), Real-ESRGAN absorbs the real-world challenge where degradations (such as blur, noise, compression artifacts, and lighting variations) co-exist and thus it is perfect for the farm where one can use it for disease detection from low-quality or mobile-captured leaf images. Although computationally expensive, Real-ESRGAN is only triggered for images below a resolution threshold (Table 8).
Table 8.
Comparative analysis of the selected models.
| Model | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Inference time (s/image) |
|---|---|---|---|---|---|
| MobileNetV3 | 98.4 | 96.8 | 97.2 | 97.0 | 0.45 |
| EfficientNetB4 | 96.9 | 97.4 | 96.2 | 96.8 | 0.82 |
| ResNet50 | 95.6 | 95.2 | 94.9 | 95.0 | 0.74 |
Real-ESRGAN evolves from the ESRGAN framework which merges:
-
i.
Generator network (RRDBNet): The generator becomes extremely deep due to the Residual-in-Residual Dense Blocks (RRDB) that thoroughly exploit feature extraction and guaranteeing training is stable even without using batch normalization. The generator convincingly accounts for both low- and high-frequency image details.
-
ii.
Discriminator network: A U-Net–based discriminator is there to single out original and fake images by thus upgrading texture realism.
-
iii.
Perceptual and adversarial losses: Real-ESRGAN employs the best practice of combining pixel-wise, perceptual (VGG-based), and adversarial losses to keep both image clarity and its natural look intact.
Although Real-ESRGAN is incorporated to enhance low-resolution user-captured images, it may introduce artificial textures or visual artifacts that do not correspond to actual disease patterns. Additionally, the super-resolution step increases computational overhead and inference latency, particularly in web-based or resource-constrained environments. While ablation results indicate modest accuracy improvements on degraded inputs, this component is not strictly necessary for all cases. Future work will focus on optimizing this stage, selectively enabling it based on image quality, or replacing it with lighter-weight preprocessing techniques to improve efficiency and robustness.
MobileNetV3
MobileNetV3 is a compact and efficient CNN model that is specifically designed for mobile and edge devices with limited computational capacity. It was created through Neural Architecture Search (NAS) coupled with the NetAdapt algorithm, which is a process of automated search for mobile CPUs latency and accuracy trade-offs done by the algorithm.
It is available in two primary versions: MobileNetV3-Large, which is designed for better accuracy, and MobileNetV3-Small, which is targeted at devices with lower latency and power limitations.
The model is composed of lightweight components like SE modules and h-swish, thus enabling it to operate at 3× the speed of MobileNetV2 while delivering comparable accuracy results on ImageNet benchmark. This is one of the most popular models for real-time vision tasks (e.g., object detection, image classification, segmentation) on mobile and embedded devices. Grad-CAM was applied to the final convolutional layer of the trained MobileNetV3 model to generate class-discriminative localization maps for interpretability analysis
It is a hybrid of two earlier works:
-
i.
Depth-wise separable convolutions – They break a regular convolution into a depth-wise convolution (spatial filtering per channel) and a pointwise convolution (1 × 1 convolution across channels). This decreases the computational cost from
to
, where k is the kernel size, M is the input channels, and N is the output channels. -
ii.Inverted residuals with linear bottlenecks (MobileNetV2 blocks) – The architecture first increases the number of channels, implements depth-wise convolution, and then returns to the lower-dimensional space instead of reducing channels at the beginning of the block. It is represented as:
where W1 is the expansion layer, W2 is the projection layer, and f is the non-linear activation.
2 -
iii.Squeeze-and-excitation (SE) blocks – SE blocks rescale feature maps by learning a channel-wise attention vector. Suppose a feature map
, the block computes channel weights s as:
Here z is the global average pooled vector, δ is ReLU, and σ is sigmoid. The newly re-weighted feature map is
3
. -
iv.Hard-Swish activation – Utilizes an energy saving version of Swish that approximates the original function more closely:

4
MobileNetV3 reaches a good balance between speed and precision, which suits very well for deployment in rural web/mobile applications where the devices may not have powerful GPUs.
Below is the diagram of the detailed architecture of the MobileNetV3 model.
EfficientNetB4
EfficientNet is the series of models that consistently scale up depth, width, and resolution in a harmonious manner. Such models are the best since they are not over-reliant on just one parameter. The early attempts, however, were able to scale only a single dimension (e.g., deeper or wider networks), which often resulted in less and less improvement. Some of the important features includes:
-
i.It introduces Compound Scaling:
subject to the constraint
where ϕ is a user-chosen coefficient controlling scaling. For EfficientNetB4, ϕ=4. -
ii.Building blocks:
- MBConv (Mobile Inverted Bottleneck Convolution): Like MobileNetV2, these blocks take advantages of channel expansion, depthwise convolution, and then project back.
- Squeeze-and-excitation modules: Boost channel attention and energize a more precise feature extraction.
- Swish activation function:

5 -
iii.
Resolution advantage: EfficientNetB4 runs at a higher input resolution of 380 × 380, which allows the model to perceive subtle vein textures, lesion shapes, and color changes in diseased leaves. This very detailed recognition power is particularly useful for visually similar plant diseases.
-
iv.
Suitability: Even though it is computationally more intensive than MobileNetV3, EfficientNetB4 offers a higher accuracy rate and is very good at capturing the fine details of leaf disease symptoms.
ResNet50
ResNet50 (Residual Network, 50 layers) is a CNN which has become famous for its residual connections that allowed it to get rid of the problem of vanishing gradients in deep networks.
The primary or core component is the Residual Block:
![]() |
6 |
Here, x represents the input, F (x, {Wi}) is the residual mapping (a series of convolution, batch normalization, and activation), and the addition illustrates a shortcut connection. If the dimensions are not the same, then instead of x, a linear projection Wsx is also added.
This identity mapping is the reason why gradients can flow directly through the skip paths; thus, it is possible to train very deep networks effectively.
The ResNet50 is made of:
-
i.
Conv1 Layer: 7 × 7 convolution, 64 filters, stride 2.
-
ii.
Conv2_x – Conv5_x Blocks: Stacked bottleneck residual blocks with 1 × 1, 3 × 3, and 1 × 1 convolutions.
-
iii.
Global Average Pooling: It mainly serves to reduce the spatial dimensions of the feature maps before the fully connected classifier.
ResNet50 is a network which is known for the robustness of its feature extraction across different domains. It is shown in plant disease detection, that it captures hierarchical features such as low-level (edges, colors, textures), mid-level (spots, lesions, discoloration), high-level (disease-specific structural patterns).
Even though it is heavier than MobileNetV3, it is still that balance between accuracy and computational cost that it can hold compared to EfficientNetB4.
Model training and evaluation
The models were initially trained on the ImageNet and then fine-tuned using transfer learning where the pre-trained weights were changed to the plant disease dataset. The training process was as follows:
-
i.
Optimizer": Adaptive Moment Estimation (Adam) with learning rate
. -
ii.
Batch Size: 32 for MobileNetV3 and ResNet50; 16 for EfficientNetB4 due to higher input resolution.
-
iii.
Epochs: 50 with early stopping based on validation performance to avoid overfitting and fine—tuning.
-
iv.
Loss function: Categorical Cross-Entropy, defined as:
where yi is the true label and yi’ is the predicted probability for class i.
![]() |
7 |
The models’ performance was checked with the following metrics:
-
i.Accuracy: Accuracy measures the overall correctness of the model by calculating the proportion of correctly predicted samples to the total number of samples. It is defined as:
where TP = true positives, TN = true negatives, FP = false positives, and FN = false negatives. A higher accuracy indicates that the model performs well in both positive and negative classifications, though it may be misleading for imbalanced datasets.
8 -
ii.Precision: Precision, also known as the positive predictive value, evaluates how many of the predicted positive cases are actually positive. It is defined as:
High precision means that the model produces fewer false positives and is reliable when predicting a disease.
9 -
iii.Recall: Recall, also referred to as sensitivity or true positive rate, measures the ability of the model to correctly identify actual positive cases. It is defined as:
A high recall indicates that the model successfully captures most of the diseased samples, which is crucial in agricultural disease detection to minimize the risk of leaving infections undetected.
10 -
iv.F1 – Score: The F1-score is the harmonic mean of the precision and recall, providing a balanced measure between them. It is defined as:
An F1-Score close to 1 reflects both high precision and high recall, indicating robust classification performance.
11 -
v.
Confusion matrix: The confusion matrix provides a class-wise visualization of correct and incorrect predictions, highlighting misclassifications.
Web application development
A web-based application was created to be the main interface between end-users (farmers and agricultural researchers) and the AI-powered disease detection system. The application combines frontend and backend parts into one framework, thus providing smooth interaction, efficient model inference, and a user-friendly experience even in areas with low connectivity.
Frontend development
The web application’s frontend was built using HTML, CSS and JS to provide a responsive, user-friendly, and device-independent interface. The layout followed mobile-first principles, as most of the end users, especially farmers, are likely to use the system through their smartphones. User interactions were implemented through React hooks and state management, which allow easy transitions between different features such as image upload, model inference, and results display. Moreover, the UI has localization and multilingual support features, thus users can set their preferred language (e.g. Hindi, English, or regional dialects).
Considerable effort was made to ensure accessibility: attractive visual aids with very few words are provided for semi-literate users, while the design follows WCAG (Web Content Accessibility Guidelines) standards. Thus, the device remains an inclusive tool and can be used by many people of both digital and non-digital literacy.
Backend development
The backend was built with the Flask framework in Python and thus it delivered the essential features needed for the interactions between the AI inference engine and the web interface. The models that were trained have been saved in the required formats, both of which are optimized for a quick and easy inference. These formats allow the predictions to be made by the server in a very efficient way without the need of a full training environment.
Besides that, backend is also in charge of the pipeline of preprocessing, which includes normalization of image, resizing, and noise filtering, after which the picture is forwarded to the chosen model (MobileNetV3). The model at the end of the processing returns the predicted disease class, the confidence score, and some other metadata to the frontend for graphic presentation.
In addition to that, the system has FAST API endpoints that could be used later on to connect apps on mobile with IoT-based crop monitoring systems.
Database management
The system employs Firebase Realtime Database and Firebase Cloud Storage to ensure efficient, scalable, and secure data management. Firebase was chosen due to its seamless integration with web applications, real-time synchronization capabilities, and offline data persistence, making it ideal for use in rural and low-connectivity regions.
Firebase Realtime Database is used to store structured data such as user details, prediction history, disease information, and feedback. Each prediction event is logged with metadata including the timestamp, model used, predicted disease label, and confidence score. The database also maintains disease-specific metadata, such as recommended treatments, organic control measures, and preventive practices. This enables the system to generate context-aware and personalized recommendations dynamically for each farmer.
For unstructured data such as uploaded crop leaf images, the system utilizes Firebase Cloud Storage, which allows secure storage and retrieval of high-resolution images. Each stored image is linked to its metadata entry in the Realtime Database through a unique identifier, ensuring data consistency across both storage layers.
To enhance performance, Firebase’s built-in indexing and query optimization mechanisms are leveraged, reducing data retrieval latency and ensuring near real-time updates across devices. The use of Firebase Authentication secures user access, ensuring that only verified users (farmers, researchers, and administrators) can perform operations such as uploading images or retrieving historical results.
Core functional features
The web platform hosts a number of important user-friendly and reliable features modules:
-
i.
Image upload & preprocessing – People can upload images of leaves taken via camera or from the gallery. The backend removes the need for the user to do any preprocessing of these photos as it does it automatically to fit the model’s input dimensions.
-
ii.
AI-based disease detection – One of the CNN models that have been trained is used to analyze the image that is sent. After that, the system prints out the disease name, the score of the probability, and the visual confidence indicator.
-
iii.
Multilingual support – Both the interface and the output messages being in several Indian languages make it possible for everyone to be included, especially people from the rural communities with spoken language.
-
iv.
Treatment & prevention guidance – The platform, upon diagnosis, gives detailed suggestions, including organic, chemical, and cultural control methods.
-
v.
Low connectivity functionality (PWA) – With the help of Progressive Web Application (PWA) features, the users get the freedom to use the platform without the need for a stable connection to the internet, as they can access already loaded data and cached disease information.
-
vi.
Feedback module – Users are allowed to give comments on either model predictions or treatment suggestions. This, in turn, will help to continuously refine the model and improve the system.
Cure recommendation using LLM
To complement the visual disease classification pipeline, the proposed system integrates a large language model (LLM) for generating text-based disease management and treatment recommendations. The LLM utilized in this study is LLaMA 3.1 (8B-Instant), which is accessible through the Groq API, allowing low-latency inference that is suitable for real-time web-based applications.
The LLM does not contribute to the diagnosis of diseases or the interpretation of images. Rather, it is a post-classification decision-support element. After the CNN model determines the crop type and disease class, the corresponding label is sent to the LLM along with structured disease metadata, such as the disease name, crop type, and predefined agronomic context. This layout guarantees that the LLM only works within a limited scope and is not allowed to affect the core classification results.
Instead of being deployed locally, the LLM is used via an external API (Groq). No model fine-tuning takes place as the LLM works in a zero-shot prompting setting. A fixed and reproducible prompt template is employed to produce recommendations that concentrate on symptoms, preventive measures, and frequently recommended treatments. An example of the prompt structure is given below:
“Given the crop type: <Crop>, and the detected disease: <Disease>, provide general information on symptoms, preventive practices, and commonly used treatment measures. Do not provide dosage-specific or expert-level prescriptions.”
For the purpose of consistency and traceability, all prompts and outputs are recorded. The suggestions are given purely as information, and they are deliberately complemented with disclaimers that advise users to get in touch with agricultural experts for advice before using any treatment.
This modular approach makes it possible for the recommendation part to be updated or changed without having to relearn the classification model. On the other hand, the outputs of the LLM have not been validated by agricultural experts, and no quantitative evaluation of the quality of the recommendation is made in this paper. Upcoming works will deal with validation by an expert-in-the-loop, multilingual prompt optimization, and the incorporation of region-specific agronomic knowledge (Figs. 1,2,3,4,5).
Fig. 1.
Real ESRGAN model architecture.
Fig. 2.

MobileNetV3 architecture.
Fig. 3.
EfficientNetB4 large architecture.
Fig. 4.
ResNet50 architecture.
Fig. 5.
System workflow.
System workflow
Below is the detailed flowchart depicting the System Workflow in detail:
Results and discussion
Model performance overview
Three convolutional neural network architectures i.e. MobileNetV3, EfficientNetB4, and ResNet50 were compared in terms of their performance on the prepared crop disease dataset. To be fair, each model was trained with the same hyperparameters, image preprocessing pipeline, and augmentation techniques.
MobileNetV3 was the one that showed the most balanced performance in terms of accuracy, computational efficiency, and generalization to unseen data among the three. EfficientNetB4, although it scored slightly better precision in some classes, needed more computational resources, and ResNet50, while it was stable, gave slower inference times, though it was a bit of a disadvantage.
A summary of the comparative performance is presented in table 6, highlighting each model’s accuracy, precision, recall, and F1-score.
From this comparison, MobileNetV3 was selected for deployment in the web application due to its lightweight structure, faster inference, and high overall accuracy, making it suitable for low-power devices used by farmers.
One experiment on cross-dataset generalization involved training the model only with PlantVillage images and then testing it on the combined Kaggle Mendeley dataset that represents a semi-field like evaluation using publicly available datasets (Kaggle and Mendeley) that include more diverse backgrounds and imaging conditions compared to controlled datasets like PlantVillage. Table 9 illustrates the model misclassifying around 1.5 - 2 % more samples when an external dataset was used for evaluation. Such a drop in performance reveals that there is a domain difference which is account for the changes in the complexity of the background, photos taken under different lighting conditions, and settings used during image acquisition. These findings suggest that achieving high accuracy on well-prepared datasets does not guarantee the same level of performance in the actual world. Also, the results underline the necessity for more diverse training data and effective use of domain adaptation techniques in the future.
Table 9.
Cross-dataset generalization performance.
| Training dataset | Testing dataset | Accuracy (%) | Performance drop (%) |
|---|---|---|---|
| PlantVillage | PlantVillage (Validation) | 98.4 | — |
| PlantVillage | Kaggle + Mendeley (Field-style) | 96.4—96.9 | 1.5—2% |
MobileNetV3 model evaluation
The accuracy and loss curves for training and validation (refer to Figure 6) confirm that the MobileNetV3 model was a steady convergence case without any indication of overfitting. The last validation accuracy was 98.4%, which is a clear proof of the model’s effective learning and generalization abilities.
Fig. 6.
Model’s accuracy and loss graph.
The confidence intervals reported in Table 10 correspond to the mean predicted class probability (confidence score) of the model on the validation dataset, rather than classification accuracy. These intervals were estimated based on the distribution of predicted probabilities across the validation dataset.
Table 10.
Confidence intervals of prediction confidence scores (MobileNetV3).
| Model | Confidence interval |
|---|---|
| MobileNetV3 with Real ESRGAN | 0.85—0.88 |
| MobileNetV3 without Real ESGAN | 0.71 – 0.74 |
It is important to note that these values do not directly correspond to the overall classification accuracy (98.4%), but instead reflect the model’s confidence distribution across predictions. The relatively lower interval range indicates variability in prediction certainty, particularly for challenging or ambiguous samples.
To make it easier to understand, Gradient-weighted Class Activation Mapping (Grad-CAM) was used to highlight the areas in the images that influence the MobileNetV3 decisions most. Starting with the final convolutional layer, heatmaps were produced to show the discriminative features that the model utilized most.
Figure 7 depicts the peaks of Grad-CAM which mostly coincide with the diseased parts of the leaves such as those with lesions or discoloration, thereby showing the model’s dependence on the relevant pathological features. In the case of Banana and Tomato disease images, the activation maps are in perfect harmony with the visibly infected regions, thus feature localization is confirmed to be quite effective. However, for diseases such as Apple scab which have symptoms spread in a less obvious way, the focus is often on the larger parts of the leaf, so in such situations there might only be a slight dependence on the overall texture or shape. This attitude can be explained by the fact that most of the training data are lab-controlled images of single leaves with fairly uniform backgrounds. Some of the mistakes in diagnoses can be traced to instances when the regions activated by the network include the ones that have nothing to do with the disease which is likely owing to visually similar disease patterns.
Fig. 7.

Model’s output using gradCAM.
Therefore, in general, Grad-CAM is in support of disease-specific learning but at the same time, it uncovers the deficiencies of the system in localization and generalization.
The confusion matrix (Figure 8) is the instrument that shows how the model reached a high level of accuracy for each class, with just a few instances of the misclassification of diseases that look similar to each other (e.g., Early Blight vs. Late Blight). Such outcomes attest to the solidity of the model and its readiness for the detection of diseases in the real world.
Fig. 8.
Confusion matrix.
Validation accuracy in general gives a preliminary impression of the model’s performance but the model’s ability to withstand real-world conditions is not completely captured. To study how the settings for capturing images affect the model, the dataset was separated into images taken in a controlled lab environment with uniform backgrounds and field-style images derived from public datasets which had complex backgrounds, different lighting, and noise. The comparison of the model’s performance on these two sets is shown in Table 11 to evaluate the model’s sensitivity to the domain and its ability to generalize to real-world conditions.
Table 11.
Performance comparison on lab-controlled and field images.
| Dataset type | Accuracy (%) |
|---|---|
| Lab / Controlled | 98.4% |
| Field / Noisy | 89.2% |
Web application results
The web-based interface now incorporates a trained MobileNetV3 model, which means a user can upload a picture of a cropped leaf, the system detects the disease, and then it shows the treatment recommendations in any language the user wants. Screenshots of the interface (Figure 9) reveal the user-friendly layout that comprises modules for uploading an image, displaying the results, and supporting the recommendations in several languages.
Fig. 9.
The home page of website.
Moreover, the website implements Real-ESRGAN technology for image quality upgrading to a diagnostic accuracy level of a case where the input is blurred or has a low resolution. In such instances, the picture is first enhanced, then passed to the disease detection model, and the results along with confidence scores and the corresponding treatment options generated by the LLM module are shown to the user.
Discussion
The findings confirm that a small CNN model like MobileNetV3 is capable of producing results that are close to a deep model such as EfficientNetB4 and ResNet50, while still being able to perform the inference faster and with less hardware. The integration of Real-ESRGAN and LLM modules also contributes to the performance guarantee that farmers will get the correct and helpful insights even if the field is a difficult one. However, the observed improvement of approximately 1.2–1.5% on degraded inputs is relatively modest, and the benefit of incorporating super-resolution is context-dependent, particularly when considering the additional computational overhead. In scenarios with adequate image quality, this step may be unnecessary.
Next research may include broadening the dataset with more crop varieties, locally training the LLM with domain-specific data, and allowing on-device inference with TensorFlow Lite for complete offline access
Limitations and challenges
Even though the results of the developed crop disease detection system are very promising, the system is still limited and challenged in some aspects that have the potential to affect its extension and stability in an actual environment. A major obstacle with the system is that it depends on the quality of the image, as the diagnosis of the disease by the system is the most accurate when the leaf images are clear and correct. To a great extent, the implementation of the Real-ESRGAN model makes the low-resolution and blurry images clear; however, it is still possible that extremely poor-quality inputs, e.g., improperly lit ones in which the leaf occupies only part of the image or the background is cluttered, cause wrong classification.
Also, the issue of dataset diversity is raised, as the model’s performance is largely absorbed from the representation of the training data. The shortage of the variation of crop types and the disease stages, as well as weather conditions, may cause the model to inadequately reflect the real-world and thus it cannot be used to solve generalized problems effectively for real-world images.
Technically speaking, the same issues of a computable and limited time to make a decision also apply here and pose additional challenges. It is a resource-consuming task to carry out the combined inference of deep learning models and image enhancement processes thus the response time may be longer on low-end devices or when the signal is weak. Moreover, besides having the ability to generalize, CNN models might change when they are used for images of fields that are taken in different weather and lighting conditions. Therefore, regular retraining and fine-tuning with the use of real-life data will be required.
Besides these issues, the authors were also concerned about language and regional adaptation. The difficulty of conveying the trades and treatment steps of agriculture in various local dialects without losing accuracy is still a great challenge. Likewise, while there are some issues related to data privacy and connectivity, the system needs stable internet access for Firebase synchronization and cloud-based inference. Even though progressive web app (PWA) caching allows for partial offline functionality, features such as model updates and LLM-based recommendations may still not be accessible in areas with poor connectivity. Finally, although the LLM-generated recommendations may sometimes be general or incomplete, they are still helpful and aware of the context. It will be very important for expert validation and prompt optimization to be continuously carried out so that the agricultural decision support will be reliable and precise.
Conclusion and future scope
The AI-based Crop Disease Detection System, as suggested, is an excellent example of how deep learning and generative enhancement models could change the agricultural sector entirely. The system, by employing Real-ESRGAN for photo enhancement, CNN structures for disease classification, and an LLM-based recommendation engine for treatment giving, becomes an intelligent, user-friendly, and time-saving tool for the earliest diagnosis of plant diseases.
Furthermore, the establishment of a web-based interface allows farmers with the least technical knowledge to upload their pictures effortlessly, get quick disease predictions, and receive treatment guidance relevant to their location. Firebase’s inclusion for data handling is also a great move towards enhancing scalability, real-time synchronization, and overall user experience. In essence, the system elevates productivity, lowers the chances of crop losses, and facilitates the implementation of environmentally friendly agricultural practices through precise detection and judicious pesticide application.
However, the system is still grappling with problems such as fluctuations in image quality, limited datasets, and the accuracy of language translation, which point to the need for further enhancements. In any case, the project paves the way for a significant shift towards digital technology in the field of precision farming.
A number of enhancements can be introduced to the proposed system in the upcoming versions. The use of IoT sensors and drone-based imaging will facilitate on-demand monitoring and a comprehensive health check of the crops. Increasing dataset and model variety with more field images and crop types will lead to higher accuracy and better model robustness. Using offline inference by means of Edge AI (TensorFlow Lite or PyTorch Mobile) can guarantee service in areas with weak network while a continuous learning pipeline will make the model capable of adapting and upgrading with new data provided by farmers.
Moreover, upgrading multilingual and voice-based interaction features will be helpful in making the technology accessible to the users living in remote areas. Training the LLM with domain-specific agricultural data will help in making treatment suggestions more precise and becoming a local expert. To sum up, partnership with government and NGO platforms can facilitate the extension of disease surveillance and the use of practices that are beneficial for the environment in agriculture.
Author contributions
Anubhava Srivastava: Supervision; Validation; Writing–Original Draft; Conceptualization. Amit Bhola: Conceptualization; Methodology; Data Curation; Writing–Original Draft. Jaroslav Frnda: Visualization; Formal Analysis; Data Processing; Writing–Review & Editing; Project Administration. Jan Rozhon: Software; Experimental Setup; Data Processing. Pallav Prakash: Resources; Investigation. Shashank Singh: Data Curation; Writing–Review & Editing. Vishakha Chauhan: Visualization; Validation. All authors have read and approved the final version of this manuscript.
Funding
This work was supported by the EU Next Generation EU through the Recovery and Resilience Plan for Slovakia under Grant 09I05-03-V02-00013.
Data availability
The data that support the findings of this study are available from Anubhava Srivastava upon reasonable request.
Declarations
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Shafik, W., Tufail, A. & De Silva Liyanage, C. Using transfer learning-based plant disease classification and detection for sustainable agriculture. BMC Plant Biol.24, 136. 10.1186/s12870-024-04825-y (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Mohanty, S. P., Hughes, D. P. & Salathé, M. Using deep learning for image-based plant disease detection. Front. Plant Sci.10.3389/fpls.2016.01419 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Shoaib, M. et al. An advanced deep learning models-based plant disease detection: A review of recent research. Front. Plant Sci.10.3389/fpls.2023.1158933 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Saleem, M. H., Potgieter, J. & Arif, K. M. Plant disease detection and classification by deep learning.. Plants10.3390/plants8110468 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Nnamdi, U. V. & Abolghasemi, V. Optimised MobileNet for very lightweight and accurate plant leaf disease detection. Sci. Rep.10.1038/s41598-025-27393-z (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Sagar, A. & Jacob, D. On using transfer learning for plant disease detection. Cold Spring Harb. Lab.10.1101/2020.05.22.110957 (2020). [Google Scholar]
- 7.Bi, C. et al. Identification method of corn leaf disease based on improved Mobilenetv3 model. Agronomy13(2), 300. 10.3390/agronomy13020300 (2023). [Google Scholar]
- 8.Khomkham, B. & Pankaseam, Y. Lightweight convolutional neural network model based on modified MobileNetV3 for plant disease classification. SN Comput. Sci.10.1007/s42979-025-04607-9 (2025). [Google Scholar]
- 9.S. Singh, P. Prakash, G. Baghel, A. Singh, D. Raj and A. K. Agrawal, Banana Crop Health: A Deep Learning-Based Model for Disease Detection and Classification, 27th International Symposium on Wireless Personal Multimedia Communications (WPMC), Greater Noida, India, pp. 1–6, 10.1109/WPMC63271.2024.10863138. (2024).
- 10.Saha, B., Keerthi, M. M., Rajasekar, G., Motghare, M., Upadhyay, N., & Prakash, P. Tomatoes Disease Detection Using Machine Learning Algorithms. In Lecture Notes in Networks and Systems (pp. 50–62). Springer Nature Switzerland. 10.1007/978-3-032-08253-4_6, (2026).
- 11.Ferentinos, K. P. Deep learning models for plant disease detection and diagnosis.. Comput. Electron. Agric.145, 311–318. 10.1016/j.compag.2018.01.009 (2018). [Google Scholar]
- 12.Barbedo, J. G. A. Impact of dataset size and variety on the effectiveness of deep learning and transfer learning for plant disease classification.. Comput. Electron. Agric.153, 46–53. 10.1016/j.compag.2018.08.013 (2018). [Google Scholar]
- 13.Kulkarni, Crop Disease Detection Using Deep Learning, Fourth International Conference on Computing Communication Control and Automation (ICCUBEA), Pune, India, pp. 1–4, 10.1109/ICCUBEA.2018.8697390. (2018).
- 14.Kaliappan, E., & Rafi, S. Plant Disease Classification and Identification Using Deep Convolutional Neural Network. In 2023 World Conference on Communication & Computing (WCONF) (pp. 1–5). 2023 World Conference on Communication & Computing (WCONF). IEEE. 10.1109/wconf58270.2023.10235145 (2023).
- 15.Bhola, A., & Kumar, P. Performance evaluation of different machine learning models in crop selection. In Lecture notes in electrical engineering (pp. 207–217). 10.1007/978-981-99-0236-1_16. (2023).
- 16.S. Jevoor, G. V, C. N, U. D and R. R. Gondkar, "A Comprehensive Comparison of MobileNet, ResNet50 and InceptionV3 for Efficient Plant Pathology Detection," International Conference on Computing for Sustainability and Intelligent Future (COMP-SIF), Bangalore, India, 2025, pp. 1–6, 10.1109/COMP-SIF65618.2025.10969933. (2025).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The data that support the findings of this study are available from Anubhava Srivastava upon reasonable request.











