DAPR-AM-Net: an end-to-end smart farming system powered by dual-attention progressive refinement and adaptive MixUp for explainable tomato leaf disease classification and forecasting Authors: Ran Wang, Xiao Yu, Lina Lu, Cong Chen Published: 2026 ABSTRACT AbstractVision-based crop disease diagnosis plays a pivotal role in smart agriculture, yet challenges such as complex field backgrounds, high intra-class similarity of lesion morphology, and severe data imbalance continue to impede model stability and interpretability. To address these issues, this study proposes DAPR-AM-Net, an intelligent diagnostic framework for tomato leaf diseases that integrates dual-attention progressive refinement with adaptive MixUp. The method introduces four key innovations: (1) a Dual Attention Fusion Mechanism (DAFM) that jointly leverages channel-wise and spatial attention to enhance lesion-related texture, color, and structural cues while suppressing background noise via the CBAM module, thereby directing the network’s focus toward pathogenic regions; (2) an Adaptive MixUp with Attention-Aware Sampling (AMAAS) module that dynamically adjusts sample mixing ratios according to attention maps, effectively improving discrimination in complex boundary areas; (3) a Progressive Feature Refinement with Dual Attention (PFR-DA) module that incrementally optimizes deep feature representations through cross-hierarchical information flows; and (4) an Imbalance-Aware Multi-Objective Optimization (IAMOO) strategy that adaptively modulates loss weights based on category distribution to strengthen recognition of minority disease classes. On our self-constructed Tomato-DD dataset, DAPR-AM-Net achieves superior performance across all major metrics—including an accuracy of 99.73%, precision of 99.73%, recall of 99.74%, and an F1-score of 99.73%—outperforming current state-of-the-art approaches. On the full Plant-Village dataset, the model achieves 99.85% accuracy, 99.78% precision, 99.84% recall, and a 99.81% F1-score, while maintaining a compact model size of only 4.72 M parameters. Multi-level interpretability analyses corroborate the transparency and reliability of the model’s inference process. Additionally, we developed an end-to-end smart agriculture platform powered by DAPR-AM-Net. Overall, DAPR-AM-Net provides a forward-looking yet practical solution for high-accuracy and strongly interpretable disease diagnosis in smart agriculture scenarios, demonstrating both methodological innovation and real-world applicability.Keywords: Tomato disease detection, Convolutional neural networks, Agricultural visual diagnosis, Dual attention mechanism, Progressive feature refinement, Imbalance-aware learning, Smart agriculture platform Introduction Agriculture, as the foundation of human civilization, is currently confronted with multiple challenges, including climate change, population growth, and increasing resource scarcity [1]. Among these challenges, crop diseases have emerged as one of the major bottlenecks restricting the sustainable development of global agriculture [2]. The Food and Agriculture Organization (FAO) estimates that plant diseases cause annual global yield losses of 20%–40%, with tomatoes being particularly vulnerable due to their high economic importance. As a key vegetable crop, tomato yield and quality are closely associated with food security and farmers’ livelihoods. Tomato leaf diseases—including early and late blight, bacterial spot, Verticillium wilt, and pest-induced disorders—exhibit high incidence, rapid spread, and visually similar symptoms, making early and accurate diagnosis challenging under field conditions [3]. Traditional manual scouting is labor-intensive and unsuitable for large-scale monitoring, thereby motivating the development of computer vision–based automated disease recognition and intelligent decision-support systems in smart agriculture [4]. Despite the success of deep learning approaches, challenges such as data imbalance, complex backgrounds, limited interpretability, and the gap between laboratory studies and real-world deployment remain unresolved [5]. At the methodological level, attention mechanisms have become a central component in plant disease recognition by enabling models to focus on discriminative lesion regions and improve fine-grained classification under complex backgrounds. Channel and spatial attention modules, when integrated with lightweight backbone networks, have been shown to substantially enhance the extraction of disease-related texture and boundary features [6]. Meanwhile, hybrid data augmentation strategies such as MixUp, CutMix, and RICAP effectively improve model generalization and alleviate overfitting. Recent studies further refine these mixed augmentation schemes to better address the limited sample size and high variability in agricultural imagery [7]. Performance gains alone are insufficient for real-world agricultural deployment. Growers and agronomists require interpretable diagnoses and actionable guidance, encompassing both the rationale behind model predictions and corresponding management recommendations. Accordingly, the integration of interpretability techniques—such as Grad-CAM and activation-based visualization—into automated diagnostic systems to establish a closed loop of “visual evidence, interpretable explanation, and decision support” has emerged as a critical direction in both high-impact research and practical applications [8]. Despite notable advances, tomato leaf disease diagnosis still faces several critical limitations. Existing models struggle to capture subtle inter-class visual differences, while severe class imbalance in training datasets often degrades performance for minority diseases. Moreover, most interpretability approaches remain post-hoc and insufficiently integrated with attention mechanisms, limiting the reliability of model explanations. Finally, current studies largely emphasize algorithmic benchmarks, with limited validation through end-to-end agricultural platforms capable of delivering actionable management recommendations, thereby constraining real-world adoption and scalability [5]. Against this backdrop, we propose DAPR-AM-Net (Dual-Attention Progressive Refinement with Adaptive MixUp), a unified framework for tomato leaf disease recognition and prediction. Unlike conventional approaches that treat attention mechanisms, data augmentation, and optimization strategies as independent enhancements, the proposed method is built upon a coupled learning paradigm, where feature representation, data augmentation, and decision optimization are jointly optimized within a closed-loop system. Specifically, DAPR-AM-Net introduces four tightly integrated components. First, a Dual-Attention Fusion Mechanism (DAFM) embeds channel and spatial attention into the EfficientNet-B0 backbone, enabling hierarchical feature recalibration. Second, Adaptive MixUp with Attention-Aware Sampling (AMAAS) establishes a novel interaction between data augmentation and feature learning, where mixing strategies are guided by attention-derived saliency, rather than random sampling. Third, a Progressive Feature Refinement strategy (PFR-DA) reformulates feature extraction as a multi-stage refinement process, allowing iterative interaction between low-level textures and high-level semantics. Finally, an Imbalance-Aware Multi-Objective Optimization (IAMOO) scheme integrates class-sensitive loss design and adaptive sampling into a unified optimization objective. Importantly, these components are not independent modules but are coordinated through a progressive learning–augmentation–optimization loop, transforming the conventional static pipeline into a dynamic, self-reinforcing learning framework. To enhance interpretability and real-world applicability, Grad-CAM visualizations are integrated with attention maps to form a dual-path, evidence-based explanation module. Furthermore, the proposed model is deployed within a smart-agriculture platform that provides disease-driven management services, including spraying and irrigation recommendations, meteorological monitoring, and agricultural question–answering. In contrast to prior studies focusing solely on model-level improvements, this work advances toward a methodological and system-level paradigm, delivering an interpretable, deployable, and operationally validated intelligent agriculture solution. The paper is organized as follows: Sect. "Related Work" reviews the related work in the field of plant disease identification, with particular emphasis on the strengths and limitations of existing approaches; Sect. "Materials and methods" elaborates on the processing methodology of the Tomato-DD dataset and the architectural design of the proposed DAPR-AM-Net model; Sect. "Experiments and Results" presents a detailed analysis of the experimental procedures and results, along with a thorough evaluation of the overall system; Sect. "Smart Agriculture System Design" provides a comprehensive description of the smart agriculture system design; Sect. "Discussion" discusses the implications and limitations of the present study; finally, Sect. "Conclusion" concludes the paper and offers perspectives on future research directions. Related work Methods for plant disease detection Deep learning–based approaches for plant disease detection have rapidly evolved from early transfer learning–driven classification models to more integrated frameworks incorporating detection, segmentation, and interpretability. Early studies demonstrated the effectiveness of pre-trained CNNs under limited data conditions, achieving high accuracy in benchmark datasets such as Plant-Village [9]. As application scenarios expanded from controlled laboratory environments to open-field and greenhouse conditions, lightweight networks and mobile deployment became prominent research directions. Several studies have proposed compact architectures suitable for edge devices, enabling real-time detection and on-site deployment, with an average accuracy of 98.32% [10]. Furthermore, classification using MobileNetV3-small yielded a test accuracy of approximately 99.50% [11]. TrioConvTomatoNet: novel CNN with triple conv layers per stage and SGD optimizer, achieves 99.39% accuracy in tomato leaf disease classification [12]. From an architectural perspective, attention mechanisms—such as channel, spatial, and hierarchical fusion designs—are widely adopted to enhance lesion-focused representation and robustness under complex backgrounds [13–15]. More recently, Transformer-based models have been explored for end-to-end plant disease detection, leveraging their ability to capture long-range dependencies and global feature representations with competitive detection and classification performance. For instance, the Plant Multi-Modal Vision Transformer (PMVT) attained accuracies of 93.6%, 85.4%, and 93.1% on wheat, coffee, and rice datasets, respectively [16]. On a large-scale plant disease dataset, the PD-TR model achieved the highest reported mAP of 56.3 [17]. In crop segmentation and lesion localization tasks, channel and spatial attention mechanisms have been proven to substantially enhance model sensitivity to tiny lesions and low-contrast targets, thereby improving segmentation accuracy and localization reliability [18–20]. In crop classification and crop mapping, attention-based feature weighting enables models to better focus on discriminative spectral bands or local morphological patterns, resulting in improved classification performance on multi-temporal remote sensing and hyperspectral data, with reported accuracies reaching 97.82% [21]. The combination of attention mechanisms with lightweight backbones enables accurate and efficient models for edge deployment, supporting real-time inference on resource-constrained platforms such as drones, mobile devices, and IoT nodes [22, 23]. To address complex backgrounds and long-tail distributions, attention mechanisms have been combined with data augmentation and domain adaptation to emphasize rare lesions and domain-specific features, thereby improving cross-domain generalization [24, 25]. One such method outperformed the current state-of-the-art (SOTA) and baseline approaches by a remarkable 13.67% in classification performance [26]. In crop health monitoring, attention-guided multi-scale fusion is widely used to integrate global context with local details, supporting accurate field-level mapping and precision spraying decisions. The proposed SSMR-Net, incorporating an Adaptive Feature Mapping Attention (AFMA) module, achieved superior weed and wheat segmentation performance on a custom dataset, with weed recognition precision of 0.774, IoU of 0.696, and mIoU of 0.865 [27]. On a constructed strawberry disease dataset, the proposed approach attained a recognition accuracy of 99.10% [28]. In temporal and spatio-temporal modeling, attention-equipped sequence models can automatically identify critical time steps and spectral bands, leading to improved short-term accuracy in yield forecasting and disease spread prediction [29–31]. Recent studies have also explored the application of artificial intelligence in challenging agricultural monitoring scenarios. For instance, Abdusalomov et al. (2025) [32]demonstrated that integrating advanced deep learning techniques can significantly improve detection accuracy in agricultural fire monitoring under complex environmental conditions. This highlights the importance of robustness and adaptability in real-world agricultural AI systems. Overall, attention mechanisms provide both consistent performance gains and practical pathways for model lightweighting, generalization, and interpretability. Future studies should focus on improving the efficiency and robustness of attention modules under challenging conditions and exploring their integration with plant physiological knowledge to develop more reliable and actionable agricultural vision systems. Data scarcity and class imbalance remain persistent challenges in crop disease detection. To mitigate these issues, data augmentation and hybrid sampling strategies, such as Balanced-MixUp, CutMix, and RICAP variants, have been shown to improve generalization for long-tail and few-sample classes across multimodal and multispectral datasets [33, 34]. For instance, the proposed PWDNet achieved 100% recall and 90% precision on a pine wilt disease test set [35], while another method attained classification accuracies of 99.79%, 92.59%, and 97.12% on two apple leaf datasets and one coffee leaf dataset, respectively [36]. In parallel, GAN-based augmentation and domain adaptation have been explored to alleviate domain shifts and improve model robustness across varying acquisition conditions. One representative study applied GAN-based image synthesis and augmentation to a small, severely imbalanced tomato leaf disease dataset, resulting in a 5.2% improvement in classification accuracy [37]. Recent reviews identify diffusion models as a more stable and high-quality alternative to GANs for agricultural image augmentation and multimodal analysis, particularly under resource constraints. In parallel, few-shot and low-shot learning frameworks have demonstrated strong recognition performance for rare diseases using only limited training samples; for example, a Vision Transformer equipped with PMF + FA modules delivered an average disease recognition accuracy of 90.12% [38]. Combining semi-supervised and few-shot learning has further alleviated the burden of labeled data scarcity, substantially boosting performance under low-sample regimes [39]. Despite recent advances, achieving robust cross-domain generalization with reduced annotation costs while maintaining accuracy and interpretability remains an open challenge. Motivated by this gap, DAPR-AM-Net integrates dual-attention–based progressive refinement with adaptive MixUp to improve long-tail and few-sample recognition, supporting a shift from passive diagnosis toward proactive disease prevention in intelligent agricultural systems. Explainable AI in agriculture As deep learning performance in agricultural applications continues to improve, explainable AI (XAI) has emerged as a key criterion for model trustworthiness. Recent research in agricultural vision emphasizes visual explanations, model validation, causal or symbolic interpretation, and user acceptance [40]. Visualization-based explainability methods, such as Grad-CAM and Integrated Gradients, are widely used in crop disease analysis to interpret model decisions, while comparisons with expert annotations help identify spurious features and inform data refinement and model retraining [41]. To enable quantitative evaluation of explainability, multiple works have proposed dedicated metrics and conducted user studies, aiming to transform “interpretability” from a subjective presentation into a measurable attribute, thereby assessing the trustworthiness and adoptability of model recommendations in agricultural contexts (e.g., by agronomists and farmers). Such research emphasizes that explanations should not only be “understandable” but also “actionable” [42, 43]. Causal inference [44] and symbolic reasoning have begun to be incorporated into agricultural decision-support systems to reveal mechanistic links between input features (e.g., meteorological, soil, or spectral indicators) and target outputs (e.g., disease risk, water demand), enabling models to support strategic interventions rather than merely providing “black-box” predictions. Causal modeling that integrates graph neural networks with attention mechanisms has shown promising results in crop growth and yield forecasting studies [45]. Despite rapid progress, agricultural XAI still faces challenges in explanation stability, integration with domain knowledge, and the conversion of insights into actionable management decisions. Future research should embed explainability into training objectives, design user-oriented interfaces, and establish standardized benchmarks to advance XAI from illustrative explanations toward decision-support systems [46]. Materials and methods Dataset description and preprocessing Dataset description In this study, two high-quality datasets were employed: the self-constructed Tomato-DD (Tomato Disease & Damage) dataset and the widely used publicly available Plant-Village dataset [47]. These datasets span real-world production and controlled experimental settings, enabling cross-domain training and generalization assessment under both high-interference and ideal conditions. This dual-domain design robustly evaluates the resilience and practical applicability of DAPR-AM-Net in complex tomato leaf disease scenarios. The self-constructed Tomato-DD dataset (View Data availability) is compiled from both independently collected field images and publicly available sources. It encompasses 11 major categories of tomato leaf diseases, including Bacterial Spot, Early Blight, Late Blight, Leaf Mold, Septoria Leaf Spot, Spider Mites, Target Spot, Tomato Yellow Leaf Curl Virus, Tomato Mosaic Virus, Healthy, and Powdery Mildew. Representative samples from the Tomato-DD dataset are shown in Fig. 1a, while Fig. 1b presents a radar chart illustrating the category distribution of tomato leaf diseases. Detailed statistics for each class are provided in Table 1. To enhance diversity, the Tomato-DD dataset spans multiple spatial scales, illumination conditions, occlusion levels, and background complexities. After rigorous re-annotation, it contains 48,584 images and realistically reflects field conditions, including ambiguous lesion boundaries, co-occurring symptoms, and environmental interference, providing a robust benchmark for evaluating model robustness and practical applicability. The left image shows example images of 11 types of tomato leaf diseases from our self-built Tomato-DD dataset (under different light conditions, backgrounds, and disease types). The right image is a radar map showing the distribution of the 11 types of tomato leaf diseases Table 1Detailed statistics for each category of the Tomato-DD datasetSerial numberDisease categoryNumberPercentage1Bacterial Spot5,68511.70%2Early Blight4,0988.44%3Late Blight5,81411.97%4Leaf Mold4,4459.15%5Septoria Leaf Spot5,39911.11%6Spider Mites1,7473.60%7Target Spot3,6887.59%8Tomato Yellow Leaf Curl Virus7,89416.25%9Tomato Mosaic Virus3,1106.40%10Healthy5,44811.21%11Powdery Mildew1,2562.59%Total1148,584100% Detailed statistics for each category of the Tomato-DD dataset PlantVillage is a benchmark dataset in agricultural vision, containing 54,305 images across 38 disease classes and 14 crop species, and is widely used for model pre-training and architecture optimization (Table 2). All images were captured under controlled, plain-background conditions with minimal noise and clear lesion textures, allowing PlantVillage to support effective learning of fundamental lesion patterns and serve as a solid foundation for initializing feature extraction in DAPR-AM-Net. Table 2Plant-village public dataset statistics tableSerial numberCrop categoryNumberPercentage1Apple3,1715.84%2Blueberry1,5022.77%3Cherry1,9063.51%4Corn3,8527.09%5Grape4,0627.48%6Orange5,50710.14%7Peach2,6574.89%8Pepper2,4754.56%9Potato2,1523.96%10Raspberry3710.68%11Soybean5,0909.37%12Squash1,8353.38%13Strawberry1,5652.88%14Tomato18,16033.44%Total1454,305100% Plant-village public dataset statistics table Data preprocessing To ensure robust model performance across diverse imaging conditions and varying noise levels, this study designs and implements a hierarchical data preprocessing pipeline during the training preparation stage. The detailed preprocessing operations are summarized in Table 3. The core components include: (1) standardized normalization procedures; (2) strong and noise-resilient data augmentation based on the Albumentations library; (3) Adaptive MixUp with Attention-Aware Sampling (AMAAS); and (4) an imbalance-aware sampling strategy (IAMOO). Table 3Summary of preprocessing and augmentation operations used in DAPR-AM-NetOperationParametersPurposeResize224 × 224Consistent with baseline model inputRandomBrightnessContrastLimit = 0.2–0.3Illumination perturbation simulationGaussianBlurLimit = 5–7Blur and sensor defocusGaussNoiseVar = 10–50Night shooting/Shadow noiseRandomRotate90/Flipp = 0.3–0.5Spatial geometric transformationCoarseDropout8 holes, 20 × 20Obstruction and damage simulationAMAASλ adaptiveAttention-Perception Hybrid EnhancementIAMOOClass-balanced samplingLong tail processing Summary of preprocessing and augmentation operations used in DAPR-AM-Net First, all images are resized to 224 × 224 and RGB channels are normalized, reducing inter-dataset statistical bias and enabling effective feature learning in DAPR-AM-Net. Second, to improve robustness in complex field conditions, a multi-level augmentation strategy is employed. Strong augmentation simulates illumination variation, noise, blur, occlusion, and structural loss, while a moderate scheme is used during training. A OneOf() mechanism introduces controlled randomness, enhancing robustness without distorting critical features. Third, building on the augmentation strategy, this study further incorporates an Adaptive MixUp with Attention-Aware Sampling (AMAAS). Unlike the conventional MixUp approach [48], AMAAS performs importance-adaptive pairing by leveraging the attention responses extracted from the model’s feature maps in the preceding stage. Samples with high-attention regions are preferentially mixed, directing learning toward true lesion areas. A dynamic resampling of the mixing coefficient λ aligns synthetic samples with realistic lesion distributions, thereby improving recall for minority classes and enhancing sensitivity to subtle or small lesions. Furthermore, to mitigate class imbalance in Tomato-DD, an imbalance-aware sampling strategy (IAMOO) increases the training frequency of rare classes, while targeted augmentations (CoarseDropout and noise perturbations) enhance their visual diversity. Together, these measures improve the accuracy and stability of long-tailed categories under realistic field conditions. Architecture of DAPR-AM-Net DAPR-AM-Net is an end-to-end visual diagnosis framework for tomato leaf disease identification, designed as a closed-loop learning system that tightly couples feature extraction, attention-driven refinement, data augmentation, and decision optimization. Rather than a conventional sequential pipeline, the framework operates as a mutually reinforced architecture, where each component dynamically influences the others. The backbone network is responsible for hierarchical feature extraction, while the proposed Dual Attention Fusion Mechanism (DAFM) serves as the core refinement unit. DAFM sequentially integrates SE channel attention and CBAM spatial–channel attention to progressively enhance disease-relevant representations. Building upon this, the Progressive Feature Refinement (PFR-DA) strategy introduces cross-layer interactions, enabling iterative refinement of features across different semantic levels. This transforms feature learning from a one-pass extraction process into a multi-stage adaptive refinement paradigm. During training, the framework further incorporates two tightly coupled mechanisms. The Adaptive MixUp with Attention-Aware Sampling (AMAAS) leverages attention feedback to guide semantically meaningful sample mixing, thereby forming a data–model co-adaptation process. Meanwhile, the Imbalance-Aware Multi-Objective Optimization (IAMOO) integrates weighted sampling and class-sensitive loss design into a unified objective, improving robustness under long-tailed distributions. Importantly, these components are not independently optimized; instead, they form a progressive learning loop, in which attention guides augmentation, augmentation influences feature learning, and optimization feedback further refines attention responses. During inference, the model outputs both disease probabilities and class activation heatmaps, enabling accurate diagnosis with intrinsic interpretability. The complete architecture is illustrated in Fig. 2. Detailed diagram of the overall structure of DAPR-AM-Net Formally, given an input image x, the model performs the mapping where F denotes the raw features extracted by the backbone, represents the features calibrated by dual attention, corresponds to the progressively refined discriminative features, and refers to the task heads (including the main classification head, auxiliary heads, and an optional temporal prediction head). To achieve both high accuracy and practical deployability, DAFM, PFR-DA, and AMAAS reuse the backbone outputs and attention maps during implementation to avoid redundant computation. All submodules interface via lightweight 1 × 1 convolutions or MLP units, ensuring compatibility with the baseline EfficientNet-B0 weights. In addition to the main classification loss , auxiliary losses (see Sect. Architecture of the PFR-DA Module on PFR-DA) are applied to several intermediate refinement layers, promoting consistent convergence from low-level semantics to high-level discrimination. The overall training objective is formulated as a multi-objective weighted sum: where denotes the mixed soft-label loss under AMAAS, denotes the attention consistency regularization (encouraging stable alignment between early-stage and refined attention responses), and denotes the parameter regularization term. The hyperparameters are tuned using multi-objective validation metrics (overall accuracy and minority-class recall) to align with the optimization goal of IAMOO. From an efficiency standpoint, the architecture introduces negligible parameter overhead through lightweight DAFM and PFR-DA modules, while maintaining effective training and inference under moderate computational resources. Architecture of the DAFM module The Dual Attention Fusion Mechanism (DAFM) is a lightweight attention module integrated after the EfficientNet-B0 backbone to enhance lesion-discriminative feature representations while preserving computational efficiency, and to provide reliable localized cues for subsequent progressive refinement (Fig. 3). In this study, DAFM is implemented as a sequential attention pipeline that first applies SE channel attention [49] for channel recalibration, followed by the CBAM channel attention and CBAM spatial attention [50] to form a composite channel–spatial attention module. Let the input feature map be denoted as . Architecture of the Dual Attention Fusion Mechanism (SE → Channel Attention → Spatial Attention), showing tensors shapes and operations The role of the SE block is to perform adaptive recalibration along the channel dimension. First, a global average pooling operation is applied to obtain the channel descriptor vector: This descriptor is then passed through a two-layer fully connected bottleneck and normalized using a Sigmoid activation [51] to generate the channel activation vector s: Finally, the original feature map is rescaled channel-wise: where ⊙ denotes element-wise multiplication with channel-wise broadcasting. Following SE, the CBAM module further refines both channel and spatial attention. The channel attention is computed through a shared multilayer perceptron (MLP) fed with both average-pooled and max-pooled channel descriptors: The resulting channel attention vector is then applied to the feature map via channel-wise multiplication: Subsequently, the spatial attention is generated by concatenating the spatial maps obtained from max-pooling and average-pooling along the channel dimension, followed by a convolutional layer: The final output of the CBAM block is therefore expressed as: In summary, the overall mapping of the DAFM module can be formulated as: This sequential design exploits SE-based channel importance as a structural prior to guide subsequent channel–spatial attention, allowing CBAM to focus on semantically reliable regions critical for precise lesion localization. Positioned between the backbone output and global average pooling, DAFM operates directly on feature maps without spatial rescaling, preserving compatibility with pretrained EfficientNet-B0 weights. Owing to its lightweight composition (SE fully connected layers and a shared MLP with a 7 × 7 convolution), the module introduces negligible parameters and computational overhead, with no observable impact on training speed or GPU memory usage. Architecture of the AMAAS module AMAAS extends conventional MixUp through attention-guided weighting, adaptive sampling of the mixing coefficient λ, and imbalance-aware difficulty weighting, ensuring that synthesized samples retain the semantic integrity of pathological regions and thereby improving recognition of complex lesions and long-tailed classes. The detailed architecture of AMAAS is illustrated in Fig. 4. The implementation of MixUp comprises four fundamental steps: (1) randomly selecting two samples for mixing; (2) generating the initial λ from a Beta distribution; (3) recalibrating λ through an adaptive resampling strategy; and (4) synthesizing mixed images and mixed labels. By leveraging intermediate attention maps, AMAAS elevates MixUp from pixel-level interpolation to a semantically guided augmentation strategy that emphasizes diagnostically salient regions, thereby enhancing robustness and discriminative performance in challenging agricultural disease recognition tasks. Overview of the AMAAS module including attention extraction, adaptive λ rescaling, and class-aware fusion Given two samples with their corresponding one-hot labels , the conventional MixUp operation is defined as: where the mixing coefficient is denoted as . However, conventional MixUp ignores attention-salient regions, applies a uniform mixing coefficient across classes, and may distort lesion semantics, limiting its effectiveness under long-tailed and fine-grained disease distributions. These limitations motivate the adoption of attention-guided and class-adaptive mixing strategies. In AMAAS, the mixing coefficient λ is no longer solely sampled from a Beta distribution; instead, it is refined using the model’s attention responses. Let the attention map corresponding to input be represented as , and the attention-based importance score is defined as: where a larger value indicates that the lesion regions are more salient and more informative for learning. AMAAS redefines the effective mixing coefficient as: Specifically, samples with strong attention responses (i.e., clear lesions) receive higher mixing weights, while noisy or background-dominated samples are down-weighted, preventing adverse optimization effects. Attention maps are extracted from the preceding epoch via DAFM, forming a closed-loop refinement process that progressively reinforces focus on diagnostically salient regions. In the Tomato-DD dataset, substantial sample disparities exist across different disease categories. To address this imbalance, AMAAS further incorporates a class–frequency–based dynamic reweighting mechanism , formulated as: where increases the mixing proportion for rare classes, thereby strengthening rare-class feature representations within the augmented samples. While the WeightedRandomSampler increases exposure frequencies for minority categories, AMAAS embeds this class-aware adjustment directly into the MixUp process, enabling enhanced semantic alignment during training. By jointly integrating attention-aware and class-aware modeling, the final mixed output is expressed as: Yielding several desirable properties: (1) improved preservation of lesion structural integrity; (2) heightened sensitivity to mild or early-stage symptoms; (3) fairer representation of rare categories; and (4) co-evolution with the model’s attention dynamics. Architecture of the PFR-DA module PFR-DA converts the channel–spatial attention produced by DAFM (SE → CBAM) into a learnable progressive refinement process, enhancing lesion discrimination and sensitivity to subtle or co-occurring symptoms. As shown in Fig. 5, it consists of multi-level feature extraction, attention-weighted reconstruction, and progressive loss regularization. Progressive Feature Refinement with Dual Attention (PFR-DA)—showing multi-scale feature extraction, attention weighting, gated cross-level fusion and auxiliary heads Let the set of feature maps produced by the backbone at stage L be denoted as ,. We use the backbone as the primary feature source and obtain comparable representations by applying GAP or a 1 × 1 projection to different layers. For engineering compatibility, the actual implementation employs the final backbone layer and its preceding shallow layer as a two-level feature hierarchy, ensuring controllable computational cost. For each layer feature , the DAFM generates the corresponding spatial attention and channel-attention vector . Based on these two attention components, we define the attention-weighted feature as: where ⊙ denotes an element-wise product with broadcasting across dimensions. This operation preserves the original spatial structure while amplifying the channels and locations deemed “important” by the model. To enable cross-level information flow and progressive refinement, PFR-DA further introduces cross-layer residual coupling and gated fusion. The fused output is defined as: where denotes the upsampling (or channel projection) that aligns higher-level features with the spatial resolution of the l layer. The gating coefficient is learned from the globally pooled representation of that layer (with σ denoting the Sigmoid function). This gating mechanism can be directly implemented through a lightweight MLP/Conv unit, allowing high-level semantic information to be progressively injected into lower-level texture representations, thereby forming a “top-down progressive refinement” process. To ensure that each refinement step consistently converges toward the discriminative objective, PFR-DA introduces a multi-level supervision strategy during training. Specifically, for several refinement outputs , a lightweight classification head is attached to each, and a corresponding classification loss is computed. The final loss is formulated as a weighted combination of the main task loss and the progressive refinement losses: Here, increases linearly with training epochs to implement a “shallow-layer auxiliary → deep-layer dominant” learning schedule. From an engineering perspective, these auxiliary heads can be easily integrated into the training loop, with their losses accumulated to construct the progressive constraints characteristic of PFR-DA. Architecture of the IAMOO module To address class imbalance and long-tailed distributions in tomato leaf disease recognition, we propose an Imbalance-Aware Multi-Objective Optimization (IAMOO) module. IAMOO jointly operates at the sampling, augmentation, and loss-optimization levels, balancing overall accuracy, per-class recall, and training stability. The detailed architecture is presented in Fig. 6. IAMOO Module Pipeline By computing the number of training samples in each class , we assign a weight to every sample in the dataset as: The computed weights are applied via a WeightedRandomSampler to increase the sampling frequency of rare classes, effectively compensating for class imbalance at the sample level and improving minority-class recall. IAMOO works cooperatively with AMAAS (Sect. Architecture of the AMAAS Module): in the adaptive λ re-scaling of MixUp, a class-frequency compensation factor (implemented as or a proportional variant) is incorporated, enabling the final mixing coefficient to account simultaneously for attention intensity and class rarity. Consequently, the contribution of rare classes is deliberately amplified within synthesized mixed samples, alleviating long-tailed class imbalance at the data-generation level. Formally: This strategy forms a dual imbalance-compensation mechanism by integrating the MixUp pathway with the WeightedRandomSampler. The training objective adopts cross-entropy with label smoothing as the foundational loss, and employs a mixed loss under MixUp to support soft-label learning: The synergy between label smoothing and MixUp enhances model calibration while mitigating overfitting, yielding a more stable accuracy–robustness trade-off. IAMOO further employs a multi-objective training schedule that tracks accuracy, loss, per-class recall, and F1 scores to guide model selection. Checkpoints are saved using a composite criterion that balances overall validation accuracy with minority-class recall. IAMOO integrates ReduceLROnPlateau with early stopping, with scheduling guided by the validation recall–accuracy trade-off, thereby prioritizing minority-class recall while maintaining overall performance. Training strategy and loss function Training strategy We propose a progressive training strategy that integrates adaptive augmentation, dual attention, and dynamic regularization to ensure stable and efficient convergence on heterogeneous data related to tomato leaf diseases. The corresponding training settings and hyperparameters are summarized in Table 4. Table 4Training configuration and hyperparameters used for DAPR-AM-NetParameter nameParameter valueInput size224 × 224Batch size64OptimizerAdamWInitial learning rate0.0005Weight decay1.0e-3Epochs100SchedulerReduceLROnPlateauEarly stopping patience20MixUp (AMAAS)0.1Label smoothing0.1SamplerWeightedRandomSampler Training configuration and hyperparameters used for DAPR-AM-Net We adopt an improved MixUp data augmentation technique, in which virtual training samples are constructed through linear interpolation within the feature space to enhance the model’s generalization capability. Given two randomly selected samples and , MixUp generates a new sample as follows: where , and α denotes the mixing coefficient. Unlike conventional MixUp, we incorporate an adaptive mixing coefficient of α =0.1, which is determined through grid search to achieve an optimal balance between feature diversity and training stability. During model training, the SE and CBAM dual-attention mechanisms operate collaboratively, refining feature representation from the channel and spatial dimensions, respectively. The SE module generates channel-wise importance weights through global average pooling: where σ denotes the Sigmoid activation, δ represents the ReLU activation, and are the weights of two fully connected layers. The CBAM module further integrates channel attention and spatial attention : This progressive attention optimization strategy enables the model to increasingly concentrate on the feature regions most relevant to disease diagnosis. We employ a ReduceLROnPlateau learning-rate scheduler that adaptively adjusts the learning rate based on the validation loss. When the validation loss fails to improve for two consecutive epochs, the learning rate is decayed by a factor of 0.4, formally expressed as: In addition, gradient clipping is introduced to prevent gradient explosion by constraining the gradient norm to not exceed 1.0: To address the class imbalance inherent in the tomato leaf disease dataset, we design a weighted random sampler in which the sampling weight assigned to each sample is inversely proportional to the number of samples in its class c: This strategy balances class distributions within each batch and improves recognition of minority diseases. Early stopping (patience = 20) is employed, and the final model is selected based on the best validation performance to ensure robust deployment. Loss function To jointly optimize overall accuracy, minority-class recall, and interpretability stability, training employs a weighted composite loss integrating MixUp soft-label loss, primary classification loss, auxiliary intermediate supervision, attention-consistency regularization, and standard regularizers. The mathematical expression is presented below: The term denotes the primary classification loss, where label-smoothed cross-entropy is employed to enhance model calibration and generalization. For the one-hot target vector corresponding to an individual sample x, label smoothing replaces it with where \varepsilon is the smoothing coefficient. To address class imbalance, sample weights are introduced, and the weighted cross-entropy is defined as: In which represents the model-predicted probability for class c. The term denotes the soft-label loss under MixUp. Given a pair of samples and the adaptive mixing coefficient produced by AMAAS, the mixed sample and mixed label are supervised using a weighted cross-entropy of the form: The term denotes the progressive auxiliary loss. In PFR-DA, lightweight classification heads are attached to several intermediate outputs , and auxiliary cross-entropy is computed as: where is a weight that increases with training epochs. The term represents the attention-consistency regularization. To ensure stable and interpretable attention behavior throughout training, we introduce an attention-consistency loss that aligns the attention maps produced by DAFM across different training stages or before and after data augmentation. A commonly used form is the L2 distance: where denotes the attention of the original input, and corresponds to the refined attention produced by PFR-DA. The term denotes parameter regularization, which incorporates regularization and gradient clipping to enhance training stability. Under strong augmentation or MixUp scenarios, a mixup-fallback mechanism is additionally activated (skipping MixUp when abnormal attention is detected) to prevent unstable gradients. The regularization term is expressed as: Algorithm description of DAPR-AM-Net To further improve the clarity, transparency, and reproducibility of the proposed framework, we provide a structured algorithmic description of the overall training and inference procedure of DAPR-AM-Net. Unlike conventional pipelines where feature extraction, data augmentation, and optimization are performed independently, the proposed method formulates these processes as a unified and coupled learning procedure, in which attention mechanisms, progressive refinement, and adaptive data augmentation are jointly optimized. To summarize the above procedure in a clear and reproducible manner, the complete training and inference workflow of DAPR-AM-Net is presented in Algorithm 1. As shown in Table 5 below. Table 5DAPR-AM-Net algorithm pseudocode DAPR-AM-Net algorithm pseudocode Experiments and results Experimental setup To ensure the credibility and reproducibility of our study, all model training procedures were conducted on two NVIDIA T4 GPUs (16 GB × 2) using the PyTorch deep learning framework (version 2.5.0) with Python 3.10.12. Detailed hardware and software configurations are summarized in Table 6. Throughout the training process, comprehensive logging was enabled to guarantee full transparency and traceability of all experimental operations. Table 6Experimental environment and training configurationCategoryProjectConfiguration detailsHardwareGPUNVIDIA T4(2 × 16 GB)CPUMulti-core processorsRAM30 GBstorageHigh-speed SSDSoftwareOSLinuxPython3.10.12PyTorch2.5.0 Experimental environment and training configuration To ensure rigorous and reproducible evaluation, a stratified three-way split with fixed random seeds was applied, dividing the data into training, validation, and test sets (70%/15%/15%) while strictly preserving class distributions. The detailed partitioning of the Tomato-DD dataset is presented in Table 7, and the corresponding partitioning of the Plant-Village dataset is provided in Table 8. StratifiedShuffleSplit was used to prevent data leakage and distributional bias. The training set optimized model parameters, the validation set supported tuning and early stopping, and the held-out test set was evaluated only once with the finalized model to report all metrics objectively. Table 7Detailed information on splitting the Tomato-DD dataset into training, validator, and test setsDataset categoriesPercentageDisease categoriesNumberSumTraining set70%Bacterial Spot397934,008Early Blight2869Late Blight4070Leaf Mold3111Septoria Leaf Spot3779Spider Mites1223Target Spot2582Tomato Yellow Leaf Curl Virus5526Tomato Mosaic Virus2177Healthy3813Powdery Mildew879Validation set15%11 categories72887288Test set15%11 categories72887288 Detailed information on splitting the Tomato-DD dataset into training, validator, and test sets Table 8Detailed information on splitting the Plant-Village dataset into training, validator, and test setsDataset categoriesPercentageCrop categoriesDisease categoriesNumberTraining set70%14 categories38 categories38,066Validation set15%14 categories38 categories8,150Test set15%14 categories38 categories8,150 Detailed information on splitting the Plant-Village dataset into training, validator, and test sets To ensure the robustness and generalization capability of the proposed model, a stratified fivefold cross-validation strategy was adopted. Specifically, the dataset was first split into a training-validation set (85%) and an independent test set (15%). The training-validation subset was further divided into five folds using StratifiedKFold, preserving class distribution consistency. For each fold, the model was trained on four folds and validated on the remaining fold. The final performance was reported as the average results across all folds. Model performance evaluation To comprehensively evaluate the performance of DAPR-AM-Net on the tomato leaf disease identification task, we computed overall Accuracy, Precision, Recall, and F1-score on the independent test set. Accuracy is defined as: which reflects the overall proportion of correctly classified samples. Precision and recall are defined as: where TP (true positives) denotes the number of positive samples correctly classified as positive, TN (true negatives) represents the number of negative samples correctly classified as negative, FP (false positives) corresponds to negative samples incorrectly predicted as positive, and FN (false negatives) refers to positive samples incorrectly predicted as negative. The F1-score, computed as the harmonic mean of precision and recall, provides a balanced measure of classification performance: Ablation study To quantify the contribution of each DAPR-AM-Net component, systematic ablation studies were conducted under identical training and validation settings. Core modules were selectively removed or substituted to isolate their effects, yielding eight experimental variants (A–H). All ablations were performed on the Tomato-DD dataset. We first evaluate the independent contribution of each proposed module. As shown in Table 9, the baseline model (Group A) achieves an Accuracy of 98.87%, a Precision of 98.98%, a Recall of 98.64%, and an F1-score of 98.81%. When the AMAAS and IAMOO modules are introduced (Group B), the model attains an Accuracy of 99.31%, a Precision of 99.31%, a Recall of 99.40%, and an F1-score of 99.35%. The AMAAS module dynamically adjusts the sample mixing ratio based on attention maps, enabling the model to better discriminate challenging boundary regions. Meanwhile, the IAMOO module addresses class imbalance through adaptive loss-weight modulation, substantially improving the recognition performance for minority disease categories. With the incorporation of the DAFM module (Group C), the model yields an Accuracy of 99.29%, a Precision of 99.14%, a Recall of 99.27%, and an F1-score of 99.20%. By jointly applying channel-wise and spatial attention, DAFM significantly enhances the model’s ability to perceive lesion-related texture, color, and structural patterns. When the PFR-DA module is introduced (Group D), the model achieves an Accuracy of 99.31%, a Precision of 99.20%, a Recall of 99.30%, and an F1-score of 99.25%. The PFR-DA module progressively refines feature representations through cross-hierarchical information flow, enabling deeper layers to preserve finer-grained discriminative details. Table 9Ablation study results on tomato-DD test setGroupModuleAccuracyPrecisionRecallF1-scoreParams/MAMAAS + IAMOODAFMPFR-DAA × × × 98.87%98.98%98.64%98.81%4.30B√ × × 99.31%99.31%99.40%99.35%4.30C × √ × 99.29%99.14%99.27%99.20%4.51D × × √99.31%99.20%99.30%99.25%4.51E√√ × 99.33%99.34%99.37%99.35%4.51F√ × √99.37%99.40%99.41%99.40%4.51G × √√99.37%99.19%99.40%99.29%4.72H√√√99.73%99.73%99.74%99.73%4.72 Ablation study results on tomato-DD test set We further investigate the synergistic effects arising from different combinations of modules. When the AMAAS, IAMOO, and DAFM modules are jointly applied (Group E), they exhibit a strong complementary effect in addressing class imbalance while simultaneously enhancing feature perception through the integration of channel and spatial attention. The model achieves an Accuracy of 99.33%, a Precision of 99.34%, a Recall of 99.37%, and an F1-score of 99.35%. When the AMAAS, IAMOO, and PFR-DA modules are combined (Group F), the class imbalance is first effectively mitigated, after which the PFR-DA module progressively refines feature representations via cross-hierarchical information flow. This configuration leads to improved detection of early-stage mild symptoms. The model attains an Accuracy of 99.37%, a Precision of 99.40%, a Recall of 99.41%, and an F1-score of 99.40%. When DAFM and PFR-DA are used together (Group G), the dual attention mechanism and progressive refinement strategy form a highly complementary pair. The foundational attention guidance provided by DAFM supplies a reliable direction for PFR-DA’s cross-level optimization, while PFR-DA further refines and strengthens the attention patterns. This configuration yields an Accuracy of 99.37%, a Precision of 99.19%, a Recall of 99.40%, and an F1-score of 99.29%. The full DAPR-AM-Net model, integrating all four proposed modules (Group H), achieves the best performance, reaching 99.73% Accuracy, 99.73% Precision, 99.74% Recall, and 99.73% F1-score. The confusion matrix of all ablation experiments is shown in Fig. 7. These results clearly demonstrate that the combined contributions of all modules substantially enhance the model’s robustness and adaptability across complex real-world conditions. Confusion matrix of ablation experimental models from group A to group H on the Tomato-DD test set Results analysis Quantitative analysis To comprehensively assess the performance of DAPR-AM-Net in the tomato leaf disease recognition task, we conducted a systematic quantitative evaluation. All experiments were performed on the same test set, which includes 10 categories of tomato leaf diseases as well as healthy leaves, comprising a total of 7,288 images. DAPR-AM-Net demonstrates outstanding overall performance on the test set, achieving an accuracy of 99.73% and an F1-score of 99.73%. These results substantially surpass those of conventional deep learning baselines, confirming the effectiveness of the proposed dual-attention progressive refinement framework. Notably, the model attains a recall of 99.74% while maintaining high precision, indicating a remarkable advantage in minimizing missed detections—an aspect that is particularly critical for early warning in agricultural disease management. The dynamic accuracy curve of DAPR-AM-Net is illustrated in Fig. 8. Accuracy dynamics curve of DAPR-AM-Net As shown in Table 10, the detailed per-class evaluation demonstrates that DAPR-AM-Net achieves an F1-score exceeding 99.00% in most disease categories. For the healthy class, the model attains an F1-score of 99.88%, indicating its strong ability to distinguish between healthy and diseased leaves and thereby avoid unnecessary pesticide application. In the recognition of Early Blight and Late Blight, two diseases with highly similar visual characteristics, the model achieves F1-scores of 99.35% and 99.71%, respectively, underscoring the effectiveness of the dual-attention mechanism in fine-grained feature discrimination. Regarding the common issue of class imbalance in agricultural datasets, DAPR-AM-Net delivers significant improvements through its imbalance-aware multi-objective optimization mechanism. For the Powdery Mildew class, which contains relatively few samples, the model still reaches an F1-score of 99.73%, representing a 2.43-point improvement over the baseline. For the Spider Mites class, also with a limited sample size, the model achieves an F1-score of 100.00%, outperforming the baseline by 0.57 points. From the perspective of precision–recall balance, the difference between precision and recall across all classes remains below 0.65%, indicating that the model maintains strong performance consistency across categories. Notably, recall values in minority classes are generally higher than precision, which is particularly advantageous in real-world agricultural scenarios—favoring minimal missed detections even at the cost of a small number of false alarms. Table 10Performance of baseline and DAPR-AM-Net across categories on the Tomato-DD test setModelDisease categoriesNumber (Test)AccuracyPrecisionRecallF1-scoreBaselineBacterial Spot85398.36%96.11%98.36%97.22%Early Blight61597.24%99.17%97.24%98.19%Late Blight87299.42%98.86%99.42%99.14%Leaf Mold66798.95%99.85%98.95%99.40%Septoria Leaf Spot81097.90%97.66%97.90%97.78%Spider Mites26299.24%99.62%99.24%99.43%Target Spot55399.82%100.00%99.82%99.91%Tomato Yellow Leaf Curl Virus1,18499.83%99.66%99.83%99.75%Tomato Mosaic Virus46699.14%99.35%99.14%99.25%Healthy81899.39%99.63%99.39%99.51%Powdery Mildew18895.74%98.90%95.74%97.30%DAPR-AM-NetBacterial Spot85399.53%99.65%99.53%99.59%Early Blight61599.02%99.67%99.02%99.35%Late Blight87299.89%99.54%99.89%99.71%Leaf Mold66799.70%99.85%99.70%99.77%Septoria Leaf Spot81099.63%99.26%99.63%99.45%Spider Mites262100.00%100.00%100.00%100.00%Target Spot553100.00%100.00%100.00%100.00%Tomato Yellow Leaf Curl Virus1,18499.92%99.92%99.92%99.92%Tomato Mosaic Virus46699.57%99.78%99.57%99.68%Healthy81899.88%99.88%99.88%99.88%Powdery Mildew188100.00%99.47%100.00%99.73% Performance of baseline and DAPR-AM-Net across categories on the Tomato-DD test set DAPR-AM-Net achieves a favorable balance between accuracy and computational efficiency, featuring a lightweight architecture with only 4.72 M parameters. In practical deployment scenarios, the model attains an end-to-end inference speed of 301.87 FPS on a standard GPU, where the reported performance comprehensively accounts for data preprocessing, model inference, and post-processing operations. This real-time capability satisfies the requirements of on-site agricultural monitoring and supports efficient large-scale field surveillance, making it well-suited for deployment in resource-constrained agricultural IoT environments. Qualitative analysis Building on the quantitative results, we perform a qualitative analysis to elucidate the internal mechanisms and decision logic of DAPR-AM-Net, thereby confirming its interpretability and practical relevance in real-world agricultural settings. Through the attention heatmaps generated by the Dual Attention Progressive Refinement (PFR-DA) mechanism, we gain an intuitive understanding of the model’s ability to localize key pathological cues. These heatmaps are produced by averaging the attention-weighted feature maps across the channel dimension and projecting the resulting activations back onto the original image space. They reveal the spatial intensity of the model’s focus on disease-related regions, thereby offering a transparent interpretation of the decision-making process. As illustrated in Fig. 9, during the identification of Late blight, the SE attention module first amplifies chromatic and textural descriptors of the lesion in the channel dimension. The subsequent CBAM module further sharpens this focus by precisely localizing the browned leaf margins and the characteristic concentric ring patterns in the spatial domain. This progressive refinement enables the model to effectively suppress healthy green tissue and concentrate computational resources on the most discriminative pathological structures. Notably, for early-stage symptoms—such as the small, localized lesions in the initial phases of Leaf Mold—the attention mechanism demonstrates a high degree of sensitivity. The model can accurately detect these subtle early lesions and assign them substantial attention weights, which explains its strong recall performance observed in the quantitative evaluations. Compared with traditional approaches, the attention regions produced by DAPR-AM-Net show a high degree of overlap with expert-annotated diagnostic areas, further validating the biological plausibility and interpretability of the model’s reasoning process. Attention heatmaps highlighting disease regions Through t-SNE–based dimensionality reduction of the learned feature representations (Fig. 10), we observe that DAPR-AM-Net forms compact intra-class clusters and clear inter-class separations within the feature space. The model exhibits a well-structured and tightly organized clustering pattern, where class boundaries are distinct and non-overlapping, indicating a highly discriminative feature representation capability. Samples with varying severity levels of the same disease display a continuous distribution trend in the feature space, suggesting that the model effectively captures the progressive characteristics of disease development. Particularly noteworthy is the behavior of visually similar yet pathologically distinct disease pairs such as Septoria_leaf_spot and Target_Spot. In the feature space of DAPR-AM-Net, these categories are separated by well-defined decision boundaries, demonstrating the effectiveness of the dual-attention mechanism in fine-grained feature discrimination. t-SNE visualization of feature embeddings extracted by DAPR-AM-Net Quantitative evaluation of explanation quality To comprehensively quantify the core performance of the proposed explainability method, this study conducts a multi-dimensional evaluation on the test set, focusing on two key metrics: Insertion AUC and Robustness (Cosine), with their sample distributions illustrated in Fig. 11. The experimental results demonstrate that the mean Insertion AUC is approximately 0.85, with a markedly right-skewed distribution. The peak density is concentrated within the 0.85–0.9 interval, and the median is slightly higher than the mean, with only a few low-value outliers observed. This indicates that the majority of samples exhibit strong positive explanatory capability, effectively identifying the critical regions underlying model decisions. In addition, the mean cosine robustness reaches 0.985, with an exceptionally narrow distribution range. Nearly all samples fall within the 0.96–1.0 interval, and no evident low-value outliers are observed. This provides compelling evidence that the proposed method exhibits remarkable resilience to input perturbations, ensuring highly stable and reliable explanation outcomes. Test set interpretability index distribution To rigorously assess the stability of the saliency maps generated by the proposed explainability method, this study evaluates input robustness by introducing Gaussian noise and quantifying the cosine similarity between saliency maps before and after perturbation. The results indicate that the mean robustness reaches 0.984, with a median of 0.986 and an interquartile range of [0.978, 0.991]. The overall distribution exhibits a pronounced right skew, with peak density concentrated around 0.99 and only a very small number of outliers. The corresponding sample distributions are illustrated in Fig. 12. These findings provide strong evidence that the saliency maps produced by the proposed method possess excellent resistance to input perturbations, thereby ensuring stable and reliable interpretability. Robustness of saliency plot to input noise Robustness analysis under environmental perturbations To further validate the practical deployability of DAPR-AM-Net in real-world greenhouse and field scenarios, we conducted a series of robustness tests by intentionally degrading the test images with Gaussian noise, motion blur, and varying brightness conditions. These perturbations simulate common challenges in agricultural imaging, such as sensor noise, camera shake, and non-uniform illumination. The detailed experimental results are summarized in Fig. 13. As shown, DAPR-AM-Net achieves a baseline accuracy of 99.67% on the original clean test set. When subjected to Gaussian noise (σ = 0.05), the accuracy slightly decreases to 99.27%, which is expected given the random corruption of fine-grained texture features. Remarkably, the model exhibits negligible performance degradation under motion blur (99.61%) and brightness changes (99.62%), with accuracy drops of less than 0.1% compared to the clean baseline. This exceptional stability can be attributed to two key design choices in our architecture: (1) The Dual-Attention Progressive Refinement (DAFM) mechanism, which emphasizes discriminative lesion areas even when edges are blurred; and (2) The Adaptive MixUp (AMAAS) strategy, which regularizes the model against synthetic distribution shifts during training. The robustness experiments under Gaussian noise, motion blur, and brightness variation demonstrate that the model can effectively handle common real-world perturbations. This robustness can be attributed to the attention-guided feature refinement and adaptive data augmentation strategies, which enhance the model’s ability to focus on disease-relevant regions under degraded conditions. Nevertheless, performance degradation under extreme perturbations highlights the inherent limitation of RGB-based approaches, particularly when dealing with subtle spectral differences. Model Robustness Against Corruptions Cross-validation results To further evaluate the robustness of the proposed DAPR-AM-Net, a fivefold cross-validation experiment was conducted. The results demonstrate consistent performance across all folds, with low standard deviation, indicating strong generalization ability. The cross-validation results confirm that the proposed model maintains stable performance across different data splits, indicating strong generalization capability within the dataset. Specifically, as shown in Fig. 14 below, the average Accuracy, Precision, Recall, and F1-score achieved were 99.64% ± 0.12%, 99.64% ± 0.12%, 99.64% ± 0.12%, and 99.64% ± 0.12%, respectively. fivefold cross-validation experiment results Comparative experiments with classical models To comprehensively and rigorously evaluate the performance of DAPR-AM-Net in tomato leaf disease recognition, we conducted systematic comparisons with five representative state-of-the-art models. For fairness and to ensure that each method achieved its optimal performance, all comparative models were moderately enhanced and equipped with consistent data augmentation strategies, closely aligning their training configurations with those of DAPR-AM-Net. The selected models encompass diverse architectural philosophies: DenseNet-169 [52] emphasizes feature reuse; EfficientNet-B3 [53] represents advances in compound scaling; VGG-19 [54] serves as a canonical deep stacked network; Xception [55] is built upon depthwise separable convolutions; and a custom-designed CNN baseline is included for reference. All experiments were conducted under identical train–validation–test splits, preprocessing protocols, and hardware environments to ensure strict fairness in comparison. In addition to these models, the proposed approach is further benchmarked against several cutting-edge classification methods, as summarized in Table 11. It is important to note that not all comparative results are strictly obtained under identical experimental conditions. Some baseline results are reported from the literature, where differences in datasets, sample sizes, preprocessing strategies, and evaluation protocols may affect performance. Therefore, these comparisons are intended to provide contextual reference rather than direct benchmarking. To ensure fairness, we emphasize that the most reliable comparisons are those conducted under the same dataset and experimental setup (i.e., Tomato-DD). Under these controlled conditions, the proposed DAPR-AM-Net consistently demonstrates competitive or superior performance compared with representative baseline models. Table 11Overall performance comparison between DAPR-AM-Net and advanced modelsModelDatasetTestAccuracyPrecisionRecallF1-scoreParams/MGFLOPsFPSDenseNet-169Tomato-DD728897.04%96.93%96.29%96.56%12.703.36219.54EfficientNet-B3Tomato-DD728899.16%99.24%99.09%99.16%11.191.80987.93self-built CNNTomato-DD728885.98%84.00%82.34%82.93%26.045.00768.39VGG-19Tomato-DD728897.19%96.64%96.47%96.55%139.6219.60411.64XceptionTomato-DD728896.19%95.79%95.29%95.44%20.868.40850.71DenseNet12 [9]Plant-Village480494.34%95.00%93.00%92.00%–––MS-Dnet [10]Paddy Leaf–98.32%92.75%92.75%92.75%–––SCSA-Transformer [28]Strawberry Leaf87099.10%97.77%98.47%97.75%24.2––RTL-Net[56]Plant-Village543099.04%98.69%98.39%98.52%2.20.24800ECA-ResNet[57]Tomato Leaf–99.24%99.23%–––––DIM[58]Tomato Leaf176193.63%––––––FWDGAN + B-ARNet[59]Tomato Leaf24098.75%98.75%98.75%98.75%–––EPDNet[60]Tomato leaf114993.62%–93.88%93.31%23.524.12–DE-NAS + ViT[61]Tomato leaf–96.05%96.12%96.08%96.05%–––DAPR-AM-NetTomato-DD728899.73%99.73%99.74%99.73%4.720.35301.87DAPR-AM-NetPlant-Village815099.85%99.78%99.84%99.81%4.720.35301.87① Rows 1–5 in the table show the classic models retrained and evaluated under exactly the same experimental conditions. This set of comparisons is the sole source of evidence for our claim of model superiority. ② Rows 6–14 present literature results reported under highly similar datasets and experimental conditions. This set of comparisons is used to provide academic context, but we explicitly indicate the differences in conditions in the main text. ③ Rows 15–16 are highlighted in bold, as they present the dataset and results of this study. Overall performance comparison between DAPR-AM-Net and advanced models ① Rows 1–5 in the table show the classic models retrained and evaluated under exactly the same experimental conditions. This set of comparisons is the sole source of evidence for our claim of model superiority. ② Rows 6–14 present literature results reported under highly similar datasets and experimental conditions. This set of comparisons is used to provide academic context, but we explicitly indicate the differences in conditions in the main text. ③ Rows 15–16 are highlighted in bold, as they present the dataset and results of this study. As shown in Table 11, DAPR-AM-Net achieves the highest overall recognition accuracy among all compared models, reaching 99.73% on the test set, with its confusion matrix presented in Fig. 7h. DenseNet-169 attains an accuracy of 97.04%, and its dense connectivity mechanism enables strong feature propagation and reuse, allowing it to capture complex lesion texture patterns effectively, making it one of the strongest baseline competitors. EfficientNet-B3, a larger variant within the EfficientNet family, achieves 99.16% accuracy, demonstrating the effectiveness of compound scaling (depth, width, and resolution) in improving model performance. In contrast, the custom-built CNN baseline achieves only 85.98% accuracy, highlighting the importance of deep architectures and carefully designed modules for handling agricultural disease identification tasks. VGG-19, a classical deep network, achieves an accuracy of 97.19%, and its strong representational capacity is reaffirmed in this task; however, its substantial parameter count (approximately 140 million) results in a bulky model with low computational efficiency. The Xception model, which leverages depthwise separable convolutions, achieves 96.19% accuracy, illustrating the potential of efficient convolutional designs in agricultural image analysis. Compared with the next-best model, EfficientNet-B3, DAPR-AM-Net achieves a 0.69-percentage-point improvement in accuracy. More importantly, in terms of macro F1 score—which evaluates performance fairness across all categories—DAPR-AM-Net reaches 99.73%, directly reflecting the effectiveness of the proposed IAMOO module in addressing class imbalance. We further validated the model on the full Plant-Village dataset, where it achieved 99.85% accuracy, 99.78% precision, 99.84% recall, and a 99.81% F1 score. The confusion matrix of all comparative experiments is shown in Figs. 15, and 16 shows the bar chart analysis of the performance indicators of each model. The confusion matrices of the comparative model on the Tomato-DD test set and Plant-Village are shown Bar chart analysis of comparative experiments Smart agriculture system design System architecture overview The proposed smart agriculture management system employs DAPR-AM-Net as its core diagnostic engine within an end-to-end application framework, delivering services ranging from image-based disease diagnosis and interpretable visualization to precision spraying, irrigation recommendations, meteorological alerts, and AI-assisted agricultural consultation. The overall system architecture is illustrated in Fig. 17. The system integrates PyTorch-based inference, Grad-CAM visualization, real-time meteorological data, and an extensible agricultural agent. A responsive web frontend ensures seamless access across mobile and desktop platforms. Smart agriculture system with DAPR-AM-Net model as the core engine As illustrated in Fig. 18, the system adopts a classical three-tier architecture comprising a presentation layer for image acquisition and interpretable diagnostic visualization, a business logic layer handling model inference, Grad-CAM generation, and AI-based agricultural consultation, and a data–service layer integrating model parameters, meteorological data, and domain knowledge to support irrigation forecasting, spraying-risk alerts, and hazard prediction. Smart Agriculture System Main Page Image The platform features cross-module linkage that synchronizes diagnostic outputs with spraying alerts to generate pesticide recommendations and optimal application windows in a structured and interpretable manner. A multi-turn AI agent enables in-depth consultation based on recent diagnostic context, while the installation-free design supports rapid on-site deployment. Importantly, rather than functioning as a fully autonomous decision-making system, the proposed platform is designed as an intelligent decision-support tool. It translates AI-driven diagnosis and interpretation into actionable suggestions that assist farmers and agronomists, while preserving human oversight in final decision-making, particularly in uncertain or high-risk scenarios. By integrating perception, reasoning, prediction, and expert-informed guidance within a unified framework, the system aligns with the core principles of Agriculture 5.0, emphasizing human-centered, reliable, and assistive intelligence for practical agricultural applications. Detailed module description The system integrates six tightly coupled functional modules, all orchestrated by DAPR-AM-Net outputs, forming an end-to-end decision pipeline that advances from disease identification to proactive management. Intelligent Disease Diagnosis and Interpretability Module.Users can capture or upload leaf images for real-time inference, after which the system displays the original image alongside the Grad-CAM heatmap, predicted disease class, confidence score, health status, and customized pesticide recommendations. (Fig. 19). When prediction confidence drops below 75%, the system automatically prompts users to submit additional multi-angle images to improve diagnostic reliability. Intelligent Disease Diagnosis and Interpretability Module. Users can capture or upload leaf images for real-time inference, after which the system displays the original image alongside the Grad-CAM heatmap, predicted disease class, confidence score, health status, and customized pesticide recommendations. (Fig. 19). When prediction confidence drops below 75%, the system automatically prompts users to submit additional multi-angle images to improve diagnostic reliability. Intelligent Pesticide Spraying Warning ModuleThe system fuses diagnostic outputs (disease type and confidence) with real-time meteorological data from Open-Meteo to compute a spray suitability index for the current day and the subsequent week. Values above 80 trigger immediate spraying recommendations with optimal time windows, whereas values below 40 prompt drift-risk warnings. An integrated pesticide database covering 11 disease categories supports one-click spray record generation, enhancing control efficacy while reducing environmental drift risks. Intelligent Pesticide Spraying Warning Module The system fuses diagnostic outputs (disease type and confidence) with real-time meteorological data from Open-Meteo to compute a spray suitability index for the current day and the subsequent week. Values above 80 trigger immediate spraying recommendations with optimal time windows, whereas values below 40 prompt drift-risk warnings. An integrated pesticide database covering 11 disease categories supports one-click spray record generation, enhancing control efficacy while reducing environmental drift risks. Intelligent Irrigation Forecasting Module.The system integrates real-time and seven-day meteorological data from Open-Meteo with a soil-moisture simulation model (extendable to field sensors) to generate three-day irrigation recommendations. The interface visualizes temperature trends, precipitation probability, estimated soil moisture, and irrigation history, supporting efficient and sustainable water management. Intelligent Irrigation Forecasting Module. The system integrates real-time and seven-day meteorological data from Open-Meteo with a soil-moisture simulation model (extendable to field sensors) to generate three-day irrigation recommendations. The interface visualizes temperature trends, precipitation probability, estimated soil moisture, and irrigation history, supporting efficient and sustainable water management. Meteorological Disaster Prediction Module.Based on seven-day forecasts from Open-Meteo, a threshold-driven early warning module identifies three major meteorological hazards: heavy rainfall (daily precipitation > 50 mm), drought (sustained temperatures > 35 °C without precipitation), and typhoons (wind speed > 10 m/s). The system dynamically reports hazard risk levels alongside targeted response recommendations, supporting proactive decision-making and preparedness for imminent extreme weather events. Meteorological Disaster Prediction Module. Based on seven-day forecasts from Open-Meteo, a threshold-driven early warning module identifies three major meteorological hazards: heavy rainfall (daily precipitation > 50 mm), drought (sustained temperatures > 35 °C without precipitation), and typhoons (wind speed > 10 m/s). The system dynamically reports hazard risk levels alongside targeted response recommendations, supporting proactive decision-making and preparedness for imminent extreme weather events. Diagram of the intelligent disease diagnosis and interpretation module Performance evaluation of the intelligent agriculture system System performance was rigorously evaluated on 40 CPU-only devices (Intel i5/i7 laptops without discrete GPUs). The proposed framework achieved an average per-image latency of 0.87 s, encompassing preprocessing, inference, and Grad-CAM visualization. On mobile platforms (iPhone and mainstream Android devices), mean latency was 1.12 s, with 90.9% of requests completed within 2 s, satisfying real-time field deployment requirements. Grad-CAM introduced only 0.21 s of overhead while enhancing model interpretability. Under 4G networks, average page load time was 3.46 s, with first-screen rendering under 2 s; system stability was maintained even below 1 Mbps via WebP compression and lazy loading. Consistency validation confirmed that system-level diagnostics fully preserved the accuracy of DAPR-AM-Net, with no performance degradation from deployment-side quantization or optimization. The pesticide spraying alert module effectively provided early warnings under high-risk conditions, reducing disease incidence and chemical input. The irrigation forecasting module, integrating Open-Meteo data with cumulative precipitation modeling, delivered accurate irrigation guidance and lowered water consumption, while the meteorological disaster module enabled proactive farmer responses through advanced extreme-event alerts. Compared with existing platforms, the proposed system achieves superior diagnostic accuracy, interpretability, and early-warning performance, enabling a tightly integrated decision-making pipeline that advances a single-image–driven, full-season management paradigm. The current implementation focuses on system design and functional validation, and does not yet include quantitative field trials to assess agronomic outcomes. Discussion This study proposes DAPR-AM-Net as an end-to-end framework linking interpretable feature learning, inference, and decision support. Beyond optimizing performance, the framework unifies attention modeling, attention-guided augmentation, progressive refinement, and imbalance-aware optimization, while embedding interpretability directly into the deployed platform. This design enables an auditable “evidence–recommendation–assistance” workflow, reducing adoption barriers and facilitating evidence-based decision-making in real-world agricultural practice. Scientifically, the integration of DAFM and PFR-DA establishes a channel–spatial–cross-layer attention loop that robustly localizes lesion regions under complex backgrounds, while AMAAS exploits attention feedback to form a self-reinforcing model–data–model augmentation process, improving recall for minority classes. From an engineering perspective, the study delivers a fully reproducible training-to-deployment pipeline with automated logging, class-wise evaluation, and checkpoint management, and seamlessly integrates inference, interpretability, and actionable recommendations into a practical decision-support system. Nevertheless, several practical limitations remain. Reliance on RGB imagery may constrain performance under adverse illumination or for spectrally subtle pathologies. Although IAMOO and AMAAS alleviate long-tail effects, overconfident errors may still arise for extremely rare or previously unseen diseases, which introduces potential risks in fully automated decision-making scenarios. Therefore, the proposed system is more appropriately positioned as a decision-support tool rather than a fully autonomous system. In real-world deployment, confidence-aware triggers, uncertainty estimation, or threshold-based alerting mechanisms should be incorporated to flag ambiguous or out-of-distribution samples for manual review. Moreover, while attention visualizations enhance interpretability, they should be jointly considered with confidence scores, historical observations, and meteorological context to avoid potential visual misinterpretation. This highlights the importance of maintaining a human-in-the-loop paradigm to ensure safe and reliable use. Based on these findings, we outline several directions for improvement. At the data level, multi-view and multi-spectral acquisition, together with guided multi-angle image upload, could enhance robustness. At the model level, extending PFR-DA to pixel- or instance-level segmentation may enable more precise lesion delineation under co-occurring diseases. At the system level, integrating active learning and online fine-tuning with expert feedback can support regional and temporal adaptation. To bridge this gap, future work should focus on conducting controlled field experiments and pilot studies, where the proposed system can be integrated into actual farming practices. Such studies may include A/B testing of management strategies, longitudinal monitoring of crop health, and quantitative evaluation using metrics such as pesticide usage reduction rate, disease incidence, and resource efficiency. In addition, recent advances in other complex classification domains have highlighted the growing importance of optimization-driven hybrid architectures, where heterogeneous model components are jointly optimized to enhance representation capacity and generalization. For example, hybrid frameworks that combine deep sequential modeling, convolutional feature extraction, and metaheuristic optimization—such as the BiLSTM–metaheuristic optimization with hybrid U-Net–MobileNetV2 encoder architecture proposed for sEMG-based gesture classification—have demonstrated strong performance in handling high-dimensional and nonlinear data distributions [62]. From an ethical and deployment perspective, staged pilot studies with agricultural stakeholders are recommended to incorporate human validation, risk assessment, and economic evaluation prior to large-scale adoption. Overall, DAPR-AM-Net moves beyond competitive metrics to establish an interpretable and practical paradigm for intelligent agriculture through human-centered, assistive, and risk-aware decision support. Future work will focus on multimodal integration, pixel-level refinement, and large-scale field validation to further enhance robustness and long-term deployability. In addition, domain adaptation and domain generalization techniques may be explored to further improve robustness when transferring from controlled datasets to real-world scenarios. Conclusion This study presents DAPR-AM-Net, an end-to-end visual diagnosis and decision-support framework for tomato leaf diseases, with integrated contributions at both algorithmic and engineering levels. Algorithmically, four complementary components—DAFM, AMAAS, PFR-DA, and IAMOO—are unified into a synergistic architecture spanning feature learning and training optimization, markedly improving discrimination under complex field conditions and recall for minority disease classes. From an engineering perspective, we further deploy the model within a smart agriculture platform that seamlessly integrates inference, interpretability, agronomic recommendations, and user interaction, forming a closed-loop workflow from model output to evidence-driven agricultural decision-making. Experimental results show that DAPR-AM-Net achieves near-optimal classification performance on the Tomato-DD test set, with overall metrics approaching 99.8%. Ablation and robustness analyses verify both the independent effectiveness and synergistic interactions of the proposed modules: DAFM enhances lesion-aware semantic representation, AMAAS preserves critical features under few-shot and noisy conditions, PFR-DA improves cross-depth feature consistency, and IAMOO alleviates long-tail–induced bias. Comprehensive visualization, logging, and checkpointing strategies further ensure training transparency, reproducibility, and the reliability of the reported conclusions. From an engineering standpoint, this work achieves a full translation from algorithmic design to field-ready deployment. Beyond image-level diagnosis, the system delivers intuitive interpretability, actionable recommendations, and expert feedback pathways, enabling human–machine collaboration and an active learning loop in real-world settings. This integrated implementation markedly improves model adoptability and lowers the institutional and cognitive barriers between laboratory research and agricultural practice. Despite these advances, several practical limitations remain. Reliance on RGB imagery constrains robustness under extreme illumination and spectral variability, motivating future integration of multispectral or near-infrared data. Large-scale deployment will further require continuous drift monitoring and online fine-tuning to address regional and temporal disease shifts. To avoid misinterpretation of attention maps, confidence-aware decision thresholds and human-in-the-loop validation should be incorporated to progressively and safely extend automated decision boundaries. In conclusion, DAPR-AM-Net advances both methodological design and engineering deployment by unifying interpretability, robustness, and imbalance-aware learning within an operational smart agriculture platform. Future work will extend toward multimodal integration, pixel-level lesion analysis, active learning, and large-scale field validation to establish a reliable and sustainable tool for precision agricultural disease management. Acknowledgements The authors would like to express their sincere and heartfelt gratitude to the editors and the anonymous reviewers of Plant Methods for the time, effort, and expertise they have generously devoted to the evaluation of our manuscript. We deeply appreciate their thoughtful and constructive comments, which have not only helped us identify important areas for improvement but have also significantly strengthened the clarity, rigor, and overall quality of the work. Their insightful suggestions have been invaluable in refining our methodology and presentation, ultimately contributing to a more robust and impactful manuscript. We are truly grateful for their professionalism, patience, and dedication throughout the review process. Author contributions Ran Wang: Data curation, Formal analysis, Investigation, Methodology, Software, Writing—original draft. Xiao Yu: Conceptualization, Funding acquisition, Resources, Vali-dation. Lina Lu: Project administration, Visualization. Cong Chen: Supervision, Writing—review and editing. Funding This work was funded by the National Social Science Fund of China (Grant No. 24BTQ031). Data availability No datasets were generated or analysed during the current study. Declarations Ethics approval and consent to participate Not applicable. Consent for publication All authors consent to the publication of this paper. 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 Associated Data Data Availability Statement No datasets were generated or analysed during the current study.