A food quality detection method, device and system based on optical analysis

By calculating the peak characteristics and temperature data of the Raman peak, the offset parameters are constructed to correct the food spectral curve, which solves the problem of thermal effect interference caused by laser scanning, and improves the accuracy and clarity of food quality detection.

CN118671048BActive Publication Date: 2024-11-08TANGSHAN ANIMAL HUSBANDRY AQUATIC PROD QUALITY MONITORING CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411148591.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-08
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

In food quality detection, laser scanning may lead to food thermal effects or photochemical reactions, resulting in the offset of Raman spectral peaks, and the ingredient information cannot be accurately obtained.

Method used

By obtaining the food spectral curve, calculating the peak characteristics and interference of Raman peaks, combining temperature data, calculating the offset factor and offset, constructing offset parameters to correct the spectral data, eliminating thermal effect interference, and obtaining more accurate detection results .

Benefits of technology

It improves the accuracy and clarity of food sample quality detection, eliminates thermal effect interference caused by laser irradiation, and ensures the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118671048B_ABST
    Figure CN118671048B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of optical testing and analysis technology, and specifically to a food quality detection method, device and system based on optical analysis, including: using the data characteristics of the food spectrum curve to calculate the peak characteristics of each Raman peak; and combining the symmetry of the Raman peak to obtain the peak interference of each Raman peak; and then combining the temperature data after the detection to calculate the Raman peak offset factor and the Raman peak peak offset; further using the temperature difference before and after the detection of several samples and the Raman peak peak offset, construct the Raman peak offset parameter; thereby correcting the food spectrum curve through the offset parameter, obtaining new spectrum data, and finally obtaining the food quality detection result of the sample. The present invention reduces the influence of the food thermal effect caused by the laser on the spectrum data when using Raman spectroscopy technology for food quality detection, and further improves the accuracy of the detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optical testing and analysis, and in particular to a food quality detection method, device and system based on optical analysis. Background Art

[0002] In the process of food production and processing, in order to ensure food quality and safety, food safety testing is required, mainly including rapid identification and differentiation, non-destructive testing, real-time monitoring and early warning, as well as component analysis, contaminant detection, quality assessment and authenticity identification. Generally, optical Raman spectroscopy technology is used to irradiate the sample with a laser, and the quality parameters of the food are obtained by analyzing the spectral information of the reflected or transmitted light. Data processing and analysis are then performed, and the test results are output in real time, providing a scientific basis for food quality monitoring.

[0003] However, laser scanning may cause thermal effects or photochemical reactions in food, resulting in a shift in the spectral peaks, making it impossible to accurately obtain ingredient information to detect food quality. Summary of the invention

[0004] The present invention provides a food quality detection method, device and system based on optical analysis to solve the existing problems.

[0005] The food quality detection method, device and system based on optical analysis of the present invention adopt the following technical solutions:

[0006] An embodiment of the present invention provides a food quality detection method based on optical analysis, the method comprising the following steps:

[0007] Obtaining food spectrum curves of several samples, wherein the food spectrum curve has Raman frequency shift as the horizontal axis and Raman scattering intensity as the vertical axis; and obtaining temperature data of several samples before and after detection through a temperature sensor;

[0008] The peak characteristics of each Raman peak are calculated by using the data characteristics of the food spectrum curve; the peak interference degree of each Raman peak is obtained by combining the peak characteristics and symmetry of the Raman peak;

[0009] According to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, and the peak interference of the Raman peak, the shift factor of the Raman peak is calculated; according to the difference in temperature and peak characteristics after the Raman spectrum detection of different samples, combined with the shift factor of the Raman peak, the peak shift of the Raman peak is calculated; using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak, the shift parameter of the Raman peak is constructed; the food spectrum curve is corrected by the shift parameter to obtain new spectrum data;

[0010] Obtain food quality test results for samples based on new spectral data.

[0011] Furthermore, the data features of the food spectrum curve are used to calculate the peak features of each Raman peak, including the following specific methods:

[0012] The peak characteristics of each Raman peak are calculated by using the half-peak width of the Raman peak in the food spectrum curve and a number of spectral data in the Raman peak;

[0013]

[0014] in, Indicates the spectral curve The peak characteristics of the Raman peaks; Indicates The half-width of a Raman peak; Indicates The number of spectral data contained in each Raman peak; Indicates Raman Peak The Raman frequency shift corresponding to the spectral data; Indicates The Raman frequency shift corresponding to the peak value in the Raman peak; Indicates Raman Peak The scattering intensity corresponding to the spectral data; Indicates the absolute value symbol; Represents an exponential function with a natural constant as base.

