Evaluation of Wines Rating Based on Sensory Characteristics Using Neural Networks

Wine is an agricultural product with very high commerce price variation, which is highly affected by quality ratings. Therefore, quality rating is particularly important for both industry and consumers. However, absence of clear concepts on what constitutes wine quality makes the perception of quality highly subjective, and it is usual for tasters to disagree on the quality rating of a specific wine. For this purpose, a Feedforward Neural Network (FNN) could be trained in order to predict wine quality. In this study, a new FNN method was developed to predict the accurate wine quality based on major sensory characteristics as FNN inputs, and to improve the ability of a taster, groups of tasters, or consumers, to rate wine by taking into account previous decisions. Specifically, five principle sensory characteristics of wines were used as inputs (Aging in Barrel, Aroma Intensity, Body, Astringency, and Acidity) in a rating range 1-3. As outputs, the quality ratings of wines in a range 70-100 were considered. The FNN was created in MATLAB with 1 hidden layer, 5 neurons and 1 output layer. For ratings divided in 5 categories the accuracy was 53% with the use of the FNN, as opposed to the accuracy of 36% achieved by Multiple Linear Regression. For ratings divided in 9 categories the accuracy was 90%. This method may allow each individual or group of tasters to introduce their own data to produce a more objective rating by taking into account previous decisions (subjective) that have accumulated in the database.


INTRODUCTION
According to the World Health Organisation, the world consumption in 2010 was 6.2 litres of pure alcohol per person aged 15 or older; 8% of which was consumed in the form of wine (Figure 1) [1,2].In 2015, the world wine production according to the International Organisation of Vine and Wine is estimated at 275.7 mhl, which is slightly higher (2%) compared to 2014 and considered a good average [3].Although, wine is an alcoholic beverage, a plethora of beneficial health effects have been attributed to moderate wine (mainly red) consumption, due to the presence of considerable amounts of biocactive phytochemicals, such as polyphenols (flavonoids, including anthocyanins, stilbenes, and proanthocyanidins) [4].Despite these well established beneficial effects, consumer preference and price variations highly depend on the organoleptic quality of wine.Therefore, quality is highly important to the strong global wine market, but at the same time hard to define precisely.Some suggest that the absence of faults is a crucial determinant of quality, which would be accepted as at least a precursor to quality, if not part of the core of quality itself [5].Others claim that wine must be "fit for its purpose" [6].The difficulty faced by the wine industry in establishing quality has produced varying approaches for its *Address correspondence to this author at the Department of Chemistry, University of Patras, 26500, Patras, Greece; Tel: +30-2610962964; Fax: +30-2610997105; E-mail: abekatorou@upatras.grevaluation during wine tasting.Influential oenologists focused on pleasure, suggesting it is the sole fundamental indicator of how good a wine is [7], or considered more quality indicators in the make-up of wine such as complexity, balance, personality, length, intensity of flavour, and varietal purity [8,9].The nature of wine quality, with its quasi-aesthetic character and relationship to personal taste, is difficult to understand and identify [10,11] even by trained panels where subjectivity is still an unsolved problem.The perception of wine quality by consumers also depends on many factors such as reputation, "appellation d' origine", price, advertising, age, harvest, alcohol content, variety, taste, aroma, and colour [12][13][14].Some studies have examined the components of wine quality focusing mainly on quality in relationship to purchase rather than the consumption experience (perceived rather than actual quality) [10,15].Thus the issue of whether or not quality exists or how it functions was sidelined from the consumer's perspective.Zeithaml [10], having distinguished perceived from objective quality, suggested that the former was a "higher level abstraction" rather than a product attribute, therefore, it is a comparative rather than a discrete assessment.Holbrook and Corfman [16], suggested that perceived quality is a "global value judgment", meaning that quality is a broad "overview" and not a precise and partitioned concept.
Wine quality may be evaluated by blind comparative sensory tests from well-trained tasters based on predetermined criteria and further statistical analysis [17,18].The blind estimation depends only on sensory evaluation and not on other factors.Several statistical methods exist for the analysis of consumer research data.The most widely used are Multiple Linear Regressions (MLR), Principal Component Regression (PCR), and Partial Least Squares Regression (PLS), which rely on the linear nature of the variables.These models can take account of non-linearity by introducing transformation of the X-variables increasing the computational burden and making hardware implementation of the algorithm more complex.Despite these limitations, regression methods are widely used.
Sensory perceptions are closely connected with complicated brain functions and contents, such as memory, culture, values or emotions, which bring together knowledge or memory of a food and sensory reactions to it.Thus, an integrated perception is created that determines the ideas and emotions inevitably associated with a specific food [19].This first approach in terminology, with words such as perception, connection, and brain shows the connection between quality and neural networks.An Artificial Neural Network (ANN) is formed by different layers: an initial layer of neurons, where the data of the input values are collected, one or more layers of intermediate neurons, where the learning processes take place, and a last one of output neurons, in which the value sought is obtained.In the training phase, the ANN learns the relations between inputs and outputs by providing a set of example training pairs and an algorithm that compares the network outputs with the expected targets.Recently, nonlinear and complex machine learning approaches such as ANNs were shown to be more reliable than conventional statistical approaches and the best alternatives to overcome their limitations due to their robustness to noise and inconsistencies in the data [20][21][22].ANNs have solved a large amount of complex problems related to different disciplines (classification, clustering, regression, etc.) and are widely used in many areas such as classification, pattern recognition, etc. [23].
A multilayer feed-forward ANN has been found to be more suitable for overcoming prediction related problems particularly when a non-linear relationship exists between input and output variables [23,24].ANNs have been successfully applied for predicting food quality [25][26][27][28][29], including wine [29][30][31].Frances and Gordon [32] used ANNs to classify Scotch whisky samples.The ANN model was used to classify wine samples in six different regions based on the measurements of trace amounts of different metals [30].Cortez et al. [31] predicted human wine taste preferences by their physicochemical properties.In this study, the main objectives were to predict the accurate wine quality based on major sensory characteristic inputs, and to improve the ability of a taster, groups of tasters, or consumers, to rate wine by taking into account previous decisions.

