Pseudo-ginseng producing area identification method and device based on spectrum and image conversion, medium and product
Through spectral and image transformation methods, the one-dimensional matrix spectral data is converted into spectral images, and combined with extreme stretching and lightweight models, the problem of low accuracy of Sanqi origin identification analysis in LIBS technology is solved, achieving higher identification Accuracy and accuracy support the industrial development of traceability of traditional Chinese medicine origin.
Patent Information
- Application Number
- CN202411162280.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-22
AI Technical Summary
The accuracy of Panax notoginseng origin identification analysis based on LIBS technology is low, with large errors, and it is difficult to effectively improve.
The spectral and image transformation method is used to convert the one-dimensional matrix spectral data into spectral images, combining extreme stretching and lightweight models, amplify the subtle differences in sampling points, enhance spatial distribution characteristics, and improve identification accuracy.
It improves the accuracy and accuracy of the identification of the origin of Panax notoginseng, reduces random error interference, enhances the anti-interference ability and robustness of the model, meets the needs of portable equipment, and serves the industrial development of traceability of traditional Chinese medicine origin.
Smart Images

Figure CN119007016A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of origin tracing of Chinese medicinal materials, and in particular to a method, device, medium and product for identifying the origin of Panax notoginseng based on spectrum and image transformation. Background Art
[0002] Panax notoginseng is a perennial herbaceous plant of the genus Panax, Araliaceae. According to the Chinese Medicine Dictionary, "Panax notoginseng can nourish blood, remove blood stasis, stop bleeding, and has the best effect. It is the most precious among all prescriptions." Modern pharmacological studies have also shown that Panax notoginseng has the effects of promoting blood circulation, stopping bleeding, and regulating immunity. Panax notoginseng has significant therapeutic effects, is a medicine and food, and has a wide range of uses. In recent years, the demand for Panax notoginseng has increased sharply. In order to alleviate the obstacles of continuous cropping in the planting area and cope with the problem of long planting years, the planting range of Panax notoginseng has been expanded from Wenshan Prefecture, Yunnan Province, the main production area, to form new production areas. Geographical and climatic factors affect the accumulation of saponin components, and soil fertility characteristics affect nutrient absorption and utilization. Therefore, the quality and safety of Panax notoginseng are closely related to the growth conditions such as the environment and soil of the production area. The origin is also considered a comprehensive indicator for evaluating quality. Therefore, origin traceability is conducive to ensuring the effectiveness, stability and safety of Panax notoginseng quality.
[0003] The trace element content of Panax notoginseng varies significantly in type, composition and content due to the influence of factors such as the growing environment and soil geology of the origin. It can be used as a characteristic indicator and important reference for origin identification. The element fingerprint characteristic spectrum of Panax notoginseng can provide an important basis for origin tracing. Laser-induced breakdown spectroscopy (LIBS) is an analysis method of atomic emission spectroscopy that focuses high-energy laser pulses on the sample to induce the sample to produce plasma. By analyzing the transition spectrum of the plasma, the element characteristics of the substance are further analyzed to achieve qualitative and quantitative analysis. As an emerging atomic spectroscopy technology, LIBS has attracted widespread attention due to its rapid detection, multi-element analysis, and long-distance transmission. There have been relevant studies on its application in the identification of the origin of traditional Chinese medicine. In some cases, the accuracy of Panax notoginseng origin identification analysis based on LIBS technology is low and the error is large. Therefore, how to improve the accuracy of Panax notoginseng origin identification needs to be solved urgently. Summary of the invention
[0004] The purpose of this application is to provide a method, equipment, medium and product for identifying the origin of Panax notoginseng based on spectral and image transformation, which can amplify subtle differences between sampling points, enhance the change trends and spatial distribution characteristics between sampling points, and improve the accuracy of Panax notoginseng origin identification.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In the first aspect, the present application provides a method for identifying the origin of Panax notoginseng based on spectrum and image transformation, including: obtaining spectral data of Panax notoginseng samples from different origins; drawing a spectral curve of each Panax notoginseng sample based on the spectral data of each Panax notoginseng sample; using an extreme value stretching method to stretch the spectral curve of each Panax notoginseng sample in spatial scale; deleting the coordinate axis in the stretched spectral curve, and storing the spectral image of each Panax notoginseng sample; training a lightweight model for identifying the origin of Panax notoginseng based on the spectral images of all Panax notoginseng samples to obtain a trained lightweight model; using the trained lightweight model to identify the origin of the spectral image of the Panax notoginseng to be identified, and obtaining an identification result.
[0007] In a second aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the above-mentioned methods for identifying the origin of Panax notoginseng based on spectral and image transformation.
[0008] In a third aspect, the present application provides 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 spectral and image transformation.
[0009] In a fourth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for identifying the origin of Panax notoginseng based on spectrum and image transformation.
[0010] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0011] This application plots the spectral data into a spectral curve, and transforms the spectral curve into a spectral image by extreme value stretching and deleting the coordinate axis. It combines a lightweight model to identify the origin of Panax notoginseng, amplifies the subtle differences between the sampling points, enhances the changing trends and spatial distribution characteristics between the sampling points, and improves the accuracy of Panax notoginseng origin identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0013] Figure 1 A schematic flow chart of a method for identifying the origin of Panax notoginseng based on spectrum and image transformation provided in an embodiment of the present application.
[0014] Figure 2 A schematic diagram of the spectral curve and spectral image transformation process provided in an embodiment of the present application.
[0015] Figure 3 A schematic diagram of spectral data collection for the laser induced breakdown spectroscopy detection platform provided in an embodiment of the present application.
[0016] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0019] In some cases, origin identification analysis based on LIBS technology mainly focuses on modeling and analysis using LIBS one-dimensional matrix spectral data, ignoring the spatial distribution characteristics of the spectrum, insufficient utilization of effective information, and difficulty in improving discrimination accuracy.
[0020] Embodiment 1, as Figure 1-Figure 2 As shown, this embodiment provides a method for identifying the origin of Panax notoginseng based on spectrum and image transformation, which specifically includes:
[0021] Step S1. Obtaining spectral data of Panax notoginseng samples from different origins, specifically including:
[0022] S11. Obtain Panax notoginseng samples from different origins.
[0023] In actual application, the process of preparing Panax notoginseng samples is as follows:
[0024] Panax notoginseng samples were collected from Chuxiong, Kunming, Qujing, Wenshan, Honghe and Yuxi. Panax notoginseng was dug three years after planting, and the surface impurities were cleaned and dried. The dried Panax notoginseng samples were ground in a traditional Chinese medicine grinder and passed through the pharmacopoeia No. 4 sieve to obtain Panax notoginseng powder samples. 0.2g of powder sample was weighed and pressed into a disc sample with a diameter of 13mm and a thickness of 1mm using a hydraulic press at a pressure of 20MPa for 30s for LIBS spectrum acquisition.
[0025] S12. Use the laser induced breakdown spectroscopy detection system to obtain the spectral data of Panax notoginseng samples from different origins.
[0026] In actual application, Figure 3 As shown, a laser induced breakdown spectroscopy detection system is used to obtain LIBS spectral data. The detection system is mainly composed of a laser, a spectrometer, a detector, a delay generator, an electric translation stage, an optical path system, etc. The laser provides laser pulse energy for the LIBS system; the constructed optical path system focuses the laser to 2mm below the surface of the Panax notoginseng sample; the electromagnetic wave signal radiated by the plasma is split by the spectrometer, and the photodetector converts the optical signal into an electrical signal, which is transmitted to the computer for reading and recording. This embodiment uses a CT monochromator SR500i with a band range of 209.97-230.98nm and a total of 1024 variables; a digital delay generator is used for timing control between the laser and the ICCD detector; and the electric translation stage realizes the acquisition of LIBS signals at different sites of the Panax notoginseng sample. In this embodiment, the parameters of the LIBS detection system are set as follows: delay time 2μs, integration time 8μs, laser energy 40mJ, and continuous hitting of a single site 9 times. The moving path of the XYZ electric translation stage was set to a 2×3 matrix. By controlling the movement of the Panax notoginseng sample, LIBS spectral data at 6 different sites were collected. A single site was laser-struck 9 times. The LIBS spectrum of the Panax notoginseng sample was the average of 54 (2×3×9) spectra.
[0027] Step S2. Draw a spectral curve of each Panax notoginseng sample according to the spectral data of each Panax notoginseng sample, specifically including: using the wavelength of the sampling point in the spectral data of each Panax notoginseng sample as the horizontal axis of the spectral curve, and using the spectral intensity value of the spectral data of each sample as the vertical axis of the spectral data, to obtain the spectral curve of each sample.
[0028] Optionally, to ensure the consistency of the image transformation during the extreme value stretching process in step 3, the drawing parameters of the spectral curve are set to: line width 1.5, red line type and white background.
[0029] Step S3: using an extreme value stretching method to stretch the spectral curve of each Panax notoginseng sample in terms of spatial scale, specifically comprising:
[0030] S31. intercepting a spectral curve of a preset wavelength band from the spectral curve of each Panax notoginseng sample.
[0031] Optionally, the preset wavelength band ranges from 209.5 nm to 231 nm.
[0032] S32. The maximum and minimum energy values of the sampling points in the intercepted spectral curve are respectively used as the upper and lower boundaries of the vertical axis for stretching to obtain a stretched spectral curve.
[0033] Through step S3, the spectrum curve can be distributed on a canvas of a fixed size to the greatest extent, thereby amplifying the subtle differences in spectral lines of the spectrum curve.
[0034] Step S4. Delete the coordinate axis in the stretched spectral curve, and store the spectral image of each Panax notoginseng sample.
[0035] Optionally, the format of the spectral image is PNG format.
[0036] Furthermore, after step S4, the method further includes: unifying the sizes of the spectral images of all Panax notoginseng samples into a preset size, wherein the preset size is 224 pixels in width and 224 pixels in height.
[0037] Step S5. Training a lightweight model for identifying the origin of Panax notoginseng based on the spectral images of all Panax notoginseng samples to obtain a trained lightweight model, specifically comprising:
[0038] S51. The spectral images of all Panax notoginseng samples were divided into training set, validation set and test set.
[0039] In the actual application process, a total of 420 Panax notoginseng samples were prepared and randomly divided into training set, validation set and test set in a ratio of 3:1:1, with 252, 84 and 84 Panax notoginseng samples respectively.
[0040] S52. Construct a lightweight model for identifying the origin of Panax notoginseng.
[0041] S53. Using the origin of Panax notoginseng as a label, input the training set into the constructed lightweight model for training.
[0042] S54. Use the validation set to select the optimal parameters of the lightweight model, and take the model corresponding to the minimum value of the loss function (when the loss drops to a stable value) as the trained lightweight model.
[0043] In the actual application process, the Pytorch framework is mainly used to train the lightweight model for Panax notoginseng origin identification. The model training parameters are set as follows: batch size (Batch_size) is 8; Cross Entropy Loss function (Cross EntropyLoss function) is the evaluation standard; the optimizer is Adam; the initial learning rate is set to 0.01, and the learning rate gradient descent strategy is adopted. After every 50 training cycles, the learning rate is reduced by 10 times until the validation set loss no longer decreases and the training stops.
[0044] S55. Use the test set to evaluate the model performance of the trained lightweight model.
[0045] In the actual application process, a Panax notoginseng origin identification model based on spectral images was established. The model performance was tested in the test set to determine the origin of Panax notoginseng. The results are as follows: the discrimination accuracy is 0.9881 (83 / 84) and the F-Score is 0.9855. It can be seen that the lightweight model based on spectral images has achieved satisfactory results, verifying the feasibility of this method in identifying the origin of Panax notoginseng.
[0046] Step S6. Use the trained lightweight model to identify the origin of the spectral image of the Panax notoginseng to obtain an identification result.
[0047] Furthermore, the lightweight model is at least one of MobileNet_V2, ShuffleNet_V2 and GhostNet.
[0048] This application transforms one-dimensional matrix spectral data into spectral images to improve the utilization rate of effective spectral information, further considers the continuous change trend and spatial distribution characteristics of the spectrum, analyzes the spectral characteristics of Panax notoginseng from an image perspective, simplifies the calculation steps, improves detection efficiency, and realizes origin identification, providing decision-making support for Panax notoginseng origin identification, and will be better applied and serve the industrial development needs of Chinese medicine origin traceability in the future.
[0049] Specifically, this application has the following technical features:
[0050] First, this application proposes a method for transforming one-dimensional matrix spectral data into spectral images. By analyzing the spectral image, the continuous change trend and spatial distribution characteristics of the spectrum are further considered, the utilization rate of spectral information is improved, the spectral characteristics are more comprehensively characterized, and the accuracy and precision of discrimination are improved.
[0051] Second, the present application adopts the extreme value stretching method to amplify the subtle differences in spectral lines in the spectrum, reduce the overall fluctuation of signal intensity between samples caused by the experimental environment and the detection system, and reduce the interference of random errors on the discrimination results.
[0052] Third, the spectrum and image transformation method of the present application has simple steps and rich information, which can effectively reduce the impact of single-point variable fluctuations of spectral signals on model performance, enhance the anti-interference ability and robustness of the model, and establish a discrimination model in combination with a lightweight model, thereby reducing the requirements for the operating environment and equipment hardware.
[0053] Fourth, the lightweight model used in this application is small in size, has fewer parameters, and occupies little memory. It can meet the requirements of portable and mobile equipment in actual production and serve the digital development of the traceability of the origin of traditional Chinese medicine. This application provides decision-making support for the identification of the origin of Panax notoginseng, and will be better applied to and serve the industrial development needs of the traceability of the origin of traditional Chinese medicine in the future.
[0054] Embodiment 2, the present application also provides a computer device, which may be a server or a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video tag processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for identifying the origin of Panax notoginseng based on spectral and image transformation is implemented.
[0055] Embodiment 3, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for identifying the origin of Panax notoginseng based on spectrum and image transformation.
[0056] Embodiment 4, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for identifying the origin of Panax notoginseng based on spectrum and image transformation.
[0057] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0058] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0059] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0060] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0061] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for identifying the origin of Panax notoginseng based on spectrum and image transformation, characterized in that: The method for identifying the origin of Panax notoginseng based on spectrum and image transformation includes: Obtain spectral data of Panax notoginseng samples from different origins; Draw a spectrum curve of each Panax notoginseng sample according to the spectrum data of each Panax notoginseng sample; The extreme value stretching method was used to stretch the spatial scale of the spectral curve of each Panax notoginseng sample; Deleting the coordinate axis in the stretched spectrum curve, and storing the spectrum image of each Panax notoginseng sample; A lightweight model for identifying the origin of Panax notoginseng is trained based on the spectral images of all Panax notoginseng samples to obtain a trained lightweight model; The trained lightweight model is used to identify the origin of the spectral image of Panax notoginseng to obtain the identification result.
2. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1, characterized in that: Obtain spectral data of Panax notoginseng samples from different origins, including: Obtain Panax notoginseng samples from different origins; The spectral data of Panax notoginseng samples from different origins were obtained using a laser induced breakdown spectroscopy detection system.
3. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1 is characterized in that: A spectral curve of each Panax notoginseng sample is drawn according to the spectral data of each Panax notoginseng sample, specifically including: The wavelength of the sampling point in the spectral data of each Panax notoginseng sample is used as the horizontal axis of the spectral curve, and the spectral intensity value of the spectral data of each sample is used as the vertical axis of the spectral data to obtain the spectral curve of each sample.
4. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1, characterized in that: The extreme value stretching method is used to stretch the spatial scale of the spectral curve of each Panax notoginseng sample, specifically including: intercepting a spectrum curve of a preset wavelength band from the spectrum curve of each Panax notoginseng sample; The maximum and minimum values of the spectral intensity values of the sampling points in the intercepted spectral curve are respectively used as the upper and lower boundaries of the vertical axis for stretching to obtain a stretched spectral curve.
5. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1, characterized in that: After deleting the coordinate axis in the stretched spectral curve and storing the spectral image of each Panax notoginseng sample, the following steps are also included: The sizes of the spectral images of all Panax notoginseng samples were unified to the preset size.
6. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1, characterized in that: Based on the spectral images of all Panax notoginseng samples, a lightweight model for identifying the origin of Panax notoginseng is trained to obtain a trained lightweight model, which specifically includes: The spectral images of all Panax notoginseng samples were divided into training set, validation set and test set; Construct a lightweight model for identifying the origin of Panax notoginseng; Using the origin of Panax notoginseng as a label, the training set is input into the constructed lightweight model for training; Use the validation set to select the optimal parameters of the lightweight model, and take the model corresponding to the minimum loss function as the trained lightweight model; Use the test set to evaluate the model performance of the trained lightweight model.
7. The method for identifying the origin of Panax notoginseng based on spectrum and image transformation according to claim 1, characterized in that: The lightweight model is at least one of MobileNet_V2, ShuffleNet_V2 and GhostNet.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for identifying the origin of Panax notoginseng based on spectral and image transformation as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying the origin of Panax notoginseng based on spectrum and image transformation described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying the origin of Panax notoginseng based on spectrum and image transformation described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Laser probe classification method and device capable of automatically selecting spectral lines based on image characteristics
CN110751048A
Image processing method of feature data and application thereof
CN113255654A
Pseudo-ginseng producing area discrimination method
CN115015222A
Cited By
Traditional Chinese medicinal material production place tracing method, device, equipment, medium and product
CN120106873A
