Deep learning-based zingiberaceae Dai medicine intelligent identification method
Through the intelligent identification method of Jiangke Dai medicine based on deep learning, the swin-transformer model and the background suppression module are used to solve the problem of difficult identification of medicinal pieces with similar shapes, achieve high accuracy and high efficiency identification, and reduce the need for manual labor. Dependence on knowledge.
Patent Information
- Application Number
- CN202410845212.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-29
AI Technical Summary
It is difficult to accurately identify Zingiberaceae herbal medicine pieces with similar shapes using existing technology, resulting in low identification accuracy and low efficiency due to reliance on manual labor or professional equipment.
The intelligent identification method of Jiangke Dai medicine based on deep learning is adopted, the swin-transformer model is used as the backbone network, combined with the background suppression module and feature fusion module, and through image preprocessing and data enhancement, a high-accuracy identification model is established, and the model is built on the cloud Deployed on the server and provided for use on web pages and small programs.
It achieves an identification accuracy of up to 93% for medicinal pieces with extremely similar shapes, improves identification efficiency, reduces reliance on manual knowledge, and significantly improves accuracy compared to manual and general artificial intelligence methods.
Smart Images

Figure CN118865366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Dai medicine identification, and in particular to an intelligent identification method of Dai medicine of the Zingiberaceae family based on deep learning. Background Art
[0002] The existing Dai medicine identification methods are as follows: identifying medicinal pieces by observing appearance characteristics or microscopic cells. Since this method uses manual identification, it is highly dependent on the identification personnel's professional experience and professional skills. It requires identification personnel to have a solid theoretical foundation and rich practical experience, and it requires years of experience accumulation. The professional barriers are high and the efficiency is low, which is prone to misjudgment.
[0003] The method of collecting medicinal pieces for chemical composition identification relies on professional equipment to identify the chemical composition and thus identify the medicinal pieces. It is inconvenient and inefficient to require professional equipment to support the identification of medicinal pieces.
[0004] Identification is done through artificial intelligence methods, which usually use convolutional neural networks (CNN) or ViT models, input the image data to be classified to extract image features, then classify according to the extracted features, continuously iterate and optimize the training of the neural network model, and finally use the trained model to complete image recognition and classification. However, this method and its various variants are mostly used for coarse-grained classification, and the features of the identified objects are very different, such as turmeric and Paris polyphylla.
[0005] For medicinal materials with similar characteristics of the same species and family, such as turmeric and cardamom, there are only slight differences in some parts. These subtle differences are easily covered by factors such as light, color, background, shape and position, making classification difficult. Previous methods have difficulty in achieving high-accuracy recognition. Summary of the invention
[0006] The purpose of the present invention is to provide an intelligent identification method of Dai medicine of the Zingiberaceae family based on deep learning in response to the above-mentioned problems that currently exist, to solve the problem that artificial intelligence is difficult to identify medicinal materials with similar shapes, and to solve the problem that the existing manual identification of medicinal materials has poor accuracy and efficiency.
[0007] The technical solution of the present invention is as follows:
[0008] A deep learning-based intelligent identification method for Dai medicine of Zingiberaceae includes the following steps:
[0009] Image preprocessing: Collect images of ginger Dai medicine pieces and create artificial intelligence training data sets, and perform preprocessing;
[0010] Neural network selection and training: Analyze the appearance characteristics of medicinal pieces, select different neural network models for testing, sort the models according to the effect, improve and optimize the models, use the training data set for training, further optimize the models according to the training results, and complete the network training;
[0011] Deploy model: deploy AI models in cloud servers;
[0012] User use.
[0013] Furthermore, the neural network selection and training specifically includes the following steps:
[0014] Using swin-transfromer as the backbone of the identification model;
[0015] The features extracted from the backbone are input into the background suppression module, which extracts important features from the input image and suppresses background features. The classification score map is generated based on the extracted features for initial classification.
[0016] Use weakly supervised selection module to select and discard classification score maps;
[0017] Use graph convolutional neural networks to merge features and make predictions based on the merged features;
[0018] Set the prediction objective function to iteratively optimize the model to achieve the target effect.
[0019] Furthermore, the identification model divides the training data set into a training set, a validation set and a test set in a ratio of 8:1:1 for training and testing. During training, the learning rate is set to 0.0005, the cosine decay and the weight decay are set to 0.0005, the optimizer is SGD, the batch size is 8, the gradient accumulation step is set to 4, and the model is trained for 40 epochs.
[0020] Furthermore, the deployment model includes: using Flask as a front-end and back-end interaction tool, and the back-end uses a trained model to infer and identify images.
[0021] Furthermore, the user use specifically includes the following steps:
[0022] Create web pages and WeChat mini-programs for users to use;
[0023] The user takes the image and uploads it to the server through the web page or client;
[0024] The server obtains the identification results through artificial intelligence model reasoning and feeds them back to the user.
[0025] Furthermore, the image preprocessing specifically includes the following steps:
[0026] Collect at least two images of Dai medicinal pieces from the ginger family;
[0027] Perform cropping and denoising preprocessing on the image;
[0028] Rotate, symmetrize, flip, scale, and cut the image to complete data augmentation and expand the dataset;
[0029] The images are divided into training, validation, and test sets in proportion.
[0030] Furthermore, the image preprocessing specifically includes the following steps:
[0031] Use digital cameras to collect 600 high-definition images of at least seven kinds of ginger herbal pieces, and have them categorized and annotated by relevant medicinal material experts;
[0032] The images were preprocessed using cropping and denoising, and then the data set was expanded to 3,000 images per type of herbal medicine using data augmentation methods.
[0033] Create a dataset of ginger Dai medicine pieces for artificial intelligence training.
[0034] Furthermore, the ginger family decoction pieces include nine-winged cardamom, turmeric, closed sheath ginger, Dai cardamom, red cardamom, purple ginger, and fennel cardamom.
[0035] Furthermore, the data enhancement method is to randomly scale, rotate, flip, and shear the original image.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] 1. An intelligent identification method for Dai medicine of the ginger family based on deep learning. Compared with the manual identification method, this method does not require professional knowledge, does not rely on manual work, and has high identification efficiency;
[0038] 2. An intelligent identification method for Dai medicine of the ginger family based on deep learning. Compared with general artificial intelligence methods, this method can achieve an identification accuracy rate of up to 93% in medicinal materials with extremely similar shapes. Compared with the previous artificial intelligence identification methods with an identification accuracy rate of 60% to 70%, this method has greatly improved the identification accuracy rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flowchart of an intelligent identification method for Dai medicine of the Zingiberaceae family based on deep learning.
[0040] Figure 2 This is an artificial intelligence model diagram of an intelligent identification method of Dai medicine of the ginger family based on deep learning.
[0041] Figure 3This is a web design rendering of an intelligent identification method for Dai medicine of the ginger family based on deep learning.
[0042] Figure 4 Design effect of a mini program for intelligent identification method of ginger Dai medicine based on deep learning Figure 1 .
[0043] Figure 5 Design effect of a mini program for intelligent identification method of ginger Dai medicine based on deep learning Figure 2 . DETAILED DESCRIPTION
[0044] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0045] The features and performance of the present invention are further described in detail below in conjunction with the embodiments.
[0046] See also Figure 1-5 , an intelligent identification method of Dai medicine of Zingiberaceae based on deep learning, such as Figure 1 and Figure 2 As shown, the following steps are included:
[0047] Image preprocessing: Collect images of ginger Dai medicine pieces and create artificial intelligence training data sets, and perform preprocessing;
[0048] Neural network selection and training: Analyze the appearance characteristics of medicinal pieces, select different neural network models for testing, sort the models according to the effect, improve and optimize the models, use the training data set for training, further optimize the models according to the training results, and complete the network training;
[0049] Deploy model: deploy AI models in cloud servers;
[0050] User use.
[0051] The neural network selection and training specifically includes the following steps:
[0052] Use swin-transfromer as the backbone of the identification model;
[0053] The features extracted from the backbone are input into the background suppression module, which extracts important features from the input image and suppresses background features. The classification score map is generated based on the extracted features for initial classification.
[0054] Use weakly supervised selection module to select and discard classification score maps;
[0055] Use graph convolutional neural networks to merge features and make predictions based on the merged features;
[0056] Set the prediction objective function to iteratively optimize the model to achieve the target effect.
[0057] The identification model divides the training data set into training set, validation set and test set in a ratio of 8:1:1 for training and testing. During the training, the learning rate is set to 0.0005, the cosine decay and weight decay are set to 0.0005, the optimizer is SGD, the batch size is 8, the gradient accumulation step is set to 4, and the model is trained for 40 epochs. The average accuracy of identification of seven ginger herbs exceeded 93% when tested on the trained model.
[0058] The deployment model includes: using Flask as a front-end and back-end interaction tool, and the back-end uses a trained model to infer and identify images.
[0059] The user use specifically includes the following steps:
[0060] Create web pages and WeChat mini-programs for users to use;
[0061] The user takes the image and uploads it to the server through the web page or client;
[0062] The server obtains the identification results through artificial intelligence model reasoning and feeds them back to the user.
[0063] The image preprocessing specifically comprises the following steps:
[0064] Collect multiple (two or more) images of Dai medicine pieces from the ginger family;
[0065] Perform cropping and denoising preprocessing on the image;
[0066] Rotate, symmetrize, flip, scale, and cut the image to complete data augmentation and expand the dataset;
[0067] The images are divided into training, validation, and test sets in proportion.
[0068] The image preprocessing specifically comprises the following steps:
[0069] Use digital cameras to collect 600 high-definition images of at least seven kinds of ginger herbal pieces, and have them categorized and annotated by relevant medicinal material experts;
[0070] The images were preprocessed using cropping and denoising, and then the data set was expanded to 3,000 images per type of herbal medicine using data augmentation methods.
[0071] Create a dataset of ginger Dai medicine pieces for artificial intelligence training.
[0072] The ginger family decoction pieces include nine-winged cardamom, turmeric, closed sheath ginger, Dai grass cardamom, red cardamom, purple ginger, and fennel cardamom.
[0073] The data enhancement method is to randomly scale, rotate, flip and shear the original image.
[0074] In addition to manual identification methods, previous artificial intelligence identification methods usually use convolutional neural networks (CNNs), which input image data to be classified to extract image features, then classify according to the extracted features, continuously iterate and optimize the training of the neural network model, and finally use the trained model to complete image recognition and classification. However, this method and its various variants are mostly used for coarse-grained classification (the features of the various objects to be identified are very different, such as turmeric and Paris polyphylla).
[0075] At present, artificial intelligence recognition models for Chinese medicinal materials are only used for the identification and classification of large categories of medicinal materials (such as the identification of 100 Chinese herbal medicines using yolov8) or the quality identification of a single variety of medicinal materials. However, the above methods are difficult to achieve high-accuracy recognition for medicinal pieces of the same species and family with similar characteristics (such as turmeric and cardamom, which only have slight differences in a certain part, and these subtle differences are easily covered by changing factors such as lighting, color, background, shape and position, resulting in classification difficulties.).
[0076] This patent uses the swin-transformer model to achieve fine-grained classification of seven kinds of ginger Dai medicine. In view of the high similarity of features between various types of medicinal pieces, the model is fine-tuned and improved to suppress the background features of the image, enhance the model's attention to key feature areas, strengthen the extraction of medicinal piece discrimination features, and improve the model's ability to identify similar features.
[0077] In another embodiment, an artificial intelligence training data set is established by A) collecting images of the decoction pieces to be identified;
[0078] B) Design and improve a fine-grained recognition method for the appearance of medicinal pieces, add background suppression modules and feature fusion prediction modules, use swin-transformer model as the backbone network for improved fine-tuning and iterative optimization. Then use this method and other current fine-grained classification methods to test on additional public datasets CUB-200-2011 (200 bird categories, including 5994 training images and 5794 test data) and dataset A (7 ginger medicinal pieces categories, 3360 training images and 840 test images). The classification and identification accuracy of this project method on both datasets is the highest, as shown in Table 1:
[0079] Table 1 Comparison results of the tests of various methods on the Zingiber officinale pieces dataset and the CUB-200-2011 dataset
[0080]
[0081] In order to verify the effectiveness of the improved method proposed in this project, this experiment used different native backbone networks to compare the classification accuracy of the backbone network added with the module designed in this project on the public dataset and dataset A. The ablation experiment shows that the background suppression module and feature fusion module designed in this project effectively improve the identification accuracy, as shown in Table 2:
[0082] Table 2 Ablation test results of the design method of this project on the Zingiber officinale pieces dataset and CUB-200-2011 dataset
[0083]
[0084]
[0085] C) Deploy the trained model to the server and use the deep learning model to perform inference and identification on the images uploaded by users.
[0086] D1) Users upload pictures through the web page to obtain medicinal material identification results, such as Figure 3 As shown:
[0087] D2) Users upload pictures through the mini program to obtain medicinal material identification results, such as Figure 4 and Figure 5 shown.
[0088] The above-mentioned embodiments only express the specific implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the protection scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the technical solution concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A deep learning-based intelligent identification method for Dai medicine of Zingiberaceae, characterized in that: The following steps are involved: Image preprocessing: Collect images of ginger Dai medicine pieces and create artificial intelligence training data sets, and perform preprocessing; Neural network selection and training: Analyze the appearance characteristics of medicinal pieces, select different neural network models for testing, sort the models according to the effect, improve and optimize the models, use the training data set for training, further optimize the models according to the training results, and complete the network training; Deploy model: deploy AI models in cloud servers; User use.
2. According to the deep learning-based intelligent identification method of Zingiberaceae Dai medicine according to claim 1, it is characterized in that: The neural network selection and training specifically includes the following steps: Using swin-transfromer as the backbone of the identification model; The features extracted from the backbone are input into the background suppression module, which extracts features from the input image and suppresses background features. The classification score map is generated based on the extracted features for initial classification. Use weakly supervised selection module to select and discard classification score maps; Use graph convolutional neural networks to merge features and make predictions based on the merged features; Set the prediction objective function to iteratively optimize the model to achieve the target effect.
3. According to the deep learning-based intelligent identification method of Zingiberaceae Dai medicine according to claim 2, it is characterized in that: The identification model divides the training data set into a training set, a validation set, and a test set in a ratio of 8:1:1 for training and testing. During training, the learning rate is set to 0.0005, the cosine decay and weight decay are set to 0.0005, the optimizer is SGD, the batch size is 8, the gradient accumulation step is set to 4, and the model is trained for 40 epochs.
4. According to the deep learning-based intelligent identification method of Zingiberaceae Dai medicine according to claim 1, it is characterized in that: The deployment model includes: using Flask as a front-end and back-end interaction tool, and the back-end uses a trained model to infer and identify images.
5. The method for intelligent identification of Dai medicine of Zingiberaceae based on deep learning according to claim 1 is characterized in that: The user use specifically includes the following steps: Create web pages and WeChat mini-programs for users to use; The user takes the image and uploads it to the server through the web page or client; The server obtains the identification results through artificial intelligence model reasoning and feeds them back to the user.
6. The method for intelligent identification of Dai medicine of Zingiberaceae based on deep learning according to claim 1 is characterized in that: The image preprocessing specifically comprises the following steps: Collect at least two images of Dai medicinal pieces from the ginger family; Perform cropping and denoising preprocessing on the image; Rotate, symmetrize, flip, scale, and cut the image to complete data augmentation and expand the dataset; The images are divided into training, validation, and test sets in proportion.
7. The method for intelligent identification of Dai medicine of Zingiberaceae based on deep learning according to claim 6 is characterized in that: The image preprocessing specifically comprises the following steps: Use digital cameras to collect 600 high-definition images of at least seven kinds of ginger herbal pieces, and have them categorized and annotated by relevant medicinal material experts; The images were preprocessed using cropping and denoising, and then the data set was expanded to 3,000 images per type of herbal medicine using data augmentation methods. Create a dataset of ginger Dai medicine pieces for artificial intelligence training.
8. The deep learning-based intelligent identification method of Zingiberaceae Dai medicine according to claim 7 is characterized in that: The ginger family decoction pieces include nine-winged cardamom, turmeric, closed sheath ginger, Dai grass cardamom, red cardamom, purple ginger, and fennel cardamom.
9. The method for intelligent identification of Dai medicine of Zingiberaceae based on deep learning according to claim 7 is characterized in that: The data enhancement method is to randomly scale, rotate, flip and shear the original image.
Citation Information
Patent Citations
Finished tea quality identification method based on transfer learning and computer vision technologies
CN112434646A
