Salmon shelf life prediction method and system based on hyperspectral imaging
Through hyperspectral imaging technology and machine learning algorithms, a salmon shelf life prediction model was established, which solved the problem of difficult to quickly and losslessly predict salmon shelf life in the existing technology, and achieved efficient and accurate shelf life prediction.
Patent Information
- Application Number
- CN202411466547.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is difficult to predict the shelf life of salmon quickly, without loss and easy to operate, especially under different temperature conditions.
Hyperspectral imaging technology combined with machine learning algorithms is used to obtain its hyperspectral data by scanning salmon through non-invasive scanning, and a prediction model is established to calculate its remaining shelf life.
It realizes fast and accurate prediction of salmon shelf life, reduces inspection time and cost, and improves prediction efficiency and product quality control.
Smart Images

Figure CN119413731A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of food technology, and in particular to a salmon shelf life prediction method based on hyperspectral imaging. Background Art
[0002] Salmon is a high-value salmon or trout that mainly lives in the cold waters of the Northern Hemisphere. It is known for its bright color, delicious taste and high nutritional value, and is hailed as the "treasure of the water" and the "supreme fish". This fish is not only rich in protein and unsaturated fatty acids, but also contains vitamin D, B vitamins, and minerals such as selenium and phosphorus. Salmon can be eaten raw, such as sushi and sashimi, or cooked into various dishes. It is a common ingredient in Western cuisine. Due to its high protein and high fat characteristics, salmon is prone to corruption during storage and transportation, and its shelf life is relatively short. In order to ensure the quality and safety of salmon, it is necessary to develop a method to quickly predict changes in salmon quality to monitor its remaining shelf life in real time.
[0003] Shelf life refers to the longest period of time that food can maintain its quality, safety and acceptable sensory properties under certain storage conditions. During this period, the food is considered suitable for sale and consumption. The length of shelf life is affected by many factors, including the initial quality of the food, processing methods, packaging, storage conditions, and the chemical and biological stability of the food itself. Traditional shelf life predictions of aquatic products usually rely on measuring freshness indicators such as total colony count, TVB-N, K value, and are determined by fitting kinetic models of microbial growth or chemical reactions. These methods are time-consuming and labor-intensive, and it is difficult to meet the needs of the modern fast-paced era. There is an urgent need for a fast, non-destructive, and easy-to-operate judgment method for the shelf life of salmon at different temperatures.
[0004] Hyperspectral imaging technology combines spectral technology and imaging technology, and can perform surface spectral analysis in the spatial dimension. This technology obtains hyperspectral data by collecting hundreds of images of different wavelengths to form a hyperspectral cube. These images not only record the external characteristics of the sample to be tested, such as shape, color and texture, but also reveal its internal molecular structure and composition state, thereby visualizing quality information and achieving the purpose of online detection. This technology has a wide range of applications in many fields, including agriculture, geological exploration, environmental monitoring, food safety testing, etc. Summary of the invention
[0005] The purpose of the present invention is to provide a salmon shelf life prediction method and system based on hyperspectral imaging to solve the problems raised in the above background technology.
[0006] To achieve the above-mentioned object of the invention, one aspect of the present invention provides a salmon shelf life prediction method based on hyperspectral imaging, comprising the following steps:
[0007] Step S1, buy some fresh salmon, cut them into slices of about 5 cm×5 cm×0.4 cm, put them into sealed bags, and store the fresh salmon slices in thermostats at -2°C, 0°C, 2°C, 5°C, 10°C, and 18°C respectively;
[0008] Step S2, collecting hyperspectral data of salmon fillets under different storage temperature conditions every day, and determining the TVB-N (Total Volatile Base Nitrogen) value and total bacterial count;
[0009] Step S3, correcting and preprocessing the acquired hyperspectral data;
[0010] Step S4, establishing a prediction model between hyperspectral data and salmon shelf life through a machine learning algorithm;
[0011] Step S5, input the hyperspectral data and storage temperature of the salmon to be tested, and calculate its remaining shelf life through the prediction model.
[0012] Furthermore, the effective working wavelength range of the hyperspectral imaging device used in step S2 is 400nm to 1000nm, and the spectral resolution is less than 5nm.
[0013] Furthermore, the method for determining the TVB-N value of salmon in step S2 includes the semi-micro nitrogen determination method, automatic Kjeldahl nitrogen determination method and micro-diffusion method specified in GB5009.228-2016 "National Food Safety Standard Determination of Volatile Basic Nitrogen in Food". The total colony count is determined according to the method specified in GB 4789.2-2016 "National Food Safety Standard Determination of Total Colony Count in Food Microbiological Examination".
[0014] Furthermore, the day of step S1 is recorded as day 0, and so on. When the TVB-N value on the nth day is greater than 30 mg / 100 g or the total colony count exceeds 6 lg CFU / g, step S2 is terminated, and n is the actual remaining shelf life of the salmon at this temperature.
[0015] Furthermore, in step S3, the hyperspectral data is corrected by a black-and-white plate, and then a mask is set on the hyperspectral data to distinguish the fish area from the background area; the black-and-white plate correction formula is as follows:
[0016]
[0017] Where: I is the corrected hyperspectral imaging data, W is the whiteboard data, B is the blackboard data, and I0 is the original hyperspectral imaging data.
[0018] Furthermore, in step S3, the hyperspectral data preprocessing method includes multivariate scattering correction, smoothing, first-order and second-order derivatives, normalization, wavelet transform and Fourier transform.
[0019] Furthermore, the multivariate scatter correction is used to eliminate the spectrum changes caused by the scattering effect, and the calculation step includes the following steps:
[0020] Step S301, calculate the average value of all sample spectral data, the calculation formula is as follows:
[0021]
[0022] Step S302: perform linear regression analysis on the spectrum of each sample and the average spectrum. The calculation formula is as follows:
[0023]
[0024] Step S303, subtract the regression intercept from each sample spectrum and divide it by the regression slope. The calculation formula is as follows:
[0025]
[0026] Where A is the calibration set spectral matrix, A i represents the spectrum of the i-th sample, n is the sample size, α is the slope, and β is the intercept.
[0027] Furthermore, the machine learning algorithms used in step S4 include multiple linear regression, principal component analysis, partial least squares regression, support vector machine, random forest and deep neural network.
[0028] Furthermore, the method of using the least squares support vector machine to perform model training includes the following steps:
[0029] Step S401, divide the data into a training set and a test set in a ratio of 4:1, the training set is used for model training, and the test set is used for model verification;
[0030] Step S402, using the Least Squares Support Vector Machine (LS-SVM) and selecting the Gaussian Radial Basis Function (RBF) kernel function to establish a prediction model;
[0031] Step S403, using the training set based on the full band as the model input and the remaining shelf life as the output training model;
[0032] Step S404, using the root mean square error (RMSE) and the coefficient of determination R2 The value is used as an indicator to evaluate the performance of the model. 2 The closer the value is to 1 and the smaller the root mean square error is, the better the prediction performance of the model is.
[0033] Another aspect of the present invention provides a salmon shelf life prediction system based on hyperspectral imaging, comprising a storage module, a collection module, a preprocessing module, a model building module, and a prediction module, wherein:
[0034] Storage module, used to store fresh salmon fillets in constant temperature boxes at -2℃, 0℃, 2℃, 5℃, 10℃, and 18℃;
[0035] The acquisition module collects hyperspectral data of salmon fillets under different storage temperature conditions every day and determines their TVB-N value and total bacterial count;
[0036] A preprocessing module, used to correct and preprocess the acquired hyperspectral data;
[0037] A model building module, which is used to build a prediction model between hyperspectral data and salmon shelf life through machine learning algorithms;
[0038] The prediction module is used to input the hyperspectral data and storage temperature of the salmon to be tested, and calculate its remaining shelf life through the prediction model.
[0039] Compared with the prior art, the present system and method have the following advantages:
[0040] The present invention proposes a method for predicting the shelf life of salmon based on hyperspectral imaging technology. The method obtains characteristic data by non-invasively scanning the sample to be tested, and the shelf life can be predicted quickly and accurately without any destructive pre-treatment. Compared with traditional chemical experimental analysis and other methods, it has the advantages of fast detection, simple operation, and non-destructiveness. This method is not affected by the size and shape of the sample. The system has a high degree of intelligence and can automatically analyze and display the results in real time. No special training is required, which effectively improves the efficiency of predicting the shelf life of salmon. It can be widely used in salmon processing, logistics, sales and other links to improve product quality control and reduce economic losses. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Flowchart of a salmon shelf life prediction method based on hyperspectral imaging.
[0042] Figure 2 This is the spectral reflectance diagram of salmon.
[0043] Figure 3 This is a graph showing the changes in total colony count at different storage temperatures for salmon.
[0044] Figure 4This is a graph showing the changes in TVB-N at different storage temperatures for salmon. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] like Figure 1 The flowchart of the method of the present invention is shown. The embodiment of the present invention provides a salmon shelf life prediction method based on hyperspectral imaging, and the specific steps are as follows:
[0047] Step S1, sample preparation
[0048] Purchase fresh salmon middle meat from different markets and e-commerce platforms in multiple batches. Cut the salmon into slices of about 5cm×5cm×0.4cm. Put the sliced salmon slices into pre-prepared sealed bags, making sure each piece of salmon is packaged separately to avoid cross contamination.
[0049] Step S2, collecting hyperspectral data of salmon fillets under different storage temperature conditions every day, and determining the TVB-N value and total bacterial count.
[0050] Prepare six incubators, set at -2°C, 0°C, 2°C, 5°C, 10°C, and 18°C. Randomly distribute the sealed bags containing salmon to different incubators to ensure that the number of salmon in each incubator is the same.
[0051] Three salmon samples were randomly taken from each incubator every day. The excess water on the surface of the fish samples was absorbed with a paper towel. The samples were placed on the platform and hyperspectral data were collected using a hyperspectral imaging device. The effective working wavelength range of the hyperspectral imaging device was set to 400nm to 1000nm, and the spectral resolution was less than 5nm. Figure 2 Shown is the spectral reflectance graph of salmon.
[0052] TVB-N was determined using the automatic Kjeldahl nitrogen analyzer method, with reference to GB5009.228-2016 "National Food Safety Standard - Determination of Volatile Basic Nitrogen in Foods". The total colony count was determined according to the method specified in GB4789.2-2016 "National Food Safety Standard - Determination of Total Colony Count in Food Microbiological Examination".
[0053] like Figure 3 , Figure 4The chart shows the change of total colony count at different storage temperatures of salmon, and the change of TVB-N at different storage temperatures. The day the salmon was purchased is recorded as day 0, and so on. When the TVB-N value on the nth day is greater than 30mg / 100g or the total colony count exceeds 6lg CFU / g, its shelf life ends, and n is the actual remaining shelf life of the salmon at this temperature.
[0054] Step S3, correcting and preprocessing the acquired hyperspectral data.
[0055] In order to eliminate the influence of equipment errors and ambient light, the original hyperspectral data needs to be corrected by black and white plates. The correction formula is as follows:
[0056]
[0057] Where: I is the corrected hyperspectral imaging data, W is the whiteboard data, B is the blackboard data, and I0 is the original hyperspectral imaging data.
[0058] A binary mask is set in the hyperspectral image to select the region of interest and distinguish the fish area from the background area.
[0059] The spectral preprocessing method uses multivariate scattering correction to eliminate spectral changes caused by scattering effects. The calculation steps are as follows:
[0060] Step S301, calculate the average value of all sample spectral data, the formula is as follows:
[0061]
[0062] Step S302, perform linear regression analysis on the spectrum of each sample and the average spectrum, the formula is as follows:
[0063]
[0064] Step S303, subtract the regression intercept from each sample spectrum and divide it by the regression slope, the formula is as follows.
[0065]
[0066] In the above formula, A is the calibration set spectral matrix, A i represents the spectrum of the i-th sample, n is the sample size, α is the slope, and β is the intercept.
[0067] Step S4, establishing a prediction model between hyperspectral data and salmon shelf life through a machine learning algorithm. Specifically, the following steps are included:
[0068] Step S401, divide the data set into a training set and a test set in a ratio of 4:1. The training set is used for model training, and the test set is used for model verification.
[0069] Step S402: Use LS-SVM and select RBF kernel function to establish a prediction model.
[0070] Step S403, training the LS-SVM model using the training set based on the full band as the model input and the remaining shelf life as the output.
[0071] Step S404, using RMSE and determination coefficient R 2 The value is used as an indicator to evaluate the performance of the model. 2 The closer the value is to 1 and the smaller the RMSE is, the better the prediction performance of the model is.
[0072] Step S5, predicting the shelf life of salmon based on the prediction model.
[0073] The hyperspectral image of the salmon to be tested is collected, and data correction and preprocessing are performed according to step S3. The obtained data is input into the prediction model established in step S4 to obtain the remaining shelf life of the sample to be tested.
[0074] Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A salmon shelf life prediction method based on hyperspectral imaging, characterized in that: The following steps are involved: Step S1, storing fresh salmon fillets in thermostats at -2°C, 0°C, 2°C, 5°C, 10°C, and 18°C respectively; Step S2, collecting hyperspectral data of salmon fillets under different storage temperature conditions every day, and determining the TVB-N value and total bacterial count; Step S3, correcting and preprocessing the acquired hyperspectral data; Step S4, establishing a prediction model between hyperspectral data and salmon shelf life through a machine learning algorithm; Step S5, input the hyperspectral data and storage temperature of the salmon to be tested, and calculate its remaining shelf life through the prediction model.
2. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: The effective working wavelength range of the hyperspectral imaging device used in step S2 is 400nm to 1000nm, and the spectral resolution is less than 5nm.
3. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: The methods for determining the TVB-N value of salmon in step S2 include semi-micro nitrogen determination method, automatic Kjeldahl nitrogen determination method and micro-diffusion method.
4. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: The day of step S1 is recorded as day 0. When the TVB-N value on day n is greater than 30 mg / 100 g or the total colony count exceeds 6 lg CFU / g, n is recorded as the actual remaining shelf life of the salmon at that temperature.
5. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: In step S3, the hyperspectral data is corrected with a black and white plate, and then a mask is set on the hyperspectral data to distinguish the fish area from the background area; the black and white plate correction formula is as follows: Where: I is the corrected hyperspectral imaging data, W is the whiteboard data, B is the blackboard data, and I0 is the original hyperspectral imaging data.
6. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: The hyperspectral data preprocessing method in step S3 includes multivariate scattering correction, smoothing, first-order and second-order derivatives, normalization, wavelet transform and Fourier transform.
7. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 6, characterized in that: The multivariate scatter correction is used to eliminate the spectrum changes caused by the scattering effect, and the calculation step includes the following steps: Step S301, calculate the average value of all sample spectral data, the calculation formula is as follows: Step S302: perform linear regression analysis on the spectrum of each sample and the average spectrum. The calculation formula is as follows: Step S303, subtract the regression intercept from each sample spectrum and divide it by the regression slope. The calculation formula is as follows: Where A is the calibration set spectral matrix, A i represents the spectrum of the i-th sample, n is the sample size, α is the slope, and β is the intercept.
8. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 1, characterized in that: The machine learning algorithms used in step S4 include multiple linear regression, principal component analysis, partial least squares regression, support vector machine, random forest, and deep neural network.
9. The method for predicting salmon shelf life based on hyperspectral imaging according to claim 8, characterized in that: The method for model training using the least squares support vector machine comprises the following steps: Step S401, divide the data into a training set and a test set in a ratio of 4:1, the training set is used for model training, and the test set is used for model verification; Step S402, using the least squares support vector machine and selecting the Gaussian radial basis kernel function to establish a prediction model; Step S403, using the training set based on the full band as the model input and the remaining shelf life as the output training model; Step S404, using the root mean square error and the coefficient of determination R 2 The value is used as an indicator to evaluate the performance of the model. 2 The closer the value is to 1 and the smaller the root mean square error is, the better the prediction performance of the model is.
10. A salmon shelf life prediction system based on hyperspectral imaging, characterized in that: It includes a storage module, a collection module, a preprocessing module, a model building module, and a prediction module, wherein: Storage module, used to store fresh salmon fillets in constant temperature boxes at -2℃, 0℃, 2℃, 5℃, 10℃, and 18℃; The acquisition module collects hyperspectral data of salmon fillets under different storage temperature conditions every day and determines their TVB-N value and total bacterial count; A preprocessing module, used to correct and preprocess the acquired hyperspectral data; A model building module, which is used to build a prediction model between hyperspectral data and salmon shelf life through machine learning algorithms; The prediction module is used to input the hyperspectral data and storage temperature of the salmon to be tested, and calculate its remaining shelf life through the prediction model.