FNN Development
A Feedforward Neural Network (FNN) was created using the Neural Network Toolbox™ of MATLAB™ (release 2008b) to evaluate the rating of a wine.In order to achieve this, a database was used, containing 9 characteristics of wines at a range of 1-3 according to their intensity.Several combinations of numbers of layers and neurons were made in order to create the best possible architecture.Also the rating was divided in 5 categories and was transformed in binary form.By means of a statistical analysis in SPSS, from the above 9 characteristics, those that are significant were identified.Confusion matrices were created by using adequate MATLAB functions ("newpr") to visualize the performance of the FNN.MMRE (Mean Magnitude of Relative Error) and PRED 25 (Percentage Relative Error Deviation) were used to find the generalization ability of the FNN.

Original Data and 9 Sensory Characteristics of Wines
Data were obtained from the Greek wine guide "A Wine Guide 2011" [33] that is being published continuously during the last 10 years and contains data from more than 1000 Greek wines.In this guide, the writers provide a string text of about 20-50 words describing every wine regarding colour, aroma and taste, the rating of wines between 70-94 or between 1-5 (70-74=1, 75-79=2, 80-84=3, 85-89 =4, and 90-94=5), and 9 principal sensory characteristics: Colour, Sweetness, Carbon Dioxide, Aging in a Barrel, Aroma Intensity, Aging, Body, Astringency and Acidity.According to their sensory description every characteristic is evaluated at a range 1-3 according to intensity (Table 1).

Training of the FNN
A file was created in order to contain some of the original data.The ratings and 9 principal characteristics, namely Colour (code 1), Sweetness (code 2), Carbon Dioxide (code 3), Aging in a Barrel (code 4), Aroma Intensity (code 5), Aging (code 6), Body (code 7), Astringency (code 8), and Acidity (code 9), were used as inputs to the FNN.Sensory description for every characteristic was estimated at a range 1-3 according to intensity and a code (mark) indicating the kind of every characteristic.The original data contained a total of 27 different gradients.
In MATLAB, the 9 characteristics were used as input and the rating of wines as the output.Nine hundred wines were used as training data (indices from 101 to 1.000) and 100 wines were used as test data (indices 1 to 100).
After several tests, by changing the proportion between inputs and target, the form of rating from numeric to binary numeral, a FNN with 1 hidden layer with 5 neurons was found to be adequate to handle the proposed problem with 1 hidden layer, with 5 neurons and 1 output layer.Training of the FNN consisted of finding the weights that minimized error.The transfer function of the hidden layer was a tangential sigmoid one (since the problem is non-linear) and the transfer function of the output layer was linear (the combination of sigmoid and linear transfer functions is very common for this type of problems).
For the rating of wines between 70-94, a criterion between outputs and targets for training convergence was chosen with an error tolerance of 2, and for a rating between 1-5, the values of outputs that are equal to the target value were considered to be correct.

