Pseudo-ginseng producing area identification method based on big data technology, storage medium and device
By constructing a near-infrared spectrum data set of Panax notoginseng and optimizing the logistic regression model, the problem of insufficient accuracy in the identification of origin of Panax notoginseng medicinal materials was solved, the intelligent origin identification and quality control of Panax notoginseng medicinal materials were realized, and the accuracy and accuracy of identification were improved. robustness.
Patent Information
- Application Number
- CN202411069868.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-11
AI Technical Summary
The existing technology has insufficient accuracy in identifying the origin of Panax notoginseng medicinal materials. Especially when the medicinal materials are processed into pieces or powders, the identification ability of the trait identification method is limited, and the accuracy of image recognition is not high, and the illumination is uneven and the shadows are , reflection and other factors have a greater impact, making it difficult to effectively identify the origin and quality control of Chinese medicinal materials.
A method based on big data technology was used to obtain the near-infrared spectrum data set of Panax notoginseng. After dimensionality reduction processing, a logistic regression model was constructed. The model parameters were optimized through the gradient descent method of weighted mean square error to achieve intelligent identification of the origin of Panax notoginseng.
It realizes green, non-destructive and intelligent origin identification of Panax notoginseng medicinal materials, improves the accuracy and robustness of identification, can handle unbalanced data sets, emphasizes the importance of specific samples, and is suitable for origin identification and quality control of Chinese medicinal materials.
Smart Images

