Professional Documents
Culture Documents
Automated Grapevine Flower Detection and Quantification Method Based On
Automated Grapevine Flower Detection and Quantification Method Based On
a
Televitis Research Group, University of La Rioja, 26006 Logroño, Spain
b
Instituto de Ciencias de la Vid y del Vino (University of La Rioja, CSIC, Gobierno de La Rioja), 26007 Logroño, Spain
c
VISILAB group, University of Castilla-La Mancha, 13071 Ciudad Real, Spain
Keywords: Grape yield forecasting is a valuable economic and quality issue for the grape and wine industry. The number of
Yield estimation flowers at bloom could be used as an early indicator towards crop forecast in viticulture. The purpose of this
Non-invasive sensing technologies work was to develop a non-invasive method for grapevine flower counting by on-the-go image acquisition, using
Precision agriculture a combination of deep learning and computer vision technology. A mobile sensing platform was used at 5 km/h
Vitis vinifera L.
to automatically capture Red Green Blue (RGB) images of vineyard canopy at night using artificial illumination
under field conditions. For the image data set, 96 vines from six grapevine varieties were selected. For ground-
truthing, the number of flowers per inflorescence was counted on a set of clusters before flowering, while yield
per vine was weighted at harvest. The developed algorithm comprised two general steps: inflorescences’ seg-
mentation, and individual flower detection. In both steps, the best results were obtained using the deep fully
convolutional neural network SegNet architecture with a VGG19 network as the encoder, with F1 score values of
0.93 and 0.73 in the inflorescences segmentation and the individual flower detection steps, respectively. These
values showed the high accuracy of the network. A determination coefficient (R2) of 0.91 between the detected
number of flowers and the actual number of flowers per vine was obtained. In addition, a linear regression model
was trained to estimate the actual number of flowers from the number of detected flowers. A root mean squared
error (RMSE) of 590 flowers per vine and a normalized root mean squared error (NRMSE) of 23.7% was ob-
tained. An R2 above 0.70 was achieved between the estimated number of actual flowers and the final yield, per
vine. These results show that the number of flowers per vine can be estimated using machine vision and deep
learning. The developed imaging platform can be used by the wine industry in commercial vineyards for a
satisfactory early crop yield forecasting.
⁎
Corresponding author at: Televitis Research Group, University of La Rioja, 26006 Logroño, Spain.
E-mail address: javier.tardaguila@unirioja.es (J. Tardaguila).
https://doi.org/10.1016/j.compag.2020.105796
Received 2 June 2020; Received in revised form 10 September 2020; Accepted 14 September 2020
Available online 23 September 2020
0168-1699/ © 2020 Elsevier B.V. All rights reserved.
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
(Palacios et al., 2019) as well as to assess crop yield at different phe- presented by Diago et al. (2014). Next steps addressed flower counting
nological stages (Nuske et al., 2014). In this latter work, the authors on inflorescences’ images manually taken under field conditions by the
developed a method for vineyard yield estimation based on berry de- application of morphological image processing and pyramidal decom-
tection in RGB images acquired from a moving vehicle equipped with position (Aquino et al., 2015b). Following these two approaches, sev-
artificial illumination. With the aim of predicting yield from image eral authors presented works for an automated flower detection and
acquisition, several trials have been conducted in different countries at counting in inflorescences’ images taken manually using a dark back-
several phenological stages, ranging from pea-size to harvest. Herrero- ground. Among them, Millan et al. (2017) calibrated and tested several
Huerta et al. (2015) proposed a method for yield estimation at cluster models for the actual number of flowers’ estimation from the visible
level based on 3D cluster modelling from RGB images acquired during flowers, that were automatically detected using an updated version of
day-time at harvest time. Font et al. (2015) used pixel-based image the algorithm presented by Diago et al. (2014). Alternatively,
segmentation methods for detecting red berries in images taken at Radhouane et al. (2016) applied the watershed algorithm for the seg-
night-time using a moving vehicle with embedded artificial illumina- mentation of flowers, while Liu et al. (2018) proposed an alternative
tion during the harvesting period. On the other hand, Liu and Whitty image analysis method based on traditional image feature descriptors
(2015) developed a method for cluster detection and counting on RGB for flower detection and counting, and Tello et al. (2019) used image
images manually acquired from red grapevine plants on field, during morphology analysis and the watershed algorithm for flower counting
day-time, days before harvest. Liu et al. (2017) proposed a grapevine considering several grapevine genotypes.
yield estimation method based on the automatic detection and counting All previous works have addressed the visible flower counting and
of vine shoots as early as two weeks after budburst. Aquino et al. (2018) actual number of flowers’ estimation using traditional image analysis
presented an algorithm for berry detection and quantification on RGB methods. Other works have handled this problem by applying more
images taken at night-time using artificial illumination at phenological recent techniques of deep learning and semantic segmentation.
stages around bunch closure. Later in the season, Millan et al. (2018) Rudolph et al. (2019) developed an algorithm based on segmenting
developed a new methodology based on segmenting grapevine clusters inflorescences using a Fully Convolutional Network (FCN, Long et al.,
on RGB images acquired one day before harvest, and estimating the 2015) and counting flowers using the Circular Hough Transform (CHT)
number of berries using a Boolean model. While several conditions and on manually acquired vine images under natural conditions. Grimm
phenological stages have been tested in these works, none of them has et al. (2019) presented a semantic segmentation framework for detec-
addressed the grapevine flower counting for crop forecasting in viti- tion and quantification of plant organs (inflorescences and flowers
culture, even though flower number per inflorescence is one of the main among them) in vine images acquired manually under field conditions.
determinants of grapevine yield (May 2005). Likewise, after budburst, Nowadays, no previous work has attempted to count flowers in
the processes of flowering, fertilization and fruit-set (a flower trans- commercial vineyards, using images acquired on-the-go from a mobile
forms into a berry) are determinant of cluster components and final platform. This is a relevant task for grapegrowers in order to develop a
yield. Fruit-set determines the final number of berries per cluster, and new, and rapid approach to early crop forecast, particularly valuable in
together with berry weight, will determine cluster weight at harvest. the context of precision viticulture.
Then, this cluster weight and the number of clusters will define the final Likewise, the main goal of this work was to develop a new, non-
yield in a given season. Approximately 60–70% of annual yield varia- destructive, automated method to detect and quantify the visible flower
tion is explained by the number of clusters, while the remaining number per vine under field conditions, and to estimate the actual
30–40% is accounted by variations in cluster weight (Clingeleffer number of flowers, with the aim of providing an early crop yield esti-
2001). Of these, the number of berries per cluster is reported to be more mation. Computer vision and deep learning was used for processing
determinant in cluster weight than berry weight (Dunn, 2010). Since RGB images acquired in commercial vineyards using a mobile imaging
the number of clusters is mostly fixed at winter pruning, assessing the platform. The amount of flowers per vine was related to yield in order
number of berries per cluster becomes then, essential for a proper and to explore a new approach for early crop forecast, several months be-
early yield estimation, and this, in turn, is dependent on the number of fore harvest, in commercial vineyards.
flowers. Both the number of flowers per inflorescence, also known as
fruitfulness, and the fruit-set rate are highly dependent on the en- 2. Materials and methods
vironmental conditions of both the previous and current seasons (May
2005), such as light, temperature and water availability, with other 2.1. Experimental layout
factors, like the variety, and some agronomical practices being also
important (Krstic et al., 2005). However, the knowledge of the number The trials were carried out during season 2018 in a commercial
of flowers may be highly relevant for early yield estimation should vineyard located in Vergalijo (lat. 42°27′46.0″ N; long. 1°48′13.1″ W;
average fruit set rate and average berry weight for a given vineyard Navarra, Spain). Six grapevine (Vitis vinifera L.) varieties were selected,
plot, or cultivar in a given grapegrowing area over a series of seasons three red (Syrah, Tempranillo, Cabernet Sauvignon) and three white
are known. Provided these values are available (or may be started to be (Verdejo, Malvasia and Muscat of Alexandria). The vines were trained
recorded yearly) then, a suitable yield estimation three to four months onto a vertical shoot positioned (VSP) trellis system with 2 m row
prior to harvest can be attained, unless hail or other adverse meteor- spacing and 1 m vine spacing. Vineyard was partially defoliated prior to
ological events take place during the growing season. image acquisition at flowering stage. An overall set of 96 vines (16
Until some years ago, flower counting per inflorescence had been vines per variety) were labelled and delimited vertically using warning
manually and destructively performed (Dunn and Martin, 2003). The tape (see Fig. 1).
first works reporting non-destructive vine flower counting using com-
puter vision date to 2014, when Diago et al. (2014) presented an al- 2.2. Image acquisition
gorithm based on image analysis for visible flower counting and the
estimation of the actual number of flowers in inflorescences’ images The RGB images were acquired on 21st May 2018, 9 days before full
manually taken. These authors used a black background to ease the flowering (109 days before harvest). A mobile platform developed at
segmentation process of the inflorescences by applying the extended- the University of La Rioja was employed for on-the-go image acquisi-
maxima transform for counting the number of brighter areas in the tion in the vineyard (Fig. 2) at a speed of 5 Km/h. The platform con-
segmented inflorescences, which usually corresponded to the flowers. sisted of a modified all-terrain-vehicle, ATV (Trail Boss 330, Polaris
Following this approach, Aquino et al. (2015a) developed an applica- Industries, Minnesota, USA), in which a structure with artificial illu-
tion for Android smartphones based on the methodology and analysis mination and a system for automated RGB image acquisition was
2
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
3
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 3. Image processing stages: a) Initial full resolution image, b) inflorescences’ segmentation, and c) flowers’ detection.
each pixel is labelled with its predicted class. architecture while the other one utilized the watershed algorithm. The
The SegNet was trained with a set of 187 image patches of which 61 third method relied on estimating the number of visible flowers from
of them contained inflorescences, while the remaining 126 included the area (in pixels) of the segmented inflorescences using a linear re-
other elements that were present in the images (e.g. leaves, trunk or gression model.
ground). In this set, image patches were pixel-wise manually labelled
(Fig. 4), and then a data augmentation process was applied in order to
increase the variability and the amount of data until a final set of 2440 2.4.2.1. SegNet flower detection approach. For the SegNet approach a
images (1220 with inflorescences and 1220 without them) was ob- VGG19 architecture was employed. A set of 35 images containing only a
tained and used during training. The first transformations applied to the group of flowers per image were manually labelled into three classes:
original images in the data augmentation process were image rotations “contour”, “center” and “background”, which corresponded to the
(90° and 180°) and image flipping (vertical and horizontal). Then, the contour of the flowers, the center, and the rest of the image,
original images and the new generated ones after the transformations respectively (Fig. 6). The data augmentation from the previous step
were convoluted with a gaussian kernel considering two sigma values was also applied to obtain a set of 700 images, and this set was used to
(2 and 4). In addition, a contrast enhancement was applied using the train the VGG19 model.
Contrast-limited adaptive histogram equalization (CLAHE) algorithm After segmentation, a false positive filtering of the flower segmen-
(Fig. 5) (Zuiderveld, 1994). The mentioned data augmentation adds tation was employed. It was based on considering as true positive those
robustness in segmenting inflorescences photographed at different flowers whose center and contour were segmented, and their contour
distances, where far-located inflorescences appear unfocused on the was surrounding the center above a certain threshold. It was observed
images and those closer to the camera exhibit higher contrast in the that, in the raw segmentation produced by the model, the structures of
separation between the flowers. pixels that did not had pixels of the “center” class or a small group of
the “contour” class, tended to be wrong artifacts that belonged to the
“background” class (Fig. 7). Several threshold values of pixels from the
2.4.2. Individual flower detection
“contour” class surrounding pixels from the “center” class were tested
Three different methods were tested for flower quantification. Two
for removing these artifacts, ranging from no filtering (no removal of
of them relied on the identification and counting of each individual
any pixel groups) to removing groups with less than 80% of the peri-
flower of the previously segmented inflorescences. For both, a seg-
meter of their center surrounded by “contour” class pixels (see Table 2)
mentation approach was followed. One of them used the SegNet
4
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
higher if the group is closer to the camera (as it would look larger on the
image) and it will be lower if the group is farther to the camera (as it
would look smaller on the image).
TP
Recall =
TP + FN (2)
Precision × Recall
F1 = 2 ×
Precision + Recall (3)
TP
Fig. 4. Manual labelling of inflorescences: a) Original image patch and b) the IoU =
TP + FP + FN (4)
corresponding manually labelled mask, where pixels containing inflorescences
are represented with white colour. The IoU metric was calculated for both the “inflorescence” and
“background” classes, and identified as IoUI and IoUB respectively.
2.4.2.2. Watershed flower segmentation approach. The watershed Also, the average between IoU of both classes was calculated and
algorithm (Meyer, 1994) segments an image into several pixel blocks identified as mIoU. To compare the performance of the values tested for
of different sizes and shapes. This segmentation is performed by the parameters in the flower detection step (contour filtering and h
“flooding” the local minima in the image until a maximum is value, for SegNet and watershed approaches, respectively), only recall,
reached. Previously, the local minima corresponding to flower centers precision and F1 score were considered. For evaluating TP, FP and FN
had to be detected (Fig. 8). The extended-minima transform, which is on this step, the flowers centers were manually checked. If a connected
described as the regional minima of the h-minima transform (Soille, component of pixels segmented as flower class surround the manually
1999), was applied in order to extent the local minima corresponding to checked flower center, that connected component is considered a true
flower centers and suppress the rest of them, so as to reduce the positive and that flower cannot be detected again. In that sense, if
“oversegmentation” that produces the watershed segmentation flower detection method has segmented several pixel groups on the
(excessive number of segmented blocks). Several h values for the the same flower, only one of them will be considered a true positive while
h-minima transform were considered and their performance was tested. the rest will be false positives. Also, if a flower center is not surrounded
by any connected component of pixels segmented as flower class, that
2.4.2.3. Linear model estimation approach. A linear regression model flower was considered a false negative.
was tuned using the number of pixels of the segmented groups of The linear model estimator relies on a regression approach to obtain
flowers from the set of 35 images used in the SegNet flower detection the number of visible flowers. Therefore, the previous described metrics
approach to estimate the number of visible flowers. Mathematically this cannot be applied. The root-mean-square error (RMSE) metric between
is represented as y = ax + b, where y represents the number of visible the number of manually labelled flowers and the number of visible
flowers and x the area in pixels. This method is a simpler approach than flowers estimated was considered instead for this model, and it was
the SegNet and watershed detection methods. While this method had compared to the RMSE obtained between the number of manually la-
the advantage of not needing distinguishable flowers in the image (it belled flowers and the number of detected flowers in the SegNet and
only needs properly segmented group of flowers), it also had the issue watershed approaches. Also, the normalized root-mean-square error
of not being scale invariant, this means that the model will estimate (NRMSE) was employed. It was calculated as the ratio of RMSE over the
different numbers of visible flowers for a given group of flowers average of the number of manually labelled flowers, expressed as a
depending on their distance to the camera. The estimation will be percentage.
5
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 5. Data augmentation: a) Original image patch, results of the convolution with a gaussian kernel considering b) σ = 2 and c) σ = 4, and applying d) a contrast
enhancement using CLAHE algorithm.
the inflorescences extraction step), and the other one contained the
centers of the visible flowers, to evaluate the flower’s detection and
quantification step (Fig. 11).
In addition, the whole set of images acquired from the 96 vines were
processed and the results for each vine were grouped, in order to obtain
a number of flowers per vine, which were then compared to the actual
number of flowers estimated by the algorithm described by Millan et al.
(2017).
Fig. 6. Manual labelling of individual flowers: a) Original image patch and b) It can be observed in Table 1 that both models yielded similar re-
the corresponding manually labelled mask, where pixels in red colour re- sults in terms of IoU for the background class (IoUB). However, for all
presents flower contours and pixels in blue colour represents flower centers. other metrics the VGG19 model outperformed the VGG16 model, this
being particularly evident for F1 and the IoU. The VGG19 model
2.4.2.6. Image processing validation set. A set of 24 full-resolution overcame the FCN-segmentation model presented by Rudolph et al.
(6720 × 4480 pixels) images, six per variety, were manually labelled (2019) in terms of IoU, where a mean Intersection Over Union (mIoU)
to evaluate the performance of the whole algorithm. For each image, of 0.876 and a IoU of 0.760 for the inflorescence class were obtained,
two masks were tagged, one contained the ground truth of the while the VGG19 model presented in this work achieved a mIoU of
segmentation of the inflorescences (to evaluate the performance of 0.935 and a IoU of 0.871 for the inflorescence class.
6
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 8. Watershed flower segmentation: a) Original image patch, and b), c) and d) corresponding watershed segmentation masks considering several h values, where
pixels in white colour represent the blocks segmented by the watershed algorithm.
method is more precise than the watershed method, but it is also more
restrictive, as it detected a lower number of flowers.
The linear model estimator differs from the previous detection
methods (SegNet and Watershed) on being a regression approach in-
stead of a classification technique. Therefore, RMSE and NRMSE me-
trics were chosen instead, to compare the linear model estimator
against the flower detection methods. The results presented in Table 5
show that the linear model yielded its best result for Cabernet Sau-
vignon variety with a RMSE of 111 flowers, which corresponds to
10.17% of the average of the number of manually labelled flowers, and
a poorer result for Muscat of Alexandria, with a RMSE of 437 flowers
and a NRMSE of 48.95%. For the watershed approach, while the lower
RMSE was obtained for Syrah, 170 flowers, in terms of NRMSE the best
result was obtained for Tempranillo, with a 27.84%, while the lowest
performance was found for Malvasia. The SegNet method yielded the
most favourable outcomes for the Tempranillo variety, with a RMSE
and a NRMSE of 27 flowers and 4.43%, respectively, and performed less
satisfactorily for Verdejo, with a RMSE of 222 flowers and a NRSME of
19%.
Fig. 9. Patch extraction and overlapping: Two consecutive image patches ex-
In general terms, the SegNet was found to provide the best ap-
tracted from a full resolution image for the segmentation of the inflorescences,
represented in blue and red colour. The overlapping region is represented with proach, as it yielded the best results considering each variety in-
yellow stripes. dependently and combining all varieties in the full test set. The dif-
ferences in the performance between varieties could be related to
differences in the morphology and the number of flowers per in-
3.2. Individual flower detection and quantification
florescence. In general terms, those varieties with higher number of
flowers per inflorescence (see Table 6), such as Verdejo, Malvasia and
For the VGG19 flower segmentation model, several threshold values
Muscat of Alexandria, were associated with lower performances for all
were tested for the flower contour filtering. As shown in Table 2, in-
three detection and quantification methods (see Table 5). Potentially,
creasing the filtering led to an enhancement in precision and a decrease
higher occlusion effects among flower buttons in those varieties whose
in recall. Of the contour filtering values tested, the highest recall was
inflorescences are naturally bearing larger number of flowers would
obtained when no filtering was applied, while the highest precision was
lead to lower performance in flower detection and quantification. The
obtained when the segmented flowers with less than an 80% of the
results in terms of F1-Score in this work, with a value of 0.729, are
contour segmented were removed. The balance between precision and
similar to the ones obtained by the circular Hough transform approach
recall is determined by the F1 score. This metric achieved its highest
presented by Rudolph et al. (2019), who reported a value of 0.752, and
value when the contour filtering was set at the 50%, yielding a F1 score
inferior to the results obtained by Grimm et al. (2019), who obtained a
of 0.729.
F1-Score of 0.867, where a deep learning semantic segmentation ap-
In the watershed approach, several h values from the h-minima
proach was also applied. In contrast to those works, in which all images
transform were tested for the raw images (see Table 3), and after ap-
were manually taken, in this study the image acquisition process was
plying contrast enhancement using the CLAHE algorithm (see Table 4).
automated, the camera was positioned at a constant distance in order to
Similarly to the SegNet approach, increasing the h value produced an
capture as much of each vine as possible, and its parameters remained
increase in precision and a decrease in recall. In general terms for the F1
fixed for all images. That also implied that the focus of the camera
score, this approach yielded poorer results than the SegNet approach.
remained constant during the image acquisition, which made it difficult
Highly similar results were found between the segmentations without
to obtain clear images of all inflorescences. Likewise, some of the in-
preprocessing and after applying the CLAHE algorithm, being slightly
florescences in the images were blurred and their flowers were hardly
superior the first one. The best result was obtained at fixing the h value
distinguishable, which affected the presented results.
to 0.05, getting a F1 score of 0.708 (see Table 3).
Comparing the two flower detection methods, the SegNet method
with 50% of contour filtering achieved better results than the wa- 3.3. Early yield prediction based on flower number
tershed method with 0.05 of h value in terms of F1 score and precision,
while recall was higher for watershed. This implies that the SegNet The results shown in Fig. 12 refer to the high correlation between
7
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 10. Inflorescence segmentation confidence score and thresholding: a) A section of the original image, b) the corresponding confidence score image, where a
lighter colour represents a higher confidence score, and c) final segmentation, where the pixels that exceeded the threshold are represented in purple.
Fig. 11. Masks manually labelled for testing the full processing algorithm's performance: a) A section of the original image and b) and c) the manually labelled masks
containing inflorescences and the flower’s centers, respectively.
Table 1
Inflorescences segmentation performance metrics for VGG16 vs. VGG19 architecture calculated over the image validation set and expressed as the average value of
the metric ± standard deviation in percentage.
Architecture Precision Recall F1-Score IoUI IoUB mIoU
VGG16 0.928 ± 2.90% 0.839 ± 5.65% 0.880 ± 3.49% 0.788 ± 5.58% 0.998 ± 0.09% 0.893 ± 2.80%
VGG19 0.974 ± 1.88% 0.893 ± 5.66% 0.930 ± 3.15% 0.871 ± 5.45% 0.999 ± 0.06% 0.935 ± 2.74%
IoUI: Intersection over Union for “inflorescence” class; IoUB: Intersection over Union for “background” class; mIoU: average between Intersection over Union for
“inflorescence” and “background” classes
8
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Table 2 Table 6
Flower detection performance metrics for SegNet-VGG19 architecture calcu- Statistical metrics of the number of flowers in each inflorescence per variety
lated over the image validation set and expressed as the average value of the calculated over the validation set of 24 full-resolution images.
metric ± standard deviation in percentage (best result is in bold face).
Grapevine variety Statistical metric
Contour filtering Precision Recall F1-Score
Min Max Average Median Std Deviation
No Filtering 0.567 ± 11.42% 0.827 ± 6.30% 0.663 ± 7.68%
35% 0.696 ± 8.39% 0.768 ± 6.62% 0.726 ± 5.74% Cabernet Sauvignon 15 763 357.04 366 160.67
50% 0.747 ± 7.53% 0.718 ± 7.03% 0.729 ± 5.81% Malvasia 44 771 364.53 361 154.50
65% 0.826 ± 5.81% 0.622 ± 8.05% 0.707 ± 6.42% Muscat of Alexandria 126 776 391.10 383 131.46
80% 0.869 ± 4.39% 0.466 ± 8.82% 0.603 ± 8.17% Syrah 28 489 172.09 169 71.66
Tempranillo 38 478 237.27 226 98.99
Verdejo 6 1331 510.03 524 216.97
Table 3
Flower detection performance metrics for Watershed calculated over the image
validation set and expressed as the average value of the metric ± standard
deviation in percentage (best result is in bold face).
h value Precision Recall F1-Score
Table 4
Flower detection performance metrics for Watershed with CLAHE preproces-
sing calculated over the image validation set and expressed as the average value
Fig. 12. Correlation between the number of automatically detected flowers by
of the metric ± standard deviation in percentage (best result is in bold face).
the algorithm, using the SegNet-VGG19 for inflorescences’ extraction and
h value Precision Recall F1-Score flower detection steps, and the real number of flowers, obtained by the esti-
mator of Millan et al. (2017), per vine and combining all varieties.
0.01 0.325 ± 5.87% 0.943 ± 4.69% 0.479 ± 6.15%
0.05 0.676 ± 13.08% 0.791 ± 14.30% 0.705 ± 6.78%
0.10 0.829 ± 8.77% 0.627 ± 18.67% 0.686 ± 12.97% the number of flowers detected by the developed algorithm, using the
0.15 0.895 ± 5.40% 0.477 ± 18.63% 0.594 ± 17.18% SegNet-VGG19 for inflorescences’ extraction and flower detection steps,
0.20 0.928 ± 3.47% 0.350 ± 15.52% 0.485 ± 16.86%
0.25 0.939 ± 2.70% 0.242 ± 11.34% 0.371 ± 14.20%
and the total number of flowers estimated by the model of Millan et al.
0.27 0.944 ± 2.59% 0.210 ± 9.80% 0.332 ± 12.86% (2017). The correlation per variety between the two parameters is
0.30 0.945 ± 2.75% 0.168 ± 7.81% 0.278 ± 10.83% shown in Fig. 13, where the R2 metric is close to or above 0.75 in all
0.33 0.946 ± 3.03% 0.138 ± 6.10% 0.235 ± 8.87% cases.
0.35 0.949 ± 2.94% 0.122 ± 5.29% 0.212 ± 7.90%
These results suggest that a linear model can be applied to estimate
CLAHE: Contrast-limited adaptive histogram equalization. the total number of flowers per vine from the number of automatically
detected flowers by the developed algorithm, under conditions of par-
Table 5 tial defoliation of the vines, which calls for a parsimonious approach. In
Flower detection and quantification methods comparative calculated over the this work partial defoliation was conducted just before image acquisi-
validation set of 24 full-resolution images for each variety independently and tion, as described previously. This implied the removal of one or two (at
combining all varieties in the full test set. most) leaves per shoot to favour the visibility of the inflorescences. It
could be thought that this leaf removal around flowering might nega-
Grapevine Method
variety tively impact fruit-set (leading to reduced fruit-set), as it is described in
LM Watershed (h = 0.05) SegNet-VGG19 most early defoliation works (Poni et al., 2006; Tardaguila et al., 2010).
(CF = 50%) However, in these works, the intensity of manual early defoliation
leading to significantly reduced fruit-set, hence yield, was at least four
RMSE NRMSE RMSE NRMSE RMSE NRMSE
to eight leaves per vine (Diago, 2010), and involved lateral removal as
Cabernet 111 10.2% 398 36.6% 103 9.5% well in some cases (Intrieri et al., 2008). Therefore, despite the fact that
Sauvignon the effect of removing one or two leaves per shoot prior to image ac-
Malvasia 238 30.8% 650 83.9% 90 11.6% quisition in fruit set and final yield should be properly assessed, existing
Muscat of 437 48.9% 441 49.5% 105 11.8%
Alexandria
literature about early defoliation suggests that no significant effect in
Syrah 149 27.0% 170 30.9% 73 13.3% yield should be expected. Two cross-validation methods were applied to
Tempranillo 126 20.5% 171 27.8% 27 4.4% test the performance of the linear regression approach for the estima-
Verdejo 181 15.4% 459 39.3% 222 19.0% tion of the total number of flowers using the number of detected
Average 207 25.5% 382 44.7% 103 11.6%
flowers. A 6-fold cross validation, where each test fold corresponded to
Full test set 235 27.7% 417 49.2% 119 14.1%
the whole set of 16 vines from a variety (therefore, training with 5
LM: Linear model; CF: Contour filtering. varieties and leaving the remaining for test), and leave-one-out, where
each test fold corresponded to one vine (therefore, training with 95
9
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 13. Correlation between the number of automatically detected flowers by the algorithm, using the SegNet-VGG19 for inflorescences’ extraction and flower
detection steps, and the real number of flowers, obtained by the estimator of Millan et al. (2017), per vine for each variety: a) Cabernet Sauvignon, b) Malvasia, c)
Muscat of Alexandria, d) Syrah, e) Tempranillo and f) Verdejo.
10
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Fig. 14. Correlation between the actual number of flowers (estimated by the linear model) and the yield weighted per vine, for each grape variety: a) Cabernet
Sauvignon, b) Malvasia, c) Muscat of Alexandria, d) Syrah, e) Tempranillo and f) Verdejo.
However, the existing knowledge of historical data of fruit-set rates and Other works have addressed the problem of early yield estimation using
average berry weight for a given plot or variety in a certain area from information obtained from images acquired on field using a moving
previous seasons, and the acquisition of additional records year after platform and the correlation between the visible detected fruit and the
year, may be a valuable source of data for yield estimation using the actual yield, although not at the flowering phenological stage. Aquino
automated flower counting described in this work. et al. (2018), using data acquired at pea-size stage, multiplied the
These strong correlations suggest that final yield can be accurately number of berries detected and the average berry weight, calculated
predicted per vine very early, near four months before harvest, using from historical data from the previous season, to obtain the ‘visible’
their total number of flowers estimated from the number of flowers yield per segment (defined in their work as three consecutive vines).
detected in RGB images by an automated method based on computer Then, the visible yield was correlated to the actual weighted yield in
vision, assuming that no other environmental factors impair the natural order to obtain a linear model that was used to estimate the actual yield
plant development (such as frost or hail damage). This opens a gateway per segment. They achieved an R2 of 0.74 between the number of de-
to a new earlier vineyard yield estimation approach, which would be tected berries and the actual yield, which is a determination coefficient
highly useful for grape growers. They could benefit from this knowl- similar to the ones presented in this work. Nuske et al. (2014) corrected
edge for an early decision making in the vineyard and harvesting the number of detected berries using an equation to estimate de number
scheduling and logistics. of visible berries, and used another equation to relate the visible fruit to
In this work, no yield prediction tests have been carried out as this the total fruit and estimate the yield, including historical yield data in
was beyond the scope of this work, but it’s part of on-going research. the equation. They analyzed the correlations between the detected
11
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
berry count and the actual yield per variety, and achieved determina- Innovation and Universities with a Ramon y Cajal grant RYC-2015-
tion coefficients (R2) between 0.60 and 0.73, which are also similar to 18429.
the ones obtained in this work.
The algorithm developed in this work was able to detect and References
quantify the number of flowers on RGB images acquired at night-time
from a moving platform. This system could be improved by processing Aquino, A., Millan, B., Gaston, D., Diago, M.-P., Tardaguila, J., 2015a. vitisFlower®: de-
images taken during day-time conditions, in order to increase the velopment and testing of a novel android-smartphone application for assessing the
number of grapevine flowers per inflorescence using artificial vision techniques.
working time limitation in commercial applications in the grape and Sensors 15, 21204–21218. https://doi.org/10.3390/s150921204.
wine industry. Additional pre-processing and data augmentation tech- Aquino, A., Millan, B., Gutiérrez, S., Tardáguila, J., 2015b. Grapevine flower estimation
niques should be tested to enhance the algorithm performance on those by applying artificial vision techniques on images with uncontrolled scene and multi-
model analysis. Comput. Electron. Agric. 119, 92–104. https://doi.org/10.1016/j.
images where inflorescences appear blurred. compag.2015.10.009.
For the estimation of the total number of flowers, several canopy Aquino, A., Millan, B., Diago, M.-P., Tardaguila, J., 2018. Automated early yield pre-
and defoliation conditions could be also tested for the analysis of the diction in vineyards from on-the-go image acquisition. Comput. Electron. Agric. 144,
26–36. https://doi.org/10.1016/j.compag.2017.11.026.
influence of the occlusion phenomenon, incorporating this information
Badrinarayanan, V., Kendall, A., Cipolla, R., 2017. SegNet: A deep convolutional encoder-
into more advanced machine learning models. decoder architecture for image segmentation. IEEE Trans. Pattern Anal. Mach. Intell.
39, 2481–2495. https://doi.org/10.1109/TPAMI.2016.2644615.
Clingeleffer, P.R., 2001. Crop development, crop estimation and crop control to secure
4. Conclusions quality and production of major wine grape varieties. A national approach. In: Final
report to the Grape and Wine Research and Development Corporation. Project n°CSH,
The results presented show that the algorithm developed in this pp. 96/1..
Coombe, B.G., 1973. The regulation of set and development of the grape berry. In: Acta
system was able to detect and quantify the number of grapevine flowers Horticulturae. International Society for Horticultural Science (ISHS), Leuven,
in RGB images. These images were acquired under field conditions Belgium, pp. 261–274. https://doi.org/10.17660/ActaHortic.1973.34.36.
using a mobile sensing platform. Daimary, D., Bora, M.B., Amitab, K., Kandar, D., 2020. Brain Tumor Segmentation from
MRI Images using Hybrid Convolutional Neural Networks. Procedia Comput. Sci.
The new developed algorithm was composed of two steps. In the 167, 2419–2428. https://doi.org/10.1016/j.procs.2020.03.295.
first step, the ROI containing only inflorescences in the image is seg- Diago, M.P., 2010. Estudio y desarrollo del deshojado precoz como técnica para el control
mented. In the second step, the flowers are detected and quantified in del rendimiento productivo de la vid (Vitis vinifera L.). Efectos sobre el desarrollo
vegetativo, los componentes de la producción, así como sobre la composición de la
the ROI segmented in the previous step. The VGG19 trained model
uva y del vino. PhD Thesis. Universidad de La Rioja (Spain).
achieved the best results in both steps Diago, M.P., Sanz-Garcia, A., Millan, B., Blasco, J., Tardaguila, J., 2014. Assessment of
The number of flowers detected by this method proved to be highly flower number per inflorescence in grapevine by image analysis under field condi-
correlated to the actual number of flowers per vine. Finally, a linear tions. J. Sci. Food Agric. 94, 1981–1987. https://doi.org/10.1002/jsfa.6512.
Diago, M.P., Aquino, A., Millan, B., Palacios, F., Tardaguila, J., 2019. On-the-go assess-
model was trained to estimate the actual number of flowers per vine, ment of vineyard canopy porosity, bunch and leaf exposure by image analysis. Aust.
and the estimation was correlated to the final yield at harvest for dif- J. Grape Wine Res. 25, 363–374. https://doi.org/10.1111/ajgw.12404.
ferent variety. The strong correlations between the estimated actual Dunn, G.M.; Martin, S.R. 2003. The current status of crop forecasting in the australian
wine industry. In Proceedings of the ASVO Seminar Series: Grapegrowing at the Edge,
number of flowers and the final yield proved that the algorithm pre- Tanunda, Barossa Valley, South Australia, pp. 4–8.
sented in this work is highly valuable for an early yield estimation near Dunn, G.M., 2010. Yield forecasting. Australian Government: Grape and wine research
four months before harvest. and development corporation. Fact sheet. June 2010. https://www.wineaustralia.
com/getmedia/5304c16d-23b3-4a6f-ad53-b3d4419cc979/201006_Yield-
Forecasting.pdf.
CRediT authorship contribution statement Font, D., Tresanchez, M., Martínez, D., Moreno, J., Clotet, E., Palacín, J., 2015. Vineyard
Yield estimation based on the analysis of high resolution images obtained with ar-
tificial illumination at night. Sensors 15, 8284–8301. https://doi.org/10.3390/
Fernando Palacios: Conceptualization, Methodology, Software, s150408284.
Validation, Formal analysis, Investigation, Data curation, Writing - Grimm, J., Herzog, K., Rist, F., Kicherer, A., Töpfer, R., Steinhage, V., 2019. An adaptable
original draft, Writing - review & editing. Gloria Bueno: Methodology, approach to automated visual detection of plant organs with applications in grape-
vine breeding. Biosyst. Eng. 183, 170–183. https://doi.org/10.1016/j.biosystemseng.
Validation, Resources, Writing - review & editing, Supervision. Jesús 2019.04.018.
Salido: Methodology, Validation, Resources, Writing - review & Herrero-Huerta, M., González-Aguilera, D., Rodriguez-Gonzalvez, P., Hernández-López,
editing, Supervision. Maria P. Diago: Conceptualization, Resources, D., 2015. Vineyard yield estimation by automatic 3D bunch modelling in field con-
ditions. Comput. Electron. Agric. 110, 17–26. https://doi.org/10.1016/j.compag.
Writing - review & editing, Supervision, Project administration. Inés 2014.10.003.
Hernández: Software, Data curation, Writing - review & editing. Javier Howell, G.S., 2001. Sustainable grape productivity and the growth-yield relationship: A
Tardaguila: Conceptualization, Validation, Resources, Writing - review review. Am. J. Enology Viticulture 52, 165–174.
Intrieri, C., Filipetti, I., Allegro, G., Centinari, M., Poni, S., 2008. Early defoliation (hand
& editing, Supervision, Project administration, Funding acquisition. vs mechanical) for improved crop control and grape composition in Sangiovese (Vitis
vinifera L.). Aust. J. Grape Wine Res. 14, 25–32. https://doi.org/10.1111/j.1755-
Declaration of Competing Interest 0238.2008.00004.x.
Kicherer, A., Klodt, M., Sharifzadeh, S., Cremers, D., Töpfer, R., Herzog, K., 2017.
Automatic image-based determination of pruning mass as a determinant for yield
The authors declare that they have no known competing financial potential in grapevine management and breeding. Aust. J. Grape Wine Res. 23,
120–124.
interests or personal relationships that could have appeared to influ- Kliewer, W.M., Casteel, T., 2003. Canopy Management. In: Hellman, E. (Ed.), Oregon
ence the work reported in this paper. Viticulture. Oregon State University Press, Corvallis, OR, pp. 177–184.
Krstic, M., Clingeleffer, P., Dunn, G., Martin, S., Petrie, P., 2005. Grapevine growth and
reproduction: an overview, in: Transforming Flowers to Fruit. In: Proceedings ASVO
Acknowledgements Conference, pp. 7–10.
Liu, S., Whitty, M., 2015. Automatic grape bunch detection in vineyards with an SVM
Authors would like to thank Ignacio Barrio, Eugenio Moreda and classifier. J. Appl. Logic 13, 643–653. https://doi.org/10.1016/j.jal.2015.06.001.
Liu, S., Cossell, S., Tang, J., Dunn, G., Whitty, M., 2017. A computer vision system for
Saúl Río for their help collecting field data. early stage grape yield estimation based on shoot detection. Comput. Electron. Agric.
137, 88–101. https://doi.org/10.1016/j.compag.2017.03.013.
Liu, S., Li, X., Wu, H., Xin, B., Tang, J., Petrie, P.R., Whitty, M., 2018. A robust automated
Funding flower estimation system for grape vines. Biosyst. Eng. 172, 110–123. https://doi.
org/10.1016/j.biosystemseng.2018.05.009.
Fernando Palacios would like to acknowledge the research founding Long, J., Shelhamer, E., Darrell, T., 2015. Fully convolutional networks for semantic
segmentation. In: 2015 IEEE Conference on Computer Vision and Pattern Recognition
FPI grant 286/2017 by Universidad de La Rioja, Gobierno de La Rioja.
(CVPR), pp. 3431–3440. https://doi.org/10.1109/CVPR.2015.7298965.
Dr Maria P. Diago is funded by the Spanish Ministry of Science,
12
F. Palacios, et al. Computers and Electronics in Agriculture 178 (2020) 105796
Martin, R.D.S., Dunn, G., 2003. How to forecast wine grape deliveries. Technique report, Afr. J. Agric. Res. 11, 3203–3209. https://doi.org/10.5897/AJAR2016.11331.
Department of Primary Industries. Rudolph, R.I., Herzog, K., Töpfer, R., Steinhage, V., 2019. Efficient identification, loca-
May, P., 2005. Flowering and fruitset in grapevines. Lythrum Press, Adelaide (Australia). lization and quantification of grapevine inflorescences and flowers in unprepared
Meyer, F., 1994. Topographic distance and watershed lines. Signal Process. 38, 113–125. field images using Fully Convolutional Networks. Vitis: J. Grapevine Res. 58, 95–104.
https://doi.org/10.1016/0165-1684(94)90060-4. https://doi.org/10.5073/vitis.2019.58.95-104.
Millan, B., Aquino, A., Diago, M.P., Tardaguila, J., 2017. Image analysis-based modelling Ruiz-Santaquitaria, J., Pedraza, A., Sánchez, C., Libreros, J.A., Salido, J., Deniz, O.,
for flower number estimation in grapevine. J. Sci. Food Agric. 97, 784–792. https:// Blanco, S., Cristóbal, G., Bueno, G., 2019. Deep Learning Versus Classic Methods for
doi.org/10.1002/jsfa.7797. Multi-taxon Diatom Segmentation. In: Morales, A., Fierrez, J., Sánchez, J.S., Ribeiro,
Millan, B., Velasco-Forero, S., Aquino, A., Tardaguila, J., 2018. On-the-go grapevine yield B. (Eds.), Pattern Recognition and Image Analysis. Springer International Publishing,
estimation using image analysis and boolean model. Journal of Sensors 2018, Cham, pp. 342–354.
9634752. https://doi.org/10.1155/2018/9634752. Siam, M., Elkerdawy, S., Jagersand, M., Yogamani, S., 2017. Deep semantic segmentation
Nuske, S., Wilshusen, K., Achar, S., Yoder, L., Narasimhan, S., Singh, S., 2014. Automated for automated driving: Taxonomy, roadmap and challenges. In: 2017 IEEE 20th
visual yield estimation in vineyards. J. Field Rob. 31, 837–860. https://doi.org/10. International Conference on Intelligent Transportation Systems (ITSC), pp. 1–8.
1002/rob.21541. Simonyan, K., Zisserman, A., 2015. Very deep convolutional networks for large-scale
Otsu, N., 1979. A threshold selection method from gray-level histograms. IEEE Trans. image recognition. International Conference on Learning Representations.
Syst., Man, Cybernetics 9, 62–66. https://doi.org/10.1109/TSMC.1979.4310076. Soille, P., 1999. Morphological image analysis. Springer, Berlin Heidelberg, pp. 170–171.
Palacios, F., Diago, M.P., Tardaguila, J., 2019. A non-invasive method based on computer Tardaguila, J., Martinez de Toda, F., Poni, S., Diago, M.P., 2010. Impact of Early Leaf
vision for grapevine cluster compactness assessment using a mobile sensing platform Removal on Yield and Fruit and Wine Composition of Vitis vinifera L. Graciano and
under field conditions. Sensors 19. https://doi.org/10.3390/s19173799. Carignan. Am. J. Enology Viticulture 61, 372–381.
Poni, S., Casalini, L., Bernizzoni, F., Civardi, S., Intrieri, C., 2006. Effects of Early Tello, J., Herzog, K., Rist, F., This, P., Doligez, A., 2019. Automatic flower number eva-
Defoliation on Shoot Photosynthesis, Yield Components, and Grape Composition. luation in grapevine inflorescences using RGB images. Am. J. Enology Viticulture.
Am. J. Enology Viticulture 57, 397–407. https://doi.org/10.5344/ajev.2019.19036.
Radhouane, B., Derdour, K., Mohamed, E., 2016. Estimation of the flower buttons per Zuiderveld, K., 1994. Contrast limited adaptive histogram equalization. In: Graphics
inflorescences of grapevine (vitis vinifera L.) by image auto-assessment processing. Gems IV. Academic Press Professional Inc, USA, pp. 474–485.
13