Edible fungus quality detection method based on spectral characteristics

By analyzing the spectral data of edible fungus samples at different ambient temperatures, a light intensity prediction model is constructed, which solves the problem of baseline drift and improves the accuracy of edible fungus quality detection.

CN118533816BActive Publication Date: 2024-09-13SHANDONG ACADEMY OF AGRICULTURAL SCIENCES
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411011354.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-09-13
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

In the quality inspection of edible fungi, the ambient temperature affects the electrical parameter performance of the Raman spectrum detection instrument, causing the light intensity of the light source to fluctuate, resulting in baseline drift and reducing the accuracy of the detection results.

Method used

By obtaining the original Raman spectrum data and light source light intensity sequence of edible fungus samples at different ambient temperatures, analyzing the similarities between the light source light intensity sequences, determining the reference light source light intensity sequence and light source fluctuation intensity, and constructing a Raman light intensity prediction model, calculate prediction weights, correct baseline drift effects, and obtain standard spectral data.

Benefits of technology

The accuracy and reliability of edible fungus quality detection results are improved, the interference of baseline drift on spectral analysis is reduced, and the numerical accuracy of detection is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118533816B
    Figure CN118533816B
Patent Text Reader

Abstract

The present invention relates to the technical field of analyzing materials using optical means, and specifically to a method for detecting the quality of edible fungi based on spectral characteristics, including: obtaining original Raman spectrum data of edible fungi samples at different ambient temperatures and a reference light source intensity sequence, determining the light source fluctuation intensity according to the reference light source intensity sequence; combining the light source fluctuation intensity and the original Raman spectrum data at different ambient temperatures, determining the prediction weight of each original Raman light intensity at each Raman shift, determining the standard spectrum Raman light intensity of each Raman shift according to the original Raman light intensity and its prediction weight, and then determining the standard Raman spectrum data; performing quality detection of edible fungi samples according to the standard Raman spectrum data. The present invention improves the detection accuracy of edible fungi quality detection by reducing the interference of baseline drift effect on Raman spectrum analysis of edible fungi samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of analyzing materials using optical means, and in particular to a method for detecting the quality of edible fungi based on spectral characteristics. Background Art

[0002] Edible fungi are a high-nutrition, low-calorie food with a wide range of consumer groups in the market. Through near-infrared spectroscopy analysis, the content of key components in edible fungi, such as protein, sugar, fat and trace elements, can be quickly obtained to evaluate the nutritional value and quality level of edible fungi, which helps producers and consumers understand the true quality of the product more quickly.

[0003] The existing method usually directly reads the Raman light intensity data of each characteristic band in the Raman spectrum of the edible fungus sample to determine the content of each component in the edible fungus sample. However, during the experimental process of spectral analysis of edible fungus samples, the ambient temperature will affect the electrical parameter performance inside the Raman spectroscopy detection instrument, which will cause the light intensity emitted by the light source of the Raman spectroscopy detection instrument to fluctuate. The fluctuation of light intensity will cause the baseline in the generated spectral data to shift, that is, the baseline drift phenomenon will occur, resulting in deviations in the authenticity of the spectral data used to analyze the content of key components, further causing the edible fungus quality detection results determined by the Raman spectroscopy data to be inaccurate. Summary of the invention

[0004] In order to solve the above-mentioned technical problem of low accuracy of edible fungus quality detection results, the purpose of the present invention is to provide an edible fungus quality detection method based on spectral characteristics, and the technical scheme adopted is as follows:

[0005] An embodiment of the present invention provides a method for detecting the quality of edible fungi based on spectral characteristics, the method comprising the following steps:

[0006] Obtaining original Raman spectrum data of edible fungi samples at different ambient temperatures, and several light intensity sequences of light sources at different ambient temperatures; wherein the horizontal axis of the original Raman spectrum data is Raman shift, and the vertical axis is original Raman light intensity;

[0007] Analyze the similarity between the light intensity sequences of the light sources according to the light intensity sequences of the light sources at each ambient temperature, and determine the light intensity sequence of the reference light source at each ambient temperature;

[0008] Analyze the fluctuation of the reference light source intensity sequence according to the reference light source intensity sequence at each ambient temperature, and determine the light source fluctuation intensity corresponding to each reference light source intensity sequence;

[0009] Relative to any Raman shift within the spectral detection range, obtain the original Raman light intensity at the Raman shift corresponding to the ambient temperature of each reference light source light intensity sequence; determine the prediction weight of each original Raman light intensities at the Raman shift according to the fluctuation intensity of each light source and each original Raman light intensities;

[0010] According to each original Raman light intensity at each Raman shift and its predicted weight, the standard spectral Raman light intensity of each Raman shift is determined, and then the standard Raman spectral data is determined;

[0011] The quality of edible fungi samples was tested based on standard Raman spectroscopy data.

[0012] Further, the similarity between light source intensity sequences is analyzed according to the light source intensity sequences of each light source at each ambient temperature to determine the reference light source intensity sequence at each ambient temperature, including:

[0013] According to the light intensity of the target light source at the same ambient temperature and the light intensity of each non-target light source at each moment in the light intensity sequence of each non-target light source, the light intensity difference of the light source at the same moment is analyzed to determine the preferred index of the target light source at each ambient temperature; wherein the target light source is any light source at the ambient temperature.

