A Green Jujube Grading Model Using BiFPN and COT Attention Mechanism
Abstract
1. Introduction
- An improved BCW-YOLO model for green jujube grading detection is proposed. The architecture integrates the bidirectional feature pyramid network (BiFPN) and the context transformation (COT) attention mechanism, which fuses both static and dynamic contextual information, to improve detection accuracy and robustness.
- Green jujube images are classified and annotated, and a multi-angle image dataset is constructed and augmented using data enhancement techniques for model training, validation, and testing.
- The model’s performance and generalization capability are comprehensively evaluated using various validation methods, including confusion matrix analysis, PR curve analysis, heatmap analysis, ablation experiments, and multi-model comparisons.
2. Materials and Methods
2.1. Dataset Construction
2.2. BCW-YOLO Network Architecture
2.2.1. Bidirectional Feature Pyramid Network (BiFPN)
2.2.2. COT Attention Mechanism
2.2.3. WIoU v3 Loss Function
2.3. Evaluation Metrics
3. Results and Analysis
3.1. Experimental Environment
3.2. Model Training Results
3.2.1. Performance Comparison Before and After Improvement
3.2.2. Confusion Matrix Analysis
3.2.3. PR Curve Analysis
3.2.4. Heatmap Analysis
3.3. Ablation Experiment
3.4. Comparison Experiment
4. Discussions
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Krishna, H.; Kumar, L.; Haldhar, S.M.; Singh, D.; Saroj, P.L. Phenological growth stages of Indian jujube (Ziziphus mauritiana Lamk.) according to the BBCH scale. Ann. Appl. Biol. 2018, 174, 106–112. [Google Scholar] [CrossRef] [Scilit]
- Anjum, M.A.; Haram, A.; Ahmad, R.; Bashir, M.A. Physico-chemical attributes of fresh and dried Indian jujube (Zizyphus mauritiana) fruits. Pak. J. Agric. Sci. 2020, 57, 165–176. [Google Scholar]
- Zhou, C. Investigation on the Fresh Jujube Industry in China. Master’s Thesis, Northwest A&F University, Xianyang, China, 2023; pp. 25–34. [Google Scholar]
- Ahmad, I.; Nafees, M.; Ashraf, I.; Ahmad, B.; Qureshi, R. Fruit morphological attributes to assess genetic diversity in jujube (Ziziphus mauritiana L.) germplasm of Bahawalpur. Pure Appl. Biol. (PAB) 2016, 5, 921–926. [Google Scholar] [CrossRef] [Scilit]
- Zhang, C.; Hao, Y.J. Advances in genomic, transcriptomic, and metabolomic analyses of fruit quality in fruit crops. Hortic. Plant J. 2020, 6, 361–371. [Google Scholar] [CrossRef] [Scilit]
- Gan, H.; Lee, W.S.; Alchanatis, V.; Ehsani, R.; Schueller, J.K. Immature green citrus fruit detection using color and thermal images. Comput. Electron. Agric. 2018, 152, 117–125. [Google Scholar] [CrossRef] [Scilit]
- Yamamoto, S.; Hayashi, S.; Yoshida, H.; Kobayashi, K. Development of a stationary robotic strawberry harvester with a picking mechanism that approaches the target fruit from below. Jpn. Agric. Res. Q. JARQ 2014, 48, 261–269. [Google Scholar]
- Kaur, H.; Sawhney, B.K.; Jawandha, S.K. Evaluation of plum fruit maturity by image processing techniques. J. Food Sci. Technol. 2018, 55, 3008–3015. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lu, Z.; Zhao, M.; Luo, J.; Wang, G.; Wang, D. Design of a winter-jujube grading robot based on machine vision. Comput. Electron. Agric. 2021, 186, 106170. [Google Scholar] [CrossRef] [Scilit]
- Wang, S.; Li, Q.; Yang, T.; Li, Z.; Bai, D.; Tang, C.; Pu, H. LSD-YOLO: Enhanced YOLOv8n Algorithm for Efficient Detection of Lemon Surface Diseases. Plants 2024, 13, 2069. [Google Scholar] [CrossRef] [Scilit]
- Liang, X.; Jia, X.; Huang, W.; He, X.; Li, L.; Fan, S.; Li, J.; Zhao, C.; Zhang, C. Real-Time Grading of Defect Apples Using Semantic Segmentation Combination with a Pruned YOLO V4 Network. Foods 2022, 11, 3150. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Mao, L. An improved YOLOv7 method to identify epidermal defects in mature litchi. J. Intell. Fuzzy Syst. 2023, 45, 12027–12036. [Google Scholar] [CrossRef] [Scilit]
- Almutairi, A.; Alharbi, J.; Alharbi, S.; Alhasson, H.F.; Alharbi, S.S.; Habib, S. Date Fruit Detection and Classification Based on Its Variety Using Deep Learning Technology. IEEE Access 2024, 12, 190666–190677. [Google Scholar] [CrossRef] [Scilit]
- Chiou, K.-D.; Chen, Y.-X.; Chen, P.-S.; Jou, Y.-T.; Tsai, S.-H.; Chang, C.-Y. Application of deep learning for fruit defect recognition in Psidium guajava L. Sci. Rep. 2025, 15, 6145. [Google Scholar] [CrossRef] [Scilit]
- Jrondi, Z.; Moussaid, A.; Hadi, M.Y. Interpretable Citrus Fruit Quality Assessment Using Vision Transformers and Lightweight Large Language Models. AgriEngineering 2025, 7, 286. [Google Scholar] [CrossRef] [Scilit]
- Gu, Z.; He, D.; Huang, J.; Chen, J.; Wu, X.; Huang, B.; Dong, T.; Yang, Q.; Li, H. Simultaneous detection of fruits and fruiting stems in mango using improved YOLOv8 model deployed by edge device. Comput. Electron. Agric. 2024, 227, 109512. [Google Scholar] [CrossRef] [Scilit]
- Sun, X.; Ma, L.; Li, G. Multi-vision attention networks for on-line red jujube grading. Chin. J. Electron. 2019, 28, 1108–1117. [Google Scholar] [CrossRef] [Scilit]
- Gao, Y.; Yuan, B.; Zhu, Q.; Zhao, J.; Ma, X.; Chen, J.; Wang, F.; Chu, P.; Wang, C. Deep Learning Based Jujube Quality Assessment: An Automated Surface Defect Detection Approach. In Proceedings of the 2024 7th International Conference on Signal Processing and Machine Learning, Qingdao, China, 12–14 July 2024; pp. 75–81. [Google Scholar]
- Cang, H.; Yan, T.; Duan, L.; Yan, J.; Zhang, Y.; Tan, F.; Lv, X.; Gao, P. Jujube quality grading using a generative adversarial network with an imbalanced data set. Biosyst. Eng. 2023, 236, 224–237. [Google Scholar] [CrossRef] [Scilit]
- Ban, Z.; Fang, C.; Liu, L.; Wu, Z.; Chen, C.; Zhu, Y. Detection of fundamental quality traits of winter jujube based on computer vision and deep learning. Agronomy 2023, 13, 2095. [Google Scholar] [CrossRef] [Scilit]
- Ju, J.; Zheng, H.; Xu, X.; Guo, Z.; Zheng, Z.; Lin, M. Classification of jujube defects in small data sets based on transfer learning. Neural Comput. Appl. 2022, 34, 3385–3398. [Google Scholar]
- NY/T 484-2018; India jujube. China Agriculture Press: Beijing, China, 2018.
- Kaur, J.; Singh, W. Tools, techniques, datasets and application areas for object detection in an image: A review. Multimed. Tools Appl. 2022, 81, 38297–38351. [Google Scholar] [PubMed]
- Alomar, K.; Aysel, H.I.; Cai, X. Data augmentation in classification and segmentation: A survey and new strategies. J. Imaging 2023, 9, 46. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cheung, T.H.; Yeung, D.Y. A survey of automated data augmentation for image classification: Learning to compose, mix, and generate. IEEE Trans. Neural Netw. Learn. Syst. 2023, 35, 13185–13205. [Google Scholar]
- Tatar, A.; Haghighi, M.; Zeinijahromi, A. Experiments on image data augmentation techniques for geological rock type classification with convolutional neural networks. J. Rock Mech. Geotech. Eng. 2025, 17, 106–125. [Google Scholar]
- Sapkota, R.; Flores-Calero, M.; Qureshi, R.; Badgujar, C.; Nepal, U.; Poulose, A.; Zeno, P.; Vaddevolu, U.B.P.; Khan, S.; Shoman, M.; et al. YOLO advances to its genesis: A decadal and comprehensive review of the You Only Look Once (YOLO) series. Artif. Intell. Rev. 2025, 58, 274. [Google Scholar] [CrossRef] [Scilit]
- Yu, C.; Shi, X.; Luo, W.; Feng, J.; Zheng, Z.; Yorozu, A.; Hu, Y.; Guo, J. MLG-YOLO: A Model for Real-Time Accurate Detection and Localization of Winter Jujube in Complex Structured Orchard Environments. Plant Phenomics 2024, 6, 0258. [Google Scholar] [CrossRef] [Scilit]
- Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 14–19 June 2020; pp. 10781–10790. [Google Scholar]
- Li, Y.; Yao, T.; Pan, Y.; Mei, T. Contextual transformer networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 45, 1489–1500. [Google Scholar] [CrossRef] [Scilit]
- Tong, Z.; Chen, Y.; Xu, Z.; Yu, R. Wise-IoU: Bounding box regression loss with dynamic focusing mechanism. arXiv 2023, arXiv:2301.10051. [Google Scholar]
- Rao, Y.; An, T.; Xuan, Y.; Wang, R.; Zhou, Q.; Guan, H.; Li, M. Feature enhancement and attention mechanism fusion method for Cantonese embroidery image detection based on YOLOv8. npj Herit. Sci. 2025, 13, 521. [Google Scholar]
- Lu, J.; Chen, W.; Lan, Y.; Qiu, X.; Huang, J.; Luo, H. Design of citrus peel defect and fruit morphology detection method based on machine vision. Comput. Electron. Agric. 2024, 219, 108721. [Google Scholar] [CrossRef] [Scilit]
- Padilla, R.; Passos, W.L.; Dias, T.L.B.; Netto, S.L.; da Silva, E.A.B. A comparative analysis of object detection metrics with a companion open-source toolkit. Electronics 2021, 10, 279. [Google Scholar] [CrossRef] [Scilit]
- Rainio, O.; Teuho, J.; Klén, R. Evaluation metrics and statistical tests for machine learning. Sci. Rep. 2024, 14, 6086. [Google Scholar]
- Aloufi, N.; Alnori, A.; Thayananthan, V.; Basuhail, A. Object detection performance evaluation for autonomous vehicles in sandy weather environments. Appl. Sci. 2023, 13, 10249. [Google Scholar] [CrossRef] [Scilit]
- Otani, M.; Togashi, R.; Nakashima, Y.; Rahtu, E.; Heikkilä, J.; Satoh, S.I. Optimal correction cost for object detection evaluation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 21107–21115. [Google Scholar]
- Riehl, K.; Neunteufel, M.; Hemberg, M. Hierarchical confusion matrix for classification performance evaluation. J. R. Stat. Soc. Ser. C Appl. Stat. 2023, 72, 1394–1412. [Google Scholar]
- He, L.; Zhou, Y.; Liu, L.; Cao, W.; Ma, J.-H. Research on object detection and recognition in remote sensing images based on YOLOv11. Sci. Rep. 2025, 15, 14032. [Google Scholar] [CrossRef] [Scilit]
- Zhao, X.; Wang, L.; Zhang, Y.; Han, X.; Deveci, M.; Parmar, M. A review of convolutional neural networks in computer vision. Artif. Intell. Rev. 2024, 57, 99. [Google Scholar] [CrossRef] [Scilit]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 618–626. [Google Scholar]
- Liu, Y.; Tang, L.; Liao, C.; Zhang, C.; Guo, Y.; Xia, Y.; Zhang, Y.; Yao, S. Optimized Dropkey-based grad-CAM: Toward accurate image feature localization. Sensors 2023, 23, 8351. [Google Scholar] [PubMed]
- Chuquimarca, L.E.; Vintimilla, B.X.; Velastin, S.A. A review of external quality inspection for fruit grading using CNN models. Artif. Intell. Agric. 2024, 14, 1–20. [Google Scholar] [CrossRef] [Scilit]
- Liu, C.; Lin, W.; Feng, Y.; Guo, Z.; Xie, Z. ATC-YOLOv5: Fruit Appearance Quality Classification Algorithm Based on the Improved YOLOv5 Model for Passion Fruits. Mathematics 2023, 11, 3615. [Google Scholar] [CrossRef] [Scilit]
- Wu, Y.; Tang, J.; Zeng, W. Research on the Intelligent Detection Algorithm of Apple Quality Based on Deep Learning. Artif. Intell. Robot. Res. 2025, 14, 1034. [Google Scholar] [CrossRef]
- Espinoza, S.; Aguilera, C.; Rojas, L.; Campos, P.G. Analysis of fruit images with deep learning: A systematic literature review and future directions. IEEE Access 2023, 12, 3837–3859. [Google Scholar] [CrossRef] [Scilit]
- Fu, Y.; Nguyen, M.; Yan, W.Q. Grading methods for fruit freshness based on deep learning. SN Comput. Sci. 2022, 3, 264. [Google Scholar] [CrossRef] [Scilit]
- Unay, D. Deep learning based automatic grading of bi-colored apples using multispectral images. Multimed. Tools Appl. 2022, 81, 38237–38252. [Google Scholar] [CrossRef] [Scilit]
- Lv, M.; Xu, Y.X.; Miao, Y.H.; Su, W.H. A Comprehensive Review of Deep Learning in Computer Vision for Monitoring Apple Tree Growth and Fruit Production. Sensors 2025, 2, 2433. [Google Scholar] [CrossRef] [Scilit]
- Colaco, L.; Kamat, P. Artificial intelligence advances for cashew fruit maturity and quality detection: A systematic review on models, sensors, and farming applications. J. Big Data 2025, 12, 250. [Google Scholar] [CrossRef] [Scilit]














