Introduction

Fresh seafood is a highly perishable product in terms of nutritional composition (i.e. high water activity, neutral pH, high protein content) (Masniyom 2011; Socaciu et al. 2018). Spoilage in seafood products could be occurred due to microbial and enzymatic activity, chemical deterioration (Boziaris 2015) and sensory loss (Mchazime and Kapute, 2018). Among the spoilage patterns in seafood, microbiological and chemical analysis are destructive, time consuming and labor intense methods to determine the quality of a particular seafood product. In contrast, sensory analysis is non-destructive, rapid and reliable in terms of the determination of the storage time and/or shelf life of seafood. Objective sensory tests could be divided into two groups such as discriminative (i.e. triangle test, ranking test) and descriptive tests (i.e. profiling and quality tests) (Martinsdóttir et al. 2009). To determine the storage time, the descriptive test is playing an important role in sensory analysis. There are three principal quality attributes in the sensory analysis that are color, texture and flavor profiling. Among these mentioned changes, the effect of color profiling has a significant contribution to determine the storage time during the sensory evaluation (Wrolstad and Smith 2010). Color analysis in a food matrix could be carried out by inspectors (i.e. panelists) or by using instrumental methods such as colorimeters. Determination of the color by inspectors may be subjective and variable from observer to observer (León et al. 2006). However, a uniform color space namely CIELAB proposed by International Commission on Illumination (CIE) in 1976. The definition of the colors in the uniform space is based on three values in the color coordinates, such as L* representing the luminosity from 0 to 100, a* and b* donates red–green and yellow–blue components from positive to negative values, respectively (Delgado-González et al. 2018; Luo 2006).

Prediction of the storage time in seafood could be performed by using mathematical models (Logistic, Baranyi, modified Gompertz, square-root, Arrhenius model, interaction models, generic models) regarding to the changes in bacterial growth with temperature fluctuations (Genç and Esteves 2016; Hansen et al. 2021). Mathematical models are precise for forecasting the storage time in seafood products. In recent years ANNs are gaining importance to have a modern approach for the prediction of quality changes, storage time and product quality evaluation (Goyal 2013). An ANN is a system that processes the information/data (i.e. input) similar to the human brain. Data are transferring by synapses to the nerve cells (i.e. neurons) to be processed. Consequently, processed data transmission occurs by axons between the nerve cells. In the computer applications (i.e. ANN), the neural simulations are processed by the system which has the ability to learn from the provided data (Bhotmange and Shastri 2011). In this context, ANNs are providing an effective forecasting method to determine the quality and safety changes in seafood. Ji et al. (2012) used a neural network to optimize the dense phase carbon dioxide parameters of microbial inactivation in shrimp. In another study presence and absence of Norwalk-like viruses were predicted by using ANN (Brion et al. 2005). Zhang et al. (2016) were used ANN and response surface methodology to model and optimize of Newfoundland shrimp waste hydrolysis for microbial growth. The protein hydrolysis of squid was modeled by in accordance with ANN modeling method (Abakarov et al. 2011). The quality changes of frozen shrimp (Solenocera melantho) were predicted by the neural network (Xu et al. 2017). Lalabadi et al. (2020) categorized the freshness of rainbow trout by developing multi class artificial neural network and support vector machines. Navotas et al. (2018) were determined the freshness classification and identify the fish species such as round scad, milkfish and tilapia by using ANN models. Several ANN model were applied to assess the quality, optimization and predicting sensory freshness in different food products (Concepcion et al. 2019; Kalathingal et al. 2020; Koyama et al. 2021). However, there is still insufficient data to determine the quality changes in seafood with non-destructive methods.

Meta-analysis compiles various independent research for quantitative evaluation of a certain aim (i.e. quality and safety evaluation of food) (Yu et al. 2018). As meta-analysis is an emerging method in terms of food science several research has been conducted in different food matrixes. Afari and Hung (2018) was evaluated the effectiveness of electrolyzed water treatments in reducing foodborne pathogens on poultry, egg, meat, fish and produce. Meta-analysis approach has been performed for the incidence evaluation of foodborne pathogens in raw milk and cheese of sheep and goat origin (Gonzales-Barron et al. 2017), Listeria monocytogenes in European cheeses (Martinez-Rios and Dalgaard 2018), presence of arsenic and lead in rice (Fakhri et al. 2018), shelf life prediction of frozen fruits and vegetables (Giannakourou and Taoukis 2019), bio-baseline establishment of trace metals in marine bivalves (Lu et al. 2019), inactivation of foodborne pathogens in fresh produce (Prado-Silva et al. 2015), prevalence of Staphylococcus aureus in poultry products (Ribeiro et al. 2018) and occurrence of foodborne pathogens in vegetables and fruits from retail establishments (Silva et al. 2017). Meta-analysis is an effective method for the quality and safety evaluation of food products. In this context, the purpose of this research is (i) to develop a storage time prediction model in seafood based on color (L*, a*, and b*) values by using ANNs, (ii) to optimize the topology of developed network and (iii) to validate the optimized network for further adaptation and possible usage in different seafood products.

