Machine Learning Modeling of Wine Sensory Profiles and Color of Vertical Vintages of Pinot Noir Based on Chemical Fingerprinting, Weather and Management Data

Important wine quality traits such as sensory profile and color are the product of complex interactions between the soil, grapevine, the environment, management, and winemaking practices. Artificial intelligence (AI) and specifically machine learning (ML) could offer powerful tools to assess these complex interactions and their patterns through seasons to predict quality traits to winegrowers close to harvest and before winemaking. This study considered nine vintages (2008–2016) using near-infrared spectroscopy (NIR) of wines and corresponding weather and management information as inputs for artificial neural network (ANN) modeling of sensory profiles (Models 1 and 2 respectively). Furthermore, weather and management data were used as inputs to predict the color of wines (Model 3). Results showed high accuracy in the prediction of sensory profiles of vertical wine vintages using NIR (Model 1; R = 0.92; slope = 0.85), while better models were obtained using weather/management data for the prediction of sensory profiles (Model 2; R = 0.98; slope = 0.93) and wine color (Model 3; R = 0.99; slope = 0.98). For all models, there was no indication of overfitting as per ANN specific tests. These models may be used as powerful tools to winegrowers and winemakers close to harvest and before the winemaking process to maintain a determined wine style with high quality and acceptability by consumers.


Introduction
The viticulture and winemaking industries have been accumulating important data from past vintages for record-keeping, related mainly to operations and management practices, such as machinery usage, fertilization, irrigation scheduling pest, and disease incidence, and control applications [1]. Other wineries keep records of physicochemical characteristics and/or sensory profiles related to berry and wine quality traits, either done at chemistry laboratories or in-house, with some of these vineyards with records of more than 15 growing seasons. Keeping with digital technological advances, these management tools can be found in the form of computer, smartphone, and tablet PC applications for portability and easy access to records [2]. However, there have been minimal attempts to analyze these records using new and emerging tools, such as data mining and machine learning. Most new researches have been focused on the implementation of robotic platforms and unmanned aerial and

Vineyards and Samples Description
Data from nine different vintages (2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016) of Pinot Noir wine were obtained from a boutique vineyard (14.5 ha) located in the South of the Great Dividing Range of the Macedon Ranges in Romsey/Lancefield, Victoria in Australia at an elevation of 540 m.a.s.l. The vineyard is located in a region with fresh and cool evenings starting in the autumn season, which allows slow ripening as well as maintenance of the natural acidity. Being a commercial boutique vineyard, Pinot Noir wines are produced under controlled processing methods and using only berries from the site and fermented using wild yeast from the vineyard/winery. These were then matured in French oak for 20-22 months. Samples of each vintage (wine bottles 750 mL) were obtained from the online store of the vineyard ( Table 1).

Weather Data Acquisition
As described in the publication from Fuentes et al. [50], integrative weather information for each vintage was obtained from the Bureau of Meteorology (BoM). The derived weather parameters based on temperature and rainfall data consisted of (i) degree days from September to harvest (DD-S-H), (ii) maximum January temperature (MJT), (iii) mean maximum temperature from veraison to harvest (MeanMaxTV-H), (iv) mean minimum temperature from veraison to harvest (MeanMinTV-H), and (v) water balance (WB).
For degree days, which is considered as a thermal time, it was calculated with base 10 • C from hourly temperature data reconstructed from readily available maximum and minimum daily temperature data from BoM. The hourly temperature (T H ) reconstruction was obtained using the method proposed by Zhang et al. (2016) [51] and using the following formula: DD = 23:59 00:00 where DD = degree days; T H = hourly temperature in • C. Water balance (WB) was calculated based on values of irrigation in megaliters (I; ML), effective rainfall (RF), and evapotranspiration (ET c ) calculated using the corresponding crop coefficient (Kc) for different phenological stages. Specific crop coefficients (Kc) used were based on those considered by Collins et al. [52]. The 0.85 fraction corresponds to effective rain, which can be readily available to plants [53]:

