Introduction

Milk and dairy products are important nutrient sources and are considered primary sources of biological calcium. An important dairy product is spreadable cheese, which enjoys great popularity among consumers in Europe and elsewhere. Processed cheese is generally manufactured from ripened Gouda or Cheddar cheese, but often a smaller quantity of fresh and less ripened cheese is also added. The manufacturing technique for this includes adding butter, water, salt, emulsifier, vegetables or meat products and optional spices. Processed cheese has several advantages over raw and ripened cheese, such as a uniquely pleasing taste and longer shelf-life [1]. However, the stability of the sensory quality and physicochemical characteristics of a product depends on various factors. The main ones are the type and state of raw materials, the technological process, the microbiological state of the ready product, and the type of packaging. During storage of processed cheese, we can observe major changes in its colour [2, 3], aroma and flavour [4], and consistency [5].

Bearing in mind all the reasons mentioned above, it is important to establish a shelf-life prediction model for accurate identification of shelf-life [6]. The shelf-life stated on the product largely relies on commercial experience and conventional methods which are not consistent, whereas the use of predictive models to establish the shelf-life of spreadable processed cheese might not be adequate. Some predictive models developed for shelf-life evaluation are often expensive and laborious. Among these, electronic sensing for rapid diagnosis of food quality [7] and a multiple linear regression model was reported to predict the shelf-life of roasted coffee, sterilized milk drinks [8] or yogurt [6, 9]. In recent years, we have witnessed the development and application of more reliable, effective and fast mathematical modelling, such as the Weibull hazard model used for estimating the shelf-life of pezik pickles, for example [10]. Fast mathematical modeling, such as the Q10 model [11], has been widely used forshelf-life evaluation of food products such as frozen shrimp [12], for kinetics analysis of quality changes in Pangasius fillets at stable and dynamic temperatures, for simulating downstream cold chain conditions [13], and also for analysis of chilled pork [14], ketchup [15] or juice drinks [16]. Multiple linear regression (MLR) is an another prediction tool which can help to forecast food deterioration and shelf-life based on a number of factors. The model is prepared based on fitting a linear equation to observed data. The major advantage of this statistical method is its ability to show relationships between variables, although no causal mechanism is indicated. The multiple regression is easy to prepare and has been applied in food research to obtain models as an alternative to other statistical methods [3, 17]. MLR has been applied to evaluate thermal inactivation of Listeria monocytogenes in liquid food products [18] or black tea [19].

The Artificial Neural Network (ANN) is one of the well-known prognostic methods used to find a solution when other statistical methods are not applicable. The advantages of this tool, such as the ability to learn from examples, fault tolerance, operation in a real-time environment, and forecasting non-linear data, all make it a widely used statistical tool. Moreover, ANN accurately fits in the nonlinear variables, which is an advantage compared to multivariate linear analysis based on linear variables [8, 20]. An inspiration for ANN was the human brain and biological neurones. The basic element of this structure is the perceptron. This is a mathematical equivalent of a neurone, which transfers electrical signals represented as numerical values. Artificial neurones are arranged in layers: input—taking the input data, hidden and output—producing a result. Each node connects with every neurone in the next layer. However, there are no connections among neurones in the same layer. The ANN learning process is based on adjusting weighted connections between nodes until the most efficient solution of a problem has been obtained. Moreover, providing both an input and output in the network allows for calculation of an error based on its target output and present output. This can be used for corrections of the network by updating its weights and to achieve optimal results [8, 21].

The characteristic features of Artificial Neural Network allow forthis tool to be applied for food quality prediction and shelf-life prediction due to its reliability and accuracy. ANNs have been used to define shelf-life for predicting food quality, e.g. soft cheese [22], spreadable processed cheese [8], UHT milk [23], soybean and soya milk [11, 24], sensory attributes of noodles [25], fruit and fruit juice [26] and perishable products [23, 27].

The aim of this study was to compare the applicability of ANN and multiple linear regression (MLR) for predicting the overall quality of spreadable processed Gouda cheese during storage. This is the second part of a study on quality changes in spreadable processed Gouda cheese. The first part [3] evaluated the utility of kinetic models based on Arrhenius equation type as a predictive tool for quality parameter changes in spreadable processed cheese during storage at various temperatures.

Materials and methods

