Application of VIS / NIR Spectroscopy and SDAE-NN Algorithm for Predicting the Cold Storage Time of Salmon

College of Engineering, South China Agricultural University, Guangzhou, China Key Laboratory of Key Technology on Agricultural Machine and Equipment, South China Agricultural University, Ministry of Education, Guangzhou, China Guangdong Provincial Key Laboratory of Food Quality and Safety, Guangzhou 510642, China School of Information Science and Technology, Zhongkai University of Agriculture and Engineering, Guangzhou 510225, China


Introduction
Atlantic salmon (Salmo salar) are farmed in cold sea water, which is delicious and rich in protein, amino acids, and unsaturated fatty acids.The fish are slaughtered and stored in a freezer under ice when consumers buy salmon in the market.The storage time is an urgent aspect of selling, due to the decrease in the freshness or even deterioration with increasing the storage time.However, it is difficult for consumers to identify the freshness of the salmon unless the salmon is thoroughly spoiled, such as smell or color change.Traditional detection methods, such as quantization index modulation (QIM) [1], mainly depend on artificial detection which may be low efficient and primarily rely on experience.On the other hand, the salmon will have a series of microbial changes and biochemical changes during storage [2,3].Some microorganism and chemical detection methods such as total viable count (TVC) [4], total volatile basic nitrogen (TVB-N) [5], and K value detection [6] have been used to detect the freshness or storage time of meat.However, the above methods have some disadvantages, such as QIM method which requires trained people and cannot grade the salmon without the head.The microorganism and chemical methods are destructive, not only complicated and time-consuming, but also the waste of raw materials.
Spectral technology is currently considered to be an effective detection technology and has a series of advantages, such as low sample amount, environmentally friendly, and reusable.This technology has been applied to autolytic change detecting [7], fat predicting [8], fish oil predicting [9], adulteration detecting [10,11], freshness [12,13], and so on.In the previous reports of spectroscopy technology, chemometric methods such as partial least squares regression (PLSR) [14][15][16] and back propagation neural network (BP-NN) [17] were used as the main modeling methods.However, the above methods have some disadvantages; for example, before PLSR modeling, the spectra need to be pretreated to eliminate the noise such as scattering and distortion.The BP-NN modeling has some disadvantages such as gradient vanishing [18] and local minima [19], which make it difficult to carry out multilayer training, and the selection of parameters should be careful to avoid overfitting and local optimal.
Therefore, to solve the above problems, stacked denoising autoencoder neural network (SDAE-NN) was used to predict the storage time of salmon.This work combines the stacked autoencoder (SAE) algorithm and denoising technology [20,21] to improve the neural network model and has the following advantages: (1) The SDAE-NN could effectively avoid the vanishing gradient problem with the use of the layer-wise method [18].(2) The SDAE-NN could effectively avoid the local optimal problems through unsupervised pretraining [22] and supervised fine tune.(3) The robustness and antinoise ability of SDAE-NN were better than BP-NN and other traditional NN algorithms.

Materials and Methods
2.1.Salmon Samples.Norwegian salmon was collected from Junhui Import and Export Company Ltd. (Guangzhou, China).After being caught in the Atlantic, salmon was hit in the head, cut tail, gutted, and rapidly frozen then shipped to China from Norway at a constant temperature of −40 °C.In China, 90 salmon meat fillets were collected from the inside middle back parts of different salmons.66 salmon skin fillets were collected from different salmons back parts without scales.The samples were then quickly packed to the laboratory with ice-packed polyethylene, located with ice under the salmon package, and stored at the constant temperature box (~2 °C), and the storage condition was kept unchanged.During the storage period, the ice was added every day to achieve the similar storage conditions in the market.

