Near-infrared rapid nondestructive quantitative detection method for THC and CBD in industrial hemp raw material
The near-infrared rapid non-destructive quantitative detection method solves the problems of rapid, accurate and large-scale application of THC and CBD detection in industrial hemp raw materials, realizing efficient quantitative detection of THC and CBD, which is suitable for online monitoring and legal and compliant use of industrial hemp raw materials.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 昆明海关技术中心
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for detecting THC and CBD in industrial hemp raw materials suffer from problems such as long detection cycles, low throughput, insufficient sample representativeness, easy overfitting of models, and sensitivity to noise, making it difficult to achieve rapid, accurate, and large-scale detection.
A rapid and non-destructive near-infrared quantitative detection method is adopted. The quantitative model is constructed by laboratory pretreatment, sample information database construction, spectral preprocessing and partial least squares regression (PLS) model. Combined with standard analytical techniques and near-infrared spectroscopy analysis, rapid and accurate quantitative detection of THC and CBD is achieved.
It enables rapid, non-destructive, and traceable large-scale detection, improving detection accuracy, model robustness, and generalization ability, making it suitable for online monitoring and legal and compliant use of industrial hemp raw materials.
Smart Images

Figure CN121877801A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial hemp raw material detection technology, and in particular to a near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials. Background Technology
[0002] THC (tetrahydrocannabinol) is a psychoactive cannabinoid and the core component of cannabis that causes hallucinogenic and stimulating effects. It binds to receptors in the human central nervous system, producing mood changes, sensory abnormalities, and other reactions; excessive use can lead to addiction. The key difference between industrial hemp and drug-grade cannabis is its THC content. CBD (cannabidiol) is a non-psychoactive cannabinoid and the core component utilized in industrial hemp. CBD does not produce hallucinogenic effects by binding to central nervous system receptors and possesses potential physiological activities such as anti-inflammatory, anti-anxiety, sedative, and sleep-improving effects.
[0003] Existing methods for detecting THC and CBD in industrial hemp raw materials mainly include high-performance liquid chromatography (HPLC), gas chromatography and gas chromatography-mass spectrometry (GC-MS), liquid chromatography-mass spectrometry (LC-MS), and immunochromatography. However, existing methods have the following drawbacks: 1) long detection cycles and low throughput, making them unsuitable for large-scale or real-time on-site detection; 2) insufficient sample representativeness and lack of information traceability, resulting in limited model application scope or unstable results; 3) severe variable redundancy, making models prone to overfitting, sensitive to noise, and exhibiting poor generalization ability; 4) some methods only measure THC or CBD without considering THCA / CBDA ratios or total amount conversion. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a rapid and non-destructive near-infrared quantitative detection method for THC and CBD in industrial hemp raw materials. This method can not only rapidly and quantitatively predict the content of THC and CBD in industrial hemp raw materials without damaging the sample, but also improve the prediction accuracy and model performance, making it suitable for large-scale applications.
[0005] To achieve the above objectives, the present invention provides the following solution: a near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials, comprising: Industrial hemp raw material samples are obtained, and laboratory pretreatment and sample information database construction are carried out on the industrial hemp raw material samples to obtain a standard sample set. The standard sample set is then divided into a first standard sample set and a second standard sample set. Based on the first set of standard samples, THC, CBD and acid type were determined using standard analytical methods to obtain a true value dataset. Based on the second set of standard samples, measurements are performed using a near-infrared instrument to obtain the original near-infrared spectral matrix. The original spectral matrix is then matched with the true dataset to obtain the label spectral dataset. For the aforementioned tagged spectral dataset, spectral preprocessing, wavelength filtering, data partitioning, and standardization are performed to obtain an optimized spectral dataset including a modeling set and a validation set. Using the modeling set and PLS algorithm, a PLS calibration model is constructed, and then the PLS calibration model is evaluated and verified using the validation set to obtain a quantitative model. Based on the quantitative model, near-infrared instrument configuration, software configuration, and operating procedure design are carried out to obtain a non-destructive quantitative detection system. The non-destructive quantitative detection system is used to quantitatively detect THC and CBD in industrial hemp raw materials.
[0006] Optionally, industrial hemp raw material samples are obtained, and laboratory pretreatment and sample information database construction are performed on the industrial hemp raw material samples to obtain a standard sample set. The standard sample set is then divided into a first standard sample set and a second standard sample set, including: A sample of industrial hemp raw material was obtained, and the sample was dried, manually chopped, and mixed evenly to obtain the original sample. Based on the original samples, sample numbering was designed and a sample information database was constructed to obtain a set of standard samples. The sample information database includes sample number, sampling date, sampling location, variety, growth date, plant part, drying method, pretreatment status, operator, and remarks. The standard sample set was divided into a first standard sample set and a second standard sample set, which were then sealed and stored for near-infrared spectral acquisition and laboratory true value analysis, respectively.
[0007] Optionally, using the aforementioned set of standard samples, THC, CBD, and acidity are determined using standard analytical methods to obtain a true dataset, including: High performance liquid chromatography-tandem mass spectrometry was selected as the standard analytical technique, and calibration curves for THC, THCA, CBD, and CBDA were constructed respectively. Based on the first set of standard samples, the standard analysis technique is used to sequentially perform sample weighing, solvent extraction, centrifugation and supernatant collection, dilution, filtration and addition of internal standard working solution to obtain the extract solution to be tested. The extract solution to be tested was analyzed by chromatography and mass spectrometry, and the chromatographic peak chromatogram and quantitative ion peak area data were output to obtain the raw signal; The THC and CBD values are calculated using the calibration curve and the original signal. Then, the THC and CBD values are subjected to quality checks and anomaly removal to obtain the true value dataset.
[0008] Optionally, the extract solution to be tested is subjected to chromatographic and mass spectrometric analysis to output chromatographic peak chromatograms and quantitative ion peak area data, thereby obtaining the raw signal, including: Based on the extract solution to be tested, the chromatographic conditions were obtained by setting the chromatographic column, mobile phase, gradient elution program, flow rate, column temperature, and injection volume. The mass spectrometry conditions were also obtained by setting the electrospray ionization source, positive and negative ion modes, ion pair monitoring, collision energy, and cone voltage. The extract solution to be tested is subjected to chromatographic and mass spectrometric analysis according to the chromatographic and mass spectrometric conditions, and the chromatographic peak chromatogram and quantitative ion peak area data are output to obtain the raw signal.
[0009] Optionally, the THC and CBD values are calculated using the calibration curve and the original signal, and then the THC and CBD values are subjected to quality checks and anomaly removal to obtain a true value dataset, including: For the extract solution to be tested, the integrated peak areas of THC, THCA, CBD and CBDA in the chromatogram are calculated. The integrated peak areas are then substituted into their respective calibration curves to obtain the concentrations of each component. Based on the concentrations of each component, the mass fraction of each component is calculated. By combining the conversion factor and the mass fraction of each component, the THC value and CBD value are calculated. Then, the THC value and CBD value are subjected to quality checks and anomaly removal to obtain the true value dataset.
[0010] Optionally, based on the second set of standard samples, measurements are performed using a near-infrared instrument to obtain a raw near-infrared spectral matrix. This raw near-infrared spectral matrix is then matched with the ground truth dataset to obtain a labeled spectral dataset, including: Select the type of near-infrared instrument, set the wavelength range and measurement mode of the selected near-infrared instrument, and standardize the near-infrared measurement conditions and sample loading method to standardize the near-infrared measurement operation procedures. Using the aforementioned near-infrared instrument, the second set of standard samples is measured by averaging repeated measurements, and the measurement results are saved in matrix form to obtain the original near-infrared spectral matrix; A unified index key is constructed, and the original near-infrared spectral matrix is matched with the ground truth dataset based on the unified index key to obtain the labeled spectral dataset.
[0011] Optionally, a unified index key is constructed, and the original near-infrared spectral matrix is matched with the ground truth dataset based on the unified index key to obtain a labeled spectral dataset, including: Set the sample number as a unique key, and connect the unique key with the sample information database, the truth dataset, and the original near-infrared spectral matrix to obtain a unified index key; For the second set of standard samples, the corresponding THC content, THCA content, CBD content, CBDA content, total THC content, and total CBD content are extracted from the truth dataset to obtain the extracted content data; The original near-infrared spectral matrix is matched with the extracted content data to obtain an initial pairing relationship. Then, the initial pairing relationship is checked for spectral quality, content data rationality, and joint spectral and content data to obtain a label spectral dataset.
[0012] Optionally, for the labeled spectral dataset, spectral preprocessing, wavelength filtering, data partitioning, and standardization are performed to obtain an optimized spectral dataset including a modeling set and a validation set, including: Based on the tagged spectral dataset, high-frequency noise is removed by smoothing filtering, scattering correction is performed by multivariate scattering correction or standard normal transformation, and baseline and overlapping peak correction is performed by first and second derivatives to complete the spectral preprocessing operation. Based on the labeled spectral dataset that has undergone spectral preprocessing, effective variables related to THC and CBD are selected from the wavelengths to obtain the feature spectral matrix; The feature spectral matrix is standardized, and then divided into a modeling set and a validation set in an 8:2 ratio to obtain an optimized spectral dataset.
[0013] Optionally, based on the labeled spectral dataset after spectral preprocessing, effective variables related to THC and CBD are selected from the wavelengths to obtain a feature spectral matrix, including: Based on the labeled spectral dataset that has undergone spectral preprocessing, bands with severe noise or no information are removed to reduce the number of useless variables, resulting in the first spectral matrix. Based on the first spectral matrix, the Pearson correlation coefficient between each wavelength point and the target content data is calculated to obtain the absolute correlation coefficient. Then, bands with absolute correlation coefficients close to 0 are removed to obtain the second spectral matrix. Based on the second spectral matrix, a partial least squares regression model is constructed. The variable importance projection value for each wavelength is calculated using the partial least squares regression model. Wavelengths with variable importance projection values greater than 1 are retained to obtain the feature spectral matrix.
[0014] Optionally, using the modeling set and the PLS algorithm, a PLS calibration model is constructed, and then the PLS calibration model is evaluated and validated using the validation set to obtain a quantitative model, including: The PLS algorithm is called in the modeling software, the modeling set is set as the independent variable, and the THC content and CBD content are set as the dependent variables to construct a THC correction model, a CBD correction model, and a PLS correction model. The validation set is input into the PLS correction model for prediction to obtain the validation prediction results. The prediction determination coefficient, prediction mean square error, and residual prediction deviation ratio of the validation prediction results are calculated. An evaluation reference standard is designed, and the evaluation results are obtained according to the evaluation reference standard. Based on the evaluation results, the PLS correction model is optimized to obtain a quantitative model. The quantitative model is then saved in mathematical form to obtain a model file, and the interface for using the model file is defined.
[0015] This invention discloses the following technical advantages by providing a rapid, non-destructive near-infrared quantitative detection method for THC and CBD in industrial hemp raw materials: 1. Standardized and traceable data chain: Through sample numbering, information database, index keys, etc., the risk of model failure caused by sample confusion and data mismatch is greatly reduced, and a traceable basis is provided for subsequent method optimization and model update.
[0016] 2. The high coupling between truth value determination and near-infrared modeling ensures model reliability: high-quality truth values, accurate pairing, and outlier removal make the THC and CBD predicted by the near-infrared quantitative model closer to the gold standard in the laboratory; the robustness and generalization ability of the model are significantly improved, and it performs more stably in actual production scenarios.
[0017] 3. Systematic spectral preprocessing and characteristic wavelength selection improve model performance and interpretability: effectively reduce redundant dimensions and improve modeling efficiency; the model is more sensitive to spectral features that are truly related to THC and CBD content, resulting in higher prediction accuracy; the characteristic wavelengths have a certain degree of mechanistic interpretability, which is conducive to the scientific demonstration of the method and regulatory acceptance.
[0018] 4. Through PLS modeling, evaluation and optimization, an engineering-grade quantitative model is formed: the modeling and evaluation process is standardized, highly reproducible, and conducive to method interoperability among multiple institutions; the optimized quantitative model can be directly integrated into near-infrared instruments to achieve one-click detection; and it provides an scalable framework for adding other components (such as other cannabinoids) in the future.
[0019] 5. A complete, rapid, non-destructive quantitative detection system suitable for large-scale applications: It significantly improves detection efficiency, reduces inspection costs, and enables non-destructive testing, which is beneficial for online monitoring of the production process and large-sample sampling; it has important application value for ensuring the legal and compliant use of industrial hemp and quickly determining whether the THC content exceeds the standard.
[0020] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the method flow provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the process of tag spectral data provided in an embodiment of the present invention; Figure 3 A flowchart illustrating the model construction process provided in this embodiment of the invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] like Figure 1 As shown, this invention provides a near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials, comprising: Step 1, as follows Figure 2 As shown, industrial hemp raw material samples are obtained, and laboratory pretreatment and sample information database construction are carried out on the industrial hemp raw material samples to obtain a standard sample set. The standard sample set is then divided into a first standard sample set and a second standard sample set.
[0026] Step 1 includes: 1.1 Obtain industrial hemp raw material samples, dry the industrial hemp raw material samples, manually cut and mix them evenly to obtain the original samples.
[0027] Drying treatment: To control the moisture content and reduce the interference of moisture differences on the near-infrared spectrum, the sample can be spread out in a well-ventilated, cool indoor place for pre-drying for 12-24 hours at a temperature of 35-40 degrees Celsius, and then placed in an oven for low-temperature drying.
[0028] Manually shredding the sample reduces the impact of particle size differences on near-infrared diffuse reflectance, while avoiding grinding the sample into powder, thus more closely mimicking actual online detection conditions. Obvious impurities are removed to ensure the near-infrared measurement area remains the target matrix.
[0029] 1.2 Based on the original samples, sample numbering is designed and a sample information database is constructed to obtain a set of standard samples; the sample information database includes sample number, sampling date, sampling location, variety, growth date, plant part, drying method, pretreatment status, operator and remarks.
[0030] 1.3 The standard sample set is divided into a first standard sample set and a second standard sample set, which are then sealed and stored for near-infrared spectral acquisition and laboratory true value analysis, respectively.
[0031] Step 2, as follows Figure 2 As shown, based on the first set of standard samples, THC, CBD and acid type were determined using standard analytical methods to obtain a true value dataset.
[0032] Step 2 includes: 2.1 High performance liquid chromatography-tandem mass spectrometry was selected as the standard analytical technique, and calibration curves for THC, THCA, CBD, and CBDA were constructed respectively. The calibration curves provide a mathematical basis for calculating the accurate quantification of each component in the sample.
[0033] 2.2 Based on the first set of standard samples, the standard analysis technique is used to sequentially perform sample weighing, solvent extraction, centrifugation and supernatant collection, dilution, filtration and addition of internal standard working solution to obtain the extract solution to be tested.
[0034] 2.3 Perform chromatographic and mass spectrometric analysis on the extracted solution to be tested, output chromatographic peak chromatograms and quantitative ion peak area data, and obtain the raw signal; specifically including: Based on the extract solution to be tested, the chromatographic conditions were obtained by setting the chromatographic column, mobile phase, gradient elution program, flow rate, column temperature, and injection volume. The mass spectrometry conditions were also obtained by setting the electrospray ionization source, positive and negative ion modes, ion pair monitoring, collision energy, and cone voltage.
[0035] The extract solution to be tested is subjected to chromatographic and mass spectrometric analysis according to the chromatographic and mass spectrometric conditions, and the chromatographic peak chromatogram and quantitative ion peak area data are output to obtain the raw signal.
[0036] 2.4 Calculate the THC and CBD values using the calibration curve and the original signal, then perform quality checks and anomaly removal on the THC and CBD values to obtain the true value dataset. Specifically, this includes: For the extract solution to be tested, the integrated peak areas of THC, THCA, CBD and CBDA in the chromatogram are calculated. The integrated peak areas are then substituted into their respective calibration curves to obtain the concentrations of each component. Based on the concentrations of each component, the mass fraction of each component is calculated.
[0037] By combining the conversion factor and the mass fraction of each component, the THC value and CBD value are calculated. Then, the THC value and CBD value are subjected to quality checks and anomaly removal, that is, checking for abnormal peak shape, retention time drift, low response, etc., to obtain the true value dataset.
[0038] Step 3, as follows Figure 2 As shown, based on the second set of standard samples, measurements are performed using a near-infrared instrument to obtain the original near-infrared spectral matrix. Then, the original spectral matrix is matched with the true dataset to obtain the tag spectral dataset.
[0039] Step 3 includes: 3.1 Select the type of near-infrared instrument, set the wavelength range and measurement mode of the selected near-infrared instrument, and standardize the near-infrared measurement conditions and sample loading method to standardize the near-infrared measurement operation procedures.
[0040] If the main sample is dried flower spikes / leaves, and the future application is to conduct rapid testing in factories or bases, a laboratory benchtop NIR spectrometer (integrating sphere diffuse reflectance mode) or a portable NIR spectrometer (probe contact diffuse reflectance mode) can be selected.
[0041] Recommended wavelength range: full-spectrum near-infrared, 800-2500 nm; or narrowed to 900-1700 nm.
[0042] Measurement mode: Diffuse reflection mode is most suitable for solid bulk samples (flower spikes, leaves); transmission or transmissive reflection mode can be selected for some liquid samples, but at this stage, when solid raw materials are the main focus, only diffuse reflection needs to be considered.
[0043] 3.2 Using the aforementioned near-infrared instrument, the second set of standard samples is measured by averaging repeated measurements, and the measurement results are saved in matrix form to obtain the original near-infrared spectral matrix.
[0044] Repeated measurements and averaged: For example, measure each sample 3-5 times; before each measurement, slightly rotate the sample cup or refill the sample to make a slight change on the surface being measured.
[0045] 3.3 Construct a unified index key. Based on the unified index key, match the original near-infrared spectral matrix with the ground truth dataset to obtain the labeled spectral dataset. Specifically, this includes: Set the sample number as a unique key, and connect the unique key with the sample information database, the truth dataset, and the original near-infrared spectral matrix to obtain a unified index key; For the second set of standard samples, the corresponding THC content, THCA content, CBD content, CBDA content, total THC content, and total CBD content are extracted from the truth dataset to obtain the extracted content data.
[0046] The original near-infrared spectral matrix is matched with the extracted content data to obtain an initial pairing relationship. Then, the initial pairing relationship is checked for spectral quality, content data rationality, and joint spectral and content data to obtain a label spectral dataset.
[0047] Spectral quality check: Randomly select several sample spectra and overlay them to check for excessive noise, abnormal baseline drift, or reflectance / absorbance values in certain bands that significantly exceed the reasonable range. For obviously abnormal spectra, check the original records to see if there are sample loading errors or abnormal instrument conditions.
[0048] Content data rationality check: Statistical analysis of the distribution of THC, total THC, CBD, and total CBD, drawing histograms and box plots to check for impossible values, such as negative values or extremely large values.
[0049] Joint inspection of spectral and content data: Select several samples with extremely high and extremely low content and compare whether their spectra show significant differences in certain bands; if some samples have extreme content but their spectra completely overlap and show no difference, it indicates that there is an error in chromatographic quantification or sample number matching, which needs to be verified.
[0050] Step 4, as follows Figure 3 As shown, for the labeled spectral dataset, spectral preprocessing, wavelength filtering, data partitioning and standardization are performed to obtain an optimized spectral dataset including a modeling set and a validation set.
[0051] Step 4 includes: 4.1 Based on the tagged spectral dataset, high-frequency noise is removed by smoothing filtering, scattering correction is performed by multivariate scattering correction or standard normal transformation, and baseline and overlapping peak correction is performed by first and second derivatives to complete the spectral preprocessing operation.
[0052] 4.2 Based on the tagged spectral dataset after spectral preprocessing, effective variables related to THC and CBD are selected from the wavelengths to obtain the feature spectral matrix; specifically including: Based on the labeled spectral dataset that has undergone spectral preprocessing, bands with severe noise or no information are removed to reduce the number of useless variables, resulting in the first spectral matrix.
[0053] Based on the first spectral matrix, the Pearson correlation coefficient between each wavelength point and the target content data is calculated to obtain the absolute correlation coefficient. Then, bands with absolute correlation coefficients close to 0 are removed to obtain the second spectral matrix.
[0054] Based on the second spectral matrix, a partial least squares regression model is constructed. The variable importance projection value for each wavelength is calculated using the partial least squares regression model. Wavelengths with variable importance projection values greater than 1 are retained to obtain the feature spectral matrix.
[0055] 4.3 The feature spectral matrix is standardized, and then divided into a modeling set and a validation set in an 8:2 ratio to obtain an optimized spectral dataset.
[0056] Step 5, as follows Figure 3 As shown, a PLS calibration model is constructed using the modeling set and the PLS algorithm, and then the PLS calibration model is evaluated and verified using the validation set to obtain a quantitative model.
[0057] Step 5 includes: 5.1 In the modeling software, call the PLS algorithm, set the modeling set as the independent variable, and set the THC content and CBD content as the dependent variables to construct a THC correction model, a CBD correction model, and a PLS correction model.
[0058] 5.2 Input the validation set into the PLS correction model for prediction to obtain the validation prediction results. Calculate the prediction determination coefficient, prediction mean square error, and residual prediction deviation ratio of the validation prediction results. Design an evaluation reference standard and obtain the evaluation results based on the evaluation reference standard.
[0059] 5.3 Based on the evaluation results, the PLS correction model is optimized to obtain a quantitative model. The quantitative model is saved in mathematical form to obtain a model file, and the interface for using the model file is defined.
[0060] Step 6: Based on the quantitative model, configure the near-infrared instrument, software, and design the operating procedures to obtain a non-destructive quantitative detection system. Use the non-destructive quantitative detection system to quantitatively detect THC and CBD in industrial hemp raw materials.
[0061] Therefore, this invention provides a rapid and non-destructive near-infrared quantitative detection method for THC and CBD in industrial hemp raw materials. This method not only enables rapid quantitative prediction of the THC and CBD content in industrial hemp raw materials without damaging the sample, but also improves prediction accuracy and model performance, making it suitable for large-scale applications.
[0062] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0063] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials, characterized in that, include: Industrial hemp raw material samples are obtained, and laboratory pretreatment and sample information database construction are carried out on the industrial hemp raw material samples to obtain a standard sample set. The standard sample set is then divided into a first standard sample set and a second standard sample set. Based on the first set of standard samples, THC, CBD and acid type were determined using standard analytical methods to obtain a true value dataset. Based on the second set of standard samples, measurements are performed using a near-infrared instrument to obtain the original near-infrared spectral matrix. The original spectral matrix is then matched with the true dataset to obtain the label spectral dataset. For the aforementioned tagged spectral dataset, spectral preprocessing, wavelength filtering, data partitioning, and standardization are performed to obtain an optimized spectral dataset including a modeling set and a validation set. Using the modeling set and PLS algorithm, a PLS calibration model is constructed, and then the PLS calibration model is evaluated and verified using the validation set to obtain a quantitative model. Based on the quantitative model, near-infrared instrument configuration, software configuration, and operating procedure design are carried out to obtain a non-destructive quantitative detection system. The non-destructive quantitative detection system is used to quantitatively detect THC and CBD in industrial hemp raw materials.
2. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 1, characterized in that, Industrial hemp raw material samples are obtained, and laboratory pretreatment and sample information database construction are performed on the industrial hemp raw material samples to obtain a standard sample set. The standard sample set is then divided into a first standard sample set and a second standard sample set, including: A sample of industrial hemp raw material was obtained, and the sample was dried, manually chopped, and mixed evenly to obtain the original sample. Based on the original samples, sample numbering was designed and a sample information database was constructed to obtain a set of standard samples. The sample information database includes sample number, sampling date, sampling location, variety, growth date, plant part, drying method, pretreatment status, operator, and remarks. The standard sample set was divided into a first standard sample set and a second standard sample set, which were then sealed and stored for near-infrared spectral acquisition and laboratory true value analysis, respectively.
3. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 2, characterized in that, Using the aforementioned set of standard samples, THC, CBD, and acidity were determined using standard analytical methods to obtain a true dataset, including: High performance liquid chromatography-tandem mass spectrometry was selected as the standard analytical technique, and calibration curves for THC, THCA, CBD, and CBDA were constructed respectively. Based on the first set of standard samples, the standard analysis technique is used to sequentially perform sample weighing, solvent extraction, centrifugation and supernatant collection, dilution, filtration and addition of internal standard working solution to obtain the extract solution to be tested. The extract solution to be tested was analyzed by chromatography and mass spectrometry, and the chromatographic peak chromatogram and quantitative ion peak area data were output to obtain the raw signal; The THC and CBD values are calculated using the calibration curve and the original signal. Then, the THC and CBD values are subjected to quality checks and anomaly removal to obtain the true value dataset.
4. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 3, characterized in that, The extract solution to be tested is subjected to chromatographic and mass spectrometric analysis, and the chromatographic peak chromatogram and quantitative ion peak area data are output to obtain the raw signal, including: Based on the extract solution to be tested, the chromatographic conditions were obtained by setting the chromatographic column, mobile phase, gradient elution program, flow rate, column temperature, and injection volume. The mass spectrometry conditions were also obtained by setting the electrospray ionization source, positive and negative ion modes, ion pair monitoring, collision energy, and cone voltage. The extract solution to be tested is subjected to chromatographic and mass spectrometric analysis according to the chromatographic and mass spectrometric conditions, and the chromatographic peak chromatogram and quantitative ion peak area data are output to obtain the raw signal.
5. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 4, characterized in that, The THC and CBD values are calculated using the calibration curve and the original signal. Then, the THC and CBD values are subjected to quality checks and anomaly removal to obtain a true value dataset, including: For the extract solution to be tested, the integrated peak areas of THC, THCA, CBD and CBDA in the chromatogram are calculated. The integrated peak areas are then substituted into their respective calibration curves to obtain the concentrations of each component. Based on the concentrations of each component, the mass fraction of each component is calculated. By combining the conversion factor and the mass fraction of each component, the THC value and CBD value are calculated. Then, the THC value and CBD value are subjected to quality checks and anomaly removal to obtain the true value dataset.
6. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 5, characterized in that, Based on the second set of standard samples, measurements are performed using a near-infrared instrument to obtain the original near-infrared spectral matrix. This original near-infrared spectral matrix is then matched with the ground truth dataset to obtain the labeled spectral dataset, which includes: Select the type of near-infrared instrument, set the wavelength range and measurement mode of the selected near-infrared instrument, and standardize the near-infrared measurement conditions and sample loading method to standardize the near-infrared measurement operation procedures. Using the aforementioned near-infrared instrument, the second set of standard samples is measured by averaging repeated measurements, and the measurement results are saved in matrix form to obtain the original near-infrared spectral matrix; A unified index key is constructed, and the original near-infrared spectral matrix is matched with the ground truth dataset based on the unified index key to obtain the labeled spectral dataset.
7. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 6, characterized in that, A unified index key is constructed, and the original near-infrared spectral matrix is matched with the ground truth dataset based on the unified index key to obtain a labeled spectral dataset, including: Set the sample number as a unique key, and connect the unique key with the sample information database, the truth dataset, and the original near-infrared spectral matrix to obtain a unified index key; For the second set of standard samples, the corresponding THC content, THCA content, CBD content, CBDA content, total THC content, and total CBD content are extracted from the truth dataset to obtain the extracted content data; The original near-infrared spectral matrix is matched with the extracted content data to obtain an initial pairing relationship. Then, the initial pairing relationship is checked for spectral quality, content data rationality, and joint spectral and content data to obtain a label spectral dataset.
8. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 7, characterized in that, For the labeled spectral dataset, spectral preprocessing, wavelength selection, data partitioning, and standardization are performed to obtain an optimized spectral dataset including a modeling set and a validation set, including: Based on the tagged spectral dataset, high-frequency noise is removed by smoothing filtering, scattering correction is performed by multivariate scattering correction or standard normal transformation, and baseline and overlapping peak correction is performed by first and second derivatives to complete the spectral preprocessing operation. Based on the labeled spectral dataset that has undergone spectral preprocessing, effective variables related to THC and CBD are selected from the wavelengths to obtain the feature spectral matrix; The feature spectral matrix is standardized, and then divided into a modeling set and a validation set in an 8:2 ratio to obtain an optimized spectral dataset.
9. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 8, characterized in that, Based on the labeled spectral dataset after spectral preprocessing, effective variables related to THC and CBD are selected from the wavelengths to obtain a feature spectral matrix, including: Based on the labeled spectral dataset that has undergone spectral preprocessing, bands with severe noise or no information are removed to reduce the number of useless variables, resulting in the first spectral matrix. Based on the first spectral matrix, the Pearson correlation coefficient between each wavelength point and the target content data is calculated to obtain the absolute correlation coefficient. Then, bands with absolute correlation coefficients close to 0 are removed to obtain the second spectral matrix. Based on the second spectral matrix, a partial least squares regression model is constructed. The variable importance projection value for each wavelength is calculated using the partial least squares regression model. Wavelengths with variable importance projection values greater than 1 are retained to obtain the feature spectral matrix.
10. The near-infrared rapid non-destructive quantitative detection method for THC and CBD in industrial hemp raw materials according to claim 9, characterized in that, Using the modeling set and PLS algorithm, a PLS calibration model is constructed. This model is then evaluated and validated using the validation set to obtain a quantitative model, including: The PLS algorithm is called in the modeling software, the modeling set is set as the independent variable, and the THC content and CBD content are set as the dependent variables to construct a THC correction model, a CBD correction model, and a PLS correction model. The validation set is input into the PLS correction model for prediction to obtain the validation prediction results. The prediction determination coefficient, prediction mean square error, and residual prediction deviation ratio of the validation prediction results are calculated. An evaluation reference standard is designed, and the evaluation results are obtained according to the evaluation reference standard. Based on the evaluation results, the PLS correction model is optimized to obtain a quantitative model. The quantitative model is then saved in mathematical form to obtain a model file, and the interface for using the model file is defined.