The direct experimental material was processed Gouda cheese. The samples underwent physicochemical analyses and sensory evaluation to find changes in their quality during storage under various conditions. On each day of the experiment a new pack of cheese was opened for analysis. The samples were analysed at a temperature of 20 ± 1 °C. The samples incubated at 8 and 20 °C were analysed once a week, whereas those incubated at 30 °C were analysed once a day. The samples were stored at 8, 20 and 30 °C for 120, 63 or 10 days after the production, respectively. In the present study, analyses were conducted on processed Gouda cheese to determine the pH, water activity, and spin–lattice, and spin–spin relaxation times were measured by low-field nuclear magnetic resonance (LF NMR), rheological properties by the dynamic mechanical thermal analysis (DMA), texture parameters, colour assessment and sensory evaluation. The detailed characteristics of the testing methods applied in this part of the study were specifically described by Weiss et al. [3].

Processed cheese preparation

Samples of spreadable processed cheese were produced in an industrial setting as part of a batch. The following raw materials were used in this process: water, natural ripened cheese, milk proteins, butter, emulsifying salts and others. The selected ingredients were ground and weighed. Then, the raw materials were sequentially dosed to a cooker and melted at mean temperature of 82.5 °C for 5 min. It resulted in a stable cheese mass, which was packed into plastic tubes of 140 g. Next, the products were cooled to a temperature of 30 °C in a cooler system for 40 min. Then, the samples were stored at three temperatures: 8, 20 and 30 °C (± 1 °C). They were stored under experimental conditions until the end of their shelf-life—for 120 days after the production or until the signs of product spoilage appeared. Spoiled samples exhibited significant changes in their colour and consistency as well as off-odours and gassing defects.

Statistical analyses

The samples were evaluated at least three times. The results were expressed as mean ± SD. Correlations between independent variables and dependent variables were defined for the collected data. In order to determine which quality parameters influence the overall quality, Principal Components Analysis (PCA) was used.

The statistical significance level was p < 0.05. Statistica v.13 (StatSoft, Kraków, Poland) and Excel Statistical software were used for analysis.

Modelling

On the basis of the principal components analysis new variables were identified. These variables were used in modelling using multiple linear regression (MLR) and Artificial Neural Network (ANN).

Multiple linear regression (MLR)

Multiple linear regression (MLR) was used [28] in order to develop a model for overall quality changes during storage. The general model of multiple linear regression uses the following equation:

$$ y = \beta_{0} + \beta_{1} x_{1} + \beta_{2} x_{2} \cdots \beta_{k} x_{k} + \varepsilon $$
(1)

where: y variable value, β0 intercept, β1k-regression coefficient; ε standard estimation error.

Artificial neural network (ANN)

A perceptron multilayer network with backpropagation was used. The ANN consisted of input, one hidden and one output layer. The number of nodes of the input layer corresponds to the number of variables describing the attributes being tested, while the number of neurones in the output layer equals the number of classes. The number of hidden layers and the number of neurones depends on the complexity of the task and the amount of training data. In the hidden and output layer each neurone was connected to all of the nodes in the proceeding layer by an associated numerical weight. The weight connecting two neurones regulates the magnitude of the signal that passes between them. To train a neural network a method of supervised learning was employed and its level was controlled by a validation error in subsequent learning periods.

The model was verified on the basis of the determination coefficient—R2 and root-mean-square error—RMSE. Statistica v.13 (StatSoft, Kraków, Poland) software was used for analysis. A significance level of α = 0.05 was used.

Results and discussion

The correlations between the qualitative attributes and the experimental data were verified. The results are presented in Table 1. It was found that 59 out of 190 correlations were statistically significant, therefore it can be concluded that there is a relationship between the variables tested.

Table 1 Correlations between the qualitative parameters analysed

In the next step, Principal Components Analysis (PCA) was performed using a Bartlett test. As a result, a new set of components was obtained, which correlates to the variables. Principal Component Analysis is an approach used for identifying the most crucial variables responsible for changes in industrialised food [29]. The PCA precedes the usage of statistical methods and limits the number of factors analysed.

Using the graphical criterion, the first five principal components, with engine values greater than 1 were derived. The first five principal components account for about 88% of the total variance. The highest and the lowest loading values indicate the highest importance of parameters in determining the sample distribution along the first PC. The first (PC1), second (PC2), third (PC3), fourth (PC4) and fifth principal component explained 57%, 12%, 8%, 6% and 8% of the variance, respectively. According to the Kaiser criterion, further analyses can be limited to these five components, without loss of the relevant information in the remaining attributes tested. The results of the analysis are presented in Table 2. The first component was dominated by lightness (L*) and adhesiveness, while the highest loading values of colour coordinates (b*, ∆E and ∆C) and viscosity index were noted for the second principal component.