[0015] Furthermore, the peak interference of each Raman peak is obtained by combining the peak characteristics and symmetry of the Raman peak, including the specific method of:

[0016]

[0017] in, Indicates The food spectrum curve The peak interference of the Raman peaks; Indicates The food spectrum curve The integrated area on the left side of the peak of each Raman peak; Indicates The food spectrum curve The integrated area on the right side of the peak of each Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak characteristics of the Raman peaks; Represents the absolute value symbol.

[0018] Furthermore, the calculation of the Raman peak shift factor according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, and the peak interference of the Raman peak, includes the following specific methods:

[0019] A broken line is drawn with the peak characteristics of the Raman peaks at corresponding positions in the spectrum curves of several foods as the horizontal coordinate and the Raman frequency shift corresponding to the peak as the vertical coordinate, which is recorded as the first broken line; at the same time, a broken line is drawn with the peak characteristics of the Raman peaks at corresponding positions in the spectrum curves of several foods as the horizontal coordinate and the temperature data after the detection of several samples as the vertical coordinate, which is recorded as the second broken line. The first broken line and the second broken line are located in the same broken line graph, and the broken line graph is recorded as the temperature parameter broken line graph;

[0020] According to the similarity of the data in the temperature parameter line graph and the peak interference of the Raman peak, the shift factor of the Raman peak is calculated;

[0021]

[0022] in, Indicates The shift factor of the Raman peak; Indicates the first line in the temperature parameter line chart. Data of Raman peaks; Indicates the second line in the temperature parameter line graph. Data of Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak interference of the Raman peaks; Indicates obtaining the DTW distance between polylines; Represents an exponential function with a natural constant as base.

[0023] Furthermore, the peak shift of the Raman peak is calculated based on the difference in temperature and peak characteristics after Raman spectrum detection of different samples, combined with the shift factor of the Raman peak, including the specific method of:

[0024]

[0025] in, Indicates the food spectrum curve The peak shift of a Raman peak; Indicates the number of samples; Indicates The shift factor of the Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates Temperature data of each sample after testing; Indicates Temperature data of each sample after testing; Represents the absolute value symbol.

[0026] Furthermore, the method of constructing the Raman peak shift parameter by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak includes the following specific methods:

[0027] The absolute value of the temperature difference before and after the detection of any sample is calculated, and the peak shift of the Raman peak in the food spectrum curve is combined to construct the shift parameter of the Raman peak; wherein the absolute value of the temperature difference before and after the detection of any sample and the peak shift of the Raman peak in the food spectrum curve are positively correlated with the shift parameter of the Raman peak.

[0028] Furthermore, the method of correcting the food spectrum curve by using the offset parameter to obtain new spectrum data includes the following specific methods:

[0029] A partial least squares model was established and the food spectral curve was corrected according to the shift parameters of the Raman peak.

[0030] Furthermore, the method of obtaining the food quality test result of the sample according to the new spectral data includes the following specific methods:

[0031] Use SpectraGryph spectral analysis software to analyze the calibrated food spectral curve to obtain quality indicators such as the sample's chemical composition, freshness and water content, and compare them with national standards to assess whether the food meets the requirements. When the test results show potentially harmful components such as microorganisms and additives that exceed national standards, the food will be destroyed. When the test results are within the standard range, the food quality test will be marked as qualified.

[0032] A food quality detection system based on optical analysis, using any one of the food quality detection methods based on optical analysis, the system comprises the following modules:

[0033] A spectrum acquisition module, used to obtain food spectrum curves of several samples;

[0034] The spectrum analysis module is used to calculate the peak characteristics of each Raman peak by using the data characteristics of the food spectrum curve; and obtain the peak interference degree of each Raman peak by combining the peak characteristics and symmetry of the Raman peak;

[0035] The spectrum correction module is used to calculate the shift factor of the Raman peak according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, as well as the peak interference of the Raman peak; calculate the peak shift of the Raman peak according to the difference in temperature and peak characteristics after the Raman spectrum detection of different samples, combined with the shift factor of the Raman peak; construct the shift parameter of the Raman peak by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak; correct the food spectrum curve by the shift parameter to obtain new spectrum data;

