A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios
Abstract
:1. Introduction
- A dataset comprising four distinct ripeness levels of bananas was constructed, and a range of data augmentation techniques, including high light, noise, low light, rotational, and flipping, were employed to enlarge the dataset. These techniques were utilized to simulate the multifactorial and complex conditions encountered during banana harvesting and distribution, thereby enhancing the diversity and robustness of the dataset.
- The introduction of the SENetV2 attention mechanism enhances the network model’s feature extraction capabilities in complex, multifactorial scenarios, and enhances the model’s focus on banana maturity features without a substantial increase in computational expense.
- For banana detection in shape-similar scenarios, the accuracy and efficiency of the bounding box regression are improved by improving the loss function, thus improving the accuracy and efficiency of the model detection by further optimizing the bounding box alignment.
- We propose a banana ripeness detection model based on YOLOv9c, which enhances the accuracy of ripeness detection by integrating the SENetV2 attention mechanism, refining the model’s downsampling method through DualConv group convolution, and introducing the EIoU loss function to augment the accuracy and efficiency of bounding box regression. This model serves as a valuable technical reference for the accurate detection of banana ripeness.
2. Materials and Methods
2.1. Image Collection and Dataset Construction
2.1.1. Image Acquisition
2.1.2. Data Annotation and Datasets Production
2.2. Data Augmentation and Expansion
2.3. YOLOv9 Detection Network
2.4. Construction of Model
2.4.1. ESD-YOLOv9 Model
2.4.2. SENetV2
2.4.3. DualConv
2.4.4. EIoU Loss Function
2.5. Experiments
2.5.1. ESD-YOLOv9 Model Experimentation
2.5.2. Ablation Study of the Improved ESD-YOLOv9
2.5.3. Comparative Analysis of Different Target Detection Networks
3. Model Evaluation Metrics and Experimental Parameter Indicators
3.1. Model Evaluation Metrics
3.2. Experimental Environment Configuration and Network Parameters
4. Result and Discussion
4.1. Result Analysis
4.1.1. Experimental Results of the ESD-YOLOv9 Model
4.1.2. Results of Ablation Experiments
4.1.3. Comparison Results of Different Object Detection Models
4.2. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Ashokkumar, K.; Elayabalan, S.; Shobana, V.G.; Sivakumar, P.; Pandiyan, M. Nutritional value of cultivars of Banana (Musa spp.) and its future prospects. J. Pharmacogn. Phytochem. 2018, 7, 2972–2977. [Google Scholar] [CrossRef]
- Bebber, D.P. The long road to a sustainable banana trade. Plants People Planet 2023, 5, 662–671. [Google Scholar] [CrossRef]
- Sanaeifar, A.; Bakhshipour, A.; De La Guardia, M. Prediction of banana quality indices from color features using support vector regression. Talanta 2016, 148, 54–61. [Google Scholar] [CrossRef] [PubMed]
- Santoyo-Mora, M.; Sancen-Plaza, A.; Espinosa-Calderon, A.; Barranco-Gutierrez, A.I.; Prado-Olivarez, J. Nondestructive quantification of the ripening process in banana (Musa AAB Simmonds) using multispectral imaging. J. Sens. 2019, 2019, 6742896. [Google Scholar] [CrossRef]
- Watharkar, R.B.; Chakraborty, S.; Srivastav, P.P.; Srivastava, B. Physicochemical and mechanical properties during storage-cum maturity stages of raw harvested wild banana (Musa balbisiana, BB). J. Food Meas. Charact. 2021, 15, 3336–3349. [Google Scholar] [CrossRef]
- Hernández-Sánchez, N.; Moreda, G.P.; Herre-ro-Langreo, A.; Melado-Herreros, Á. Assessment of internal and external quality of fruits and vegetables. In Imaging Technologies and Data Processing for Food Engineers; Springer: Berlin/Heidelberg, Germany, 2016; pp. 269–309. [Google Scholar]
- Bhargava, A.; Bansal, A. Fruits and vegetables quality evaluation using computer vision: A review. J. King Saud-Univ.-Comput. Inf. Sci. 2021, 33, 243–257. [Google Scholar] [CrossRef]
- Lv, X.; Zhang, X.; Gao, H.; He, T.; Lv, Z.; Zhangzhong, L. When Crops meet Machine Vision: A review and development framework for a low-cost nondestructive online monitoring technology in agricultural production. Agric. Commun. 2024, 2, 100029. [Google Scholar] [CrossRef]
- Nisa, Y.A.; Sari, C.A.; Rachmawanto, E.H.; Yaacob, N.M. Ambon Banana Maturity Classification Based on Convolutional Neural Network (CNN). Sink. J. Dan Penelit. Tek. Inform. 2023, 7, 2568–2578. [Google Scholar] [CrossRef]
- Arunima, P.L.; Gopinath, P.P.; Lekshmi, P.R.G.; Esakkimuthu, M. Digital assessment of post-harvest Nendran banana for faster grading: CNN-based ripeness classification model. Postharvest Biol. Technol. 2024, 214, 112972. [Google Scholar] [CrossRef]
- Zhao, M.; You, Z.; Chen, H.; Wang, X.; Ying, Y.; Wang, Y. Integrated Fruit Ripeness Assessment System Based on an Artificial Olfactory Sensor and Deep Learning. Foods 2024, 13, 793. [Google Scholar] [CrossRef] [PubMed]
- Wang, L.-M.; Jiang, Y. Automatic classification of banana ripeness based on deep learning. Food Mach. 2022, 38, 149–154. [Google Scholar]
- Wei, X.; Xie, F.; Wang, K.; Song, J.; Bai, Y. A study on Shine-Muscat grape detection at maturity based on deep learning. Sci. Rep. 2023, 13, 4587. [Google Scholar] [CrossRef] [PubMed]
- Gai, R.; Chen, N.; Yuan, H. A detection algorithm for cherry fruits based on the improved YOLO-v4 model. Neural Comput. Appl. 2023, 35, 13895–13906. [Google Scholar] [CrossRef]
- Wang, C.; Wang, C.; Wang, L.; Wang, J.; Liao, J.; Li, Y.; Lan, Y. A lightweight cherry tomato maturity real-time detection algorithm based on improved YOLOV5n. Agronomy 2023, 13, 2106. [Google Scholar] [CrossRef]
- Yang, H.; Liu, Y.; Wang, S.; Qu, H.; Li, N.; Wu, J.; Yan, Y.; Zhang, H.; Wang, J.; Qiu, J. Improved apple fruit target recognition method based on YOLOv7 model. Agriculture 2023, 13, 1278. [Google Scholar] [CrossRef]
- Kazama, E.H.; Tedesco, D.; Carreira, V.S.; Júnior, M.R.B.; de Oliveira, M.F.; Ferreira, F.M.; Júnior, W.M.; da Silva, R.P. Monitoring coffee fruit maturity using an enhanced convolutional neural network under different image acquisition settings. Sci. Hortic. 2024, 328, 112957. [Google Scholar] [CrossRef]
- Chen, Y.; Xu, H.; Chang, P.; Huang, Y.; Zhong, F.; Jia, Q.; Chen, L.; Zhong, H.; Liu, S. CES-YOLOv8: Strawberry Maturity Detection Based on the Improved YOLOv8. Agronomy 2024, 14, 1353. [Google Scholar] [CrossRef]
- Li, Z.; Jiang, X.; Shuai, L.; Zhang, B.; Yang, Y.; Mu, J. A real-time detection algorithm for sweet cherry fruit maturity based on YOLOX in the natural environment. Agronomy 2022, 12, 2482. [Google Scholar] [CrossRef]
- Ploetz, R.C.; Evans, E.A. The future of global banana production. Hortic. Rev. 2015, 43, 311–352. [Google Scholar]
- Ray, J.D.; Subandiyah, S.; Rincon-Florez, V.A.; Prakoso, A.B.; Mudita, I.W.; Carvalhais, L.C.; Markus, J.E.R.; O’Dwyer, C.A.; Drenth, A. Geographic expansion of banana blood disease in Southeast Asia. Plant Dis. 2021, 105, 2792–2800. [Google Scholar] [CrossRef]
- Arvanitoyannis, I.S.; Mavromatis, A. Banana cultivars, cultivation practices, and physicochemical properties. Crit. Rev. Food Sci. Nutr. 2009, 49, 113–135. [Google Scholar] [CrossRef] [PubMed]
- Ferdaus, M.H.; Prito, R.H.; Rasel, A.A.S.; Ahmed, M.; Saykot, M.J.H.; Shanta, S.S.; Akter, S.; Das, A.C.; Islam, M.M.; Hasan, M.; et al. BananaImageBD: A Comprehensive Banana Image Dataset for Classification of Banana Varieties and Detection of Ripeness Stages in Bangladesh. Data Brief 2024, 58, 111239. [Google Scholar] [CrossRef]
- Li, H.; Rajbahadur, G.K.; Lin, D.; Bezemer, C.-P.; Jiang, Z.M. Keeping Deep Learning Models in Check: A History-Based Approach to Mitigate Overfitting. IEEE Access 2024, 12, 70676–70689. [Google Scholar] [CrossRef]
- He, K.; Gkioxari, G.; Dollár, P. Mask R-CNN. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
- Girshick, R. Fast R-CNN. In Proceedings of the IEEE International Conference on Computer vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- 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. 2016, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Redmon, J. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar]
- Redmon, J. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Lin, T. Focal Loss for Dense Object Detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017. [Google Scholar]
- Tan, M.; Pang, R.; Le, Q.V. EfficientDet: Scalable and Efficient Object Detection. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020; pp. 10778–10787. [Google Scholar]
- Wang, C.Y.; Yeh, I.H.; Liao, H.Y.M. YOLOv9: Learning what you want to learn using programmable gradient information. arXiv 2024, arXiv:2402.13616. [Google Scholar]
- Narayanan, M. SENetV2: Aggregated dense layer for channelwise and global representations. arXiv 2023, arXiv:2311.10807. [Google Scholar]
- Zhong, J.; Chen, J.; Mian, A. DualConv: Dual Convolutional Kernels for Lightweight Deep Neural Networks. IEEE Trans. Neural Netw. Learn. Syst. 2023, 34, 9528–9535. [Google Scholar] [CrossRef]
- 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–157. [Google Scholar] [CrossRef]
Parameters | Configuration |
---|---|
GPU | NVIDIA RTX 3090/24 GB |
Python | 3.8 (ubuntu20.04) |
PyTorch | 2.0.0 |
Operating system | Windows 11 |
Accelerated environment | CUDA 11.8.0 |
Item | Value |
---|---|
Optimizer | SGD |
Momentum | 0.937 |
Batch size | 16 |
Weight decay | 0.0005 |
Training epochs | 120 |
Initial learning rate | 0.01 |
Maturity Level | Precision | Recall | mAP50 | mAP50-95 | F1 Score |
---|---|---|---|---|---|
unripe | 80.9% | 1 | 98.1% | 95.4% | 89.4% |
ripe | 99.4% | 97.8% | 99.4% | 94.6% | 98.6% |
overripe | 97.1% | 1 | 99.2% | 97.6% | 98.5% |
rotten | 98.7% | 97.4% | 98.8% | 94.2% | 98.0% |
Average | 94.0% | 98.8% | 98.9% | 95.9% | 96.3% |
No. | ECA | SENetV2 | SCConv | DualConv | EIoU | Precision | Recall | mAP50 | mAP50-95 | Params/M |
---|---|---|---|---|---|---|---|---|---|---|
1 | ✓ | × | × | × | × | 96.2% | 99.8% | 97.2% | 87.7% | 51.006 |
2 | × | ✓ | × | × | × | 94.0% | 98.7% | 98.5% | 95.3% | 51.350 |
3 | × | × | ✓ | × | × | 97.3% | 92.6% | 97.9% | 87.9% | 49.156 |
4 | × | × | × | ✓ | × | 93.9% | 98.3% | 98.7% | 95.0% | 51.594 |
5 | × | × | × | × | ✓ | 93.8% | 98.7% | 98.4% | 95.1% | 51.006 |
6 | ✓ | × | ✓ | × | ✓ | 96.1% | 94.4% | 97.4% | 87.3% | 49.157 |
7 | ✓ | × | × | ✓ | ✓ | 95.5% | 98.5% | 98.0% | 90.3% | 51.594 |
8 | × | ✓ | ✓ | × | ✓ | 94.2% | 98.7% | 98.0% | 89.6% | 51.424 |
9 | × | ✓ | × | ✓ | ✓ | 94.0% | 98.8% | 98.9% | 95.9% | 51.938 |
Model | Attention Mechanism | Conv | Loss Function | Precision | Recall | mAP50 | mAP50-95 | GFLOPs |
---|---|---|---|---|---|---|---|---|
YOLOv9c | - | - | - | 93.8% | 99.2% | 98.2% | 94.7% | 238.9 |
YOLOv9c | - | - | EIoU | 93.8% | 98.7% | 98.4% | 95.1% | 238.9 |
YOLOv9c | - | DualConv | - | 93.9% | 98.3% | 98.7% | 95.0% | 237.5 |
YOLOv9c | SENetV2 | - | - | 94.0% | 98.7% | 98.5% | 95.3% | 239.2 |
YOLOv9c | - | DualConv | EIoU | 94.0% | 99.2% | 98.8% | 95.6% | 237.5 |
YOLOv9c | SENetV2 | - | EIoU | 94.3% | 99.0% | 98.6% | 95.4% | 239.2 |
YOLOv9c | SENetV2 | DualConv | - | 94.2% | 99.0% | 98.8% | 95.5% | 237.8 |
YOLOv9c | SENetV2 | DualConv | EIoU | 94.0% | 98.8% | 98.9% | 95.9% | 235.6 |
Model | Average Precision | Precision | Recall | Prarm/M | FPS | F1 Score | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
Unripe | Ripe | Overripe | Rotten | mAP50 | mAP50-95 | ||||||
YOLOv5X | 93.0% | 99.4% | 98.5% | 98.5% | 97.3% | 92.3% | 91.9% | 98.9% | 86.193 | 19.54 | 95.3% |
YOLOv7 | 94.9% | 99.5% | 98.0% | 98.2% | 97.6% | 91.3% | 91.5% | 98.3% | 36.492 | 40.22 | 94.8% |
YOLOv8n | 90.2% | 99.5% | 99.5% | 99.3% | 97.1% | 93.9% | 94.3% | 97.5% | 3.006 | 162.89 | 95.9% |
YOLOv10n | 94.0% | 99.4% | 99.3% | 99.1% | 97.9% | 93.4% | 93.9% | 97.0% | 2.962 | 172.34 | 95.4% |
RT-DETR | 97.5% | 98.5% | 95.9% | 97.0% | 97.2% | 91.2% | 93.7% | 96.9% | 31.991 | 36.36 | 95.3% |
Faster-RCNN | 75.9% | 66.6% | 73.5% | 63.1% | 69.8% | 64.7% | 42.5% | 82.1% | 138.43 | 11.54 | 56.0% |
SSD | 80.1% | 74.8% | 79.4% | 84.7% | 86.2% | 82.9% | 86.2% | 37.4% | 146.52 | 9.94 | 52.2% |
YOLOv11 | 95.7% | 99.4% | 99.2% | 98.9% | 98.3% | 95.4% | 93.5% | 99.0% | 2.582 | 120.41 | 96.1% |
Ours | 98.1% | 99.4% | 99.2% | 98.8% | 98.9% | 95.5% | 94.0% | 98.8% | 51.639 | 44.98 | 96.3% |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, G.; Gao, Y.; Xu, F.; Sang, W.; Han, Y.; Liu, Q. A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios. Symmetry 2025, 17, 231. https://doi.org/10.3390/sym17020231
Wang G, Gao Y, Xu F, Sang W, Han Y, Liu Q. A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios. Symmetry. 2025; 17(2):231. https://doi.org/10.3390/sym17020231
Chicago/Turabian StyleWang, Ge, Yuteng Gao, Fangqian Xu, Wenjie Sang, Yue Han, and Qiang Liu. 2025. "A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios" Symmetry 17, no. 2: 231. https://doi.org/10.3390/sym17020231
APA StyleWang, G., Gao, Y., Xu, F., Sang, W., Han, Y., & Liu, Q. (2025). A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios. Symmetry, 17(2), 231. https://doi.org/10.3390/sym17020231