Testing the Performance of the FNN
The most widely used evaluation criterion, to assess the performance of software prediction models, is the Mean Magnitude of Relative Error (MMRE) [34].Calculation of the MMRE is based on the absolute difference between target data and output data as % of target data.MMRE is given as the average of all the

Significance and Principal Component Analysis of the 9 Sensory Characteristics
Using SPSS, from the 9 characteristics of wine, the data that are significant were identified.Rating was selected as the dependent variable and the 9 sensory characteristics (Colour, Sweetness, Carbon Dioxide, Barrel, Aroma, Body, Astringency, Aging, and Acidity) were selected as independent.Also in SPSS, a Principal Component Analysis (PCA) was performed for the 9 sensory characteristics in order to observe the correlation between them.

Creation of the Confusion Matrix
A confusion matrix is a specific table layout that allows visualization of the performance of an algorithm, typically a supervised learning like artificial intelligence.Each column of the matrix represents the instances in a predicted class, while each row represents the instances in an actual class.Values in the diagonal represent a correct prediction of the FNN, while values in the other cells show failure of the FNN model to give correct results.For this purpose, using MATLAB, the function "newpr" was created, which creates a pattern recognition network and returns a FNN exactly as the "newff' does, but with an output layer transfer function "tansing" and additional plotting functions.

The FNN
The purpose of this work was to predict the rating of a wine based on the sensory characteristics description.A FNN with 5 hidden layers and 1 output layer was created in MATLAB.Nine principal characteristics of wines (Colour, Sweetness, Carbon Dioxide, Aging in Barrel, Aroma Intensity, Aging, Body, Astringency, and Acidity) were used as input, at a range of 1-3 and a rating between 70-94 as target.A total of 900 wines were used as data for training and 100 for testing.Values that were 2 rating points higher or lower than the target value were considered to be correct.As a result, by the FNN a success rate of 53% was achieved.The respective result from the MLR analysis in SPSS for the same number of testing wines (100) was only 36%.This is a good indication that a FNN may be a better candidate for solving the specific problem.The R-square value indicates that about 0.56% of the variance in rating is explained by the 9 predictor variables.
For correct results, values that are 5 rating points above or under the target have a 90% success.As expected, increasing the interval that "corresponds" to success case increases the success rate.
The figure of the performance of the FNN, as produced by MATLAB, did not indicate any major problems with the training.The validation and test curves were very similar.The regression plot showed the relationship between the outputs of the FNN and the targets.If the training was perfect, the FNN outputs and the targets would be exactly equal, but the relationship is rarely perfect.In practice the R=0.72805 value shows a sufficiently good relationship between outputs and targets.Similar were the results from SPSS, where regression was calculated to be R=0.748 and this indicates that the model fits the data well.
As mentioned in previous sections, the relative errors MMRE and PRED, which indicate the prediction quality of a model, were calculated to be 0.0345 (a very small value) and 100%, respectively.This result is a good indication that the FNN model performs well in this problem.

Changes in Order to Improve Performance of the FNN
Apart from the target rating 70-94, were a success rate of 53% was achieved, for the target rating 1-5 a success rate of 52% was achieved, which is very similar.Subsequently the rating 70-94 was divided in 3 categories.As was expected, this improved the results and a success rate of 77% was achieved.
In order to improve the results, 700 data for training and 300 for testing were used.The result (success rate 52%) was similar.Usually in problems such as the classic "Iris problem", much less data (150) exist, so there should be a sufficient number of both inputs and outputs.In our case, having a much larger number of data (1000) means that there were enough for both training and testing.Therefore, apparently the relative proportion (10% or 30%) did not affect the effectiveness of the method.
The target rating (70-94) was transformed into 5 categories using a binary representation.This categorization is almost the same as the precedent (2 rating points above or under the target value).In this case the results were worse (success rate 33%).The target rating was transformed in binary form in 3 categories.Then a success rate of 70% was achieved.