Material and methods

Data collection

The collection of data was performed in accordance with the method described by Gonzales- Barron et al. (2018). The data set corresponds to the color values (L*, a* and b*) of different fresh or processed seafood products that were compiled from 205 experiments from the accessible literature data for the development of ANN (Table 1). The fresh seafood products were (n = 79) modified atmosphere, vacuum, and air packaged or stored in ice whereas the processed products (n = 126) have consisted of edible film-coated, a preservative added (i.e. nisin or phosphate) or non-thermal/thermal processed.

Table 1 Obtained data and product characteristics of different seafood to development of ANN

The 205 experiments were randomly divided into 145 (~ 70%), 30 (~ 15%) and 30 (~ 15%) data sets for training, testing and validation of ANN, respectively. Prior to analyzing the data set, obtained data were transformed into normalized values for the evaluation of developed ANN topology. All the raw data in the dataset were normalized between 0 and 1 (Eq. 1).

$$ Y_{normalized} = \frac{{Y_{i} - Y_{\min } }}{{Y_{\max } - Y_{\min } }} $$
(1)

In Eq. 1. \(Y_{i}\) donates raw input/output data, \(Y_{\min }\) is the minimum value in the data set where \(Y_{\max }\) is the maximum.

Development of ANN

The construction of ANN was performed in two steps. In the first step the collected data were used to train the network and in the second step trained network was validated based on unused collected data. A multilayer perceptron (MLP) with one hidden layer was trained and tested in this study. The architecture of the network was consisted of input, hidden and output layer and schematically shown in Fig. 1. The input layer contains 3 variables from the color value of different seafood while the hidden layer contains one or more neurons (1 to 40 neurons).

Fig. 1
figure 1

Schematic view of ANN. Input layer consisted of color values (L*, a* and b*), hidden layer contains up to 30 neurons and output layer representing the storage time

The Marquardt algorithm which is incorporated into the backpropagation algorithm was applied for training the feed-forward backpropagation network which is used as the network type in this study (Hagan and Menhaj 1996). Gradient Decent with Momentum and Adaptive Learning Rate Backpropagation (GDMALR) function was selected as training function which updates weight and bias values according to gradient descent momentum and an adaptive learning rate. Additionally, GDMALR function runs by adaptively changing the momentum in the neural network and works faster and more accurate compared to other learning functions (i.e. Gradient Descent Method with Adaptive Gain and Gradient Descent with Simple Momentum) (Rehman and Nawi 2011). The algorithm of the training function is shown in Eq. 2.

$$ dX = \frac{{\left( {mc*dXprev} \right) + \left( {lr*mc*dperf} \right)}}{dX} $$
(2)

where \(dX\) is the derivative of the variables, \(mc\) donates the momentum coefficient, \(dXprev \) is the previous change to the weight or bias, \(lr \) is representing the learning rate and \(dperf \) derivatives of performance with respect to the weight and bias variables X (Demuth and Beale 2002). Values from the GDMALR functionis then transformed by hyperbolic tangent sigmoid transfer function to calculate a single output (Eq. 3).

$$ y_{j} = \left( {f_{n} } \right) = \frac{2}{{1 + e^{ - 2n} }} - 1 $$
(3)

The architecture of ANN was designed in accordance with the training function. The maximum number of epochs was adjusted 10.000, the learning rate was 0.01, and the momentum constant was 0.9. A variable number of neurons were used (i.e.1 to 40) in the hidden layer to decide the optimum number of neurons. The network was trained until the maximum number of epochs was reached. To design and test the network, a neural network toolbox from MATLAB® (R2014a, USA) was used.

Performance evaluation of ANN

The evaluation of the performance of developed ANN was carried out based on Mean Absolute Deviation (MAD), Mean Square Errors (MSE), Root Mean Square Errors (RMSE), Correlation Coefficient (R2), Mean Absolute Error (MAE) and F-test statistics. The MAD is a measure of scale of individual differences that explains how two independent data were agreed each other (Bohlscheid-Thomas et al. 1997) (Eq. 4). MAE and RMSE are donating the average model prediction error (Willmoth and Matsuura 2005). The correlation coefficient (R2) is widely used to compare the relationship between repeated outcomes (Edwards et al. 2008).

