Refractive index detection method, device and equipment and storage equipment
By acquiring and color-correcting the near-infrared spectral data of the tobacco flavor and fragrance, a refractive index prediction model is constructed, which solves the problem of low detection accuracy in the prior art and achieves high-precision online rapid detection.
Patent Information
- Application Number
- CN202510186217.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-30
AI Technical Summary
When detecting the refractive index of tobacco flavors, the prediction results are low and it is difficult to achieve rapid online detection.
By obtaining the near-infrared spectral data and color parameter values of the tobacco flavor fragrance with a known refractive index, a refractive index prediction model was constructed after color correction, and the refractive index of the tobacco flavor fragrance to be tested was used to detect the refractive index of the tobacco flavor fragrance to be measured.
The accuracy of the refractive index detection of tobacco flavors and fragrances is improved, and the online rapid detection is realized, solving the problem of low accuracy of prediction results.
Smart Images

Figure CN120070604A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spectral detection, and particularly relates to a refractive index detection method, device, equipment and storage device. Background Art
[0002] Tobacco flavorings endow products with characteristic aromas and flavors, cover up and correct bad flavors, stabilize the aroma quality of products, improve and supplement the flavors of products, etc. However, with the continuous expansion of the tobacco product market, the quality control problem of tobacco flavorings has become increasingly prominent. Therefore, the quality detection of tobacco flavorings is crucial for controlling the quality of tobacco products. And the refractive index is one of the important criteria for measuring the quality of tobacco flavorings.
[0003] Currently, the method for detecting the refractive index of tobacco flavorings mainly refers to the industry standard YC / T 145.3-2012 "Determination of the Refractive Index of Tobacco Flavors". This method requires contacting the sample, and the measurement speed is slow, making it difficult to achieve on-line rapid detection. Tobacco flavorings are a type of dark and viscous substance. Due to the variety of spice varieties, different manufacturers, and different production batches of tobacco flavors, their colors vary. The relatively deep color will have a greater impact on the near-infrared spectrum, especially in the short-wavelength region. The near-infrared spectrum change caused by the color of tobacco flavorings is even more obvious than the near-infrared spectrum change caused by the composition of tobacco flavorings itself. This will greatly affect the result of analyzing the quality of tobacco flavorings by near-infrared spectroscopy, bringing measurement errors and making the prediction result inaccurate.
[0004] In summary, how to solve the problem of low prediction accuracy when predicting the refractive index of tobacco flavorings is an urgent problem to be solved at present. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a refractive index detection method, device, equipment and storage device, which can solve the problem of low prediction accuracy when predicting the refractive index of tobacco flavorings. The specific scheme is as follows:
[0006] In the first aspect, the present application provides a refractive index detection method, including:
[0007] Obtaining the known near-infrared spectrum data and color parameter values of tobacco flavorings with known refractive indices;
[0008] Performing color correction on the known near-infrared spectrum data according to the color parameter values to obtain corrected known near-infrared spectrum data;
[0009] Constructing a target tobacco flavoring refractive index prediction model based on the refractive index of the tobacco flavorings and the corrected known near-infrared spectrum data;
[0010] Detect the target refractive index of the to-be-detected tobacco flavor using the constructed target refractive index prediction model for tobacco flavors.
[0011] Optionally, the obtaining of the known near-infrared spectral data and color parameter values of the tobacco flavor with a known refractive index includes:
[0012] Obtain the known near-infrared spectral data and color parameter values of the tobacco flavor with a known refractive index using a preset acquisition mode, where the preset acquisition mode includes any one or several of a preset diffuse reflection mode, a preset transmission mode, and a preset transflection mode.
[0013] Optionally, the color parameter values include a preset red parameter value, a preset green parameter value, a preset blue parameter value, a preset hue parameter value, a preset saturation parameter value, a preset lightness parameter value, and a preset brightness parameter value.
[0014] Optionally, the color-correcting the known near-infrared spectral data according to the color parameter values to obtain corrected known near-infrared spectral data includes:
[0015] Construct a target spectral data matrix based on the color parameter values for the known near-infrared spectral data, and then perform data preprocessing operations on the target spectral data matrix to obtain corrected known near-infrared spectral data;
[0016] Among them, the data preprocessing operations include any one or several of a preset mean centering operation, a preset standardization operation, a preset normalization operation, a preset first derivative operation, a preset second derivative operation, a preset scatter correction operation, a preset baseline correction operation, and a preset smoothing operation.
[0017] Optionally, the constructing of the target refractive index prediction model for tobacco flavors based on the refractive index of the tobacco flavor and the corrected known near-infrared spectral data includes:
[0018] Determine an initial refractive index prediction model for tobacco flavors based on the corrected known near-infrared spectral data, the correlation coefficient between the known near-infrared spectral data and the color parameter values, and a preset correlation coefficient threshold;
[0019] Substitute the preset color parameter values into the initial refractive index prediction model for tobacco flavors to obtain the target refractive index prediction model for tobacco flavors.
[0020] Optionally, the constructing of the target refractive index prediction model for tobacco flavors based on the refractive index of the tobacco flavor and the corrected known near-infrared spectral data includes:
[0021] Construct a target refractive index prediction model for tobacco flavor based on the refractive index of the tobacco flavor and the calibrated known near-infrared spectral data by using a preset model construction method;
[0022] Wherein, the preset model construction method includes any one or several of a preset partial least squares method, a preset principal component regression method, a preset support vector machine method, a preset neural network method, a preset multiple linear regression, a preset decision tree regression, a preset ridge regression, and a preset Lasso regression.
[0023] Optionally, detecting the target refractive index of the tobacco flavor to be measured by using the constructed target refractive index prediction model for tobacco flavor includes:
[0024] Obtain the near-infrared spectral data to be detected of the tobacco flavor to be measured;
[0025] Perform color correction on the near-infrared spectral data to be detected according to the color parameter value to obtain the calibrated near-infrared spectral data to be detected;
[0026] Analyze the calibrated near-infrared spectral data to be detected by using the target refractive index prediction model for tobacco flavor to obtain the target refractive index of the tobacco flavor to be measured.
[0027] In a second aspect, the present application provides a refractive index detection device, including:
[0028] A data acquisition module, configured to acquire the known near-infrared spectral data and color parameter values of the tobacco flavor with a known refractive index;
[0029] A color correction module, configured to perform color correction on the known near-infrared spectral data according to the color parameter value to obtain the calibrated known near-infrared spectral data;
[0030] A model construction module, configured to construct a target refractive index prediction model for tobacco flavor based on the refractive index of the tobacco flavor and the calibrated known near-infrared spectral data;
[0031] A refractive index detection module, configured to detect the target refractive index of the tobacco flavor to be measured by using the constructed target refractive index prediction model for tobacco flavor.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] A memory, configured to store a computer program;
[0034] A processor, configured to execute the computer program to implement the refractive index detection method as described above.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the refractive index detection method as described above is implemented.
[0036] In summary, the present application first obtains known near-infrared spectral data and color parameter values of tobacco flavors and fragrances with known refractive index; performs color correction on the known near-infrared spectral data according to the color parameter values to obtain corrected known near-infrared spectral data; constructs a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the corrected known near-infrared spectral data; and uses the constructed target tobacco flavor and fragrance refractive index prediction model to detect the target refractive index of the tobacco flavor and fragrance to be tested. As can be seen from the above, the present application first obtains known near-infrared spectral data of tobacco flavors and fragrances with known refractive index and their corresponding color parameter values. Next, color correction is performed on the known near-infrared spectral data according to these color parameter values, and the corrected known near-infrared spectral data is obtained through this operation. Subsequently, based on the refractive index of tobacco flavors and fragrances and the corrected known near-infrared spectral data, a target tobacco flavor and fragrance refractive index prediction model is constructed. Finally, the constructed prediction model for the refractive index of tobacco flavors and fragrances is used to detect the target refractive index of the tobacco flavors and fragrances to be tested. In this way, the present application can detect the refractive index of tobacco flavors and fragrances based on the color-corrected near-infrared spectroscopy technology, solving the problem of low prediction accuracy when predicting the refractive index of tobacco flavors and fragrances. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 This is a flow chart of a refractive index detection method disclosed in this application;
[0039] Figure 2 A near infrared spectrum of tobacco flavors of different colors disclosed in this application;
[0040] Figure 3 This is a schematic structural diagram of a refractive index detection device disclosed in this application;
[0041] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] Currently, the method for detecting the refractive index of tobacco flavor mainly refers to the industry standard YC / T 145.3-2012 "Determination of Refractive Index of Tobacco Flavor". This method requires contacting the sample, and the measurement speed is slow, making it difficult to achieve on-line rapid detection. Tobacco flavor is a type of dark and viscous substance. There are various types of tobacco flavor, different manufacturers, and different production batches, resulting in different shades of color. The relatively deep color will have a greater impact on the near-infrared spectrum, especially in the short-wavelength region. The near-infrared spectrum change caused by the color of tobacco flavor is even more obvious than that caused by the composition of tobacco flavor itself. This will greatly affect the result of analyzing the quality of tobacco flavor by near-infrared spectroscopy, bringing measurement errors and making the prediction result inaccurate. To solve the above technical problems, this application discloses a refractive index detection method, device, equipment, and storage device, which can solve the problem of low accuracy of the prediction result when predicting the refractive index of tobacco flavor.
[0044] See Figure 1 As shown, the embodiments of the present invention disclose a refractive index detection method, which may include:
[0045] Step S11, obtain the known near-infrared spectrum data and color parameter values of tobacco flavor with a known refractive index.
[0046] In this embodiment, first, it is necessary to select tobacco flavor samples of different varieties and batches for research. For example, 10 tobacco flavor samples can be selected for experiments. Then, use a preset acquisition mode to obtain the known near-infrared spectrum data and color parameter values of tobacco flavor with a known refractive index, where the preset acquisition mode includes any one or several of a preset diffuse reflection mode, a preset transmission mode, and a preset transflection mode. Specifically, using the transmission scanning mode of a near-infrared spectrometer, perform near-infrared spectrum scanning on the tobacco flavor sample with a known refractive index, and the known near-infrared spectrum data as shown in Figure 2 can be obtained. Among them, the specific scanning parameters can be: the instrument wavelength range is , and the resolution is , the number of scans is 64 scans, and the optical path is 1 mm. In addition, it is also necessary to collect visible light images of tobacco flavorings, and obtain color parameter values of tobacco flavorings with known refractive indices based on the visible light images. It should be noted that the color parameter values may include preset red parameter values (R values), green parameter values (G values), blue parameter values (B values), preset hue parameter values, preset saturation parameter values, preset lightness parameter values, and preset brightness parameter values.
[0047] Step S12: Perform color correction on the known near-infrared spectral data according to the color parameter values to obtain corrected known near-infrared spectral data.
[0048] In this embodiment, it is necessary to perform color correction on the obtained known near-infrared spectral data. It is necessary to construct a target spectral data matrix based on the color parameter values for the known near-infrared spectral data, and then perform data preprocessing operations on the target spectral data matrix to obtain corrected known near-infrared spectral data; among them, the data preprocessing operations include any one or several of preset mean centering operations, preset standardization operations, preset normalization operations, preset first derivative operations, preset second derivative operations, preset scatter correction operations, preset baseline correction operations, and preset smoothing operations. Specifically, the obtained known near-infrared spectral data is initially preprocessed by mean centering to obtain a target spectral data matrix, and then the target spectral data matrix is preprocessed to screen out the known near-infrared spectral data with a low correlation with the R value, G value, and B value as the corrected known near-infrared spectral data.
[0049] Step S13: Construct a target refractive index prediction model for tobacco flavorings based on the refractive index of the tobacco flavorings and the corrected known near-infrared spectral data.
[0050] In this embodiment, after obtaining the corrected known near-infrared spectral data, determine an initial refractive index prediction model for tobacco flavorings based on the corrected known near-infrared spectral data, the correlation coefficient between the known near-infrared spectral data and the color parameter values, and a preset correlation coefficient threshold; substitute the preset color parameter values into the initial refractive index prediction model for tobacco flavorings to obtain a target refractive index prediction model for tobacco flavorings. Specifically, use the corrected known near-infrared spectral data as the independent variable and the color parameter values as the prediction variables to establish an initial color parameter value correction model:
[0051] ;
[0052] Among them, is the corrected known near-infrared spectral data; X is the known near-infrared spectral data; is the i-th color parameter value; is the correlation coefficient of known near-infrared spectral data and color parameter values; r 0 is the correlation coefficient threshold.
[0053] In addition, a target refractive index prediction model for tobacco flavor and fragrance can be constructed based on the refractive index of tobacco flavor and fragrance and the corrected known near-infrared spectral data by using a preset model construction method; wherein, the preset model construction method includes any one or several of a preset partial least squares method, a preset principal component regression method, a preset support vector machine method, a preset neural network method, a preset multiple linear regression, a preset decision tree regression, a preset ridge regression, and a preset Lasso regression.
[0054] In a specific embodiment, a refractive index prediction model for tobacco flavor and fragrance is established by using a preset partial least squares method. First, randomly select the corrected known near-infrared spectral data of three-fifths of the tobacco flavor samples as the calibration set, and use the corrected known near-infrared spectral data of the remaining tobacco flavor samples as the validation set. Then, taking the corrected known near-infrared spectral data after color correction as the independent variable and the refractive index of the tobacco flavor as the dependent variable, construct a preset partial least squares model. Among them, the cumulative contribution rate of the first two principal components of the tobacco flavor samples reaches 90%. Therefore, a partial least squares model of the refractive index of the tobacco flavor is established according to the first two principal components of the tobacco flavor samples:
[0055] ;
[0056] Among them, is the corrected known near-infrared spectral data; X is the known near-infrared spectral data; R is the red value of the color parameter, G is the green value of the color parameter, and B is the blue value of the color parameter; r(X, R) is the correlation coefficient between the known near-infrared spectral data and the R value; r(X, G) is the correlation coefficient between the known near-infrared spectral data and the G value; r(X, B) is the correlation coefficient between the known near-infrared spectral data and the B value.
[0057] In this embodiment, to ensure the accuracy of the refractive index prediction model of the tobacco flavor, the data of the validation set is used to verify the constructed model. In the model verification stage, the coefficient of determination threshold can be set to 0.90 as the core evaluation criterion. Therefore, when the coefficient of determination of the validation set is greater than 0.90, it indicates that the model prediction error is in a relatively small range. At this time, the model can be determined as the target refractive index prediction model for tobacco flavor and fragrance. On this basis, when the coefficient of determination of the model calibration set is greater than 0.94, then the target refractive index prediction model for tobacco flavor and fragrance can meet the requirements of the refractive index prediction accuracy of the tobacco flavor.
[0058] Step S14, detecting the target refractive index of the to-be-detected tobacco flavor and fragrance by using the constructed target refractive index prediction model for tobacco flavor and fragrance.
[0059] In this embodiment, after the refractive index prediction model of the target tobacco flavor is constructed, the near-infrared spectral data to be detected of the tobacco flavor to be detected is obtained; the color correction is performed on the near-infrared spectral data to be detected according to the color parameter value to obtain the corrected near-infrared spectral data to be detected; the target refractive index of the tobacco flavor to be detected is obtained by analyzing the corrected near-infrared spectral data to be detected by using the target refractive index prediction model of the tobacco flavor. Specifically, first, the near-infrared spectral data to be detected of the tobacco flavor to be detected is obtained, and then the color correction is performed on the near-infrared spectral data to be detected according to the color parameter value to eliminate the interference of the color factor on the accuracy of the spectral data, and the corrected near-infrared spectral data to be detected is obtained. Finally, the constructed target refractive index prediction model of the tobacco flavor is used to analyze the corrected near-infrared spectral data to be detected, and the target refractive index of the tobacco flavor to be detected is finally obtained.
[0060] As can be seen from the above, in the embodiment of the present application, first, the known near-infrared spectral data of the tobacco flavor with a known refractive index and its corresponding color parameter values are obtained. Immediately afterwards, color correction is performed on the known near-infrared spectral data according to these color parameter values, and the corrected known near-infrared spectral data is obtained through this operation. Subsequently, based on the refractive index of the tobacco flavor and the corrected known near-infrared spectral data, a target refractive index prediction model of the tobacco flavor is constructed. Finally, the constructed refractive index prediction model of the tobacco flavor is used to detect the target refractive index of the tobacco flavor to be detected that needs to be detected. In this way, based on the color-corrected near-infrared spectral technology, the embodiment of the present application can detect the refractive index of the tobacco flavor, and solves the problem of low prediction accuracy of the prediction result when predicting the refractive index of the tobacco flavor.
[0061] Based on the previous embodiment, it can be known that the present application discloses a refractive index detection method, which can solve the problem of low prediction accuracy of the prediction result when predicting the refractive index of the tobacco flavor. Next, a detailed description will be given of the specific refractive index detection method.
[0062] First, this application needs to select tobacco flavor samples of different varieties and batches for research. Then, using a preset acquisition mode, known near-infrared spectral data and color parameter values of tobacco flavor and fragrance with known refractive indices are obtained. Based on the color parameter values, the obtained known near-infrared spectral data is color-corrected to obtain the color-corrected known near-infrared spectral data. Next, after obtaining the color-corrected known near-infrared spectral data, the color-corrected known near-infrared spectral data is used as the independent variable, and the color parameter value is used as the predictive variable to establish an initial color parameter value correction model. Then, the color parameter value is optimized, the optimized color parameter value is substituted into the initial color parameter value correction model, and the correlation coefficient threshold is determined to construct the required target tobacco flavor and fragrance refractive index prediction model. Finally, the to-be-detected near-infrared spectral data of the to-be-detected tobacco flavor and fragrance is obtained. Then, based on the color parameter value, the to-be-detected near-infrared spectral data is color-corrected, and the established target tobacco flavor and fragrance refractive index prediction model is used to detect the color-corrected to-be-detected near-infrared spectral data to obtain the target refractive index of the to-be-detected tobacco flavor and fragrance.
[0063] See Figure 3 As shown, an embodiment of the present invention discloses a refractive index detection device, which may include:
[0064] A data acquisition module 11, configured to acquire known near-infrared spectral data and color parameter values of tobacco flavor and fragrance with known refractive indices;
[0065] A color correction module 12, configured to perform color correction on the known near-infrared spectral data according to the color parameter values to obtain color-corrected known near-infrared spectral data;
[0066] A model construction module 13, configured to construct a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the color-corrected known near-infrared spectral data;
[0067] A refractive index detection module 14, configured to detect the target refractive index of the to-be-detected tobacco flavor and fragrance by using the constructed target tobacco flavor and fragrance refractive index prediction model.
[0068] As can be seen from the above, the present application first obtains the known near-infrared spectral data of tobacco flavors and fragrances with known refractive index and their corresponding color parameter values. Next, color correction is performed on the known near-infrared spectral data based on these color parameter values, and the corrected known near-infrared spectral data is obtained through this operation. Subsequently, a target tobacco flavor and fragrance refractive index prediction model is constructed based on the refractive index of tobacco flavors and fragrances and the corrected known near-infrared spectral data. Finally, the target refractive index of the tobacco flavor and fragrance to be tested is detected using the constructed tobacco flavor and fragrance refractive index prediction model. In this way, the present application can detect the refractive index of tobacco flavors and fragrances based on color correction near-infrared spectroscopy technology, which solves the problem of low accuracy of prediction results when predicting the refractive index of tobacco flavors and fragrances.
[0069] In some specific implementations, the data acquisition module 11 may specifically include:
[0070] The known near-infrared spectrum data and color parameter value acquisition unit is used to acquire the known near-infrared spectrum data and color parameter values of tobacco flavors and fragrances with known refractive index using a preset acquisition mode, wherein the preset acquisition mode includes any one or more of a preset diffuse reflection mode, a preset transmission mode, and a preset transflective reflection mode.
[0071] In some specific implementations, the color parameter values include a preset red parameter value, a green parameter value, a blue parameter value, a preset hue parameter value, a preset saturation parameter value, a preset lightness parameter value, and a preset brightness parameter value.
[0072] In some specific implementations, the color correction module 12 may specifically include:
[0073] The corrected known near-infrared spectrum data acquisition unit is used to construct the known near-infrared spectrum data into a target spectrum data matrix based on the color parameter value, and then perform a data preprocessing operation on the target spectrum data matrix to obtain the corrected known near-infrared spectrum data; wherein the data preprocessing operation includes any one or more of a preset mean centering operation, a preset standardization operation, a preset normalization operation, a preset first-order derivative operation, a preset second-order derivative operation, a preset scattering correction operation, a preset baseline correction operation, and a preset smoothing operation.
[0074] In some specific implementations, the model building module 13 may specifically include:
[0075] An initial tobacco flavor and fragrance refractive index prediction model determination unit is used to determine an initial tobacco flavor and fragrance refractive index prediction model based on the corrected known near-infrared spectrum data, the correlation coefficient between the known near-infrared spectrum data and the color parameter value, and a preset correlation coefficient threshold;
[0076] A target refractive index prediction model unit for tobacco flavor is used to substitute a preset color parameter value into an initial refractive index prediction model for tobacco flavor to obtain a target refractive index prediction model for tobacco flavor.
[0077] In some specific embodiments, the model construction module 13 may specifically include:
[0078] A target refractive index prediction model construction unit for tobacco flavor is used to construct a target refractive index prediction model for tobacco flavor based on the refractive index of the tobacco flavor and the corrected known near-infrared spectral data by using a preset model construction method; wherein, the preset model construction method includes any one or several of a preset partial least squares method, a preset principal component regression method, a preset support vector machine method, a preset neural network method, a preset multiple linear regression, a preset decision tree regression, a preset ridge regression, and a preset Lasso regression.
[0079] In some specific embodiments, the refractive index detection module 14 may specifically include:
[0080] A unit for obtaining near-infrared spectral data to be detected is used to obtain the near-infrared spectral data to be detected of the tobacco flavor to be detected;
[0081] A unit for obtaining corrected near-infrared spectral data to be detected is used to perform color correction on the near-infrared spectral data to be detected according to the color parameter value to obtain the corrected near-infrared spectral data to be detected;
[0082] A unit for obtaining the target refractive index is used to analyze the corrected near-infrared spectral data to be detected by using the target refractive index prediction model for tobacco flavor to obtain the target refractive index of the tobacco flavor to be detected.
[0083] Furthermore, an embodiment of the present application also discloses an electronic device Figure 4 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the scope of use of the present application.
[0084] Figure 4 It is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the refractive index detection method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0085] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0086] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0087] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of implementing the refractive index detection method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks.
[0088] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the foregoing disclosed refractive index detection method. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0089] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and reference can be made to the description of the method part for related parts.
[0090] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0091] The steps of the methods or algorithms described in combination with the embodiments disclosed in this specification can be implemented directly by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0092] Finally, it should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0093] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this specification to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A refractive index detection method, characterized in that: include: Acquire known near infrared spectrum data and color parameter values of tobacco flavors and fragrances with known refractive index; Performing color correction on the known near-infrared spectrum data according to the color parameter value to obtain corrected known near-infrared spectrum data; Constructing a prediction model for the refractive index of a target tobacco flavor based on the refractive index of the tobacco flavor and the known near-infrared spectrum data after correction; The target refractive index of the tobacco flavor and fragrance to be tested is detected by using the constructed target tobacco flavor and fragrance refractive index prediction model.
2. The refractive index detection method according to claim 1, characterized in that: The method of obtaining known near infrared spectrum data and color parameter values of tobacco flavors and fragrances with known refractive index includes: The known near-infrared spectrum data and color parameter values of tobacco flavors and fragrances with known refractive index are acquired using a preset acquisition mode, wherein the preset acquisition mode includes any one or more of a preset diffuse reflection mode, a preset transmission mode, and a preset transflective reflection mode.
3. The refractive index detection method according to claim 1, characterized in that: The color parameter values include a red parameter value, a green parameter value, a blue parameter value, a preset hue parameter value, a preset saturation parameter value, a preset lightness parameter value, and a preset brightness parameter value.
4. The refractive index detection method according to claim 1, characterized in that: The color correction of the known near-infrared spectrum data according to the color parameter value to obtain the corrected known near-infrared spectrum data includes: The known near-infrared spectrum data is constructed into a target spectrum data matrix based on the color parameter value, and then a data preprocessing operation is performed on the target spectrum data matrix to obtain the corrected known near-infrared spectrum data; Among them, the data preprocessing operation includes any one or more of a preset mean centering operation, a preset standardization operation, a preset normalization operation, a preset first-order derivative operation, a preset second-order derivative operation, a preset scatter correction operation, a preset baseline correction operation, and a preset smoothing operation.
5. The refractive index detection method according to claim 1, characterized in that: The method of constructing a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the corrected known near-infrared spectrum data comprises: Determine an initial tobacco flavor and fragrance refractive index prediction model based on the corrected known near-infrared spectrum data, the correlation coefficient between the known near-infrared spectrum data and the color parameter value, and a preset correlation coefficient threshold; The preset color parameter values are substituted into the initial tobacco flavor and fragrance refractive index prediction model to obtain the target tobacco flavor and fragrance refractive index prediction model.
6. The refractive index detection method according to claim 1, characterized in that: The method of constructing a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the corrected known near-infrared spectrum data comprises: Using a preset model building method to build a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the corrected known near-infrared spectrum data; Among them, the preset model building method includes any one or more of the preset partial least squares method, the preset principal component regression method, the preset support vector machine method, the preset neural network method, the preset multivariate linear regression, the preset decision tree regression, the preset ridge regression, and the preset Lasso regression.
7. The refractive index detection method according to any one of claims 1 to 6, characterized in that: The method of using the constructed target tobacco flavor and fragrance refractive index prediction model to detect the target refractive index of the tobacco flavor and fragrance to be tested includes: Obtaining near infrared spectrum data of the tobacco flavors and fragrances to be tested; Performing color correction on the near-infrared spectrum data to be detected according to the color parameter value to obtain corrected near-infrared spectrum data to be detected; The target tobacco flavor and fragrance refractive index prediction model is used to analyze the corrected near-infrared spectrum data to be detected, so as to obtain the target refractive index of the tobacco flavor and fragrance to be detected.
8. A refractive index detection device, characterized in that: include: A data acquisition module, used to acquire known near-infrared spectrum data and color parameter values of tobacco flavors and fragrances with known refractive index; A color correction module, used for performing color correction on the known near-infrared spectrum data according to the color parameter value to obtain corrected known near-infrared spectrum data; A model building module, used to build a target tobacco flavor and fragrance refractive index prediction model based on the refractive index of the tobacco flavor and fragrance and the corrected known near-infrared spectrum data; The refractive index detection module is used to detect the target refractive index of the tobacco flavor to be tested by using the constructed target tobacco flavor prediction model.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the refractive index detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the refractive index detection method according to any one of claims 1 to 7 is implemented.