Table 2 Principal components coordinates of the variables

Multiple linear regression (MLR)

In order to prepare processed cheese overall quality model a MLR Eq. (1) and five principal components (PCs) selected in the PCA analysis, storage time and temperatures were used. This method allowed the number of predictors in the analysis to be limited. The following results were obtained in the regression analysis: F(7.29) = 9.04, p < 0.05, standard error of estimation—5.83, coefficient R = 0.9591, determination coefficient R2 = 0.9200 and RMSE = 17.03. The MLR model was highly significant and specifically described the influence of the storage conditions and components on the overall quality of the product. The MLR model is shown below:

$$ \begin{aligned} y &= 75.55 - 1.19 \times {\text{temparature}} - 0.02 \times {\text{time}} + 5.99 \times {\text{PC}}_{1}\\&\quad - 2.67 \times {\text{PC}}_{2} + 2.95 \times {\text{PC}}_{3} - 1.19 \times {\text{PC}}_{4} + 2.48 \times {\text{PC}}_{5} \end{aligned} $$
(2)

where y overall desirability, PC1–5 principal components.

MLR is a simple and well-known technique which helps to establish a relationship between the factors and the quality feature. One perceived disadvantage of MLR models is the ability to describe only linear relationships between variables and without considering other kinds of relationships, thus it can be seen as a limited method for preparing mathematical models. Even though the Multiple Linear Regression models are considered ineffective, they are used widely used for modelling process and successfully validated. Examples of this are studies where the MLR model for the cheese curd dry matter during curd treatment achieved high accuracy with a value R2 = 91.85 [30], Young’s modulus (YM) of apple tissue obtained R2 > 0.95 [31], or eight aroma properties of Dianhong tea produced R2 > 0.95 [19]. This tool was applied widely in other fields of science, such as environmental modelling [32] or waste water problems [33], proving its usefulness, simplicity and rapidity in preparation, which was also shown in the preparation of the models for overall quality changes during storage of spreadable processed gouda cheese.

Artificial neural network

ANN used storage conditions (time and temperature) and 5 factors selected by Principal Component Analysis that were used as input data for the ANN calculation. The datasets were divided into three subsets in a ratio of 2:1:1. These were a training set (a set of samples used to adjust the network weights), a validation set (a set of samples used to tune the parameters), and a test set (a set of samples used only to assess the performance to new, unseen observations). The performance of the neural network was confirmed by measuring its performance on a third independent set of data called a test set. The ANN was trained using selected parameters from the data set and was subsequently validated using an independent data set. The number of neurones in a hidden layer was varied in order to examine the influence of the hidden layers on the performance of the neural network. The results suggested that eleven neurones in the hidden layer were optimal and therefore they were selected to train the networks. Multilayer feed-forward fully connected ANN was trained with the Broyden–Fletcher–Goldfarb–Shanno learning algorithm (200 epoch). The search for an appropriate ANN model was performed using multilayer perceptron (MLP) and radial basis function (RBF) networks. The network structure developed for data included an input layer, one hidden layer and an output layer. The input layer made up of 7 neurons, 11 neurons in a hidden layer and 1 neurons in the output layer (Fig. 1). The sum of squares function was used during the network training process. In the resulting network the exponential function was used in the hidden layer, whereas the logistic function was used in the output layer. The success of the model in classifying objects can be evaluated as follows: training performance as a percentage of the samples in the learning set correctly classified during the networks learning step; test performance as a percentage of the samples in the testing set correctly classified during the network testing step and validation performance as a percentage of the samples in the validation set (samples not used in the learning and testing steps) correctly classified by the models during the network validation step. The model training performance obtained was 0.99, test performance was 0.88 and validation performance was 0.99. The correlation coefficient, R2, between the outputs and targets was a measure of how well the variation in the output was explained by the targets and outputs. A determination coefficient R2 = 0.98 indicates a good match between the observed and predicted data. Comparable model accuracy for processed cheese was obtained by Goyal and Goyal [8] with R2 = 0.9907. However, this model has a significantly lower the root-mean-square error (RMSE)-0.0093. These differences may be related to the amount and type of input data due to the fact that the Goyal study focused on cheese stored at 30 °C. In further analyses for processed cheese stored at 7–8 °C, Goyal and Goyal [1] tested the ANN with a single hidden layer consisting of 3–20 neurones. In their analysis, the determination coefficient was 0.9915 for 20 neurones in the hidden layer, while the use of nine neurones gave R2 = 0.9743, which is significantly lower than the one reported in this study. Based on these studies, it can be concluded that the number of nodes in the hidden layer should be correlated with the amount of input data. Figure 2 shows the results of the distribution between experimental and predicted values for the network of MLP 7-11-1.