| Models | Test Objectives | Precision | Recall | mAP50 | F1 |
|---|---|---|---|---|---|
| LSD-YOLO [10] | Lemon surface diseases | 89.22% | 83.96% | 80.84% | - |
| Improved YOLOv4 [11] | Apple defect regions | 94.30% | 94.33% | - | 94.31% |
| Improved YOLOv7 [12] | Skin defects of ripe lychee | 91.56% | - | 93.42% | - |
| YOLO v4-COCO [14] | Guava appearance defects | 92.44% | 94.36% | - | 93.39% |
| ViT-Base [15] | Citrus fruit quality | 97.33% | 97.33% | - | 97.67% |
| Improved YOLOv8 [16] | Mango fruits | 97.63% | 96.07% | - | - |
| ID | A | B | C | Precision | Recall | mAP50 | F1 Score | GFLOPs | FPS | Size/M |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 88.94% | 89.35% | 94.08% | 89.15% | 6.9 | 283.64 | 5.4 | |||
| 2 | √ | 89.43% | 91.78% | 95.56% | 90.59% | 23.8 | 215.68 | 19.1 | ||
| 3 | √ | 89.86% | 89.34% | 94.26% | 89.60% | 7.4 | 235.98 | 6.5 | ||
| 4 | √ | 90.14% | 90.08% | 94.56% | 90.11% | 6.9 | 241.6 | 5.4 | ||
| 5 | √ | √ | 90.13% | 91.89% | 95.76% | 91.00% | 23.8 | 204.8 | 19.1 | |
| 6 | √ | √ | 90.04% | 92.06% | 95.48% | 91.04% | 25.6 | 198.6 | 23.5 | |
| 7 | √ | √ | √ | 90.87% | 92.12% | 95.66% | 91.49% | 25.6 | 195.1 | 23.5 |
| Models | Precision | Recall | mAP50 | F1 |
|---|---|---|---|---|
| YOLOv8n | 88.94% | 89.35% | 94.08% | 89.15% |
| YOLOv3 | 90.39% | 91.71% | 96.01% | 91.05% |
| YOLOv5 | 87.31% | 87.87% | 92.91% | 87.59% |
| YOLOv5s | 88.20% | 89.65% | 93.76% | 88.92% |
| YOLOv6 | 87.53% | 86.90% | 91.84% | 87.22% |
| YOLOv6s | 89.62% | 90.01% | 94.34% | 89.81% |
| YOLOv10n | 86.07% | 90.29% | 92.97% | 88.13% |
| YOLOv10s | 90.87% | 87.81% | 95.24% | 89.32% |
| YOLOv11 | 89.06% | 90.04% | 94.95% | 89.55% |
| RT-DETR-R18 | 90.76% | 90.13% | 88.65% | 90.44% |
| BCW-YOLO | 90.87% | 92.12% | 95.66% | 91.49% |
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.
Share and Cite
Chang, P.; Zhu, X.; Wu, H.; Wu, S.; Jiang, F. A Green Jujube Grading Model Using BiFPN and COT Attention Mechanism. Agronomy 2026, 16, 982. https://doi.org/10.3390/agronomy16100982
Chang P, Zhu X, Wu H, Wu S, Jiang F. A Green Jujube Grading Model Using BiFPN and COT Attention Mechanism. Agronomy. 2026; 16(10):982. https://doi.org/10.3390/agronomy16100982
Chicago/Turabian StyleChang, Pengyan, Xudong Zhu, Huini Wu, Shuijin Wu, and Fan Jiang. 2026. "A Green Jujube Grading Model Using BiFPN and COT Attention Mechanism" Agronomy 16, no. 10: 982. https://doi.org/10.3390/agronomy16100982
APA StyleChang, P., Zhu, X., Wu, H., Wu, S., & Jiang, F. (2026). A Green Jujube Grading Model Using BiFPN and COT Attention Mechanism. Agronomy, 16(10), 982. https://doi.org/10.3390/agronomy16100982