[0014] The preferred index of each light source intensity sequence under each ambient temperature is obtained, and then the light source intensity sequence corresponding to the maximum preferred index under each ambient temperature is determined, and the light source intensity sequence is used as the reference light source intensity sequence.

[0015] Further, the light intensity of the target light source at the same ambient temperature and each non-target light source at each moment in the light intensity sequence of the light source are analyzed to determine the preferred index of the light intensity sequence of the target light source at each ambient temperature, including:

[0016] First, calculate the difference between the light intensity of the target light source at each moment in the light intensity sequence of the target light source at the same ambient temperature and the light intensity of the light source at the corresponding moment in the light intensity sequence of each non-target light source, and record it as the light intensity difference value of the light source;

[0017] Then, the average value of the light intensity difference values ​​of all light sources under the same ambient temperature is calculated, and negative correlation processing is performed on the average value of the light intensity difference values ​​of the light sources to obtain the optimal index of the target light source light intensity sequence under each ambient temperature.

[0018] Further, analyzing the fluctuation of the reference light source light intensity sequence according to the reference light source light intensity sequence at each ambient temperature to determine the light source fluctuation intensity corresponding to each reference light source light intensity sequence includes:

[0019] For any reference light source intensity sequence, determine each local extreme point corresponding to the reference light source intensity sequence, and determine the light source intensity mean corresponding to the reference light source intensity sequence;

[0020] According to the difference between each local extreme point and the mean value of the light intensity of the light source, the light source fluctuation intensity corresponding to the reference light source light intensity sequence is determined.

[0021] Furthermore, determining the light source fluctuation intensity corresponding to the reference light source light intensity sequence according to the difference between each local extreme point and the light source light intensity mean value includes:

[0022] Calculate the absolute value of the difference between each local extreme point and the mean light intensity of the light source, and take the average of all the absolute values ​​of the difference as the initial light source fluctuation intensity;

[0023] The initial light source fluctuation intensity is normalized, and the normalized result value is used as the light source fluctuation intensity corresponding to the reference light source light intensity sequence.

[0024] Furthermore, the step of determining the prediction weights of the original Raman light intensities at the Raman shift according to the fluctuation intensities of the light sources and the original Raman light intensities includes:

[0025] Combining the fluctuation intensity of each light source and each original Raman light intensity, a Raman light intensity prediction model at the Raman shift is constructed;

[0026] According to the clustering of all data points in the Raman light intensity prediction model and the light source fluctuation intensity of each data point, the prediction weights of each original Raman light intensity at the Raman shift are determined.

[0027] Furthermore, the method of combining the fluctuation intensity of each light source and each original Raman light intensity to construct a Raman light intensity prediction model at the Raman shift includes:

[0028] A coordinate system is established with the fluctuation intensity of each light source as the horizontal coordinate and the original Raman light intensity as the vertical coordinate;

[0029] Interpolation processing is performed on each data point on the coordinate system, and the coordinate system after the interpolation processing is used as the Raman light intensity prediction model at the Raman shift.

[0030] Furthermore, the prediction weights of the original Raman light intensities at the Raman shift are determined according to the clustering of all data points in the Raman light intensity prediction model and the light source fluctuation intensity of each data point, including:

[0031] All data points in the Raman light intensity prediction model are clustered to obtain clusters, and then the negative correlation value of the number of data points in each cluster is determined; the negative correlation value is used as the confidence factor of each data point in the cluster to which it belongs;

[0032] The product of the confidence factor of each data point and the light source fluctuation intensity of the corresponding data point is calculated and recorded as the first product; the first product is negatively correlated and normalized, and the normalized result value is used as the prediction weight of the original Raman light intensity of the corresponding data point.

[0033] Furthermore, determining the standard spectral Raman intensity of each Raman shift according to each original Raman intensity at each Raman shift and its predicted weight includes:

[0034] The predicted weights are used to perform weighted averaging processing on the original Raman intensities at any Raman shift, and the result value after the weighted averaging processing is used as the standard spectral Raman intensity of the Raman shift.

[0035] Furthermore, the quality detection of the edible fungus sample according to the standard Raman spectroscopy data includes:

[0036] Perform feature analysis on standard Raman spectral data to determine the content of each type of element in edible fungi samples;

[0037] The quality test results of the edible fungus samples are determined based on the content of each type of element in the edible fungus samples.

[0038] The present invention has the following beneficial effects:

[0039] The present invention provides a method for detecting the quality of edible fungi based on spectral characteristics. The method predicts the standard Raman intensity value when there is no baseline drift effect according to the Raman intensity characteristics under the change of light source light intensity, realizes the correction of the baseline drift effect in the spectral data, and helps to improve the accuracy of the edible fungi quality detection results. First, by analyzing the similarity between the light intensity sequences of each light source under the same ambient temperature, the light intensity sequence of the light source only affected by the ambient temperature is selected, that is, the reference light intensity sequence of the light source, which helps to improve the numerical accuracy and reliability of the analysis data, and further improves the reference value of the light source fluctuation intensity determined based on the reference light source light intensity sequence; secondly, combining the light source fluctuation intensity and the original Raman intensity corresponding to each reference light source light intensity sequence, the prediction weight of each original Raman intensity at each Raman shift is determined, and by analyzing the influence of the original Raman intensity on the light source fluctuation intensity, the weight of a single original Raman intensity in the quantified standard Raman intensity is predicted, and the standard spectral Raman intensity is determined, which can reduce the interference of the baseline drift effect on the spectral analysis, thereby improving the detection accuracy of the edible fungi quality detection based on spectral characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] 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.

