Submitted:
01 July 2026
Posted:
01 July 2026
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Materials
2.1.1. Data Acquisition
2.1.2. Dataset Annotation, Partition, and Single-Object Augmentation
2.2. Overall Architecture and Design of SG-RTDETR
2.3. Saliency-Guided Feature Encoder
2.4. Frequency-Aware Detail Preservation
2.5. Context-Aware Feature Organization
2.6. Spatially Adaptive Cross-Scale Fusion
2.7. Quality Focal Loss (QFL)
2.8. Experimental Setup
3. Results
3.1. Evaluation Metrics
3.2. Impact of Single-Object Sample Introduction and Augmentation Strategies on Model Performance
3.3. Training Dynamics of SG-RTDETR
3.4. Ablation Studies
3.5. Ablation and Mechanism Analysis of SGFE
3.5.1. Sensitivity Analysis of Token Retention Ratio
3.5.2. Effect of Saliency-Guided Token Selection
3.5.3. Impact of Token Retention Policies
3.5.4. Effect of Residual Spatial Refill Strategy
3.5.5. Qualitative Analysis of Saliency-Guided Token Scoring and Residual Refill
3.6. Frequency- and Spatial-Domain Validation of FADP
3.7. Visualization of Mid-Level Feature Responses with CAFO
3.8. Quantitative Comparison Between CAFO and Typical Attention Mechanisms
3.9. Comparison with Other Models
3.10. Visualization of Detection Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Akter, T.; Bhattacharya, T.; Kim, J.H.; Kim, M.S.; Baek, I.; Chan, D.E.; Cho, B.K. A comprehensive review of external quality measurements of fruits and vegetables using nondestructive sensing technologies. Journal of Agriculture and Food Research 2024, 15, 101068. [CrossRef]
- Chang, S.; Zhang, M.; Kong, D.; Mujumdar, A.S. Artificial intelligence-driven postharvest quality control of fruit and vegetable products: intelligent detection, optimization strategies and application prospects. Food Bioscience 2025, 74, 108004. [CrossRef]
- Chuquimarca, L.E.; Vintimilla, B.X.; Velastin, S.A. A review of external quality inspection for fruit grading using CNN models. Artificial Intelligence in Agriculture 2024, 14, 1–20. [CrossRef]
- Ma, J.; Wan, Y.; Min, W.; Ma, Z.; Tan, L.; Jiang, S. Frontiers and advances of deep learning-based fruit and vegetable image analysis. Computers and Electronics in Agriculture 2026, 241, 111256. [CrossRef]
- Lu, Y.; Saeys, W.; Kim, M.; Peng, Y.; Lu, R. Hyperspectral imaging technology for quality and safety evaluation of horticultural products: a review and celebration of the past 20-year progress. Postharvest Biology and Technology 2020, 170, 111318. [CrossRef]
- Yang, C.; Guo, Z.; Fernandes Barbin, D.; Dai, Z.; Watson, N.; Povey, M.; Zou, X. Hyperspectral imaging and deep learning for quality and safety inspection of fruits and vegetables: a review. Journal of Agricultural and Food Chemistry 2025, 73, 10019–10035. [CrossRef]
- Afonso, M.; Fonteijn, H.; Fiorentin, F.S.; Lensink, D.; Mooij, M.; Faber, N.; Polder, G.; Wehrens, R. Tomato fruit detection and counting in greenhouses using deep learning. Frontiers in Plant Science 2020, 11, 571299. [CrossRef]
- Gao, J.; Zhang, J.; Zhang, F.; Gao, J. LACTA: a lightweight and accurate algorithm for cherry tomato detection in unstructured environments. Expert Systems with Applications 2024, 238, 122073. [CrossRef]
- Gu, Z.; Ma, X.; Guan, H.; Jiang, Q.; Deng, H.; Wen, B.; Zhu, T.; Wu, X. Tomato fruit detection and phenotype calculation method based on the improved RTDETR model. Computers and Electronics in Agriculture 2024, 227, 109524. [CrossRef]
- Koirala, A.; Walsh, K.B.; Wang, Z.; McCarthy, C. Deep learning–method overview and review of use for fruit detection and yield estimation. Computers and Electronics in Agriculture 2019, 162, 219–234. [CrossRef]
- Solimani, F.; Cardellicchio, A.; Dimauro, G.; Petrozza, A.; Summerer, S.; Cellini, F.; Renò, V. Optimizing tomato plant phenotyping detection: boosting YOLOv8 architecture to tackle data complexity. Computers and Electronics in Agriculture 2024, 218, 108728. [CrossRef]
- Zhang, W.; Wang, J.; Liu, Y.; Chen, K.; Li, H.; Duan, Y.; Wu, W.; Shi, Y.; Guo, W. Deep-learning-based in-field citrus fruit detection and tracking. Horticulture Research 2022, 9, uhac003. [CrossRef]
- Wang, A.; Qian, W.; Li, A.; Xu, Y.; Hu, J.; Xie, Y.; Zhang, L. NVW-YOLOv8s: an improved YOLOv8s network for real-time detection and segmentation of tomato fruits at different ripeness stages. Computers and Electronics in Agriculture 2024, 219, 108833. [CrossRef]
- Zeng, T.; Li, S.; Song, Q.; Zhong, F.; Wei, X. Lightweight tomato real-time detection method based on improved YOLO and mobile deployment. Computers and Electronics in Agriculture 2023, 205, 107625. [CrossRef]
- Bresilla, K.; Perulli, G.D.; Boini, A.; Morandi, B.; Corelli Grappadelli, L.; Manfrini, L. Single-shot convolution neural networks for real-time fruit detection within the tree. Frontiers in Plant Science 2019, 10, 611–622. [CrossRef]
- Kang, H.; Chen, C. Fast implementation of real-time fruit detection in Apple orchards using deep learning. Computers and Electronics in Agriculture 2020, 168, 105108. [CrossRef]
- Da Costa, A.Z.; Figueroa, H.E.; Fracarolli, J.A. Computer vision based detection of external defects on tomatoes using deep learning. Biosystems Engineering 2020, 190, 131–144. [CrossRef]
- Ireri, D.; Belal, E.; Okinda, C.; Makange, N.; Ji, C. A computer vision system for defect discrimination and grading in tomatoes using machine learning and image processing. Artificial Intelligence in Agriculture 2019, 2, 28–37. [CrossRef]
- Huang, Y.; Xiong, J.; Yao, Z.; Huang, Q.; Tang, K.; Jiang, D.; Yang, Z. A fluorescence detection method for postharvest tomato epidermal defects based on improved YOLOv5m. Journal of the Science of Food and Agriculture 2024, 104, 6615–6625. [CrossRef]
- Xue, S.; Li, Z.; Wang, D.; Zhu, T.; Zhang, B.; Ni, C. YOLO-ALDS: an instance segmentation framework for tomato defect segmentation and grading based on active learning and improved YOLO11. Computers and Electronics in Agriculture 2025, 238, 110820. [CrossRef]
- Cai, X.; Zhu, Y.; Liu, S.; Yu, Z.; Xu, Y. FastSegFormer: a knowledge distillation-based method for real-time semantic segmentation of surface defects in navel oranges. Computers and Electronics in Agriculture 2024, 217, 108604. [CrossRef]
- Nanda, M.A.; Saukat, M.; Yusuf, A.; Wigati, L.P.; Tanaka, F.; Tanaka, F. Identification of tomatoes with bruise using laser-light backscattering imaging technique. Scientia Horticulturae 2025, 350, 114301. [CrossRef]
- Feng, J.; Wang, Z.; Wang, S.; Tian, S.; Xu, H. MSDD-YOLOX: an enhanced YOLOX for real-time surface defect detection of oranges by type. European Journal of Agronomy 2023, 149, 126918. [CrossRef]
- Rong, D.; Rao, X.; Ying, Y. Computer vision detection of surface defect on oranges by means of a sliding comparison window local segmentation algorithm. Computers and Electronics in Agriculture 2017, 137, 59–68. [CrossRef]
- Chen, Y.; Huang, Y.; Zhang, Z.; Wang, Z.; Liu, B.; Liu, C.; Huang, C.; Dong, S.; Pu, X.; Wan, F.; et al. Plant image recognition with deep learning: a review. Computers and Electronics in Agriculture 2023, 212, 108072. [CrossRef]
- Ren, C.; Jeong, D.; Kim, D.K. A survey of deep learning in agriculture: techniques and their applications. Journal of Information Processing Systems 2020, 16, 1015–1033. [CrossRef]
- Li, C.; Lin, J.; Li, Z.; Mai, C.; Jiang, R.; Li, J. An efficient detection method for litchi fruits in a natural environment based on improved YOLOv7-litchi. Computers and Electronics in Agriculture 2024, 217, 108605. [CrossRef]
- Mao, D.; Sun, H.; Li, X.; Yu, X.; Wu, J.; Zhang, Q. Real-time fruit detection using deep neural networks on CPU (RTFD): an edge AI application. Computers and Electronics in Agriculture 2023, 204, 107517. [CrossRef]
- Min, W.; Wang, Z.; Yang, J.; Liu, C.; Jiang, S. Vision-based fruit recognition via multi-scale attention CNN. Computers and Electronics in Agriculture 2023, 210, 107911. [CrossRef]
- Wang, D.; He, D. Channel pruned YOLO V5s-based deep learning approach for rapid and accurate apple fruitlet detection before fruit thinning. Biosystems Engineering 2021, 210, 271–281. [CrossRef]
- Carion, N.; Massa, F.; Synnaeve, G.; Usunier, N.; Kirillov, A.; Zagoruyko, S. End-to-End Object Detection with Transformers, 2020. [CrossRef]
- Zhu, X.; Su, W.; Lu, L.; Li, B.; Wang, X.; Dai, J. Deformable DETR: deformable transformers for end-to-end object detection, 2021. arXiv:2010.04159 [cs], . [CrossRef]
- Zhao, Y.; Lv, W.; Xu, S.; Wei, J.; Wang, G.; Dang, Q.; Liu, Y.; Chen, J. DETRs Beat YOLOs on Real-Time Object Detection, 2023. [CrossRef]
- Lv, W.; Zhao, Y.; Chang, Q.; Huang, K.; Wang, G.; Liu, Y. RT-DETRv2: improved baseline with bag-of-freebies for real-time detection transformer, 2024. arXiv:2407.17140 [cs], . [CrossRef]
- Rao, Y.; Zhao, W.; Liu, B.; Lu, J.; Zhou, J.; Hsieh, C.J. DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification, 2021. [CrossRef]
- Ryoo, M.S.; Piergiovanni, A.J.; Arnab, A.; Dehghani, M.; Angelova, A. TokenLearner: What Can 8 Learned Tokens Do for Images and Videos?, 2021. [CrossRef]
- Liang, Y.; Ge, C.; Tong, Z.; Song, Y.; Wang, J.; Xie, P. Not All Patches Are What You Need: Expediting Vision Transformers via Token Reorganizations, 2022. [CrossRef]
- Zhang, R. Making Convolutional Networks Shift-Invariant Again, 2019. [CrossRef]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-net: efficient channel attention for deep convolutional neural networks. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, June 2020; pp. 11531–11539. [CrossRef]
- Yu, F.; Koltun, V. Multi-Scale Context Aggregation by Dilated Convolutions, 2015. [CrossRef]
- Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection, 2016. [CrossRef]
- Tan, M.; Pang, R.; Le, Q.V. EfficientDet: Scalable and Efficient Object Detection, 2019. [CrossRef]
- Ding, X.; Zhang, X.; Ma, N.; Han, J.; Ding, G.; Sun, J. RepVGG: Making VGG-Style ConvNets Great Again, 2021. [CrossRef]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection, 2017. [CrossRef]
- Zhang, H.; Wang, Y.; Dayoub, F.; Sünderhauf, N. VarifocalNet: An IoU-Aware Dense Object Detector, 2020. [CrossRef]
- Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection. In Proceedings of the Advances in Neural Information Processing Systems, 2020, pp. 21002–21012.
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018, pp. 7132–7141. [CrossRef]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: convolutional block attention module. In Computer vision–ECCV 2018; Ferrari, V.; Hebert, M.; Sminchisescu, C.; Weiss, Y., Eds.; Springer International Publishing: Cham, 2018; Vol. 11211, pp. 3–19. Series Title: Lecture Notes in Computer Science, . [CrossRef]
- Lyu, C.; Zhang, W.; Huang, H.; Zhou, Y.; Wang, Y.; Liu, Y.; Zhang, S.; Chen, K. RTMDet: an empirical study of designing real-time object detectors, 2022. arXiv:2212.07784 [cs], . [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: towards real-time object detection with region proposal networks, 2016. arXiv:1506.01497 [cs], . [CrossRef]



















| Experiments | |||||
|---|---|---|---|---|---|
| A1 | 700 | 0 | 0 | 0 | 700 |
| A2 | 700 | 0 | 2000 | 0 | 2700 |
| A3 | 700 | 400 | 0 | 0 | 1100 |
| A4 | 700 | 400 | 0 | 2000 | 3100 |
| Experiments | SGFE | SACF | QFL | FADP | CAFO |
(%)↑ |
(%)↑ |
(%)↑ |
Params (M)↓ |
FLOPs (G)↓ |
FPS↑ |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 84.5 | 88.9 | 95.0 | 20.09 | 61.17 | 110.5 | |||||
| 2 | ✓ | 86.3 | 91.5 | 94.7 | 20.10 | 60.82 | 110.7 | ||||
| 3 | ✓ | 85.7 | 90.3 | 95.1 | 20.11 | 61.29 | 106.1 | ||||
| 4 | ✓ | 85.6 | 90.7 | 95.0 | 20.09 | 61.17 | 109.4 | ||||
| 5 | ✓ | 85.5 | 90.5 | 95.0 | 20.10 | 61.30 | 104.3 | ||||
| 6 | ✓ | 86.1 | 90.9 | 95.2 | 20.09 | 61.27 | 106.4 | ||||
| 7 | ✓ | ✓ | 86.8 | 91.6 | 95.3 | 20.13 | 60.65 | 107.8 | |||
| 8 | ✓ | ✓ | ✓ | 87.1 | 91.8 | 95.3 | 20.13 | 60.80 | 106.2 | ||
| 9 | ✓ | ✓ | ✓ | ✓ | 87.3 | 91.9 | 95.4 | 20.13 | 61.18 | 104.5 | |
| 10 | ✓ | ✓ | ✓ | ✓ | ✓ | 87.9 | 92.5 | 95.6 | 20.14 | 61.17 | 103.6 |
| Setting | Train policy | Test policy | (%)↑ | (%)↑ |
|---|---|---|---|---|
| Baseline | – | – | 84.5 | 95.0 |
| Fixed–Fixed | Fixed, | Fixed, | 85.3 | 94.5 |
| Source-aware–Fixed | Source-aware, / 60% | Fixed, | 86.3 | 94.7 |
| Experiments | (%)↑ | (%)↑ |
|---|---|---|
| SGFE-Overwrite | 85.3 | 94.9 |
| SGFE-Zero-Fill | 84.2 | 94.5 |
| SGFE-Residual | 86.3 | 94.7 |
| Experiments | HFER/ALI | PBR | Coh | |
|---|---|---|---|---|
| Baseline | 0.0005 | 1.5206 | 1.4036 | 0.189591 |
| FADP | 0.0003 | 1.1693 | 1.6912 | 0.064604 |
| Experiments | Backbone |
(%)↑ |
(%)↑ |
(%)↑ |
Params (M)↓ |
FLOPs (G)↓ |
FPS↑ |
|---|---|---|---|---|---|---|---|
| YOLOv8n | CSPDarknet-n | 82.4 | 89.1 | 84.2 | 3.01 | 8.10 | 256 |
| YOLOv11n | CSPDarknet-n | 82.4 | 89.3 | 83.7 | 2.58 | 6.30 | 333 |
| RTMDet | ResNet-50 | 85.0 | 91.6 | 93.9 | 52.26 | 79.96 | 33.7 |
| Faster R-CNN | ResNet-50-FPN | 82.7 | 89.2 | 90.4 | 41.75 | 91.30 | 17.18 |
| Deformable DETR | ResNet-50 | 81.6 | 90.5 | 91.1 | 40.10 | 123.00 | 14.59 |
| RT-DETRv2 | ResNet-50 | 84.5 | 88.9 | 95.0 | 20.09 | 61.17 | 110.5 |
| Ours | ResNet-50 | 87.9 | 92.5 | 95.6 | 20.14 | 61.17 | 103.6 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).