[0036] The food detection module is used to obtain the food quality detection result of the sample according to the new spectral data.

[0037] A food quality detection device based on optical analysis comprises a spectrometer, a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the steps of the food quality detection method based on optical analysis is implemented.

[0038] The beneficial effects of the technical solution of the present invention are as follows: compared with the traditional food quality detection method, the embodiment of the present invention takes into account the influence of the food thermal effect caused by the laser on the detection result when using Raman spectroscopy technology, and uses the spectral analysis module to analyze and calculate the spectral data, so as to quickly and accurately obtain the peak interference of each Raman peak in the food spectral curve, thereby improving the analysis ability of the spectral data of the food sample; by analyzing the performance of the Raman peaks of several samples at different temperatures, including the Raman peak offset factor, the peak offset, etc., the Raman peak offset parameters are constructed, and the food spectral curve is corrected by the offset parameters, so as to obtain clearer and more accurate new spectral data, which can eliminate the interference caused by the thermal effect caused by laser irradiation in the original data, and improve the accuracy of food sample quality detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 The present invention is a flowchart of the steps of a food quality detection method based on optical analysis. DETAILED DESCRIPTION

[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the food quality detection method and system based on optical analysis proposed by the present invention, its specific implementation, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0043] The following is a detailed description of a food quality detection method and system based on optical analysis provided by the present invention in conjunction with the accompanying drawings.

[0044] See also Figure 1 , which shows a flowchart of a method for detecting food quality based on optical analysis provided by an embodiment of the present invention, the method comprising the following steps:

[0045] Step S001: Obtain food spectrum curves of several samples.

[0046] It should be noted that in the process of using Raman spectroscopy for food quality testing, due to the influence of laser energy, the sample may cause local heating under the action of the laser, resulting in changes in the vibration state of the sample molecules, thereby affecting the accuracy of the Raman spectrum. Therefore, the food spectrum curve is obtained, and then the spectrum is analyzed to complete the correction of the spectrum data.

[0047] Specifically, in order to implement the food quality detection method based on optical analysis proposed in this embodiment, it is first necessary to obtain a food spectrum curve. The specific process is as follows:

[0048] The embodiment of the present invention uses a LMSP portable Raman spectrometer to detect the sample, obtains the Raman spectrum data of the sample, and fits the Raman spectrum data of the sample into a curve with Raman frequency shift as the horizontal axis and Raman scattering intensity as the vertical axis, which is recorded as the food spectrum curve. At the same time, a temperature sensor is used to measure and record the temperature data of the sample before and after Raman spectrum detection.

[0049] Several samples are tested to obtain several food spectrum curves.

[0050] It should be noted that the horizontal axis of the Raman spectrum is the Raman frequency shift, which reflects the vibration mode of the sample molecules; the vertical axis is the Raman scattering intensity, which reflects the relative intensity of the sample molecules in different vibration modes. The position and intensity of each Raman peak can provide information about the sample molecular structure, crystal structure, and their vibration and rotation modes. Therefore, the peaks in the Raman spectrum can be used to identify substances, analyze sample composition, and study sample molecular structure and its interactions.

[0051] So far, several food spectrum curves have been obtained through the above method.

[0052] Step S002: using the data features of the food spectrum curve, calculating the peak features of each Raman peak; combining the peak features and symmetry of the Raman peak, obtaining the peak interference of each Raman peak.

[0053] It should be noted that in the same batch of samples to be tested, the content of each component is different, which may lead to differences in intermolecular interactions, thereby affecting the effect of thermal effects on the molecular vibration frequency and causing position shifts. By comparing the shifts of peaks between different samples and obtaining the degree of shift, it is first necessary to obtain the characteristics of each peak in order to determine the peaks of the same component in the Raman spectra of different samples.

[0054] Specifically, in step 2.1, the peak characteristics of each Raman peak are calculated using the data characteristics of the food spectrum curve.

[0055] It should be noted that in the food spectrum curve, the differences in sample molecules are reflected in the different peak characteristics of the Raman peak. The half-peak width of the Raman peak can reflect the vibration mode of the sample molecule. The waveform concentration of the Raman peak can reflect the structural characteristics of the molecule, which is expressed by the product of different Raman frequency shifts and the distance between the peaks and the scattering intensity corresponding to the spectral data.

[0056] The peak characteristics of each Raman peak are calculated using the half-peak width of the Raman peak in the food spectrum curve and a number of spectral data in the Raman peak.

