Bo-white peony root identification method, system and equipment based on deep learning model and medium
Through the deep learning model, the Bobai Paeoniae image data is trained and verified, which solves the problem that it is difficult to accurately judge the harvest time of Bobai Paeoniae, and achieves rapid and automated identification, which improves the quality of medicinal materials and the reliability of clinical efficacy.
Patent Information
- Application Number
- CN202510328084.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-17
AI Technical Summary
The existing technology lacks objectified or digitalized rapid characterization methods, which makes it difficult to accurately judge the harvest time of Bobai Paeoniae, affecting the quality of medicinal materials and clinical efficacy.
By obtaining the image data of Bobai peony at different harvesting periods, labeling and dividing it into training sets, verification sets and test sets, the deep learning model is trained and verified, the training parameters of the model are determined, and the identification model is obtained through performance testing, so as to achieve rapid identification of Bobai peony harvesting time.
The rapid and automated identification of the harvest time of Bobai Paeoniae has been achieved, which has improved the identification efficiency, reduced labor costs, and improved the reliability of the quality of medicinal materials.
Smart Images

Figure CN120164036A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the technical field of medicinal material identification, and particularly relates to a method, system, electronic device, and storage medium for identifying Bozhou white peonies based on a deep learning model. Background Art
[0002] The medicinal properties of medicinal materials generally refer to their biological activities and therapeutic effects on the human body, which mainly stem from the active ingredients contained in the medicinal materials. The content and activity of these active ingredients vary at different growth and development stages.
[0003] In order to obtain medicinal materials with the best efficacy, it is necessary to harvest them at the appropriate time. For example, when Bozhou white peonies are harvested in the eighth and ninth lunar months, they have a "sufficient powdery texture" in appearance and relatively high contents of active ingredients such as paeoniflorin, and the quality of Bozhou white peonies is the best. Currently, the harvesting time of Bozhou white peonies by farmers is affected by market prices, resulting in premature or late harvesting. The quality of Bozhou white peony slices is uneven, and their quality is often closely related to clinical efficacy. A "sufficient powdery texture" is the main characteristic of high-quality Bozhou white peonies. Currently, the identification of "sufficient powdery texture" Bozhou white peonies mainly relies on traditional experience judgments by farmers or experts, lacking objective or digital rapid characterization means. Summary of the Invention
[0004] To solve the above problems, the present disclosure provides a method, system, electronic device, and storage medium for identifying Bozhou white peonies based on a deep learning model. This solution obtains image data of medicinal materials harvested at different harvesting times, and trains a deep learning model with a large amount of medicinal material image data labeled with the harvesting time to ensure that the model can learn the subtle feature differences of medicinal materials at different harvesting times and accurately identify the harvesting time of medicinal materials.
[0005] To solve the above technical problems, a first aspect of the present invention proposes a method for identifying Bozhou white peonies based on a deep learning model, and the method includes:
[0006] Obtain multi-group image data of Bozhou white peonies harvested at different harvesting times, and add labels to the image data according to the harvesting time;
[0007] Divide the image data and the corresponding labels into a data training set, a data validation set, and a data test set according to a preset ratio;
[0008] Based on the data training set, perform multiple trainings on a pre-constructed deep learning model, verify each trained deep learning model through the data validation set, and determine the training parameters of the deep learning model based on the verification results;
[0009] Perform performance testing on the deep learning model trained based on the training parameters through the data test set. If the performance testing passes, an identification model is obtained.
[0010] Identify the Bozhou white peonies to be identified through the identification model to obtain the harvesting time of the Bozhou white peonies to be identified.
[0011] According to a preferred embodiment of the present invention, the pre-constructed deep learning model is trained in multiple rounds based on the data training set. During each round of training, the data validation set is input into the deep learning model for verification, and the training parameters of the deep learning model are adjusted based on the verification results, including:
[0012] Set the learning rate, number of training rounds, and training batch size of the parameters in the deep learning model;
[0013] Adjust the learning rate of each parameter based on the Adam algorithm;
[0014] Under different numbers of training rounds and training batch sizes, the pre-constructed deep learning model is trained multiple times based on the data training set;
[0015] Verify the training effect of the deep learning model obtained by each training through the data validation set;
[0016] Determine the optimal number of training rounds and the optimal training batch size through the verification results, and use the adjusted learning rate, optimal number of training rounds, and optimal training batch size as the training parameters.
[0017] According to a preferred embodiment of the present invention, the performance of the deep learning model trained based on the training parameters is tested through the data test set. If the performance test passes, an identification model is obtained, including:
[0018] Input the image data in the data test set into the deep learning model respectively to obtain corresponding predicted label values;
[0019] Calculate the loss function value according to each predicted label value and the label of the corresponding image data;
[0020] Determine the predicted classification result corresponding to the image data according to the predicted label value, and calculate the classification accuracy through the predicted classification result;
[0021] Compare the loss function value and the classification accuracy with a preset performance standard. When the loss function value and the classification accuracy meet the preset performance standard, the performance test passes.
[0022] According to a preferred embodiment of the present invention, after obtaining the image data of multiple groups of Bozhou white peonies harvested at different harvesting periods, the identification method further includes:
[0023] Adjust the size of each of the image data to a preset size;
[0024] Normalize the image pixel values in each of the image data to a preset range;
[0025] For each of the image data, process the image data respectively through a variety of different image processing methods to obtain multiple processed image data corresponding to the image data.
[0026] According to a preferred embodiment of the present invention, the identification method further includes:
[0027] Use the Keras framework to construct a CNN model and a VGG16 model respectively as the deep learning model.
[0028] According to a preferred embodiment of the present invention, the identification method further includes:
[0029] Fix the Bozhou white peony root to a preset area, and photograph the Bozhou white peony root through an image acquisition module with unified shooting parameters to obtain the image data.
[0030] To solve the above technical problems, a second aspect of the present invention proposes a Bozhou white peony root identification system based on a deep learning model, and the identification system includes:
[0031] A data preprocessing module, configured to obtain image data of multiple groups of Bozhou white peony roots harvested at different harvest times, and add labels to the image data according to the harvest time;
[0032] A data division module, configured to divide the image data and the corresponding labels into a data training set, a data validation set, and a data test set according to a preset ratio;
[0033] A model training module, configured to perform multiple trainings on a pre-constructed deep learning model based on the data training set, verify the deep learning model obtained by each training through the data validation set, and determine the training parameters of the deep learning model based on the verification results;
[0034] The model training module is further configured to perform a performance test on the deep learning model trained based on the training parameters through the data test set, and obtain an identification model if the performance test passes;
[0035] A Bozhou white peony root identification module, configured to identify the Bozhou white peony root to be identified through the identification model to obtain the harvest time of the Bozhou white peony root to be identified.
[0036] According to a preferred embodiment of the present invention, the model training module is specifically configured to set the learning rate, the number of training epochs, and the training batch size of the parameters in the deep learning model; adjust the learning rate of each parameter based on the Adam algorithm; perform multiple trainings on the pre-constructed deep learning model based on the data training set under different numbers of training epochs and training batch sizes; verify the training effect of the deep learning model obtained by each training through the data validation set; determine the optimal number of training epochs and the optimal training batch size based on the verification results, and use the adjusted learning rate, the optimal number of training epochs, and the optimal training batch size as the training parameters.
[0037] To solve the above technical problems, a third aspect of the present invention proposes an electronic device, including:
[0038] a processor; and
[0039] a memory storing computer-executable instructions, which when executed by the processor, cause the processor to execute the method described in any one of the above embodiments.
[0040] To solve the above technical problems, a fourth aspect of the present invention proposes a computer storage medium, wherein the computer storage medium stores one or more programs, which when executed by a processor, implement the method described in any one of the above embodiments.
[0041] Compared with the prior art, the present disclosure has the following advantages: The present disclosure obtains the image data of Baishao harvested at different harvest periods, adds corresponding labels to the image data, splits the sample data into multiple data sets, trains a deep learning model with a large number of Baishao image data labeled with the harvest period, determines the training parameters of the deep learning model during the training process, and tests the model performance. The model can learn the subtle feature differences of Baishao at different harvest periods, ensuring the discrimination effect of the deep learning model. Compared with the traditional manual discrimination method, this method can achieve rapid and automatic discrimination of Baishao, greatly improving the discrimination efficiency and reducing the labor cost.
[0042] Other features and advantages of the present disclosure will be described in the following specification, and will be partially obvious from the specification, or understood by implementing the present disclosure. The objectives and other advantages of the present disclosure can be achieved and obtained by the structures pointed out in the specification, the claims, and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0044] Figure 1 Figure 1 shows a schematic flow diagram of a method for identifying Bozhou white peonies based on a deep learning model according to an embodiment of the present disclosure.
[0045] Figure 2 Figure 2 shows a schematic diagram of Bozhou white peony decoction pieces at different harvesting periods from April to December according to an embodiment of the present disclosure.
[0046] Figure 3 Figure 3 shows the image data of Bozhou white peony decoction pieces after preprocessing according to an embodiment of the present disclosure.
[0047] Figure 4 Figure 4 shows the images generated by different image processing methods for the image data of Bozhou white peony decoction pieces according to an embodiment of the present disclosure.
[0048] Figure 5 Figure 5 shows the training process data graph of the CNN model with different training parameters according to an embodiment of the present disclosure.
[0049] Figure 6 Figure 6 shows the training process data graph of the VGG16 model with different training parameters according to an embodiment of the present disclosure.
[0050] Figure 7 Figure 7 shows the training process data graph of the CNN model with different training parameters according to an embodiment of the present disclosure.
[0051] Figure 8 Figure 8 shows the training process data graph of the VGG16 model with different training parameters according to an embodiment of the present disclosure.
[0052] Figure 9 Figure 9 shows the training process data graph of the CNN model with different training parameters according to an embodiment of the present disclosure.
[0053] Figure 10 Figure 10 shows the training process data graph of the VGG16 model with different training parameters according to an embodiment of the present disclosure.
[0054] Figure 11 Figure 11 shows the training process data graph of the CNN model with different training parameters according to an embodiment of the present disclosure.
[0055] Figure 12Shows the training process data graph of the VGG16 model adopting different training parameters according to the embodiments of the present disclosure;
[0056] Figure 13 Shows the training process data graph of the CNN model adopting different training parameters according to the embodiments of the present disclosure;
[0057] Figure 14 Shows the training process data graph of the VGG16 model adopting different training parameters according to the embodiments of the present disclosure;
[0058] Figure 15 Shows the second schematic diagram of the process of the identification method of Bozhou white peony based on a deep learning model according to the embodiments of the present disclosure;
[0059] Figure 16 Shows the schematic diagram of the structure of the identification system of Bozhou white peony based on a deep learning model according to the embodiments of the present disclosure;
[0060] Figure 17 Shows the schematic diagram of the structure of an electronic device according to the embodiments of the present disclosure. Specific embodiments
[0061] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.
[0062] The same reference numerals in the drawings represent the same or similar elements, components or parts. Therefore, the repeated description of the same or similar elements, components or parts may be omitted hereinafter. It should also be understood that although the ordinal adjectives such as first, second, third, etc. may be used herein to describe various devices, elements, components or parts, these devices, elements, components or parts should not be limited by these ordinal adjectives. That is to say, these ordinal adjectives are only used to distinguish one from another. For example, the first device may also be called the second device without departing from the essential technical solution of the present invention. In addition, the terms "and / or", "or / and" mean all combinations including any one or more of the listed items.
[0063] Please refer to Figure 1 , Figure 1 is the first schematic diagram of the process of the identification method of Bozhou white peony based on a deep learning model provided by the present invention. As Figure 1 shown, the monitoring method includes:
[0064] S11. Obtain the image data of multiple groups of Baishao from Bozhou harvested at different harvest times, and add labels to the image data according to the harvest time.
[0065] In this embodiment, there are a wide variety of traditional Chinese medicines with extensive sources, and their medicinal properties are affected by various factors, including growth environment, climate conditions, harvest season, etc. Whether the harvest time is appropriate directly relates to the quality, efficacy of the medicinal materials, and the curative effect of clinical applications. In addition to the Baishao from Bozhou in this solution, this solution can also be applied to medicinal materials such as Astragalus membranaceus and Codonopsis pilosula.
[0066] In this embodiment, the Baishao from Bozhou harvested at different harvest times in this application, such as Figure 2 shown, the types of Baishao include Baishao decoction pieces harvested at different harvest times from April to December, a total of 9 harvest months, and there will be different differences in the size, shape, and color of the Baishao collected in different harvest months.
[0067] In this embodiment, add labels to the image data according to the harvest time. The label can be the harvest time of the medicinal material. Use the classification method of the harvest month of Baishao to mark the categories of Baishao decoction pieces, and make comparisons between Baishao decoction pieces in different harvest months.
[0068] In this embodiment, when the relevant image data is obtained, the size of each image data can be adjusted to a preset size; the image pixel values in each image data are normalized to a preset interval range; for each image data, the image data is processed separately through a variety of different image processing methods to obtain multiple processed image data corresponding to the image data. In this solution, the image processing methods can be rotation, translation, flipping, and cropping.
[0069] In this embodiment, as Figure 3 shown, the following steps are used to preprocess the image to improve the effect of model training. Figure 3 The leftmost one in the middle is the original image data. First, adjust the size, and uniformly adjust the size of all images to images of 224*224 size to obtain Figure 3 the image data in the middle position. Secondly, perform normalization: normalize the image pixel values to the interval [0, 1] to generate Figure 3 the image data on the right.
[0070] Finally, as Figure 4 shown, perform data augmentation again: increase the diversity of the image data through rotation, translation, flipping, and cropping to prevent overfitting in model training. Figure 4From left to right are the original image, the image rotated 45 degrees, the image translated 50 pixels to the right, the horizontally flipped image, and the image cropped within the range of (100, 100, 600, 600). After processing the image data of Baishao of Bozhou through different image processing methods, the number of image data in the subsequent model training process can be greatly increased, ensuring the recognition accuracy of the subsequent model.
[0071] In this embodiment, the Baishao of Bozhou is fixed to a preset area, and the Baishao of Bozhou is photographed by an image acquisition module with unified shooting parameters to obtain image data. Specifically, the fine dust on the surface of the Baishao slices can be swept away with a brush, and the Baishao slices are uniformly fixed in the center of the shooting box. The specific unified shooting parameters are as follows: the distance from the lens to the slices: 35 cm; white balance: 6500K; aperture: F 10; shutter speed: 1 / 200; ISO: 125.
[0072] S12. Divide the image data and the corresponding labels into a data training set, a data validation set, and a data test set according to a preset ratio.
[0073] In this embodiment, the model training mainly includes the division of the data set and the setting of training parameters. According to the types of Baishao of Bozhou, the image data of Baishao slices in different harvesting periods are divided into a training set, a validation set, and a test set according to a preset ratio, and then data augmentation is performed to establish a sample label array.
[0074] In this embodiment, in order to ensure the training effect of the model, the data volume of the training set should be greater than that of the validation set and the test set. Therefore, the preset ratio in this solution can be 8:1:1.
[0075] S13. Based on the data training set, the pre-constructed deep learning model is trained multiple times, and the deep learning model obtained by each training is verified through the data validation set. Based on the verification results, the training parameters of the deep learning model are determined.
[0076] In this embodiment, three experimental parameters, namely the learning rate, the number of training epochs, and the training batch size, are set during the model training process. The initial value of the model learning rate in the experiment is set to 0.0005, and then it is dynamically adjusted and optimized through the Adam optimizer; the learning rate of each parameter is adjusted by calculating the first moment (mean) and the second moment (uncentered variance) of the gradient.
[0077] In this embodiment, for the deep learning model through the data training set, the number of training rounds can be set to four cases: 20, 30, 50, and 70. Of course, more training rounds can also be set to verify the influence of different training rounds on the deep learning model. For the deep learning models obtained by training with different numbers of training rounds, they are verified through the data validation set, and the number of training rounds with the best training effect of the deep learning model is selected as the number of training rounds of this solution. The training effect of the deep learning model can be measured by metrics such as recognition accuracy and ROC curve performance. This solution does not make special limitations on this.
[0078] In this embodiment, the training batch size refers to the number of samples used each time the model parameters are updated and can be selected through historical data. The training batch size selected in this solution can be 64.
[0079] In this embodiment, a CNN model and a VGG16 model can be respectively constructed using the Keras framework as the deep learning model.
[0080] In this embodiment, the CNN model contains an input layer that accepts images with a size of 128x128x3. The first convolutional layer uses 32 3x3 filters and the ReLU activation function, followed by a 2x2 max-pooling layer. The second convolutional layer contains 64 3x3 filters and the ReLU activation function, followed by another 2x2 max-pooling layer. The third convolutional layer has 128 3x3 filters and the ReLU activation function, followed by a 2x2 max-pooling layer. The feature map is converted into a one-dimensional vector through a flattening layer. Next is a fully connected layer that contains 512 neurons and the ReLU activation function. The Dropout layer randomly discards neurons at a rate of 0.5 to prevent overfitting. Finally, the output layer contains 9 neurons and the softmax activation function for classification tasks and outputs the probability of each class.
[0081] In this embodiment, the VGG16 model is a pre-trained deep learning architecture, and the pre-trained VGG16 model on the ImageNet dataset is used for feature extraction. The basic model consists of 13 convolutional layers, 5 pooling layers, and 3 fully connected layers. The flattening layer converts the multi-dimensional feature map into a one-dimensional vector for input into the fully connected layer. The fully connected layer contains 256 neurons and the ReLU activation function for further non-linear combination of the extracted features. The Dropout layer prevents overfitting at a rate of 0.5 and improves the generalization ability of the model by randomly discarding half of the neurons. The output layer contains 9 neurons and the softmax activation function for classification tasks and outputs the probability of each class.
[0082] S14. Use the data test set to perform a performance test on the deep learning model trained based on the training parameters. If the performance test passes, the discrimination model is obtained.
[0083] In this embodiment, the image data in the data test set is input into the deep learning model respectively to obtain the corresponding predicted label values; the loss function value is calculated according to each predicted label value and the label of the corresponding image data; the predicted classification result of the corresponding image data is determined according to the predicted label value, and the classification accuracy is calculated through the predicted classification result; the loss function value and the classification accuracy are compared with the preset performance criteria. When the loss function value and the classification accuracy meet the preset performance criteria, the performance test passes.
[0084] Specifically, in this embodiment, the loss function (categorical crossentropy) and the model accuracy accuracy are used to measure the performance of the model during the training and evaluation processes. The loss function adopted is categorical crossentropy, which is a loss function commonly used in multi-classification problems and measures the difference between the predicted distribution and the true distribution. It is calculated using the formula:
[0085]
[0086] Loss is the loss function value, which is a numerical value used to measure the accuracy of the model prediction. y i represents the true label of the i-th sample, represents the predicted label of the i-th sample;
[0087] For multi-classification problems, the accuracy is calculated using the formula: Accuracy = Number of correctly classified samples / Total number of samples.
[0088] In this embodiment, under different deep learning models, different training parameters will ultimately result in different performances. Specifically, as shown in the following table:
[0089]
[0090]
[0091] Figure 5 ,, Figure 6 ,, Figure 7 ,, Figure 8 ,, Figure 9 ,, Figure 10 ,, Figure 11 ,, Figure 12 ,, Figure 13 and Figure 14Experimental results of the relationship between the number of training epochs and the loss function value and model accuracy value of the CNN model under the learning rate and training batch size.
[0092] S15. Identify the harvested Baishao root to be identified through the identification model, and obtain the harvesting time of the Baishao root to be identified.
[0093] In this embodiment, through the systematic collection, collation, and analysis of the image data of Baishao root, a correlation model between the harvesting time of the medicinal material and the quality of the medicinal material can be established. By identifying the Baishao root to be identified through the identification model and determining its harvesting time accordingly, not only can the accuracy of identification be improved and the harvesting time be optimized, but also the standardized development of the medicinal material industry can be promoted, the sustainability of medicinal material utilization can be enhanced, and the identification cost can be reduced.
[0094] In this embodiment, the present disclosure obtains the image data of Baishao root harvested at different harvesting periods, adds corresponding labels to the image data, splits the sample data into multiple data sets, trains the deep learning model with a large number of image data of Baishao root labeled with the harvesting period, determines the training parameters of the deep learning model during the training process, and tests the model performance. The model can learn the subtle feature differences of Baishao root at different harvesting periods to ensure the identification effect of the deep learning model. Compared with the traditional manual identification method, this method can achieve rapid and automatic identification of Baishao root, greatly improving the identification efficiency and reducing the labor cost.
[0095] In this embodiment, through the systematic collection, collation, and analysis of the image data of Baishao root, a correlation model between the harvesting time of Baishao root and the quality of Baishao root can be established, providing a more scientific decision-making basis for the planting, harvesting, and processing of medicinal materials. This method not only improves the identification accuracy and efficiency of the harvesting time of medicinal materials, but also promotes the standardization and modernization of the Chinese medicinal material industry, providing strong support for the inheritance and innovation of traditional Chinese medicine.
[0096] Please refer to Figure 15 , Figure 15 Figure 2 is the second schematic flowchart of a method for identifying Baishao root based on a deep learning model provided by the present invention. As shown in Figure 15 Figure 2, the method includes the following steps:
[0097] S21. Set the learning rate, number of training epochs, and training batch size of the parameters in the deep learning model.
[0098] In this embodiment, three experimental parameters, namely the learning rate, number of training epochs, and training batch size, are set during the model training process.
[0099] S22. Adjust the learning rate of each parameter based on the Adam algorithm.
[0100] In this embodiment, the initial value of the model learning rate in the experiment is set to 0.0005, and then it is dynamically adjusted and optimized through the Adam optimizer; the learning rate of each parameter is adjusted by calculating the first moment (mean) and the second moment (uncentered variance) of the gradient.
[0101] S23. Based on the data training set, perform multiple trainings on the pre - constructed deep - learning model under different training epochs and training batch sizes.
[0102] In this embodiment, epochs can be set to four cases: 20, 30, 50, and 70 for training; batchsize refers to the number of samples used each time the model parameters are updated.
[0103] S24. Verify the training effect of the deep - learning model obtained from each training through the data validation set.
[0104] S25. Determine the optimal training epochs and the optimal training batch size based on the verification results, and use the adjusted learning rate, the optimal training epochs, and the optimal training batch size as training parameters.
[0105] In this embodiment, the best training effect is finally obtained when epochs = 50, and the selected batch size in this solution is 64.
[0106] Please refer to Figure 16 , Figure 16 This is a Baishao root (Paeonia lactiflora Pall. var. albiflora) identification system based on a deep - learning model provided by the present invention. The identification system includes: a data pre - processing module 11, a data partitioning module 12, a model training module 13, and a Baishao root (Paeonia lactiflora Pall. var. albiflora) identification module 14.
[0107] In this embodiment, the data pre - processing module 11 is used to obtain image data of multiple groups of Baishao root (Paeonia lactiflora Pall. var. albiflora) harvested at different harvest times, and add labels to the image data according to the harvest time.
[0108] In this embodiment, the data partitioning module 12 is used to partition the image data and the corresponding labels into a data training set, a data validation set, and a data test set according to a preset ratio.
[0109] In this embodiment, the model training module 13 is used to perform multiple trainings on the pre - constructed deep - learning model based on the data training set, verify the deep - learning model obtained from each training through the data validation set, and determine the training parameters of the deep - learning model based on the verification results.
[0110] In this embodiment, the model training module 13 is further configured to perform performance testing on the deep learning model trained based on the training parameters through a data test set, and obtain a discrimination model if the performance testing passes.
[0111] In this embodiment, the Baishao root discrimination module 14 is configured to discriminate the to-be-identified Baishao root through the discrimination model, and obtain the harvesting time of the to-be-identified Baishao root.
[0112] In this embodiment, the model training module 13 is specifically configured to set the learning rate, the number of training epochs, and the training batch size of the parameters in the deep learning model; adjust the learning rate of each parameter based on the Adam algorithm; perform multiple trainings on the pre-constructed deep learning model based on the data training set under different numbers of training epochs and training batch sizes; verify the training effect of the deep learning model obtained by each training through a data validation set; determine the optimal number of training epochs and the optimal training batch size through the verification results, and use the adjusted learning rate, the optimal number of training epochs, and the optimal training batch size as training parameters.
[0113] In this embodiment, the model training module 13 is specifically configured to input the image data in the data test set into the deep learning model respectively to obtain corresponding predicted label values; calculate the loss function value according to each predicted label value and the label of the corresponding image data; determine the predicted classification result of the corresponding image data according to the predicted label value, and calculate the classification accuracy through the predicted classification result; compare the loss function value and the classification accuracy with a preset performance standard, and when the loss function value and the classification accuracy meet the preset performance standard, the performance testing passes.
[0114] In this embodiment, the discrimination system further includes an image data processing module, configured to adjust the size of each image data to a preset size; normalize the image pixel values in each image data to a preset interval range; and perform processing on each image data through a variety of different image processing methods respectively to obtain multiple processed image data corresponding to the image data.
[0115] In this embodiment, the discrimination system further includes a model establishment module, configured to respectively construct a CNN model and a VGG16 model using the Keras framework as the deep learning model.
[0116] In this embodiment, the discrimination system further includes an image data acquisition module, configured to photograph the Baishao root fixed in a preset area to obtain image data.
[0117] As Figure 17As shown in the figure, an embodiment of the present invention provides an electronic device, including a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140. Among them, the processor 1110, the communication interface 1120, and the memory 1130 complete communication with each other through the communication bus 1140;
[0118] The memory 1130 is used to store computer programs;
[0119] The processor 1110, when executing the program stored on the memory 1130, implements any of the above methods.
[0120] In the electronic device provided by the embodiment of the present invention, the processor 1110 obtains image data of multiple groups of Bozhou white peonies harvested at different harvest periods by executing the program stored on the memory 1130, and adds labels to the image data according to the harvest period; divides the image data and the corresponding labels into a data training set, a data verification set, and a data test set according to a preset ratio; performs multiple trainings on a pre-constructed deep learning model based on the data training set, verifies the deep learning model obtained by each training through the data verification set, and determines the training parameters of the deep learning model based on the verification results; performs performance testing on the deep learning model trained based on the training parameters through the data test set, and obtains a discrimination model if the performance testing passes; discriminates the Bozhou white peony to be recognized through the discrimination model, and obtains the harvest time of the Bozhou white peony to be recognized.
[0121] The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0122] The communication interface 1120 is used for communication between the above electronic device and other devices.
[0123] The memory 1130 may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory 1130 may also be at least one storage device located far from the aforementioned processor 1110.
[0124] The above-mentioned processor 1110 can be a general-purpose processor 1110, including a central processing unit 1110 (CPU for short), a network processor 1110 (NP for short), etc.; it can also be a digital signal processor 1110 (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0125] An embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors 1110 to implement the method of any of the above embodiments.
[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
[0127] Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for identifying Paeonia lactiflora based on a deep learning model, characterized in that: The identification method comprises: Acquire multiple groups of image data of Paeonia lactiflora harvested at different harvesting periods, and add labels to the image data according to the harvesting periods; Dividing the image data and the corresponding labels into a data training set, a data verification set and a data test set according to a preset ratio; Based on the data training set, the pre-built deep learning model is trained multiple times, the deep learning model obtained by each training is verified by the data verification set, and the training parameters of the deep learning model are determined based on the verification results; Performing a performance test on the deep learning model trained based on the training parameters using the data test set, and obtaining an identification model if the performance test passes; The Radix Paeoniae Alba to be identified is identified by using the identification model to obtain the harvesting time of the Radix Paeoniae Alba to be identified.
2. The method for identifying Radix Paeoniae Alba according to claim 1, characterized in that: The method further comprises: performing multiple rounds of training on the pre-built deep learning model based on the data training set, inputting the data verification set into the deep learning model for verification during each round of training, and adjusting the training parameters of the deep learning model based on the verification result, including: Setting the learning rate, number of training rounds and training batch size of the parameters in the deep learning model; Adjust the learning rate of each parameter based on the Adam algorithm; Training the pre-built deep learning model multiple times based on the data training set under different numbers of training rounds and training batch sizes; Verifying the training effect of the deep learning model obtained from each training by using the data verification set; The optimal number of training rounds and the optimal training batch size are determined according to the verification result, and the adjusted learning rate, optimal number of training rounds and the optimal training batch size are used as the training parameters.
3. The method for identifying Radix Paeoniae Alba according to claim 2, characterized in that: The method of performing a performance test on the deep learning model trained based on the training parameters by using the data test set, and obtaining an identification model if the performance test passes, includes: Input the image data in the data test set into the deep learning model respectively to obtain corresponding predicted label values; A loss function value is calculated based on each of the predicted label values and the label of the corresponding image data; Determine a predicted classification result corresponding to the image data according to the predicted label value, and calculate a classification accuracy rate through the predicted classification result; The loss function value and the classification accuracy are compared with a preset performance standard. When the loss function value and the classification accuracy meet the preset performance standard, the performance test passes.
4. The identification method according to claim 1, characterized in that: After obtaining the image data of multiple groups of Paeonia lactiflora harvested at different harvesting periods, the identification method further comprises: Adjusting the size of each of the image data to a preset size; Normalizing the image pixel values in each of the image data to within a preset range; For each of the image data, the image data is processed respectively by using a plurality of different image processing methods to obtain a plurality of processed image data corresponding to the image data.
5. The identification method according to claim 1, characterized in that: The identification method further comprises: The Keras framework is used to construct a CNN model and a VGG16 model as the deep learning model.
6. The identification method according to claim 1, characterized in that: The identification method further comprises: The white peony root is fixed to a preset area, and the white peony root is photographed by an image acquisition module with unified shooting parameters to obtain the image data.
7. A deep learning model-based identification system for Paeonia lactiflora, characterized in that: The identification system comprises: A data preprocessing module, used to obtain image data of multiple groups of Paeonia lactiflora harvested at different harvesting periods, and add labels to the image data according to the harvesting period; A data division module, used for dividing the image data and the corresponding labels into a data training set, a data verification set and a data test set according to a preset ratio; A model training module, used to train the pre-built deep learning model multiple times based on the data training set, verify the deep learning model obtained by each training through the data verification set, and determine the training parameters of the deep learning model based on the verification results; The model training module is further used to perform a performance test on the deep learning model trained based on the training parameters through the data test set, and the identification model is obtained if the performance test passes; The Bobaishao identification module is used to identify the Bobaishao to be identified by using the identification model to obtain the harvesting time of the Bobaishao to be identified.
8. The identification system for Paeonia lactiflora L. according to claim 7, characterized in that: The model training module is specifically used to set the learning rate, number of training rounds and training batch size of the parameters in the deep learning model; adjust the learning rate of each parameter based on the Adam algorithm; train the pre-built deep learning model multiple times based on the data training set under different numbers of training rounds and training batch sizes; and verify the training effect of the deep learning model obtained from each training through the data verification set; The optimal number of training rounds and the optimal training batch size are determined according to the verification result, and the adjusted learning rate, optimal number of training rounds and the optimal training batch size are used as the training parameters.
9. An electronic device, characterized in that: include: processor; as well as A memory storing computer executable instructions which, when executed, cause the processor to perform the method according to any one of claims 1-6.
10. A computer storage medium, characterized in that: in, The computer storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
A traditional Chinese medicinal material harvesting time identification method based on artificial intelligence
CN109934277A
Product feature information acquisition method and device, electronic equipment and storage medium
CN115601739A
Paeonia lactiflora variety identification method based on Ghost-ELAN module and attention mechanism
CN118334665A
Image feature recognition method and system, electronic equipment and storage medium
CN118736345A