**3.2 Multivariate linear regression model (MLRM)**

The training of the MLRM (**Figure 3A**) showed large variation between the predicted data and the real value, resulting in a low adjustment (r<sup>2</sup> = 0.616) and a mean squared error of 0.477. Although the residuals obtained from the training data (**Figure 3C**) showed a random distribution, which may indicate that the data fitted well for the model, the absolute value of these residuals was high (up to 1.5). The following equation was obtained from the MLRM for the prediction:

Acceptability ¼ �0*:*<sup>751</sup> <sup>þ</sup> <sup>0</sup>*:*002 Oil content <sup>ð</sup> %Þ � <sup>3</sup>*:*<sup>09</sup> � <sup>10</sup>�<sup>5</sup> ðViscosityÞ þ 0*:*509ðFlavor scoreÞ þ 0*:*586ðTexture scoreÞ*:*

#### **Figure 3.**

*Prediction of testing data (A) and validation data (B) and their residuals (C, D) of sensory acceptability of mayonnaise using a multivariate linear regression model.*

In the validation of the model (unseen data), which is shown in **Figure 3B**, the MLRM showed an increase of the adjustment (r<sup>2</sup> = 0.864) and a decrease of the mean squared error (0.077) in comparison to the training. The behavior of the residuals (**Figure 3D**) showed a positive bias in the results (the model tends to underestimate the data), additionally, the random distribution of the residual was slightly loss; however, this underestimation could be advantageous because it is possible that the real acceptability be better than the predicted by the model. Hence, these results showed that the MLRM could be applied to estimate the acceptability of a mayonnaise by using non-sensory and sensory parameters with considerably good reliability.

Some regression models reported for sensory data showed results comparable to the obtained in the present study, overall, the MLRM have low predictive performance (r<sup>2</sup> = 0.600–0.800). In a study of the application of a PLS (partial least squares) algorithm to predict the overall acceptability of green tea showed an adjustment of 0.776 in the prediction of unseen data [12]. Similarly, a multivariate linear regression models showed low predictive performance (r2 = 0.806) for the oxidative stability of virgin olive oil [14] and the sensory quality of beer (r2 = 0.660) [25]. Regarding the model of this work, it showed a better performance than the studies previously cited, probably the data selection and the strong correlation of sensory evaluations could improve the predictive performance of this model [11].

#### **3.3 ANFIS model**

The architecture for the ANFIS was selected by testing different conditions such as type of membership function, number of membership functions, and number of epochs (number of training cycles of the model) until obtain the best adjustment.

The selection of membership function types (sigmoid, gaussian, and generalized bell) were tested using a fixed number of membership functions (MF = 6) and 100 epochs. It was observed that sigmoid MF reduced the prediction accuracy at values around r2 = 0.700, however, gaussian and generalized bell MF showed similar results (r2 0.800). The gaussian type MF was selected because the use of only two premise parameters (*c* and *σ*) allows a faster calculation and usually gives better results compared to generalized bell and sigmoid type MF [26–28].

The number of membership functions also influenced the performance of the model, therefore, different MF number (4, 8, 12, and 16 MF) were tested using 100 epochs to obtain the best results. The lower adjustment (r2 = 0.79) was obtained using 4 MF, which was increased gradually (r<sup>2</sup> 0.830) using 8 and 12 MF. Compared to the previous conditions, the best performance was observed using 16 MF (r2 = 0.910).

The learning curves of the model during the training are shown in **Figure 4**, it is observed that the training loss curve cross the validation loss near to the epoch number 30, then, both values (training and validation) converge close to the epoch number 80 epochs reaching an error value near to 0, this indicates that the model was well trained (by minimizing the error) and adjusted. Therefore, the number of epochs were kept at 100 to avoid an overfitting of the model; the final architecture of the ANFIS was: 4 inputs, 16 membership functions (MF), and 100 epochs.

Due to the batch size set for the ANFIS model (batch size = 8), one data point was missed in the training-testing set compared to the testing of the MLRM. Hence, the testing of ANFIS were done with 8 data points (**Figure 5A**). The results showed that the performance of ANFIS exceed the MLRM because the adjustment and error values (r2 = 0.941 and a mean squared error of 0.057) were better. In addition, the residuals

*Artificial Intelligence for Sensory Acceptability Prediction DOI: http://dx.doi.org/10.5772/intechopen.105162*

**Figure 4.** *ANFIS training curve. Training loss (loss) and validation loss (val\_loss).*

**Figure 5.**

*Prediction of testing data (A) and validation data (B) and their residuals (C, D) of sensory acceptability of mayonnaise using an adaptive neuro-fuzzy inference system (ANFIS) model.*

obtained (**Figure 5C**) in the model also demonstrate a positive bias but with a lower absolute value (0.1–0.5) compared to the MLRM.

The validation of the ANFIS is shown in **Figure 5B**. It was observed a slight reduction in the adjustment and the error (r<sup>2</sup> = 0.910 with a mse = 0.051) than the test prediction. The residuals (**Figure 5D**) indicate a good fitting of the data because these showed a random distribution. Despite the reduction of the adjustment in the validation, the ANFIS demonstrated to be a better option to predict the sensory acceptability of mayonnaise in comparison to the MLRM.



### *Artificial Intelligence for Sensory Acceptability Prediction DOI: http://dx.doi.org/10.5772/intechopen.105162*

The ANFIS model obtained in the present study showed a lower adjustment compared to other studies, for instance in the prediction of virgin olive oil stability (r2 = 0.988), moisture ratio in papaya slices after drying (r2 = 0.996), and the sensory acceptability in ice creams (r<sup>2</sup> = 0.930) [14, 15, 17]. Herein, it was needed a more complex architecture compared to the model reported by Bahram-Pavar et al. [17], which used 100 epochs, 2 MF, and 4 sensory parameters of quality-descriptive-analysis (QDA). The difference in both architectures could be due to the nature of the input variables, as it is shown in the correlation matrix, the sensory attributes are closely related to the overall acceptability; in contrast, the formulation, and the viscosity (used in our model) are not explained with a clear linear behavior. It is hypothesized that the model requires more MF to create a better relationship between the acceptability and the non-linear features, yet it is possible to use these variables.

In **Table 1** is summarized the data from the validation of the models, as well as the summary of their performance metrics. Overall, the ANFIS model showed best results, indicated by the higher adjustment than the obtained from the MLRM. It has been documented that hybrid models, such as ANFIS, are more suitable for predicting non-linear data [12, 14]. This is thanks to the training through back propagation and the multilayer architecture, that could provide a better adaptation to the non-linear parameters [12]. In this case, the viscosity and the oil content are not highly correlated with the acceptability, thus, it is probable that these data did not fit well for the prediction in the linear model (MRLM). Hence, it could be inferred that ANFIS model is superior to the MRLM if non-linear parameters are used, with possible research or industrial application; however, ANFIS model requires more computational skills in comparison to MRLM. This latter, despite the lower performance, could be considered as a simple model for non-industrial tasks, for instance, in academic practices.

Finally, it is important to point out some limitations of the present study, for instance, the high variability within the formulation of the products (use of gums, proteins, starches from different sources, different flavorings, among others), the low volume of the database, because most of the machine learning usually needs large datasets (>1000 data points) for being statistically significant.

However, the strength of this study is that the data used was not from a single study, this suggest that machine learning and deep learning algorithms could be implemented for different formulations in foods, therefore, it could be considered for testing novel ingredients or to evaluate and calibrate reformulations without the time consuming of conventional sensory analysis. Additionally, this type of works could impulse the generation of foods databases for developing industrial solutions using artificial intelligence models.