VIS/NIR Spectroscopy Measurement.
Ocean optics USB4000 (Ocean Optics, USA) Fourier transform fiber spectrometer and 38 mm integrating sphere (Jingyi, China) were used to collect the VIS/NIR reflection spectroscopy.The overall measurement range was from 400 to 1000 nm with a resolution of 1 nm.15 spectra of salmon meat fillets and 11 spectra of skin fillets were acquired at the storage time of 0, 2, 5, 8, 11, and 16 days.In each measurement day, the samples were rapidly taken to the spectroscopic laboratory and measured at 3 to 5 p.m. Before measuring the salmon spectra, the spectrometer was allowed to warm up for 20 minutes.Then, spectrometer was calibrated through measuring a standard whiteboard as 100% reflectance (W) (the exposure intensity about 55000), a dark background as 0% reflectance (D).The salmon spectrum could then be collected through the following formula.
Each salmon spectrum was acquired with 64 spectra being scanned successively and averaged.To exclude the effects of the dark current on the instrument, the spectrometer was calibrated once after measuring five salmon spectra.The laboratory environment was kept unchanged at the temperature of 20 °C and humidity 30 ± 5%, and a total of 90 salmon meat spectra and 66 salmon skin spectra were collected.

Algorithm Description
2.3.1.Autoencoder Neural Network.The spectral data always have hundreds or even thousands of dimensions, and many dimensions have a certain correlation.In the past, PCA algorithm was often used for dimensionality reduction, which was a linear reduction method that the new dimensions were the transformation combination of the original dimensions [23].However, it could not be applied for the nonlinear conditions.The autoencoder is considered as an efficient method for nonlinear dimensionality reduction.In the neural network model, autoencoder [24] is an unsupervised learning algorithm, which can learn the characteristics of the internal structure of data and extract the characteristics more efficiently.The process of the autoencoder neural network was shown in Figure 1.
When training the neural network H M , if the input of neural network was equal to output X N = XN , the network could be considered as an autoencoder neural network.When the number of hidden layer neurons M is less than the input spectral data dimensions N, the process from the input X N to the hidden layer H M can be considered as a data compression and dimensionality reduction.In this process, the autoencoder neural network can obtain the appropriate initial weights layer by layer through using unsupervised spectroscopic data.During the training process, the hidden layer data information should be lost as few as possible (information-preserving encoding), and the output data reconstructed after training should restore the original data characteristics as much as possible.Through the autoencoder technique, the original data were effectively compressed and the neural network could get better initial weights.

Stacked Denoising Autoencoder.
Stacked autoencoder [21] was composed of multilayer autoencoder, and the 2 Journal of Spectroscopy output from the previous layer of autoencoder was used as the input of the subsequent layer.Stacked autoencoder adopts the layer-wise [18] method to train each layer of a neural network by unsupervised training method.A deep-learning network can be established through unsupervised pretraining and supervised output layer regression or classification.In this work, salmon spectral data were trained by a double-layer autoencoder model.The structure was set up as shown in Figure 2. The input layer x 1 − x 600 represents spectral data which have 600 dimensions.The first hidden layer H [1] was compressed to 200 dimensions, and the second hidden layer H [2] was compressed to 100 dimensions.The training steps were as follows: (1) X»H [1] »X, X = x 1 , … , x 600 .
H [1] and H [2] could be separately gotten by the autoencoder training steps (1) and ( 2).H [2] had 100 dimensions, so it could be considered that the spectral data was compressed from 600 dimensions to 100 dimensions and the 100 dimensions data contained the information of 600 dimensions of input.After that, the model needs to reconstruct the spectral data by making XN ≈ X N .By the stacked autoencoder, the weights of the hidden layer have been trained well and could be used as the initial weights of the neural network.
When noise was added to the input signal, the learning process was more robust by reconstructing the original signal by adding noise data.Stacked denoising autoencoder algorithm (SDAE) was implemented by adding noise to the input data of the stacked autoencoder [21].The stacked autoencoder must learn to remove the noise and get real input that was not contaminated by the noise.Therefore, this forced neural network gives more robust expression of input signals and its adaptability was stronger than the general neural network.

