A method for detecting adulteration and quality control of rhizoma corydalis
By combining the THz-TDS system with the UMAP algorithm and DCNN classifier for spectral dimensionality reduction, and then with the XGBoost regression model, the problem of rapid and accurate detection of adulteration of Corydalis yanhusuo and Xia Tian was solved, achieving non-destructive and efficient adulteration detection and concentration prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE FIRST AFFILIATED HOSPITAL OF GUANGXI UNIV OF TRADITIONAL CHINESE MEDICINE (GUANGXI TRADITIONAL CHINESE MEDICINE HOSPITAL)
- Filing Date
- 2026-04-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are insufficient for the rapid and non-destructive identification and detection of adulteration with Corydalis yanhusuo and Xia Tianwu. Furthermore, existing THz spectral data processing methods are complex and difficult to achieve efficient and accurate adulteration detection.
The THz-TDS system, combined with the UMAP algorithm and DCNN classifier, is used for spectral dimensionality reduction. The XGBoost regression model is used for adulteration detection. Qualitative and quantitative detection are achieved through feature extraction and sample set partitioning.
It achieves non-destructive and efficient detection of Corydalis adulteration, improving the accuracy and efficiency of detection and enabling precise identification of adulteration concentration.
Smart Images

Figure CN122149954A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of adulteration screening, specifically to a method for detecting and controlling adulteration of Corydalis rhizome. Background Technology
[0002] Due to their highly similar morphological characteristics, Corydalis rhizome and Summer Pepper are easily confused during harvesting, distribution, and sales, and can even be misused. Corydalis rhizome, as a frequently used and in-demand traditional Chinese medicine, has high economic value and is therefore often targeted for adulteration and counterfeiting. Although current pharmacopoeia methods can identify it, most rely on experience or complex pretreatment processes, which are insufficient for rapid, non-destructive on-site quality control.
[0003] THz spectroscopy lies between microwave and infrared spectroscopy, with a frequency range of 0.1 to 10.0 THz. Radiation in this band can excite rotational and vibrational modes within molecules, thus forming unique spectral characteristics, which are considered the fingerprints of materials. Different Chinese medicinal herbs exhibit unique differences in their molecular structures and arrangements in THz spectra; therefore, analyzing the THz spectral fingerprints of these herbs can effectively identify their chemical composition. Furthermore, the THz band's advantages of low energy and high penetration make this technology ideal for non-destructive, rapid, and accurate quality testing of Chinese medicinal herbs.
[0004] However, the components of traditional Chinese medicine (TCM) are complex, and their THz spectra often contain the superposition of multiple components, making direct interpretation difficult. Furthermore, THz spectral data is high-dimensional, nonlinear, and redundant, requiring qualitative and quantitative analysis using chemometrics and machine learning methods. Currently, the use of UMAP-DCNN classification models and SPXY-XGBoost regression prediction models based on the THz-TDS (Terahertz time-domain spectroscopy) system for detecting adulteration in Corydalis yanhusuo is still in its infancy. Therefore, developing efficient and accurate detection technologies for Corydalis yanhusuo adulteration based on chemometrics and machine learning is of great significance for ensuring the quality of TCM and the safety of clinical medication. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a method for detecting and controlling adulteration of Corydalis rhizome.
[0006] To achieve the above technology, the specific steps are as follows: S1. Pretreatment was performed on samples of Corydalis and Summer-Summer to obtain tablet samples with different adulteration concentrations. S2. Based on S1, the THz-TDS system was used to irradiate the processed Corydalis and Summer Wu samples to obtain the raw absorbance spectral data of each sample, and the absorbance spectrum within a specific frequency range was extracted. S3. Apply the Tukey window function to the absorbance spectra of summer and Corydalis obtained in S2 for preprocessing. Use the UMAP algorithm to reduce the dimensionality of the preprocessed spectral data to obtain the input spectral feature matrix. S4. Input the feature matrix obtained in S3 into a deep convolutional neural network classifier for qualitative identification; S5. Process the raw absorbance spectral data obtained in S2 with a Tukey window function, and use the SPXY algorithm to divide the sample set into training set and test set according to a preset ratio. S6. Input the training set obtained in S5 into the XGBoost regression model to predict the doping concentration. S7. Integrate the qualitative classification results obtained in S4 with the quantitative concentration prediction results obtained in S6 to form a complete detection result for adulteration of Corydalis rhizome.
[0007] Preferably, the method for obtaining tablet samples with different adulteration concentrations in S1 includes: crushing, sieving and drying Corydalis and Xia Tianwu samples respectively, and then mixing them with high-density polyethylene at a preset mass ratio; then using Corydalis as a matrix, Xia Tianwu is added stepwise at fixed gradient intervals to prepare samples with different adulteration concentrations; and finally, after pressing and drying the sample powder, tablet samples are obtained.
[0008] Preferably, the target dimension after dimensionality reduction in S3 is 3, while retaining key features including the position, intensity and trend of absorption peaks in the terahertz spectrum, to form the input spectral feature matrix.
[0009] Preferably, the deep convolutional neural network in S4 is a DCNN, and the network structure includes convolutional layers, pooling layers, and fully connected layers. Finally, the classification result is output through the softmax function.
[0010] Preferably, in S6, the training set data obtained in S5 is input into the XGBoost regression model for training. The model is ensembled using decision trees and optimizes the objective function by combining first-order and second-order derivative information, as follows: In the formula, This represents the objective function value in the t-th iteration; This represents the total number of training samples. Indicates the index of the training sample; Represents the decision tree function; Indicates the first One sample; Indicates the first The first derivative of each sample; Indicates the first The second derivative of each sample; Indicates the penalty coefficient for leaf nodes; This represents the number of leaf nodes in the tree, where m represents the index of a leaf node. Represents the L2 regularization coefficient; This represents the weight of the m-th leaf node; This represents the scaling factor.
[0011] The beneficial effects of this invention are: This invention is based on the obvious absorption characteristics of Corydalis yanhusuo and its counterfeits in the THz spectral region, thereby obtaining the original transmission spectrum data. The UMAP algorithm is used to perform feature dimensionality reduction on the spectral data, while retaining the key features in the data. Data redundancy is removed while ensuring the accuracy of convolutional neural network classification.
[0012] This invention combines the SPXY algorithm for sample segmentation and utilizes the XGBoost regression model to predict adulteration concentration, generating regression results to achieve non-destructive, efficient, and accurate prediction of Corydalis adulteration concentration. This method significantly improves the efficiency and accuracy of Corydalis adulteration detection, has broad application prospects, and possesses significant application value in the field of Corydalis adulteration detection. Attached Figure Description
[0013] Figure 1 This is a flowchart of the steps of the present invention; Figure 2 This is a schematic diagram of the dimensionality reduction visualization results of Corydalis yanhusuo and its adulterant, Xia Tianwu, under the classification model. Figure 3 This is a schematic diagram illustrating the effect of predicting the adulteration concentration of Corydalis in the regression results of the test set in the example. Detailed Implementation
[0014] The present invention will be further described in detail below with reference to specific embodiments.
[0015] In this embodiment, 160 sets of samples are used for classification, with 80 sets of samples each for Corydalis and Summer-Nourishing. 80% of the samples are used as the training set and 20% of the samples are used as the test set, that is, each type of sample contains 64 training samples and 16 test samples.
[0016] S1, Corydalis and Summer No. sample pretreatment; The samples of Corydalis yanhusuo and Xia Tianwu were pulverized using a JXFSTPRP-24L pulverizer and then passed through a 200-mesh sieve to obtain uniformly sized powder. They were then dried in a YB-IA vacuum drying oven at 50℃ for 30 minutes. After drying, the Corydalis yanhusuo and Xia Tianwu were mixed uniformly with high-density polyethylene (HDPE) at a mass ratio of 1:3. Using Corydalis yanhusuo as the matrix, Xia Tianwu was gradually added to prepare gradient samples with adulteration concentrations ranging from 5% to 75% (increasing in 5% increments), totaling 15 concentration levels. Eight parallel samples were prepared for each concentration. The adulteration was measured using a FA2004B electronic... 200 mg of sample powder was weighed using an analytical balance. The sample powder was pressed using an FM-4A tablet press under a pressure of 10 MPa for 2-3 minutes using a mold provided with the press, yielding a sample tablet with a diameter of 13 mm and a thickness of 1 mm. The prepared sample tablet was then placed in a YB-IA type vacuum constant temperature drying oven and dried at 50°C for 30-40 minutes. The adulteration concentration was defined as the percentage of the mass of *Corydalis yanhusuo* (a type of phytoalexin) added to the matrix *Corydalis yanhusuo* and the total mass of *Corydalis yanhusuo* added. The prepared *Corydalis yanhusuo*, *Corydalis yanhusuo*, and sample tablets with different adulteration concentrations were obtained for subsequent spectral acquisition.
[0017] S2. The treated Corydalis and Summer Heatless samples were irradiated using a THz-TDS system to obtain the raw absorbance spectral data of each sample, and the absorbance spectra at frequencies of 0.3THz-1THz were extracted.
[0018] S3. Apply the Tukey window function to the absorbance spectra of summer and Corydalis obtained in S2 for preprocessing. Use the UMAP algorithm to reduce the dimensionality of the preprocessed spectral data to obtain the input spectral feature matrix. The dimensionality of the spectral data is reduced from thousands to single digits while retaining the key features of the original spectrum. In this invention, the target dimension is set to 3, namely UMAP_1, UMAP_2 and UMAP_3. The key features include the position of the absorption peak in the terahertz spectrum, the intensity of the absorption peak and the trend of its variation. These features can reflect the differences between different samples and are the most representative information in terahertz spectral analysis. When using UMAP to reduce the dimensionality of terahertz spectral data, although the dimensionality of the spectral data is reduced from high to low, the relative relationship between samples in the spectral data is maintained, so that samples with similar spectral features remain similarly distributed after dimensionality reduction, thus ensuring that the above key features are not lost.
[0019] S4. Input the feature matrix obtained in S3 into a deep convolutional neural network (DCNN) classifier for qualitative identification; The network structure includes convolutional layers, pooling layers, and fully connected layers, ultimately outputting the classification result through the softmax function. The feature matrix undergoes convolution operations through the convolutional layers, where the convolutional kernel is multiplied point-by-point with the input feature map and then summed. The formula is as follows: In the formula, Indicates the first Layer The output feature map of each convolutional kernel; This indicates the size of the local region covered by the convolution kernel. Indicates the traversal index of a local region; Indicates the first Layer One input feature matrix; No. Layer The first convolutional kernel Each convolutional kernel weight; Indicates the first Layer One bias term; After passing through convolutional and pooling layers, the feature map is flattened and fed into a fully connected layer to generate the final classification result. The classifier is calculated through forward propagation, as shown in the formula: In the formula, Indicates the output vector; Indicates the activation function; This represents the learnable parameter matrix of the fully connected layer; This represents a one-dimensional feature vector that has been flattened after passing through convolutional and pooling layers. Indicates the bias term; The model was trained using 128 training samples and its classification performance was evaluated using 32 test samples. The classification accuracy reached 100.00%, and the visualization results are as follows. Figure 2 As shown.
[0020] In concentration prediction, 1200 sets of samples were used to predict the adulteration concentration, which ranged from 5% to 75%, with 15 concentrations in 5% intervals, and each concentration contained 80 sets of samples.
[0021] S5. The raw absorbance spectral data with 5%-75% doping concentration obtained in S2 are processed with the Tukey window function, and the SPXY algorithm is used to divide the sample set into training and test sets in a 4:1 ratio to ensure uniform sample distribution.
[0022] S6. Input the training set obtained in S5 into the XGBoost regression model to predict the doping concentration. The XGBoost model consists of two parts: a loss function and a regularization term. The model optimizes the objective function by ensembling multiple decision trees and incorporating first- and second-order derivative information, ultimately predicting the doping concentration. Specifically, let the model have... If there are decision trees, then the model is in the th decision tree. Sample objective function It can be represented as: In the formula, This represents the objective function value in the t-th iteration; This represents the total number of training samples. Indicates the index of the training sample; Represents the loss function; Indicates the first The true value of each sample; This represents the predicted value of the sample in round t-1; Represents the decision tree function; Represents the regularization term in a decision tree; Represents a constant term; XGBoost utilizes second-order derivative information when constructing decision trees; in the optimization process of the loss function, it considers not only the first-order derivative but also introduces the second-order derivative; when the current t-1 trees are determined, the resulting residuals... It is a definite value, therefore the objective function Finally, it simplifies to: In the formula, Indicates the first The first derivative of each sample; Indicates the first The second derivative of each sample; Indicates the penalty coefficient for leaf nodes; This represents the number of leaf nodes in the tree, where m represents the index of a leaf node. Represents the L2 regularization coefficient; This represents the weight of the m-th leaf node; This represents the scaling factor.
[0023] Using the SPXY algorithm, 80% of the samples were used as the training set and 20% as the test set. An XGBoost regression model was constructed under this experimental setup. The model was trained with n=960 training samples and its predictive performance was evaluated using 240 test samples. The coefficient of determination of the regression results... The doping concentration prediction effect reached 0.9547, as shown in the diagram below. Figure 3 As shown.
[0024] S7. Determine the adulteration detection results: Qualitative classification of Corydalis and Summer-wine is performed based on the constructed DCNN classifier, and quantitative prediction of different adulteration concentrations is performed by combining the XGBoost regression model. Finally, high-precision classification and concentration prediction results are output.
[0025] The specific embodiments of the present invention have been described in detail above with reference to examples. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for detecting adulteration and controlling the quality of Corydalis rhizome, characterized in that, Includes the following steps: S1. Pretreatment was performed on samples of Corydalis and Summer-Summer to obtain tablet samples with different adulteration concentrations. S2. Based on S1, the THz-TDS system was used to irradiate the processed Corydalis and Summer Wu samples to obtain the raw absorbance spectral data of each sample, and the absorbance spectrum within a specific frequency range was extracted. S3. Apply the Tukey window function to the absorbance spectra of summer and Corydalis obtained in S2 for preprocessing. Use the UMAP algorithm to reduce the dimensionality of the preprocessed spectral data to obtain the input spectral feature matrix. S4. Input the feature matrix obtained in S3 into a deep convolutional neural network classifier for qualitative identification; S5. Process the raw absorbance spectral data obtained in S2 with a Tukey window function, and use the SPXY algorithm to divide the sample set into training set and test set according to a preset ratio. S6. Input the training set obtained in S5 into the XGBoost regression model to predict the doping concentration. S7. Integrate the qualitative classification results obtained in S4 with the quantitative concentration prediction results obtained in S6 to form a complete detection result for adulteration of Corydalis rhizome.
2. The method for detecting and controlling adulteration of Corydalis rhizome according to claim 1, characterized in that: The method for obtaining tablet samples with different adulteration concentrations in S1 includes: crushing, sieving and drying Corydalis and Xia Tianwu samples respectively, and then mixing them with high-density polyethylene at a preset mass ratio; then using Corydalis as a matrix, Xia Tianwu is added stepwise at fixed gradient intervals to prepare samples with different adulteration concentrations; and finally, after pressing and drying the sample powder, tablet samples are obtained.
3. The method for detecting and controlling adulteration of Corydalis rhizome according to claim 1, characterized in that: In S3, the target dimension after dimensionality reduction is 3, while retaining key features including the position, intensity and trend of absorption peaks in the terahertz spectrum, to form the input spectral feature matrix.
4. The method for detecting and controlling adulteration of Corydalis rhizome according to claim 1, characterized in that: In S4, the deep convolutional neural network is DCNN, and the network structure includes convolutional layers, pooling layers, and fully connected layers. Finally, the classification result is output through the softmax function.
5. The method for detecting and controlling adulteration of Corydalis rhizome according to claim 1, characterized in that: In step S6, the training set data obtained in step S5 is input into the XGBoost regression model for training. The model optimizes the objective function through decision tree ensemble and combines first-order and second-order derivative information, as follows: In the formula, This represents the objective function value in the t-th iteration; This represents the total number of training samples. Indicates the index of the training sample; Represents the decision tree function; Indicates the first One sample; Indicates the first The first derivative of each sample; Indicates the first The second derivative of each sample; Indicates the penalty coefficient for leaf nodes; This represents the number of leaf nodes in the tree, where m represents the index of a leaf node. Represents the L2 regularization coefficient; This represents the weight of the m-th leaf node; This represents the scaling factor.