[0041] Figure 1 This is a schematic diagram of a process of a method for detecting quality of edible fungi based on spectral features according to an embodiment of the present invention;

[0042] Figure 2 Schematic diagram of the process of step S2 in an embodiment of the present invention;

[0043] Figure 3 Schematic diagram of the process of step S3 in an embodiment of the present invention;

[0044] Figure 4 Schematic diagram of the process of step S4 in the embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below 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, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0046] 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.

[0047] The application scenarios targeted by the present invention may be:

[0048] When the quality of edible fungi is detected by Raman spectroscopy, the ambient temperature may cause a baseline drift effect in the spectral data, thereby affecting the accuracy of spectral technology in detecting the quality of edible fungi. Therefore, the present invention corrects the baseline drift effect in the spectral data in combination with data characteristics to obtain standard spectral data results.

[0049] This embodiment provides a method for detecting the quality of edible fungi based on spectral characteristics. Figure 1 As shown, the following steps are included:

[0050] S1, obtaining Raman spectrum data of edible fungi samples at different ambient temperatures, and several light intensity sequences of light sources at different ambient temperatures.

[0051] The above step S1 can be implemented by the following steps:

[0052] The first step is to obtain edible fungus samples.

[0053] Specifically, during the test, the mushroom flesh with a strong umami flavor was sliced ​​by hand, and the deionized water used to make the water slide was replaced with silver colloid to make the silver colloid slide for later use. The silver colloid was prepared by microwave method.

[0054] The second step is to obtain the original Raman spectrum data of the edible fungus samples at different ambient temperatures, as well as several light intensity sequences of light sources at different ambient temperatures.

[0055] It should be noted that it is necessary to predict the standard Raman light intensity of the standard Raman spectral data according to the changes in the light intensity of different light sources. However, the main factor causing the change in the light intensity of the light source is the change in ambient temperature. Therefore, the ambient temperature during measurement is set as the dependent variable, and the Raman spectral data and light intensity data of the edible fungi samples under different ambient temperature conditions are collected.

[0056] Specifically, the Raman spectral data corresponding to the edible fungi samples at 15 different ambient temperatures were collected respectively. In order to distinguish the Raman spectral data before and after correction, they were recorded as original Raman spectral data. The horizontal axis of the original Raman spectral data was Raman shift, and the vertical axis was original Raman light intensity. The measuring instrument used in measuring the spectral data was a DXR laser confocal microscope Raman spectrometer. The excitation wavelength used by the spectrometer was 532nm, the measurement power was 1mW, the exposure time of sample 1 was 3s, and the sample was exposed twice continuously. The magnification of the microscope objective lens was 10 when the Raman spectral measurement was performed.

[0057] Since it is necessary to analyze the changes in the light intensity of the light source, while collecting the spectral data under different ambient temperature conditions, a light intensity sensor is used to collect the light intensity data of the light source emission port of the Raman spectrum detection instrument under different ambient temperature conditions, that is, to collect the light intensity of the light source. Because the light intensity is also slightly affected by impurities in the air, multiple sets of data are obtained for the light intensity data of the light source emission port of the Raman spectrum detection instrument under each ambient temperature condition, that is, one ambient temperature corresponds to multiple light source light intensity sequences, and the number of light source light intensity sequences can be taken as an empirical value of 6. The collected data is uploaded to the computer for subsequent analysis. Among them, the number of types of ambient temperature and light source light intensity sequences can be set by the implementer according to the specific actual situation, without specific limitation.

[0058] So far, this embodiment has obtained the original Raman spectrum data of the edible fungus samples at different ambient temperatures, and several light intensity sequences of light sources at different ambient temperatures.

[0059] S2, analyzing similarities between light source intensity sequences according to the light source intensity sequences at each ambient temperature, and determining a reference light source intensity sequence at each ambient temperature.

[0060] First of all, it should be noted that in the process of Raman spectrometer collecting spectra of edible fungi samples, inappropriate ambient temperature affects the internal electrical properties of the Raman spectrometer when it is working, which in turn causes the light intensity of the light source of the Raman spectrometer to change when it is working. The change in the light intensity of the light source causes errors in the Raman light intensity in the spectrum, resulting in baseline drift, which in turn leads to low accuracy of the edible fungi quality results detected by Raman spectroscopy technology.

[0061] In order to correct the influence of baseline drift on Raman spectral data, it is necessary to analyze the spectral features corresponding to the changes in the light intensity data of the light source. Specifically, first, through the similar features between the light intensity data of the Raman spectroscopy instrument measured multiple times at different ambient temperatures, a light intensity sequence of the light source that is only affected by the ambient temperature is selected for each ambient temperature as much as possible, that is, compared with other light intensity sequences of the light source at the same ambient temperature, the selected light intensity sequence of the light source is least affected by impurities in the air. Among them, impurities in the air affect the uniformity of the medium in the propagation path of the light source, which in turn causes the change of light intensity to be slightly affected.

