Food additive testing method based on spectral analysis
Through the spectral analysis method, the detection characteristic peak of food additives is determined and the detection of food samples to be detected based on the peak is solved, and the problem of low detection accuracy and reliability of food additives in the prior art is achieved, and non-destructive detection and high accuracy detection results are achieved.
Patent Information
- Application Number
- CN202510599606.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-06-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the detection results of food additives have low accuracy and reliability, and the samples are often pretreated and decomposed, resulting in changes in the original properties of the samples.
Using the food additive testing method based on spectral analysis, the recommended degree of characteristic peaks is determined by obtaining spectral images of pure samples without food additives, additive samples containing food additives and samples of other food additives, and the food samples to be detected based on the target peaks.
The non-destructive testing of food additives is realized, the accuracy and reliability of the test results are improved, and the impact of sample decomposition treatment on the results is avoided.
Smart Images

Figure CN120102477A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of material testing, and in particular to a food additive testing method based on spectral analysis. Background Art
[0002] Food additives refer to chemically synthesized or natural substances added to food to improve food quality and color, aroma, and taste, as well as for preservation and processing needs. In the food industry, various food additives emerge in an endless stream to improve food quality. However, when food additives are added in excessive amounts, they pose a potential threat to consumer monitoring. Therefore, it is necessary to test food additives.
[0003] In some scenarios, chemical analysis methods are often used to conduct destructive testing of food additives. Samples need to be pretreated and decomposed before testing. During the sample pretreatment and decomposition process, the structure or concentration of food additives may change, thereby changing the original properties of the samples. Therefore, when food additives are tested using the above method, the accuracy and reliability of the test results of food additives are low. Summary of the invention
[0004] In order to solve the technical problem of low accuracy and reliability of food additive detection results, the purpose of the present invention is to provide a food additive testing method based on spectral analysis, and the technical scheme adopted is as follows: An embodiment of the present invention provides a food additive testing method based on spectral analysis, including: obtaining a first spectral image of a pure sample without food additives, a second spectral image of an additive sample containing food additives, and a third spectral image of an additive sample containing other food additives; determining an alternative peak that becomes a detection feature of the food additive from a characteristic peak in the second spectral image, and determining a first characteristic peak in the first spectral image and a second characteristic peak in the third spectral image; determining a recommendation degree of the alternative peak based on a peak height of the first characteristic peak, a peak parameter of the alternative peak, and a peak height of the second characteristic peak, and determining an alternative peak with a recommendation degree greater than a threshold as a target peak of the detection feature of the food additive; obtaining a fourth spectral image of the food sample to be tested, and detecting the food additive based on the target peak in the fourth spectral image, wherein the food additive is added to the food sample to be tested.
[0005] Determining the recommendation degree of the alternative peak includes: determining a first difference between the alternative peak and the first spectral image, and determining a second difference between the alternative peak and the third spectral image according to the peak height of the second characteristic peak and the second distance between the alternative peak and the second characteristic peak; determining an initial recommendation degree of the alternative peak as a detection feature according to the first difference, the second difference and the peak height in the peak parameters of the alternative peak; determining the excellence of the alternative peak according to a first weight of the peak shape in the peak parameters of the alternative peak, a second weight of the peak signal-to-noise ratio in the peak parameters of the alternative peak, a half-height width in the peak parameters of the alternative peak, a width difference between the leading edge and the trailing edge in the peak parameters of the alternative peak, and the peak signal-to-noise ratio; The initial recommendation degree is corrected using the degree of excellence to obtain the recommendation degree. Optionally, determining the candidate peaks that become the detection characteristics of food additives from the characteristic peaks in the second spectral image includes: using a peak detection algorithm to identify the characteristic peaks in the second spectral image, and sorting the peak heights of each characteristic peak in descending order; selecting the first N bits of the characteristic peaks after descending order as candidate peaks, where N is a natural number greater than 1.
[0006] Optionally, determining the first difference between the alternative peak and the first spectral image includes: selecting a first minimum value from the first distance between the alternative peak and the first characteristic peak, and determining the peak height of the first characteristic peak corresponding to the first minimum value; determining a first ratio between the first minimum value and the peak height of the first characteristic peak corresponding to the first minimum value as the first difference.
[0007] Optionally, determining the second difference between the alternative peak and the third spectral image includes: selecting a second minimum value from the second distance between the alternative peak and the second characteristic peak, and determining the peak height of the second characteristic peak corresponding to the second minimum value; determining a second ratio between the second minimum value and the peak height of the second characteristic peak corresponding to the second minimum value as the second difference.
[0008] Optionally, determining the initial recommendation degree of the alternative peak as a detection feature based on the first difference, the second difference and the peak height in the peak parameters of the alternative peak includes: superimposing each second difference to obtain a superimposed difference; calculating a first product among the superimposed difference, the first difference and the peak height in the peak parameters of the alternative peak; and normalizing the first product to obtain an initial recommendation degree.
[0009] Optionally, determining the excellence of the candidate peak according to a first weight of the peak shape in the peak parameters of the candidate peak, a second weight of the peak signal-to-noise ratio in the peak parameters of the candidate peak, a half-height width in the peak parameters of the candidate peak, a width difference between the leading edge and the trailing edge in the peak parameters of the candidate peak, and the peak signal-to-noise ratio includes: Based on the principal component analysis method, the first contribution of the peak shape to the data variability and the second contribution of the peak signal-to-noise ratio to the data variability are determined; the first sum between the first contribution and the second contribution is calculated, the third ratio between the first contribution and the first sum is determined as the first weight, and the fourth ratio between the second contribution and the first sum is determined as the second weight; the second sum between the second product between the half-height width and the width difference and the predetermined value is calculated, and the third product between the first weight and the reciprocal of the second sum is calculated; the fourth product between the second weight and the peak signal-to-noise ratio is calculated, and the third sum between the third product and the fourth product is calculated; the third sum is normalized to obtain the degree of excellence.
[0010] Optionally, the initial recommendation degree is corrected using the excellence degree to obtain the recommendation degree, which includes: calculating the fifth product between the excellence degree and the initial recommendation degree; and normalizing the fifth product to obtain the recommendation degree.
[0011] Optionally, detecting food additives based on the target peak in the fourth spectral image includes: determining the content of food additives in the food sample to be detected based on the peak height of the target peak and a fitting curve between the predetermined peak height and the additive content.
[0012] Optionally, based on the peak height of the target peak and a fitting curve between the predetermined peak height and the additive content, determining the content of food additives in the food sample to be tested includes: performing spectral testing on test samples to which different doses of food additives are added; fitting the peak height of the target peak detected in each test sample with the content of food additives added to the test sample to obtain a fitting curve; and determining the content of food additives corresponding to the peak height of the target peak of the food sample to be tested from the fitting curve.
[0013] The present invention has the following beneficial effects: first, a first spectral image of a pure sample without food additives, a second spectral image of an additive sample of food additives, and a third spectral image of an additive sample of other food additives are obtained; then, an alternative peak that becomes a detection feature of food additives is determined from the characteristic peaks in the second spectral image, and a first characteristic peak in the first spectral image and a second characteristic peak in the third spectral image are determined; secondly, according to the peak height of the first characteristic peak, the peak parameters of the alternative peak, and the peak height of the second characteristic peak, the recommendation degree of the alternative peak is determined, and the alternative peak with a recommendation degree greater than a threshold is determined as a target peak of the detection feature of food additives; finally, a fourth spectral image of the food sample to be detected is obtained, and the food additive is detected based on the target peak in the fourth spectral image, and food additives are added to the food sample to be detected.
[0014] In this way, the embodiment of the present invention obtains high-intensity characteristic peaks in the spectrum of food additives by analyzing the spectral images of food and the spectral images of food additives, and determines the recommendation degree of each characteristic peak as a detection feature for identifying the type of food additives, and determines whether the characteristic peak is used as a detection feature of food additives based on the recommendation degree. After determining the detection feature of the food additive, the food additives in the food sample to be detected are detected based on the detection feature. Therefore, the embodiment of the present invention does not need to decompose the sample, solves the problems caused by the destructive detection of food additives in the prior art, realizes non-destructive detection of food additives, and improves the accuracy and reliability of the detection results of food additives. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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.
[0016] Figure 1 A flow chart of a food additive testing method based on spectral analysis provided by one embodiment of the present invention.
[0017] Figure 2 A schematic structural diagram of a food additive testing spectral image analysis system provided by one embodiment of the present invention.
[0018] Figure 3 A schematic structural diagram of a food additive testing spectral image analysis system provided in another embodiment of the present invention. DETAILED DESCRIPTION
[0019] 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 additive testing method based on spectral analysis proposed by the present invention, its specific implementation, structure, characteristics and effects as follows in conjunction 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, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0020] 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.
[0021] The specific scheme of a food additive testing method based on spectral analysis provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0022] Embodiment 1: See also Figure 1 , which shows a flow chart of a food additive testing method based on spectral analysis provided by one embodiment of the present invention, including: S101, obtaining a first spectral image of a pure sample without food additives, a second spectral image of an additive sample containing food additives, and a third spectral image of an additive sample containing other food additives.
[0023] Specifically, the embodiment of the present invention places the collected pure samples, samples containing current food additives and samples containing other food additives on the scanning platform of the spectral imager, uses the spectral imager to scan the pure samples, samples containing current food additives and samples containing other food additives, and collects their spectral data at a series of wavelengths. These spectral data are expressed as a function of absorbance or reflectivity with wavelength on the spectral image. Then, these spectral data are converted into a chart through well-known technology, usually the horizontal axis represents the wavelength, and the vertical axis represents the signal intensity. For example, the horizontal axis of the first spectral image represents the different detection wavelengths of the pure sample, and the vertical axis represents the peak height of different characteristic peaks of the pure sample, that is, the signal intensity.
[0024] Furthermore, in order to reduce errors in the subsequent analysis steps, the embodiment of the present invention performs denoising, background correction and normalization on the obtained first spectral image, second spectral image and third spectral image to improve data quality and reduce errors in the subsequent analysis.
[0025] Furthermore, in the embodiment of the present invention, the food additives refer to the food additives currently being analyzed that need to be added to the pure sample, and other food additives refer to other types of food additives used in the pure sample.
[0026] S102, determining candidate peaks that become detection features of food additives from characteristic peaks in the second spectral image, and determining a first characteristic peak in the first spectral image and a second characteristic peak in the third spectral image.
[0027] Specifically, the characteristic peak in the embodiment of the present invention refers to a peak with a higher peak height in the spectral image, which can represent the characteristics of the corresponding sample. The alternative peak refers to a peak that may be used as a detection feature to distinguish the type of food additives. The first spectral image, the second spectral image, and the third spectral image all include multiple characteristic peaks.
[0028] Furthermore, as an optional embodiment of the present invention, determining candidate peaks that serve as detection features of food additives from characteristic peaks in the second spectral image includes: using a peak detection algorithm to identify characteristic peaks in the second spectral image, and sorting the peak heights of each characteristic peak in descending order; selecting the first N bits of the characteristic peaks after descending order as candidate peaks, where N is a natural number greater than 1.
[0029] Specifically, the embodiment of the present invention uses a peak detection algorithm to automatically detect and identify characteristic peaks in the spectrum, and then sorts each characteristic peak in descending order. The characteristic peaks whose peak heights are ranked in the first N positions are regarded as stronger peaks in the spectrum image of the food additive, and these peaks may become candidate peaks for the detection characteristics of the food additive. Among them, N can be selected according to the actual scenario, and the value in the embodiment of the present invention is 5.
[0030] Furthermore, the embodiment of the present invention uses a peak detection algorithm to detect the first characteristic peak in the first spectral image and the second characteristic peak in the third spectral image.
[0031] S103, determining the recommendation degree of the alternative peaks according to the peak height of the first characteristic peak, the peak parameters of the alternative peaks and the peak height of the second characteristic peak, and determining the alternative peaks with the recommendation degree greater than the threshold as the target peaks of the detection characteristics of the food additives.
[0032] Specifically, for an alternative peak, the farther the distance between it and the characteristic peak in the first spectral image of the pure sample and the lower the peak height of the characteristic peak in the first spectral image of the pure sample that is closest to it, the greater the difference between it and the first spectral image of the pure sample, the better the alternative peak can identify the food additive corresponding to the alternative peak, and therefore the higher the recommendation degree of the alternative peak as a detection feature.
[0033] Furthermore, the peak parameters of the candidate peaks include but are not limited to peak height, peak shape, peak signal-to-noise ratio, half-width, and width difference between the leading edge and the trailing edge.
[0034] Further, as an optional embodiment of the present invention, determining the recommendation degree of the alternative peak according to the peak height of the first characteristic peak, the peak parameters of the alternative peak and the peak height of the second characteristic peak includes: determining a first difference between the alternative peak and the first spectral image according to the peak height of the first characteristic peak and the first distance between the alternative peak and the first characteristic peak, and determining a second difference between the alternative peak and the third spectral image according to the peak height of the second characteristic peak and the second distance between the alternative peak and the second characteristic peak; determining an initial recommendation degree of the alternative peak as a detection feature according to the first difference, the second difference and the peak height in the peak parameters of the alternative peak; determining the excellence of the alternative peak according to a first weight of the peak shape in the peak parameters of the alternative peak, a second weight of the peak signal-to-noise ratio in the peak parameters of the alternative peak, the half-width in the peak parameters of the alternative peak, the width difference between the leading edge and the trailing edge in the peak parameters of the alternative peak, and the peak signal-to-noise ratio; and correcting the initial recommendation degree using the excellence degree to obtain the recommendation degree.
[0035] Specifically, there may be multiple first characteristic peaks in the embodiment of the present invention, and there may also be multiple first distances between the alternative peak and the first characteristic peak in the embodiment of the present invention. When calculating the first difference, the minimum value of the first distances is selected to calculate the first difference. Among them, as an optional embodiment of the present invention, according to the peak height of the first characteristic peak and the first distance between the alternative peak and the first characteristic peak, determining the first difference between the alternative peak and the first spectral image includes: selecting a first minimum value from the first distance between the alternative peak and the first characteristic peak, and determining the peak height of the first characteristic peak corresponding to the first minimum value; determining the first ratio between the first minimum value and the peak height of the first characteristic peak corresponding to the first minimum value as the first difference.
[0036] Specifically, the embodiment of the present invention is based on the The candidate peaks are compared with the first spectral image of the pure sample. The distance between the first characteristic peaks is the shortest. In the embodiment of the present invention, the distance between the two is . And the first spectral image The peak height of the first characteristic peak is . The first difference between the candidate peak and the first spectral image The calculation is done using the following formula: In the above formula, Indicates A first difference between the candidate peak and the first spectral image. Indicates The candidate peaks are compared with the first spectral image of the pure sample. The first minimum value among the first distances of the first characteristic peaks. Indicates The candidate peaks are compared with the first spectral image of the pure sample. The peak height of the first characteristic peak.
[0037] Furthermore, the embodiment of the present invention adopts the same method to calculate the second difference between the candidate peak and the third spectral image of other food additives that are often present in the food. The greater the first difference between a candidate peak and the first spectral image of the pure sample, the greater the second difference between the candidate peak and the third spectral image of other common food additives, and the higher the peak height of the candidate peak itself, the higher the recommendation of the candidate peak as a detection feature.
[0038] Further, as an optional embodiment of the present invention, determining the second difference between the alternative peak and the third spectral image based on the peak height of the second characteristic peak and the second distance between the alternative peak and the second characteristic peak includes: selecting a second minimum value from the second distance between the alternative peak and the second characteristic peak, and determining the peak height of the second characteristic peak corresponding to the second minimum value; determining the second ratio between the second minimum value and the peak height of the second characteristic peak corresponding to the second minimum value as the second difference.
[0039] Specifically, the calculation formula of the second difference can refer to the calculation formula of the first difference in the above embodiment, and the embodiment of the present invention will not be repeated here.
[0040] Further, as an optional embodiment of the present invention, determining the initial recommendation degree of the alternative peak as a detection feature based on the first difference, the second difference and the peak height in the peak parameters of the alternative peak includes: superimposing each second difference to obtain a superimposed difference; calculating a first product among the superimposed difference, the first difference and the peak height in the peak parameters of the alternative peak; and normalizing the first product to obtain an initial recommendation degree.
[0041] Specifically, the embodiment of the present invention is based on the For example, the first candidate peak The candidate peaks are related to other common food additives in the food. The second difference of the third spectral image of the food additive is The commonly used food additives in this food are species, and the peak height of the candidate peak is The embodiment of the present invention specifically uses the following formula to calculate the The initial recommendation of candidate peaks as detection features: In the above formula, Indicates The candidate peaks are used as the initial recommendation of the detection features. Indicates A first difference between the candidate peak and the first spectral image. Indicates The candidate peaks are related to other common food additives in the food. A second difference degree of a third spectral image of a food additive. Indicates The peak height in the peak parameters of the candidate peaks. As a whole, it represents the difference between the candidate peak and other peaks that may appear in the spectrum image of this kind of food. Represents the normalization function, which is used to Perform normalization.
[0042] Furthermore, when distinguishing the alternative peak from other interference factors, the quality of the alternative peak itself will also affect the suitability of the alternative peak as a detection feature. When the peak shape of the alternative peak is more symmetrical and the peak is sharper, the peak shape of the alternative peak is considered to be better. At the same time, the exact height of the peak of the alternative peak is measured, the standard deviation of the background noise near the peak is measured, and the ratio of the peak height to the standard deviation of the background noise is defined as the peak signal-to-noise ratio corresponding to the alternative peak. The peak signal-to-noise ratio of the alternative peak is combined to comprehensively judge the quality of the alternative peak, and then the recommendation of the alternative peak as a detection feature is corrected accordingly. However, when calculating the excellence of the alternative peak by the peak shape and the peak signal-to-noise ratio, the two may have different effects on the final result. Therefore, it is first necessary to use statistical methods, such as principal component analysis, to determine the contribution of the peak shape and the peak signal-to-noise ratio to the data variability, and to assign weights accordingly to improve the accuracy of the calculation results of the excellence of the alternative peak.
[0043] Further, as an optional embodiment of the present invention, determining the excellence of an alternative peak based on a first weight of a peak shape in the peak parameters of the alternative peak, a second weight of a peak signal-to-noise ratio in the peak parameters of the alternative peak, the half-width in the peak parameters of the alternative peak, the width difference between the leading edge and the trailing edge in the peak parameters of the alternative peak, and the peak signal-to-noise ratio includes: determining a first contribution of the peak shape to data variability and a second contribution of the peak signal-to-noise ratio to data variability based on a principal component analysis method; calculating a first sum between the first contribution and the second contribution, determining a third ratio between the first contribution and the first sum as a first weight, and determining a fourth ratio between the second contribution and the first sum as a second weight; calculating a second sum between a second product between the half-width and the width difference and a predetermined value, and calculating a third product between the first weight and the inverse of the second sum; calculating a fourth product between the second weight and the peak signal-to-noise ratio, and calculating a third sum between the third product and the fourth product; normalizing the third sum to obtain the excellence.
[0044] Specifically, the first contribution of the peak shape to the data variability is recorded as , the contribution of peak signal-to-noise to data variability is recorded as . and The acquisition process is as follows: Firstly, the peak shape (such as peak width and symmetry) and peak signal-to-noise ratio (SNR) data of each candidate peak were obtained, and the peak shape and peak signal-to-noise ratio were standardized (mean was 0 and standard deviation was 1) respectively to eliminate the influence of dimensional differences on principal component analysis.
[0045] Then the standardized data covariance matrix is equivalent to the correlation coefficient matrix. If the original variables are X (peak shape) and Y (peak signal-to-noise ratio), the covariance matrix for: ,in is the correlation coefficient between the two.
[0046] Secondly, the covariance matrix is decomposed to obtain two eigenvalues (larger value) and (smaller value), and the corresponding eigenvector (direction of the principal component), let the load of the first principal component (PC1) be , the loading of the second principal component (PC2) is , satisfying a+b=1 and c+d=1.
[0047] Finally, the contribution of variables X and Y is calculated, among which the first contribution of the peak shape is : , the second contribution to the peak signal-to-noise ratio β: .
[0048] Since the specific implementation process of using principal component analysis to determine the contribution of peak shape and peak signal-to-noise ratio to data variability belongs to the prior art, it will not be described in detail here.
[0049] Furthermore, after obtaining the first contribution of the peak shape and the second contribution of the peak signal-to-noise ratio, we use and Calculate the first weight of the peak shape and the second weight of the peak signal-to-noise ratio. The first weight of the peak shape is The second weight of the peak signal-to-noise ratio is .
[0050] Furthermore, in the embodiment of the present invention, The half-width of the candidate peak is , the The width difference between the leading and trailing edges of the candidate peaks is , and the peak signal-to-noise ratio of the peak is , the predetermined value is 1, then the following formula is used to calculate the The quality of the candidate peaks: In the above formula, Indicates The excellence of the alternative peaks. Represents the first contribution to the crest shape. Represents the second contribution to the peak signal-to-noise ratio. Indicates The half-width at half-height of the candidate peak. Indicates The difference in width between the leading and trailing edges of the candidate peaks. Indicates The peak signal-to-noise ratio of the candidate peaks. Represents the normalization function, which is used to Normalization is performed. The smaller the half-height width is, the sharper the peak shape is. As a whole, it indicates how good the peak shape is.
[0051] Furthermore, the embodiment of the present invention corrects the initial recommendation degree of the candidate peak as the detection feature based on the excellence of the candidate peak itself. As an optional embodiment of the present invention, correcting the initial recommendation degree using the excellence degree to obtain the recommendation degree includes: calculating the fifth product between the excellence degree and the initial recommendation degree; normalizing the fifth product to obtain the recommendation degree.
[0052] Specifically, the embodiment of the present invention is based on the As an example, the following formula is used to calculate the The recommendation degree of candidate peaks as detection features : In the above formula, Indicates The recommendation degree of the candidate peaks as detection features. Indicates The excellence of the alternative peaks. Indicates The candidate peaks are used as the initial recommendation of the detection features. Represents the normalization function, which is used to Perform normalization.
[0053] Furthermore, the threshold in the embodiment of the present invention can be set according to the actual situation. In the embodiment of the present invention, the threshold is set to 0.7. The alternative peak is considered as the target peak suitable as the detection characteristic of this food additive.
[0054] S104, obtaining a fourth spectral image of the food sample to be detected, and detecting food additives based on a target peak in the fourth spectral image, wherein food additives are added to the food sample to be detected.
[0055] Specifically, the food sample to be tested in the embodiment of the present invention refers to the food that needs to be tested for food additives, in which the food additives in the above embodiment and other food additives are added. In order to make the target peak obtained in the above embodiment actually applied to the detection of additives, the test samples with different doses of food additives added are subjected to spectral testing to obtain the detection limit value corresponding to the target peak. The detection limit value is the minimum content of abnormal conditions in the spectral image that can be detected when each target peak is used as the detection feature of a certain food additive. If the content of the additive in the food does not reach the minimum content, it may lead to missed detection and false negative. Therefore, the embodiment of the present invention increases the concentration of food additives in food by the following methods: (1) Sample enrichment: increase the concentration of the food additive to be tested by extraction, concentration and other means (such as evaporating the solvent to increase the concentration by 10 times). (2) Improve the instrument: use a detector with higher sensitivity (such as a fluorescence detector instead of an ultraviolet detector). (3) Signal amplification: enhance the characteristic peak signal by chemical derivatization reaction. In this way, the above method further improves the accuracy and reliability of the detection results of food additives.
[0056] Furthermore, as an optional embodiment of the present invention, detecting food additives based on the target peak in the fourth spectral image includes: determining the content of food additives in the food sample to be tested based on the peak height of the target peak and a fitting curve between a predetermined peak height and the additive content.
[0057] Specifically, the fitting curve between the predetermined peak height and the additive content is determined by the spectral images of samples with different doses of food additives added in the embodiment of the present invention. First, the test samples with different doses of food additives added are subjected to spectral testing; then, the peak height of the target peak detected in each test sample is fitted with the content of the food additive added in the test sample to obtain a fitting curve; finally, the content of the food additive corresponding to the peak height of the target peak of the food sample to be tested is determined from the fitting curve.
[0058] Specifically, the embodiment of the present invention performs spectral testing on test samples to which different doses of food additives are added, obtains spectral images of these samples, adopts a peak detection algorithm to determine the peak heights of target peaks corresponding to different doses of food additives, fits the peak heights with the corresponding contents of food additives, and obtains a linear relationship between the peak heights of the fitting curve and the corresponding food additives. After obtaining the peak heights of the target peaks in the fourth spectral image, the content of the food additives is directly deduced from the fitting curve.
[0059] The embodiment of the present invention obtains high-intensity characteristic peaks in the spectrum of food additives by analyzing the spectral images of food and the spectral images of food additives, and determines the recommendation degree of each characteristic peak as a detection feature for identifying the type of food additives, and determines whether the characteristic peak is used as a detection feature of food additives based on the recommendation degree. After determining the detection feature of the food additive, the food additives in the food sample to be detected are detected based on the detection feature. Therefore, the embodiment of the present invention does not need to decompose the sample, solves the problems caused by the destructive detection of food additives in the prior art, realizes non-destructive detection of food additives, and improves the accuracy and reliability of the detection results of food additives.
[0060] Embodiment 2: Corresponding to the food additive testing method based on spectral analysis provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides a food additive testing spectral image analysis system, which is used to execute the above food additive testing method based on spectral analysis. Figure 2 A schematic diagram of a food additive testing spectral image analysis system provided by an embodiment of the present invention is shown in FIG. Figure 2As shown. The food additive test spectral image analysis system 200 includes: an acquisition module 201, which is used to acquire a first spectral image of a pure sample without food additives, a second spectral image of an additive sample of food additives, and a third spectral image of an additive sample of other food additives; a determination module 202, which is used to determine an alternative peak that becomes a detection feature of food additives from a characteristic peak in the second spectral image, and to determine a first characteristic peak in the first spectral image and a second characteristic peak in the third spectral image; the determination module 202 is also used to determine a recommendation degree of an alternative peak according to a peak height of the first characteristic peak, a peak parameter of the alternative peak, and a peak height of the second characteristic peak, and to determine an alternative peak with a recommendation degree greater than a threshold as a target peak of a detection feature of food additives; a detection module 203, which is used to acquire a fourth spectral image of a food sample to be detected, and to detect food additives based on the target peak in the fourth spectral image, and food additives are added to the food sample to be detected.
[0061] The embodiment of the present invention obtains high-intensity characteristic peaks in the spectrum of food additives by analyzing the spectral images of food and the spectral images of food additives, and determines the recommendation degree of each characteristic peak as a detection feature for identifying the type of food additives, and determines whether the characteristic peak is used as a detection feature of food additives based on the recommendation degree. After determining the detection feature of the food additive, the food additives in the food sample to be detected are detected based on the detection feature. Therefore, the embodiment of the present invention does not need to decompose the sample, solves the problems caused by the destructive detection of food additives in the prior art, realizes non-destructive detection of food additives, and improves the accuracy and reliability of the detection results of food additives.
[0062] Embodiment three: Corresponding to the food additive testing method based on spectral analysis provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides a food additive testing spectral image analysis system, which is used to execute the above food additive testing method based on spectral analysis. Figure 3 A structural schematic diagram of a food additive testing spectral image analysis system provided by another embodiment of the present invention is shown in FIG. Figure 3 The food additive testing spectral image analysis system may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, the memory 302 is used to store computer programs that can be run on the processor 301, and the processor 301 is used to execute the program stored in the memory 302 to achieve the above Figure 1The memory 302 may be a temporary storage or a permanent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), each of which may include a series of computer executable instructions in the food additive test spectral image analysis system.
[0063] Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the food additive testing spectrum image analysis system. The food additive testing spectrum image analysis system can also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input and output interfaces 305, and one or more keyboards 306.
[0064] Specifically in this embodiment, the food additive test spectral image analysis system includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to achieve the above Figure 1 The various steps in the method embodiment are similar to those in the method embodiment, and have the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present invention will not be described in detail here.
[0065] It should be noted that the food additive testing spectral image analysis system provided in the embodiment of the present invention and the food additive testing method based on spectral analysis provided in the embodiment of the present invention are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned food additive testing method based on spectral analysis, and has the same or similar beneficial effects, and the repeated parts will not be repeated.
[0066] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0067] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A food additive testing method based on spectral analysis, characterized in that: Food additive testing methods based on spectral analysis include: Acquire a first spectral image of a pure sample without food additives, a second spectral image of an additive sample containing food additives, and a third spectral image of an additive sample containing other food additives; Determine a candidate peak that becomes a detection feature of the food additive from the characteristic peaks in the second spectral image, and determine a first characteristic peak in the first spectral image and a second characteristic peak in the third spectral image; Determine a first difference between the alternative peak and the first spectral image, and determine a second difference between the alternative peak and the third spectral image; determine an initial recommendation degree of the alternative peak as a detection feature based on the first difference, the second difference, and the peak height in the peak parameters of the alternative peak; determine the excellence of the alternative peak based on a first weight of the peak shape in the peak parameters of the alternative peak, a second weight of the peak signal-to-noise ratio in the peak parameters of the alternative peak, a half-width in the peak parameters of the alternative peak, a width difference between the leading edge and the trailing edge in the peak parameters of the alternative peak, and the peak signal-to-noise ratio; use the excellence degree to correct the initial recommendation degree to obtain a recommendation degree, and determine the alternative peak with a recommendation degree greater than a threshold as a target peak for the detection feature of the food additive; A fourth spectral image of the food sample to be detected is obtained, and food additives are detected based on a target peak in the fourth spectral image. Food additives are added to the food sample to be detected.
2. The food additive testing method based on spectral analysis according to claim 1, characterized in that: The step of determining a candidate peak that becomes a detection feature of the food additive from the characteristic peak in the second spectral image comprises: Using a peak detection algorithm to identify characteristic peaks in the second spectral image, and sorting the peak heights of the characteristic peaks in descending order; The first N peaks among the characteristic peaks sorted in descending order are selected as the candidate peaks, where N is a natural number greater than 1.
3. The food additive testing method based on spectral analysis according to claim 1, characterized in that: Determining a first difference between the candidate peak and the first spectral image includes: Selecting a first minimum value from the first distance between the candidate peak and the first characteristic peak, and determining a peak height of the first characteristic peak corresponding to the first minimum value; A first ratio between the first minimum value and a peak height of a first characteristic peak corresponding to the first minimum value is determined as the first difference.
4. The food additive testing method based on spectral analysis according to claim 1, characterized in that: Determining a second difference between the candidate peak and the third spectral image includes: Selecting a second minimum value from the second distance between the candidate peak and the second characteristic peak, and determining a peak height of the second characteristic peak corresponding to the second minimum value; A second ratio between the second minimum value and the peak height of a second characteristic peak corresponding to the second minimum value is determined as the second difference.
5. The food additive testing method based on spectral analysis according to claim 1, characterized in that: The method for obtaining the initial recommendation degree includes: Superimposing each of the second differences to obtain a superimposed difference; Calculating a first product of the superposition difference, the first difference, and a peak height in a peak parameter of the candidate peak; The first product is normalized to obtain the initial recommendation degree.
6. The food additive testing method based on spectral analysis according to claim 1, characterized in that: The method for obtaining the excellence level includes: Determining a first contribution of the peak shape to the data variability and a second contribution of the peak signal-to-noise ratio to the data variability based on a principal component analysis method; calculating a first sum value between the first contribution and the second contribution, determining a third ratio between the first contribution and the first sum value as the first weight, and determining a fourth ratio between the second contribution and the first sum value as the second weight; Calculating a second sum of a second product of the half-height width and the width difference and a predetermined value, and calculating a third product of the first weight and a reciprocal of the second sum; calculating a fourth product between the second weight and the peak signal-to-noise ratio, and calculating a third sum between the third product and the fourth product; The third sum is normalized to obtain the excellence level.
7. The food additive testing method based on spectral analysis according to claim 1, characterized in that: The method for obtaining the recommendation degree includes: calculating a fifth product between the excellence degree and the initial recommendation degree; The fifth product is normalized to obtain the recommendation degree.
8. The food additive testing method based on spectral analysis according to claim 1, characterized in that: The detecting of food additives based on the target peak in the fourth spectral image includes: The content of the food additive in the food sample to be tested is determined based on the peak height of the target peak and a fitting curve between the predetermined peak height and the additive content.
9. The food additive testing method based on spectral analysis according to claim 8, characterized in that: The determining the content of the food additive in the food sample to be tested based on the peak height of the target wave peak and a pre-determined fitting curve between the peak height and the additive content comprises: performing spectral testing on test samples to which different dosages of the food additive are added; Fitting the peak height of the target peak detected in each of the test samples with the content of the food additive added to the test sample to obtain the fitting curve; The content of the food additive corresponding to the peak height of the target peak of the food sample to be tested is determined from the fitting curve.