Near-Infrared Spectroscopy and Color Data Analysis
Triplicates from two bottles of each of the wine samples were analyzed three times each (n = 9 readings) using a near infra-red (NIR) spectroscopy handheld device (microPHAZIR™ RX Analyzer; Thermo Fisher Scientific, Waltham, MA, USA). This machine is capable of acquiring the spectra within the 1596-2396 nm range with readings every 7-9 nm. Whatman ® qualitative grade three filter paper of 7 cm (Whatman plc., Maidstone, UK) was saturated with the wine samples and then read with the device. The NIR values of the filter paper were subtracted to obtain the values for wine. This method was described and validated in a study by Gonzalez Viejo et al. [54].
Color was measured in triplicates using the NIX™ PRO color sensor (Nix Sensor Ltd., Ontario, Canada) with D50 illuminant and 10 • observer. A total of 15 mL of wine was poured into a 35 mm × 10 mm Corning ® CellBIND ® Petri dish (Sigma -Aldrich Inc., St. Louis, MO, USA) and placed over a generic/unbranded Light Emitting Diode (LED) light pad (Hong Kong) and measured with the NIX™ PRO device connected via Bluetooth to a smartphone and the NIX™ PRO color sensor application (App). Data were obtained in three color scales (i) CIELab, (ii) Red, Green, Blue (RGB), and (iii) Cyan, Magenta, Yellow, Black (CMYK).

Descriptive Sensory Evaluation
A sensory panel of 12 participants from The University of Melbourne (Ethics ID: 1545786.2) was trained using a combination of International Standard methodology (ISO 8586-1: 1993E Sensory analysis-General guidelines for the selection, training, and monitoring of selected assessors and expert sensory assessors, and quality control procedures) [55] and the quantitative descriptive analysis method (QDA ® ). The training details are described in the study published by Gonzalez Viejo et al. [56], using panelists that were regular wine consumers and with training designed using wine samples and references related to red wine. Once the panelists were trained, a blind sensory session was conducted in the sensory laboratory at The University of Melbourne, which consists of individual booths with uniform lighting. The number of samples (N = 9) was adequate and enough for sensory evaluation to avoid fatigue of the panelists due to the alcohol concentration and astringency present in the wine, this makes the results more reliable. This is in accordance with the recommended maximum number of samples, which is usually between six and twelve for descriptive sensory evaluation [57,58].
The sensory questionnaire was displayed in Android (Google, Mountain View, CA, USA) Tablets using the Bio-Sensory App (The University of Melbourne, Parkville, Vic, Australia) [59]. Table 2 shows the descriptors assessed by the panelists, which were rated using a 15-cm non-structured scale. Samples were served at 20 • C in International Standard Wine Tasting Glasses by Luigi Bormioli, and the serving size was 30 mL.