Fig. 1
figure 1

The schematic model of ANN MLP 7-11-1

Fig. 2
figure 2

Distribution of the results obtained for the overall desirability using the MLP 7-11-1 model

Models verification

Verification of multiple regression models and ANN was performed on the basis of the determination coefficient (R2). Moreover, in order to verify the model’s ability to match, the root-mean-square error (RMSE) was used, indicating what variation is represented by the model. Regression models were characterized by lower determination coefficients and higher RMSE values. For temperatures 8, 20 and 30 °C determination coefficients were 0.99, 0.87 and 0.87, respectively for regression models, whereas they were 0.99, 0.96 and 0.96 for models based on artificial neural networks. Moreover, root mean squared errors of 1.67, 6.2 and 6.1 for 8, 20 and 30 °C, respectively, were higher for the MLR models than for ANN models, where the RMSE values for 8, 20 and 30 °C were 0.65, 3.34 and 3.3, respectively. These results showed that the determination coefficient of the ANN model for all temperatures was significantly higher (R2 = 0.98) than for the MLR (R2 = 0.94). In addition, the RMSE of the ANN model was 1.35 and was more accurate than the MLR model (RMSE = 2.48). Therefore, it appears possible to use both models, although the ANN model is a more reliable and accurate tool for predicting the overall desirability of spreadable Gouda cheese. Figure 3 illustrates the difference in prediction accuracy between both models. The curves of predicted values of overall desirability using the MLR model and the ANN model had a similar flow. However, a better fit was noted for the ANN model. ANN was commonly employed in studies on food changes and shelf-life with a good accuracy determined on the basis of R2 compared with other models such as regression. This tool was applied with very good results for vacuum packed soft cheese’s shelf-life and acidity prediction, where a back propagation algorithm was used with supervised training [22]. In the model the input data were: temperatures, failure possibility and maturation time, received coefficient R2 = 0.9996 for shelf-life and R2 = 0.6897 for acidity, which show better accuracy than for the model using regression. The results presented by Sánchez-González et al. [22] confirm our conclusions. In the studies by Bai et al. [34], ANN was used for predicting moisture content and colour changes in ginkgo biloba seeds. The outcomes for the coefficient between 0.9056 to 0.9834 for the ANN model confirmed that it is a precise tool with very good prediction accuracy. Moreover, ANN engaged in the evaluation of fruit ripeness and the prediction of a harvest date confirm that the ANN modelling has high accuracy and can be used as a predictive tool for perishable and prolonged shelf-life foodstuffs [35].

Fig. 3
figure 3

The overall desirability changes of processed cheese predicted by the MLR and ANN models during storage at 8 °C

Comparing the results obtained using ANN models and kinetic models proves that the ANN models give the highest correlation of prediction. Moreover, the unique feature of the artificial neural network is found independently and eliminates error, making the ANN models more useful as a prediction tool [27, 36].

In the next step, the overall quality level of processed cheese was predicted using the MLP 7-11-1 model. The quality change was determined for the selected periods in the product shelf-life, which refers to the specific stages of the product lifecycle: P1—production day, P2—wholesale, P3—retail sale, P4—purchase by customer, P5—consumption by customer, P6—last day of expiry date (Fig. 4). Based on the results obtained, it can be concluded that the average quality loss at the time of cheese consumption is about 48% versus 100% on the first day after production (when stored at 8 °C).

Fig. 4
figure 4

Overall quality changes of processed cheese in the selected periods based on the ANN model

In conclusion, the results indicated that both types of model were able to predict the overall desirability of spreadable Gouda cheese during storage with relatively good adjustment and fits between 0.99 and 0.87. However, the ANN model (multilayer perceptron type) had slightly better performance than the MLR models.. Consequently, the ANN model can be applied to predict quality deterioration during storage, which is important during the risk assessment process or food safety and quality assessment.