[0057] As an embodiment, the specific calculation method of the peak characteristics of the Raman peak is:

[0058]

[0059] in, Indicates the spectral curve The peak characteristics of the Raman peaks; Indicates The half-width of a Raman peak; Indicates The number of spectral data contained in each Raman peak; Indicates Raman Peak The Raman frequency shift corresponding to the spectral data; Indicates The Raman frequency shift corresponding to the peak value in the Raman peak; Indicates Raman Peak The scattering intensity corresponding to the spectral data; Indicates the absolute value symbol; Represents an exponential function with a natural constant as base.

[0060] It should be noted that For the Raman Peak The difference in Raman frequency shift between the spectral data and the peak of the Raman peak, For the The product of the difference in Raman frequency shift between several Raman data and the corresponding position of the peak in a Raman peak and the scattering intensity corresponding to the peak can reflect the waveform concentration of the Raman peak. The greater the waveform concentration of the Raman peak, the greater the peak characteristic of the Raman peak, and the more likely the Raman peak is a characteristic peak. The half-peak width of the Raman peak reflects the vibration mode of the sample molecule corresponding to the Raman peak. When the Raman peak is narrower, it indicates that the actual vibration of the sample molecule is more overlapped with the theoretical value, and the peak characteristic of the Raman peak is greater.

[0061] Step 2.2, combining the peak characteristics and symmetry of the Raman peaks to obtain the peak interference of each Raman peak.

[0062] It should be noted that the thermal effect of food caused by laser irradiation may cause the peaks in the same wavelength range in the food spectrum curve to overlap or have noise interference peaks. In order to prevent the interference peaks from being mistaken for the characteristic peaks of the corresponding sample molecules in the wavelength range, thereby causing errors in the calculation of the peak deviation, it is necessary to obtain the peak interference of several Raman peaks in each wavelength range in the food spectrum curve.

[0063] As an embodiment, a specific method for calculating the peak interference of the Raman peak in the spectrum curve is:

[0064]

[0065] in, Indicates The food spectrum curve The peak interference of the Raman peaks; Indicates The food spectrum curve The integrated area on the left side of the peak of each Raman peak; Indicates The food spectrum curve The integrated area on the right side of the peak of each Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak characteristics of the Raman peaks; Represents the absolute value symbol.

[0066] It should be noted that Indicates The food spectrum curve The symmetry of the peaks of the Raman peaks. When the difference in the integrated area on both sides of the peak of the Raman peak is more obvious, it means that the symmetry of the peaks on the left and right sides is lower, and the shape of the Raman peak is more irregular. The possibility that the Raman peak is an interference peak is greater, and its peak interference is greater; Indicates The food spectrum curve The peak characteristics of the first Raman peak are consistent with the first The difference between the mean values ​​of the peak characteristics of the Raman peaks is calculated. The larger the difference, the more random the interference peak appears and the greater the peak interference degree.

[0067] Step S003: Calculate the shift factor of the Raman peak according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, and the peak interference of the Raman peak; calculate the peak shift of the Raman peak according to the difference in temperature and peak characteristics after Raman spectrum detection of different samples, combined with the shift factor of the Raman peak; construct the shift parameter of the Raman peak by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak; correct the food spectrum curve by the shift parameter to obtain new spectrum data.

[0068] It should be noted that by confirming the peak interference of several Raman peaks in the same wavelength range, the influence of the interfering peaks can be eliminated, and then by comparing the position differences of the corresponding Raman peaks in different samples, the degree of influence of the thermal effect of food on the peak shift can be obtained, thereby obtaining the offset of each peak, and according to the relationship between temperature and peak position in different samples, the degree of influence of the thermal effect of food on the peak shift can be obtained.

[0069] Specifically, in step 3.1, the shift factor of the Raman peak is calculated according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, and the peak interference of the Raman peak.

[0070] A broken line is drawn with the peak characteristics of Raman peaks at corresponding positions in several food spectral curves as the horizontal coordinate and the Raman frequency shift corresponding to the peak as the vertical coordinate, which is recorded as the first broken line; at the same time, a broken line is drawn with the peak characteristics of Raman peaks at corresponding positions in several food spectral curves as the horizontal coordinate and the temperature data of several samples after detection as the vertical coordinate, which is recorded as the second broken line. The first broken line and the second broken line are located in the same broken line graph, and the broken line graph is recorded as the temperature parameter broken line graph.

