A method and system for analyzing components of traditional Chinese medicine based on spectral clustering
Through cluster analysis, the samples closest to the category center are selected for model update, which solves the problem of reduced model accuracy caused by the difference between new samples and original samples in the analysis of traditional Chinese medicine ingredients, and improves the prediction performance and application value of the model.
Patent Information
- Application Number
- CN202210461016.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the analysis of traditional Chinese medicine ingredients, the difference between the newly measured sample spectral data and the original sample leads to a decrease in the accuracy of the near-infrared spectroscopy quantitative model. The existing model update method fails to effectively select representative samples, resulting in inaccurate accuracy of the updated model. high.
By performing cluster analysis on the new sample set, select the sample closest to the center of each category as a candidate sample, add it to the calibration set of the original sample set to form a new calibration set, and update and train the traditional Chinese medicine ingredient analysis model to improve the model's accuracy. Predict performance.
It improves the prediction performance of the traditional Chinese medicine component analysis model, enhances the prediction ability of new samples, reduces the time and cost of model update, and improves the practical application value.
Smart Images

Figure CN114783539B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of near infrared spectral analysis, and in particular to a method and system for analyzing components of traditional Chinese medicine based on spectral clustering. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] Near infrared (NIR) spectroscopy is an electromagnetic wave with a wavelength range of 780nm to 2526nm, which mainly reflects the spectral absorption of the overtones and combination bands of CH, OH and NH vibrations. It has the characteristics of rapidity, low cost, simple operation, non-destructiveness, good reproducibility and conformity to the concept of green analytical chemistry. As a rapid analytical technology, near infrared spectroscopy analysis has been widely used in many fields such as pharmaceutical science, food science and petrochemical science, and has shown great potential in qualitative identification, quantitative analysis and real-time online analysis of traditional Chinese medicine and food.
[0004] Establishing an effective near-infrared spectroscopy quantitative model is a key issue in the use of near-infrared spectroscopy technology for quality monitoring of traditional Chinese medicine and food. In order to establish a near-infrared spectroscopy quantitative model, a variety of modeling methods have been introduced. However, no matter which modeling method is used, the calibration samples of the established model need to cover the characteristic information of the predicted samples. However, in practical applications, it is usually difficult to meet this requirement for newly measured samples. For example, due to differences in origin, growing year, climatic conditions, and extraction methods, the spectral data and quality attributes of the measured new samples may be different, and even very different, resulting in a decrease in the accuracy of the original model established.
[0005] There are two common methods to solve the loss of model accuracy caused by systematic differences between newly measured samples and original samples: one is to rebuild a new model using only new samples, that is, not using the original calibration set samples in the new model, but this will lose the information of the original model, resulting in a waste of time and energy in the model; the other solution is the model update method, that is, using the original calibration set samples combined with a small number of selected new samples to update the original model to improve modeling accuracy. Since only a small number of new samples need to be selected, the time and cost of model update are less than the time and cost of rebuilding a new model, which is more suitable for practical applications. Selecting representative samples from a large number of new samples is the key issue of model updating, but the existing method of selecting representative samples from a large number of new samples does not consider the spectral information of the new samples. Therefore, it is difficult to determine whether the selected samples are representative, resulting in the accuracy of the updated model is still not high. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a method and system for analyzing the components of traditional Chinese medicine based on spectral clustering. The method selects samples closest to the centers of each spectral category as candidate samples, adds them to the correction set divided from the original sample set to complete the update of the original correction set, and updates the training of the traditional Chinese medicine component analysis model, so that the accuracy of the trained traditional Chinese medicine component analysis model is improved and the system has better prediction performance.
[0007] To achieve the above objectives, the present disclosure adopts the following technical solutions:
[0008] In a first aspect, a method for analyzing components of traditional Chinese medicine based on spectral clustering is disclosed, comprising:
[0009] Obtain near-infrared spectra of traditional Chinese medicines;
[0010] According to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model, the analysis results of traditional Chinese medicine components are obtained;
[0011] The specific process of obtaining a trained Chinese medicine component analysis model is as follows: obtaining near-infrared spectral samples of Chinese medicine components; dividing the near-infrared spectral samples of Chinese medicine components into an original sample set and a new sample set; dividing the original sample set into a calibration set and a validation set, and using the calibration set and the validation set to construct a Chinese medicine component analysis model; performing cluster analysis on the new sample set to obtain different sample categories; selecting the samples closest to the center of each category as candidate samples; adding the candidate samples to the calibration set divided from the original sample set to form a new calibration set, and using the remaining samples in the new sample set except the candidate samples as a test set, and using the new calibration set and the test set to train the Chinese medicine component analysis model to obtain a trained Chinese medicine component analysis model.
[0012] Secondly, a Chinese medicine component analysis system based on spectral clustering is proposed, including:
[0013] A data acquisition module, used to obtain the near-infrared spectrum of traditional Chinese medicine;
[0014] The result acquisition module is used to obtain the analysis results of the components of traditional Chinese medicine according to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model;
[0015] The specific process of obtaining a trained Chinese medicine component analysis model is as follows: obtaining near-infrared spectral samples of Chinese medicine components; dividing the near-infrared spectral samples of Chinese medicine components into an original sample set and a new sample set; dividing the original sample set into a calibration set and a validation set, and using the calibration set and the validation set to construct a Chinese medicine component analysis model; performing cluster analysis on the new sample set to obtain different sample categories; selecting the samples closest to the center of each category as candidate samples; adding the candidate samples to the calibration set divided from the original sample set to form a new calibration set, and using the remaining samples in the new sample set except the candidate samples as a test set, and using the new calibration set and the test set to train the Chinese medicine component analysis model to obtain a trained Chinese medicine component analysis model.
[0016] In a third aspect, an electronic device is proposed, comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps of a method for analyzing components of traditional Chinese medicine based on spectral clustering are completed.
[0017] In a fourth aspect, a computer-readable storage medium is proposed for storing computer instructions. When the computer instructions are executed by a processor, the steps of a method for analyzing components of traditional Chinese medicine based on spectral clustering are completed.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] 1. When obtaining a trained Chinese medicine component analysis model, the present invention first trains the original model through the original sample set to obtain the Chinese medicine component analysis model, then selects the samples closest to the center of each spectral category from the new sample set as candidate samples, adds the candidate samples to the correction set divided by the original sample set to form a new correction set, and updates the Chinese medicine component analysis model through the new correction set, and finally obtains the trained Chinese medicine component analysis model. The finally obtained trained Chinese medicine component analysis model has better prediction performance and improves the practical application value.
[0020] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0022] Figure 1 It is a flowchart of the method disclosed in Example 1;
[0023] Figure 2 is the near infrared spectra of all samples 1 in Example 1;
[0024] Figure 3 is the distribution diagram of all samples 1 in the first and second PC spaces in Example 1;
[0025] Figure 4 The dendrogram is a clustering result of all samples in Example 1 using the Ward method;
[0026] Figure 5 The dendrogram is a clustering result of all samples in Example 1 using the Average method;
[0027] Figure 6 The distribution diagram of the samples selected by different methods in Example 1 in the first and second PC spaces;
[0028] Figure 7 is the near infrared spectra of all samples 2 in Example 1;
[0029] Figure 8 is the distribution diagram of all samples 2 in the first and second PC spaces in Example 1;
[0030] Fig. 9 This is a dendrogram of clustering results of all samples 2 in Example 1 using the Ward method;
[0031] Fig.10 The dendrogram is the clustering result of all samples 2 in Example 1 using the Average method;
[0032] Fig.11 Distribution diagram of samples selected by different methods in Example 1 in the first and second PC spaces. DETAILED DESCRIPTION
[0033] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0034] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0035] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0036] Example 1
[0037] In this embodiment, a method for analyzing components of traditional Chinese medicine based on spectral clustering is disclosed, comprising:
[0038] Obtain near-infrared spectra of traditional Chinese medicines;
[0039] According to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model, the analysis results of traditional Chinese medicine components are obtained;
[0040] The specific process of obtaining a trained Chinese medicine component analysis model is as follows: obtaining near-infrared spectral samples of Chinese medicine components; dividing the near-infrared spectral samples of Chinese medicine components into an original sample set and a new sample set; dividing the original sample set into a calibration set and a validation set, and using the calibration set and the validation set to construct a Chinese medicine component analysis model; performing cluster analysis on the new sample set to obtain different sample categories; selecting the samples closest to the center of each category as candidate samples; adding the candidate samples to the calibration set divided from the original sample set to form a new calibration set, and using the remaining samples in the new sample set except the candidate samples as a test set, and using the new calibration set and the test set to train the Chinese medicine component analysis model to obtain a trained Chinese medicine component analysis model.
[0041] Furthermore, the specific process of selecting the samples closest to the center of each category as candidate samples is as follows:
[0042] Calculate sample centers for each category;
[0043] Calculate the Euclidean distance between each sample and the sample center of each category;
[0044] Sort the calculated Euclidean distances;
[0045] The samples with the smallest Euclidean distance in each category are selected as candidate samples.
[0046] Furthermore, the Ward method or Average method is used to perform cluster analysis on the new sample set.
[0047] Furthermore, the specific process of constructing a Chinese medicine component analysis model through the original sample set is as follows:
[0048] Establish an analytical model for the original components of traditional Chinese medicine;
[0049] The original sample set is divided into a calibration set and a validation set, and the original TCM component analysis model is trained to obtain a TCM component analysis model.
[0050] Furthermore, the Chinese medicine component analysis model adopts a PLS model, a neural network model or a support vector machine model.
[0051] Furthermore, the near-infrared spectral samples of the traditional Chinese medicine ingredients are preprocessed, and the original sample set and the new sample set are constructed through the preprocessed near-infrared spectral samples of the traditional Chinese medicine ingredients.
[0052] Furthermore, the samples in the original sample set and the new sample set do not overlap.
[0053] A method for analyzing components of traditional Chinese medicine based on spectral clustering disclosed in this embodiment is described in detail.
[0054] like Figure 1 As shown, a method for analyzing components of traditional Chinese medicine based on spectral clustering comprises:
[0055] S1: Obtain near-infrared spectra of traditional Chinese medicine.
[0056] During specific implementation, a spectrometer is used to obtain the near-infrared spectrum of the traditional Chinese medicine.
[0057] S2: Obtain the analysis results of Chinese medicine components based on the near-infrared spectrum of Chinese medicine and the trained Chinese medicine component analysis model.
[0058] Among them, the Chinese medicine component analysis model adopts PLS model, neural network model or support vector machine model.
[0059] Establish an original Chinese medicine component analysis model, and train the original Chinese medicine component analysis model to obtain a trained Chinese medicine component analysis model. The specific process is as follows:
[0060] S21: Obtain near-infrared spectrum samples of traditional Chinese medicine ingredients, which are used for subsequent model training.
[0061] The near-infrared spectrum samples of traditional Chinese medicine ingredients contain the indicators of each ingredient and the reference values of the ingredient indicators measured using industry standard testing methods.
[0062] S22: Divide the near-infrared spectral samples of traditional Chinese medicine ingredients into the original sample set X and the new sample set X new .
[0063] In specific implementation, the near-infrared spectrum samples of traditional Chinese medicine ingredients can be directly divided into an original sample set and a new sample set; or the near-infrared spectrum of the traditional Chinese medicine ingredients can be preprocessed first, and the preprocessed near-infrared spectrum can be divided to obtain the original sample set and the new sample set.
[0064] Among them, the preprocessing methods for the near-infrared spectra of traditional Chinese medicine ingredients include: any one or more combinations of smoothing processing, first-order derivative calculation, second-order derivative calculation, standardization processing, baseline drift processing, standard normal variable processing, multivariate scattering correction processing, etc.
[0065] S23: The original TCM component analysis model is trained using the original sample set to obtain a TCM component analysis model.
[0066] In the specific implementation, the original sample set X is divided into the calibration set X cal and validation set Xval , the original traditional Chinese medicine component analysis model is trained to obtain the traditional Chinese medicine component analysis model.
[0067] Among them, the calibration set X cal The number of is greater than or equal to the validation set X val The number of calibration and validation sets X val The sample size ratio is set to 2:1 and above.
[0068] Divide the original sample set X into the calibration set X cal and validation set X val The division method can be any one of the KS method, Rank-KS method, SPXY method, Rank-SPXY method and content gradient method.
[0069] S24: Through the new sample set X new Further training is performed on the TCM component analysis model to obtain a trained TCM component analysis model, specifically:
[0070] S241: Perform cluster analysis (HCA) on the sample spectra in the new sample set, and divide the new samples into different X classes according to the selected clustering results and category data. new,i , where “i” represents different categories.
[0071] In specific implementation, any one of the Ward method and the Average method is used to perform cluster analysis on the samples.
[0072] S242: Calculate the sample center x of each category center,i , can be obtained by the following formula:
[0073] x center,i =X new,i / N(1)
[0074] Among them, x center,i Represents the sample center of different categories, and “N” represents the number of samples in each category.
[0075] S243: Calculate each sample x new,j Euclidean distance d to the center of each category x (j):
[0076]
[0077] S244: Sort the calculated Euclidean distances; select the sample with the smallest Euclidean distance in each category as the candidate sample X sel .
[0078] S245: add all candidate samples to the calibration set divided from the original sample set to form a new calibration set, and use the remaining samples in the new sample set except the candidate samples as the test set X test , the Chinese medicine component analysis model is trained by using the new calibration set and test set to obtain a trained Chinese medicine component analysis model.
[0079] The present embodiment discloses a method for analyzing components of traditional Chinese medicine based on spectral clustering, which selects samples closest to the centers of each spectral category as candidate samples and adds them to the correction set divided from the original sample set, and further updates the traditional Chinese medicine component analysis model, so that the trained traditional Chinese medicine component analysis model has better prediction performance for unknown new samples and has more practical application value.
[0080] The method disclosed in this embodiment was verified using commercially available astragalus extract (RAE) as an example.
[0081] A total of 82 RAE samples were measured, including 9 batches collected from 5 manufacturers. The specific information is shown in Table 1. Among them, 53 samples from S1 to S6 are the original sample set X, which is used to establish the TCM component analysis model, and the remaining 29 samples (S7 to S9) are used as the new sample set X. new The near infrared spectra of the original sample and the new sample were measured by AntarisⅡFT-NIR spectrometer (Thermo Fisher Scientific, USA). Figure 2 , the solid line is the original sample, and the dotted line is the new sample. Astragaloside IV (AST IV), calycosin glucoside (CG) and astragaloside polysaccharide (APS) were used as the reference component index Y. The contents of AST IV and CG in astragalus extract were determined by HPLC, respectively, and measured by high performance liquid chromatography (1260, Agilent Technologies, USA); the content of APS in astragalus extract was determined by phenol-sulfuric acid method, and the results are shown in Table 1.
[0082] Table 1 RAE sample information table
[0083]
[0084]
[0085] Note: A concentration ratio of 10:1 means that 10 times the weight of the raw material is concentrated to 1 time the weight, and so on. Manufacturers A, B, C, D and E are all from Shaanxi Province.
[0086] The commonly used KS method is used to divide the original sample set into the calibration set X cal and validation set X val, respectively, for developing and validating the TCM component analysis model, where the number of calibration set samples is 36 and the number of prediction set samples is 17. The near-infrared spectra were processed using the SNV combined with the first-order derivative preprocessing method.
[0087] Taking APS as an example, the principal component analysis (PCA) scores of all sample spectra after preprocessing are shown in the figure below: Figure 3 As shown. Figure 3 As shown, the distribution area of the new sample is not included in the spectral space of the original sample, but is divided into different clusters. From the perspective of presenting different clusters, there is basically no overlapping area between the original sample set and the new sample set, indicating that the new sample may have systematic differences compared with the original sample. Therefore, using the TCM component analysis model to directly predict the new sample will lead to poor results.
[0088] To this end, a cluster analysis is first performed on the new sample set of RAE. Figure 4 and Figure 5 The figure shows the clustering results of the new samples after preprocessing by the Ward and Average methods. The dotted line, dashed line and solid line represent that the new samples are divided into 4, 5 and 6 categories respectively, dividing the new samples into different categories X new,i .from Figure 4 , 5 It can be seen that although the dendrograms formed by the two clustering methods are different, the classification results of samples in categories 1-5 are consistent, so the samples contained in categories 1-5 should be consistent.
[0089] According to the clustering results, the sample center x of each category is calculated separately. center,i , then calculate the Euclidean distance d from each sample to the center of each category x(j) And sort them, select the samples closest to the center of each category as candidate samples X sel Add calibration set X cal In the above example, a new calibration set is formed to update the TCM component analysis model, and the remaining samples are used as the test set X. test Verify the updated model. For predicting new samples by model updating, as few new samples as possible should be selected. We selected 3 (about 10% of the 29 new samples) to 6 samples (about 20%) for model updating. The results are shown in Table 3. It can be seen from the results that after the model is updated using the method disclosed in this embodiment (CCD method), R t and RPD tThe values are higher than those directly predicted by the TCM component analysis model, and the RMSET value is also greatly reduced, indicating that the TCM component analysis model after training has greatly improved the content prediction of new samples. Among them, the RMSET values of the three components AST IV, CG and APS are reduced from 0.0637, 0.0261 and 4.1141 to 0.0063, 0.0011 and 1.0133, respectively, proving that the use of the method disclosed in this embodiment can greatly improve the model's prediction ability for unknown new samples.
[0090] Table 2 Comparison of the prediction results of the sample content of the test set before and after the model update
[0091]
[0092] Note: “-” means the number of samples selected is 0.
[0093] In order to evaluate the performance of the method disclosed in this embodiment, the method disclosed in this embodiment is compared with commonly used methods such as RS method, SPXY method and KS method. The RS method is used for ten repeated samplings due to randomness, and the average results of ten times are compared with other methods. The other three methods all select samples of the same sample number range (3 to 6) as the method disclosed in this embodiment to add to the original calibration set, and evaluate the representativeness of the selected samples by updating the performance of the model, so as to compare the modeling performance and prediction ability of different methods. The relevant results are shown in Table 3.
[0094] Table 3 Best results of model updating by different methods
[0095]
[0096] As shown in Table 4, the four sample selection methods can enable the updated model to better predict the content of each component in the new sample, indicating that the model update strategy is feasible and the updated model can be effectively applied to the new sample. Compared with the original model, the prediction results of the model update using the method disclosed in this embodiment have achieved the best prediction results compared with the RS, SPXY and KS methods, with a lower RMSET value and RPD t Higher value.
[0097] In order to further demonstrate the practicality of the method disclosed in this embodiment, the results of the four methods after model updating when the minimum number of samples (3 samples) is selected are compared, and the results are shown in Table 4. From Table 4, it can be seen that when the number of selected samples is the smallest, the CCD method has a clear advantage over the other three methods. In addition, the RPD updated by the method disclosed in this embodiment t The values are all greater than 3.5, indicating that the method disclosed in this embodiment greatly improves the applicability of the updated model. Figure 6The distribution of samples selected by the CCD, SPXY and KS methods in the first and second PC spaces is shown. The enlarged images are the enlarged images of S7 (ac), S8 (df) and S9 (gi), where (a), (d) and (g) represent AST IV; (b), (e) and (h) represent CG; (c), (f) and (i) represent APS. It can be seen from the figure that the samples selected by the method disclosed in this embodiment are basically closer to the center of each category, which may be more representative of the samples of the corresponding category, thereby obtaining better results.
[0098] Table 4 Results of model updating using different methods when selecting 3 samples
[0099]
[0100]
[0101] The commercially available astragalus extract (RAE) was used as an example to verify the method disclosed in this embodiment. A total of 82 RAE samples were measured, which were collected from 9 batches of 5 manufacturers. The specific information is shown in Table 1. The near infrared spectra of the original samples and the new samples were measured by Micro-NIR 1700 micro near infrared spectrometer (VIAVI, USA). The measured near infrared spectra are shown in Table 1. Figure 7 , the solid line is the original sample, and the dotted line is the new sample. Astragaloside IV (AST IV), calycosin glucoside (CG) and astragalus polysaccharide (APS) were used as reference component indicators.
[0102] The commonly used KS method is used to divide the original sample set into the calibration set X cal and validation set X val , respectively, for developing and validating the original model, where the number of samples in the calibration set is 36 and the number of samples in the prediction set is 17. The near-infrared spectra were processed using the SNV combined with the first-order derivative preprocessing method. Taking APS as an example, the principal component analysis (PCA) score of all sample spectra after preprocessing is shown in the figure Figure 8 As shown. Figure 8 As shown, the distributions of the new samples are not contained in the spectral space of the original samples, but are divided into different clusters, and there is basically no overlapping area between the original sample set and the new sample set, indicating that there may be systematic differences between the new samples and the original samples.
[0103] First, cluster analysis is performed on the new sample set of RAE. Fig. 9 and Fig.10 The figure shows the clustering results of the new samples after preprocessing by Ward and Average methods. The dotted line, dashed line and solid line represent that the new samples are divided into 4, 5 and 6 categories respectively, dividing the new samples into different categories X new,iAs can be seen from the figure, the classification results of samples in categories 1-5 are consistent, so the samples contained in categories 1-5 should be consistent.
[0104] Since HCA divides new samples into different categories according to different numbers of categories, in order to select representative samples, we first calculate the sample center x of each category. center,i Then, the Euclidean distance of each sample to the center of each category is calculated and sorted, and a sample closest to the center of each category is selected as the candidate representative sample X sel Add to the calibration set X divided from the original sample set cal A new calibration set is formed from the 29 new samples, and the TCM component analysis model is updated through the new calibration set. Specifically, 3 (about 10% of the 29 new samples) to 6 samples (about 20%) are selected for model update. Table 5 shows the remaining unselected samples X in the new samples after model update. test The optimal content prediction results of the three active ingredients. After the model is updated using the method disclosed in this embodiment (CCD method), R t and RPD t The values are higher than those predicted directly by the original model, and the RMSET values are also greatly reduced, indicating that the model has greatly improved the content prediction of new samples. The RMSET values of AST IV, CG and APS components decreased from 0.0507, 0.0268 and 3.6572 to 0.0085, 0.0029 and 1.2583, respectively. t The values increased from 0.9428, 0.5250, and 0.8827 to 0.9931, 0.9876, and 0.9723, while RPD t The values also increased from 0.47, 0.12 and 1.01 to 4.66, 4.39 and 3.13, respectively, proving that using the method disclosed in this embodiment to update the model can greatly improve the performance of the model and the prediction of unknown new samples.
[0105] Table 5 Comparison results of prediction of test set sample content before and after model update
[0106]
[0107]
[0108] The method disclosed in this embodiment is compared with classical methods such as RS method, SPXY method and KS method, wherein the RS method is used to repeat sampling ten times, and the average results of ten times are taken and compared with other methods. The samples of the same number range as those selected by the method disclosed in this embodiment are added to the calibration set divided from the original sample set to form a new calibration set, and the performance of the model is updated by the new calibration set to evaluate the representativeness of the selected samples, so as to compare the modeling performance and prediction ability of different methods. The relevant results are shown in Table 6.
[0109] Table 6 Best results of model updating by different methods
[0110]
[0111]
[0112] As shown in Table 6, the four methods can enable the updated model to better predict the content of each component in the new sample. Compared with the original model, except for the CG component, the prediction results after the model was updated using the method disclosed in this embodiment reached the best prediction results compared with the RS, SPXY and KS methods, with lower RMSET values and RPD t The values are high and the results of CG components are also similar to those of other methods.
[0113] In addition, the results of the four methods after model updating when the minimum number of samples (3 samples) is selected are compared, and the results are shown in Table 7. It can be seen from the results that when only the minimum number of samples is selected, the method disclosed in this embodiment can obtain similar or better results than the other three methods. In addition, the RPD of the CCD update model t The values are all greater than 2, indicating that the model after model updating by the method disclosed in this embodiment can predict the content of unknown new samples. Fig.11 The distribution of samples selected by the CCD, SPXY and KS methods in the first and second PC spaces is shown. The enlarged images are the enlarged images of S7 (ac), S8 (df) and S9 (gi), where (a), (d) and (g) represent AST IV; (b), (e) and (h) represent CG; (c), (f) and (i) represent APS. It can be seen from the figure that the samples selected by the method of this embodiment are basically closer to the center of each category, which may have better representativeness for the samples of the corresponding category, thereby obtaining better results.
[0114] Table 7 Results of model updating by different methods when selecting 3 samples
[0115]
[0116]
[0117] It can be seen from the above two examples that the new samples do have certain systematic differences from the original samples, resulting in the spectra of the samples showing different categories, and the Chinese medicine component analysis model cannot be applied. The above two verification examples use different devices to obtain samples, but both can verify that this embodiment uses the original calibration set combined with a small amount of selected new samples to update the Chinese medicine component analysis model, and selects the samples closest to the category center as candidate samples to update the calibration set divided by the original sample set, so that the selected samples are representative, and the updated model prediction results are all good. In addition, the method disclosed in this embodiment is compared with the RS, SPXY and KS methods, which has certain advantages. In addition, the sample selection and model updating method based on spectral clustering centers disclosed in this embodiment can be extended to various fields, which is more practical.
[0118] Example 2
[0119] In this embodiment, a Chinese medicine component analysis system based on spectral clustering is disclosed, comprising:
[0120] A data acquisition module, used to obtain the near-infrared spectrum of traditional Chinese medicine;
[0121] The result acquisition module is used to obtain the analysis results of the components of traditional Chinese medicine according to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model;
[0122] The specific process of obtaining a trained Chinese medicine component analysis model is as follows: obtaining near-infrared spectral samples of Chinese medicine components; dividing the near-infrared spectral samples of Chinese medicine components into an original sample set and a new sample set; dividing the original sample set into a calibration set and a validation set, and using the calibration set and the validation set to construct a Chinese medicine component analysis model; performing cluster analysis on the new sample set to obtain different sample categories; selecting the samples closest to the center of each category as candidate samples; adding the candidate samples to the calibration set divided from the original sample set to form a new calibration set, and using the remaining samples in the new sample set except the candidate samples as a test set, and using the new calibration set and the test set to train the Chinese medicine component analysis model to obtain a trained Chinese medicine component analysis model.
[0123] Example 3
[0124] In this embodiment, an electronic device is disclosed, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps described in the method for analyzing components of traditional Chinese medicine based on spectral clustering disclosed in Example 1 are completed.
[0125] Example 4
[0126] In this embodiment, a computer-readable storage medium is disclosed for storing computer instructions. When the computer instructions are executed by a processor, the steps described in the method for analyzing components of traditional Chinese medicine based on spectral clustering disclosed in Example 1 are completed.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for analyzing components of traditional Chinese medicine based on spectral clustering, characterized in that: include: Obtain near-infrared spectra of traditional Chinese medicines; According to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model, the analysis results of traditional Chinese medicine components are obtained; The specific process of obtaining the trained TCM component analysis model is as follows: obtaining near-infrared spectrum samples of TCM components; The near-infrared spectral samples of traditional Chinese medicine components are divided into an original sample set and a new sample set, wherein the samples in the original sample set and the new sample set do not overlap; the original sample set is divided into a calibration set and a validation set, and a traditional Chinese medicine component analysis model is constructed using the calibration set and the validation set; cluster analysis is performed on the new sample set to obtain different sample categories; samples closest to the center of each category are selected as candidate samples; the candidate samples are added to the calibration set divided from the original sample set to form a new calibration set, and the remaining samples in the new sample set except the candidate samples are used as a test set, and the traditional Chinese medicine component analysis model is trained using the new calibration set and the test set to obtain a trained traditional Chinese medicine component analysis model.
2. A method for analyzing components of traditional Chinese medicine based on spectral clustering as claimed in claim 1, characterized in that: The specific process of selecting the samples closest to the center of each category as candidate samples is as follows: Calculate sample centers for each category; Calculate the Euclidean distance of each sample to the sample center of each category; Sort the calculated Euclidean distances; The samples with the smallest Euclidean distance in each category are selected as candidate samples.
3. A method for analyzing components of traditional Chinese medicine based on spectral clustering as claimed in claim 1, characterized in that: Use Ward method or Average method to perform cluster analysis on the new sample set.
4. A method for analyzing components of traditional Chinese medicine based on spectral clustering as claimed in claim 1, characterized in that: The specific process of constructing a TCM component analysis model through the original sample set is as follows: Establish an analytical model for the original components of traditional Chinese medicine; The original sample set is divided into a calibration set and a validation set, and the original TCM component analysis model is trained to obtain a TCM component analysis model.
5. A method for analyzing components of traditional Chinese medicine based on spectral clustering as claimed in claim 1, characterized in that: The Chinese medicine component analysis model adopts PLS model, neural network model or support vector machine model.
6. A method for analyzing components of traditional Chinese medicine based on spectral clustering as claimed in claim 1, characterized in that: The near-infrared spectral samples of traditional Chinese medicine ingredients were preprocessed, and the original sample set and the new sample set were constructed through the preprocessed near-infrared spectral samples of traditional Chinese medicine ingredients.
7. A Chinese medicine component analysis system based on spectral clustering, characterized in that: include: A data acquisition module, used to obtain the near-infrared spectrum of traditional Chinese medicine; The result acquisition module is used to obtain the analysis results of the components of traditional Chinese medicine according to the near infrared spectrum of traditional Chinese medicine and the trained traditional Chinese medicine component analysis model; The specific process of obtaining the trained TCM component analysis model is as follows: obtaining near-infrared spectrum samples of TCM components; The near-infrared spectral samples of traditional Chinese medicine components are divided into an original sample set and a new sample set, wherein the samples in the original sample set and the new sample set do not overlap; the original sample set is divided into a calibration set and a validation set, and a traditional Chinese medicine component analysis model is constructed using the calibration set and the validation set; cluster analysis is performed on the new sample set to obtain different sample categories; samples closest to the center of each category are selected as candidate samples; the candidate samples are added to the calibration set divided from the original sample set to form a new calibration set, and the remaining samples in the new sample set except the candidate samples are used as a test set, and the traditional Chinese medicine component analysis model is trained using the new calibration set and the test set to obtain a trained traditional Chinese medicine component analysis model.
8. An electronic device, characterized in that: The invention comprises a memory and a processor and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of a method for analyzing components of traditional Chinese medicine based on spectral clustering as described in any one of claims 1 to 6 are completed.
9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps of a method for analyzing components of traditional Chinese medicine based on spectral clustering as described in any one of claims 1 to 6.