Results and Discussion
3.1.Spectral Analysis.When collecting the salmon spectra, after repeated measurement and continuous calibration of the spectrometer, the spectra in the NIR region still had a lot of noise and the spectral analysis of the region was affected.Therefore, in order to avoid the negative effect of noise on the NIR region, only the visible region (400-700 nm) was analyzed and discussed in the paper.The spectra of the salmon meat and skin of different storage days were averaged, as shown in Figure 3.The main difference between the salmon meat and skin at visible light region (400-700 nm) was the color of the skin was different from the salmon meat.When the salmon meat and skin were observed separately, we could see that the spectra of different storage times were not obvious.To better observe the spectral differences in different storage times, a second derivative and 21 points quadratic polynomial Savitzky-Golay smoothing method was used in the spectra of salmon meat (Figure 4).The wavelength range in 400-700 nm has a correlation with freshness because of the change in heme proteins [13,25], and it could be seen that there are some differences at the peak position of 432, 550, 574, 606, and 621 nm during different storage times.The differences around 432 nm were ...

+1
h 200 [1] h 100 [2] h 1 [2] h 3 [1] h 2 [1] h 1 [1] ... +1 ĥ 200 [1] ĥ 3 [1] ĥ 2 [1] ĥ 1 [1] x 5 3 Journal of Spectroscopy probably due to the absorption by met Hb and/or met Mb, the peak at 550 nm may be mainly caused by deoxymyoglobin, the differences around 574 nm are caused by the content of oxymyoglobin changing during different storage times [26], and the peak around 621 nm may be caused by hemin chloride [27].Meanwhile, the amount of HbO 2 is different between the fresh and not fresh fish which can be reflected at 606 nm [13].Another peak at 503 nm may have an influence on freshness because of metmyoglobin, but it is covered by a wide absorption peak at 500 nm (Figure 3) which is assigned to carotenoids, such as astaxanthin and canthaxanthin [28], and has a negative impact to the freshness.Further, the principal component regression-(PCR-) weighted regression coefficient (BW) was analyzed to observe the important spectral peaks (Figure 5), and it could also be observed that 432, 496, 557, and 621 nm had important effects on distinguishing different storage times.The peak at 557 nm is due to deoxymyoglobin [26]; therefore, it can be concluded that the differences in the storage time of the salmon are mainly caused by heme protein changes such as oxymyoglobin, deoxymyoglobin, met Hb, and hemin chloride.4 Journal of Spectroscopy and back propagation neural network (BPNN) models also were established to compare the performance of SDAE neural network.In the process of modeling, the salmon meat and skin spectra were used as input data, and the number of storage days was used as the output source.In the salmon meat and skin spectra, 3/4 of the samples were randomly selected for modeling, and the remaining 1/4 samples were used as external prediction samples.Model determination coefficient, prediction mean square error of calibration sets (RMSEC), root mean square error of cross-validation sets (RMSECV), and prediction accuracy were used to evaluate the performance of the model.Firstly, the salmon meat spectral model was established.In the process of PLSR modeling, when the number of principal components was 6, the model could achieve the best performance with determination coefficient of calibration sets (R 2 CAL ) 0.97, determination coefficient of crossvalidation sets (R 2 CV ) 0.96, determination coefficient of test sets (R 2 test ) 0.97, RMSEC 0.99, RMSECV 1.18, and RMSEP 1.0317.A threshold was set in the middle of every two storage days, and when the predicted days exceed the threshold, it could be judged as a prediction error.According to the statistics, when PLSR method was used, the prediction accuracy of calibration sets was 94.7%, and the prediction accuracy of cross-validation sets was 90.8%.When the 25 external test samples were predicted as shown in Figure 6, there were 5 samples misclassified and the prediction accuracy was 80%.
When back propagation (BP) neural network model was built, we used three-layer neural networks and the number of neurons was 200-100-1.The hidden layer activation function was the hyperbolic function (tanh), and the output layer was the linear function "y = x."The number of iterations was 1000, and the learning rate was 0.001.When the gradient descent method [29] was used to iterate, the result was shown in Figure 7. Four samples were wrongly predicted with R 2 CAL 0.95, R 2 CV 0.93, R 2 test 0.96, RMSEC 1.4, RMSECV 1.55, and RMSEP 0.99.The accuracy of prediction test sets was 84.6%.
The SDAE-NN was a double autoencoder structure, the number of the first autoencoder neurons was 600-200-600, and the second layer was 200-100-200.The activation function of both layers was the hyperbolic function (tanh), and the output layer activation function was the linear function.Through this algorithm, there were three samples which were wrongly predicted (Figure 8) with R