Statistical Analysis and Machine Learning Modeling
An analysis of variance (ANOVA) was performed for the sensory and color data to evaluate significant differences between samples for each parameter. Fisher's least significant difference (LSD) post hoc test was conducted for pairwise comparisons using α = 0.05.
Three artificial neural network (ANN) regression models were developed using a Matlab ® R2020a (Mathworks, Inc., Natick, MA, USA) code. A total of 17 different training algorithms were tested and compared (data not shown) to find the best models according to their performance, accuracy, and absence of overfitting signs. For Model 1, the raw absorbance values of 100 wavelengths within the 1596-2396 nm spectrum measured using the NIR device were used as inputs, while Model 2 was developed using the weather and water balance data mentioned in Section 2.2, both to predict the 19 sensory descriptors shown in Table 2. These models were constructed using the Levenberg Marquardt training algorithm with data divided randomly as 70% of samples used for training, 15% for validation with performance based on means squared error (MSE), and 15% for testing using a default derivative function ( Figure 1). A neuron trimming exercise (Neurons: 3, 5, and 10) was conducted to find the best performance and no signs of overfitting.
Model 3 was developed using the weather and water balance data mentioned in Section 2.2 to predict color in three color scales (i) CIELab, (ii) RGB, and (iii) CMYK. The model was built using a random data division, with 70% of the samples used for training using the Bayesian Regularization algorithm and 30% for testing using an MSE performance algorithm ( Figure 1). A neuron trimming exercise (Neurons: 3, 5, and 10) was conducted to find the model with the best performance and no overfitting signs.  Table 2. Table 3 shows the results of the ANOVA for color parameters in the three scales (CIELab, RGB, and CMYK). Significant differences were found among samples for all color parameters. It can be observed that the wine from 2014 (W14) was the darkest in color (L = 32.05) and significantly different from the other vintages, while W11 was the lightest (L = 59.23). According to the CIELab scale, W14 was the highest in "a" value, which represents the red color on the positive values, while W11 was the lowest; similarly, the R-value of W14 was the lowest (darker red), while W11 was the highest (lighter red). W08 was the highest in "b" and second lowest in G, which represent darker green colors. Figure 2 shows the ANOVA results for the sensory descriptors. Significant differences were found among samples for all descriptors. Sample W14 presented the highest intensity for descriptors such as color, red and black fruits aroma, sweet aroma, bitter taste, body, and astringency. At the same time, it had the lowest intensity in spicy flavor. On the other hand, W11 had the lowest intensity for color, black fruits aroma, sweet taste, herbs flavor, black fruits aroma, body, astringency, and warming mouthfeel. In contrast, it had the highest intensity for spicy aroma and acidic taste. The strongest warming mouthfeel, sweet taste, and bitterness were found in W12.  Table 2. Table 3 shows the results of the ANOVA for color parameters in the three scales (CIELab, RGB, and CMYK). Significant differences were found among samples for all color parameters. It can be observed that the wine from 2014 (W14) was the darkest in color (L = 32.05) and significantly different from the other vintages, while W11 was the lightest (L = 59.23). According to the CIELab scale, W14 was the highest in "a" value, which represents the red color on the positive values, while W11 was the lowest; similarly, the R-value of W14 was the lowest (darker red), while W11 was the highest (lighter red). W08 was the highest in "b" and second lowest in G, which represent darker green colors. Figure 2 shows the ANOVA results for the sensory descriptors. Significant differences were found among samples for all descriptors. Sample W14 presented the highest intensity for descriptors such as color, red and black fruits aroma, sweet aroma, bitter taste, body, and astringency. At the same time, it had the lowest intensity in spicy flavor. On the other hand, W11 had the lowest intensity for color, black fruits aroma, sweet taste, herbs flavor, black fruits aroma, body, astringency, and warming mouthfeel. In contrast, it had the highest intensity for spicy aroma and acidic taste. The strongest warming mouthfeel, sweet taste, and bitterness were found in W12.   Table 1. Error bars = standard error (range: 0.32-1.82).  Table 4 shows the statistical data of the three models. It can be observed that Model 1, which was developed using NIR values as inputs to predict the intensity of sensory descriptors, presented a high overall correlation coefficient (R = 0.92; Figure 3a). However, the validation R-value (R = 0.82) is far from the training (R = 0.96), and the performance of validation (MSE = 0.68) and testing (MSE = 0.83) were not as close, which are signs of possible overfitting. Furthermore, the slope for validation is low-moderate, and the overall model presented 5.48% of outliers (103 out of 1881), based on the 95% confidence bounds (Figure 3a). In contrast, Model 2, which was developed using weather values as inputs to predict the intensity of sensory descriptors, had very high overall correlation (R = 0.98; Figure 3b) and no signs of overfitting as the validation and training R values were close (R = 0.99 and R = 0.96), and validation and testing performances are the same. Slopes from the three stages are high (slope = 0.85-0.96); the overall model presented 2.87% of outliers (36 out of 1254), based on the 95% confidence bounds (Figure 3b). On the other hand, Model 3, which was constructed using weather data as inputs to predict color parameters, had a very high overall correlation (R = 0.99; Figure 3c) and the lower training performance (MSE < 0.01) compared to the testing (MSE = 0.02), shows that there were no signs of overfitting. Furthermore, slope values were high and close to unity (slope~1), while the overall model presented 3.33% of outliers (22 out of 660), according to the 95% confidence bounds (Figure 3c).   (Table 2), and (c) Model 3 using weather and water balance data as inputs to predict color parameters in three scales (i) CIELab, (ii) RGB, and (iii) CMYK.

