Fish fillet freshness prediction method, prediction model training method and computer device
By fusing infrared spectral data with sensory evaluation data, a fish fillet freshness prediction model is constructed, which solves the problem of insufficient destructive, complex and accurate freshness detection of fish products in the prior art, and achieves a fast, lossless and accurate detection effect.
Patent Information
- Application Number
- CN202411586894.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art has problems of destructiveness, complexity and accuracy in the detection of freshness of fish products, especially in the detection of incomplete fish products.
The freshness prediction method of fish fillet based on infrared and sensory data fusion is adopted. By obtaining infrared spectral data and sensory data, data preprocessing and feature screening are carried out, feature fusion vectors are fused, and the trained fillet freshness prediction model is input for prediction.
It realizes fast, lossless and accurate fish fillet freshness detection, makes up for the defect of low accuracy of handheld infrared spectrometers, meets the accuracy requirements of on-site sampling, and provides comprehensive detection information.
Smart Images

Figure CN119540168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of quality detection of aquatic products in the food safety industry, biometric recognition software in the artificial intelligence industry, and in particular to a method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data, a prediction model training method, and a computer device. Background Art
[0002] In the food industry, ensuring food freshness and safety is a critical challenge. Especially in the detection of fish products, existing technical methods have their own limitations. Traditional prediction methods, such as chemical analysis and microbiological testing, usually require sample destruction, are complex and time-consuming to operate, and are difficult to provide real-time results. Although sensory evaluation can directly reflect the sensory characteristics of fish fillets, its accuracy is limited due to the imperfect evaluation system and the difficulty in accurately identifying changes. Therefore, there is a growing demand for fast and non-destructive detection technologies in the market.
[0003] As consumers pay more and more attention to food safety and freshness, the market urgently needs a fast, convenient and non-destructive testing technology, especially a prediction method that can reflect sensory changes. However, current prediction methods, such as chemical analysis and microbial testing, are mostly laboratory analyses, which are difficult to apply to rapid on-site testing in the supply chain. In addition, although existing infrared spectroscopy technology can provide information at the molecular and chemical bond levels, it has problems such as high data dimensionality, strong collinearity and information redundancy, resulting in a single technology that cannot fully capture changes in food freshness. Although sensory evaluation is closely related to consumers' real feelings, its evaluation system is not perfect, and it is difficult to accurately identify subtle changes in food storage, which affects its prediction accuracy. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] The present invention is expected to at least partially solve one of the above technical problems.
[0006] 2. Technical Solution
[0007] The first aspect of the present invention provides a method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data. The method for predicting the freshness of fish fillets comprises:
[0008] Step A, obtaining infrared spectrum data of measured fish fillets;
[0009] Step B, obtaining sensory data of the measured fish fillet;
[0010] Step C, performing data preprocessing and feature screening on the infrared spectrum data to obtain an infrared spectrum feature vector;
[0011] Step D, performing data preprocessing and feature screening on the sensory data to obtain a sensory feature vector;
[0012] Step E, fusing the infrared spectrum feature vector and the sensory feature vector to obtain a feature fusion vector;
[0013] Step F: input the feature fusion vector into the trained fish fillet freshness prediction model to obtain the freshness prediction data of the measured fish fillet.
[0014] A second aspect of the present invention provides a method for training a prediction model for the freshness of fish fillets. The prediction model training method comprises:
[0015] Step S10, obtaining a training sample set, including:
[0016] Sub-step 11, for each of the N training fish fillets: step A', obtaining infrared spectrum data of the training fish fillet; step B', obtaining sensory data of the training fish fillet; step C', performing data preprocessing on the infrared spectrum data to obtain an infrared spectrum vector; step D', performing data preprocessing on the sensory data to obtain a sensory feature vector;
[0017] Sub-step 12, the training samples of N training fish fillets constitute a training sample set;
[0018] The sub-step specifically includes: merging the infrared spectrum vectors of N training fish fillets into an infrared matrix, performing feature screening in the infrared matrix to obtain an infrared matrix after feature screening; forming a sensory matrix with sensory feature vectors of N training fish fillets, performing feature screening in the sensory matrix to obtain a sensory matrix after feature screening; merging the infrared matrix after feature screening and the sensory matrix to obtain a training sample set;
[0019] Step S20, constructing a fish fillet freshness prediction model;
[0020] Step S30, using the training samples in the training sample set to train the fish fillet freshness prediction model, obtain the freshness data prediction value of the training fish fillet, and comprehensively evaluate the fish fillet freshness prediction model through MSE, RMSE and R square to optimize the model performance.
[0021] A third aspect of the present invention provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: the above fish fillet freshness detection method; or the above fish fillet freshness prediction model training method.
[0022] The fourth aspect of the present invention provides a computer device, comprising: a memory; a processor; and a computer program stored in the memory; wherein the processor executes the computer program to implement: the above fish fillet freshness prediction method; or, the above fish fillet freshness prediction model training method.
[0023] 3. Beneficial Effects
[0024] It can be seen from the above technical solution that the present invention has at least one of the following beneficial effects compared with the prior art:
[0025] 1. Data fusion of infrared and sensory parts
[0026] Infrared advantages and limitations: Infrared spectroscopy can quickly and non-destructively extract information at the molecular level, has a strong ability to extract information, and objectively reflects the physical state of the sample. However, most of the current patents and existing literature use large infrared instruments, which are not portable. The data stability and resolution of existing portable handheld infrared instruments are limited, which limits their application in detection. At the same time, due to the high collinearity of infrared spectral data, the applicability of traditional statistical analysis is limited.
[0027] Sensory advantages and limitations: Due to the limited and subjective perception of texture and details by the human eye, sensory evaluation still has room for improvement. This limitation is improved through data fusion.
[0028] The present invention demonstrates the strong complementarity of information through the fusion of infrared and sensory evaluation, covering multi-dimensional information such as macro and micro, subjective feelings and objective evaluation, and significantly enhancing the robustness and overall performance of the model. This multi-dimensional fusion of information is a significant advantage of the present invention.
[0029] 2. Use a handheld infrared spectrometer
[0030] However, this type of technology uses a large infrared spectrometer, which is not portable and difficult to meet the needs of on-site testing. Although handheld infrared spectrometers are portable, they have low sensitivity, low spectral resolution, high signal-to-noise ratio, and are easily disturbed by external factors (such as temperature, shaking when holding, etc.), making it difficult to support freshness prediction needs.
[0031] The present invention adopts a handheld infrared spectrometer and innovatively introduces the sensory dimension, which greatly makes up for the limitations of handheld devices and provides additional auxiliary information. Even if the infrared data is fuzzy, it can still ensure a high accuracy rate. At the same time, the present invention also effectively avoids the sensory evaluation deviation caused by the subjective factors of the evaluator, and meets the needs of fast, robust and non-destructive testing.
[0032] 3. Improvement of sensory index adaptability:
[0033] Traditional sensory evaluation methods for seafood (such as the EU quality index method) are based on the characteristics of intact fish such as fish eyes, gills, and the degree of skin wrinkling. However, this evaluation is not fully applicable to incomplete fish such as fish fillets.
[0034] In traditional fish freshness testing, indicators related to whole fish morphology such as fish eye depression and gill color are used, which cannot meet the testing needs of non-complete fish products such as sashimi and fish fillets that are prevalent in the market.
[0035] The present invention has created and verified a set of sensory evaluation guidelines for the freshness of incomplete fish products, including 10 dimensions: smell, fish skin gloss, mucus layer appearance, muscle boundary, red muscle color, red muscle edge, white muscle color, muscle transparency, cracks, and hardness. This evaluation system fills the gap in the evaluation criteria for incomplete fish products. Due to the limitations and subjectivity of the human eye's perception of texture and details, the sensory evaluation method still has room for improvement. This limitation has been improved through the fusion with infrared data.
[0036] 4. Data fusion and normalization
[0037] Chemical and microbiological analysis usually requires sample destruction and is complex, while spectral analysis, although rich in information, has data redundancy and collinearity issues that affect accuracy. Sensory evaluation is highly subjective and the system may be imperfect.
[0038] The present invention uses multimodal data fusion to improve the accuracy and robustness of detection, realizes efficient and non-destructive food freshness detection, makes up for the low accuracy of handheld infrared spectrometers, and meets the accuracy requirements of on-site sampling. At the same time, the present invention integrates the molecular level information of infrared spectroscopy and the actual experience of sensory evaluation, optimizes the model performance, and meets the needs of rapid detection.
[0039] 5. Use random forest model for prediction
[0040] In the present invention, a random forest model is used to improve the prediction accuracy by constructing multiple decision trees and averaging or voting their results. The model increases the diversity and robustness of the model through self-service sampling and random feature selection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 The present invention is a flowchart of a method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data according to an embodiment of the present invention.
[0042] Figure 2 for Figure 1 The research roadmap of fish fillet freshness prediction methods is shown.
[0043] Figure 3 for Figure 1The scoring criteria for the two indicators of overall perception and supplementary description in odor evaluation in the fish fillet freshness prediction method are shown.
[0044] Figure 4 for Figure 1 The scoring criteria for gloss and mucus in fish skin evaluation in the fish fillet freshness prediction method shown in the figure.
[0045] Figure 5 for Figure 1 The following are the scoring criteria and examples for the three indicators of red muscle color, white muscle color, boundary and crack in the muscle appearance evaluation in the fish fillet freshness prediction method.
[0046] Figure 6 for Figure 1 The evaluation criteria for the two indicators of white meat viscosity and hardness in the muscle touch evaluation in the fish fillet freshness prediction method shown in the figure.
[0047] Figure 7 for Figure 1 A chart showing the influence of each feature obtained using XGBoost on the final result in the fish fillet freshness prediction method.
[0048] Figure 8 To adopt Figure 1 Fitting plot of the MLDF data random forest regression model test set for the fish fillet freshness prediction method shown.
[0049] Fig. 9 A schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
[0050] Fig.10 FIG. 4 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The present invention overcomes the destructiveness and complexity of existing methods by fusing infrared spectroscopy data with sensory evaluation data, and achieves rapid and non-destructive detection. By effectively fusing multimodal data, it not only improves the accuracy and robustness of the prediction model, but also provides comprehensive detection information, thus meeting the needs of efficient and accurate detection of food freshness.
[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and with reference to the accompanying drawings.
[0053] The first aspect of the present invention provides a method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data. This embodiment uses grass carp as the research object to develop a rapid non-destructive detection technology, combines chemometrics and feature engineering, fuses ATR-FTIR (400-4000nm) data with sensory data, and performs random forest machine learning regression modeling on the fused data, thereby obtaining a more accurate storage time prediction value analysis model.
[0054] Figure 1 The present invention is a flowchart of a method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data according to an embodiment of the present invention. Figure 2 for Figure 1 The research roadmap of fish fillet freshness prediction method is shown in Figure 2. Figure 1 and Figure 2 As shown, the fish fillet freshness prediction method based on infrared and sensory data fusion in this embodiment includes:
[0055] Step A, obtaining infrared spectrum data of measured fish fillets;
[0056] Step B, obtaining sensory data of the measured fish fillet;
[0057] Step C, performing data preprocessing and feature screening on the infrared spectrum data to obtain an infrared spectrum feature vector;
[0058] Step D, performing data preprocessing and feature screening on the sensory data to obtain a sensory feature vector;
[0059] Step E, fusing the infrared spectrum feature vector and the sensory feature vector to obtain a feature fusion vector;
[0060] Step F: input the feature fusion vector into the trained fish fillet freshness prediction model to obtain the freshness prediction data of the measured fish fillet.
[0061] In this embodiment, the fusion of infrared and sensory evaluation demonstrates the strong complementarity of information, covering multi-dimensional information such as macro and micro, subjective feelings and objective evaluation, and significantly enhancing the robustness and overall performance of the model. This multi-dimensional fusion of information is a significant advantage of the present invention.
[0062] The following is a detailed description of each step of this embodiment.
[0063] In step A of this embodiment, there are two methods for obtaining the infrared spectrum data of the measured fish fillet:
[0064] Method 1: (1) Clean the sample to remove dirt and moisture from the surface of the fish fillet; (2) Turn on the spectrometer and measure in reflectance mode; (3) Calibrate the instrument for background subtraction; (4) Align the sample for measurement
[0065] Method 2: (1) freeze-drying fish fillets using a freeze dryer; (2) measuring freeze-dried fish fillets using ATR-FTIR;
[0066] It should be noted that this embodiment uses a handheld infrared spectrometer to obtain raw infrared spectrum data, which is ATR-FTIR with a wavelength range of 400 to 4000 nm.
[0067] In the large-scale rapid meat detection of the prior art, a relatively large infrared spectrometer is used. These instruments are difficult to apply to on-site sampling, rapid detection and patrol inspections. The present invention improves the accuracy of handheld infrared devices through data fusion, making the present invention applicable to on-site sampling, rapid detection and patrol inspections. At the same time, the present invention utilizes multimodal data fusion to improve the accuracy and robustness of detection, realizes efficient and non-destructive food freshness detection, makes up for the defect of low accuracy of handheld infrared spectrometers, and meets the accuracy requirements of on-site sampling.
[0068] In step B of this embodiment, the sensory data of the measured fish fillet is obtained. The sensory data is input by the on-site inspection personnel and is expressed as various sensory indicators of the measured fish fillet. The sensory data includes: odor evaluation, fish skin evaluation, muscle appearance evaluation, and muscle touch evaluation indicators.
[0069] In this embodiment, the odor evaluation includes: odor scoring, wherein: the odor scoring scores the odor of the back of the fish fillet in at least two levels according to the degree of odor preference. The odor evaluation in this embodiment is divided into two dimensions: overall perception and supplementary description. Figure 3 for Figure 1 The scoring criteria for the two indicators of overall perception and supplementary description in the odor evaluation in the fish fillet freshness prediction method are shown in FIG. Figure 3 As shown,
[0070] 1. Overall Perception of Odor
[0071] In the overall odor perception index, odor scores were rated on the following 4 levels: pleasant; neither unpleasant nor pleasant; unpleasant; extremely unpleasant.
[0072] 2. Odor Supplement Description
[0073] In the odor supplementary descriptive index, odor scores are scored on the following 4 levels: light fishy odor, rusty odor, muddy odor, and ammonia odor.
[0074] In this embodiment, the fish skin evaluation includes: fish skin glossiness score and fish skin mucus score. Figure 4 for Figure 1 The scoring criteria for the two indicators of gloss and mucus in the fish skin evaluation in the fish fillet freshness prediction method shown in FIG. Figure 4As shown in the figure, the glossiness score is: the fish skin glossiness is scored in at least 2 levels; the fish skin mucus index is: the fish skin mucus is scored in at least 2 levels. Figure 3 As shown, the fish skin sensory evaluation indicators in this embodiment include:
[0075] 1. Fish skin glossiness
[0076] The fish skin gloss index is scored on the following 3 levels: shiny; relatively shiny; dull.
[0077] 2. Fish skin mucus
[0078] The fish skin mucus index is scored in the following 3 levels: thin and transparent; later opaque; sticky and clumpy.
[0079] In this embodiment, the muscle appearance evaluation includes: red muscle color score, white muscle color score, muscle boundary score, and muscle fissure score. Figure 5 for Figure 1 The scoring criteria and examples of the three indicators of red muscle color, white muscle color, boundary and crack in the muscle appearance evaluation of fish fillet freshness prediction method are shown in FIG. Figure 5 As shown, the muscle touch sensory evaluation index of this embodiment includes:
[0080] 1. Red muscle color
[0081] The red muscle color index is scored on the following 4 levels: pink or bright red; dark red; brown or dark; dark brown;
[0082] 2. White skin color
[0083] The white skin color index is scored in the following 4 levels: white / flesh pink and uniform; flesh color is slightly orange and the color is relatively uniform; dark and has spots; yellow-green at the edges;
[0084] 3. Muscle Boundary
[0085] Muscle boundary indicators were scored on the following 3 levels: clear boundary; blurred boundary; lost boundary;
[0086] 4. Muscle Fissure
[0087] The muscle fissure index was scored in 3 levels: no fissure except the middle fissure; <25% of the total fillet area had fissures; 25-75% of the fillet area had fissures; and more than 75% of the fillet area had fissures.
[0088] In this embodiment, the sensory evaluation index of muscle appearance includes: white meat viscosity index and muscle hardness index. Figure 6 for Figure 1 The evaluation criteria of white meat viscosity and hardness in the muscle touch evaluation of fish fillet freshness prediction method are shown in FIG. Figure 6 As shown, the muscle touch sensory evaluation index of this embodiment includes:
[0089] 1. White meat viscosity index
[0090] The stickiness index of white meat is scored in the following 4 levels: the meat surface feels sandy; no sand; sticky; very sticky;
[0091] 2. Muscle hardness index
[0092] The muscle hardness index is scored on 3 levels: quick recovery after pressing; slow recovery after pressing; no recovery after pressing.
[0093] It should be noted that this embodiment uses XGBoost for feature extraction and selects 8 key features for freshness evaluation, which reduces the amount of data and improves the prediction speed and accuracy.
[0094] Specifically, in this embodiment, XGBoost is used for feature extraction. XGBoost is a powerful ensemble learning algorithm that optimizes the model by building multiple decision trees and using the gradient boosting method. It can evaluate the contribution of each feature to the model and extract the most predictive features from it.
[0095] Figure 7 for Figure 1 The chart shows the influence of each feature obtained by XGBoost on the final result in the fish fillet freshness prediction method. Figure 7 As shown, in this embodiment, among the various indicators introduced above, 8 key features are selected by XGBoost, such as fish skin brightness, fish meat texture, red muscle color, etc. These features are of great importance in the model and have a significant impact on the prediction results, so they are selected to predict the freshness of the tested fish fillets in practical applications.
[0096] It can be seen from the above description that the present invention has created and verified a set of sensory evaluation guidelines for the freshness of incomplete fish products, including 10 dimensions: smell, fish skin gloss, mucus layer appearance, muscle boundary, red muscle color, red muscle edge, white muscle color, muscle transparency, cracks, and hardness. This evaluation system fills the gap in the evaluation standards for incomplete fish products: traditional seafood sensory evaluation methods (EU quality index method, etc., described in detail in the technical briefing book) are based on the characteristics of complete fish such as fish eyes, fish gills, and the degree of shrinkage of fish skin, but this evaluation is not completely applicable to incomplete fish such as fish fillets. Although this method can express information more comprehensively, due to the limitations and subjectivity of the human eye's perception of texture and details, the sensory evaluation method still has room for improvement. This limitation has been improved through data fusion.
[0097] In this embodiment, in the spectral data preprocessing, the data is smoothed to reduce noise and fluctuations and improve the interpretability of the data. In order to remove background noise and baseline drift, background subtraction and local smoothing methods are used, which helps to eliminate interference signals and improve the quality of spectral data.
[0098] In addition, other preprocessing is required for infrared spectral data and sensory data, mainly interpolation filling and normalization processing, to ensure the consistency and dimensionality of the data. Interpolation filling fills in the missing values in the data so that data from different sources can be effectively compared. This is mainly because the data collectors in the original sensory data are difficult to judge or miss the data. Normalization processing standardizes the numerical range of the data to make it on the same order of magnitude, which helps the machine learning algorithm to better process the data.
[0099] Specifically, the process of performing data preprocessing and feature screening on infrared spectrum data in step C includes:
[0100] Sub-step C1, using Matlab moving average method to perform data smoothing on the original infrared spectrum data, with a window size of 2;
[0101] Sub-step C2, eliminating interference from the infrared spectrum data after data smoothing by background subtraction method;
[0102] Sub-step C3, mapping the infrared spectrum data after eliminating interference to between [0,1];
[0103] Normalization standardizes the numerical range of the data to make it on the same order of magnitude, which helps machine learning algorithms to better process the data. The normalization of infrared spectral data refers to normalizing the spectral intensity corresponding to each wavelength to between [0,1].
[0104] Sub-step C4, screening out infrared spectrum data corresponding to 82 characteristic infrared wavelengths, and obtaining a 1×82 infrared spectrum feature vector.
[0105] Those skilled in the art should understand that for data smoothing, interference elimination, etc., other methods commonly used in the art may be adopted, and are not limited to the specific methods mentioned in the above embodiments, which will not be described in detail here.
[0106] Specifically, the process of performing data preprocessing and feature screening on sensory data in step D includes:
[0107] Sub-step D1, filling in missing indicators in the original sensory data;
[0108] In this sub-step, the data collection personnel in the original sensory data are mainly filled in because the data is difficult to judge or missing. In this embodiment, the missing indicators are filled in with median filling.
[0109] Sub-step D2, using Matlab to normalize each index of the original sensory data to between [0,1];
[0110] Normalization standardizes the numerical range of the data to make it on the same scale, which helps machine learning algorithms process the data better. The normalization of raw sensory data refers to digitizing each indicator and normalizing it to between [0,1].
[0111] Sub-step D3, combining the scores of various sensory indicators to obtain a 1×8 sensory feature vector.
[0112] Those skilled in the art should understand that, although in this embodiment, infrared spectrum data corresponding to 82 characteristic infrared wavelengths are selected to form a 1×82 infrared spectrum feature vector; 8 sensory features are selected to form a 1×8 sensory feature vector, the present invention is not limited thereto. In other embodiments of the present invention, the number of features and the type of features can be reasonably set according to factors such as the processing power of the processor and the rationality of the sensory index. These variations can also implement the present invention and are also within the scope of protection of the present invention.
[0113] In this embodiment, step E includes: fusing the infrared spectrum feature matrix and the sensory feature matrix by using a mid-level data fusion method, and fusing the infrared spectrum feature vector and the sensory feature vector into a 1×90 feature fusion matrix.
[0114] Table 1 Figure 1 Parameter values of each parameter of the random forest prediction model in the fish fillet freshness prediction method shown
[0115]
[0116] In the data fusion stage, the present invention adopts low-level data fusion (LLDF), middle-level data fusion (MLDF) and high-level data fusion (HLDF). Low-level fusion ensures the compatibility of different data sources by merging infrared data and sensory data matrices and performing normalization. Middle-level fusion further streamlines the data set, reduces redundant information, and improves the processing efficiency of the model by screening important infrared features and merging them with sensory data. In this embodiment, the best MLDF is selected.
[0117] In this embodiment, in step E, the fish fillet freshness prediction model is a random forest prediction model. It should be noted that the applicant selected the random forest regression model that is most suitable for this data type for modeling after trying multiple models. Random forest is an ensemble learning method that improves prediction accuracy by building multiple decision trees and averaging or voting their results. The model increases the diversity and robustness of the model through self-service sampling and random feature selection.
[0118] Table 1 Figure 1 Parameter values of various parameters of the random forest prediction model in the fish fillet freshness prediction method shown in Table 1. As shown in Table 1, in the random forest prediction model of this embodiment, the cross validation is 3-fold; the number of decision trees is 100; the node splitting evaluation criterion is MSE, and the minimum number of leaf node samples is 1.
[0119] Table 2 shows the Figure 1 The value table of each parameter in the MLDF random forest regression modeling in the fish fillet freshness prediction method is shown in Table 2. As shown in Table 2, this embodiment optimizes the model performance through cross-validation and model evaluation indicators (such as mean square error, root mean square error, mean absolute error, etc.), and displays the model prediction effect and the importance of features through visual results. This series of steps ensures the comprehensiveness of data preprocessing and the efficiency of modeling.
[0120] Table 2 MLDF random forest regression modeling
[0121]
[0122] Figure 8 To adopt Figure 1 The MLDF data random forest regression model test set fitting diagram of the fish fillet freshness prediction method shown in the figure. Figure 8 As shown, the prediction accuracy of this embodiment is relatively high, reaching an accuracy of R2=0.946, which is better than the evaluation results of using infrared data alone and sensory data alone.
[0123] A second aspect of the present invention provides a method for training a fish fillet freshness prediction model. The method for training a fish fillet freshness prediction model according to an embodiment of the present invention comprises:
[0124] Step S10, obtaining a training sample set, including:
[0125] Sub-step 11, for each of the N training fish fillets:
[0126] Sub-step 12, the training samples of N training fish fillets constitute a training sample set;
[0127] Step S20, constructing a fish fillet freshness prediction model;
[0128] Step S30, train the fish fillet freshness prediction model using the training sample set to obtain the predicted value of the freshness data of the measured fish fillet, comprehensively evaluate the fish fillet freshness prediction model through MSE, RMSE and R square, and optimize the model performance. The values of each parameter are shown in Table 2.
[0129] Regarding infrared spectrum data, original sensory data, fish fillet freshness prediction model, model evaluation index, etc., reference can be made to the relevant description of the previous embodiments. Only the special aspects of the training process are described here.
[0130] In this embodiment, sub-step 11 specifically includes: step A', obtaining infrared spectrum data of training fish fillets; step B', obtaining original sensory data of training fish fillets; step C', performing data preprocessing on the infrared spectrum data to obtain an infrared spectrum vector; step D', performing data preprocessing on the sensory data to obtain a sensory feature vector.
[0131] It should be noted that before step D', the method also includes: obtaining T sensory data indicators of N training fish fillets, T>8; using XGBoost to perform feature screening to screen out the 8 most predictive key sensory data indicators, and in step D', performing data preprocessing on the 8 key sensory data indicators, and the 8 key sensory data indicators include: odor score, fish skin gloss score, fish skin mucus score, red muscle color score, muscle boundary score, muscle fissure score, white meat viscosity score, and muscle hardness score.
[0132] In this embodiment, sub-step 12 specifically includes: merging the infrared spectral vectors of N training fish fillets into an infrared matrix, performing feature screening in the infrared matrix, and obtaining an infrared matrix after feature screening; the sensory feature vectors of N training fish fillets form a sensory matrix, performing feature screening in the sensory matrix, and obtaining a sensory matrix after feature screening; merging the infrared matrix after feature screening and the sensory matrix to obtain a training sample set.
[0133] In this embodiment, in step S20, the fish fillet freshness prediction model is a random forest prediction model, and the cross validation of the random forest prediction model is 3 folds; the number of decision trees is 100; the node splitting evaluation criterion is MSE, and the minimum number of leaf node samples is 1;
[0134] A third aspect of the present invention provides a computer-readable storage medium. Fig. 9 Schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Fig. 9 As shown, a computer program is stored on the computer-readable storage medium of this embodiment, and when the computer program is executed by the processor, it implements: the above fish fillet freshness prediction method; or the above fish fillet freshness prediction model training method.
[0135] A fourth aspect of the present invention provides a computer device. Fig.10 Schematic diagram of a computer device according to an embodiment of the present invention. Fig.10 As shown, the computer device of this embodiment includes: a memory; a processor; and a computer program stored in the memory; wherein the processor executes the computer program to implement: the above fish fillet freshness prediction method; or the above fish fillet freshness prediction model training method.
[0136] At this point, the various embodiments of the present invention have been introduced. According to the above description, those skilled in the art should have a clear understanding of the present invention.
[0137] It should be noted that the core content of the present invention is the data model framework mentioned above: infrared spectrum data and sensory data are fused to predict freshness. The use of handheld infrared or other types of infrared instruments, the use of Quality index method or other achievable technologies are all within the scope of protection of the present invention. If only the data fusion method and machine learning model are replaced, it is also within the scope of protection of the present invention.
[0138] In addition, for certain implementations, if they are not the key content of the present invention and are well known to ordinary technicians in the relevant technical field, they are not described in detail in the drawings or text of the specification due to space limitations. In this case, reference can be made to relevant existing technologies for understanding.
[0139] It is to be understood that, unless specifically described or required to occur in sequence, the order of the above steps is not limited to that listed above and may be changed or rearranged according to desired designs.
[0140] The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0141] The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. The physical implementation of the hardware structure includes but is not limited to physical devices, which include but are not limited to transistors, memristors, DNA computers, single-chip microcomputers, microprocessors or digital signal processors (DSPs). In addition, the present invention is not directed to any specific programming language. It should be understood that the content of the present invention can be implemented using various programming languages, and the description of specific languages herein is to disclose the best implementation of the present invention.
[0142] Similarly, it should be understood that in order to simplify the present invention, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the claims, each inventive aspect lies in less than all the features of the previous single embodiment. Moreover, the embodiments can be mixed and matched with each other or with other embodiments based on design and reliability considerations, that is, the technical features in different embodiments can be freely combined to form more embodiments. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.
[0143] The above specific embodiments provide a detailed description of the objectives, technical means and beneficial effects of the present invention. It should be understood that the purpose of the detailed description is to enable those skilled in the art to understand the present invention more clearly, and it is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting the freshness of fish fillets based on the fusion of infrared and sensory data, characterized in that: include: Step A, obtaining infrared spectrum data of measured fish fillets; Step B, obtaining sensory data of the measured fish fillet; Step C, performing data preprocessing and feature screening on the infrared spectrum data to obtain an infrared spectrum feature vector; Step D, performing data preprocessing and feature screening on the sensory data to obtain a sensory feature vector; Step E, fusing the infrared spectrum feature vector and the sensory feature vector to obtain a feature fusion vector; Step F: input the feature fusion vector into the trained fish fillet freshness prediction model to obtain the freshness prediction data of the measured fish fillet.
2. The method for predicting the freshness of fish fillets according to claim 1, characterized in that: In the step A, The infrared spectrum data is obtained by a handheld infrared device; And / or, the infrared spectrum data is: ATR-FTIR; the wavelength range is: 400~4000nm.
3. The method for predicting the freshness of fish fillets according to claim 1, characterized in that: In step B, the sensory data is obtained by receiving input from on-site testing personnel, which is expressed as the scores of various sensory indicators of the fish fillets measured, wherein the sensory data includes: ① Odor evaluation, including: Odor scoring, including: Odor scoring was as follows: the odor on the back of the fillet was scored on at least 2 levels according to the odor preference or dislike; ②Fish skin evaluation, including: fish fillet gloss score, fish skin mucus score, including: Fish skin glossiness was scored as follows: the fish skin glossiness was scored on at least 2 levels; Fish skin mucus was scored as follows: fish skin mucus was scored on at least 2 levels; ③ Muscle appearance evaluation, including: red muscle color score, white muscle color score, muscle boundary score, muscle fissure score, among which: The white muscle color is scored as follows: the white muscle color of the front of the fillet is scored in at least 2 grades. Red muscle color is scored as follows: score the red muscle color on the front of the fillet on at least 2 levels; The muscle boundary was scored as follows: the clarity of the red and white muscle boundary was scored in at least 2 grades; Muscle fissures were scored as follows: muscle fissures were classified in at least 2 grades; ④ Muscle touch evaluation, including: white meat stickiness score, muscle hardness score; The white meat viscosity was scored as follows: The white meat viscosity was scored on at least 2 scales; Muscle firmness was scored by classifying the recovery of the muscle after compression into at least 2 levels.
4. The method for predicting the freshness of fish fillets according to claim 3, characterized in that: In the step B: The odor rating was rated on the following 4 scales: pleasant; neither unpleasant nor pleasant; unpleasant; extremely unpleasant; The fish skin glossiness score is scored in the following 3 levels: glossy; relatively glossy; dull; The fish skin mucus score was scored in the following 3 levels: thin and transparent; later opaque; sticky and clumpy; The red muscle color score is scored in the following 4 grades: pink or bright red; dark red; brown or dark; dark brown; The white muscle color score is scored in the following 4 levels: white / flesh pink and uniform; flesh color is slightly orange and the color is relatively uniform; dark with spots; yellow-green at the edges; The muscle boundary score is scored in the following 3 levels: clear boundary; blurred boundary; lost boundary; The muscle fissure score is scored in the following three levels: no fissure except the middle fissure; <25% of the total fillet area has fissures; 25-75% of the fillet area has fissures; more than 75% of the fillet area has fissures; The white meat stickiness score is scored in the following 4 levels: the meat surface feels sandy; no sand; relatively sticky; very sticky; The muscle hardness score is scored in the following 3 levels: quick recovery after pressing; slow recovery after pressing; no recovery after pressing.
5. The method for predicting the freshness of fish fillets according to claim 1, characterized in that: The step C comprises: Sub-step C1, performing data smoothing processing on the original infrared spectrum data; Sub-step C2, eliminating interference from the infrared spectrum data after data smoothing by background subtraction method; Sub-step C3, mapping the infrared spectrum data after eliminating interference to between [0,1]; Sub-step C4, filtering out infrared spectrum data corresponding to N1 characteristic infrared wavelengths from the full-wavelength infrared spectrum to obtain a 1×N1 infrared spectrum feature vector.
6. The method for predicting the freshness of fish fillets according to claim 5, characterized in that: The step D comprises: Sub-step D1, filling in the scores of missing indicators in the sensory data; Sub-step D2, normalizing the scores of each indicator in the sensory data to between [0, 1]; Sub-step D3, combining the scores of the various sensory indicators to obtain a 1×N2 sensory feature vector, where N2 is the number of sensory indicators in the sensory data.
7. The method for predicting the freshness of fish fillets according to claim 6, characterized in that: The step E comprises: fusing the infrared spectrum feature matrix and the sensory feature matrix by using a mid-level data fusion method, and fusing the infrared spectrum feature vector and the sensory feature vector into a feature fusion vector of 1×(N1+N2); And / or, in step F, the fish fillet freshness prediction model is a random forest prediction model; And / or, in the sub-step D1, the scores of missing indicators in the sensory data are filled using the median filling method.
8. A method for training a prediction model for fish fillet freshness, characterized in that: include: Step S10, obtaining a training sample set, including: Sub-step 11, for each of the N training fish fillets: step A', obtaining infrared spectrum data of the training fish fillet; step B', obtaining sensory data of the training fish fillet; step C', performing data preprocessing on the infrared spectrum data to obtain an infrared spectrum vector; step D', performing data preprocessing on the sensory data to obtain a sensory feature vector; Sub-step 12, the training samples of N training fish fillets constitute a training sample set; The sub-step specifically includes: merging the infrared spectrum vectors of N training fish fillets into an infrared matrix, performing feature screening in the infrared matrix to obtain an infrared matrix after feature screening; forming a sensory matrix with sensory feature vectors of N training fish fillets, performing feature screening in the sensory matrix to obtain a sensory matrix after feature screening; merging the infrared matrix after feature screening and the sensory matrix to obtain a training sample set; Step S20, constructing a fish fillet freshness prediction model; Step S30, using the training samples in the training sample set to train the fish fillet freshness prediction model, obtain the freshness data prediction value of the training fish fillet, and comprehensively evaluate the fish fillet freshness prediction model through MSE, RMSE and R square to optimize the model performance.
9. The fish fillet freshness prediction model training method according to claim 8, characterized in that: Before step D', the method further includes: obtaining T sensory data indicators of N training fish fillets, where T>8; using XGBoost to perform feature screening to screen out 8 key sensory data indicators, and in step D', performing data preprocessing on the 8 key sensory data indicators, wherein the 8 key sensory data indicators include: odor score, fish skin gloss score, fish skin mucus score, red muscle color score, muscle boundary score, muscle fissure score, white meat viscosity score, and muscle hardness score; And / or, in step S20, the fish fillet freshness prediction model is a random forest prediction model, the cross validation of the random forest prediction model is 3-fold; the number of determination trees is 100; the node splitting evaluation criterion is MSE, and the minimum number of samples of leaf nodes is 1.
10. A computer device, characterized in that: include: Memory; processor; and, a computer program stored on the memory; Wherein, the processor executes the computer program to implement: the fish fillet freshness prediction method according to any one of claims 1 to 7; or the fish fillet freshness prediction model training method according to claim 8 or 9.