Figure CN118762232A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence identification, and specifically relates to a method, storage medium and device for identifying the origin of Panax notoginseng based on big data technology. Background Art
[0002] Panax notoginseng is the dried root of a perennial herbaceous plant of the genus Panax in the Araliaceae family. In recent years, it has received widespread attention in the medical field because it is non-toxic and has no side effects. Panax notoginseng is produced in Wenshan, China, and is expensive. However, due to the serious continuous cropping obstacles in the original production area of Wenshan, Wenshan Panax notoginseng is under-planted, and the price is much higher than that of other production areas. Using other Panax notoginseng as a substitute for Wenshan Panax notoginseng has become a very common problem in the herbal medicine market, and once Panax notoginseng leaves its place of production, it is basically labeled as Wenshan Panax notoginseng. Therefore, it is necessary to identify the origin of Panax notoginseng.
[0003] Traditional methods for identifying Panax notoginseng are mainly character identification and microscopic identification. Character identification is to identify the authenticity, quality and origin of medicinal materials by observing the shape, size, color, texture, smell, surface and fracture characteristics, and the main identification characteristics in water test and fire test. It is the simplest, fastest and easiest identification method. However, this character identification method is only suitable for the identification of complete medicinal materials. When the medicinal materials are processed into pieces or powders, the necessary character characteristics are lost, and the identification ability of the character identification method is limited. Microscopic identification is to use microscopic technology to analyze and identify the tissue structure, cell morphology and inclusions of traditional Chinese medicine. It is suitable for the identification of complete medicinal materials, broken or powdered medicinal materials, and Chinese patent medicines whose appearance is difficult to identify. Microscopic identification is especially suitable for the identification of powdered medicinal materials. Compared with physical and chemical identification and molecular identification, microscopic identification requires simple instruments, uses less reagents, and has a fast identification speed, but it also has some shortcomings. The microscopic characteristics of medicinal materials of the same genus are similar, making it difficult to identify them. For example, the application number 201910168812.X, "A method for identifying authentic and fake mixed Chinese medicinal materials based on artificial intelligence", discloses that photographing authentic and fake Chinese medicinal material particles obtains a data set, and then the multi-dimensional features of the image data set are input into the SVM model for training, and finally the classification of authentic Chinese medicinal materials and fake Chinese medicinal materials is realized; the patent application number 202111593705.5, "A method for identifying authentic Chinese medicinal materials with hyperspectral images of adaptive random block convolution kernel networks", discloses that hyperspectral images of Chinese medicinal materials are collected to construct a data set, and then the optimal clustering framework is used to obtain the optimal band subset of the data set and select the best feature band, and then principal component analysis is used to reduce the dimension of the data set, and finally an adaptive random convolution kernel network is used to realize the classification of Chinese medicinal materials. Patent application number 202010360338.3, "A method for constructing and applying a classification model for the provenance of Ampelopsis pilosa L. based on NIR spectroscopy," discloses the collection of near-infrared spectral data of Ampelopsis pilosa L. samples, then preprocessing the infrared spectral data, and finally applying the SVM model to realize the classification of the Ampelopsis pilosa L. provenance.
[0004] In the above-mentioned prior art, since the morphology, color, texture and other characteristics of Chinese medicinal materials are affected by many factors and have large variability, the quality of the image and the shooting conditions will affect the accuracy of image recognition. For example, factors such as uneven lighting, shadows, and reflections will make it difficult to extract the features of the image, thereby affecting the identification results; the data preprocessing methods and machine learning models used in the above patents are mature methods and models, and the recognition accuracy given by the scheme is not high, which shows that the existing mature methods and models are difficult to directly apply to the identification of the origin and quality control of Chinese medicinal materials. Summary of the invention
[0005] In order to solve the problems existing in the above-mentioned prior art, the present invention proposes a method for identifying the origin of Panax notoginseng based on big data technology, the method comprising: obtaining a Panax notoginseng sample to be identified; constructing a Panax notoginseng near-infrared spectral data set; performing dimensionality reduction processing on the data in the Panax notoginseng near-infrared spectral data set; dividing the reduced dimensionality data set into a training set and a test set; constructing a Panax notoginseng origin identification model, wherein the Panax notoginseng origin identification model is a logistic regression model; inputting the data in the training set into the Panax notoginseng origin identification model for training; inputting the data in the test set into the trained Panax notoginseng origin identification model for testing; inputting the Panax notoginseng sample to be identified into the trained Panax notoginseng origin identification model to obtain a Panax notoginseng origin identification result.
[0006] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any of the above-mentioned methods for identifying the origin of Panax notoginseng based on big data technology is implemented.
[0007] To achieve the above-mentioned purpose, the present invention also provides a Panax notoginseng origin identification device based on big data technology, comprising a processor and a memory; the memory is used to store computer programs; the processor is connected to the memory, and is used to execute the computer programs stored in the memory, so that the Panax notoginseng origin identification device based on big data technology can execute any of the above-mentioned Panax notoginseng origin identification methods based on big data technology.
[0008] Beneficial effects of the present invention:
[0009] Based on the existing technology equipment, the present invention only needs to construct a near-infrared spectral data set of Panax notoginseng from different origins, and then realize the green, non-destructive and intelligent origin identification of Panax notoginseng Chinese medicinal materials through software, without increasing the hardware cost; on the basis of the classical logistic regression model, the present invention optimizes the parameter adjustment process of the original model by introducing the gradient descent method of weighted mean square error, and the weight vector adopts the eigenvalue in the data dimension reduction of the original data set, which brings the importance of Panax notoginseng sample features into the model parameter optimization, and better reflects the applicability and robustness of the new model. The loss of each sample of the present invention is adjusted by its corresponding weight, and samples with higher weights will have a greater impact on the loss function. By adjusting the weight of the sample, the importance of different samples can be adjusted during the training process; this is very useful for processing unbalanced data sets or emphasizing the importance of specific samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is the overall flow chart of the present invention;
[0011] Figure 2 A flowchart of the present invention for performing dimensionality reduction processing on data in a Panax notoginseng near-infrared spectrum data set;
[0012] Figure 3 This is a training flow chart of the Panax notoginseng origin identification model of the present invention. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] A method for identifying the origin of Panax notoginseng based on big data technology, such as Figure 1 As shown, the method includes: obtaining a Panax notoginseng sample to be identified; constructing a Panax notoginseng near-infrared spectrum data set; performing dimensionality reduction processing on the data in the Panax notoginseng near-infrared spectrum data set; dividing the reduced dimensionality data set into a training set and a test set; constructing a Panax notoginseng origin identification model, wherein the Panax notoginseng origin identification model is a logistic regression model; inputting the data in the training set into the Panax notoginseng origin identification model for training; inputting the data in the test set into the trained Panax notoginseng origin identification model for testing; inputting the Panax notoginseng sample to be identified into the trained Panax notoginseng origin identification model to obtain a Panax notoginseng origin identification result.
[0015] In this embodiment, constructing a Panax notoginseng near-infrared spectral data set includes: collecting Panax notoginseng Chinese medicinal material samples from different origins; cleaning, drying and grinding the Panax notoginseng samples; taking 2 grams of sample powder and using a Fourier transform near-infrared spectrometer to collect near-infrared spectral data of the Panax notoginseng powder; storing all near-infrared spectral data and storing each sample by row; marking the origin of each sample to obtain a Panax notoginseng near-infrared spectral data set.
[0016] Specifically, multiple batches of Panax notoginseng Chinese medicinal material samples from different origins were collected and processed. First, after washing the soil on the surface of the Panax notoginseng samples, the samples were dried to constant weight at a constant temperature of 50°C using a Longyue LDO-9000 air drying oven, crushed using a grinder, and the medicinal powder was screened through an 80-mesh sieve to ensure uniform particle size. About 2 grams of powder was taken from each sample and placed in a glass weighing bottle to ensure that the surface of the powder was flat. Then, a Bruker Matrix-F Fourier transform near-infrared spectrometer was used to collect near-infrared spectral data. The parameters were set as follows: the resolution was 1.0cm -1 The scanning number was 64 times, air was used as reference, the scanning mode was diffuse reflectance spectroscopy, and the spectral range was 4000-10000cm -1 . Each Panax notoginseng powder sample was subjected to 3 spectral acquisitions, and the average spectrum was taken as the near-infrared spectrum of the sample. All spectra were measured in reflection mode and recorded as the logarithm of the reciprocal reflectance. Finally, the near-infrared spectrum data of each Panax notoginseng sample were stored row by row, and the origin of each sample was labeled to construct a Panax notoginseng near-infrared spectrum raw data set X with origin labels.
[0017] In this embodiment, since the dimension of each sample of the original dataset X of Panax notoginseng near-infrared spectrum reaches 6000 dimensions, if the original dataset X is directly used for the training and testing of the next model, it will inevitably consume more computing resources and time. Therefore, it is necessary to perform dimensionality reduction processing on the original dataset X of Panax notoginseng near-infrared spectrum to obtain a new dataset X after dimensionality reduction. p .like Figure 2 As shown in FIG. 1 , the dimensionality reduction processing of the data includes: calculating the distance matrix between the original data set X of the Panax notoginseng near-infrared spectrum; centering the distance matrix to eliminate the influence of the sample mean; performing eigenvalue decomposition on the centralized matrix to obtain eigenvalues and eigenvectors; and selecting the first P largest eigenvalues and their corresponding eigenvectors to construct a low-dimensional space.
[0018] The specific steps for data dimensionality reduction include:
[0019] Step 1, distance matrix calculation: Use the Euclidean distance formula to calculate the distance matrix between the data points of the original data set X of Panax notoginseng near-infrared spectrum to obtain the distance matrix D.
[0020] Step 2: Center the distance matrix. Center the distance matrix D through a double centering matrix to eliminate the influence of the sample mean and obtain the centering matrix B.
[0021]
[0022] Among them, D represents a distance matrix and J represents a centralization matrix.
[0023]
[0024] Among them, I represents the identity matrix, 1 represents the all-1 vector, and N represents the number of samples in the distance matrix D.
[0025] Step 3, eigenvalue decomposition: Perform eigenvalue decomposition on the centered matrix B to obtain the eigenvalue matrix Λ and the eigenvector matrix V.
[0026] B=VΛV T
[0027] Step 4: Select the principal component; that is, arrange the eigenvectors in descending order of eigenvalue, and select the first P eigenvectors as the new feature space, where P is the dimension after dimensionality reduction (the default value of parameter P is 5, which can be adjusted according to actual conditions, and is usually less than 10).
[0028] Step 5: Data projection: The matrix V consisting of the first P eigenvectors of the centered matrix B is p The diagonal matrix Λ composed of the first P eigenvalues p Multiply them to get the reduced-dimensional data matrix X p .
[0029]
[0030] Among them, including the former V p represents the matrix composed of the first P eigenvectors of the centralized matrix B, Λ p Represents the diagonal matrix consisting of the first P eigenvalues.
[0031] For the reduced dimension dataset X p Split the dataset into training and test sets. p The basic principle of splitting is to randomly shuffle the samples in the entire data set to ensure that the training set and test set after splitting are random and representative sample subsets. Dataset X p 80% of the total number of p_train , and the remaining 20% is used as the test set X p_test .
[0032] In this embodiment, an optimized logistic regression model is designed for identification of the geographical origin of Panax notoginseng. The optimization idea of the new model is to use the gradient descent method based on weighted mean square error to optimize the logistic regression model. The advantage of the weighted mean square error gradient descent method is that since the original data set is subjected to dimensionality reduction processing and the features of the new data set are sorted from high to low in importance, the loss of each new sample is adjusted by its corresponding weight, and the importance of different samples can be adjusted during the training process. This is very useful for processing unbalanced data sets or emphasizing the importance of specific samples.
[0033] In this embodiment, if Figure 3 As shown, the training of the Panax notoginseng origin identification model includes:
[0034] Step 1. Define the Sigmoid function: According to the design of the classic logistic regression model, the prediction function of the logistic regression model is:
[0035]
[0036] Among them, X p_train Represents the dataset X after dimensionality reduction p training set, θ represents the model parameter vector, h θ (X p_train ) indicates that the model is in the training set X p_train The prediction results on .
[0037] Step 2: Define the loss function: According to the design requirements of the new model, define a weighted mean square error loss function:
[0038]
[0039] Among them, N train Represents the training set X p_train The number of samples, λ i Represents the training set X after dimensionality reduction of the original data set p_train The i-th training sample x i_train The eigenvalue of h θ (x i_train ) indicates that the model is in the training set X p_train The i-th training sample x i_train The prediction results on x i_train Represents the training set X p_train The i-th training sample, y i_train Represents the training set X p_train The i-th training sample x i_train The real category.
[0040] Step 3: Calculate the gradient of the loss function: According to the definition in step 2, the gradient of the weighted mean square error loss function is calculated as follows:
[0041]
[0042] Where diag(λ) represents the diagonal matrix of the weight vector λ.
[0043] Step 4: Update the model parameters θ: Substitute the calculated loss function gradient into the following formula to obtain the next iteration parameters of the model.
[0044]
[0045] Among them, t represents the current iteration, t+1 represents the next iteration, and α represents the parameter update step (learning rate); the value range is (0,1). As the model training progresses, the learning rate α is dynamically adjusted to avoid training problems caused by excessive learning rates, thereby improving the training effect and convergence speed of the model. For example, the learning rate α can be reduced through the exponential decay formula.
[0046] α=α0·e -decay_rate·t
[0047] Among them, α0 represents the initial step size, decay_rate represents the decay rate, and t represents the current iteration.
[0048] Step 5: Repeat steps 3 and 4 until the loss function of the model converges to complete the model training.
[0049] In this embodiment, the test set X p_test Input the trained model in step 4 and return the predicted classification y pred . Its expression is:
[0050] y pred =round(h θ (X p_test ))
[0051] Calculate the predicted classification result y pred and the actual category y of the sample test , and finally the prediction accuracy of the logistic regression model based on the weighted mean square error gradient descent method is obtained; its expression is:
[0052]
[0053] Among them, count represents the count of the predicted classification results and the actual category of the sample, N test Denotes the test set X p_test The accuracy represents the prediction accuracy of the artificial intelligence model.
[0054] In terms of the identification of the origin of Chinese medicinal materials, this technical solution can accurately determine the origin of Panax notoginseng. The traditional method of identifying the origin of Panax notoginseng is subjective and uncertain, resulting in low reliability of the identification results. This technical solution uses big data technology to quickly and accurately identify the origin of Panax notoginseng based on the characteristic data of Panax notoginseng.
[0055] In terms of quality control of traditional Chinese medicine production, this technical solution can assist traditional Chinese medicine companies in accurately judging the quality of the purchased Panax notoginseng medicinal materials. Companies can better control the quality of raw materials and ensure that the produced medicines meet the prescribed quality standards.
[0056] In one embodiment of the present invention, the present invention also includes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for identifying the origin of Panax notoginseng based on big data technology.
[0057] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0058] A device for identifying the origin of Panax notoginseng based on big data technology, comprising a processor and a memory; the memory is used to store computer programs; the processor is connected to the memory, and is used to execute the computer programs stored in the memory, so that the device for identifying the origin of Panax notoginseng based on big data technology can execute any of the above-mentioned methods for identifying the origin of Panax notoginseng based on big data technology.
[0059] Specifically, the memory includes: ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk, etc., which can store program codes.
[0060] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0061] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for identifying the origin of Panax notoginseng based on big data technology, characterized in that: include: Obtaining a Panax notoginseng sample to be identified; Construct a Panax notoginseng near-infrared spectroscopy dataset; Perform dimensionality reduction on the data in the Panax notoginseng near-infrared spectroscopy dataset; The reduced-dimensional data set is divided into a training set and a test set; a Panax notoginseng origin identification model is constructed, wherein the Panax notoginseng origin identification model is a logistic regression model; The data in the training set are input into the Panax notoginseng origin identification model for training; Input the data in the test set into the trained Panax notoginseng origin identification model for testing; The Panax notoginseng samples to be identified are input into the trained Panax notoginseng origin identification model to obtain the Panax notoginseng origin identification result.
2. According to claim 1, a method for identifying the origin of Panax notoginseng based on big data technology is characterized in that: Constructing the Panax notoginseng near-infrared spectroscopy dataset includes: collecting Panax notoginseng Chinese medicinal material samples from different origins; cleaning, drying and grinding the Panax notoginseng samples; taking 2 grams of sample powder and using a Fourier transform near-infrared spectrometer to collect near-infrared spectral data of the Panax notoginseng powder; storing all near-infrared spectral data and storing each sample by row; marking the origin of each sample to obtain the Panax notoginseng near-infrared spectroscopy dataset.
3. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 1, characterized in that: The dimensionality reduction processing of the data includes: calculating the distance matrix between the original data set X of Panax notoginseng near-infrared spectrum data points; centering the distance matrix to eliminate the influence of the sample mean; performing eigenvalue decomposition on the centralized matrix to obtain eigenvalues and eigenvectors; and selecting the first P largest eigenvalues and their corresponding eigenvectors to construct a low-dimensional space.
4. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 1, characterized in that: Training the Panax notoginseng origin identification model includes: Step 1: Define the prediction function of the logistic regression model; Step 2: Input the data in the training set into the prediction function that defines the logistic regression model to obtain the prediction result; Step 3: Calculate the loss function of the model based on the prediction results; Step 4: Calculate the gradient of the loss function; Step 5: Update the model parameters according to the gradient of the loss function; Step 6: Repeat steps 4 to 5 until the loss function of the model converges to complete the model training.
5. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 4 is characterized in that: The prediction function of the logistic regression model is: Among them, X p_train Represents the dataset X after dimensionality reduction p training set, θ represents the model parameter vector, h θ (X p_train ) indicates that the model is in the training set X p_train The prediction results on .
6. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 4 is characterized in that: The loss function of the model is a weighted mean square error loss function, which is expressed as: Among them, N train Represents the training set X p_train The number of samples, λ i Represents the training set X after dimensionality reduction of the original data set p_train The i-th training sample x i_train The eigenvalue of h θ (x i_train ) indicates that the model is in the training set X p_train The i-th training sample x i_train The prediction results on x i_train Represents the training set X p_train The i-th training sample, y i_train Represents the training set X p_train The i-th training sample x i_train The real category.
7. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 4 is characterized in that: The expression for calculating the gradient of the loss function is: Where diag(λ) represents the diagonal matrix of the weight vector λ.
8. The method for identifying the origin of Panax notoginseng based on big data technology according to claim 4 is characterized in that: The model parameters are updated as follows: Among them, t represents the current iteration, t+1 represents the next iteration, and α represents the parameter update step size.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor according to the method for identifying the origin of Panax notoginseng based on big data technology as described in any one of claims 1 to 8.
10. A device for identifying the origin of Panax notoginseng based on big data technology, characterized in that: It comprises a processor and a memory; the memory is used to store a computer program; the processor is connected to the memory and is used to execute the computer program stored in the memory, so that the Panax notoginseng origin identification device based on big data technology executes the Panax notoginseng origin identification method based on big data technology as described in any one of claims 1 to 8.
Citation Information
Patent Citations
artificial intelligence-based true and false mixed traditional Chinese medicinal material identification method
CN109919224A
Construction method and application of clinacanthus nutans seed source land classification model based on NIR spectrum
CN111595802A
Hyperspectral traditional Chinese medicinal material identification method based on adaptive random block convolution kernel network
CN113989525A
Cited By
Agricultural product producing area tracing method based on radioactive energy spectrum analysis
CN121684967A
