Impact of Phenological and Lighting Conditions on Early Detection of Grapevine Inflorescences and Bunches Using Deep Learning
Abstract
1. Introduction
2. Materials and Methods
2.1. Experimental Sites
2.2. Image Acquisition
2.3. Dataset
2.4. Labeling
2.5. Computational Setup
2.6. Model Architecture and Training Strategy
- Batch size: 32;
- Image resolution: 800 × 800 pixels;
- Maximum epochs: 200;
- Loss function: Objectness + Classification + Bounding Box regression (YOLOv11 default).
2.7. Data Augmentation
- Mosaic augmentation, which combines four images into one during training to improve detection of small and densely clustered objects [50].
- Random horizontal flipping, to introduce variability in canopy orientation.
- Color space augmentations (hue, saturation, and brightness), to simulate differences in natural lighting.
- Affine transformations, such as scaling, translation, and rotation, to account for camera perspective and positioning variability in mobile acquisition.
2.8. Statistical Tools for Model Evaluation
- The confidence threshold defines the minimum probability required for the model to consider a detected object as valid. Lower thresholds may increase sensitivity but also introduce more false positives.
- The IoU threshold determines the minimum overlap between a predicted bounding box and a ground truth annotation for the prediction to be considered correct. A higher IoU enforces stricter spatial agreement but may penalize slightly off-center detections.
- Coefficient of determination (R2): reflects the consistency of predictions relative to ground truth counts.
- Root mean square error (RMSE): quantifies the average magnitude of prediction errors.
- Mean absolute error (MAE): captures the average absolute deviation from ground truth.
3. Results and Discussion
3.1. Sample Distribution Analysis
3.2. Performance of YOLOv11 Models Across Conditions
3.3. Visual Assessment of Predictions
3.4. Optimal Detection Conditions
3.4.1. Influence of Phenological Stage
3.4.2. Influence of Illumination Conditions
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Laurent, C.; Oger, B.; Taylor, J.A.; Scholasch, T.; Metay, A.; Tisseyre, B. A review of the issues, methods and perspectives for yield estimation, prediction and forecasting in viticulture. Eur. J. Agron. 2021, 130, 126339. [Google Scholar] [CrossRef]
- Martin, S.; Dunstone, R.; Dunn, G. How to Forecast Wine Grape Deliveries Using Grape Forecaster Excel Workbook Version 7; Department of Primary Industries: Victoria, Australia, 2003. [Google Scholar]
- Santos, T.T.; De Souza, L.L.; dos Santos, A.A.; Avila, S. Grape detection, segmentation, and tracking using deep neural networks and three-dimensional association. Comput. Electron. Agric. 2020, 170, 105247. [Google Scholar] [CrossRef]
- Mohimont, L.; Alin, F.; Rondeau, M.; Gaveau, N.; Steffenel, L.A. Computer vision and deep learning for precision viticulture. Agronomy 2022, 12, 2463. [Google Scholar] [CrossRef]
- Dunn, G.M.; Martin, S.R. The current status of crop forecasting in the Australian wine industry. In Proceedings of the ASVO Seminar Series: Grapegrowing at the Edge, Barossa Valley, South Australia, 10 July 2003. [Google Scholar]
- Wohlfahrt, Y.; Collins, C.; Stoll, M. Grapevine bud fertility under conditions of elevated carbon dioxide: This article is published in cooperation with the 21th GIESCO International Meeting, June 23–28 2019, Thessaloniki, Greece. Guests editors: Stefanos Koundouras and Laurent Torregrosa. Oeno One 2019, 53, 279–288. [Google Scholar] [CrossRef]
- Nuske, S.; Wilshusen, K.; Achar, S.; Yoder, L.; Narasimhan, S.; Singh, S. Automated visual yield estimation in vineyards. J. Field Robot. 2014, 31, 837–860. [Google Scholar] [CrossRef]
- Khokher, M.R.; Liao, Q.; Smith, A.L.; Sun, C.; Mackenzie, D.; Thomas, M.R.; Wang, D.; Edwards, E.J. Early yield estimation in viticulture based on grapevine inflorescence detection and counting in videos. IEEE Access 2023, 11, 37790–37808. [Google Scholar] [CrossRef]
- Palacios, F.; Diago, M.P.; Melo-Pinto, P.; Tardaguila, J. Early yield prediction in different grapevine varieties using computer vision and machine learning. Precis. Agric. 2023, 24, 407–435. [Google Scholar] [CrossRef]
- Moreira, G.; dos Santos, F.N.; Cunha, M. Grapevine inflorescence segmentation and flower estimation based on Computer Vision techniques for early yield assessment. Smart Agric. Technol. 2025, 10, 100690. [Google Scholar] [CrossRef]
- Aquino, A.; Millan, B.; Diago, M.-P.; Tardaguila, J. Automated early yield prediction in vineyards from on-the-go image acquisition. Comput. Electron. Agric. 2018, 144, 26–36. [Google Scholar] [CrossRef]
- Anderson, N.T.; Walsh, K.B.; Wulfsohn, D. Technologies for forecasting tree fruit load and harvest timing—From ground, sky and time. Agronomy 2021, 11, 1409. [Google Scholar] [CrossRef]
- Tsouros, D.C.; Bibi, S.; Sarigiannidis, P.G. A review on UAV-based applications for precision agriculture. Information 2019, 10, 349. [Google Scholar] [CrossRef]
- Cubero, S.; Aleixos, N.; Moltó, E.; Gómez-Sanchis, J.; Blasco, J. Advances in machine vision applications for automatic inspection and quality evaluation of fruits and vegetables. Food Bioprocess Technol. 2011, 4, 487–504. [Google Scholar] [CrossRef]
- Íñiguez, R.; Palacios, F.; Barrio, I.; Hernández, I.; Gutiérrez, S.; Tardaguila, J. Impact of leaf occlusions on yield assessment by computer vision in commercial vineyards. Agronomy 2021, 11, 1003. [Google Scholar] [CrossRef]
- Liu, S.; Cossell, S.; Tang, J.; Dunn, G.; Whitty, M. A computer vision system for early stage grape yield estimation based on shoot detection. Comput. Electron. Agric. 2017, 137, 88–101. [Google Scholar] [CrossRef]
- Parr, B.; Legg, M.; Alam, F. Analysis of depth cameras for proximal sensing of grapes. Sensors 2022, 22, 4179. [Google Scholar] [CrossRef] [PubMed]
- Tardif, M. Proximal Sensing and Neural Network Processes to Assist in Diagnosis of Multi-Symptom Grapevine Diseases. Ph.D. Thesis, Université de Bordeaux, Pessac, France, 2023. [Google Scholar]
- Hu, C.; Sapkota, B.B.; Thomasson, J.A.; Bagavathiannan, M.V. Influence of image quality and light consistency on the performance of convolutional neural networks for weed mapping. Remote Sens. 2021, 13, 2140. [Google Scholar] [CrossRef]
- Arad, B.; Kurtser, P.; Barnea, E.; Harel, B.; Edan, Y.; Ben-Shahar, O. Controlled lighting and illumination-independent target detection for real-time cost-efficient applications. The case study of sweet pepper robotic harvesting. Sensors 2019, 19, 1390. [Google Scholar]
- Fu, H.; Zhao, X.; Tan, H.; Zheng, S.; Zhai, C.; Chen, L. Effective methods for mitigate the impact of light occlusion on the accuracy of online cabbage recognition in open fields. Artif. Intell. Agric. 2025, 15, 449–458. [Google Scholar] [CrossRef]
- Silwal, A.; Parhar, T.; Yandun, F.; Baweja, H.; Kantor, G. A robust illumination-invariant camera system for agricultural applications. In Proceedings of the 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Prague, Czech Republic, 27 September–1 October 2021; IEEE: Piscataway, NJ, USA. [Google Scholar]
- Kurtulmus, F.; Lee, W.S.; Vardar, A. Immature peach detection in colour images acquired in natural illumination conditions using statistical classifiers and neural network. Precis. Agric. 2014, 15, 57–79. [Google Scholar] [CrossRef]
- Dhanush, G.; Khatri, N.; Kumar, S.; Shukla, P.K. A comprehensive review of machine vision systems and artificial intelligence algorithms for the detection and harvesting of agricultural produce. Sci. Afr. 2023, 21, e01798. [Google Scholar] [CrossRef]
- Bruni, V.; Dominijanni, G.; Vitulano, D.; Ramella, G. A perception-guided CNN for grape bunch detection. Math. Comput. Simul. 2025, 230, 111–130. [Google Scholar] [CrossRef]
- Mohimont, L.; Hollard, L.; Steffenel, L.A. Smart-Viticulture and Deep Learning: Challenges and Recent Developments on Yield Prediction. In Smart Life and Smart Life Engineering: Current State and Future Vision; Springer: Cham, Switzerland, 2025; pp. 187–207. [Google Scholar]
- Kamilaris, A.; Prenafeta-Boldu, F. Deep learning in agri-culture: A survey. Comput. Electron. Agric. 2018, 147, 70–90. [Google Scholar] [CrossRef]
- Palacios, F.; Bueno, G.; Salido, J.; Diago, M.P.; Hernández, I.; Tardaguila, J. Automated grapevine flower detection and quantification method based on computer vision and deep learning from on-the-go imaging using a mobile sensing platform under field conditions. Comput. Electron. Agric. 2020, 178, 105796. [Google Scholar] [CrossRef]
- Palacios, F.; Melo-Pinto, P.; Diago, M.P.; Tardaguila, J. Deep learning and computer vision for assessing the number of actual berries in commercial vineyards. Biosyst. Eng. 2022, 218, 175–188. [Google Scholar] [CrossRef]
- Hernández, I.; Gutiérrez, S.; Barrio, I.; Íñiguez, R.; Tardaguila, J. In-field disease symptom detection and localisation using explainable deep learning: Use case for downy mildew in grapevine. Comput. Electron. Agric. 2024, 226, 109478. [Google Scholar] [CrossRef]
- Zhu, J.; Cheng, M.; Wang, Q.; Yuan, H.; Cai, Z. Grape leaf black rot detection based on super-resolution image enhancement and deep learning. Front. Plant Sci. 2021, 12, 695749. [Google Scholar] [CrossRef]
- Xie, X.; Ma, Y.; Liu, B.; He, J.; Li, S.; Wang, H. A deep-learning-based real-time detector for grape leaf diseases using improved convolutional neural networks. Front. Plant Sci. 2020, 11, 751. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Sozzi, M.; Cantalamessa, S.; Cogato, A.; Kayad, A.; Marinello, F. Automatic bunch detection in white grape varieties using YOLOv3, YOLOv4, and YOLOv5 deep learning algorithms. Agronomy 2022, 12, 319. [Google Scholar] [CrossRef]
- Guo, C.; Zheng, S.; Cheng, G.; Zhang, Y.; Ding, J. An improved YOLO v4 used for grape detection in unstructured environment. Front. Plant Sci. 2023, 14, 1209910. [Google Scholar] [CrossRef]
- Zhang, T.-Y.; Li, J.; Chai, J.; Zhao, Z.-Q.; Tian, W.-D. Improved yolov5 network with attention and context for small object detection. In Intelligent Computing Methodologies; Springer: Cham, Switzerland, 2022. [Google Scholar]
- Khanam, R.; Hussain, M. Yolov11: An overview of the key architectural enhancements. arXiv 2014, arXiv:2410.17725. [Google Scholar]
- Badeka, E.; Karapatzak, E.; Karampatea, A.; Bouloumpasi, E.; Kalathas, I.; Lytridis, C.; Tziolas, E.; Tsakalidou, V.N.; Kaburlasos, V.G. A deep learning approach for precision viticulture, assessing grape maturity via YOLOv7. Sensors 2023, 23, 8126. [Google Scholar] [CrossRef] [PubMed]
- Aguiar, A.S.; Magalhães, S.A.; Dos Santos, F.N.; Castro, L.; Pinho, T.; Valente, J.; Martins, R.; Boaventura-Cunha, J. Grape bunch detection at different growth stages using deep learning quantized models. Agronomy 2021, 11, 1890. [Google Scholar] [CrossRef]
- Barriguinha, A.; de Castro Neto, M.; Gil, A. Vineyard yield estimation, prediction, and forecasting: A systematic literature review. Agronomy 2021, 11, 1789. [Google Scholar] [CrossRef]
- Schieck, M.; Krajsic, P.; Loos, F.; Hussein, A.; Franczyk, B.; Kozierkiewicz, A.; Pietranik, M. Comparison of deep learning methods for grapevine growth stage recognition. Comput. Electron. Agric. 2023, 211, 107944. [Google Scholar] [CrossRef]
- Baillod, M.; Baggiolini, M. Les stades reperes de la vigne. In Revue Suisse de Viticulture, Arboriculture, Horticulture; National Library of Australia: Canberra, Australia, 1993; Volume 25. [Google Scholar]
- Tzutalin. LabelImg: Label Image Bounding Boxes for Object Detection. GitHub repository, 2015. Available online: https://github.com/tzutalin/labelImg (accessed on 4 April 2025).
- Ultralytics. YOLOv11 by Ultralytics. 2024. Available online: https://github.com/ultralytics/ (accessed on 4 April 2025).
- Howard, J.; Gugger, S. Deep Learning for Coders with Fastai and PyTorch; O’Reilly Media: Newton, MA, USA, 2020. [Google Scholar]
- Loshchilov, I.; Hutter, F. Decoupled weight decay regularization. arXiv 2017, arXiv:1711.05101. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Qiu, J. YOLO by Ultralytics. GitHub. 2023. Available online: https://github.com/ultralytics/ultralytics/blob/main/CITATION.cff (accessed on 4 April 2025).
- Shorten, C.; Khoshgoftaar, T.M. A survey on image data augmentation for deep learning. J. Big Data 2019, 6, 60. [Google Scholar] [CrossRef]
- Bochkovskiy, A.; Wang, C.-Y.; Liao, H.-Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Ferro, M.V.; Catania, P. Technologies and innovative methods for precision viticulture: A comprehensive review. Horticulturae 2023, 9, 399. [Google Scholar] [CrossRef]
- Íñiguez, R.; Gutiérrez, S.; Poblete-Echeverría, C.; Hernández, I.; Barrio, I.; Tardáguila, J. Deep learning modelling for non-invasive grape bunch detection under diverse occlusion conditions. Comput. Electron. Agric. 2024, 226, 109421. [Google Scholar] [CrossRef]
- Ferrara, G.; Marcotuli, V.; Didonna, A.; Stellacci, A.M.; Palasciano, M.; Mazzeo, A. Ripeness prediction in table grape cultivars by using a portable NIR device. Horticulturae 2022, 8, 613. [Google Scholar] [CrossRef]
- Yu, F.; Zhang, Q.; Xiao, J.; Ma, Y.; Wang, M.; Luan, R.; Liu, X.; Ping, Y.; Nie, Y.; Tao, Z. Progress in the application of cnn-based image classification and recognition in whole crop growth cycles. Remote Sens. 2023, 15, 2988. [Google Scholar] [CrossRef]
- Tan, C.; Sun, J.; Paterson, A.H.; Song, H.; Li, C. Three-view cotton flower counting through multi-object tracking and RGB-D imagery. Biosyst. Eng. 2024, 246, 233–247. [Google Scholar] [CrossRef]
- Miranda, J.C. Open Source Software and Benchmarking of Computer Vision Algorithms for Apple Fruit Detection, Fruit Sizing and Yield Prediction Using RGB-D Cameras. Ph.D. Thesis, University of Lleida, Lleida, Spain, 2024. [Google Scholar]
- Gatou, P.; Tsiara, X.; Spitalas, A.; Sioutas, S.; Vonitsanos, G. Artificial Intelligence Techniques in Grapevine Research: A Comparative Study with an Extensive Review of Datasets, Diseases, and Techniques Evaluation. Sensors 2024, 24, 6211. [Google Scholar] [CrossRef] [PubMed]
Pre-Bloom | Pre-Bloom | Fruit-Set | Fruit-Set | |
---|---|---|---|---|
Cultivar | Day | Night | Day | Night |
Cabernet Sauvignon | 16 | 30 | 10 | 10 |
Malvasia | 18 | 32 | 10 | 10 |
Moscatel | 6 | 32 | 10 | 10 |
Syrah | 20 | 32 | 10 | 10 |
Tempranillo | 19 | 38 | 10 | 10 |
Verdejo | 35 | 38 | 10 | 10 |
Total | 114 | 202 | 60 | 60 |
Pre-Bloom | Pre-Bloom | Fruit-Set | Fruit-Set | Combined | |
---|---|---|---|---|---|
Partition | Day | Night | Day | Night | |
Training (70%) | 78 | 142 | 42 | 42 | 304 |
Validation (20%) | 21 | 40 | 12 | 12 | 85 |
Testing (10%) | 15 | 20 | 6 | 6 | 47 |
Total | 114 | 202 | 60 | 60 | 436 |
Subset | Mean | Median | SD | Min | Max | CV (%) | Skew | Kurt |
---|---|---|---|---|---|---|---|---|
Pre-bloom Day | 7.46 | 7 | 3.74 | 1 | 18 | 50.15 | 0.61 | −0.19 |
Pre-bloom Night | 5.29 | 5 | 2.7 | 0 | 15 | 51.07 | 0.79 | 0.43 |
Fruit-set Day | 8.35 | 8 | 3.52 | 1 | 16 | 42.12 | 0.16 | −0.93 |
Fruit-set Night | 7.53 | 7 | 3.7 | 1 | 17 | 49.15 | 0.81 | 0.16 |
Metric | Pre-Bloom Day | Fruit-Set Day | Pre-Bloom Night | Fruit-Set Night | Combined |
---|---|---|---|---|---|
mAP50 | 0.50 | 0.81 | 0.73 | 0.83 | 0.71 |
mAP | 0.20 | 0.52 | 0.37 | 0.55 | 0.38 |
Precision | 0.64 | 0.82 | 0.75 | 0.85 | 0.82 |
Recall | 0.53 | 0.78 | 0.69 | 0.78 | 0.63 |
F1 Score | 0.58 | 0.80 | 0.72 | 0.81 | 0.72 |
Metric | Pre-Bloom Day | Fruit-Set Day | Pre-Bloom Night | Fruit-Set Night | Combined |
---|---|---|---|---|---|
mAP50 | 0.50 | 0.81 | 0.68 | 0.82 | 0.66 |
mAP | 0.24 | 0.50 | 0.35 | 0.54 | 0.36 |
Precision | 0.66 | 0.89 | 0.71 | 0.84 | 0.75 |
Recall | 0.52 | 0.68 | 0.72 | 0.69 | 0.63 |
F1 Score | 0.58 | 0.77 | 0.71 | 0.76 | 0.68 |
Model | IoU | Confidence | R2 | RMSE | MAE | |||
---|---|---|---|---|---|---|---|---|
Validation | Testing | Validation | Testing | Validation | Testing | |||
Pre-bloom Day | 0.10 | 0.10 | 0.77 | 0.72 | 1.76 | 2.02 | 1.36 | 1.61 |
Pre-bloom Night | 0.30 | 0.50 | 0.88 | 0.76 | 0.96 | 1.09 | 0.69 | 0.82 |
Fruit-set Day | 0.10 | 0.25 | 0.83 | 0.97 | 1.09 | 0.83 | 0.96 | 0.78 |
Fruit-set Night | 0.50 | 0.50 | 0.80 | 0.79 | 1.68 | 1.97 | 1.18 | 1.77 |
Combined | 0.25 | 0.30 | 0.81 | 0.71 | 1.50 | 2.08 | 1.11 | 1.39 |
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
Íñiguez, R.; Poblete-Echeverría, C.; Barrio, I.; Hernández, I.; Gutiérrez, S.; Martínez-Cámara, E.; Tardáguila, J. Impact of Phenological and Lighting Conditions on Early Detection of Grapevine Inflorescences and Bunches Using Deep Learning. Agriculture 2025, 15, 1495. https://doi.org/10.3390/agriculture15141495
Íñiguez R, Poblete-Echeverría C, Barrio I, Hernández I, Gutiérrez S, Martínez-Cámara E, Tardáguila J. Impact of Phenological and Lighting Conditions on Early Detection of Grapevine Inflorescences and Bunches Using Deep Learning. Agriculture. 2025; 15(14):1495. https://doi.org/10.3390/agriculture15141495
Chicago/Turabian StyleÍñiguez, Rubén, Carlos Poblete-Echeverría, Ignacio Barrio, Inés Hernández, Salvador Gutiérrez, Eduardo Martínez-Cámara, and Javier Tardáguila. 2025. "Impact of Phenological and Lighting Conditions on Early Detection of Grapevine Inflorescences and Bunches Using Deep Learning" Agriculture 15, no. 14: 1495. https://doi.org/10.3390/agriculture15141495
APA StyleÍñiguez, R., Poblete-Echeverría, C., Barrio, I., Hernández, I., Gutiérrez, S., Martínez-Cámara, E., & Tardáguila, J. (2025). Impact of Phenological and Lighting Conditions on Early Detection of Grapevine Inflorescences and Bunches Using Deep Learning. Agriculture, 15(14), 1495. https://doi.org/10.3390/agriculture15141495