학술

CWF-YOLO11s: Context-aware and weak-boundary feature recalibration for tomato leaf abnormality detection in natural field scenes

PLOS ONE
CC BY
이 매체는 공공·자유 라이선스로 본문을 직접 표시합니다.

Figures
Abstract
Accurate detection of tomato leaf diseases in natural scenes is limited by large variation in lesion size, weak and gradual lesion boundaries, visually similar nutrient-deficiency symptoms, leaf occlusion, and background interference. To address these challenges, this study developed CWF-YOLO11s, an enhanced detector based on YOLO11s for six-category tomato leaf abnormality detection. The model introduces a context-aware feature neck module, CAFNeckLite, to recalibrate multi-scale fused features in the neck, and a weak-boundary feature recalibration module, WBFRHeadLite, before the P3 and P4 detection branches to enhance local texture and low-contrast boundary responses before prediction. On the Tomato-Village validation set, CWF-YOLO11s achieved an mAP50 of 0.8940 and an of 0.6153, representing improvements of 2.00 and 2.03 percentage points over YOLO11s, respectively. Under matched insertion locations, CAFNeckLite achieved higher overall mAP values than CBAM and ECA. On the additional Tomato Leaf Disease Detection dataset, CWF-YOLO11s achieved a Precision of 0.7147, Recall of 0.7290, mAP50 of 0.7371, and of 0.4415, outperforming YOLO11s by 10.22, 6.69, 7.93, and 3.24 percentage points, respectively. Runtime profiling showed an inference time of 6.599 ms/image and a throughput of 151.54 FPS for CWF-YOLO11s, compared with 5.782 ms/image and 172.94 FPS for YOLO11s. Overall, CWF-YOLO11s improves detection accuracy across both evaluated datasets, albeit with a measurable increase in computational cost.
Citation: Lv J, Zhang D, Zhang R, Hu J, Zhao C, Cheng L (2026) CWF-YOLO11s: Context-aware and weak-boundary feature recalibration for tomato leaf abnormality detection in natural field scenes. PLoS One 21(11): e0363466. https://doi.org/10.1371/journal.pone.0363466
Editor: Shuai Liu, Hunan Normal University, CHINA
Received: August 17, 2026; Accepted: November 9, 2026; Published: November 25, 2026
Copyright: © 2026 Lv et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: All data used in this article are obtained from the publicly available Tomato-Village dataset (https://github.com/mamta-joshi-gehlot/Tomato-Village) and the publicly available Tomato Leaf Dataset (https://data.mendeley.com/datasets/bpfd9cns5g/2).
Funding: This research funded by the Scientific and Technologial Innovation Programs of Higher Education Institutions in Shanxi (2024L058); Shanxi Scholarship Council of China (2025-125); Shanxi Agricultural University’s “Introduction of Talents Scientific Research Startup Project” (2023BQ28). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
Introduction
Tomato is an economically important crop in protected and open-field production. Fungal and viral diseases, insect feeding, and nutrient stress can produce necrotic lesions, chlorosis, marginal discoloration, mottling, or feeding trails on leaves. Manual scouting depends on operator experience and becomes inefficient at production scale, while early or low-contrast abnormalities may be overlooked. Automated region-level detection is nevertheless difficult in natural scenes because illumination, leaf occlusion, stems, soil, and symptom variability can all alter the visual appearance of the target.
Deep learning is widely used for visual tasks such as image classification, object detection, and visual object tracking. Occlusion and changes in target appearance pose challenges in visual object tracking [1] and are also relevant to detecting leaf abnormalities in natural agricultural scenes. In tomato crop monitoring, deep-learning studies have extended beyond image-level classification to object detection, which predicts both category and location. Two-stage detectors such as Faster R-CNN perform region-based localization and classification [2], whereas one-stage YOLO detectors use a unified prediction framework for real-time object detection [3]. Fuentes et al. applied Faster R-CNN, R-FCN, and SSD to detect tomato diseases and pests in natural scenes, illustrating the value of localizing affected regions rather than assigning only image-level labels [4]. Reviews and cross-condition studies have also cautioned that high accuracy on controlled-background images does not necessarily transfer to field conditions [5,6]. Region-level outputs can therefore provide a more actionable visual basis for symptom localization, severity assessment, and subsequent targeted management, provided that their evaluation reflects realistic variation.
Dataset composition determines how model performance should be interpreted. Tomato-Village was collected in real-world environments and its object-detection subset contains six target classes: Late Blight, Leaf Miner, Magnesium Deficiency, Nitrogen Deficiency, Potassium Deficiency, and Spotted Wilt Virus [7]. These labels span disease, pest damage, and nutrient stress rather than a single biological category. A controlled comparison of YOLOv8 through YOLOv12 found that YOLO11 provided a strong overall baseline on this dataset [8], and a separate YOLOv8 study showed that magnesium, nitrogen, and potassium deficiency regions form a distinct detection problem [9]. We therefore used the compact, multiscale YOLO11s implementation as the baseline and defined the task as region-level detection of tomato leaf diseases, pest damage, and nutrient deficiencies.
Recent tomato leaf detectors have addressed background interference, small lesions, occlusion, and feature attenuation through attention, multiscale fusion, contextual modeling, and improved bounding-box regression. These approaches address feature representation and localization, with geometric regression losses providing objectives that account for spatial relationships between predicted and ground-truth boxes [10]. Prior-knowledge attention and an additional small-object branch have been combined with multiscale features [11], while bidirectional feature pyramids and attention have been used to improve lesion representation across scales [12]. YOLO-FMDI redesigned the neck to strengthen cross-layer interaction [13]. BED-YOLO incorporated deformable convolution, bidirectional feature fusion, and multiscale attention for occluded or blurred symptoms [14]; DM-YOLO combined dynamic upsampling with improved regression constraints [15]; and YOLO-BSMamba integrated state-space modeling with global-local feature interaction [16]. These studies support the usefulness of channel selection, cross-scale interaction, and local-detail enhancement, but many modify several stages of the backbone, neck, and detection pipeline simultaneously. The separate contribution of low-overhead calibration at the fused neck outputs and at the inputs to the original detection layer remains less clearly characterized.
YOLO11-based tomato detectors have further emphasized multiscale and detail-aware design. WTAD-YOLO combined wavelet convolution, ADown, and DySample while reducing model size [17]. On Tomato-Village, TDD-YOLO and MSP-Net improved texture representation, attention, background suppression, and cross-layer fusion [18,19]. A recent benchmark also compared object detectors on a real-world tomato leaf dataset [20]. Motivated by this line of work, we asked whether two localized interventions could improve the feature stream while preserving the YOLO11s backbone and its original detection layer.
We developed CWF-YOLO11s with two complementary modules. CAFNeckLite calibrates the P3, P4, and P5 fusion outputs by combining local modeling with channel weighting, whereas WBFRHeadLite recalibrates the P3 and P4 features immediately before they enter the detection layer. We evaluated the complete model through comparisons with representative detectors, class-wise analysis, component ablations, regression-loss sensitivity, random-seed stability experiments, and evaluation on an additional field-image dataset. Qualitative detection results and Grad-CAM visualizations were further used to analyze the model’s prediction behavior and spatial feature responses.
Materials and methods
Dataset and preprocessing
The object-detection subset of the Tomato-Village dataset was used as the experimental dataset in this study [7]. The dataset contains tomato leaf images acquired under natural environmental conditions, including variations in illumination, leaf pose, occlusion, and background complexity. Compared with image-level classification, object detection requires the simultaneous prediction of target categories and spatial locations, placing higher demands on fine-grained feature representation, localization accuracy, and robustness to complex backgrounds.
The original object-detection dataset contained 14,368 images. During data screening, 109 images without valid target annotations were excluded, resulting in 14,259 images retained for the experiments. Because the excluded images contained no valid annotated target instances, the total number of labeled instances remained unchanged. The retained dataset covers six target categories: Late Blight, Leaf Miner, Magnesium Deficiency, Nitrogen Deficiency, Potassium Deficiency, and Spotted Wilt Virus. All images are stored in JPG format with a spatial resolution of pixels. Rather than using an official predefined split, the retained dataset was randomly partitioned by us into training, validation, and test subsets at an approximate ratio of 8:1:1, using a fixed random seed of 42. This resulted in 11,401 training images, 1,429 validation images, and 1,429 test images. The training subset was used for model parameter optimization, the validation subset for model selection and comparative analysis, and the independent test subset was reserved exclusively for final performance evaluation.
The six target categories in Tomato-Village exhibit substantial differences in visual morphology. Leaf Miner is typically characterized by elongated and irregular serpentine feeding trails, whereas Late Blight and Spotted Wilt Virus often appear as patch-like or mottled abnormal regions. Magnesium, Nitrogen, and Potassium Deficiencies exhibit visually similar symptoms such as chlorosis, discoloration, and leaf-margin abnormalities. Consequently, the dataset presents several challenging characteristics, including small and densely distributed targets, weak or irregular boundaries, inter-class visual similarity, leaf occlusion, and interference from complex natural backgrounds.
Before model training, the correspondence between image files and YOLO-format annotation files was checked to ensure annotation consistency. Images without valid target annotations were excluded, while abnormal bounding boxes and incorrect class indices were screened. The class indices and normalized bounding-box coordinates of the retained samples were standardized to maintain a consistent annotation format. All images were maintained at pixels, which was also adopted as the network input resolution during training. The statistical distribution of annotation instances across the three subsets is summarized in Table 1.
The dataset exhibits a substantial class imbalance across the six target categories. To preserve the original data distribution and ensure a fair comparison among different models, no class-weighting strategy, class-specific resampling, or Focal Loss was employed. To improve the robustness of the detection models under varying imaging conditions, five data augmentation techniques were applied to the Tomato-Village training set, including horizontal flipping, random rotation, brightness adjustment, noise addition, and contrast adjustment. These transformations increased the diversity of leaf orientations, illumination conditions, image noise, and contrast levels. The same augmentation settings were adopted for all compared models to ensure experimental consistency. No data augmentation was applied to the validation or test subsets.
As illustrated in the center point distribution heatmap in Fig 1(a), the bounding box centers are predominantly concentrated in the central region of the image and disperse toward the surrounding boundaries. This indicates that while the main leaf structure typically lies within the primary field of view, the affected or abnormal regions exhibit spatial randomness and dispersion. Furthermore, the normalized width and height distribution map in Fig 1(b) reveals that the bounding box dimensions are heavily skewed toward lower value intervals, with a sparse distribution of larger targets extending along the main diagonal. These distribution characteristics demonstrate that the dataset encompasses both tiny lesions and large-area spreading targets, thereby placing dual demands on the network for high-resolution local feature representation and effective multi-scale feature fusion mechanisms.
(a) Center point distribution heatmap (x, y), showing the spatial location of bounding box centers. (b) Normalized width and height distribution map (width, height), illustrating target scale variations.
To further evaluate the proposed model on an independently sourced dataset, the Tomato Leaf Disease Detection dataset was introduced as an additional benchmark [21]. The dataset contains tomato leaf images collected under natural field conditions in Bangladesh, with variations in illumination, leaf appearance, and background complexity. The publicly available version comprises 689 images and 2,278 bounding-box annotations covering seven categories: Early Blight, Black Spot, Late Blight, Leaf Mold, Bacterial Spot, Target Spot, and Healthy. The dataset provides object-level bounding-box annotations, enabling the evaluation of both disease category recognition and spatial localization under natural field conditions. The annotations were prepared in YOLO format for model training and evaluation. The dataset follows its original partition, comprising 597 training images, 61 validation images, and 31 test images. Both YOLO11s and CWF-YOLO11s were trained and evaluated using the same data partition to ensure a fair comparison.
Overall architecture of CWF-YOLO11s
YOLO11s is the lightweight variant of the YOLO11 architecture, comprising a backbone for hierarchical feature extraction, a neck for multiscale feature aggregation, and a detection head for classification and bounding-box regression. Specifically, the backbone integrates Conv, C3k2, SPPF, and C2PSA modules. To precisely evaluate the impact of our architectural modifications, the backbone and original detection head were left unaltered, restricting structural interventions strictly to the neck-derived feature representation and the input to the detection head.
Although the baseline YOLO11s natively supports multiscale detection, the fused features generated by the neck often suffer from irrelevant background noise—such as leaf veins, soil, stems, or illumination artifacts. Furthermore, fine-grained local details, including subtle texture and edge cues, tend to attenuate as features pass through progressive fusion operations. To address these limitations, CWF-YOLO11s introduces feature recalibration at these critical processing stages, enhancing feature representations fed into the detection head and improving overall prediction performance.
The complete architecture is shown in Fig 2. CAFNeckLite was placed at the P3, P4, and P5 neck outputs to model local neighborhoods and recalibrate the fused features. WBFRHeadLite was placed on the higher-resolution P3 and P4 branches immediately before the unchanged detection layer. The term “Lite” refers to the use of relatively low-overhead operations within the proposed modules and does not indicate a reduction in the overall model complexity compared with the baseline.
WBFRHeadLite prediction-feature recalibration
Fused features output by the neck network often retain residual background noise, while local texture and edge cues are prone to attenuation during multiscale propagation. These limitations severely impede the precise localization of elongated structures, transitional regions, and low-contrast anomalies. To tackle this challenge, we introduce the Weak-Boundary Feature Recalibration Head Lite (WBFRHeadLite) module prior to the entry of the P3 and P4 feature branches into the detection head. This module specifically recalibrates the feature representations fed into the prediction head, thereby enhancing the model’s expressiveness in regions with blurred boundaries and low contrast (Fig 3).
The WBFRHeadLite module consists of four core steps: channel mapping, channel recalibration, local detail modeling, and residual fusion. First, the input feature x is mapped to a foundational feature x0 via a convolution to unify the channel dimensions. Subsequently, drawing upon the channel recalibration mechanism [22], x0 undergoes Global Average Pooling (GAP), followed by a convolution and a Sigmoid activation function to compute a channel weight vector w. The weight vector w is then multiplied by x0 element-wise along the channel dimension to yield the recalibrated feature , enabling the network to adaptively adjust the contribution of each feature channel based on global context responses.
Next, is fed into the local detail branch. This branch employs a depthwise separable convolution structure comprising a depthwise convolution and a pointwise convolution: the former captures local texture and boundary variations within spatial neighborhoods, while the latter facilitates cross-channel information interaction. Finally, the detail features extracted by the local modeling branch are further processed by a output-projection convolution and then combined with the foundational feature x0 through residual fusion to produce the final output y [23]. This residual connection not only preserves the original shallow semantic and spatial structure information, but also effectively maintains the stability of feature propagation across deeper layers. The operational definition is as shown in Eqs (1)–(4):
(1)(2)(3)(4)where denotes the input feature map with C, H, and W representing the channel dimension, height, and width, respectively; represents the base feature map after channel mapping; denotes the channel weight vector; is the recalibrated feature map; ⊙ indicates channel-wise element-wise multiplication; and corresponds to the final module output. Specifically, Eq (1) performs channel dimension mapping, Eq (2) generates the adaptive channel weights, Eq (3) executes channel recalibration, and Eq (4) integrates depthwise spatial modeling, pointwise cross-channel interaction, output projection, and residual fusion to produce the final enhanced feature representation.
It should be noted that WBFRHeadLite functions as a predictive feature recalibration unit inserted prior to the detection head, rather than constituting a standalone detection head. The incorporation of convolutions and depthwise convolutions effectively constrains the additional computational overhead [24].
CAFNeckLite context-aware recalibration of fused neck features
The original neck combines shallow texture and deeper semantic information through upsampling, downsampling, and feature aggregation. However, within the fused outputs, target-relevant features and background responses (such as leaf veins, soil, and illumination artifacts) often remain mixed.
To address this limitation, the Context-Aware Feature Neck Lite (CAFNeckLite) module was designed and inserted after each of the P3, P4, and P5 fusion outputs (Fig 4). While adhering to the multiscale aggregation logic of feature pyramid and path aggregation networks [25,26], CAFNeckLite incorporates scale-specific local modeling and channel calibration. By leveraging global channel responses to recalibrate local features, it aims to highlight channels associated with abnormal regions while attenuating background interference.
The CAFNeckLite module consists of four core computational steps: channel alignment, context weight generation, local feature modeling, and residual fusion. First, the input feature map x is mapped through a convolution to align channel dimensions and re-project features, yielding the baseline feature map x0, as expressed in Eq (5):
(5)Subsequently, global average pooling (GAP) is applied to x0, followed by a convolution and a Sigmoid activation function to compute the channel context weight vector w. This mechanism captures global inter-channel dependencies to modulate channel-wise responses, as formulated in Eq (6):
(6)In the local feature branch, a depthwise separable convolution—combining a depthwise convolution () for spatial neighborhood modeling and a pointwise convolution () for cross-channel interaction—is performed on x0 to extract the local feature map , as given in Eq (7):
(7)Next, the local feature map is modulated by the global channel weight w via element-wise multiplication, producing the channel-context-calibrated local feature map , as defined in Eq (8):
(8)Finally, is combined with the baseline feature map x0 through element-wise addition within a residual connection to obtain the output feature map y, as shown in Eq (9):
(9)By integrating these steps, the module preserves the underlying feature representation while performing adaptive channel-wise modulation of local texture responses driven by global contextual information. Here, and denote the extracted local feature map and the calibrated feature map, respectively. Eqs (5)–(9) sequentially correspond to channel alignment, context weight generation, local spatial and channel modeling, feature calibration, and residual fusion.
Finally, CAFNeckLite and WBFRHeadLite share a low-overhead channel-spatial modeling operator, yet they target fused feature quality and prediction input feature representation, respectively, by employing distinct operational orders and deployment strategies. CAFNeckLite first extracts local information from the fused neck output and subsequently calibrates these local responses using context-derived channel weights. Conversely, WBFRHeadLite first recalibrates the prediction input along the channel dimension before supplementing it with local spatial information. Considering the high spatial resolution of the P3 and P4 branches, and to constrain computational overhead, WBFRHeadLite is deployed exclusively on these two branches. The ablation study evaluates the individual and joint effects of both modules.
Experimental Setup and Evaluation Metrics
The experimental environment was built on Ubuntu, with Python 3.8, PyTorch 2.0.0, and CUDA 11.8. Model training was conducted using the Ultralytics framework (version 8.4.60). The primary training hyperparameters are listed in Table 2.
All YOLO11s-based models were trained using Ultralytics v8.4.60 with optimizer = auto, which automatically selected MuSGD because the estimated number of training iterations exceeded 10,000. Inference efficiency was evaluated on the same NVIDIA GeForce RTX 4080 SUPER GPU using input images of pixels under an identical timing protocol for all compared models. Inference latency was reported in milliseconds per image, and FPS was calculated as the reciprocal of the measured per-image latency, expressed in seconds. To ensure comparability among the evaluated detectors, all models were trained and evaluated using the same dataset partition, input resolution of , and standardized evaluation metrics. The same training and validation subsets were used for all models, and the non-maximum suppression IoU threshold was set to 0.7 during evaluation. Each architecture was initialized using its corresponding official pretrained weights. The principal experimental settings were kept consistent whenever applicable, whereas architecture-specific optimization settings were configured according to the standard requirements of their respective implementations.
To evaluate detection performance, Precision (P), Recall (R), and Mean Average Precision (mAP50 and ) were adopted in this study. Additionally, the number of parameters (Params), floating-point operations (FLOPs), inference latency, and frames per second (FPS) were reported to characterize model scale, theoretical computational complexity, and runtime efficiency. Specifically, Precision denotes the proportion of correctly identified targets among all positive predictions, whereas Recall represents the fraction of ground-truth targets successfully detected by the model. Their mathematical formulations are expressed in Eq (10) and Eq (11), respectively:
(10)(11)where TP, FP, and FN denote the numbers of true positives, false positives, and false negatives, respectively.
Average Precision (AP) is defined as the area under the Precision–Recall curve for a single category, while mean Average Precision (mAP) represents the average AP across all categories. Specifically, mAP50 adopts an IoU threshold of 0.50, primarily reflecting detection performance under a relatively lenient localization criterion. In contrast, averages AP over IoU thresholds from 0.50 to 0.95 in increments of 0.05 and therefore places stricter requirements on bounding-box localization. The corresponding definitions are given in Eqs (12)–(14):
(12)(13)(14)where denotes the AP for the i-th class, with and representing precision and recall for class i, respectively, and denoting precision as a function of recall. N represents the total number of target categories. is the AP of class i at IoU = 0.50, while denotes the AP at threshold t. Accordingly, mAP50 is averaged across all categories at IoU = 0.50, whereas is averaged across all categories and the ten IoU thresholds from 0.50 to 0.95.
Results
Comparison with representative detectors
To evaluate the comprehensive detection performance of CWF-YOLO11s, we compared CWF-YOLO11s with Faster R-CNN, DETR, RT-DETR-L, YOLOv5s, YOLOv8s, YOLOv10s and YOLO11s [2,27–32]. These models represent two-stage convolutional, transformer-based end-to-end, and one-stage YOLO detection paradigms. Table 3 reports the results on the Tomato-Village validation set together with model complexity and runtime measurements.
As presented in Table 3, under the unified experimental setting, DETR exhibits relatively low overall performance, whereas RT-DETR achieves comparable metrics to YOLOv10s. Notably, YOLO11s outperforms all other evaluated baseline models, achieving the highest Precision, Recall, mAP50, and . Consequently, YOLO11s is selected as the baseline architecture for our proposed method.
On this basis, the proposed CWF-YOLO11s achieves Precision, Recall, mAP50, and scores of 0.9061, 0.8339, 0.8940, and 0.6153, respectively, outperforming all compared models. These results indicate that combining neck-output calibration with prediction-input recalibration improves the overall detection performance of YOLO11s under the current experimental setting. Relative to YOLO11s, CWF-YOLO11s increases parameters by 14.88% and FLOPs by 13.95%; latency increases from 5.782 to 6.599 ms/image, while throughput decreases from 172.94 to 151.54 FPS.
To further compare the detection performance of different models across varying confidence thresholds, Fig 5 presents the Precision–Recall (PR) curves obtained on validation set. Overall, CWF-YOLO11s maintains a relatively higher PR curve over most of the recall range, followed by YOLO11s, while the remaining detectors show different degrees of performance degradation. In particular, CWF-YOLO11s preserves comparatively high precision in the medium-to-high recall region, indicating a favorable trade-off between precision and recall. This trend is broadly consistent with the mAP50 results reported in Table 3 and provides additional visual evidence of the overall performance differences among the evaluated detectors.
Class-wise detection performance
To analyze the performance variations across different categories, we evaluate the AP50 and scores of YOLO11s and CWF-YOLO11s on the validation set, as summarized in Table 4. Class-wise AP is simultaneously influenced by factors such as object detection, confidence ranking, and bounding box localization, thereby serving as an effective indicator to identify the primary sources of overall mAP improvements.
As observed in Table 4, CWF-YOLO11s achieves improvements in both AP50 and across the majority of categories. Notably, the most substantial gain is achieved in Potassium Deficiency, where AP50 increases from 0.8080 to 0.8907 (+0.0827) and increases from 0.5700 to 0.6227 (+0.0527). This category features a limited number of instances, and its visual symptoms—such as leaf margin chlorosis and localized necrosis—are susceptible to lighting variations and background texture interference. These findings demonstrate that our proposed architecture yields pronounced performance gains for this challenging category under the current validation set; however, this should not be overgeneralized as an equivalent enhancement across all low-frequency classes.
Although Leaf Miner possesses significantly more instances than other categories, its score remains relatively low. This indicates that the detection difficulty stems not only from sample size, but also from its intrinsic visual characteristics, namely irregular serpentine feeding trails that easily blend with leaf veins and shadows. CWF-YOLO11s improves the of Leaf Miner from 0.5130 to 0.5338, suggesting that predicted input recalibration helps refine bounding box localization for slender and irregular objects. Meanwhile, Late Blight, Nitrogen Deficiency, and Spotted Wilt Virus also exhibit varying degrees of improvement.
For Magnesium Deficiency, AP50 decreased slightly from 0.9230 to 0.9185, whereas increased from 0.6600 to 0.6685. This indicates that CWF-YOLO11s achieved slightly lower detection performance at an IoU threshold of 0.50 but improved average performance across the evaluated IoU thresholds. The improvement in suggests more favorable detection performance across the combined IoU criteria, including stricter overlap requirements, although these aggregate metrics alone cannot isolate the contribution of localization accuracy from that of confidence ranking.
Ablation study
As shown in Table 5, individually introducing CAFNeckLite into the baseline model improves mAP50 and from 0.8740 and 0.5950 to 0.8816 and 0.6034, respectively. This performance gain demonstrates that applying local modeling and channel calibration to the neck fusion outputs effectively enhances multi-scale feature representation.
When WBFRHeadLite is integrated individually, the Precision, mAP50, and reach 0.9018, 0.8873, and 0.6107, respectively. The performance gain of this single module surpasses that of CAFNeckLite, indicating that channel recalibration and local feature modeling at the input of the prediction head provide a more substantial contribution to the current task.
Furthermore, incorporating both CAFNeckLite and WBFRHeadLite yields Precision, Recall, mAP50, and values of 0.9061, 0.8339, 0.8940, and 0.6153, respectively—representing improvements of 0.0171, 0.0039, 0.0200, and 0.0203 over the baseline YOLO11s, and achieving the best overall performance in Table 5. Although the parameter count increases from 9.41 M to 10.81 M and FLOPs rise from 21.5 G to 24.5 G, and the observed accuracy gain was accompanied by approximately 14.9% more parameters and 14.0% more theoretical computation. However, these results demonstrate that the combined architecture successfully achieves higher detection accuracy at the cost of a modest computational overhead.
Comparison with conventional attention mechanisms
To compare CAFNeckLite with conventional attention modules under matched conditions, CBAM [33] or ECA [34] was inserted at the same P3, P4, and P5 neck-output locations, while WBFRHeadLite, the remaining model components, the dataset split, and the training configuration were kept unchanged. The results are summarized in Table 6.
CAFNeckLite improves mAP50 and by 1.01 and 1.37 percentage points over CBAM, and by 1.49 and 2.38 percentage points over ECA, respectively. CBAM yields the highest Recall, whereas CAFNeckLite provides the best overall mAP under the matched configuration.
To further compare the detection performance under different module configurations, Fig 6 presents the Precision–Recall (PR) curves of the YOLO11s baseline, YOLO11s+CAFNeckLite, YOLO11s+WBFRHeadLite, and CWF-YOLO11s. With the incorporation of either CAFNeckLite or WBFRHeadLite, the PR curve shifts upward relative to the baseline, indicating improved precision across a broad range of recall levels. Among the two individual modifications, YOLO11s+WBFRHeadLite exhibits a more favorable precision–recall trade-off than YOLO11s+CAFNeckLite. When both modules are incorporated, CWF-YOLO11s consistently maintains the highest precision over most of the recall range, with a particularly pronounced advantage at higher recall levels. Overall, CWF-YOLO11s exhibits the most favorable PR profile among the evaluated configurations. These observations are consistent with the quantitative results in Table 5, suggesting that CAFNeckLite and WBFRHeadLite each contribute to improved detection performance, while their combination provides a further performance improvement under the evaluated experimental conditions.
Sensitivity to bounding-box regression loss
To evaluate the impact of bounding box regression constraints on model performance, sensitivity experiments were conducted using CIoU, EIoU, WIoU, and SIoU [35–38], while keeping the network architecture of CWF-YOLO11s and all other training configurations identical. The results are summarized in Table 7.
This experiment is intended solely to examine the sensitivity of the proposed model to different bounding box regression loss functions. As presented in Table 7, WIoU achieves the highest of 0.6190, whereas EIoU yields the highest Precision of 0.9160, albeit at the expense of Recall, which decreases to 0.8242. SIoU exhibits a slightly higher Recall compared to CIoU. These results indicate that different loss functions demonstrate distinct trade-offs across performance metrics. To maintain a unified and consistent baseline configuration for both module ablation and comparative analyses, the default CIoU loss of YOLO11s is retained for the primary experiments reported in the main text.
Training dynamics and random-seed stability
Fig 7 illustrates the training dynamics of YOLO11s and CWF-YOLO11s, with red and green curves representing the proposed model and the baseline model, respectively. For both models, the validation bounding box regression losses decrease rapidly during early training iterations and gradually stabilize in later stages without obvious divergence. Furthermore, the proposed model achieves a consistently lower validation bounding box loss () in the final epochs, while maintaining higher overall trajectories for Precision, Recall, mAP50, and . These results demonstrate that the training process of CWF-YOLO11s is stable and yields superior convergence behavior.
(a) Validation box loss. (b) Precision. (c) Recall. (d) mAP50. (e) . Red denotes CWF-YOLO11s and green denotes YOLO11s.
To assess the sensitivity of CWF-YOLO11s to random weight initialization and data loading sequences, independent training runs were conducted under three different random seeds (42, 3407, and 2025), while maintaining identical dataset splits, network architectures, training epochs, and primary hyperparameters. All three runs were evaluated on the same held-out Tomato-Village test set. The results are summarized in Table 8.
As presented in Table 8, CWF-YOLO11s achieved a mean mAP50 of and a mean of across three random seeds on the Tomato-Village test set. The low standard deviations indicate consistent detection performance across the three independent runs.
Performance evaluation on the additional tomato leaf disease dataset
The performance of YOLO11s and CWF-YOLO11s was compared on a test set comprising 31 images from the independently sourced Tomato Leaf Disease Detection dataset under a matched evaluation protocol. The results are summarized in Table 9.
As shown in Table 9, CWF-YOLO11s increased Precision from 0.6125 to 0.7147 and Recall from 0.6621 to 0.7290, representing gains of 10.22 and 6.69 percentage points, respectively. The concurrent improvements indicate a more favorable balance between the precision of the detections and coverage of annotated targets. Meanwhile, mAP50 increased from 0.6578 to 0.7371 and from 0.4091 to 0.4415, corresponding to gains of 7.93 and 3.24 percentage points, respectively. The smaller gain in suggests that performance under more stringent overlap criteria remains relatively challenging. Taken together, these results show that the proposed model also outperforms its YOLO11s baseline on this additional dataset.
Fig 8 presents detection results for three representative images from the test set. In the first sample, both models identify the prominent damaged region, but CWF-YOLO11s produces a more compact bounding box and raises the prediction confidence from 0.54 to 0.90. In the second sample, YOLO11s produces an additional large prediction with a confidence score of 0.29 extending into the background, which is absent from the CWF-YOLO11s output; several corresponding small-region predictions also receive higher confidence scores from the proposed model. In the third sample, multiple dispersed leaf spots are detected by both models, with generally higher confidence for the corresponding regions under CWF-YOLO11s. These examples illustrate changes in box extent, confidence assignment, and responses to small abnormal regions, complementing the aggregate comparison in Table 9.
The upper row (a–c) shows YOLO11s predictions, and the lower row (d–f) shows CWF-YOLO11s predictions.
Grad-CAM was further used to examine spatial response patterns on three other representative leaf images from the same test set (Fig 9). In the first sample, YOLO11s displays scattered high-response areas on the leaf and in the surrounding background, whereas CWF-YOLO11s emphasizes several localized regions near visible leaf abnormalities. In the second sample, the proposed model shows distinct responses at multiple small spots in the central and lower parts of the leaf, while the baseline responses are weaker and less extensive over these areas. The third sample shows a similar pattern, with CWF-YOLO11s responding to several discrete spot-like regions, although activation is also visible along leaf margins and in portions of the background. The visualizations indicate a redistribution of model responses toward local symptom-related regions in these examples, in line with the purpose of the two feature-recalibration modules; they are interpreted as qualitative support rather than a direct measure of localization accuracy.
From left to right, each row shows the original image, the YOLO11s activation map, and the CWF-YOLO11s activation map.
Discussion
CWF-YOLO11s improved all four aggregate detection metrics relative to YOLO11s under a fixed Tomato-Village dataset. The ablation results indicate that recalibration at both processing stages contributed: CAFNeckLite improved the fused neck representations, and WBFRHeadLite produced the larger single-module gain when applied to the high-resolution prediction inputs. Their combined use produced the highest mAP values, which is consistent with complementary rather than redundant effects. This interpretation is limited to the observed ablation pattern.
The class-wise results further qualify the aggregate improvement. Potassium Deficiency showed the largest gain despite being the least frequent class, whereas Magnesium Deficiency showed a small decrease in AP50 and an increase in . Leaf Miner remained difficult under strict localization criteria despite its large number of instances. These differences suggest that class frequency alone does not explain performance and that morphology, boundary irregularity, symptom similarity, and background context also influence detection.
The controlled attention comparison shows that the improvement is not reproduced to the same extent by simply inserting CBAM or ECA at the same neck-output locations. CAFNeckLite achieves the highest mAP50 and under the matched configuration, supporting the use of its combined local modeling and context-aware channel recalibration.
The accuracy gain is accompanied by a measurable efficiency cost. Relative to YOLO11s, CWF-YOLO11s increases parameters by approximately 14.9% and FLOPs by approximately 14.0%, while latency increases from 5.782 to 6.599 ms/image and throughput decreases from 172.94 to 151.54 FPS on the RTX 4080 SUPER.
The additional dataset exhibited greater performance improvements over the corresponding YOLO11s baseline than Tomato-Village, although its absolute mAP scores remained lower. This difference suggests that dataset characteristics may influence both detection difficulty and the magnitude of the improvements achieved through feature recalibration.
Conclusion
This study developed CWF-YOLO11s for region-level detection of tomato leaf diseases, pest damage, and nutrient deficiencies in natural-field scenarios. By introducing CAFNeckLite at the fused neck outputs and WBFRHeadLite immediately before the high-resolution prediction branches, the proposed model improved mAP50 and by 2.00 and 2.03 percentage points, respectively, compared with YOLO11s under the same experimental protocol. Ablation experiments confirmed the complementary contributions of the two modules, while the controlled comparisons with CBAM and ECA showed that CAFNeckLite achieved the highest overall mAP under matched conditions.
On the additional Tomato Leaf Disease Detection dataset, CWF-YOLO11s achieved improvements of 10.22, 6.69, 7.93, and 3.24 percentage points in Precision, Recall, mAP50, and , respectively, over YOLO11s. These results demonstrate the effectiveness of the proposed approach on two independently sourced tomato leaf datasets. Despite the improvements in detection performance, accurate localization of small and irregular abnormal regions remains challenging, particularly under stricter IoU thresholds. Future work will investigate model compression techniques, including pruning, quantization, and knowledge distillation, and further evaluate model performance using field images collected across different locations, seasons, and imaging conditions.
References
- 1. Chen Z, Peng C, Liu S, Ding W. Visual object tracking: Review and challenges. Appl Soft Comput. 2025;177:113140.
- 2. Ren S, He K, Girshick R, Sun J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans Pattern Anal Mach Intell. 2017;39(6):1137–49. pmid:27295650
- 3.
Redmon J, Divvala S, Girshick R, Farhadi A. You Only Look Once: Unified, Real-Time Object Detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2016. p. 779–88.
- 4. Fuentes A, Yoon S, Kim SC, Park DS. A Robust Deep-Learning-Based Detector for Real-Time Tomato Plant Diseases and Pests Recognition. Sensors (Basel). 2017;17(9):2022. pmid:28869539
- 5. Jelali M. Deep learning networks-based tomato disease and pest detection: a first review of research studies using real field datasets. Front Plant Sci. 2024;15:1493322. pmid:39524561
- 6. Ahmad A, Gamal AE, Saraswat D. Toward Generalization of Deep Learning-Based Plant Disease Identification Under Controlled and Field Conditions. IEEE Access. 2023;11:9042–57.
- 7. Gehlot M, Saxena RK, Gandhi GC. “Tomato-Village”: a dataset for end-to-end tomato disease detection in a real-world environment. Multimedia Systems. 2023;29(6):3305–28.
- 8. Ramos LT, Sappa AD. A comprehensive analysis of YOLO architectures for tomato leaf disease identification. Sci Rep. 2025;15(1):26890. pmid:40707664
- 9.
Li C, Zhang D, Yuan F. Research on Detection of Magnesium, Nitrogen, and Potassium Deficiencies in Tomato Leaves Based on YOLOv8. In: 2025 5th International Conference on Mechanical Automation and Electronic Information Engineering (MAEIE). IEEE; 2025. p. 533–6.
- 10. Li C, Liu K, Liu S. A Survey of Loss Functions in Deep Learning. Mathematics. 2025;13(15):2417.
- 11. Liu J, Wang X. Tomato disease object detection method combining prior knowledge attention mechanism and multiscale features. Front Plant Sci. 2023;14:1255119. pmid:37877077
- 12. Wang Y, Zhang P, Tian S. Tomato leaf disease detection based on attention mechanism and multi-scale feature fusion. Front Plant Sci. 2024;15:1382802. pmid:38654901
- 13. Sun H, Nicholaus IT, Fu R, Kang D-K. YOLO-FMDI: A Lightweight YOLOv8 Focusing on a Multi-Scale Feature Diffusion Interaction Neck for Tomato Pest and Disease Detection. Electronics. 2024;13(15):2974.
- 14. Wang Q, Yan N, Qin Y, Zhang X, Li X. BED-YOLO: An Enhanced YOLOv10n-Based Tomato Leaf Disease Detection Algorithm. Sensors (Basel). 2025;25(9):2882. pmid:40363318
- 15. Abulizi A, Ye J, Abudukelimu H, Guo W. DM-YOLO: improved YOLOv9 model for tomato leaf disease detection. Front Plant Sci. 2025;15:1473928. pmid:40007767
- 16. Liu Z, Guo X, Zhao T, Liang S. YOLO-BSMamba: A YOLOv8s-Based Model for Tomato Leaf Disease Detection in Complex Backgrounds. Agronomy. 2025;15(4):870.
- 17. Yao J, Li Y, Xia Z, Nie P, Li X, Li Z. WTAD-YOLO: A lightweight tomato leaf disease detection model based on YOLO11. Smart Agric Technol. 2025;12:101349.
- 18. Chen Z, Bian Z, Li L, Dai C, Ji Z, Ganchev I. TDD-YOLO: A novel model for precise detection of tomato diseases. PLoS One. 2026;21(5):e0334989. pmid:42172292
- 19. Kang F, Wang L, Li H, Su Y, Chen R, Wu Q, et al. MSP-Net: An Effective Multi-Scale Feature-Aware Detection Network for the Detection of Tomato Leaf Diseases. Plants (Basel). 2026;15(5):711. pmid:41829742
- 20. Ruhad FM, Fahim M, Hossain MS, Monir MdF, Islam A, Amin MA. Beyond classification: Benchmarking object detection models for efficient tomato leaf disease identification on a real-world dataset. Smart Agric Technol. 2025;12:101336.
- 21. Imtiaz A, Swapnil FBI, Masud SR, Karmaker D. Tomato leaf dataset: A dataset for multiclass disease detection and classification. Data Brief. 2025;60:111520. pmid:40255326
- 22.
Hu J, Shen L, Sun G. Squeeze-and-excitation networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2018. p. 7132–41.
- 23.
He K, Zhang X, Ren S, Sun J. Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2016. p. 770–8.
- 24.
Chollet F. Xception: Deep learning with depthwise separable convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2017. p. 1251–8.
- 25.
Lin TY, Dollár P, Girshick R, He K, Hariharan B, Belongie S. Feature pyramid networks for object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2017. p. 2117–25.
- 26.
Liu S, Qi L, Qin H, Shi J, Jia J. Path Aggregation Network for Instance Segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2018. p. 8759–68. https://doi.org/10.1109/cvpr.2018.00913
- 27.
Carion N, Massa F, Synnaeve G, Usunier N, Kirillov A, Zagoruyko S. End-to-End Object Detection with Transformers. In: Computer Vision – ECCV 2020. vol. 12346 of Lecture Notes in Computer Science. Springer; 2020. p. 213–29.
- 28.
Zhao Y, Lv W, Xu S, Wei J, Wang G, Dang Q, et al. DETRs Beat YOLOs on Real-time Object Detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2024. p. 16965–74.
- 29.
Jocher G. Ultralytics YOLOv5. Ultralytics. Version 7.0. Software repository. 2020. Available from: https://github.com/ultralytics/yolov5
- 30.
Jocher G, Chaurasia A, Qiu J. Ultralytics YOLOv8. Ultralytics. Version 8.0.0. Software repository. 2023. Available from: https://github.com/ultralytics/ultralytics
- 31.
Wang A, Chen H, Liu L, Chen K, Lin Z, Han J, et al. YOLOv10: Real-Time End-to-End Object Detection. In: Advances in Neural Information Processing Systems. Vol. 37. 2024. p. 107984–8011. https://doi.org/10.52202/079017-3429
- 32.
Jocher G, Qiu J. Ultralytics YOLO11. Ultralytics. Version 11.0.0. Software repository. 2024. Available from: https://github.com/ultralytics/ultralytics
- 33.
Woo S, Park J, Lee JY, Kweon IS. Cbam: Convolutional block attention module. In: European conference on computer vision. Springer; 2018. p. 3–19.
- 34.
Wang Q, Wu B, Zhu P, Li P, Zuo W, Hu Q. ECA-Net: Efficient channel attention for deep convolutional neural networks. In: 2020 IEEE/CVF conference on computer vision and pattern recognition (CVPR). IEEE; 2020. p. 11531–9.
- 35. Zheng Z, Wang P, Liu W, Li J, Ye R, Ren D. Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression. AAAI. 2020;34(07):12993–3000.
- 36. Zhang Y-F, Ren W, Zhang Z, Jia Z, Wang L, Tan T. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing. 2022;506:146–57.
- 37.
Tong Z, Chen Y, Xu Z, Yu R. Wise-IoU: Bounding Box Regression Loss with Dynamic Focusing Mechanism. 2023. Available from: https://arxiv.org/abs/2301.10051
- 38.
Gevorgyan Z. SIoU Loss: More Powerful Learning for Bounding Box Regression. 2022. Available from: https://arxiv.org/abs/2205.12740

관련 뉴스