[0071] According to the similarity of the data in the temperature parameter line graph and the peak interference of the Raman peak, the shift factor of the Raman peak is calculated.

[0072] As an embodiment, the specific calculation method of the shift factor of the Raman peak is:

[0073]

[0074] in, Indicates The shift factor of the Raman peak; Indicates the first line in the temperature parameter line chart. Data of Raman peaks; Indicates the second line in the temperature parameter line graph. Data of Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak interference of the Raman peaks; Indicates obtaining the DTW distance between polylines; Represents an exponential function with a natural constant as base.

[0075] Step 3.2, according to the difference in temperature and peak characteristics after Raman spectrum detection of different samples, combined with the shift factor of the Raman peak, the peak shift of the Raman peak is calculated.

[0076] It should be noted that when comparing the shift factors of the corresponding Raman peaks of several sample molecules, since the temperature changes caused by Raman laser irradiation are different for samples of different masses, the samples are affected by thermal effects differently, resulting in different degrees of shift.

[0077] As an embodiment, the specific calculation method of the peak shift of the Raman peak in the sample curve is:

[0078]

[0079] in, Indicates the sample The peak shift of a Raman peak; Indicates the number of samples; Indicates The shift factor of the Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates Temperature data of each sample after Raman spectrum detection; Indicates Temperature data of each sample after Raman spectrum detection; Represents the absolute value symbol.

[0080] It should be noted that Represents two different samples The difference between the peak characteristics of the Raman peaks represents the difference caused by the different degrees of peak shift caused by the thermal effect at different concentrations; It represents the ratio of the peak deviation of the same Raman peak between two samples to the degree of thermal effect, which measures the effect of temperature difference that causes the peak difference of food components between two samples; It represents the ratio of the effect of the temperature difference that causes the peak difference of food components between two samples to the actual temperature difference, and quantifies the peak shift caused by the actual unit temperature increase.

[0081] Step 3.3, using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak, the shift parameter of the Raman peak is constructed.

[0082] It should be noted that when actually testing the composition of samples, there is a difference between the temperature of the thermal effect of the food and the normal temperature, so it is necessary to calculate the peak shift caused by the unit temperature increase and construct the shift parameters of the Raman peak in the food spectral curve.

[0083] The absolute value of the temperature difference before and after Raman spectrum detection of any sample is calculated, and the peak shift of the Raman peak in the food spectrum curve is combined to construct the shift parameter of the Raman peak; wherein the absolute value of the temperature difference before and after Raman spectrum detection of any sample and the peak shift of the Raman peak in the food spectrum curve are positively correlated with the shift parameter of the Raman peak.

[0084] As an embodiment, the specific calculation method of the shift parameter of the Raman peak is:

[0085]

[0086] Indicates the food spectrum curve The shift parameters of the Raman peaks; Represents the temperature data of the sample after Raman spectrum detection; Indicates the temperature data of the sample before Raman spectrum detection; Indicates the sample The peak shift of a Raman peak; Represents the absolute value symbol.

[0087] Step 3.4, correct the food spectral curve by using the offset parameter to obtain new spectral data.

[0088] A partial least squares (PLS) model was established and the food spectral curve was corrected according to the shift parameters of the Raman peak.

[0089] Specifically, the shift parameters of the Raman peaks are used as features to construct a feature matrix, the shift parameters of several Raman peaks in each sample form a row, and the data of all samples together constitute the feature matrix to construct the initial PLS model.

[0090] The K-fold cross-validation method is used to internally validate the model, evaluate the stability and predictive ability of the model, prevent overfitting problems, and ensure the generalization ability of the model on new data sets. The regression model is used to predict the offset parameters of the Raman peak based on the Raman spectrum data of the sample to be tested. The results predicted by the PLS model are then compared with the actual observed values, and the peak position or peak shape of the spectral data is adjusted, and the peak position is corrected accordingly to improve the accuracy and reliability of the spectrum. In the actual calibration process, if the model prediction effect is found to be poor or there is new experimental data, the model parameters can be readjusted or the model can be trained again to ensure the continuous optimization of the calibration effect.

[0091] It should be noted that this embodiment corrects the food spectrum curve by establishing a partial least squares model, wherein the partial least squares model is a statistical method commonly used in regression analysis and data compression, and can usually provide better prediction results when the number of samples is small but the number of features is large.