[0062] The above step S2 can be Figure 2 The steps shown achieve:

[0063] S21, according to the light intensity of the target light source at the same ambient temperature and the light intensity of each non-target light source at each moment in the light intensity sequence of each light source, analyze the light intensity difference of the light source at the same moment, and determine the preferred index of the target light source at each ambient temperature.

[0064] In this embodiment, the target light source light intensity sequence refers to any light source light intensity sequence under the ambient temperature, and the non-target light source light intensity sequence refers to other light source light intensity sequences except the target light source light intensity sequence under the same ambient temperature. Each light source light intensity sequence under an ambient temperature must be subjected to similarity analysis with the remaining light source light intensity sequences except itself. In order to facilitate the understanding of the scheme and reduce unnecessary descriptions, this embodiment takes the target light source light intensity sequence as an example to determine the preferred index of the target light source light intensity sequence. The preferred index is used to evaluate the possibility of the light source light intensity sequence being selected as the reference light source light intensity sequence.

[0065] As an example, the above step S21 may be implemented by the following steps:

[0066] In the first step, the difference between the light intensity of the target light source at each moment in the light intensity sequence of the target light source under the same ambient temperature and the light intensity of the non-target light source at the corresponding moment in the light intensity sequence of the non-target light source is calculated, and recorded as the light intensity difference value.

[0067] In the second step, the average value of the light intensity difference values ​​of all light sources under the same ambient temperature is calculated, and the average value of the light intensity difference values ​​of the light sources is negatively correlated to obtain the optimal index of the target light source light intensity sequence under each ambient temperature.

[0068] The calculation formula for the optimal index of the jth light source intensity sequence at the i-th ambient temperature can be:

[0069] ; In the formula, represents the preferred index of the jth light source intensity sequence under the i-th ambient temperature, exp represents the exponential function with the natural constant as the base, M represents the number of light source intensity sequences corresponding to each ambient temperature, T represents the number of moments in the light source intensity sequence, that is, the collection duration of each group of light source intensity, x represents the sequence number of the light source intensity sequence corresponding to each ambient temperature, t represents the sequence number of the moment in the light source intensity sequence, It represents the absolute value of the difference between the light intensity of the light source at the tth moment in the jth light source light intensity sequence at the ith ambient temperature and the light intensity of the light source at the tth moment in the xth light source light intensity sequence excluding the jth light source light intensity sequence at the ith ambient temperature, that is, the light source light intensity difference value.

[0070] In the calculation formula of the optimal index, The smaller the preference index is, the better the similarity between the light intensity sequence of the j-th light source at the i-th ambient temperature and the light intensity sequences of other light sources under the same ambient temperature conditions; the larger the preference index is, the greater the possibility that the light intensity sequence of the j-th light source at the i-th ambient temperature will be selected as the reference light intensity sequence of the light source at the i-th ambient temperature.

[0071] In another example, the above step S21 can also be implemented by the following steps:

[0072] Specifically, the DTW (Dynamic Time Warping) distance between the target light source intensity sequence and each non-target light source intensity sequence under the same ambient temperature is calculated, and then the average value of all DTW distances corresponding to the target light source intensity sequence is calculated, and the average value of all DTW distances is negatively correlated, and the result value after negative correlation processing is used as the preferred indicator of the target light source intensity sequence.

[0073] The calculation formula for the preferred index of the j-th light source intensity sequence at the i-th ambient temperature can also be:

[0074] ; In the formula, DTW represents the function of finding the distance between two sequences, represents the light intensity sequence of the jth light source at the i-th ambient temperature, represents the light intensity sequence of the xth light source at the ith ambient temperature, .

[0075] S22, obtaining the preferred index of each light source intensity sequence at each ambient temperature, and then determining the light source intensity sequence corresponding to the maximum preferred index at each ambient temperature, and using it as the reference light source intensity sequence.

[0076] In this embodiment, the larger the preferred index is, the greater the influence of the corresponding light source intensity sequence on the ambient temperature is, and the greater the possibility of it being selected as the reference light source intensity sequence is.

[0077] Specifically, by referring to the calculation process of the preferred index of the target light source light intensity sequence, the preferred index of each light source light intensity sequence at each ambient temperature can be obtained, the maximum preferred index corresponding to each ambient temperature can be determined, and the light source light intensity sequence corresponding to the maximum preferred index can be used as the reference light source light intensity sequence at the corresponding ambient temperature.

[0078] So far, this embodiment has obtained the light intensity sequence of the reference light source at each ambient temperature.

[0079] S3, analyzing the fluctuation of the reference light source intensity sequence according to the reference light source intensity sequence at each ambient temperature, and determining the light source fluctuation intensity corresponding to each reference light source intensity sequence.

