Method and system for rapidly determining nicotine content in cigarette oil using near infrared spectroscopy
By calculating the characteristic correlation coefficient and correlation coefficient of wavelength and component in near-infrared spectral data, and selecting characteristic wavelengths, the problem of unconsidered correlation between wavelength and nicotine in the existing technology is solved, and the accuracy of determining the nicotine content in e-liquid is improved Rate.
Patent Information
- Application Number
- CN202411524564.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-30
Smart Images

Figure CN119044111B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of infrared light analysis technology, and in particular to a method and system for rapidly determining the nicotine content in cigarette oil by using near infrared spectroscopy. Background Art
[0002] The e-cigarette oil is mainly composed of solvent, nicotine and flavor substances. With the rapid development of the e-cigarette market, the nicotine content in the oil has become a key quality control indicator. Near infrared spectroscopy technology has the characteristics of rapidity, non-destructiveness and low cost, making it an important means of detecting the nicotine content in the oil.
[0003] When using near-infrared spectroscopy to detect the nicotine content in e-liquid, existing methods select characteristic wavelengths from the spectral data of the e-liquid, and establish a quantitative prediction model based on the spectral data at the characteristic wavelength and the nicotine content in the e-liquid, so as to achieve rapid detection of the nicotine content in the e-liquid. The spectral data in the e-liquid often contains mixed information of multiple components. When selecting characteristic wavelengths, existing methods do not consider the correlation between wavelengths and nicotine, resulting in poor expression of nicotine by some of the selected characteristic wavelengths, and there is a lot of redundant information, resulting in low accuracy in determining the nicotine content in the e-liquid using near-infrared spectroscopy. Summary of the invention
[0004] In order to solve the technical problem that the correlation between wavelength and nicotine is not considered in the process of characteristic wavelength selection, so that the selected characteristic wavelength has a poor expression effect on nicotine, resulting in inaccurate nicotine content determination, the purpose of the present invention is to provide a method and system for quickly determining the nicotine content in e-liquid using near-infrared spectroscopy. The technical scheme adopted is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy, the method comprising:
[0006] Obtaining spectral data of e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; forming a content sequence from the contents of all components in the e-liquid samples;
[0007] According to the difference between the spectral data of each e-liquid sample and the abnormality degree of the content sequence, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample, a characteristic correlation coefficient between each wavelength in the spectral data and each component is obtained;
[0008] Obtaining a correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine;
[0009] Selecting a characteristic wavelength in the spectral data according to a projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data;
[0010] A nicotine content prediction model is determined according to the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and the nicotine content in the e-liquid to be tested is measured using the nicotine content prediction model.
[0011] Furthermore, the step of obtaining the characteristic correlation coefficient between each wavelength and each component in the spectral data includes:
[0012] The LOF value of the spectral data of each e-liquid sample is obtained by using the local outlier factor algorithm, which is recorded as the spectral anomaly score; the LOF value of the content sequence of each e-liquid sample is obtained by using the local outlier factor algorithm, which is recorded as the content anomaly score;
[0013] The ratio of the spectral anomaly score to the content anomaly score of each e-liquid sample is recorded as a first value, and the ratio of the content anomaly score to the spectral anomaly score of each e-liquid sample is recorded as a second value; the maximum value between the first value and the second value is selected as the spectral anomaly value of each e-liquid sample;
[0014] According to the spectral abnormal value, the correlation between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample is adjusted to obtain a characteristic correlation coefficient between each wavelength in the spectral data and each component.
[0015] Furthermore, the characteristic correlation coefficient between each wavelength and each component in the spectral data is expressed by the formula:
[0016]
[0017] In the formula, is the characteristic correlation coefficient between the ath wavelength and the bth component in the spectral data; N is the total number of e-liquid samples; is the spectral abnormal value of the nth e-liquid sample; is the response value of the ath wavelength in the nth e-liquid sample; is the mean of the response values of the ath wavelength in all e-liquid samples; is the content of the bth component in the nth e-liquid sample; is the average content of component b in all e-liquid samples; is the standard deviation of the response values of the ath wavelength in all e-liquid samples; is the standard deviation of the content of the bth component in all e-liquid samples; exp is an exponential function with the natural constant e as the base.
[0018] Furthermore, the correlation coefficient between each wavelength in the spectral data and nicotine includes:
[0019] The maximum value of the characteristic correlation coefficients between each wavelength in the spectral data and the remaining components in the e-liquid sample except nicotine is used as the reference correlation coefficient of each wavelength in the spectral data;
[0020] The ratio of the characteristic correlation coefficient between each wavelength in the spectral data and nicotine to the reference correlation coefficient is used as the correlation coefficient between each wavelength in the spectral data and nicotine.
[0021] Furthermore, the selecting of characteristic wavelengths in the spectral data includes:
[0022] The first characteristic wavelength is obtained, and the first characteristic wavelength constitutes an initial target wavelength set, the remaining wavelengths in the spectral data except the first characteristic wavelength constitute an initial candidate wavelength set, and the response values of the same wavelength in the spectral data of all e-liquid samples constitute a response vector of each wavelength;
[0023] According to the correlation coefficients of the wavelengths in the target wavelength set and the projection values of the response vectors of the wavelengths in the target wavelength set on the response vectors of each wavelength in the to-be-selected wavelength set, the target wavelength set and the to-be-selected wavelength set are updated respectively; when the correlation coefficients of the wavelengths in the updated target wavelength set do not meet the to-be-selected condition, the updated target wavelength set and the to-be-selected wavelength set are continuously updated until the correlation coefficients of the wavelengths in the updated target wavelength set meet the to-be-selected condition; when the to-be-selected condition is met, the wavelengths in the updated target wavelength set are used as characteristic wavelengths in the spectral data.
[0024] Further, the updating of the target wavelength set and the to-be-selected wavelength set respectively according to the correlation coefficients of the wavelengths in the target wavelength set and the projection values of the response vectors of the wavelengths in the target wavelength set on the response vectors of each wavelength in the to-be-selected wavelength set includes:
[0025] Select one wavelength from the target wavelength set as the analysis wavelength, and select one wavelength from the candidate wavelength set as the candidate wavelength;
[0026] Using a continuous projection algorithm, a projection value of the response vector of the analysis wavelength on the response vector of the selected wavelength is obtained, which is recorded as the original projection value of the two wavelengths; according to the correlation coefficient of the analysis wavelength and the original projection value, an initial improved projection value of the analysis wavelength and the selected wavelength is obtained;
[0027] The cumulative sum of the initial improved projection values of all wavelengths in the target wavelength set and the selected wavelength is taken as the final improved projection value of the target wavelength set and the selected wavelength; the wavelength corresponding to the maximum value of the final improved projection values of all wavelengths in the selected wavelength set is taken as the target wavelength;
[0028] The target wavelength is added to the target wavelength set to complete the update of the target wavelength set; the target wavelength in the to-be-selected wavelength set is deleted to complete the update of the to-be-selected wavelength set.
[0029] Further, the correlation coefficient of the wavelength in the updated target wavelength set does not satisfy the selection condition, including:
[0030] The average of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine is taken as the overall correlation value;
[0031] The product of the maximum value of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine and a preset threshold is used as the correlation threshold;
[0032] The candidate condition is: the overall correlation value is less than the correlation threshold.
[0033] Further, obtaining the first characteristic wavelength includes:
[0034] The wavelength corresponding to the maximum value of the correlation coefficients between all wavelengths in the spectral data and nicotine is taken as the first characteristic wavelength.
[0035] Furthermore, determining the nicotine content prediction model according to the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content includes:
[0036] Arranging the response values of characteristic wavelengths in the spectral data of each e-liquid sample in order to obtain a characteristic spectral response sequence of the corresponding e-liquid sample;
[0037] The characteristic spectral response sequence of each e-liquid sample is used as input, and the nicotine content in the e-liquid sample is used as output. Partial least squares method is used to build a model to obtain a nicotine content prediction model.
[0038] In a second aspect, another embodiment of the present invention provides a system for rapidly determining the nicotine content in e-liquid using near infrared spectroscopy, the system comprising:
[0039] The data acquisition module is used to obtain the spectral data of the e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; the content sequence is formed by the content of all components in the e-liquid samples;
[0040] A wavelength component correlation analysis module, for obtaining a characteristic correlation coefficient between each wavelength in the spectral data and each component according to the difference between the spectral data of each e-liquid sample and the abnormality degree of the content sequence, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample;
[0041] A wavelength-nicotine correlation analysis module, for obtaining a correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine;
[0042] A characteristic wavelength extraction module, used for selecting a characteristic wavelength in the spectral data according to the projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data;
[0043] The nicotine content determination module is used to determine a nicotine content prediction model based on the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and to determine the nicotine content in the e-liquid to be tested using the nicotine content prediction model.
[0044] The present invention has the following beneficial effects:
[0045] In the embodiment of the present invention, the spectral data of the e-liquid sample is affected by multiple components, resulting in serious overlap of the wavelengths of the multiple components. It is necessary to analyze the correlation between the wavelengths in the spectral data and the components in the e-liquid sample. Considering that the measurement error may cause the response values of some wavelengths in the spectral data to deviate from the actual situation, the difference between the abnormality of the spectral data and the content sequence is analyzed to obtain the characteristic correlation coefficient, so as to avoid the interference of the measurement error in the accuracy of the correlation between the wavelength and the component. Since some wavelengths have a strong band aliasing effect, the correlation between the above wavelengths and the multiple components is strong. Therefore, according to the characteristic correlation between the wavelength and nicotine and the remaining components except nicotine, the characteristic correlation coefficient is obtained. The relative size of the characteristic correlation coefficient and the determined correlation coefficient can accurately measure the expression effect of the wavelength on nicotine; this scheme takes into account the expression effect of the wavelength on nicotine, that is, the correlation coefficient, in the process of selecting the characteristic wavelength, thereby reducing the problem that the characteristic wavelength selected by the traditional method based only on the projection relationship between the unselected wavelength and the selected wavelength has a poor expression effect on nicotine, so that the selected characteristic wavelength has a stronger expression effect on nicotine and reduces most of the redundant information to a certain extent; the nicotine content prediction model is determined based on the response value of the characteristic wavelength in the spectral data of all e-liquid samples and the nicotine content, which can improve the accuracy and stability of the nicotine content prediction model, thereby increasing the accuracy of determining the nicotine content in the e-liquid. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] 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.
[0047] Figure 1 A flowchart of a method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy provided in one embodiment of the present invention;
[0048] Figure 2 A structural diagram of a system for rapidly determining the nicotine content in e-liquid using near-infrared spectroscopy provided in one embodiment of the present invention;
[0049] Figure 3 A computer device schematic diagram of a device for rapidly determining the nicotine content in e-liquid using near-infrared spectroscopy provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the method and system for quickly determining the nicotine content in the e-liquid using near-infrared spectroscopy according to the present invention, its specific implementation, structure, features and effects, 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.
[0051] 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.
[0052] The following is a detailed description of a method and system for rapidly determining the nicotine content in e-liquid using near-infrared spectroscopy provided by the present invention in conjunction with the accompanying drawings.
[0053] Embodiment 1:
[0054] The present invention proposes a method for rapidly determining the nicotine content in cigarette oil using near infrared spectroscopy. Figure 1 , which shows a flowchart of the steps of a method for quickly determining the nicotine content in tobacco oil using near infrared spectroscopy provided by one embodiment of the present invention, the method comprising:
[0055] Step S1: obtaining spectral data of e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; and forming a content sequence from the contents of all components in the e-liquid samples.
[0056] The purpose of this embodiment is to determine the relationship between the spectral data of the e-liquid sample and the nicotine content, and data needs to be collected before starting the analysis. Specifically, the spectral data of the e-liquid samples with different nicotine contents are collected using a near-infrared spectrometer; the main components of the e-liquid include nicotine, vegetable glycerin and propylene glycol, etc., and the components are the same in all e-liquid samples. The content of each component in each e-liquid sample is measured, and the sequence composed of the content of all components in each e-liquid sample is recorded as the content sequence. The elements with the same subscript in the content sequence of all e-liquid samples are the content of the same component.
[0057] It should be noted that the spectral data of the e-liquid sample is a spectrogram, the horizontal axis of the spectrogram represents the wavelength, and the vertical axis represents the response value of different wavelengths, and the response value usually represents the absorbance or transmittance; in this embodiment, the wavelength range of the near-infrared spectrum is 950 nanometers to 1650 nanometers, and the minimum difference in wavelength in the spectral data is 1 nanometer, which can be set by the implementer according to the specific situation. In this embodiment, atomic absorption spectroscopy is used to determine the content of components in the e-liquid sample, and spectrophotometry and ion chromatography can also be used. Among them, atomic absorption spectroscopy is a well-known technology for those skilled in the art and will not be described in detail here.
[0058] Step S2: According to the difference between the abnormality degree of the spectral data and the content sequence of each e-liquid sample, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample, the characteristic correlation coefficient between each wavelength in the spectral data and each component is obtained.
[0059] This scheme uses near-infrared spectroscopy technology to detect the nicotine content in e-liquid. The spectral data of e-liquid usually contains mixed information of multiple components, so it is necessary to extract characteristic wavelengths that have a better nicotine expression effect from the spectral data of the e-liquid.
[0060] The spectral data of the e-liquid sample is affected by the various components in the e-liquid, resulting in serious overlap of the wavelengths of the various components. Therefore, it is necessary to analyze the correlation between each wavelength in the spectral data and each component in the e-liquid sample. Considering that the response values of some wavelengths deviate from the actual situation due to measurement errors during the acquisition of some spectral data, in order to ensure the accuracy of subsequent analysis, it is also necessary to perform abnormal detection on the e-liquid sample during the analysis of the correlation between wavelengths and components.
[0061] It is known that there is a certain correlation between the content of various components in the e-liquid and the spectral characteristics, that is, the spectral characteristics of the e-liquid will change accordingly with the change of the content of certain components in the e-liquid. If the content of certain components in the e-liquid is too high or too low, that is, the abnormality of the above-mentioned component content is large, the abnormality of its spectral characteristics is also large, and the abnormality of the component content and spectral characteristics of the same e-liquid sample should be relatively consistent. Therefore, the difference between the abnormality of the spectral data and the content sequence of the e-liquid sample can measure the abnormality of the e-liquid sample, and the correlation between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample is analyzed to obtain the characteristic correlation coefficient, thereby reducing the influence of the measurement error on the correlation between the wavelength and the components in the e-liquid sample.
[0062] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the characteristic correlation coefficient includes: using a local outlier factor algorithm to obtain the LOF value of the spectral data of each e-liquid sample, recorded as a spectral anomaly score; using a local outlier factor algorithm to obtain the LOF value of the content sequence of each e-liquid sample, recorded as a content anomaly score; recording the ratio of the spectral anomaly score to the content anomaly score of each e-liquid sample as a first value, and recording the ratio of the content anomaly score to the spectral anomaly score of each e-liquid sample as a second value; selecting the maximum value between the first value and the second value as the spectral anomaly value of each e-liquid sample; according to the spectral anomaly value, adjusting the correlation between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample, and obtaining the characteristic correlation coefficient between each wavelength in the spectral data and each component. Among them, the local anomaly factor algorithm is a well-known technology for those skilled in the art and will not be repeated here.
[0063] There is a certain correlation between the content of components in the e-liquid and the spectral characteristics. When the abnormality of the substance content in the e-liquid sample is large, the spectral abnormality score of the e-liquid sample will also be large. On the basis of the same or similar component content, the abnormality of the component content in the e-liquid is small. If there is a part of the spectral data that deviates from the spectral characteristics of the normal substance content, the abnormality of the part of the spectral data is greater, and it is more affected by the content of other substances. Therefore, the difference between the substance content in the abnormal e-liquid sample and the abnormality of the spectral data is large, and the subsequent analysis using the spectral data of the e-liquid sample will reduce the accuracy of the determination of the nicotine content in the e-liquid.
[0064] The changes in the content of components in normal e-liquids are consistent with the changes in the degree of abnormality of spectral data, while the changes in the content of components in abnormal e-liquids are inconsistent with the changes in the degree of abnormality of spectral data. Specifically, taking nicotine content as an example, when the nicotine content in some e-liquid samples is too high or too low, because the abnormality score represents the degree of outlier of the data, the content abnormality score in the e-liquid sample is relatively large, which makes the degree of abnormality of the spectral characteristics of the e-liquid sample, that is, the spectral abnormality score, relatively large. Therefore, if the spectral abnormality score and the content abnormality score of the e-liquid sample are both relatively large, the degree of abnormality of the e-liquid sample is relatively small; if one of the spectral abnormality score and the content abnormality score of the e-liquid sample is relatively large but the other is relatively small, the degree of abnormality of the e-liquid sample is relatively large.
[0065] In a specific implementation of this embodiment, the spectrum anomaly score of the e-liquid sample is expressed by the formula:
[0066]
[0067] Where GY is the spectral anomaly value of each e-liquid sample; XL is the spectral anomaly score of each e-liquid sample; YL is the content anomaly score of each e-liquid sample; is the first value of each e-liquid sample; is the second value of each e-liquid sample; max is the maximum value function.
[0068] In another embodiment, the absolute value of the difference between the spectrum abnormality score and the content abnormality score of each e-liquid sample may be used as the spectrum abnormality degree of each e-liquid sample.
[0069] In order to reduce the impact of measurement errors on the correlation between wavelength and components in the e-liquid sample during data collection, the proportion of correlation data of e-liquid samples with greater abnormality should be smaller, and the proportion of correlation data of e-liquid samples with less abnormality should be larger during the correlation analysis. Therefore, it is necessary to negatively correlate the spectral abnormality values of the e-liquid sample, and use the mapping results to adjust the correlation between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample, so as to obtain the characteristic correlation coefficient.
[0070] In a specific implementation of this embodiment, taking the ath wavelength in the spectral data and the bth component in the e-liquid sample as an example, the characteristic correlation coefficient between each wavelength in the spectral data and each component is expressed by the formula:
[0071]
[0072] In the formula, is the characteristic correlation coefficient between the ath wavelength and the bth component in the spectral data; N is the total number of e-liquid samples; is the spectral outlier value of the nth e-liquid sample; is the response value of the ath wavelength in the nth e-liquid sample; is the mean of the response values of the ath wavelength in all e-liquid samples; is the content of the bth component in the nth e-liquid sample; is the average content of component b in all e-liquid samples; is the standard deviation of the response values of the ath wavelength in all e-liquid samples; is the standard deviation of the content of the bth component in all e-liquid samples; exp is an exponential function with the natural constant e as the base. It should be noted that if the characteristic correlation coefficient The larger the value, the greater the correlation between the ath wavelength and the bth component in the spectral data; this embodiment uses an exponential function with the natural constant e as the base for negative correlation mapping, and negative correlation mapping can also be achieved by taking the inverse and other methods, which is not limited here.
[0073] It should be noted that the correlation between the wavelength in the spectral data and the components in the e-liquid sample is measured by the Pearson correlation coefficient. The present embodiment uses the spectral abnormality to correct the above correlation, reduce the weight of the abnormal e-liquid sample in the characteristic correlation coefficient calculation process, avoid the interference of measurement errors in the data collection process, and improve the accuracy of the correlation between the wavelength and the components in the spectral data of the e-liquid sample.
[0074] According to the method for obtaining the characteristic correlation coefficient between the ath wavelength and the bth component in the spectral data, the characteristic correlation coefficient between each wavelength in the spectral data and each component in the e-liquid sample is obtained.
[0075] Step S3: Obtain the correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine.
[0076] Since the absorption spectra of multiple components in the e-liquid overlap, some wavelengths have a strong band aliasing effect. Some wavelengths are not only strongly correlated with nicotine, but also with other components except nicotine. Therefore, it is necessary to analyze the correlation between each wavelength and various components in the e-liquid.
[0077] If the correlation between a single wavelength and nicotine is much greater than the correlation between the wavelength and the remaining components except nicotine, the correlation between the wavelength and nicotine is greater. Therefore, the correlation between each wavelength and nicotine can be measured by the relative size of the characteristic correlation coefficient between each wavelength in the spectral data and nicotine and the remaining components except nicotine, and then the correlation coefficient can be obtained to present the expression effect of wavelength on nicotine.
[0078] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the correlation coefficient between the wavelength and nicotine includes: taking the maximum value of the characteristic correlation coefficients between each wavelength in the spectral data and the remaining components in the e-liquid sample except nicotine as the reference correlation coefficient of each wavelength in the spectral data; taking the ratio of the characteristic correlation coefficient between each wavelength in the spectral data and nicotine to the reference correlation coefficient as the correlation coefficient between each wavelength in the spectral data and nicotine.
[0079] It should be noted that, for any wavelength, if the correlation between the wavelength and nicotine is much greater than the correlation between the wavelength and the remaining components except nicotine, then the characteristic correlation coefficient between the wavelength and nicotine must be greater than the maximum value of the characteristic correlation coefficients between the wavelength and the remaining components except nicotine. In order to simplify the analysis process, the maximum value of the characteristic correlation coefficients between the wavelength and the remaining components except nicotine is selected for analysis.
[0080] In a specific implementation of the embodiment of the present invention, taking the ath wavelength in the spectral data as an example, the correlation coefficient between each wavelength in the spectral data and nicotine is expressed by the formula:
[0081]
[0082] In the formula, is the correlation coefficient between the ath wavelength in the spectral data and nicotine; Nic is nicotine; is the characteristic correlation coefficient between the ath wavelength and nicotine in the spectral data; W is the set of e-liquid analysis components, which consists of the remaining components in the e-liquid sample except nicotine; is the characteristic correlation coefficient between the ath wavelength in the spectral data and the wth component in the smoke oil analysis component set; is the reference correlation coefficient of the ath wavelength in the spectral data; max is the maximum value function. It should be noted that when The larger it is, the stronger the correlation between the ath wavelength and nicotine, and the better the expression effect of the ath wavelength on nicotine.
[0083] Step S4: Selecting a characteristic wavelength in the spectral data according to the projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data.
[0084] The traditional method selects characteristic wavelengths based only on the projection relationship between the unselected wavelengths and the selected wavelengths, without considering the differences in the expression effects of different wavelengths on nicotine, resulting in poor expression effects of the selected characteristic wavelengths on nicotine, and more redundant information, which in turn leads to low reliability of some characteristic wavelengths in predicting the nicotine content in the e-liquid. Therefore, this scheme improves the continuous projection algorithm, and in the process of analyzing the projection relationship between different wavelengths in the spectral data, also considers the expression effect of the wavelength on nicotine, thereby improving the expression effect of the selected characteristic wavelength on nicotine.
[0085] Preferably, in some possible implementations of the embodiments of the present invention, the method for selecting a characteristic wavelength includes: obtaining a first characteristic wavelength, forming an initial target wavelength set with the first characteristic wavelength, forming an initial to-be-selected wavelength set with the remaining wavelengths in the spectral data except the first characteristic wavelength, and forming a response vector of each wavelength with the response value of the same wavelength in the spectral data of all e-liquid samples; updating the target wavelength set and the to-be-selected wavelength set respectively according to the correlation coefficient of the wavelengths in the target wavelength set and the projection value of the response vector of the wavelength in the target wavelength set on the response vector of each wavelength in the to-be-selected wavelength set; when the correlation coefficient of the wavelength in the updated target wavelength set does not meet the to-be-selected condition, continuing to update the updated target wavelength set and the to-be-selected wavelength set until the correlation coefficient of the wavelength in the updated target wavelength set meets the to-be-selected condition; when the to-be-selected condition is met, taking the wavelength in the updated target wavelength set as the characteristic wavelength in the spectral data.
[0086] The traditional continuous projection algorithm selects one wavelength as the initial wavelength. If the initial wavelength has a poor expression effect on nicotine, it is easy to cause the subsequent selected characteristic wavelength to have a poor expression effect on nicotine, which in turn leads to a low accuracy rate of nicotine content measurement. In order to solve the above problem, in this embodiment, the wavelength corresponding to the maximum value of the correlation coefficient between all wavelengths in the spectral data and nicotine is taken as the first characteristic wavelength, that is, the wavelength with the best expression effect on nicotine in the wavelengths of the spectral data is selected as the initial wavelength.
[0087] It should be noted that the values of the same dimension in the response vectors of all wavelengths represent the response values of all wavelengths in the spectral data of a cigarette oil sample. The wavelengths in the target wavelength set are characteristic wavelengths, and wavelengths are selected from the candidate wavelength set as characteristic wavelengths. Among them, the continuous projection algorithm is a well-known technology for those skilled in the art and will not be described in detail here.
[0088] A wavelength is randomly selected from the target wavelength set and recorded as the analysis wavelength, and a wavelength is randomly selected from the candidate wavelength set and recorded as the candidate wavelength; a continuous projection algorithm is used to obtain the projection value of the response vector of the analysis wavelength on the response vector of the candidate wavelength, which is recorded as the original projection value of the two wavelengths; according to the correlation coefficient of the analysis wavelength and the original projection value, the initial improved projection value of the analysis wavelength and the candidate wavelength is obtained; the cumulative sum of the initial improved projection values of all wavelengths in the target wavelength set and the candidate wavelength is taken as the final improved projection value of the target wavelength set and the candidate wavelength.
[0089] In a specific implementation of the embodiment of the present invention, assuming that the selected wavelength is the rth wavelength in the selected wavelength set, taking the selected wavelength as an example, the final improved projection value of the target wavelength set and the selected wavelength is expressed by the formula:
[0090]
[0091] In the formula, is the final improved projection value of the target wavelength set and the selected wavelength; U is the total number of wavelengths in the target wavelength set; is the correlation coefficient between the uth wavelength in the target wavelength set and nicotine; is the response vector of the wavelength to be selected; is the response vector of the uth wavelength in the target wavelength set; is the original projection value of the uth wavelength in the set of candidate wavelengths and target wavelengths; is the initial improved projection value of the uth wavelength in the set of selected wavelengths and target wavelengths; T is the transpose of the matrix; is the two-norm function.
[0092] It should be noted that when The larger the value is, the higher the correlation between the candidate wavelength and the u-th wavelength in the target wavelength set. Since the wavelengths in the target wavelength set have a better expression effect on nicotine, the candidate wavelength has a better expression effect on nicotine.
[0093] The traditional continuous projection algorithm selects the characteristic wavelength only by the maximum value of the projection value of the wavelength selected in the previous iteration of the current iteration on the candidate wavelength, which may still cause strong multicollinearity problems. At the same time, if the characteristic wavelength selected in a certain iteration has a poor expression effect on nicotine, it is easy to reduce the expression effect of the subsequent characteristic wavelength on nicotine. Therefore, this embodiment analyzes the correlation between the candidate wavelength and all the selected wavelengths, that is, all the wavelengths in the target wavelength set, to avoid the above problems, and at the same time As The weight coefficient of is used to improve the accuracy of the correlation between the candidate wavelength and the u-th wavelength in the target wavelength set.
[0094] when When the value is larger, the correlation between the u-th wavelength in the target wavelength set and nicotine is stronger, the weight of the reference u-th wavelength is greater, and the expression effect of the selected wavelength on nicotine is more accurate. Therefore, the correlation coefficient and the original projection value are positively correlated with the final improved projection value. If the final improved projection value The larger the value is, the better the expression effect of the candidate wavelength on nicotine is, and the greater the possibility that the candidate wavelength will be selected as the characteristic wavelength.
[0095] The wavelength corresponding to the maximum value of the final improved projection values of all wavelengths in the candidate wavelength set is used as the target wavelength. The target wavelength is added to the target wavelength set to complete the update of the target wavelength set; the target wavelength in the candidate wavelength set is deleted to complete the update of the candidate wavelength set.
[0096] In the traditional continuous projection algorithm, the number of characteristic wavelengths is fixed. As the number of characteristic wavelengths increases, the repeated redundant information between the selected characteristic wavelengths will gradually increase. If the number of characteristic wavelengths is set to a large number, a large amount of redundant information will be introduced, which may reduce the reliability of the prediction model; if the number of characteristic wavelengths is set to a small number, key information may be lost, and the reliability of the prediction model is also low, which will lead to errors in the determination of nicotine content.
[0097] In this embodiment, the stop condition of the improved continuous projection algorithm is: taking the average of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine as the overall correlation value ZG; taking the maximum value of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine as the preset threshold value. The product of is used as the correlation threshold GY; the candidate condition is: the overall correlation value is less than the correlation threshold. It should be noted that the preset threshold The value range is The preset threshold is the empirical value of 0.75, which can be set by the implementer according to the specific situation.
[0098] The overall correlation value reflects the overall level of the expression effect of all wavelengths in the target wavelength set on nicotine. As the number of wavelengths in the target wavelength set increases, the repeated redundant information between wavelengths will gradually increase, and the overall correlation value will gradually decrease until the overall level is lower than a certain value, that is, the overall correlation value is less than the correlation threshold, and the iterative selection of characteristic wavelengths is stopped. The wavelengths in the target wavelength set at this time are used as the characteristic wavelengths of the spectral data. The characteristic wavelengths have a strong expression effect on nicotine.
[0099] As an example, suppose the wavelength in the spectral data is , is the first characteristic wavelength, the initial target wavelength set MS1={ }, the initial candidate wavelength set DS1={}; The first iteration process is as follows: The overall correlation value ZG1 of MS1 is the wavelength Correlation coefficient with nicotine , association threshold , the overall correlation value ZG1 must be greater than the correlation threshold GY1, the initial target wavelength set MS1 must meet the selection conditions, and the MS1 is obtained respectively The final improved projection values are If among the three Maximum, then Add to MS1 to update MS1, the updated target wavelength set MS2={ }; Set DS1 Delete, to update DS1, the updated target wavelength set DS2={ }.
[0100] The second iteration process is as follows: The overall correlation value of MS2 ,in The wavelength The correlation coefficient between nicotine and middle Maximum, then the associated threshold , assuming that the overall correlation value ZG2 of MS2 is greater than the correlation threshold GY2, continue to obtain MS2={ } respectively with The final improved projection values are , if either Maximum, then Add to MS2 to update MS2, the updated target wavelength set MS3={ }; Set DS1 Delete, to update DS2, the updated target wavelength set DS3 = { }.
[0101] The third iteration process is as follows: The overall correlation value of MS3 ,in The wavelength The correlation coefficient between nicotine and middle Maximum, then the associated threshold , assuming that the overall correlation value ZG3 of MS3 is less than the correlation threshold GY3, stop iterating to select the characteristic wavelength, and then set MS3={ }middle As the characteristic wavelength of spectral data.
[0102] Step S5: determining a nicotine content prediction model according to the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and measuring the nicotine content in the e-liquid to be tested using the nicotine content prediction model.
[0103] Step S4 performs projection analysis on the wavelengths in the spectral data. The collinearity of the selected characteristic wavelengths will be reduced, which will reduce most of the redundant information to a certain extent. The prediction model is constructed using the response values of the characteristic wavelengths, which can improve the accuracy and stability of the nicotine content prediction model.
[0104] The response values of the characteristic wavelengths in the spectral data of each e-liquid sample are arranged in sequence to obtain the characteristic spectral response sequence of the corresponding e-liquid sample; the characteristic spectral response sequence of each e-liquid sample is used as input, and the nicotine content in the e-liquid sample is used as output, and the partial least squares method is used to build a model to obtain a nicotine content prediction model.
[0105] According to the difference between the content prediction value obtained by inputting the characteristic spectral response sequence of each e-liquid sample into the partial least squares method and the nicotine content of the e-liquid sample, the residual of each e-liquid sample is obtained; the regression coefficient is estimated by minimizing the residual sum of squares, and the regression coefficient is substituted into the model constructed by the partial least squares method to obtain the nicotine content prediction model. In this embodiment, the mean square error is selected to evaluate the quality of the model constructed by the partial least squares method, that is, the mean square error between the content prediction value corresponding to each e-liquid sample and the nicotine content is used as the residual of the corresponding e-liquid sample; in other embodiments, the root mean square error, determination coefficient and relative error can also be used to evaluate the quality of the model, which is not limited here.
[0106] It should be noted that the response values of the characteristic wavelengths of the spectral data in each e-liquid sample are arranged from small to large according to the characteristic wavelength to obtain a characteristic spectrum response sequence. Among them, the partial least squares method is a well-known technology for those skilled in the art and will not be described in detail here.
[0107] A near-infrared spectrometer is used to collect spectral data of the tested e-liquid, and the response values of characteristic wavelengths in the spectral data constitute a characteristic spectral response sequence of the tested e-liquid. The sequence is used as the input of a nicotine content prediction model, and the output value of the nicotine content prediction model is used as the nicotine content in the tested e-liquid, thereby completing the determination of the nicotine content in the tested e-liquid.
[0108] It should be noted that the method for obtaining the characteristic spectral response sequence of the e-liquid sample and the e-liquid to be tested is the same.
[0109] So far, the present invention is completed.
[0110] Embodiment 2:
[0111] The present invention proposes a system for rapidly determining the nicotine content in cigarette oil using near infrared spectroscopy. Figure 2, which shows a system structure diagram of a method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy provided by an embodiment of the present invention, the system comprising:
[0112] The data acquisition module 610 is used to obtain the spectral data of the e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; the content sequence is formed by the content of all components in the e-liquid samples;
[0113] The wavelength component correlation analysis module 620 is used to obtain the characteristic correlation coefficient between each wavelength in the spectral data and each component according to the difference between the abnormality degree of the spectral data and the content sequence of each e-liquid sample, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample;
[0114] The wavelength-nicotine correlation analysis module 630 is used to obtain the correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine;
[0115] A characteristic wavelength extraction module 640 is used to select a characteristic wavelength in the spectral data according to the projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data;
[0116] The nicotine content determination module 650 is used to determine a nicotine content prediction model based on the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and to determine the nicotine content in the e-liquid to be tested using the nicotine content prediction model.
[0117] It should be noted that: the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the system for rapidly determining the nicotine content in the e-liquid using near-infrared spectroscopy provided in the above embodiment and the method for rapidly determining the nicotine content in the e-liquid using near-infrared spectroscopy provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0118] Embodiment 3:
[0119] Figure 3 A computer device schematic diagram of a device for rapidly determining the nicotine content in e-liquid using near infrared spectroscopy provided by one embodiment of the present invention. Figure 3As shown, the computer device includes: a memory 701, a processor 702, and a computer program 703 stored in the memory 701 and running on the processor 702, wherein when the processor 702 executes the computer program 703, the computer device can execute any of the aforementioned methods for rapidly determining the nicotine content in the e-liquid using near-infrared spectroscopy.
[0120] In addition, an embodiment of the present application also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a method for quickly determining the nicotine content in e-liquid using near-infrared spectroscopy provided in an embodiment of the present application.
[0121] In this embodiment, the functional modules of the device can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0122] It should be understood that the device provided in this embodiment is used to execute the above-mentioned method for quickly determining the nicotine content in e-liquid using near-infrared spectroscopy, and thus can achieve the same effect as the above-mentioned implementation method.
[0123] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is applied to a device, the processing module may be used to control and manage the actions of the device. The storage module may be used to support the device to execute mutual program codes, etc.
[0124] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits included in the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0125] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0126] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy, characterized in that: The method includes: Obtaining spectral data of e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; forming a content sequence from the contents of all components in the e-liquid samples; According to the difference between the spectral data of each e-liquid sample and the abnormality degree of the content sequence, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample, a characteristic correlation coefficient between each wavelength in the spectral data and each component is obtained; Obtaining a correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine; Selecting a characteristic wavelength in the spectral data according to a projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data; A nicotine content prediction model is determined according to the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and the nicotine content in the e-liquid to be tested is measured using the nicotine content prediction model.
2. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 1, characterized in that: The step of obtaining the characteristic correlation coefficient between each wavelength and each component in the spectral data includes: The LOF value of the spectral data of each e-liquid sample is obtained by using the local outlier factor algorithm, which is recorded as the spectral anomaly score; the LOF value of the content sequence of each e-liquid sample is obtained by using the local outlier factor algorithm, which is recorded as the content anomaly score; The ratio of the spectral anomaly score to the content anomaly score of each e-liquid sample is recorded as a first value, and the ratio of the content anomaly score to the spectral anomaly score of each e-liquid sample is recorded as a second value; the maximum value between the first value and the second value is selected as the spectral anomaly value of each e-liquid sample; According to the spectral abnormal value, the correlation between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample is adjusted to obtain a characteristic correlation coefficient between each wavelength in the spectral data and each component.
3. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 2, characterized in that: The characteristic correlation coefficient between each wavelength and each component in the spectral data is expressed by the formula: In the formula, is the characteristic correlation coefficient between the ath wavelength and the bth component in the spectral data; N is the total number of e-liquid samples; is the spectral abnormal value of the nth e-liquid sample; is the response value of the ath wavelength in the nth e-liquid sample; is the mean of the response values of the ath wavelength in all e-liquid samples; is the content of the bth component in the nth e-liquid sample; is the average content of component b in all e-liquid samples; is the standard deviation of the response values of the ath wavelength in all e-liquid samples; is the standard deviation of the content of the bth component in all e-liquid samples; exp is an exponential function with the natural constant e as the base.
4. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 1, characterized in that: The correlation coefficient between each wavelength in the spectral data and nicotine includes: The maximum value of the characteristic correlation coefficients between each wavelength in the spectral data and the remaining components in the e-liquid sample except nicotine is used as the reference correlation coefficient of each wavelength in the spectral data; The ratio of the characteristic correlation coefficient between each wavelength in the spectral data and nicotine to the reference correlation coefficient is used as the correlation coefficient between each wavelength in the spectral data and nicotine.
5. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 1, characterized in that: The selecting characteristic wavelength in the spectral data comprises: The first characteristic wavelength is obtained, and the first characteristic wavelength constitutes an initial target wavelength set, the remaining wavelengths in the spectral data except the first characteristic wavelength constitute an initial candidate wavelength set, and the response values of the same wavelength in the spectral data of all e-liquid samples constitute a response vector of each wavelength; According to the correlation coefficients of the wavelengths in the target wavelength set and the projection values of the response vectors of the wavelengths in the target wavelength set on the response vectors of each wavelength in the to-be-selected wavelength set, the target wavelength set and the to-be-selected wavelength set are updated respectively; when the correlation coefficients of the wavelengths in the updated target wavelength set do not meet the to-be-selected condition, the updated target wavelength set and the to-be-selected wavelength set are continuously updated until the correlation coefficients of the wavelengths in the updated target wavelength set meet the to-be-selected condition; when the to-be-selected condition is met, the wavelengths in the updated target wavelength set are used as characteristic wavelengths in the spectral data.
6. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 5, characterized in that: The updating of the target wavelength set and the to-be-selected wavelength set respectively according to the correlation coefficients of the wavelengths in the target wavelength set and the projection values of the response vectors of the wavelengths in the target wavelength set on the response vectors of each wavelength in the to-be-selected wavelength set includes: Select one wavelength from the target wavelength set as the analysis wavelength, and select one wavelength from the candidate wavelength set as the candidate wavelength; Using a continuous projection algorithm, a projection value of the response vector of the analysis wavelength on the response vector of the selected wavelength is obtained, which is recorded as the original projection value of the two wavelengths; according to the correlation coefficient of the analysis wavelength and the original projection value, an initial improved projection value of the analysis wavelength and the selected wavelength is obtained; The cumulative sum of the initial improved projection values of all wavelengths in the target wavelength set and the selected wavelength is taken as the final improved projection value of the target wavelength set and the selected wavelength; the wavelength corresponding to the maximum value of the final improved projection values of all wavelengths in the selected wavelength set is taken as the target wavelength; The target wavelength is added to the target wavelength set to complete the update of the target wavelength set; the target wavelength in the to-be-selected wavelength set is deleted to complete the update of the to-be-selected wavelength set.
7. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 5, characterized in that: The correlation coefficient of the wavelength in the updated target wavelength set does not satisfy the selection condition, including: The average of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine is taken as the overall correlation value; The product of the maximum value of the correlation coefficients between all wavelengths in the updated target wavelength set and nicotine and a preset threshold is used as the correlation threshold; The candidate condition is: the overall correlation value is less than the correlation threshold.
8. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 5, characterized in that: The obtaining of the first characteristic wavelength comprises: The wavelength corresponding to the maximum value of the correlation coefficients between all wavelengths in the spectral data and nicotine is taken as the first characteristic wavelength.
9. The method for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy according to claim 1, characterized in that: The method of determining a nicotine content prediction model based on the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content includes: Arranging the response values of characteristic wavelengths in the spectral data of each e-liquid sample in order to obtain a characteristic spectral response sequence of the corresponding e-liquid sample; The characteristic spectral response sequence of each e-liquid sample is used as input, and the nicotine content in the e-liquid sample is used as output. Partial least squares method is used to build a model to obtain a nicotine content prediction model.
10. A system for rapidly determining the nicotine content in tobacco oil using near infrared spectroscopy, characterized in that: The system includes: The data acquisition module is used to obtain the spectral data of the e-liquid samples at different nicotine contents and the content of each component in the e-liquid samples; the content sequence is formed by the content of all components in the e-liquid samples; A wavelength component correlation analysis module, for obtaining a characteristic correlation coefficient between each wavelength in the spectral data and each component according to the difference between the spectral data of each e-liquid sample and the abnormality degree of the content sequence, and the correlation degree between the response value of each wavelength in the spectral data and the content of each component in the e-liquid sample; A wavelength-nicotine correlation analysis module, for obtaining a correlation coefficient between each wavelength in the spectral data and nicotine according to the relative magnitude of the characteristic correlation coefficients between each wavelength in the spectral data and nicotine and the remaining components in the e-liquid sample except nicotine; A characteristic wavelength extraction module, used for selecting a characteristic wavelength in the spectral data according to the projection relationship between different wavelengths in the spectral data and the correlation coefficient of each wavelength in the spectral data; The nicotine content determination module is used to determine a nicotine content prediction model based on the response values of characteristic wavelengths in the spectral data of all e-liquid samples and the nicotine content; and to determine the nicotine content in the e-liquid to be tested using the nicotine content prediction model.
Citation Information
Patent Citations
Modeling method of tobacco leaf conventional chemical component general model based on near infrared spectrum
CN115824996A
Spectral analysis device and analysis method for tobacco components
CN117092060A