[0092] Step S004: Obtaining food quality test results of the sample according to the new spectral data.

[0093] Then, use SpectraGryph spectral analysis software to analyze the corrected food spectral curve to obtain quality indicators such as the sample's chemical composition, freshness and water content, and compare them with national standards to evaluate whether the food meets the requirements. When the test results show that potentially harmful components such as microorganisms and additives exceed national standards, they will be destroyed. When the test results are within the standard range, the food quality test is marked as qualified.

[0094] At this point, food quality testing is completed through the above method.

[0095] Through the above steps, a food quality detection method based on optical analysis is completed.

[0096] In a second aspect, the present invention provides a food quality detection system based on optical analysis, the system comprising the following modules:

[0097] The spectrum acquisition module is used to obtain food spectrum curves of several samples.

[0098] The spectrum analysis module is used to calculate the peak characteristics of each Raman peak by using the data characteristics of the food spectrum curve; and obtain the peak interference degree of each Raman peak by combining the peak characteristics and symmetry of the Raman peak.

[0099] The spectrum correction module is used to calculate the shift factor of the Raman peak according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, as well as the peak interference of the Raman peak; calculate the peak shift of the Raman peak according to the difference in temperature and peak characteristics after Raman spectrum detection of different samples, combined with the shift factor of the Raman peak; construct the shift parameter of the Raman peak by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak; correct the food spectrum curve by the shift parameter to obtain new spectrum data.

[0100] The food detection module is used to obtain the food quality detection result of the sample according to the new spectral data.

[0101] In a third aspect, the present invention also provides a food quality detection device based on optical analysis, which comprises a spectrometer and a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, steps S001 to S004 of a food quality detection method based on optical analysis are implemented.

[0102] Compared with the traditional food quality detection method, the embodiment of the present invention takes into account the influence of the food thermal effect caused by the laser on the detection result when using Raman spectroscopy technology, and uses the spectral analysis module to analyze and calculate the spectral data, so as to quickly and accurately obtain the peak interference of each Raman peak in the food spectral curve, thereby improving the analysis ability of the spectral data of the food sample; by analyzing the performance of the Raman peaks of several samples at different temperatures, including the shift factor of the Raman peak, the peak shift, etc., the shift parameters of the Raman peak are constructed, and the food spectral curve is corrected by the shift parameters, so as to obtain clearer and more accurate new spectral data, which can eliminate the interference caused by the thermal effect caused by laser irradiation in the original data, and improve the accuracy of food sample quality detection.