5
Journal of Spectroscopy PLSR model, the model performance was best with R 2 test 0.90 and RMSEP 2.42.The BP-NN and SDAE-NN methods use the same parameters as salmon meat modeling, When BP-NN was used to predict the test sets, the R 2 test was 0.91 and RMSEP was 2.26.When SDAE-NN was used to predict the test sets, the R 2 test was 0.92 and RMSEP was 1.75.As shown in Figure 9, the three methods all had a good performance in predicting the storage days of the salmon skin.However, PLSR had the maximum root mean square error and the least determination coefficient.In contrast, the SDAE-NN method had the smallest predicted error and the largest determination coefficient.
Furthermore, we have compared the prediction performance of the salmon skin and salmon meat using the three methods, as shown in Table 1.It can be seen that the performance using the salmon meat was better than salmon skin unrelated to the as-used method.When the salmon skin was used to predict, the best result of R 2 test was 0.92 and RMSEP was 1.75.While when the salmon meat was used to predict, the best result of R 2 test was 0.98 and RMSEP was 0.93.
The denoising ability of the SDAE-NN model was also studied in this work.In order to improve the denoising ability, Gaussian noise with the variance of 0, 0.01, 0.02, 0.03, 0.04, and 0.05 was added during the autoencoder training, respectively.As shown in Figure 10, when Gaussian noise variance was 0.02, the RMSEP of the model was 0.93, the determination coefficient was 0.98, and the model has the best performance with high robustness and denoising ability.
3.3.Discussion.In this paper, the reason why using the salmon meat could get better prediction result than the salmon skin was that the composition of the salmon meat was different from the salmon skin.On the one hand, the salmon meat had a higher moisture content and was more easily rotted and decayed during storage.The differences of the salmon meat in the absorption peak position and strength were more obvious than the salmon skin, due to the dramatic changes of the chemical composition in the meat, such as bacteria breeding, fat oxidation, and protein decomposition [30].On the other hand, the visible region of the spectrum (400-700 nm) has been proved to have a great influence on the freshness of fish [13,31].The oxidation of heme proteins, such as haemoglobin (Hb) and myoglobin (Mb), was detected and explained with most spectral variation in the visible region [13,32], and the salmon meat contains more haemoglobin (Hb) and myoglobin (Mb) than the skin.
Nilsen et al. [12] also used spectroscopy to predict the storage time of salmon, and the best result of R 2 test 0.98 and RMSEP 1.20 was achieved using the PLSR method.However, it was achieved under the precondition of 10 principal components, which might be overfitting.When the PLSR method was used in this paper, the prediction accuracy could reach 1.03 day under 6 principal components, which was higher than the above reference.It is found that the conditions of sample storage, such as the storage temperature and the degree of exposure, might have a certain effect on the biochemical and chemical changes of the meat [4].At the same time, the noise of the spectra and the parameters of test instruments also have a certain effect on predicted results.
In the comparison of three kinds of algorithms, we could find that using the neural network method (BP-NN and SDAE-NN) could get better results than the PLSR method.The PLSR is better at solving linear regression issues and is susceptible to noise, so when there was more noise in the spectra, the modeling was not effective enough.In contrast, the neural network method, containing multiple neurons and weights, is more suitable to solve the problem of nonlinear regression and classification.Of course, whether the model parameter has been suited, the set would have a great impact on the effect of the neural network.Since this work carefully selected the related parameters of BP-NN, such as  the learning rate, the results were better than those of the PLSR method.SDAE-NN algorithm had the best performance of the three algorithms; it is attributed that SDAE-NN is an improved algorithm on the basis of BP-NN.In BP-NN, the weights are initialized randomly and the performance of the BP-NN depends on the selection of the initial value.So it is easily prone to local optimal, and when the number of layers of the neural network increases, gradient descent method used in training networks would have a big probability of creating gradients vanishing and it is difficult for the neural network to select the optimal parameters.In the SDAE-NN algorithm used in this paper, the weights of the neural network were not randomly initialized but obtained through pretraining [22], and it could be considered the optimal weights.In the pretraining, the neural network was trained layer by layer through the autoencoder technology.The hidden features of each layer after training were used as input to the next layer, so that the problem of gradients vanishing could be eliminated as much as possible.At the same time, the process of SAE also reduced the dimensions of spectral data and was considered to be a better dimensionality reduction method than principal component analysis [22].
We have rephrased the highlighted sentence.Please confirm that this is your intended meaning.Due to some noises caused by environment, equipment, samples and baseline drift have a negative impact on the performance of the model, another advantage of SDAE-NN is its denoising ability compared with PLSR..The PLSR method used in the previous reports [4,33] needs to perform spectral preprocessing such as multiplicative scatter correction and standard normal variate before modeling to eliminate noise.In this paper, we added some Gaussian noise in the autoencoder process to improve the robustness of the neural network (Figure 10) and to enhance the antinoise ability of the model.Therefore, good prediction results could be obtained in the SDAE-NN method without spectral preprocessing.
It should be pointed out that although SDAE-NN had obtained the best prediction results; however, the prediction accuracy rate of the test sets was only 88.5%.When training the SDAE-NN, it was easy to achieve 100% accuracy of the calibration sets, but the test sets was difficult to achieve this accuracy because the neural network was easy to overfit.At this time, increasing the number of samples is considered to be a better method than adjusting the parameters and structure of neural network itself because the characteristic of neural network is that its performance and accuracy can be significantly improved with the increase of training samples.The prediction accuracy will be closer and closer to 100% when the number of samples is collected enough and the measurements of spectra are accurate.