Discussion
Weather information for contrasting seasons for the same vineyard has been previously reported [9,50]. From all nine seasons, the most contrasting vintage was 2011, presenting higher and anomalous rainfall with lower irrigation input, resulting in a water balance of 673.7 mm and lowest solar exposure between veraison and harvest of 15.6 MJ m −2 . Higher water availability will increase canopy vigor and offset canopy balance towards the vegetative fraction over reproductive (grapes). This explains lower color (Table 3) and sensory profiles of wines that resulted from this particular vintage (Figure 2), consistent with previous studies [60,61]. On the contrary, the 2013 and 2014  (Table 2), and (c) Model 3 using weather and water balance data as inputs to predict color parameters in three scales (i) CIELab, (ii) RGB, and (iii) CMYK.

Discussion
Weather information for contrasting seasons for the same vineyard has been previously reported [9,50]. From all nine seasons, the most contrasting vintage was 2011, presenting higher and anomalous rainfall with lower irrigation input, resulting in a water balance of 673.7 mm and lowest solar exposure between veraison and harvest of 15.6 MJ m −2 . Higher water availability will increase canopy vigor and offset canopy balance towards the vegetative fraction over reproductive (grapes). This explains lower color (Table 3) and sensory profiles of wines that resulted from this particular vintage (Figure 2), consistent with previous studies [60,61]. On the contrary, the 2013 and 2014 vintages were related to lower water balance (−117.5 and −61.9 mm respectively) and higher solar exposure between veraison to harvest (21.8 and 19.0 MJm −2 , respectively) with warmer temperatures. These vintages produced wines with the highest color (Table 3) and sensory quality traits (Figure 2). Color is an important quality trait for Pinot Noir wines, and its prediction before winemaking can offer powerful decision-making tools to winegrowers [62,63].
The use of the CIELab color scale in food and beverages is attributed to its uniform distribution of color in the scale and considered as the closest to the human eye perception of colors. However, RGB has also been reported to be similar to human perception [64] and has been used in food studies such as oil, beer, and wine [65][66][67]. The latter scale has been found to be correlated with pigments such as carotenoids in olive oil [66] and used to predict adulteration in wines [67]. On the other hand, despite that CMYK is not utilized in food, it may provide useful information to print the corresponding color on labels to increase consumer perception before opening the bottle. According to Piqueras-Fiszman et al. [68,69], it is very important for packaging to display the real colors of the contained product to ease consumer familiarization with the food or beverage. Furthermore, Lick et al. [70] found that there is an association between the colors in labels and the flavors that consumers expect in the wine.
Within the 1596-2396 nm NIR range, overtones of several components may be found. Some of these compounds that are related to the sensory descriptors are aromatics (1685 nm), water (1790 and 1940 nm), carboxylic acids, which form esters that are common aromatic compounds (1900 nm), pOH that is related to acidity and inverse scale to pH (1908 nm), alcohol (2090 nm), sucrose (2080 nm), and citric acid (2220 nm), among others. Furthermore, intensities of basic tastes rated by a trained panel have been modeled to be predicted using NIR absorbance values within the aforementioned range in chocolate, which indicates there is an association between this wavelength range and sensory attributes [71].
Machine learning modeling has been previously implemented to predict aroma profiles for the same vintages reported in this study, and aroma patterns are consistent with the sensory results presented here (Figure 2) [9]. Aroma profiles are also dependent on canopy architecture and the vegetative and reproductive balance, similar to other crops, such as cocoa trees, which have also been modeled using machine learning [72]. These modeling techniques have been proven to be accurate and robust to predict aroma and sensory profiles of other beverages as per recent research published on artificial intelligence, robotics, computer vision, and machine learning applications to beverages [73][74][75].
The ML model based on chemical fingerprinting of wines using NIR (Model 1) was not as accurate compared to Models 2 and 3 based on weather and management information from vertical vintages. Further disadvantages of Model 1 are related to the requirement of the NIR instrument, which can be cost-prohibitive to winegrowers and winemakers, and measurements are obtained after winemaking. However, it could offer a quick assessment of wines produced without the requirement of trained sensory panels, which in turn can be time-consuming and cost-prohibitive and not accessible for most wineries. The implementation of Model 1 could offer a rapid, robust, accurate, and reproducible way to assess the sensory profile of wines and wine batches to maintain a certain wine style that characterizes specific wineries.
More practical and accurate models developed in this study were based on weather information and water management of vineyards (Models 2 and 3) to predict sensory profiles and color of the wines, respectively. The effect of seasonal variability on soil, grapevine, environment, and water management, and its influence on the quality traits in grapes and wines have been well-established. Models 2 and 3 offer information on sensory profiles and wine traits before harvest and winemaking. These models will offer the opportunity to winemakers to adjust vinification techniques to obtain a more consistent wine style, predict the market and consumer acceptance for pricing adjustments, better description of wines in labels for accurate information to consumers, among others. Models 1 to 3 are specific to the location and corresponding wine and winemaking techniques; thus, they could have very limited applicability for other vineyards, wineries, and wines from different soil types, climatic regions, and cultivars. However, the methodology is very easy to reproduce to obtain specific models when libraries of vertical wines and meteorological information are available through the years. Furthermore, once the models are constructed per winery, region, and cultivars, weather information projections can be incorporated for early prediction of sensory profile and color of resulting wines. Even though the models can be considered as site-specific and variety specific, by adding more data, they have the capability to "learn", hence making them more broadly applicable to other environments and cultivars.
Temperatures and rainfall, which were the basis of weather parameters in this paper, can be obtained for up to three months in advance for any specific region in Australia from the Bureau of Meteorology (BOM, Outlook information, Australia). From this information, evapotranspiration (ET) and water balance data can be estimated early in the season by applying ET predictive models based on temperature [76,77] and corresponding Kc values. Earlier prediction (three months in advance) will be associated with higher estimation errors of temperature and ET and overall outputs for Model 1 and 2. However, periodic model feeding from veraison onwards will offer reference information for changes of sensory and color trends for wines, which may be used as a decision-making tool to schedule irrigation and canopy management within the season.
One of the main disadvantages found through this research was related to putting all the historical information together from vineyards. It is common that these industries have a mix of information and data recorded manually (handwritten), and printed but not recorded digitally, based on different software platforms (i.e., Excel, Word, database platforms) or specific database commercial software. Furthermore, it could be considered as a disadvantage the specialized analysis required to construct the models proposed here concerning the physicochemical and sensory analysis of vertical libraries of wines available. Recent studies and developments have made it possible to implement new and emerging technologies to make these analyses more affordable and user-friendly. Some of these are, for example, the development of robotic pourers coupled with computer vision, machine learning and gas release analysis of beers [65,78] and sparkling wines [75], low-cost electronic noses for aroma profile and faults detection [73], low-cost near-infrared spectroscopy devices and color sensors that can be attached to smartphones with applications in food and beverages [50,79], and sensory analysis of consumers using a newly developed computer application, which can be downloaded by users and deployed in Android-based devices to obtain normal sensory analysis (self-reported) plus biometrics for emotional response and physiological changes of participants, such as heart rate, blood pressure [80], and body temperature among others [59].