[0080] First of all, it should be noted that the light source fluctuation intensity represents the degree of fluctuation of the light source intensity in the reference light source intensity sequence, which can reflect the degree of trustworthiness of the original Raman spectral data at the ambient temperature corresponding to the reference light source intensity sequence, and is used to subsequently determine the prediction weight, thereby overcoming the influence of the baseline offset of the Raman spectral data; the greater the light source fluctuation intensity, the more the internal electrical performance of the Raman spectral instrument is affected when it is working, further indicating that the greater the fluctuation in the light intensity data of the light source of the Raman spectral instrument when it is working.

[0081] The above step S3 can be Figure 3 The steps shown achieve:

[0082] S31, for any reference light source light intensity sequence, determine each local extreme point corresponding to the reference light source light intensity sequence, and determine the light source light intensity mean corresponding to the reference light source light intensity sequence.

[0083] In this embodiment, in order to reduce unnecessary descriptions and facilitate understanding of the solution, a reference light source intensity sequence at an ambient temperature is arbitrarily selected, and the fluctuation of the reference light source intensity sequence is analyzed. When determining each local extreme point corresponding to the reference light source intensity sequence, the reference light source intensity sequence is first curve fitted using the least squares method, and each extreme point is determined on the fitting curve as the local extreme point.

[0084] The implementation process of the least square method is prior art and is not within the scope of the present invention and will not be elaborated in detail. Of course, the implementer may also use other methods to determine the local extreme point, which is not specifically limited here.

[0085] S32, determining the light source fluctuation intensity corresponding to the reference light source light intensity sequence according to the difference between each local extreme point and the mean light source light intensity.

[0086] The above step S32 can be implemented by the following steps:

[0087] The first step is to calculate the absolute value of the difference between each local extreme point and the mean light intensity of the light source, and take the average of all the absolute values ​​of the difference as the initial light source fluctuation intensity.

[0088] The second step is to normalize the initial light source fluctuation intensity, and use the normalized result value as the light source fluctuation intensity corresponding to the reference light source light intensity sequence.

[0089] As an example, the calculation formula for the light source fluctuation intensity corresponding to the reference light source light intensity sequence at the i-th ambient temperature may be:

[0090] ; In the formula, represents the light source fluctuation intensity corresponding to the reference light source light intensity sequence at the i-th ambient temperature, norm represents the linear normalization function, represents the number of local extreme value points in the light intensity sequence of the reference light source at the i-th ambient temperature, y represents the sequence number of the local extreme value point in the light intensity sequence of the reference light source at the i-th ambient temperature, represents the light intensity of the yth local extreme point in the light intensity sequence of the reference light source at the ith ambient temperature, represents the mean light intensity of the reference light source corresponding to the light intensity sequence of the i-th ambient temperature, represents the absolute value function, Indicates the initial light source fluctuation intensity.

[0091] In the calculation formula of the light source fluctuation intensity, The larger it is, the greater the light source intensity fluctuation intensity of the reference light source light intensity sequence at the ith ambient temperature, which further indicates that the reliability of the original Raman spectrum data at the ith ambient temperature is lower; in order to facilitate the light source fluctuation intensity to participate in the subsequent prediction weight calculation process, it is necessary to ensure the standardization of the light source fluctuation intensity, that is, to limit the value range of the light source fluctuation intensity to between 0 and 1.

[0092] It is worth noting that compared with calculating the degree of sequence fluctuation by calculating the variance or standard deviation, the above-mentioned calculation formula for the light source fluctuation intensity can better reflect non-normally distributed data, is more sensitive to outliers and is suitable for fluctuation analysis of different scales. The numerical accuracy of the light source fluctuation intensity determined in this way is higher, which helps to further improve the data quality of standard Raman spectroscopy data.

[0093] So far, this embodiment has obtained the light source fluctuation intensity corresponding to each reference light source light intensity sequence, that is, the light source fluctuation intensity corresponding to the reference light source light intensity sequence at each ambient temperature.

[0094] S4, relative to any Raman shift within the spectral detection range, determining the prediction weights of the original Raman light intensities at the Raman shift according to the fluctuation intensities of the light sources and the original Raman light intensities.

[0095] First of all, it should be noted that the spectral detection range is the spectral detection range of the edible fungus sample. The Raman shift of the horizontal axis in the original Raman spectral data under different temperature environments is the same, but the Raman intensity is different; in order to determine the standard Raman intensity of each Raman shift, it is necessary to analyze the influence of the light source fluctuation intensity under different ambient temperatures on the original Raman intensity, that is, to quantify the prediction weight of each original Raman intensity. Among them, the prediction weight refers to the weight occupied by the original Raman intensity at different ambient temperatures at the same Raman shift when quantifying the standard Raman intensity, and the standard Raman intensity is the Raman intensity with zero light source fluctuation intensity that is not affected by the ambient temperature.

[0096] The above step S4 can be performed by Figure 4 The steps shown achieve:

[0097] S41, relative to any Raman shift within the spectral detection range, obtaining the original Raman light intensity at the Raman shift corresponding to the ambient temperature of each reference light source light intensity sequence.

[0098] In this embodiment, each reference light source light intensity sequence is a reference light source light intensity sequence at each ambient temperature, and the original Raman light intensity in the original Raman spectrum data of the same Raman shift at different ambient temperatures is obtained. In order to ensure that the light source fluctuation intensity is compared with the original Raman light intensity, each reference light source light intensity sequence is taken as the main body, and the original Raman light intensity at the Raman shift in the original Raman spectrum data at the ambient temperature corresponding to each reference light source light intensity sequence is determined to obtain each original Raman light intensities corresponding to the Raman shift.

