Efficient model training method and system based on data driving
By combining destructive detection and hyperspectral imaging technology, the characteristic wavelength of mutton freshness is extracted and the light correction algorithm is introduced, which solves the subjectivity and light impact problems of traditional meat freshness detection methods, and achieves the fast and accurate mutton freshness is can Non-destructive testing improves the robustness and practicality of testing.
Patent Information
- Application Number
- CN202411412600.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-11-08
AI Technical Summary
Traditional meat freshness detection methods have problems such as strong subjectivity, long-term and high cost, and the results of non-destructive testing are poor under different lighting conditions.
Using a data-driven model efficient training method, combined with destructive detection and hyperspectral imaging technology, by obtaining hyperspectral images of mutton samples of different fresh grades, extracting characteristic wavelengths, constructing a mutton freshness discrimination model, and introducing a light correction algorithm. Adjust the model to reduce the impact of light changes.
It realizes fast and accurate non-destructive testing of the freshness of mutton under various lighting environments, improves the robustness and accuracy of the model, and ensures the reliability and practicality of the test results.
Smart Images

Figure CN118918484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to the technical field of extracting image features, and specifically to a data-driven model efficient training method and system. Background Art
[0002] With the improvement of people's living standards and the change of consumption concepts, the requirements for food quality, especially the freshness of meat, are increasing. The freshness of meat products is not only directly related to the health and experience of consumers, but also an important indicator for measuring the level of meat supply chain management. However, traditional meat freshness detection methods often rely on manual sensory evaluation or chemical testing. These methods have the disadvantages of strong subjectivity, long time consumption, high cost, etc., which are difficult to meet the needs of modern food industry for efficient, accurate and non-destructive testing.
[0003] Data-driven artificial intelligence technology has made remarkable progress in various fields, especially in image processing, spectral analysis and machine learning, showing great application potential. These technologies provide new solutions for the rapid and non-destructive detection of meat freshness. By converting the spectral information and image information of meat samples into digital data and using advanced machine learning algorithms for analysis and processing, efficient and accurate judgment of the freshness of mutton can be achieved.
[0004] Therefore, it is necessary to improve the mutton freshness training model in the prior art to solve the above problems. Summary of the invention
[0005] The present invention overcomes the shortcomings of the prior art and provides a data-driven efficient model training method and system, aiming to solve the problem of the influence of light on non-destructive testing in the prior art.
[0006] To achieve the above object, the technical solution adopted by the present invention is: a data-driven efficient model training method, comprising: S1. Obtain a number of mutton samples of different freshness levels and determine the destructive testing standards of the corresponding freshness through destructive testing; S2, obtaining hyperspectral images of mutton samples under natural light and different supplementary light intensities, and extracting characteristic wavelengths of mutton freshness through hyperspectral images; S3. Constructing a mutton freshness discrimination model based on characteristic wavelength; S4. Combining the lossy detection standard and the mutton freshness discrimination model, the influence of light intensity on the discrimination of mutton freshness is analyzed; S5. Adjust the mutton freshness discrimination model according to the influence of light intensity.
[0007] In a preferred embodiment of the present invention, in step S1, the freshness level includes: fresh, sub-fresh and spoiled; the destructive detection method is one of volatile basic nitrogen content determination, microbial detection and pH value measurement.
[0008] In a preferred embodiment of the present invention, the step of determining the volatile basic nitrogen content comprises: Lamb samples of different freshness grades were soaked in distilled water for 30-45 min; The sample solution after soaking was transferred to a distillation device, and an appropriate amount of sodium hydroxide solution was added to adjust the pH to alkaline, and distilled for 30-45 minutes to release volatile nitrogen-containing compounds; The distilled gas is introduced into a boric acid absorption liquid through a conduit so that the volatile nitrogen-containing compounds are absorbed, and the absorption liquid is titrated with sulfuric acid or hydrochloric acid solution until the color of the solution changes from green to red; The volatile basic nitrogen content in the sample is calculated based on the amount of acid consumed in the titration and the concentration of the standard solution. ;in, is the volume of acid solution consumed in titrating the sample; is the volume of standard acid solution consumed in the blank test; is the molar concentration of the standard acid solution; is the mass of the sample; is the molar mass of the nitrogen atom; The TVB-N content of the mutton samples was obtained as a destructive test standard for freshness.
[0009] In a preferred embodiment of the present invention, in step S2, the steps of acquiring and processing the hyperspectral image of the mutton sample are: S21, obtaining the natural light intensity of the current environment; S22, adjusting the fill light intensity to obtain hyperspectral images of mutton samples under different light intensities; S23. Perform image correction on the hyperspectral image, extract spectral data, and select characteristic wavelengths that are significantly correlated with the freshness of mutton.
[0010] In a preferred embodiment of the present invention, in step S23, the image correction step includes: By acquiring the dark current image without sample and the reflection image of pure white reference plate, the sample image is corrected and processed. ,in, is the spectral reflectance of the sample after black and white correction, is the spectral intensity reflected by the original sample, is the spectral intensity reflected by the standard calibration blackboard, The spectral intensity of the reflection from the standard calibration white plate.
[0011] Apply Savitzky-Golay smoothing filter to the spectral data after black and white correction to reduce noise. Savitzky-Golay smoothing filter is a signal processing technology, mainly used for smoothing and differentiation of spectral data. For each data point, take the window size points around it, construct the coefficient matrix through the least squares method, and the smoothed data point ,in, represents the original data points, represents the coefficients in the coefficient matrix, Represents half the width of the window, that is, there are Points, is the index within the window, starting from arrive change.
[0012] In a preferred embodiment of the present invention, the step of extracting the spectral characteristic wavelength after image correction by continuous projection method includes: Randomly select a wavelength as the initial characteristic wavelength , for the currently selected A collection of characteristic wavelengths , calculate the Wavelength Projection vector on the set ,in, is the matrix of spectral data of all samples, each column represents the spectral information of a sample, and each row represents the spectral intensity at a wavelength. express In wavelength The spectral intensity vector at ; Calculate wavelength The residual on the current set of characteristic wavelengths , select the wavelength with the largest residual As a new characteristic wavelength, ; The newly selected wavelength Add to Collection ; Stop selecting when the feature selection of the characteristic wavelength set no longer significantly improves.
[0013] In a preferred embodiment of the present invention, in step S3, the step of constructing a mutton freshness discrimination model by using a BP artificial neural network includes: Determine the network structure, including the number of nodes in the input layer, hidden layer, and output layer; the number of input layer nodes is equal to the number of characteristic wavelengths, the number of hidden layer nodes is set to 1-2 times the number of input layer nodes, and the number of output layer nodes is 3 nodes, corresponding to the classification of freshness levels; The input data is passed through the hidden layer of the network to the output layer. The formula for forward propagation is: ,in, It is The weighted input of the layer, It is The weight matrix of the layer, is the activation output of the previous layer, is the output of the current layer, is the bias vector, is the activation function; The weights and biases are adjusted through the back-propagation algorithm to minimize the loss function, calculate the gradient of the loss function with respect to the weights and biases, and update the weights and biases: Loss function ,in, It is the real freshness of mutton. is the predicted output of mutton freshness; update rule: , ,in, is the learning rate.
[0014] In a preferred embodiment of the present invention, in step S4, the influence of light intensity on the model prediction result is quantified, and the evaluation formula is defined as ,in, Indicates the change in the prediction result. represents the model prediction results under natural lighting conditions, Represents the model prediction results under lighting conditions with different fill light intensities; Establishing the relationship between light intensity and predicted results ;in, is the prediction result, is the light intensity, is the error term, is the regression coefficient.
[0015] In a preferred embodiment of the present invention, in step S5, an illumination correction algorithm is introduced to reduce the impact of illumination changes on model prediction; Multivariate scattering correction is performed on the spectral data after Savitzky-Golay smoothing to further correct the baseline shift and reduce the baseline shift caused by light scattering, making the spectral data of different samples more consistent on the baseline; ,in, is the spectrum after multivariate scattering correction, is the smoothed spectrum, are the intercept and slope functions of the smoothed spectrum.
[0016] In a preferred embodiment of the present invention, in step S5, the original BP neural network model is set as: ,in, is the weight matrix, is the characteristic wavelength, are model parameters, To predict the output mutton freshness; the revised mutton freshness discrimination model is .
[0017] The present invention solves the defects existing in the background technology and has the following beneficial effects: (1) The present invention provides a data-driven efficient model training method and system. By combining destructive detection with non-destructive hyperspectral imaging technology, the volatile basic nitrogen content is used to establish the benchmark data of mutton freshness, and hyperspectral images are collected under different lighting conditions to extract characteristic wavelengths. A mutton freshness discrimination model is constructed. By introducing a lighting correction algorithm, the impact of lighting changes on the detection results is effectively reduced, the robustness and accuracy of the model are improved, and rapid and accurate non-destructive detection of mutton freshness under a variety of lighting environments is achieved.
[0018] (2) The present invention analyzes the influence of light intensity on the discriminant model and performs correction. In step S4, the influence of light intensity on the model prediction results is quantified, and the relationship between light intensity and prediction results is established. In step S5, a light correction algorithm is introduced to reduce the influence of light changes on model prediction, thereby further improving the accuracy and robustness of the model under different light conditions.
[0019] (3) The present invention reduces the influence of noise on spectral data and improves the reliability of data through black-white correction and Savitzky-Golay smoothing filtering. It uses a continuous projection method to extract characteristic wavelengths and selects the most representative wavelengths from a large amount of spectral information, thereby simplifying the model and improving its performance and reducing the interference of redundant information. The characteristic wavelengths are input into a BP artificial neural network to construct a discrimination model, which automatically learns the features in the input data and realizes accurate and rapid classification of the freshness of mutton.
[0020] (4) The present invention combines destructive testing with non-destructive hyperspectral imaging technology to determine the volatile basic nitrogen content, providing accurate and reliable benchmark data for the freshness of mutton. This ensures that the calibration and verification of subsequent non-destructive testing technology has a high-precision foundation. Hyperspectral imaging technology can obtain the spectral and spatial information of mutton without destroying the sample. Combining these two technologies not only ensures the accuracy of the data, but also realizes non-destructive testing. Compared with the existing technology, it further improves the detection efficiency and practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. Figure 1 is a flow chart of a preferred embodiment of the present invention; Figure 2 is an acquisition diagram of a hyperspectral image according to a preferred embodiment of the present invention; Figure 3 It is a diagram of a mutton freshness discrimination model constructed by a BP artificial neural network in a preferred embodiment of the present invention; In the picture, 1. Shooting platform; 2. Lamb sample; 3. Halogen lamp; 4. Spectrometer camera; 5. Fill light controller; 6. Hyperspectral image. DETAILED DESCRIPTION
[0022] 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.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0024] Application Overview: Taking mutton as an example, in the prior art, the detection methods for the freshness of mutton include non-destructive detection and destructive detection; Destructive testing can detect the freshness of mutton by measuring the volatile basic nitrogen content. During the storage of meat, due to the action of microorganisms, protein decomposition produces ammonia, amines and other alkaline nitrogen-containing substances. These substances are volatile, so they are called volatile basic nitrogen. By measuring the total amount of volatile nitrogen-containing substances, the freshness and degree of corruption of meat can be evaluated. Although it provides a relatively accurate and reliable assessment of the freshness of meat, it requires the destruction of part of the sample for analysis. Nondestructive testing technology can be carried out through hyperspectral imaging technology. Combining spectroscopy and imaging technology, it can simultaneously obtain the spectral information and spatial information of the target object and evaluate the freshness through characteristics. However, it will cause deviations in the test results under different lighting conditions. Changes in light intensity will affect the effect of optical detection, resulting in poor consistency of results in different environments.
[0025] Therefore, this application proposes an efficient freshness training model that combines destructive testing with non-destructive hyperspectral imaging technology, taking mutton as an example, aiming to overcome the problem of poor consistency of results of traditional non-destructive testing under different lighting conditions.
[0026] like Figure 1 As shown, a data-driven model efficient training method and system includes the following steps: S1. Collect several mutton samples of different freshness levels and determine the destructive testing standards of the corresponding freshness through destructive testing; S2, collecting hyperspectral images of mutton samples under natural light and different supplementary light intensities, and extracting characteristic wavelengths of mutton freshness through hyperspectral images; S3. Constructing a mutton freshness discrimination model based on characteristic wavelength; S4. Combining the lossy detection standard and the mutton freshness discrimination model, the influence of light intensity on the discrimination of mutton freshness is analyzed; S5. According to the influence of light intensity, adjust the mutton freshness discrimination model; Using lamb of different freshness grades allows the model to be trained under a wide range of conditions, making it more robust and accurate for real-world applications; In step S1, the freshness level includes: fresh, less fresh, and spoiled; wherein, fresh mutton refers to mutton that has just been slaughtered and has no obvious signs of corruption; less fresh mutton refers to mutton that has been stored for a period of time but is still within an acceptable edible range; spoiled mutton refers to mutton that is no longer suitable for consumption and has obvious signs of corruption; By covering samples of different freshness levels, we can ensure that the model not only performs well on fresh samples, but also accurately distinguishes different degrees of corruption; Destructive testing refers to methods that require sacrificing part of the integrity of the sample for testing. This method destroys part of the sample and cannot be used for final product inspection for commercial sale, but it can provide accurate results. Therefore, this application uses destructive testing as benchmark data to calibrate and verify the effectiveness of non-destructive testing technology.
[0027] In step S1, the destructive detection method includes: determination of volatile basic nitrogen content, microbial detection, and pH value measurement; Preferably, the step of determining the volatile basic nitrogen content comprises: Lamb samples of different freshness grades were soaked in distilled water for 30-45 min; The sample solution after soaking was transferred to a distillation device, and an appropriate amount of sodium hydroxide solution was added to adjust the pH to alkaline, and distilled for 30-45 minutes to release volatile nitrogen-containing compounds; The distilled gas is introduced into a boric acid absorption liquid through a conduit so that the volatile nitrogen-containing compounds are absorbed, and the absorption liquid is titrated with sulfuric acid or hydrochloric acid solution until the color of the solution changes from green to red; The volatile basic nitrogen content in the sample is calculated based on the amount of acid consumed in the titration and the concentration of the standard solution. ;in, is the volume of acid solution consumed in titrating the sample; is the volume of standard acid solution consumed in the blank test; is the molar concentration of the standard acid solution; is the mass of the sample; is the molar mass of the nitrogen atom; Through the above steps, the TVB-N content of the mutton sample is obtained as a destructive detection standard for freshness.
[0028] like Figure 2 As shown, in step S2, the steps of acquiring and processing the hyperspectral image of the mutton sample are: S21, obtaining the natural light intensity of the current environment; S22, adjusting the fill light intensity to obtain hyperspectral images of mutton samples under different light intensities; S23, performing image correction on the hyperspectral image, extracting spectral data, and selecting characteristic wavelengths significantly correlated with the freshness of mutton; In step S21, the surface of the mutton sample is clean, free of excess fat and tendons, and trimmed to a uniform size.
[0029] In step S22, the fill light intensity is set to three levels: low, medium, and high; and the halogen lamp is controlled by the fill light controller to perform fill light; The low fill light intensity range is 500-1000 lux, the medium fill light intensity range is 1000-3000 lux, and the high fill light intensity range is 3000-5000 lux; In step S23, in order to reduce the influence of the light source, spectrometer camera and environment on the sample spectral information, the collected hyperspectral image data needs to be calibrated in black and white. By obtaining the dark current image without sample and the reflection image of the pure white reference plate, the sample image is calibrated. ,in, is the spectral reflectance of the sample after black and white correction, is the spectral intensity reflected by the original sample, is the spectral intensity reflected by the standard calibration blackboard, The spectral intensity of the reflection from the standard calibration white plate.
[0030] Apply Savitzky-Golay smoothing filter to the spectral data after black and white correction to reduce noise. Savitzky-Golay smoothing filter is a signal processing technology, mainly used for smoothing and differentiation of spectral data. For each data point, take the window size points around it, construct the coefficient matrix through the least squares method, and the smoothed data point ,in, represents the original data points, represents the coefficients in the coefficient matrix, Represents half the width of the window, that is, there are Points, is the index within the window, starting from arrive change.
[0031] The continuous projection method is a feature selection method that selects the most representative variable from a set of variables in an iterative manner. In the mutton freshness detection of this application, hyperspectral imaging technology provides a large amount of spectral information, and the presence of redundant or irrelevant information in the spectral information will increase the complexity of the model and may cause overfitting. Therefore, the continuous projection method is selected to select the characteristic wavelength of mutton freshness.
[0032] The steps of extracting the spectral characteristic wavelength after image correction by the continuous projection method include: Randomly select a wavelength as the initial characteristic wavelength , for the currently selected A collection of characteristic wavelengths , calculate the Wavelength Projection vector on the set ,in, is the matrix of spectral data of all samples, each column represents the spectral information of a sample, and each row represents the spectral intensity at a wavelength. express In wavelength The spectral intensity vector at ; Calculate wavelength The residual on the current set of characteristic wavelengths , select the wavelength with the largest residual As a new characteristic wavelength, ; The newly selected wavelength Add to Collection ; Stop selecting when the feature selection of the characteristic wavelength set no longer significantly improves.
[0033] In this way, the continuous projection method can select those wavelengths that contribute most to the detection of mutton freshness from a large number of wavelengths, thereby simplifying the model and improving its performance.
[0034] BP artificial neural network is a multi-layer feedforward network trained by the error back propagation method. It optimizes the network weights through the back propagation algorithm to achieve learning and classification of input data. It consists of an input layer, one or more hidden layers, and an output layer. BPNN can handle complex nonlinear relationships such as characteristic wavelength data extracted from hyperspectral images. It automatically learns the features in the input data through multi-layer neurons, distinguishes lamb of different freshness levels, and adjusts weights to adapt to different input data.
[0035] like Figure 3 As shown, in step S3, a mutton freshness discrimination model is constructed by BP artificial neural network or CART algorithm; preferably, the mutton freshness discrimination model is constructed by BP artificial neural network: Determine the network structure, including the number of nodes in the input layer, hidden layer, and output layer; the number of input layer nodes is equal to the number of characteristic wavelengths, the number of hidden layer nodes is set to 1-2 times the number of input layer nodes, and the number of output layer nodes is 3 nodes, corresponding to the classification of freshness levels; The input data is passed through the hidden layer of the network to the output layer. The formula for forward propagation is: ,in, It is The weighted input of the layer, It is The weight matrix of the layer, is the activation output of the previous layer, is the output of the current layer, is the bias vector, is the activation function; The weights and biases are adjusted through the back-propagation algorithm to minimize the loss function, calculate the gradient of the loss function with respect to the weights and biases, and update the weights and biases: Loss function ,in, It is the real freshness of mutton. is the predicted output of mutton freshness; update rule: , ,in, is the learning rate.
[0036] By continuously iterating the forward propagation and back-propagation processes, BPANN can learn the mapping relationship between the input feature wavelength and the freshness of mutton, and make accurate classification or prediction based on it.
[0037] In step S4, the effect of light intensity on the freshness of mutton is analyzed to ensure the reliability and accuracy of hyperspectral imaging technology under different lighting conditions. Changes in lighting conditions will affect the quality of hyperspectral images. For example, changes in light intensity will cause changes in image brightness and contrast, which in turn affects the effectiveness of characteristic wavelengths extracted from the image.
[0038] Quantify the impact of light intensity on the model prediction results and define the evaluation formula ,in, Indicates the change in the prediction result. represents the model prediction results under natural lighting conditions, Represents the model prediction results under lighting conditions with different fill light intensities; Establishing the relationship between light intensity and predicted results ;in, is the prediction result, is the light intensity, is the error term, is the regression coefficient.
[0039] In step S5, an illumination correction algorithm is introduced to reduce the impact of illumination changes on model prediction; The illumination correction algorithm is one of multivariate scatter correction, Retinex algorithm and standard normal variable transformation. Preferably, the multivariate scatter correction method is used: Multivariate scatter correction is a widely used correction technique, especially in near-infrared spectroscopy. It attempts to correct for baseline shift by subtracting a reference spectrum from each spectrum and performing a linear transformation on it.
[0040] Multivariate scattering correction is performed on the spectral data after Savitzky-Golay smoothing to further correct the baseline shift and reduce the baseline shift caused by light scattering, making the spectral data of different samples more consistent on the baseline; ,in, is the spectrum after multivariate scattering correction, is the smoothed spectrum, are the intercept and slope functions of the smoothed spectrum.
[0041] The revised model will perform multivariate scattering correction before inputting characteristic wavelength data to reduce characteristic fluctuations caused by illumination changes, thereby improving the robustness and accuracy of the model.
[0042] Assume the original BP neural network model is: ,in, is the weight matrix, is the characteristic wavelength, are model parameters, To predict the freshness of the output mutton; The revised mutton freshness discrimination model is: ; By performing multivariate scattering correction on spectral data, the mutton freshness discrimination model can better process data under different lighting conditions and improve the accuracy and reliability of mutton freshness discrimination.
[0043] A data-driven model efficient training system, including modules: A data collection module is used to collect a number of mutton samples of different freshness levels, determine the destructive detection standards corresponding to the freshness through destructive detection, and collect hyperspectral images of the mutton samples under natural light and different supplementary light intensities; An image correction module, used for performing image correction on a hyperspectral image; A feature extraction module is used to extract the characteristic wavelength of mutton freshness through hyperspectral images; A model building module, used to build a mutton freshness discrimination model based on characteristic wavelengths; Lighting impact analysis module, used to combine the lossy detection standard and the mutton freshness discrimination model to analyze the impact of light intensity on mutton freshness discrimination; The illumination correction module is used to introduce an illumination correction algorithm to reduce the impact of illumination changes on model prediction.
[0044] Next, the present application is described through specific embodiments.
[0045] Lamb samples of different freshness levels were collected and tested to determine the corresponding destructive testing standards for freshness; the destructive testing included volatile basic nitrogen content, microbial testing and pH testing, and the freshness results obtained are shown in Table 1; Table 1 Multiple test measurement data for each mutton freshness level
[0046] Hyperspectral images of mutton samples under natural light and different supplementary light intensities were collected, and characteristic wavelengths of mutton freshness were extracted through hyperspectral images; freshness values were set at 0.0-5.0 for freshness, 5.1-10.0 for sub-freshness, and above 10.1 for spoilage; The characteristic wavelength of the mutton sample is used as the input of the mutton freshness discrimination model before correction and the mutton freshness discrimination model after correction to predict the freshness of the mutton sample; the prediction results are shown in Table 2; Table 2 Output results of the mutton freshness discrimination model without correction and after correction
[0047] Combining the data in Table 1 and Table 2, the output of the model correction improves the accuracy of discrimination. Therefore, in practical applications, the introduction of the illumination correction algorithm is of great significance for improving the accuracy of mutton freshness discrimination.
[0048] The above is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and the technical scope must be determined according to the scope of the claims.
Claims
1. A data-driven efficient model training method, characterized in that: Includes steps: S1. Obtain a number of mutton samples of different freshness levels and determine the destructive testing standards of the corresponding freshness through destructive testing; S2, obtaining hyperspectral images of mutton samples under natural light and different supplementary light intensities, and extracting characteristic wavelengths of mutton freshness through hyperspectral images; S3. Constructing a mutton freshness discrimination model based on characteristic wavelength; S4. Combining the lossy detection standard and the mutton freshness discrimination model, the influence of light intensity on the discrimination of mutton freshness is analyzed; S5. Adjust the mutton freshness discrimination model according to the influence of light intensity.
2. The data-driven efficient model training method according to claim 1, characterized in that: In step S1, the freshness level includes: fresh, sub-fresh and spoiled; the destructive detection method is one of volatile basic nitrogen content determination, microbial detection and pH value measurement.
3. The data-driven efficient model training method according to claim 1, characterized in that: The steps for determining the volatile basic nitrogen content include: Lamb samples of different freshness grades were soaked in distilled water for 30-45 min; The sample solution after soaking was transferred to a distillation device, and an appropriate amount of sodium hydroxide solution was added to adjust the pH to alkaline, and distilled for 30-45 minutes to release volatile nitrogen-containing compounds; The distilled gas is introduced into a boric acid absorption liquid through a conduit so that the volatile nitrogen-containing compounds are absorbed, and the absorption liquid is titrated with sulfuric acid or hydrochloric acid solution until the color of the solution changes from green to red; The volatile basic nitrogen content in the sample is calculated based on the amount of acid consumed in the titration and the concentration of the standard solution. ;in, is the volume of acid solution consumed in titrating the sample; is the volume of standard acid solution consumed in the blank test; is the molar concentration of the standard acid solution; is the mass of the sample; is the molar mass of the nitrogen atom; The TVB-N content of the mutton samples was obtained as a destructive test standard for freshness.
4. The data-driven efficient model training method according to claim 1, characterized in that: In step S2, the hyperspectral image of the mutton sample is obtained and processed: S21, obtaining the natural light intensity of the current environment; S22, adjusting the fill light intensity to obtain hyperspectral images of mutton samples under different light intensities; S23. Perform image correction on the hyperspectral image, extract spectral data, and select characteristic wavelengths that are significantly correlated with the freshness of mutton.
5. The data-driven efficient model training method according to claim 4, characterized in that: In step S23, the image correction step includes: By acquiring the dark current image without sample and the reflection image of pure white reference plate, the sample image is corrected and processed. ,in, is the spectral reflectance of the sample after black and white correction, is the spectral intensity reflected by the original sample, is the spectral intensity reflected by the standard calibration blackboard, The spectral intensity of the reflection of the standard calibration white plate; Apply Savitzky-Golay smoothing filter to the spectral data after black and white correction; for each data point, take the window size points around it, construct the coefficient matrix by the least squares method, and the smoothed data point ,in, represents the original data points, represents the coefficients in the coefficient matrix, Represents half the width of the window, that is, there are Points, is the index within the window, starting from arrive change.
6. The data-driven efficient model training method according to claim 5, characterized in that: The steps of extracting the spectral characteristic wavelength after image correction by the continuous projection method include: Randomly select a wavelength as the initial characteristic wavelength , for the currently selected A collection of characteristic wavelengths , calculate the Wavelength Projection vector on the set ,in, is the matrix of spectral data of all samples, each column represents the spectral information of a sample, and each row represents the spectral intensity at a wavelength. express In wavelength The spectral intensity vector at ; Calculate wavelength The residual on the current set of characteristic wavelengths , select the wavelength with the largest residual As a new characteristic wavelength, ; The newly selected wavelength Add to Collection ; Stop selecting when the feature selection of the characteristic wavelength set no longer significantly improves.
7. The data-driven efficient model training method according to claim 6, characterized in that: In step S3, the step of constructing a mutton freshness discrimination model by using a BP artificial neural network includes: Determine the network structure, including the number of nodes in the input layer, hidden layer, and output layer; the number of input layer nodes is equal to the number of characteristic wavelengths, the number of hidden layer nodes is set to 1-2 times the number of input layer nodes, and the number of output layer nodes is 3 nodes, corresponding to the classification of freshness levels; The input data is passed through the hidden layer of the network to the output layer. The formula for forward propagation is: ,in, It is The weighted input of the layer, It is The weight matrix of the layer, is the activation output of the previous layer, is the output of the current layer, is the bias vector, is the activation function; The weights and biases are adjusted through the back-propagation algorithm to minimize the loss function, calculate the gradient of the loss function with respect to the weights and biases, and update the weights and biases: Loss function ,in, It is the real freshness of mutton. is the predicted output of mutton freshness; update rule: , ,in, is the learning rate.
8. The data-driven efficient model training method according to claim 7, characterized in that: In step S4, the effect of light intensity on the model prediction results is quantified and the evaluation formula is defined ,in, Indicates the change in the prediction result. represents the model prediction results under natural lighting conditions, Represents the model prediction results under lighting conditions with different fill light intensities; Establishing the relationship between light intensity and predicted results ;in, is the prediction result, is the light intensity, is the error term, is the regression coefficient.
9. The data-driven efficient model training method according to claim 7, characterized in that: In step S5, an illumination correction algorithm is introduced to reduce the impact of illumination changes on model prediction; Multivariate scattering correction is performed on the spectral data after Savitzky-Golay smoothing to further correct the baseline shift and reduce the baseline shift caused by light scattering, making the spectral data of different samples more consistent on the baseline; ,in, is the spectrum after multivariate scattering correction, is the smoothed spectrum, is the intercept and slope function of the smoothed spectrum; Assume the original BP neural network model is: ,in, is the weight matrix, is the characteristic wavelength, are model parameters, To predict the output mutton freshness; the revised mutton freshness discrimination model is .
10. A data-driven efficient model training system, a system based on the data-driven efficient model training method according to any one of claims 1 to 9, characterized in that: A data collection module is used to collect a number of mutton samples of different freshness levels, determine the destructive detection standards corresponding to the freshness through destructive detection, and collect hyperspectral images of the mutton samples under natural light and different supplementary light intensities; An image correction module, used for performing image correction on a hyperspectral image; A feature extraction module is used to extract the characteristic wavelength of mutton freshness through hyperspectral images; A model building module, used to build a mutton freshness discrimination model based on characteristic wavelengths; Lighting impact analysis module, used to combine the lossy detection standard and the mutton freshness discrimination model to analyze the impact of light intensity on mutton freshness discrimination; The illumination correction module is used to introduce an illumination correction algorithm to reduce the impact of illumination changes on model prediction.
Citation Information
Patent Citations
Multi-feature fusion-based meat freshness hyperspectral image visual detection
CN103900972A
THz spectrum rapid nondestructive detection method of freshness K value of fresh meat
CN106960091A
Nondestructive testing method for pork quality
CN112683849A
Fish freshness detection method and system
CN113791055A
Multi-index meat freshness nondestructive testing method and system
CN114739916A