Conclusions
This study is one of the first attempts to apply these techniques for the assessment of vertical vintages in the wine industry, which have offered encouraging results with the construction of robust machine learning models with high accuracy and practicality. Models presented in this study were based on new and emerging technologies (near-infrared spectroscopy) and ubiquitous weather information from past seasons and relevant vineyard management data applied to the vertical library of wines that are mostly available in the majority of vineyards around the world. Further research should be conducted to incorporate more cultivars, seasonality, and winemaking techniques to create more robust machine learning models to assess final wine aroma profiles, sensory profiles, and color. This research is the first step to achieve universal machine learning models to apply artificial intelligence to the winemaking industry. These models and procedures may be considered preliminary. However, they have the following advantages: (i) easy to construct site-specific models for other regions and cultivars using vertical vintages and historical meteorological data, (ii) models can incorporate future seasons and use the intrinsic "learning" capabilities of these methodologies to incorporate climate change factors that may affect targets proposed, (iii) models were constructed based on information that can be considered nowadays ubiquitous and wineries that keep vintage libraries of wines can get full benefits from these procedures. The main disadvantage of obtaining these benefits could be related to the physicochemical and sensory analysis of wines required to construct the models. However, recently, there has been a body of research to make these measurements more affordable and accessible to the industries in a "do-it-yourself" fashion.