[0099] S42, constructing a Raman light intensity prediction model at the Raman shift by combining the fluctuation intensity of each light source and each original Raman light intensity.

[0100] In this embodiment, each Raman shift has its corresponding Raman light intensity prediction model, which is used to predict the standard Raman light intensity of the corresponding Raman shift. The Raman light intensity prediction model consists of two parts, namely, the light source fluctuation intensity corresponding to each reference light source light intensity sequence and the original Raman light intensity at the Raman shift under the ambient temperature corresponding to each reference light source light intensity sequence.

[0101] The above step S42 can be implemented by the following steps:

[0102] The first step is to establish a coordinate system with the fluctuation intensity of each light source as the horizontal coordinate and the original Raman light intensity as the vertical coordinate.

[0103] Specifically, a two-dimensional coordinate system is established, where the horizontal axis is the light source fluctuation intensity and the vertical axis is the original Raman light intensity, and the position of the data point consisting of the light source fluctuation intensity and the original Raman light intensity corresponding to each reference light source light intensity sequence is determined on the two-dimensional coordinate system.

[0104] The second step is to perform interpolation processing on each data point on the coordinate system, and use the interpolated coordinate system as the Raman light intensity prediction model at the Raman shift.

[0105] It should be noted that the horizontal coordinate light source fluctuation intensity of each data point is not necessarily an arithmetic progression, that is, the horizontal coordinate difference between two adjacent data points is not necessarily equal. In order to ensure that the prediction result of the Raman light intensity prediction model is more accurate, it is necessary to interpolate each data point on the coordinate system, that is, use interpolation technology to ensure that the distance between each adjacent point after interpolation is equal. Among them, the implementation process of the interpolation technology is a prior art and is not within the protection scope of the present invention, and will not be elaborated here.

[0106] Specifically, a suitable spacing is selected to ensure that the distances between adjacent points after interpolation are equal and the number of interpolation points is as small as possible. At the same time, the interpolation ordinate is obtained by the nearest data points on the left and right sides according to the corresponding proportional relationship, that is, the interpolation point and the nearest data points on the left and right sides satisfy the three points collinearity.

[0107] S43, determining the prediction weights of the original Raman light intensities at the Raman shift according to the clustering of all data points in the Raman light intensity prediction model and the light source fluctuation intensity of each data point.

[0108] In this embodiment, the degree of aggregation of all data points in the Raman light intensity prediction model is further analyzed. When the aggregation of a data point on the model is better, it means that the probability that the original Raman light intensity in the Raman spectrum data changes less when the light source light intensity of the data point changes is higher, the reference degree of the data point in determining the standard Raman light intensity is higher, and the prediction weight of the data point is greater. Based on the above prediction weight analysis logic, the prediction weight of each original Raman light intensity at the Raman shift is determined by the Raman light intensity prediction model.

[0109] The above step S43 can be implemented by the following steps:

[0110] In the first step, all data points in the Raman light intensity prediction model are clustered to obtain clusters, and then the negative correlation value of the number of data points in each cluster is determined; the negative correlation value is used as the confidence factor of each data point in the cluster to which it belongs.

[0111] Specifically, all data points in the Raman light intensity prediction model of the Raman shift are subjected to DBSCAN (Density-based spatial clustering of applications with noise) density clustering processing to obtain clusters; the number of data points in each cluster is counted, and the number of data points in the cluster is negatively correlated, and the obtained negative correlation value is used as the confidence factor of each data point in the corresponding cluster, and the confidence factors of each data point in the same cluster are the same.

[0112] Among them, the ε (eps) parameter in the DBSCAN density clustering algorithm can be set to 5, and the MinPts parameter can also be set to 5. The implementer can set the size of the two parameters in the clustering algorithm according to the specific actual situation; the DBSCAN density clustering algorithm is a prior art and is not within the protection scope of the present invention, and will not be elaborated here.

[0113] For example, when performing negative correlation processing on the number of data points in the cluster, the inverse of the number can be used as the negative correlation value, that is, to determine the confidence factor. The smaller the confidence factor, the smaller the possibility that the change in the light intensity of the light source corresponding to the data point in the Raman light intensity prediction model corresponding to the Raman shift will cause the Raman spectrum data to change.

[0114] In the second step, the product of the confidence factor of each data point and the light source fluctuation intensity of the corresponding data point is calculated, which is recorded as the first product; the first product is negatively normalized and the normalized result value is used as the prediction weight of the original Raman light intensity of the corresponding data point.

[0115] As an example, the calculation formula for the prediction weight of the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k can be:

[0116] ; In the formula, represents the prediction weight of the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k, exp represents the exponential function with the natural constant as the base, Indicates the number of data points in the cluster to which the rth data point belongs in the Raman intensity prediction model when the Raman shift is k. represents the confidence factor of the rth data point in the Raman intensity prediction model when the Raman shift is k, represents the light source fluctuation intensity of the rth data point in the Raman light intensity prediction model when the Raman shift is k, Represents the first product of the rth data point in the Raman intensity prediction model when the Raman shift is k.

