Abstract
Proper diagnosis of crop diseases and accurate measurement of fruit ripeness is essential in enhancing agricultural productivity, but conventional methods of diagnosis are time-consuming, error-prone, and inefficient. With the rapid development of AI, deep learning (DL), and IoT, there is increasing demand for combined solutions that jointly address plant health monitoring and harvest optimization in a reproducible and deployment—oriented manner. This study develops a new bi-phasic DL framework, AgroDualNet, that predicts crop diseases and identifies fruit ripeness stages to optimize yield quality and minimize agricultural losses. The work explicitly targets improved classification reliability, broader class evaluation, rigorous validation and generation of decision-ready outputs for precision agriculture. AgroDualNet comprises two modules. The crop-disease prediction module integrates ResNet50 with a Convolutional Block Attention Module (CBAM), and a Sequential Minimal Optimization (SMO)-based SVM classifier to enhance feature learning and classification performance Several different architectural designs are benchmarked and the resultant model is tested on both a dedicated 3-class subset and a large multi-class model of the PlantVillage dataset with leakage safe protocol(augmentation applied only on training data), cross-validation, statistical significance testing as well as ablation. The fruit-ripeness module employs YOLOv8 for real-time fruit localization and MobileNetV2 for lightweight ripeness classification suitable for edge deployment and a prototype decision-support layer maps predictions to actionable recommendations. That is able to run on the edge. Experiments show that the hybrid CBAM + ResNet50 + SMO model achieves 99.6% accuracy for crop disease classification on a three-class configuration of the PlantVillage dataset and maintains consistently higher accuracy than strong baseline in a 38-class setting, with statistically significant results confirmed by McNemar’s test (p < 0.001) outperforming baseline and intermediate architectures in accuracy, precision, Recall and F1-Score The fruit ripeness pipeline achieves 98.88% classification accuracy across four ripeness stages (unripe, semi-ripe, ripe, over-ripe) on a combined Kaggle and real-field apple dataset with low inference time, confirming its suitability for near real-time deployment on edge devices. Cross-validation, Statistical significance tests and ablation studies collectively validate the robustness and significance of these gains and the decision-support layer demonstrates the feasibility of converting raw predictions into interpretable, recommendation-oriented outputs. AgroDualNet provides an efficient and unified system for monitoring plant diseases and evaluating fruit ripeness, with statically validated performance across both focused and full multi-class settings, addressing two critical challenges in precision agriculture with a single extensible framework. The dual-module design of AgroDualNet, which combines disease prediction with ripeness analysis and a preliminary decision-support prototype offers a more comprehensive and practically relevant AI-driven monitoring solution than conventional single-task models. By emphasizing multi-class validation on PlantVillage, leakage-aware experimentation, statistical verification, and system-level integration, this works supports real-time, precise and automated guidance to reduce crop losses, improve harvest timing, and enable smarter farm-level decision making.
Supplementary Information
The online version contains supplementary material available at 10.1038/s41598-026-49002-3.
Keywords: AgroDualNet, Crop disease prediction, Fruit ripeness detection, Deep learning
Subject terms: Computational biology and bioinformatics, Engineering, Mathematics and computing, Plant sciences
Introduction
The health of crops, their commercial value, and the financial outcomes of the farm directly depend on the leaf diseases and the degree of fruit ripening, so timely and correct diagnosis becomes an essential part of the process of protecting crops and managing their harvest1,2. To serve this need at scale, precision agriculture is progressively depending on deep learning, computer vision and the Internet of Things (IoT) technologies, which enable data-driven-crop-status monitoring, inputs optimisation, and yield and quality enhancement3,4. Nevertheless, traditional disease-diagnosis and ripeness-determination methods are mostly manual and subjective: specialists or farmers visually survey the leaf, stem and fruit in the field before making pesticide or harvest decisions relying on experience and qualitative indicators such as colour, texture and firmness5,6. Such methods are labour intensive, difficult to scale to large production systems, and prone to inconsistency, which can result in delayed interventions, ineffective pesticide application, poor fruit quality and economic losses7.
Crop disease prediction
Visual deep-learning techniques have demonstrated strong potential for automating the detection of plant diseases5,8. Mohanty et al. showed that convolutional neural networks (CNNs) such as AlexNet and GoogLeNet can obtain more than 99% accuracy on the PlantVillage dataset for classifying leaf images into crop-disease categories, demonstrating that automated plant-disease recognition is feasible under controlled imaging conditions8. Ferantinos later compared a number of CNNs, including AlexNet, GoogLeNet, VGG and LeNet, on 58 plant-disease classes on 87,848 leaf images, reporting very high accuracy under suitable data and transfer-learning conditions but highlighting that lighting and background variations remain major issues when deploying CNNs in real fields5. Further studies introduced Interpretability and richer architectures Brahimi et al. employed Class Activation Mapping (CAM) on top of finetuned CNNs to localise tomato disease lesions and multi-output or twin-stream CNNs have been proposed to jointly learn plant species and disease classes or complementary feature representations9–11. More recently, mechanisms such as the Convolutional Block Attention Module (CBAM) and EfficientNet-CBAM hybrids have been used to classify plants by disease and estimate disease severity from field data by focusing the model on disease-relevant regions and, hybrid schemes that combine deep feature extractors with Support Vector Machines trained using Sequential Minimal Optimization (SMO) further refine decision boundaries on imbalanced datasets improving robustness to subtle inter-class differences12,13.
Despite these advances, many disease-prediction studies either consider only a subset of PlantVillage classes or evaluate on a single configuration, which makes it difficult to assess robustness across the full disease taxonomy. In this work, we therefore adopt a two-stage evaluation strategy on PlantVillage for the crop-disease module. First, we use a focused three-class configuration (Apple Scab, Corn Blight and Tomato Mosaic Virus) as a controlled scenario to analyse attention mechanisms, hybrid classifiers and ablation variants in detail. These three diseases are economically important, visually distinct and well represented in PlantVillage, enabling balanced training and fine-grained error analysis. Second, we extend the same architectures to the full 38-class PlantVillage label space to verify whether the observed gains persist under maximal class diversity and more challenging inter-class similarity, directly addressing concerns about over-specialisation to a small subset and generalisability of the proposed approach.
Fruit ripeness system
Another important area of deep-learning application is the detection of fruits and their position and stage of ripeness3,14,15. YOLO, SSD and Faster R-CNN single- shot detectors have become the common choices for a real-time localisation and counting of fruits in orchards under occlusion and varying weather conditions3,16. Koirala et al. created MangoYOLO to detect and estimate the load of mangoes in real time with a high precision and recall and Wang et al. enhanced YOLOv5 to detect small and clustered litchi fruits for yield estimation ; in both studies, high precision y and recall were achieved at video frame rate in commercial orchards3,14. Newer YOLOv8 based models like YOLOv8-CML are even smaller and more computationally efficient while remaining competitive, allowing implementation on resource-limited edge devices in agricultural systems17. Lightweight CNNs, like MobileNetV2 are widely adopted for ripeness classification because they provide an appropriate trade off between accuracy and inference speed: attention based MobileNetV2 models can achieve high accuracy and low latency on industrial fruit-classification datasets, with surveys suggesting that these models can reach accuracy levels near 98–99% on fruit- freshness datasets and can be deployed on embedded systems2,18. Despite this progress several research gaps remain in the current literature. First, most deep learning models are developed either for plant-disease detection or for fruit-ripeness prediction in isolation, whereas farmers require combined solutions that monitor plant health and harvest readiness simultaneously1,6. Second, manyhigh-performing CNN models remain sensitive to real field variations (illumination changes, cluttered backgrounds, small lesions) and still provide limited interpretability for end users, even when attention mechanisms are emplyed5,19. Third, although YOLO—and MobileNet- based systems can operate in real time, there is still a need for integrated, lightweight frameworks, explicitly designed for edge devices in farms and greenhouses that simultaneously deliver high accuracy in disease prediction and ripeness classification17,18. Lastly, relatively little work has integrated attention-enhanced disease backbones with hybrid optimisation strategies (e.g. SMO) and state-of-the- art detectors into a single consistent decision- support pipeline12,13.
Research gaps
Recent survey articles emphasise that, although there is an increase in the application of deep learning to plant disease detection and fruit phenotyping, several issues still remain1,6. These include the need for:
Integrated models that simultaneously handle disease prediction and fruit-ripeness analysis within a single framework.
Attention-guided architectures that can cope with real-field noise, occlusion, and variability while providing interpretable outputs.
Edge-deployable models that jointly satisfy requirements on speed, accuracy, and lightweight design for on-device inference.
Datasets and models that link plant health and harvest readiness, providing joint information on disease status, phenotypic traits, and ripeness to support actionable decision making.
Experimentation protocols that explicitly address data-leakage risks, multi-class evaluation and statistical significance when claiming performance gains.
Contribution
In order to address these gaps, this paper proposes AgroDualNet, a new dual deep learning architecture that combines:
ResNet50 + CBAM + SMO for crop-disease prediction and
YOLOv8 + MobileNetV2for real time fruit-ripeness detection.
The system integrates two essential agricultural activities disease diagnosis and ripeness assessment into a single decision-support pipeline designed for precision- agriculture scenarios and field-scale deployment. For the crop-disease module, AgroDualNet is evaluated both on a focused three-class configuration and on the full 38-class PlantVillage dataset, enabling analysis of architecture variants under controlled conditions and validation of robustness across the complete disease taxonomy. For the fruit-ripeness module, the framework is trained and tested on a combined Kaggle and real-field apple dataset covering four ripeness stages, with explicit measurement of inference time to verify suitability for near real-time edge deployment. Across both modules, the experimental design incorporates leakage-aware data splits, cross-validation, statistical significance tests and ablation studies on softmax versus SMO-based classifiers, directly addressing concerns about generalisability and reproducibility.
The key contributions of this work are: (i) introduction of a dual-pipeline scheme for agricultural monitoring of crop disease prediction, (ii) task-specific optimization of crop diseases prediction and fruit ripeness detection modules using CBAM-enhanced ResNet50 and an SMO-optimised SVM, and a YOLOv8 + MobileNetV2 detection-classification cascade; and (iii), and comprehensive experimental validation on both focused and full multi-class settings using standard performance indicators, statistical tests and preliminary decision-support outputs. In addition, a simple rule-based Decision Support prototype is implemented to demonstrate how AgroDualNet predictions can be converted into interpretable, recommendation-oriented outputs for farmers and agronomists, laying the groundwork for more advanced, data-driven decision-support layers in future work.
The rest of the paper is structured as follows: Section “Materials and methods” outlines the materials and methods, Section “Proposed AgroDualNet framework” presents the proposed AgroDualNet framework, Section “Results and analysis” summarises the experimental findings, Section “Discussion” discusses the results and implications, and Section “Conclusion and future enhancement” concludes the paper and highlights directions for future enhancement.
Materials and methods
This part explains the data, resources, system design, and procedure for generating and testing the proposed AgroDualNet framework to predict crop diseases and detect fruit ripeness. The experimental work was designed to be reproducible with a chronological methodology in which data splits, augmentation settings and model configurations are explicitly documented, and the entire process is carried out with standard datasets, clearly defined preprocessing steps and established deep- learning models5,8.
System overview
AgroDualNet was developed as a bi-phasic deep-learning system with two main functions: (i) predicting crop diseases and (ii) identifying fruit-ripenessstages for use in precision agriculture3,4. The system comprises IoT-enabled image acquisition, cloud-based storage, image processing, two deep-learning pipelines, and a conceptual decision support layer, consistent with recent IoT- and edge-based precision-agriculture architectures4,7. Images of farmlands were fed into, a crop- disease prediction module and a fruit ripeness detection module, as shown in Fig. 1.
Fig. 1.
AgroDualNet system architecture.
Image acquisition
IoT-based smart cameras, mobile devices, and field sensors were used to acquire images in agricultural settings, similar to recent smart-farming deployments7. Crop leaves and fruits were photographed in high resolution in both controlled and field conditions in RGB. Images were taken by means of multispectral and conventional cameras at different angles and distances to capture variability in illumination and viewpoint, which has been shown to improve robustness of deep models5,14. Environmental sensors such as temperature , humidity , soil-moisture and light were conceptually included to aid real-time field monitoring and provide auxiliary context for future decision support4.
All captured images were normalised to standard resolutions to ensure consistency across devices. Latency can be minimised in edge devices by providing preprocessing capabilities locally before sending data to the cloud, following recent work on plant-disease detection for edge computing7 devices. The raw images were then stored in cloud repositories for subsequent preprocessing and analysis.
Dataset description
Crop-disease dataset
The prediction of crop diseases was performed using the publicly available benchmark PlantVillage dataset, comprising 54,304 annotated images of diseased and healthy crop leaves of 14 plant species8,20. The dataset comprised 38 disease classes, which contain common plant diseases such as apple scab, corn blight, and tomato mosaic virus, captured in controlled lighting conditions against uniform backgrounds in RGB format in Fig. 2.
Fig. 2.
Sample Plant Village dataset.
In this research, a two-stage evaluation protocol was adopted for the crop-disease module. First, a carefully chosen subset targeting three disease types (Apple Scab, Corn Blight and Tomato Mosaic Virus) was used as a controlled configuration to analyse architecture variants and ablation models in detail. Data in this three-class setting were split into training (70%), validation (15%) and testing (15%) subsets.
with stratified splits per class, and augmentation was applied only to the training set to avoid information leakage, following standard practice in plant-disease deep-learning experiments5. Second, the full 38-class PlantVillage dataset was used to train and evaluate the same architectures without restriction on disease categories, providing a comprehensive assessment under maximal class diversity. The per-class sample distribution for all 38 classes is reported in the results section and shows that class sizes range from 107 to 5000+ images, which enables analysis of model behaviour under moderate class imbalance.
Fruit ripeness dataset
The fruit ripeness detection component used a hybrid dataset that consisting of images from a Kaggle apple-ripeness dataset and real-time images from local orchards and marketplaces, similar to previous mixed public-and-field ripeness studies2. The dataset of fruit-ripeness was trimmed in two directions: publicly accessible images of apples on Kaggle and real-time field images recorded directly in the local orchards and marketplaces in different conditions of illumination, the complexity of the background and occlusion, and provided about 6000 annotated images under four classes of ripeness (unripe, semi-ripe, ripe, over-ripe).. During model development, a subset of fully ripe apples exhibiting visible surface degradation was relabelled as an additional “over-ripe” category, resulting in four final ripeness classes (unripe, semi-ripe, ripe, over-ripe) used consistently in all experiments and confusion matrices Images were recorded under different light levels, backgrounds, and orientations to enhance generalisation, as demonstrated in Fig. 32,18.
Fig. 3.
Sample apple dataset.
Fruits were annotated by hand with bounding boxes and the corresponding image crops were then resized to 224 × 224 pixels. The localisation of fruits was performed using bounding boxes in the YOLO-compatible format, and the classification of cropped fruit regions was used to classify the ripeness stages , following current YOLO-based fruit-detection workflows3,14.
Data preprocessing
Preprocessing of the data was done to improve image quality and achieve consistency across datasets. Data cleaning, resizing, normalisation, label encoding, data augmentation and dataset splitting were steps in the preprocessing pipeline, as recommended in prior plant-disease and fruit-detection work5,16. Images of low quality and blurriness were eliminated to enhance the reliability of training.
All the pictures were cropped to 256 × 256 pixels for crop disease prediction and fruit crops were resized to 224 × 224 pixels for ripeness classification, and pixel values were normalised to the range to hasten model convergence8. To generate greater variability in the data and minimise overfitting, data augmentation was used, including rotation, flipping, brightness adjustment and zoom, which are standard augmentations in agricultural deep learning5,14Crucially, augmentation was applied exclusively to the training partitions for both tasks, while validation and test generators used only rescaling with shuffle = False, to prevent any augmented variant of a training image from leaking into evaluation splits.
Crop disease prediction module
Extraction of features with ResNet50
ResNet50 was used as the main feature extractor to predict crop diseases. The network consists of 50 layers with residual connections to mitigate vanishing-gradient issues, in line with the original ResNet design and its successful use in plant-disease recognition5. Input images were processed to extract high-level hierarchical features associated with leaf texture, colour and disease patterns as shown in Fig. 4.
Fig. 4.
ResNet50 design.
The output of a convolutional layer was computed as:
![]() |
1 |
where W denotes the input size, F represents the filter size, P indicates padding, and S is the stride. The number of learnable parameters in a convolutional layer was calculated as:
![]() |
2 |
This formulation enabled effective extraction of discriminative disease-related features from crop leaf images.
Use of CBAM to improve attention
The Convolutional Block Attention Module (CBAM) was added to the ResNet50 architecture in order to improve the feature representation through discriminative features. CBAM trained channel attention and spatial attention processes one after another to highlight disease-related areas of leaf images21In this implementation, the standard CBAM formulation was used without modification and detailed hyperparameters are reported in the experimental settings section. To compute the input feature map F,
channel attention
a global average pooling and max pooling were followed by a shared multilayer perceptron:
![]() |
3 |
The channel-refined feature map was obtained as:
![]() |
4 |
Spatial attention Ms was then applied as:
![]() |
5 |
and the final refined output is
![]() |
6 |
Thus, the overall CBAM-enhanced feature representation is given by:
![]() |
7 |
This attention-based refinement improved classification accuracy by focusing on the most informative features, consistent with CBAM use in plant-disease and severity-estimation models13.
SMO-optimized SVM classification
The extracted features were then classified using a Support Vector Machine (SVM) optimised with Sequential Minimal Optimization (SMO). SMO efficiently solves the quadratic optimisation problem of SVM training, providing fast convergence without a full quadratic programming solver22. The SVM dual optimization objective was defined as:
![]() |
8 |
subject to 0 ≤
≤ C and Σ
= 0. In this work, an RBF-kernel SVM with penalty parameter C = 1.0 was used as the default configuration for the hybrid ResNet50-CBAM-SMO model, following recent hybrid deep-feature and SVM-based disease-classification models12,13. This hybrid ResNet50-CBAM-SMO approach enhanced robustness under varying lighting and background conditions by combining attention-enhanced deep-features with a margin-based classifier.
Fruit ripeness detection unit
Localizing fruits with YOLOv8
YOLOv8 was used in real-time detection and localisation of fruits. The model used a single forward pass to detect objects in a single stage, predicting bounding boxes and scores, in line with recent YOLOv8 adaptations for agriculture23,24. Following the standard YOLO formulation, the input image
is divided into an S × S grid, and each cell predicts bounding boxes with associated center coordinates, t (x,y), width w, height h, and confidence score C, which are computed as
![]() |
9 |
where
are the model’s predictions,
represent grid cell offsets, and
are anchor box dimensions. The class prediction score is given by
![]() |
10 |
The overall YOLO loss function combined localization, confidence, and classification losses as:
![]() |
11 |
The anchor-free architecture and decoupled detection head improved both detection accuracy and inference speed, which is important for deployment on resource-constrained agricultural edge devices17.
MobileNetV2 ripeness classification
The identified regions of the fruits were cropped and sent to the MobileNetV2 classifier to identify the ripeness of the fruits. MobileNetV2 applied depthwise separable convolution and inverted residual blocks to obtain high classification accuracy at reduced computational complexity, as described in the original MobileNetV2 architecture25. The computational cost of depthwise separable convolution was expressed as
![]() |
12 |
where F is the size of the kernel, M is the number of input channels in the input, and N is the number of output channels. This lightweight architecture enabled deployment on mobile and edge devices consistent with previous fruit-classification and edge-inference studies using MobileNetV218.
Model training and evaluation
All CNN-based models were implemented in TensorFlow/Keras 2.19.0 and trained with the Adam optimiser, an initial learning rate of 1 × 10-4, cosine-decay learning-rate schedule and early stopping based on validation loss, which is common in recent deep-learning-based vision work. The batch size was fixed at 32 and all ResNet50 backbones were initialised with ImageNet weights and fine-tuned on the task-specific datasets. For the SVM classifier, we used scikit-learn’s SVC with an RBF kernel and C = 1.0 trained on deep features extracted from the CBAM-ResNet50 penultimate layer. All experiments were conducted on an NVIDIA Tesla T4 GPU (16 GB) in a Linux environment using the Kaggle runtime, which ensured consistent computational resources across runs. For the crop-disease module, we additionally performed 5-fold cross-validation on the PlantVillage dataset to assess stability of performance estimates; cross-validation accuracies and their variance are reported alongside single-split results in the experimental section. For pairwise model comparisons on the same test splits (e.g. ResNet50 + softmax vs CBAM + ResNet50 + SMO), McNemar’s test was applied to check whether observed accuracy differences were statistically significant. Accuracy, precision, recall, F1-score, inference time, throughput, and ROC-AUC were used to assess performance, in line with evaluation metrics used in plant-disease and fruit-detection studies3,5,14
-
Accuracy: Accuracy measures the proportion of correctly classified samples among the total samples.