[0103] It should be noted that the The model is only used to represent negative correlation and constrain the output of the model to be in In the specific implementation, it can be replaced by other models with the same purpose. This embodiment is only based on The model is described as an example without any specific limitation. is the input to the model.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A food quality detection method based on optical analysis, characterized in that: The method comprises the following steps: Obtaining food spectrum curves of several samples, wherein the food spectrum curve has Raman frequency shift as the horizontal axis and Raman scattering intensity as the vertical axis; and obtaining temperature data of several samples before and after detection through a temperature sensor; The peak characteristics of each Raman peak are calculated by using the data characteristics of the food spectrum curve; the peak interference degree of each Raman peak is obtained by combining the peak characteristics and symmetry of the Raman peak; According to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, and the peak interference of the Raman peak, the shift factor of the Raman peak is calculated; according to the difference in temperature and peak characteristics after the Raman spectrum detection of different samples, combined with the shift factor of the Raman peak, the peak shift of the Raman peak is calculated; using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak, the shift parameter of the Raman peak is constructed; the food spectrum curve is corrected by the shift parameter to obtain new spectrum data; Obtain food quality test results of samples based on new spectral data; The method of calculating the peak characteristics of each Raman peak by using the data characteristics of the food spectrum curve includes: The peak characteristics of each Raman peak are calculated by using the half-peak width of the Raman peak in the food spectrum curve and a number of spectral data in the Raman peak; in, Indicates the spectral curve The peak characteristics of the Raman peaks; Indicates The half-width of a Raman peak; Indicates The number of spectral data contained in each Raman peak; Indicates Raman Peak The Raman frequency shift corresponding to the spectral data; Indicates The Raman frequency shift corresponding to the peak value in the Raman peak; Indicates Raman Peak The scattering intensity corresponding to the spectral data; Indicates the absolute value symbol; represents an exponential function with a natural constant as base; The peak interference degree of each Raman peak is obtained by combining the peak characteristics and symmetry of the Raman peak, and the specific method includes: in, Indicates The food spectrum curve The peak interference of the Raman peaks; Indicates The food spectrum curve The integrated area on the left side of the peak of each Raman peak; Indicates The food spectrum curve The integrated area on the right side of the peak of each Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak characteristics of the Raman peaks; Indicates the absolute value symbol; The specific method for calculating the Raman peak offset factor based on the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve and the peak interference of the Raman peak is as follows: A broken line is drawn with the peak characteristics of the Raman peaks at corresponding positions in the spectrum curves of several foods as the horizontal coordinate and the Raman frequency shift corresponding to the peak as the vertical coordinate, which is recorded as the first broken line; at the same time, a broken line is drawn with the peak characteristics of the Raman peaks at corresponding positions in the spectrum curves of several foods as the horizontal coordinate and the temperature data after the detection of several samples as the vertical coordinate, which is recorded as the second broken line. The first broken line and the second broken line are located in the same broken line graph, and the broken line graph is recorded as the temperature parameter broken line graph; According to the similarity of the data in the temperature parameter line graph and the peak interference of the Raman peak, the shift factor of the Raman peak is calculated; in, Indicates The shift factor of the Raman peak; Indicates the first line in the temperature parameter line chart. Data of Raman peaks; Indicates the second line in the temperature parameter line graph. Data of Raman peaks; Indicates the food spectrum curve of all samples The mean of the peak interference of the Raman peaks; Indicates obtaining the DTW distance between polylines; represents an exponential function with a natural constant as base; The peak shift of the Raman peak is calculated based on the difference in temperature and peak characteristics after Raman spectrum detection of different samples, combined with the shift factor of the Raman peak, and the specific method includes: in, Indicates the food spectrum curve The peak shift of a Raman peak; Indicates the number of samples; Indicates The shift factor of the Raman peak; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates The food spectrum curve The peak characteristics of the Raman peaks; Indicates Temperature data of each sample after testing; Indicates Temperature data of each sample after testing; Indicates the absolute value symbol; The method of constructing the Raman peak shift parameter by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak includes the following specific methods: The absolute value of the temperature difference before and after the detection of any sample is calculated, and the peak shift of the Raman peak in the food spectrum curve is combined to construct the shift parameter of the Raman peak; wherein the absolute value of the temperature difference before and after the detection of any sample and the peak shift of the Raman peak in the food spectrum curve are both positively correlated with the shift parameter of the Raman peak; The method of correcting the food spectrum curve by using the offset parameter to obtain new spectrum data includes: A partial least squares model was established and the food spectral curve was corrected according to the shift parameters of the Raman peak.

2. A food quality detection method based on optical analysis according to claim 1, characterized in that: The specific method of obtaining the food quality test result of the sample according to the new spectral data includes: Use SpectraGryph spectral analysis software to analyze the calibrated food spectral curve to obtain quality indicators such as the sample's chemical composition, freshness and water content, and compare them with national standards to assess whether the food meets the requirements. When the test results show potentially harmful components such as microorganisms and additives that exceed national standards, the food will be destroyed. When the test results are within the standard range, the food quality test will be marked as qualified.

3. A food quality detection system based on optical analysis, using a food quality detection method based on optical analysis as claimed in any one of claims 1 to 2, characterized in that: The system includes the following modules: A spectrum acquisition module, used to obtain food spectrum curves of several samples; The spectrum analysis module is used to calculate the peak characteristics of each Raman peak by using the data characteristics of the food spectrum curve; and obtain the peak interference degree of each Raman peak by combining the peak characteristics and symmetry of the Raman peak; The spectrum correction module is used to calculate the shift factor of the Raman peak according to the relationship between the temperature of several samples after detection and the Raman peak in the food spectrum curve, as well as the peak interference of the Raman peak; calculate the peak shift of the Raman peak according to the difference in temperature and peak characteristics after the Raman spectrum detection of different samples, combined with the shift factor of the Raman peak; construct the shift parameter of the Raman peak by using the temperature difference before and after the detection of several samples and the peak shift of the Raman peak; correct the food spectrum curve by the shift parameter to obtain new spectrum data; The food detection module is used to obtain the food quality detection result of the sample according to the new spectral data.

4. A food quality detection device based on optical analysis, comprising a spectrometer, a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method as claimed in any one of claims 1 to 2 are implemented.