$$ MAD = \mathop \sum \limits_{i = 1}^{n} \left| {x_{i} - \overline{x}} \right| $$
(4)
$$ MSE = \frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {y_{calc}^{i} - y_{\exp }^{i} } \right)^{2} $$
(5)
$$ RMSE = \sqrt {\frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {y_{calc}^{i} - y_{\exp }^{i} } \right)^{2} } $$
(6)
$$ R^{2} = 1 - \frac{{\mathop \sum \nolimits_{i = 1}^{n} \left( {y_{calc}^{i} - y_{\exp }^{i} } \right)^{2} }}{{\mathop \sum \nolimits_{i = 1}^{n} \left( {y_{calc}^{i} - \overline{y}} \right)^{2} }} $$
(7)
$$ MAE = \frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left| {y_{calc}^{i} - y_{\exp }^{i} } \right| $$
(8)

where in Eq. 4. \(\overline{x}\) represents the mean, \(x_{i}\) is the absolute differences between output values in Eqs. 5, 6, 7 and 8\(y_{calc}^{i}\) is the calculated and \(y_{exp}^{i}\) is the observed values. Finally, \(n\) is the number of subjects.

Results and discussion

Optimization of topology

Significant attention should be paid to the determination of topology during the development of ANN model. In this study, the best topology was selected based on the R2 and MSE values. At the total 40 neurons were structured in ANN and evaluated. The results of the ANN topology are shown in Table 2. The selection of an optimum number of the neurons was performed with the purpose of maximizing R2 and minimizing MSE values. The changes in R2 and MSE values were varied regardless of the number of neurons until the neuron number reached to 25. However, 30 and 40 neurons in the hidden layer donated the same R2 values which found to be 0.81. Similar to the changes in R2 values, MSE values were also varied independently from the number of the neurons. The term of correlation coefficient is the measure of the degree of association between two variables that are both measured on a series. Additionally, the strength of correlation is donated by correlation of coefficient. Regardless to the method conducted the coefficient could have a magnitude between 0 and 1. The highest correlations are defined when the magnitude has a values of − 1 and + 1 (Brower, 2000a). The association degree in magnitude of correlation coefficient could be categorized in four groups namely strog 0.8–1.0, moderate 0.5–0.8, weak 0.2–0.5 and finally negligible 0.1–0.2 (Brower, 2000b). The correlation coefficient which was calculated to be 0.81 in this study there is a strong correlation in the variable which used for development and optimization process.

Table 2 Correlation coefficients (R2) and Mean square errors (MSE) of neurons in the optimization of the topology

The lowest MSE was reported for 1, 2 and 17 neurons while the highest was found to be 0.5 for 9 neurons. The MSE values of 40 neurons were slightly lower than those of 30 neurons. While the aim of the topology optimization is to maximize the R2 and minimize the MSE, the highest R2 and the lowest MSE was found in 40 neurons. However, as the R2 and MSE values remained, the use of the best topology was decided with 30 neurons in the hidden layer and the network was trained with 30 neurons. Similar results were reported with lower neurons by Zhang et al. (2016) who reported that the MSE values were reached the minimum value after 11 nodes contained in the hidden layer and become stable during the development of ANN model for Newfoundland shrimp waste hydrolysis. In another study, the quality changes in rainbow trout (Oncorhynchus mykiss) fillets were predicted by using ANN model. Researchers constructed the ANN model with one hidden layer and reported the lowest MSE and highest r2 values as 0.00418 and 0.9697 with 6 neurons, respectively (Liu et al. 2015). Bai et al. 2018 were studied drying kinetics and color changes of ginkgo biloba seeds during microwave drying process and modeled the changes by using ANN. The model was applied to estimate the moisture ratio color parameters (i.e. L*, a* and b*). The researchers were concluded their study that ANN model was able to precisely predict the experimental data with correlation coefficients and MSE of between 0.90–0.98 and 0.0014–2.2044, respectively. The results that reported by the authors were similar to current study, as in Table 2, developed ANN model was used 40 neurons with high correlation coefficient (R2 = 0.81) and low MSE which is 0.14.

Validation of ANN model

A total of 45 data sets were used for the validation of ANN model and compiled from the accessible literature that is shown in Table 3. The selected data set represents the color changes (L*, a* and b*) of different seafood stored under chilled conditions (+ 2 to + 4˚C).

Table 3 Data used for the validation of developed ANN in different seafood

The storage time of different seafood was predicted by the network with 30 neurons in the hidden layer and the performance evaluation of the model is shown in Table 4. For the performance evaluation of developed ANN model MAD, MSE, RMSE, R2, MAE and F-test values were found to be 0.20, 0.05, 0.002, 0.80, 0.71 and 1.06, respectively. The model performance showing that the developed ANN model successfully validated in accordance with the performance criteria indicating that good agreement was reached between the predicted values and observed data. Additionally, properly-trained network must highly be predictable for the new data set (Razavi et al. 2004; Nourbakhsh et al. 2014; Tan et al. 2020).