[0117] In the calculation formula of prediction weight, is the base value of the prediction weight, The larger it is, the greater the influence of the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k on the light source intensity fluctuation is, and the smaller the weight of the rth data point in predicting the standard Raman intensity is. The smaller it is, the better the reliability of the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k, and the greater the prediction weight of the original Raman intensity of the rth data point; exp (-) represents the normalization processing of negative correlation. There are original Raman spectral intensities with different degrees of influence in a Raman shift Raman intensity prediction model. In order to facilitate the subsequent implementation of standard Raman intensity prediction, the value range of the prediction weight needs to be limited to between 0 and 1;

[0118] So far, this embodiment refers to the calculation process of the prediction weights of each original Raman light intensity when the Raman shift is k, and can obtain the prediction weights of each original Raman light intensity at each Raman shift.

[0119] S5, determining the standard spectrum Raman intensity of each Raman shift according to each original Raman light intensity at each Raman shift and its predicted weight, and further determining the standard Raman spectrum data.

[0120] First of all, it should be noted that after obtaining each original Raman intensity at each Raman shift and its predicted weight, the standard spectral Raman intensity at each Raman shift is quantified by combining the original Raman intensity and the predicted weight of the original Raman intensity. The standard spectral Raman intensity is the Raman intensity when the light source fluctuation intensity is zero in the Raman intensity prediction model, that is, the spectral Raman intensity when the Raman shift is k after reducing the influence of the baseline drift effect.

[0121] Specifically, the prediction weights are used to perform weighted averaging processing on the original Raman intensities at any Raman shift, and the result value after the weighted averaging processing is used as the standard spectral Raman intensity of the Raman shift.

[0122] As an example, the calculation formula of the standard spectrum Raman intensity when the Raman shift is k can be:

[0123] ; In the formula, represents the standard spectral Raman intensity when the Raman shift is k, represents the number of data points in the Raman intensity prediction model when the Raman shift is k, r represents the sequence number of the data point in the Raman intensity prediction model, represents the prediction weight of the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k, Represents the original Raman intensity of the rth data point in the Raman intensity prediction model when the Raman shift is k.

[0124] Finally, by referring to the calculation process of the standard spectrum Raman intensity when the Raman shift is k, the standard spectrum Raman intensity of each Raman shift can be obtained; the Raman spectrum data composed of each Raman shift and its standard spectrum Raman intensity are used as standard Raman spectrum data.

[0125] So far, this embodiment has obtained the standard Raman spectrum data of the edible fungus sample.

[0126] S6, performing quality detection of edible fungus samples according to standard Raman spectroscopy data.

[0127] Specifically, characteristic analysis is performed on standard Raman spectral data to determine the content of each type of element in the edible fungus sample; and the quality test result of the edible fungus sample is determined based on the content of each type of element in the edible fungus sample.

[0128] In this embodiment, the standard Raman spectral data is the Raman spectral data after correcting the baseline drift effect. First, the standard Raman light intensity of each band of the edible fungus sample is characteristically analyzed according to actual needs, thereby reflecting the content of protein, carbohydrates, fat and trace elements in the edible fungus sample; secondly, the quality level of the edible fungus is detected according to the degree of deviation between the actual content of each component in the edible fungus sample and the standard content, thereby realizing a more accurate edible fungus quality detection method based on spectral feature analysis.

[0129] For example, the protein standard for King Oyster Mushroom is that the protein content accounts for 14% to 18% of the dry mass of its fruiting body. The greater the deviation between the protein content in the King Oyster Mushroom sample and the standard content level, the worse the quality of the protein content in the King Oyster Mushroom sample. The same applies to the quality inspection of the content of other components in King Oyster Mushroom, and the same applies to other varieties of edible fungi.

[0130] The present invention provides a method for detecting the quality of edible fungi based on spectral characteristics. The method predicts the standard Raman light intensity value when there is no baseline drift effect according to the Raman light intensity characteristics under the change of light intensity of the light source, thereby realizing the correction of the baseline drift effect in the original Raman spectrum data of the edible fungi sample. The edible fungi quality detection result determined based on the standard Raman spectrum data has higher accuracy.