Conclusion
VIS/NIR spectroscopy combined with SDAE-NN algorithm has been used to predict the storage time of the  7 Journal of Spectroscopy salmon meat and skin.The salmon meat is proved to be a better location that could get better predictive performance than the salmon skin.Compared with PLSR and BPNN algorithm, the SDAE-NN could achieve better determination coefficient and smaller prediction error with R 2 test = 0.98 and RMSEP = 0.93 day.This technique was nondestructive, low cost, and fast and has no-preprocessing and could be considered as an effective method for predicting the storage time of the salmon.Furthermore, the new technique can be widely adopted to predict the freshness of other agricultural products.

Disclosure
This article does not contain any studies with human participants or animals performed by any of the authors.

3. 2 .Figure 3 :Figure 4 :
Figure 3: The average spectra of the salmon meat (a) and skin (b) at different storage days.

Figure 5 :
Figure 5: Principal component regression-weighted regression coefficient (BW) for salmon meat spectra at different storage days.

Figure 6 :
Figure 6: Predicted results of PLSR model for test sets of the salmon meat.

Figure 7 :
Figure 7: The predicted results of BP-NN model for test sets of the salmon meat.

Figure 8 :
Figure 8: The predicted results of SDAE-NN model for test sets of the salmon meat.

Figure 9 :
Figure 9: The predicted results of SDAE-NN, BP-NN, and PLSR models for test sets of the salmon skin.

Figure 10 :
Figure 10: Influence on the model of Gaussian noise with different variance.

Table 1 :
The performance of SDAE-NN, BP-NN, and PLSR models for test sets.