Table 4 Performance evaluation of the ANN

Khoshnoudi-Nia and Moosavi-Nasab (2019) were evaluated the multispectral imaging system for the prediction of various freshness indicator in rainbow trout fillets. Researchers were applied linear (Partial Least Square Regression (PLSR), Multiple Linear Regression (MLR)) and nonlinear (least-squares support vector machine (LS-SVM), back-propagation artificial neural network (BP-ANN)) models to predict the changes in Psychrotrophic Plate Count (PPC), Total Volatile Basic Nitrogen (TVB-N) and sensory scores. For BP-ANN models the prediction correlation coefficient and RSMEP were calculated to be 0.92 and 0.594, 0.85 and 3.65, 0.91 and 1.848 for PPC, TVB-N and sensory scores, respectively. Compared to our results researchers were reported higher correlation coefficient for the data predicted by BP-ANN model. However, RMSE was found lower compared to those results reported by Khoshnoudi-Nia and Moosavi-Nasab (2019). This differences between the research findings could be due to the methods (traditional and instrumental) used to predict the changes in quality parameters (i.e. PPC, TVB-N). Microbiological and chemical changes have great potential to determine the quality loss in seafood. However, On the other hand color changes in seafood also have direct influence on the quality changes in fishery products (Hassoun and Karoui 2017; Prabhakar et al. 2020). In this context, it is presumable to have different performance values (i.e. RMSE or R2) in the validation process.

Comparison of observed and predicted storage time

The agreements between predicted storage time which are obtained by developed ANN and observed storage time that belongs to different seafood and compiled from the accessible literate are shown in Fig. 2. The R2 value of the regression line is found to be 0.85. Higher correlations reported by Niamnuy et al. (2012) who were studied the physicochemical changes of shrimp during boiling and an ANN model has been developed to predict the protein changes of shrimp. The ANN model was developed and consisted of two hidden layers and twelve neurons per layer. Researchers were agreed that the ANN model was precisely predicted the protein and physical changes in boiling shrimp with the coefficient of R2 = 0.994 and 0.972, respectively. Similar correlations between predicted and observed values has been reported in another study which includes the development of ANN to predict the storage time of yogurt stored under refrigeration temperatures (+ 4 to + 7). In accordance with the conclusions of the authors, ANN model was able to predict the storage time in yogurt with high correlation that were reported to be 0.9996 (Sofu and Ekinci, 2007).

Fig. 2
figure 2

Predicted vs observed storage time plot obtained by developed ANN. *storage time values are shown in normalized scale. The optimum network with 1 hidden layer and 30 neurons per hidden layer was used. The validation data set was consisted of 45 data which belong different seafood

Khanzadi et al. (2010) applied the ANN to predict the growth of Clostridium botulinum as a function of environmental factors such as essential oils, pH, NaCI and temperature. The probability percentage of the growth of C.botulinum was predicted by ANN with the R2 value of 0.988. The determination coefficient cannot be a good criterion alone to evaluate prediction accuracy (Gorgulu 2012). The differences between the literature findings and this study could be the result of using pooled data. The quality indices data for seafood (microbiological, chemical, biochemical, sensory) with different processing techniques (i.e. packaged (vacuum or modified atmosphere), marinated, preservative added etc.) creates a data pool with variances. However, using variated data in prediction studies reinforce the prediction intervals and eventually requires fewer calibrations for further experiments. Additionally, pooling dependent and independent data could support to meet more robust parameter estimates including more biological variations (Hensen et al. 2021). Moreover, due to using of pooled data which represents the color values of different seafood relatively lower R2 value (0.85) has been achieved compared to literature findings in this study. However, it is obvious that a good agreement has been achieved in this study between observed and predicted storage time values (Fig. 2).

Conclusions

Storage time prediction of seafood by artificial neural network based on color (L*, a* and b*) values has been proven to be an accurate method. The architecture of the model was optimized with one hidden layer and thirty neurons in the hidden layer. Model evaluation indicating a good agreement between observed and predicted values. Low RSME and MAE values indicating that the model has been successfully validated. Developed ANN model could predict the storage time of fresh or processed seafood with a high R2 value of 0.80. Among other quality indicators (i.e.TVB-N, Trimethylamine Nitrogen (TMA-N), K-value, Microbiological changes etc.) color measurements are non-destructive and not time-consuming and does not require preliminary training for the evaluation like sensory analysis. In this context, color measurements were used in this study to estimate the storage time in seafood products and should be emphasized that the combination of ANN models and color parameters as an input in the models has great potential and advantage to predict the storage time in seafood while it is fast, accurate and reliable. Additionally, another advantage of the developed ANN model is that the model can be adapted in different seafood products to predict the storage time.