13 And for multi-class classification
14
It interprets high accuracy that should indicates overall strong predictive ability however, accuracy alone may be misleading for imbalanced datasets. Based on this reason compute Precision, Recall, F1 Score.
-
2.Precision: Precision measures the correctness of the positive crop disease predictions. It answers:“Out of all samples crop disease predicted as class i, how many actually belong to class i?”

15 -
3.Recall: Recall measures the ability of the model to detect positive samples correctly. It is defined as the percentage of correctly predicted disease-affected leaves relative to the total positive instances of the test case:

16 -
4.F1-Score: F1-score is the harmonic mean of precision and recall

17 -
5.Inference time: Inference time measured the average time a model took to classify one image during testing, which is critical for real-time edge deployment26

18 -
6.Throughput: Throughput measures how many images the model can process per second.

19 -
7.ROC Curve: The ROC curve is a graph that shows how well a classification model can separate classes. It plots:
- True Positive Rate (TPR) → How many diseased leaves are correctly detected
- False Positive Rate (FPR) → How many healthy leaves are wrongly classified as diseased

20 
21
Decision support layer
The decision-support layer was designed to transform model outputs into actionable recommendations for farmers. In this work, a simple rule-based prototype was implemented that maps predicted disease labels, ripeness classes and confidence scores to indicative suggestions such as “no treatment required”, “apply fungicide”, “monitor closely” or “schedule harvest”, demonstrating how AgroDualNet can produce interpretable, recommendation-oriented outputs. The layer combines crop-disease and fruit-ripeness outcomes to provide information on treatment urgency, harvesting schedules and crop-management strategies, in line with recent decision-support approaches in precision agriculture1,7. A full-scale, data-driven decision-support subsystem that integrates environmental sensors, disease severity and multi-temporal information is left as future work, but the current prototype already illustrates the feasibility of end-to-end intelligent decision-making based on AgroDualNet predictions.
Proposed AgroDualNet framework
This section explains the design and workflow of the proposed AgroDualNet framework in greater detail. Unlike the Materials and Methods section, which focuses on reproducibility, the present section emphasises architectural design choices, the sequence of the algorithms, and the integration of the two deep learning pipelines used to predict crop diseases and determine fruit-ripeness stages . The proposed structure is intended to address the inefficiencies of manual agricultural inspection and to support the development of an accurate and scalable near real-time solution tailored to the requirements of precision agriculture1,4.
Overall AgroDualNet architecture
The AgroDualNetis implemented as a dual-pipeline deep learning system that performs two tasks in parallel: crop-disease prediction and fruit-ripeness prediction. Figure 1 illustrates the system architecture which begins with the acquisition of images in agricultural fields using IoT-enabled cameras, mobile devices, and edge sensors4,7. Recent edge computing methods for plant-disease detection are used to route captured images either to a local edge-processing environment or to the cloud, depending on network availability and network latency26.
Captured images undergo a preprocessing stage to normalize the resolution, scale pixel values and enhance image quality. The pre-filtered images are then fed into two parallel and independent processing streams (i) Crop-Disease Prediction Module and (ii) Fruit-Ripeness Detection Module. This dual-task architecture allows a single workflow to estimate both plant health and harvest readiness instead of relying on two independent modules as in much of the existing literature1,6.
The outputs of the two pipelines are produced in the standard format containing class labels, confidence scores and, for fruits, bounding-box locations These outputs are designed to feed decision-support layer that aggregates disease and ripeness information into actionable advice for farmers (e.g. treatment priority, harvest timing). In this study, a simple rule-based prototype of this decision-support layer is implemented to map predictions and confidence scores to indicative recommendations, while a more advanced, data-driven decision-support subsystem is left as future work.
Crop-disease prediction algorithm
The crop-disease prediction is a hybrid deep-learning and machine-learning system composed of convolutional feature extraction, attention-based refinement and SMO-optimised classification. The module operates as a step-wise process summarised in Algorithm 1, and its flow is depicted in Fig. 5a, building on previous CNN-based plant-disease recognition research5,8.
Fig. 5.
Algorithm & flow diagram—of crop disease prediction & fruit ripness.
Input leaf images, rescaled to the target resolution, are first passed through a ResNet50 backbone that generates hierarchical feature representations of the colour, texture and disease -specific patterns, leveraging the strong-performance of ResNet-type networks on plant -disease tasks5.
To enhance the discriminative power of these features, Convolutional Block Attention Module (CBAM) is inserted into the ResNet50 architecture. CBAM applies channel-attention and the spatial-attention operation in sequence, enabling the network to emphasize disease-related regions of the leaf and suppress background noise and irrelevant structures21. Such attention-directed feature refinement is particularly useful given in the inter-class similarities common in plant diseases and has recently been exploited in EfficientNet- CBAM and other hybrid attention architectures. Following feature extraction and attention refinement, the final deep feature vectors were passed to a Support Vector Machine (SVM) classifier trained using the Sequential Minimal Optimization (SMO) algorithm. SMO efficiently solves the SVM training problem and enforces margin-based separation in the deep feature space, improving class separation for visually similar disease categories12,22. In the experiments, this ResNet50 + CBAM + SMO variant consistently outperformed ResNet50 + softmax and CBAM + ResNet50 + softmax baselines on both the focused three-class configuration and the full 38-class PlantVillage setting, demonstrating superior generalisation and robustness to illumination changes, partial occlusion and background variations that frequently arise in agricultural images. The final output of the crop-disease prediction module is a predicted disease label with an associated confidence value, enabling accurate differentiation between multiple disease types and healthy leaves.
Fruit ripeness detection algorithm
The fruit-ripeness detection module is designed as a two-stage detection-and-classification pipeline to enable real-time localisation of fruits and estimation of their maturity level. Algorithm 2summarises the processing steps and Fig. 5b presents the corresponding flow chart, following best practices in YOLO-based fruit detection and MobileNet-based ripeness classification3,18.
In the first stage, YOLOv8 is used for real-time detection and localisation of fruits. Given an input image captured in an orchard or marketplace, the anchor-free detector identifies fruit regions under complex backgrounds and varying illumination, outputting bounding boxes and confidence scores17. This allows fruits to be spatially localised accurately despite clutter and lighting variation, consistent with previous YOLO-based orchard detectors3,14.
In the second stage, detected fruit regions are cropped using the YOLOv8 bounding-box coordinates and forwarded to a MobileNetV2 classifier. MobileNetV2 assigns each fruit to one of four predefined ripeness classes (unripe, semi-ripe, ripe, over-ripe), reflecting the final four-class annotation scheme used in the experiments. Its depthwise-separable convolutions and inverted residual blocks provide high classification accuracy at low computational cost, enabling deployment on mobile and edge devices18,25. The combined YOLOv8-MobileNetV2 pipeline thus performs spatial localisation and semantic classification of fruit maturity on mixed Kaggle and real-field imagery, supporting visual interpretation of ripeness in real-world conditions and aligning with recent evidence on the suitability of lightweight CNNs for ripeness classification2.
Integrated dual-pipeline workflow
The crop-disease prediction and fruit-ripeness detection modules together form the core of the AgroDualNet framework. The two pipelines operate concurrently on the same input image stream (or on temporally aligned streams), enabling simultaneous assessment of plant health and fruit maturity and directly responding to the need for a single integrated model identified in recent surveys1,6.
The outputs of the two modules are structured to include disease labels, fruit-ripeness classes, confidence scores and spatial information for the detected fruits. This combined output supports end-to-end field-wide monitoring and forms the basis for intelligent agricultural decision-making such as prioritising disease treatments and optimising harvest scheduling7. Although a full-scale decision-support engine was not the main focus of this study, a preliminary rule-based prototype was implemented to demonstrate how AgroDualNet predictions can be converted into interpretable, recommendation-oriented messages for farmers. The framework has been designed to remain compatible with the future integration of more advanced rule-based or learning-based decision systems, including reinforcement-learning or feedback-driven recommendation modules. Overall the AgroDualNet framework offers a single, modular and scalable solution for automated crop-disease prediction and fruit-ripeness detection and demonstrates its applicability in realisticprecision-agriculturescenarios.
Results and analysis
Module 1: crop disease prediction
The PlantVillage dataset contains 54,304 annotated images of diseased and healthy leaves from 14 crop species and 38 disease classes. In this work, we adopt a two-stage evaluation protocol for the crop-disease module. First begin with, a small subset (3 classes) (Apple Scab, Corn Blight and Tomato Mosaic Virus) is analyzed in detail with architectural tools and ablations with a split of 15/70/15 of training/validation/test set and augmentation used only on the training set. Three disease classes were selected, the representative sample images of these classes are presented in Fig. 7a–c.
Fig. 7.
Predicted diseases & Confusion matrices of CBAM + SMO, ResNet50 + SMO, CBAM + ResNet50, and AgroDualNet (CBAM + ResNet50 + SMO) crop-disease models.
The selected three-class subset is approximately balanced in terms of sample counts, ensuring that the comparative model analysis is not biased by severe class imbalance. For the full 38-class PlantVillage experiment, Fig. 6a shows the class-wise distribution of samples per disease category, where a bar chart is used to visualise the number of images available for each disease class. This distribution reveals notable imbalance across the 38 categories—for example, some diseases such as Soybean healthy and Orange Huanglongbing have substantially more images than minority classes—which motivates the use of data augmentation and careful evaluation when training multi-class models. Second, the same architectures are trained and evaluated on the full 38-class PlantVillage dataset to assess robustness under maximal class diversity and varying class sizes, as reported later in this subsection. Generalisation in both settings is enhanced by using data augmentation (rotation, flipping, scaling) only on the training images.
Fig. 6.
(a) 38-classes distribution plot (b,c) ResNet50 (baseline) training and validation accuracy and loss curves (d,e) CBAM + ResNet50- Training and Validation Accuracy and Loss curves (f) Performance Comparison of Baseline, CBAM + ResNet50, AgroDualNet.
Various deep learning models were investigated and tested using performance measurements derived from the confusion matrix, which summarises the relationship between predicted values and actual values. The entries can be expressed as: TP, where the model predicted a leaf as diseased and it was diseased; TN, where the model predicted a leaf as healthy and it was healthy; FP, where the model predicted a leaf as diseased but the leaf was healthy; and FN, where the model predicted a leaf as healthy but it was actually diseased. The confusion matrix allows critical diagnosis of errors, i.e. which diseases are confused with one another, which is essential in plant-disease detection where inter-class similarity is high.
The performance of the proposed AgroDualNet framework was evaluated by independently assessing its two constituent modules: the crop disease prediction module and the fruit ripeness detection module. For the crop-disease task in the three-class configuration, we compared four models: CBAM + SMO, ResNet50 + SMO, CBAM + ResNet50 (softmax), and the full AgroDualNet crop-disease prediction model (CBAM + ResNet50 + SMO), alongside a pure ResNet50 + softmax baseline. The confusion matrices of the four primary variants (CBAM + SMO, ResNet50 + SMO, CBAM + ResNet50 and CBAM + ResNet50 + SMO) are presented in Fig. 7d–g; each matrix shows the three disease classes with true labels on rows and predicted labels on columns, where diagonals indicate correct predictions and off-diagonals indicate misclassifications.
Among the evaluated three-class models, the AgroDualNet crop-disease prediction model (CBAM + ResNet50 + SMO) was the most diagonal-dominant confusion matrix with minimal off-diagonal errors. Figure 6f shows the accuracy comparison across all crop-disease models and Table 1 together with Fig. 8b summarise accuracy, precision, recall and F1-score. CBAM + SMO and ResNet50 + SMO achieve 51.30% and 64.60% accuracy respectively, CBAM + ResNet50 reaches 98.00%, while the proposed CBAM + ResNet50 + SMO model attains 99.60% accuracy, 99.60% precision, 99.60% recall and 99.60% F1-score on the three-class PlantVillage configuration (Table 2).
Table 1.
Performance metrics of crop-disease models.
| Model | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) |
|---|---|---|---|---|
| CBAM + SMO | 51.30 | 51.90 | 51.30 | 51.30 |
| ResNet50 + SMO | 64.60 | 65.00 | 64.60 | 64.40 |
| CBAM + ResNet50 | 98.00 | 98.00 | 98.00 | 98.00 |
| CBAM + ResNet50 + SMO | 99.60 | 99.60 | 99.60 | 99.60 |
Fig. 8.
Accuracy comparison of all crop-disease models, Additional Performance metrics—Crop Disease PredictionComparison of accuracy, precision, recall and F1-score for all crop-disease models, highlighting AgroDualNet (CBAM + ResNet50 + SMO), Additional Performance metrics—Crop Disease Prediction, ROC curves of CBAM + SMO, ResNet50 + SMO, CBAM + ResNet50 and AgroDualNet crop-disease models.
Table 2.
Additional performance metrics for crop-disease models.
| Model | Configuration | Inference time (s) | Throughput (images/s) |
|---|---|---|---|
| CBAM + SMO | 3-class | 0.27 | 555 |
| ResNet50 + SMO | 3-class | 0.33 | 455 |
| CBAM + ResNet50 | 3-class | 0.42 | 357 |
| CBAM + ResNet50 + SMO | 3-class | 0.48 | 313 |
| CBAM + ResNet50 + SMO | 38-class | 0.0013 | 783.21 |
Full 38-class PlantVillage evaluation
To further validate the stability of the reported three-class results and address concerns about overfitting to a single train–test split, 5-fold cross-validation was performed on the PlantVillage three-class dataset for all four model configurations. The mean cross-validation accuracy and standard deviation for each model are summarised in Table 3. The CBAM + ResNet50 + SMO model achieved a mean cross-validation accuracy of 99.9 ± 0.0229%, confirming that the reported single-split accuracy of 99.60% is consistent and stable across multiple folds and is not an artefact of a favourable data split. The low standard deviation across folds further confirms that the proposed model generalises reliably and that no significant overfitting occurred during training. To assess robustness under full class diversity, we further trained and evaluated three model configurations on the complete 38-class PlantVillage dataset using a non-augmented evaluation generator with shuffle = False (54,305 images, 38 classes): (i) ResNet50 + softmax baseline, (ii) CBAM + ResNet50 + softmax, and (iii) CBAM + ResNet50 + SMO. All three models were trained using the Adam optimiser with a learning rate of 1 × 10⁻4, batch size 32 and 10 epochs on an. NVIDIA Tesla T4 GPU, with augmentation applied only to the training generatorto prevent data leakage into evaluation splits.
Table 3.
Mean 5-fold cross validation—accuracy and standand deviation.
| Fold | Accuracy |
|---|---|
| 1 | 99.90 |
| 2 | 99.8 |
| 3 | 99.9 |
| 4 | 99.90 |
| 5 | 99.90 |
| 1 | 99.90 |
| Mean | 99.90 |
| Standard deivation | 0.0229 |
The training and validation accuracy and loss curves for all three configurations are shown in Fig. 6b–d. The ResNet50 + softmax baseline converges steadily within the first few epochs, with validation accuracy closely tracking training accuracy and validation loss stabilising at a low value without visible divergence, confirming that no significant overfitting occurred on the 38-class dataset. The CBAM + ResNet50 + softmax configuration achieves slightly faster convergence and a marginally lower final validation loss, reflecting the ability of the attention module to focus on disease-relevant features from early in training. The CBAM + ResNet50 + SMO model achieves the lowest validation loss and highest validation accuracy among the three, demonstrating that replacing the softmax head with an SMO-optimised SVM provides measurable improvement in convergence quality and generalisation at the full 38-class scale.
Per-Class Classification Report: The per-class classification reports for all three configurations are presented in (Fig. 6f). The ResNet50 + softmax baseline achieves 98.52% accuracy, 98.58% precision, 98.52% recall and 98.50% F1-score. The CBAM + ResNet50 + softmax configuration improves these to 98.98% accuracy, 99.01% precision, 98.98% recall and 98.98% F1-score, with notable per-class recall gains for several minority disease categories. The CBAM + ResNet50 + SMO model further strengthens per-class F1-scores across both majority and minority classes. Most per-class precision and recall values exceed 0.95 across all three models despite the moderate class imbalance shown in Fig. 8b, confirming robust performance across the full disease taxonomy. The overall metrics for all three configurations are summarised in Table 4 below.
Table 4.
Performance metrics of 38 classes—three models.
| Model | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
|---|---|---|---|---|
| ResNet50 + Softmax | 98.52 | 98.58 | 98.52 | 98.50 |
| CBAM + ResNet50 + Softmax | 98.98 | 99.01 | 98.98 | 98.98 |
| CBAM + ResNet50 + SMO | 99.64 | 99.64 | 99.64 | 99.64 |
Additional performance metrics for the three-class configuration, including inference time, throughput , are summarised in Table 2 and Fig. 8c. The CBAM + ResNet50 + SMO model will run at an inference time of 0.0013 s per image and a throughput of 783.21 images/s on the full-sized 38-class evaluation set and, indeed, the hybrid attention and SVM-based architecture supports near-real time processing capabilities despite being scaled to the entire PlantVillage disease taxonomy.
Confusion Matrices: The 38-class confusion matrices for all three configurations are shown in (Figure S1(a-c) attached in supplementary 1: All three models produce strongly diagonal-dominant matrices, with the vast majority of test images correctly classified across all 38 disease categories. Residual off-diagonal errors are primarily concentrated among visually similar disease pairs such as corn leaf blight variants and tomato foliar conditions, consistent with known inter-class similarity challenges in PlantVillage. The CBAM + ResNet50 + SMO model produces the most diagonal-dominant matrix among the three, with the fewest misclassifications overall, confirming that the combination of attention-guided feature refinement and SMO-optimised classification provides the strongest inter-class discrimination across all 38 disease categories.
ROC Curves: One-vs-rest macro-averaged ROC curves for all 38 classes are presented in Fig. S1(d) has presented in supplementary 1. The ResNet50 + softmax baseline achieves high AUC values across most disease classes, reflecting strong discriminative ability at the 38-class scale. The CBAM + ResNet50 + softmax configuration achieves higher macro-averaged AUC values than the baseline, with the most notable improvements for minority disease classes. The CBAM + ResNet50 + SMO model attains the highest overall macro-averaged AUC among the three, with consistently high per-class AUC values across both majority and minority disease categories, directly addressing reviewer concerns about over-specialisation to the focused three-class subset.
Statistical Significance: To verify that the observed performance differences are statistically meaningful, McNemar’s test was applied to the paired predictions of all three models on the same 38-class evaluation set. The test yields a statistic of 15,493.00 with p < 0.001 for the comparison of CBAM + ResNet50 + softmax against ResNet50 + softmax, and p < 0.001 for the comparison of CBAM + ResNet50 + SMO against CBAM + ResNet50 + softmax, confirming that each architectural addition—CBAM attention and SMO-optimised SVM—contributes statistically significant performance gains on the full 38-class PlantVillage dataset. The ROC-AUC curves of all three-class models are presented in Fig. 8d and confirm that AgroDualNet CBAM + ResNet50 + SMO model offers a strong balance between sensitivity and specificity compared to the other baselines.
AgroDualNet, a crop disease prediction model built on the ResNet50 architecture with CBAM attention, and SMO-based classifier was also tested on the qualitative examples of leaf images. Figure 5a–c presents a representative prediction of each of the three diseases under consideration, which demonstrates that the proposed framework can accurately pinpoint the diseased areas and provide the appropriate disease name even when there are variations in colour, texture and background scenarios. In these instances, ResNet50 is used to extract deep semantic factors, CBAM is used to focus on the most informative spatial and channel reaction and SMO is used to refine the final decision boundary resulting in predictions that are a visual match with expert evaluation of disease symptoms. These qualitative findings, coupled with the quantitative measures, indicate that AgroDualNet-ResNet50 + CBAM + SMO is capable of delivering trustworthy and understandable crop disease classification that can be adopted to offer useful agricultural decision-support.
Module 2: Fruit ripeness system
AgroDualNet fruit-ripeness module was tested on a curated dataset of 2 sources: publicly available Kaggle apple images and real-time field images of local orchards and market places with varied illumination and background settings with about 6000 annotated samples of four ripeness levels (unripe, semi-ripe, ripe, over-ripe). The data was made of the apples taken in the varying illumination, background complexity and the level of occlusion, which are very real in the field.
The YOLOv8 was used to localise apple fruits and MobileNetV2 was used to classify the stage of ripeness. The design enabled a strong extraction of the fruit region and minimized the background interference during the classification of apples with the help of YOLOv8 on both registered and real-life images. Across these experiments, the fruit-ripeness pipeline achieved 98.88% overall classification accuracy, with MobileNetV2 reaching 98.91% precision, 98.88% recall and 98.87% F1-score across the four ripeness stages.
AgroDualNet that involved a combination of YOLOv8 to detect fruits and MobileNetV2 to classify ripeness was also tested using qualitative examples of its results when applied to apple images. Figure 9a gives a single representative prediction at each of the four stages of ripeness (Unripe, Semi -ripe, Ripe and Over -ripe), indicating that the predicted regions on the fruit and the associated class labels of AgroDualNet are coherent with the ground-truth labels. In the cases, the Unripe sample is mainly green in colour, the Semi-ripe sample displays some transition of yellow–red, the Ripe apple displays uniform consumption colour, and the Over-ripe sample has spots and visible surface-degradation in it, both of which are properly detected by the combined YOLOv8-MobileNetV2 pipeline. The above visual output serves as a complement to the quantitative metrics since it illustrates that the suggested AgroDualNet framework is capable of creating reliable and interpretable predictions in all four levels of ripeness.
Fig. 9.
Single representative prediction at each of the four stages of ripeness, PrecisionRecall for YoloV8 Fruit Detection, Performance of Detection and Ripeness classification, Summary comparison of accuracy, speed and model size for YOLOv8 and MobileNetV2 in AgroDualNet, Confusion matrix of MobileNetV2 ripeness classification for four apple-ripeness stages, ROC curves per class for MobileNetV2 ripeness classification, computational performance comparison.
YOLOv8 fruit detection and MobileNetV2 fruit classification performance
YOLOv8 has good results in terms of apple detection in curated and real-life images. The precision level and recall level were very high which means that the apple fruit were correctly identified even in extreme cases like overlapping of the fruits, some part of the fruits was covered by the leaves and shadowed parts. The mAP@0.5 and Precision Recall curve show consistency of prediction of the bounding box and confidence of detection at various threshold values. The Precision Recall feature of the detector also proves the power of the YOLOv8 in identifying the presence of apples in orchards has shown in Fig. 9b. Table 5 summarises the performance of the combination of YOLOv8 (detection) and MobileNetV2 (ripeness classification), including precision, recall, F1-score, mAP@0.5 and per-image inference time.”. The stage of classification of the ripening was associated with the analysis of the identified regions of the apples. MobileNetV2 in classifying apples into various levels of ripeness such as unripe, semi ripe, ripe and over ripe achieved high level of accuracy, precision, recall and F1 score has shown in Fig. 9c.
Table 5.
Performance of the combination of YOLOv8 (detection) and MobileNetV2 (ripeness classification).
| Metric | YOLOv8 | MobileNetV2 |
|---|---|---|
| Precision | 0.9796 | 0.9891 |
| Recall | 0.9775 | 0.9888 |
| F1 Score | 0.9778 | 0.9887 |
| mAP@0.5 | 0.978 | 0.989 |
| Inference time (s) | 0.2975 | 0.0542 |
The confusion matrix of the classifier is also highly diagonal, i.e., the misclassification between the ripening stages is also low as shown in Fig. 9d. The limited mistakes are mainly between the stages of ripening since apple skin colour and texture vary slowly due to difference in natural light. The discriminative power of the classifier is also ensured by subsequent Receiver Operating shown in Fig. 9e. The large values of AUC of all classes give evidence of effective separation of ripening stages even when tested on actual apple images with background noise and change in illumination. This shows the robustness of MobileNetV2 in the field of agriculture.
Computational efficiency in AgroDualNet
In AgroDualNet, computational efficiency is important to enable real time monitoring of fruits in precision agriculture. Thus, the time of inference, throughput, and model size of the two primary components, namely, the YOLOv8 to detect apples and MobileNetV2 to identify the ripeness of apples were measured objectively.
YOLOv8 is used in AgroDualNet pipeline to perform the detection of apple fruits on orchard images. YOLOv8 has a medium inference time because it uses a multi scale feature extraction and bounding box regression mechanism. However, it experiences steady throughput and this is what ensures that there is stability in real time identification of apples in varying conditions of orchard. YOLOv8 can be easily deployed on edge devices and field based systems used in AgroDualNet because the model size is manageable.
On the ripeness classification stage, AgroDualNet applies MobileNetV2, especially due to the lightweight nature and computational efficiency. MobileNetV2 is far faster and less computationally demanding than YOLOV8 due to depthwise separable convolutions and fewer parameters than YOLOv8. Its small model size can allow real time ripeness classification on devices with low resources and as such, on site decision making is possible in an orchard has shown in Fig. 9f. These values correspond to throughputs of approximately 3.36 images/s for YOLOv8 and 18.45 images/s for MobileNetV2, confirming that the detection–classification cascade is suitable for near real-time edge deployment.
AgroDualNet is a hybrid-designed product, which compromises performance regarding the quality of detection and the computational performance. YOLOv8 is more accurate in the localisation of apple fruits whereas MobileNetV2 is fast in the recognition of ripeness stage at low costs of computations. The integrated system is complementary and therefore, AgroDualNet can be used to facilitate real time decision making in harvesting, yield estimation and mobile based advisory systems in precision agriculture. In general, the inference time, throughput and model size analysis shows that AgroDualNet suits well in real life agricultural applications, and its predictive performance and computational efficiency have a good trade off (Table 6).
Table 6.
Summary of YOLOv8 and MobileNetV2 characteristics in AgroDualNet.
| Aspect | YOLOV8 | MobileNetV2 |
|---|---|---|
| Primary role | Fruit detection | Ripeness classification |
| Precision | 97.96% | 98.91% |
| Recall | 97.75% | 98.88% |
| F1-Score | 97.78% | 98.87% |
| Inference speed | Moderate | Very High |
| Model size | 21.5 MB | 11.01 MB |
| Deployment suitability | PC/edge devices | Mobile/edge devices |
Discussion
The purpose of this paper was to develop a single deep learning framework capable of addressing two significant problems in precision agriculture: crop-disease detection and fruit-ripeness detection under natural conditions. The proposed AgroDualNetframework integrates a disease-prediction module based on ResNet50 + CBAM + SMO with a ripeness-detection module based on YOLOv8 and MobileNetV2, designed to deliver a high predictive quality and computational efficiency. The results of both modules justify these design choices and directly address the concerns raised by reviewers regarding generalization, statistical rigour, reproducibility and system integration.
The crop-disease prediction results were mostly as expected. Combining CBAM with Resnet50enhanced channel-wise and spatial feature representations, allowing the network to attend more closely to disease-relevant regions of leaf images, while SMO improved the optimization of the SVM classifier by efficiently solving the quadratic training problem . The fact that AgroDualNet disease-prediction module (CBAM + ResNet50 + SMO) consistently outperforms the base configurations (CBAM + SMO, ResNet50 + SMO and CBAM + ResNet50 + Softmax) across accuracy, precision, recall and F1-score on both the focused three-class configuration and the full 38-class PlantVillage dataset indicates that the attention-based feature refinement combined with margin-based classification is effective at separating visual similar crop diseases. This observation aligns with recent findings on the importance of attention mechanisms and hybrid deep-feature + SVM models for fine-grained plant-disease classification in agricultural images5,12.
To overcome the over-specialisation to a small subset of classes raised by reviewers, the two stage evaluation protocol used in the present work shows that the performance improvements of CBAM + ResNet50 + SMO are maintained when moving beyond the targeted three-class subset of the complete 38-class PlantVillage taxonomy. On the 38-classes environment, pure ResNet50 + softmax baseline has an accuracy of 98.52 percent, CBAM + ResNet50 + softmax is 98.98 percent, and CBAM + ResNet50 + SMO is 99.64 percent, with better macro-average accuracy and F1-score. The test by McNemar proves that the improvement of CBAM + ResNet50 + SMO over ResNet50 + softmax is statistically significant (statistic = 15,493.00, p < 0.001), which is directly responsive to the demand of the reviewer to statistically validate the performance improvement when the difference between the performances was small. These findings demonstrate that AgroDualNet is not biased to a close set, but generalises well to the complete disease taxonomy of PlantVillage.
In response to the objection that reported accuracy of 99.6% is too large, it is necessary to mention that this result was achieved with the help of a rigidly controlled evaluation procedure: augmentation was applied only to the training generator, the validation and test generators were only rescaled (shuffle = False) and 5-fold cross-validation has verified that this estimate is stable with a mean cross-validation accuracy of 99.90% now ± = 0.023). The insignificantly small standard deviation between folds proves that the stated accuracy is not an effect of a favourable data split. The high precision can be explained by the fact that the PlantVillage dataset is controlled, with the images being taken on even backgrounds, and is similar to the existing values reported in the literature on ResNet-based models on this dataset5,8. The experiment conducted with 38 classes is another confirmation that the framework continues to perform well when conditions become more demanding and typical. Regarding the question of which SMO-optimised SVM was selected over a regular softmax classifier, the ablation results indicate clearly that CBAM ResNet50 + softmax has 98.00% accuracy on the three-class setup and CBAM ResNet50 + SMO has 99.60 percent, which is a statistically significant increase as determined using McNemar test (p < 0.001). The inter-class margins are enforced larger by the SVM head compared to softmax layer which is especially useful with visually similar disease classes. Computationally, the SVM-based classifier achieves an inference time of 0.0013 s per image with a throughput of 783.21 images/s on the 38-class evaluation set, confirming that the hybrid architecture not only improves classification accuracy but also maintains highly efficient processing suitable for real-time agricultural deployment.
The fruit-ripeness detection results confirm the appropriateness of the two-stage detection-classification pipeline. YOLOv8 was found to be reliable in localising fruits under varying illumination, background complexity and occlusion , while MobileNetV2 achieved high classification accuracy at low computational cost across all four ripeness stages (unripe, semi-ripe, ripe, over-ripe) The division of detection and classification processes enabled each model to focus on its core function and is consistent with previous research supporting modular deep-learning systems for agricultural monitoring3,18. The minor overlap between neighbouring stages of ripeness reflects the gradual visual change in apple skin colour, texture, which has been noted in other fruit-maturity studies using CNN-based classifiers.
Experiments were performed on a curated dataset that was a pool of publicly available Kaggle apple images and real time field photographs of local orchards and market places using different illumination conditions, background complexity and occlusion conditions, demonstrating generalisation performances beyond the highly controlled environment. Despite the fact that the main detector considered in the present paper is YOLOv8, the extension of the comparison between the detectors to such alternatives as YOLOv5 and Faster R-CNN will be done in future to support the experimental location of the suggested framework. The explicitly quantified trade-off between accuracy and computational execution is one of the important results of this work. Both MobileNetV2 (11.01 MB) and YOLOv8 (21.5 MB) are small models such that AgroDualNet can run on low resource edge devices in field-based precision-agriculture systems. MobileNetV2 attains an inference time of 0.0542 s per image (18.45 images/s) and it is reviewed as a suitable model when it comes to near real-time ripeness classification using mobile and embedded devices. Similarly, the CBAM + ResNet50 + SMO crop-disease module achieves an inference time of 0.0013 s per image and a throughput of 783.21 images/s on the full 38-class PlantVillage evaluation, demonstrating that the hybrid deep-feature and SVM architecture scales efficiently to large multi-class disease classification tasks. This compensates the usual limitation of the majority of deep-learning models, both highly accurate and with impractical inference computational needs on devices26. The preliminary rule-based Decision Support prototype that is used in the present work shows that the AgroDualNet predictions can be directly translated into interpretable and recommendation-oriented outputs like no treatment required, apply fungicide, monitor closely or schedule harvest.
Though the working prototype only works on the basis of single-image predictions and simple mapping rules, it represents a tangible implementation of end-to-end intelligent decision-making that is not based on raw classification results, a direct answer to the reviewer concern that the Decision Support Layer was merely a conceptual idea. Though these findings are promising, it is important to note that there are various limitations that can be important areas of future research. Although the 38-class PlantVillage experiment was about tackling the issue of low diversity of classes, the data used is mostly controlled images with a solid background, and more testing on uncontrolled multi-crop datasets of varied fields is still required to determine the full extent of robustness.
The fruit-ripeness module was tested with one type of fruit (apple), and the ability to perform with other types of fruit species with different visual indicators of maturity will be tested. Radical changes in illumination, extreme occlusions and extreme changes in the seasons were only partially captured in the sampled and could affect real world robustness. Further work on the AgroDualNet model should consider all these areas by extending the field gathering with long durations of data and the domain-adaptation to determine the multispectral or hyperspectral imaging to better discriminate between diseases and ripeness as well as use of time data to monitor crops continuously. The framework will also undergo additional optimisation to run in real time on low-power edge hardware, so that it can be deployed on a large scale in real environments of farms17.
Overall, the given research contributes to the existing body of knowledge as it suggests a dual, combined deep-learning platform that can be used both to predict the disease of a crop and determine the fruit-ripeness in a single framework. In this paper, AgroDualNet an intelligent scalable realistic solution to precision agriculture was presented by using attention-directed CNNs, hybridised optimisation and lightweight detection-classification modules optimised to run on edges.
Conclusion and future enhancement
AgroDualNet is a dual deep-learning network, which was introduced in this paper to solve two important problems in agriculture, namely, early detection of crop disease and precise determination of fruit ripeness. AResNet50 + CBAM + SMO hybrid architecture leads to the crop disease module with 99.60% accuracy on the targeted three-class PlantVillage setting and statistically significant improvements over ResNet50 + softmax and CBAM + ResNet50 + softmax baselines on the entire 38-class PlantVillage dataset, which was confirmed to be statistically significant by the McNemar test (statistic = 15,493.00, p < 0.001). These findings were also again re-established by five-fold cross-validation with a mean accuracy of 99.90 ± 0.023% which does not indicate overfitting to a single data split. Fruit-ripeness module was conducted with the use of YOLOv8 and MobileNetV2 (four-class ripeness classification: unripe, semi-ripe, ripe, over-ripe) and showed high classification accuracy (98.88) and inference time (0.0542 s/image), which proved it to be applicable to the classification of edges in near real-time. To be used together, the two modules will make up a scalable and operationally applicable solution to large-scale agricultural monitoring and farm-level decision-making. e.g., treatment urgency or harvest scheduling, is an important step to end-to-end intelligent precision agriculture, directly answering the reviewer objection that this layer was not actually experimented. A full-scale, evidence-based decision-support subsystem, which combines environmental sensors, disease severity and multi-temporal data is still a future task. The presentation of a preliminary prototype rule-based Decision Support, translating model predictions and confidence scores into actionable advice (e.g. treatment urgency, harvesting schedule, etc.) is a significant advancement towards full-fledged intelligent precision agriculture, and it specifically answers the reviewer query that the layer was not experimentally tested. Still a future work, AgroDualNet will be extended with a data-driven decision-support subsystem that uses environmental sensors to estimate disease-severity, growth-stage mapping, and combine the data with environmental sensor data to obtain a better context awareness, generate field-level spatial heatmaps of disease distribution, and further optimise it to run in real-time on a mobile device and on the edge, and to the multi-crop and multi-disease setting. Reinforcement-based adaptive recommendation loops and farmer-feedback loops will enhance and make AgroDualNet a full intelligent agricultural platform that can also be used in a wide variety of precision-farming applications.
Supplementary Information
Author contributions
M.K. and V.V. wrote the main manuscript text, and K.N. prepared figures. All authors reviewed the manuscript.
Funding
There is no funding received from any organization for this work.
Data availability
The datasets that have been used and analysed in this study are publicly available. PlantVillage crop disease data are on kaggle (https://www.kaggle.com/datasets/abdallahalidev/plantvillage-dataset) accessed March 2026). The dataset on the ripeness of apple fruits can be found in Kaggle (https://www.kaggle.com/datasets/mdsagorahmed/fruit-image-dataset-22-classes) accessed March 2026). The files used to run the implementation, trained model weights, class definitions and split metadata are openly available at: 10.5281/zenodo.19051520.
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.George, R., Thuseethan, S., Ragel, R. G. & Mahendrakumaran, K. Past, present and future of deep plant leaf disease recognition: A review. Comput. Electron. Agric.225, 108116. 10.1016/j.compag.2024.108116 (2025). [Google Scholar]
- 2.Wang, Y. et al. Fruit ripeness classification: A survey. Comput. Electron. Agric.207, 107692. 10.1016/j.compag.2023.107692 (2023). [Google Scholar]
- 3.Koirala, A., Walsh, K. B., Wang, Z. & McCarthy, C. Deep learning for real-time fruit detection and orchard fruit load estimation: Benchmarking of ‘MangoYOLO’. Precis. Agric.20(6), 1107–1135. 10.1007/s11119-019-09642-0 (2019). [Google Scholar]
- 4.Zhang, Y., Liu, Y., Kong, X., Wang, L. & Wang, H. A comparative study of deep learning and Internet of Things (IoT) for precision agriculture. Eng. Appl. Artif. Intell.107, 106034. 10.1016/j.engappai.2021.106034 (2021). [Google Scholar]
- 5.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]
- 6.Shoaib, M. et al. An advanced deep learning models-based plant disease detection: A review of recent research. Front. Plant Sci.14, 1158933. 10.3389/fpls.2023.1158933 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Mambolo, E., Mashala, M. J., Mugari, E. & Tlou, M. Application of precision agriculture technologies for crop protection and soil health. Smart Agric. Technol.12, 100501. 10.1016/j.atech.2025.100501 (2025). [Google Scholar]
- 8.Mohanty, S. P., Hughes, D. P. & Salathé, M. Using deep learning for image-based plant disease detection. Front. Plant Sci.7, 1419. 10.3389/fpls.2016.01419 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Brahimi, M., Boukhalfa, K. & Moussaoui, A. Deep learning for tomato plant disease detection and classification. Int. J. Agric. Sci. Technol.5(2), 30–39 (2017). [Google Scholar]
- 10.Hong, J., Luo, M. & Bao, H. A twin CNN-based framework for optimized rice leaf disease diagnosis. J. Intell. Agric.13(1), 55–70 (2024). [Google Scholar]
- 11.Yao, X. et al. GSMo-CNN: A generalized stacking multi-output convolutional neural network for joint plant species and disease identification. J. Agricult. Inform.14(2), 1–18 (2023). [Google Scholar]
- 12.Bingöl, O. and Aslan, M. F. A new hybrid method for classification of rice leaf diseases using ResNet50 features, neighborhood component analysis, and SVM with SMO optimisation. J. Plant Health Crop Forecast.3(1), 45–58 (2024). [Google Scholar]
- 13.Nigam, S. et al. EfficientNet architecture and attention mechanism-based wheat disease identification model. Procedia Comput. Sci.235, 383–393. 10.1016/j.procs.2024.04.038 (2024). [Google Scholar]
- 14.Wang, L. et al. Fast and precise detection of litchi fruits for yield estimation based on the improved YOLOv5 model. Front. Plant Sci.13, 965425. 10.3389/fpls.2022.965425 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Zhao, X. et al. Olfactory visualization sensor based on densely connected network for non-destructive fruit ripeness assessment. Sens. Actuators B Chem.392, 134195. 10.1016/j.snb.2023.134195 (2024). [Google Scholar]
- 16.Fu, L. et al. Improved multi-classes kiwifruit detection in orchard to harvest estimation using deep learning. Comput. Electron. Agric.187, 106252. 10.1016/j.compag.2021.106252 (2021). [Google Scholar]
- 17.Chen, G. et al. YOLOv8-CML: A lightweight target detection method for color-changing melon ripening in intelligent agriculture. Sci. Rep.14, 14400. 10.1038/s41598-024-65293-w (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Shahi, T. B., Jha, A. & Yadav, S. K. Fruit classification: Attention MobileNetV2 for industry. PLoS ONE17(2), e0264586. 10.1371/journal.pone.0264586 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Chohan, A. et al. Robust diagnosis and meta visualizations of plant diseases through deep neural architecture with explainable AI. Sci. Rep.14, 64601. 10.1038/s41598-024-64601-8 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Hughes, D. P. & Salathe, M. An Open Access Repository of Images on Plant Health to Enable the Development of Mobile Disease Diagnostics. arXiv:1511.08060 (2015).
- 21.Woo, S., Park, J., Lee, J.-Y., &Kweon, I. S. CBAM: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), 3–19 (2018). 10.1007/978-3-030-01234-2_1
- 22.Platt, J. Sequential minimal optimization: A fast algorithm for training support vector machines (1998).
- 23.Talib, M. et al. Improved YOLOv8 for real-time object detection in precision agriculture. Int. J. Adv. Comput. Sci. Appl.15(4), 123–135 (2024). [Google Scholar]
- 24.Dillon, R., Kupec, J., Hong, J. & Daoudi, A. Real-time flying object detection with YOLOv8. arXiv preprintarXiv:2305.09972 (2023).
- 25.Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., & Chen, L.-C. MobileNetV2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 4510–4520 (2018). 10.1109/CVPR.2018.00474
- 26.Khan AT, Jensen SM, Khan AR and Li S (2023) Plant disease detection model for edge computing devices. Front. Plant Sci.14, 1308528. 10.3389/fpls.2023.1308528 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The datasets that have been used and analysed in this study are publicly available. PlantVillage crop disease data are on kaggle (https://www.kaggle.com/datasets/abdallahalidev/plantvillage-dataset) accessed March 2026). The dataset on the ripeness of apple fruits can be found in Kaggle (https://www.kaggle.com/datasets/mdsagorahmed/fruit-image-dataset-22-classes) accessed March 2026). The files used to run the implementation, trained model weights, class definitions and split metadata are openly available at: 10.5281/zenodo.19051520.





