MLR in SPSS and Significance of 9 Wine Characteristics
From the 9 wine characteristics (data entry) the data that are significant (sig<0.05)were estimated with the aid of SPSS 17.Among them the following 5 characteristics seemed important: Aging in Barrel (sig=0.001),Aroma Intensity (sig=0.000),Body (sig=0.000),Astringency (sig=0.004),and Acidity (sig=0.002).The results are plausible, since for example, Colour, Sweetness, and Carbon Dioxide affect the type of wine but not how good it is.Colour (sig=0.608),Sweetness (sig<0.861),Carbon Dioxide (sig<0.550),and Aging (sig<0.352)don't seem to be important.Aging is not always positive or negative on wine quality since it can either improve or degrade quality.
The multiple R shows a substantial correlation among the 9 predictor variables and the dependent variable Rating (R=0.748).The R-square value indicates that about 0.56% of the variance in Rating is explained by the 9 predictor variables.B gives the coefficients and constants for the MLR equation ( A new FNN with these 5 characteristics, 900 data for training and 100 for testing, was created.Values that were 2 rating points higher or lower than the target value were considered to be correct.Then as a result, by the FNN a success rate of 50% was achieved, which is almost the same as with the one acquired from the 9 characteristics (53%).This means that it is not necessary to dominate characteristics.

PCA of 9 Wine Characteristics
PCA was performed using SPSS and the results are shown in Figure 1.A correlation of axes in aroma and body can be observed, which is expected since in a wine with rich body habitually has corresponding rich aroma.Also the wines from barrel have increased sensation of aging.It can also be observed that acidity and carbon dioxide appear with high correlation since carbon dioxide contributes to increased sensation of acidity.

Confusion Matrix by MATLAB 'newpr' of 9 Characteristics and 1-5 Rating
Values followed a distribution (Shapiro-Wilk Test in SPCC is 0.251, greater than 0.05) and were concentrated near the middle category 3. To get a more general view of the results, a confusion matrix was created with the function "newpr" (Table 2).The total success rate was 52.5%, which is sufficiently high.It should be noted that the FNN has the ability to provide the correct value (target) and also, when it fails, it does not do it at random, as it gives more values near the right value.For example in the case of target 2 (Table 2), 25 results were correct (i.e. 2), 2 results were 1 instead of 2, 17 were 3, 2 were 4, and none was 5.If the results were completely random it would give each one of the 5 cases the probability for a random response 1/5=20% response per category.Category 2 contains 50 cases (150 in total).Successes were 25, namely 50% of the total cases, well above the amount of random.However, there seemed to be a problem in calculating the integer values in categories 1 and 5 where the data were very few.This seems to produce poor training of neural networks in extreme ranges and so neural networks do not seem to perform well in extreme ratings.
The proposed model may have several practical applications, for instance an application utilizing mobile phones that would allow the customer-user to receive automatically an objective rating for a specific wine by filling a questionnaire of certain sensory characteristics.Gradually, by increasing the input of the database, the application will give more objective wine rating, as defined by the overall judgment of the end-users.

CONCLUSION
The aim of this work was to evaluate wines quality based on major sensory characteristics.A FNN was used to process this data, predict wine quality and permit a more objective and automatic evaluation of wines rating.In this new proposed method, 5 principal characteristics of wines were used as input, namely Aging in Barrel, Aroma Intensity, Body, Astringency, and Acidity.A FNN was created in MATLAB with 1 hidden layer, 5 neurons and 1 output layer.For ratings divided in 5 categories the accuracy was 53% with the use of the FNN, as opposed to the accuracy of 36% achieved by MLR.For ratings divided in 9 categories the accuracy was 90%.This method may solve the problem of subjectivity in wines rating for every evaluation done by individuals such as wine journalists, consumers or trained tasters.In this case, each individual or group of tasters can introduce their own data to produce a more objective rating by taking into account previous decisions (ratings accumulate in the data base).The ultimate goal is to start from a subjective data base, in order to create an automatic and more objective scoring based on major sensory characteristics of wine.

Figure 2 :
Figure 2: Results of PCA for 9 wine characteristics.