[0131] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for detecting the quality of edible fungi based on spectral characteristics. It is characterized in that The following steps are involved: Obtaining original Raman spectrum data of edible fungi samples at different ambient temperatures, and several light intensity sequences of light sources at different ambient temperatures; wherein the horizontal axis of the original Raman spectrum data is Raman shift, and the vertical axis is original Raman light intensity; Analyze the similarity between the light intensity sequences of the light sources according to the light intensity sequences of the light sources at each ambient temperature, and determine the light intensity sequence of the reference light source at each ambient temperature; Analyze the fluctuation of the reference light source intensity sequence according to the reference light source intensity sequence at each ambient temperature, and determine the light source fluctuation intensity corresponding to each reference light source intensity sequence; Relative to any Raman shift within the spectral detection range, obtain the original Raman light intensity at the Raman shift corresponding to the ambient temperature of each reference light source light intensity sequence; determine the prediction weight of each original Raman light intensities at the Raman shift according to the fluctuation intensity of each light source and each original Raman light intensities; According to each original Raman light intensity at each Raman shift and its predicted weight, the standard spectral Raman light intensity of each Raman shift is determined, and then the standard Raman spectral data is determined; Quality testing of edible fungi samples based on standard Raman spectroscopy data; The step of analyzing similarities between light source intensity sequences according to the light source intensity sequences of each light source at each ambient temperature to determine a reference light source intensity sequence at each ambient temperature includes: According to the light intensity of the target light source at the same ambient temperature and the light intensity of each non-target light source at each moment in the light intensity sequence of each non-target light source, the light intensity difference of the light source at the same moment is analyzed to determine the preferred index of the target light source at each ambient temperature; wherein the target light source is any light source at the ambient temperature. Obtaining the preferred index of each light source light intensity sequence at each ambient temperature, and then determining the light source light intensity sequence corresponding to the maximum preferred index at each ambient temperature, and using it as the reference light source light intensity sequence; The step of analyzing the fluctuation of the reference light source light intensity sequence according to the reference light source light intensity sequence at each ambient temperature to determine the light source fluctuation intensity corresponding to each reference light source light intensity sequence includes: For any reference light source intensity sequence, determine each local extreme point corresponding to the reference light source intensity sequence, and determine the light source intensity mean corresponding to the reference light source intensity sequence; According to the difference between each local extreme point and the mean light intensity of the light source, the light source fluctuation intensity corresponding to the reference light source light intensity sequence is determined; The step of determining the prediction weights of the original Raman light intensities at the Raman shift according to the fluctuation intensities of the light sources and the original Raman light intensities comprises: Combining the fluctuation intensity of each light source and each original Raman light intensity, a Raman light intensity prediction model at the Raman shift is constructed; According to the clustering of all data points in the Raman light intensity prediction model and the light source fluctuation intensity of each data point, the prediction weight of each original Raman light intensity at the Raman shift is determined; The method of combining the fluctuation intensity of each light source and each original Raman light intensity to construct a Raman light intensity prediction model at the Raman shift position includes: A coordinate system is established with the fluctuation intensity of each light source as the horizontal coordinate and the original Raman light intensity as the vertical coordinate; Performing interpolation processing on each data point on the coordinate system, and using the interpolated coordinate system as a Raman light intensity prediction model at the Raman shift; The method of determining the prediction weights of the original Raman light intensities at the Raman shift according to the clustering of all data points in the Raman light intensity prediction model and the light source fluctuation intensity of each data point comprises: All data points in the Raman light intensity prediction model are clustered to obtain clusters, and then the negative correlation value of the number of data points in each cluster is determined; the negative correlation value is used as the confidence factor of each data point in the cluster to which it belongs; The product of the confidence factor of each data point and the light source fluctuation intensity of the corresponding data point is calculated and recorded as the first product; the first product is negatively correlated and normalized, and the normalized result value is used as the prediction weight of the original Raman light intensity of the corresponding data point.

2. The edible fungus quality detection method based on spectral characteristics according to claim 1, It is characterized in that The method of analyzing the light intensity difference of the light sources at the same moment according to the light intensity sequence of the target light source and each non-target light source at the same ambient temperature to determine the preferred index of the light intensity sequence of the target light source at each ambient temperature includes: First, calculate the difference between the light intensity of the target light source at each moment in the light intensity sequence of the target light source at the same ambient temperature and the light intensity of the light source at the corresponding moment in the light intensity sequence of each non-target light source, and record it as the light intensity difference value of the light source; Then, the average value of the light intensity difference values ​​of all light sources under the same ambient temperature is calculated, and negative correlation processing is performed on the average value of the light intensity difference values ​​of the light sources to obtain the optimal index of the target light source light intensity sequence under each ambient temperature.

3. The edible fungus quality detection method based on spectral characteristics according to claim 1, It is characterized in that The step of determining the light source fluctuation intensity corresponding to the reference light source light intensity sequence according to the difference between each local extreme point and the light source light intensity mean value includes: Calculate the absolute value of the difference between each local extreme point and the mean light intensity of the light source, and take the average of all the absolute values ​​of the difference as the initial light source fluctuation intensity; The initial light source fluctuation intensity is normalized, and the normalized result value is used as the light source fluctuation intensity corresponding to the reference light source light intensity sequence.

4. The edible fungus quality detection method based on spectral characteristics according to claim 1, It is characterized in that Determining the standard spectral Raman intensity of each Raman shift according to each original Raman intensity at each Raman shift and its predicted weight includes: The predicted weights are used to perform weighted averaging processing on the original Raman intensities at any Raman shift, and the result value after the weighted averaging processing is used as the standard spectral Raman intensity of the Raman shift.

5. The edible fungus quality detection method based on spectral characteristics according to claim 1, It is characterized in that The quality detection of edible fungus samples according to standard Raman spectroscopy data includes: Perform feature analysis on standard Raman spectroscopy data to determine the content of each type of element in edible fungi samples; The quality test results of the edible fungus samples are determined based on the content of each type of element in the edible fungus samples.

Citation Information

Cited By

  • Intensive edible mushroom target detection post-processing device and method

    CN122550918A

  • A dense edible mushroom target detection post-processing device and method

    CN122550918B