Atractylodes macrocephala detection method based on deep learning and related equipment

Through deep learning-based methods, it automatically recognizes whether Chinese herbal plants contain Atractylodes, which solves the problems of inaccuracy and low efficiency in the prior art, and achieves high accuracy and high efficiency of Atractylodes recognition.

CN110852341BActive Publication Date: 2024-12-13PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910897832.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-23
Publication Date
2024-12-13
Estimated Expiration
2039-09-23

AI Technical Summary

Technical Problem

The prior art has problems of inaccuracy and low work efficiency in aphrodisiac recognition, mainly because feature extraction relies on artificial experience and subjective consciousness, and the quality of image preprocessing has a great impact.

Method used

Using a deep learning method, by obtaining Chinese herbal plants images, comparing their image resolution with preset resolution, determining the target plant image, and importing it into the pre-trained target model for identification, confirming whether Atractylodesia is included, if it contains Then send the recognition result for clearing.

Benefits of technology

Automatic recognition of atractylodesia is realized, the accuracy and work efficiency of recognition are improved, manual intervention is reduced, and the accuracy and efficiency of atractylodesia is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110852341B_ABST
    Figure CN110852341B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and provides a method for detecting Atractylodes macrocephala based on deep learning, and related equipment thereof, wherein the method for detecting Atractylodes macrocephala based on deep learning comprises: obtaining a Chinese herbal medicine plant image to be identified from an image library; comparing the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result; determining a target plant image according to the comparison result; importing the target plant image into a pre-trained target model for identification, and confirming whether the target plant image contains Atractylodes macrocephala; if it contains Atractylodes macrocephala, sending the identification result to a target user for clearing. The technical solution of the present invention realizes automatic identification of Atractylodes macrocephala, avoids manual intervention, and thus improves the accuracy of Atractylodes macrocephala identification and the work efficiency of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a deep learning-based Atractylodes macrocephala detection method and related equipment. Background Art

[0002] Atractylodes is a Chinese herbal medicine with high demand, with an annual output of more than 1,000 tons. The main medicinal part of Atractylodes is the root, but its root is very similar to the root of another plant, Atractylodes macrocephala, and requires experienced people to correctly distinguish it. Since Atractylodes and Atractylodes macrocephala belong to the genus Atractylodes in the Asteraceae family, the appearance of the two plants is similar. If the two can be distinguished during the planting process, the Atractylodes can be retained and the unnecessary Atractylodes macrocephala can be removed, the output of high-purity Atractylodes medicinal materials can be increased.

[0003] At present, the main method for identifying Atractylodes macrocephala is to manually judge or extract the features of Atractylodes macrocephala in advance, encode the features and put the encoded features into a classifier for 2-class classification, train the optimal classification surface, find the features that best represent Atractylodes macrocephala, and remove the features that are irrelevant to the classification and self-correlated. However, the extraction of these features mainly depends on human experience and subjective consciousness. The difference in the extracted features has a great impact on the classification performance. Even the order of the extracted features will affect the final Atractylodes macrocephala recognition performance. At the same time, the quality of image preprocessing will also affect the extracted features. As a result, there is an inaccurate recognition of Atractylodes macrocephala, which further affects the user's work efficiency in identifying Atractylodes macrocephala. Summary of the invention

[0004] The embodiment of the present invention provides a deep learning-based Atractylodes macrocephala detection method and related equipment to solve the problem of being unable to accurately identify Atractylodes macrocephala, which affects user work efficiency.

[0005] A method for detecting Atractylodes macrocephala based on deep learning, comprising:

[0006] Acquire the Chinese herbal medicine plant image to be identified from the image library;

[0007] Comparing the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result;

[0008] Determine the target plant image according to the comparison result;

[0009] Importing the target plant image into a pre-trained target model for recognition, and confirming whether the target plant image contains Atractylodes macrocephala;

[0010] If Atractylodes macrocephala is included, the recognition result is sent to the target user for clearing.

[0011] A deep learning-based atractylodes detection device, comprising:

[0012] The first acquisition module is used to acquire the image of the Chinese herbal medicine plant to be identified from the image library;

[0013] A comparison module, used for comparing the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result;

[0014] A determination module, used to determine a target plant image according to the comparison result;

[0015] A recognition module, used for importing the target plant image into a pre-trained target model for recognition, and confirming whether the target plant image contains Atractylodes macrocephala;

[0016] The sending module is used to send the recognition result to the target user for clearing if Atractylodes macrocephala is included.

[0017] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned deep learning-based Atractylodes macrocephala detection method when executing the computer program.

[0018] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned deep learning-based Atractylodes macrocephala detection method.

[0019] The above-mentioned deep learning-based Atractylodes macrocephala detection method, device, computer equipment and storage medium compare the image resolution of the acquired Chinese herbal medicine plant image with the preset resolution, and determine the target plant image according to the comparison result, and then import the target plant image into the pre-trained target model for recognition, to confirm whether the target plant image contains Atractylodes macrocephala. If it does, the recognition result is sent to the target user for clearing. In this way, automatic recognition of Atractylodes macrocephala is achieved, human intervention is avoided, the accuracy of Atractylodes macrocephala recognition can be effectively improved, and the work efficiency of users in identifying Atractylodes macrocephala is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0021] Figure 1 is a flow chart of a method for detecting Atractylodes macrocephala based on deep learning provided by an embodiment of the present invention;

[0022] Figure 2is a flowchart of step S3 in the Atractylodes macrocephala detection method based on deep learning provided in an embodiment of the present invention;

[0023] Figure 3 is a flowchart of step S32 in the Atractylodes macrocephala detection method based on deep learning provided in an embodiment of the present invention;

[0024] Figure 4 It is a flowchart of training a target model in a method for detecting Atractylodes macrocephala based on deep learning provided in an embodiment of the present invention;

[0025] Figure 5 is a flowchart of step S62 in the Atractylodes macrocephala detection method based on deep learning provided in an embodiment of the present invention;

[0026] Figure 6 It is a flow chart of updating positive and negative samples in the Atractylodes macrocephala detection method based on deep learning provided by an embodiment of the present invention;

[0027] Figure 7 It is a flowchart of training a convolutional neural network model in the Atractylodes macrocephala detection method based on deep learning provided in an embodiment of the present invention;

[0028] Figure 8 is a schematic diagram of a deep learning-based Atractylodes macrocephala detection device provided in an embodiment of the present invention;

[0029] Fig. 9 It is a basic structural block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The deep learning-based Atractylodes macrocephala detection method provided in this application is applied to the server side, which can be implemented by an independent server or a server cluster composed of multiple servers. Figure 1 As shown, a method for detecting Atractylodes macrocephala based on deep learning is provided, comprising the following steps:

[0032] S1: Obtain the Chinese herbal medicine plant image to be identified from the image library.

[0033] In the embodiment of the present invention, the Chinese herbal medicine plant image to be identified refers to the Chinese herbal medicine plant image that needs to be identified whether it contains Atractylodes macrocephala; by detecting the image library, when it is detected that the Chinese herbal medicine plant image exists in the image library, the Chinese herbal medicine plant image is directly acquired. The image library refers to a database specifically used to store Chinese herbal medicine plant images.

[0034] It should be noted that when a Chinese herbal medicine plant image is acquired from the image library, the Chinese herbal medicine plant image is deleted from the image library to avoid repeated acquisition of the Chinese herbal medicine plant image.

[0035] S2: Compare the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result.

[0036] In the embodiment of the present invention, according to the Chinese herbal medicine plant image obtained in step S1, the image resolution of the Chinese herbal medicine plant image is compared with the preset resolution to obtain a comparison result. The preset resolution may be 800*800, or may be set according to the actual needs of the user, which is not limited here. Preferably, the embodiment of the present invention adopts a preset resolution of 800*800.

[0037] It should be noted that the 800*800 resolution used in the embodiment of the present invention is the model input size set by the user after comprehensively considering the recognition accuracy, recognition speed and server hardware configuration. That is, images with other resolutions need to be scaled to this size before recognition.

[0038] Furthermore, there are three comparison results, namely, the image resolution is greater than the preset resolution, the image resolution is equal to the preset resolution, and the image resolution is less than the preset resolution.

[0039] S3: Determine the target plant image according to the comparison result.

[0040] Specifically, according to the comparison result obtained in step S2, the Chinese herbal medicine plant image is determined as the target plant image according to the preset conditions. The preset conditions may specifically determine the Chinese herbal medicine plant image with an image resolution equal to the preset resolution as the target plant image, or may be set according to the actual needs of the user, which is not limited here.

[0041] S4: Import the target plant image into the pre-trained target model for recognition to confirm whether the target plant image contains Atractylodes macrocephala.

[0042] In an embodiment of the present invention, the pre-trained target model is mainly used to identify whether the target plant image contains Atractylodes macrocephala. The target plant image obtained in step S3 is imported into the pre-trained target model for identification. After receiving the target plant image, the target model will perform Atractylodes macrocephala detection on the target plant image and output the identification result, thereby confirming whether the target plant image contains Atractylodes macrocephala based on the identification result.

[0043] S5: If Atractylodes macrocephala is included, the recognition result is sent to the target user for clearing.

[0044] Specifically, according to the recognition method of step S4, when the recognition result is that the target plant image contains Atractylodes macrocephala, the recognition result is sent to the target user according to a preset method, prompting the user to remove the Atractylodes macrocephala from the Chinese herbal medicine plant where the target plant image is located.

[0045] It should be noted that Atractylodes macrocephala is a common herb, while Atractylodes lancea, which belongs to the same genus Atractylodes in the Asteraceae family as Atractylodes macrocephala, is a high-demand Chinese herbal medicine variety. Due to the similarities in the appearance of the two plants, in order to retain Atractylodes lancea and remove unnecessary Atractylodes macrocephala during the planting process, the yield of high-purity Atractylodes lancea can be increased. Therefore, the identified Atractylodes macrocephala needs to be removed during the planting process.

[0046] In this embodiment, the image resolution of the acquired Chinese herbal medicine plant image is compared with the preset resolution, and the target plant image is determined according to the comparison result. Then, the target plant image is imported into the pre-trained target model for recognition to confirm whether the target plant image contains Atractylodes macrocephala. If it does, the recognition result is sent to the target user for clearing. In this way, automatic recognition of Atractylodes macrocephala is achieved, manual intervention is avoided, the accuracy of Atractylodes macrocephala recognition can be effectively improved, and the work efficiency of the user in identifying Atractylodes macrocephala is further improved.

[0047] In one embodiment, if Figure 2 As shown, step S3, i.e. determining the target plant image according to the comparison result, includes the following steps:

[0048] S31: If the comparison result is that the image resolution is the same as the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is determined as the target plant image.

[0049] In an embodiment of the present invention, according to step S2, the image resolution of the Chinese herbal plant image is compared with the preset resolution. If the comparison result is that the image resolution is the same as the preset resolution, it means that the resolution of the Chinese herbal plant image meets the standard required by the user, and the Chinese herbal plant image is determined as the target plant image.

[0050] For example, the preset resolution is 800*800, there is a Chinese herbal plant image A, and the image resolution corresponding to the Chinese herbal plant image A is 800*800. The image resolution is compared with the preset resolution. Since both are 800*800, the Chinese herbal plant image A is determined as the target plant image.

[0051] S32: If the comparison result is that the image resolution is different from the preset resolution, scaling the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image.

[0052] Specifically, according to step S2, the image resolution of the Chinese herbal plant image is compared with the preset resolution. If the comparison result is that the image resolution is different from the preset resolution, it means that the resolution of the Chinese herbal plant image does not meet the standard required by the user. The Chinese herbal plant image is imported into the preset zoom port for zoom processing, and the Chinese herbal plant image after zoom processing is determined as the target plant image.

[0053] The preset zoom port refers to a processing port used for zooming the image of the Chinese herbal medicine plant.

[0054] In this embodiment, when the image resolution is the same as the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is determined as the target plant image, and when the image resolution is different from the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is scaled, and the scaled Chinese herbal medicine plant image is determined as the target plant image. Thus, the target plant image can be accurately acquired, and by comparing the image resolution with the preset resolution, the image resolution of the target plant image can be guaranteed to be the optimal resolution, thereby improving the accuracy of subsequent Atractylodes macrocephala recognition using the target plant image.

[0055] In one embodiment, if Figure 3 As shown, in step S32, if the comparison result is that the image resolution is different from the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is scaled to obtain the target plant image, including the following steps:

[0056] S321: If the comparison result is that the image resolution is greater than the preset resolution, downsampling the Chinese herbal medicine plant image corresponding to the image resolution is performed to obtain a target plant image.

[0057] In the embodiment of the present invention, downsampling processing refers to setting a downsampling coefficient k for an N*M image, and taking a pixel point every k pixels in each row and column of the N*M image to form a new image.

[0058] Specifically, according to the comparison method of step S2, the image resolution of the Chinese herbal plant image is compared with the preset resolution. If the comparison result is that the image resolution is greater than the preset resolution, the Chinese herbal plant image corresponding to the image resolution is imported into the preset downsampling library, and the Chinese herbal plant image is downsampled according to the preset downsampling coefficient. The Chinese herbal plant image after the downsampling is used as the target plant image, and the image resolution of the target plant image is the same as the preset resolution.

[0059] The preset downsampling database refers to a database specifically used for downsampling Chinese herbal medicine plant images. The preset downsampling coefficient refers to a constant set according to the preset resolution, and the value range of the constant is 0-9.

[0060] If 10 downsampling levels are pre-set for the Chinese herbal plant image, that is, the downsampling coefficients are set to 0 to 9, when the downsampling coefficient is 0, it means that the Chinese herbal plant image is not downsampled, and when the downsampling coefficient is 9, it means that the Chinese herbal plant image is downsampled to the maximum extent.

[0061] It should be noted that the larger the downsampling coefficient k is, the larger the corresponding downsampling rate is and the smaller the image resolution is.

[0062] For example, if the downsampling coefficient is set to 1, when the Chinese herbal plant image is downsampled, for each row and column of pixels in the Chinese herbal plant image, one pixel is taken out as the target pixel every other pixel, and finally a thumbnail image corresponding to the Chinese herbal plant image is formed based on each target pixel. This thumbnail image is the target plant image.

[0063] S322: If the comparison result is that the image resolution is less than or equal to the preset resolution, upsampling the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image.

[0064] In the embodiment of the present invention, upsampling processing refers to setting an upsampling coefficient k for an N*M image, copying each pixel in the N*M image k times in the horizontal and vertical directions to form a new image with a resolution of kN*kM.

[0065] Specifically, according to the comparison method of comparing the image resolution of the Chinese herbal plant image with the preset resolution in step S2, if the comparison result is that the image resolution is less than or equal to the preset resolution, the Chinese herbal plant image corresponding to the image resolution is imported into the preset upsampling library, and the Chinese herbal plant image is upsampled according to the preset upsampling coefficient, and the upsampled Chinese herbal plant image is used as the target plant image, and the image resolution of the target plant image is the same as the preset resolution.

[0066] The preset sampling library refers to a database specifically used for upsampling Chinese herbal medicine plant images. The preset upsampling coefficient refers to a constant set according to a preset resolution, and the value range of the constant is 0-9.

[0067] If 10 upsampling levels are pre-set for the Chinese herbal plant image, that is, the upsampling coefficients are set to 0 to 9, where when the upsampling coefficient is 1, it means that the Chinese herbal plant image is not upsampled, and when the upsampling coefficient is 9, it means that the Chinese herbal plant image is upsampled to the maximum extent.

[0068] It should be noted that the larger the upsampling coefficient k is, the larger the corresponding upsampling rate is, and the higher the resolution of the Chinese herbal medicine plant image is.

[0069] For example, if the downsampling coefficient is set to k, when the Chinese herbal medicine plant image is downsampled, the pixels in each row and column of the Chinese herbal medicine plant image are copied k times in the horizontal and vertical directions, and finally the size of the original image is enlarged by k times. The enlarged image is the target plant image.

[0070] In this embodiment, when the image resolution is greater than the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is downsampled to obtain the target plant image, and when the image resolution is less than or equal to the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is upsampled to obtain the target plant image. Thus, the image resolution corresponding to the Chinese herbal medicine plant image is adjusted to ensure that the image resolution of the target plant image obtained from the Chinese herbal medicine plant image is the optimal resolution, thereby improving the accuracy of subsequent Atractylodes macrocephala recognition using the target plant image.

[0071] In one example, Figure 4 As shown, after step S3 and before step S4, the deep learning-based Atractylodes macrocephala detection method further includes the following steps:

[0072] S61: Acquire image samples from a preset database, wherein the image samples include image samples containing a Baishu bounding box.

[0073] In an embodiment of the present invention, the image sample refers to sample data specifically used to train a convolutional neural network model to obtain a target model. The image sample mainly includes images of Chinese herbal medicine plants, and some image samples contain a bounding box of Atractylodes macrocephala.

[0074] Specifically, the image samples are directly obtained from a preset database, wherein the preset database refers to a database specifically used to store image samples.

[0075] S62: Filter the image samples according to the white atractylodes bounding box to obtain positive and negative samples.

[0076] Specifically, image samples are divided into positive samples and negative samples according to the Baizhu bounding box. If it is detected that the image sample contains the Baizhu bounding box, the image sample is identified as a positive sample. If it is detected that the image sample does not contain the Baizhu bounding box, the image sample is identified as a negative sample. Finally, the positive samples and negative samples are summarized to obtain positive and negative samples.

[0077] S63: Import the positive and negative samples into the convolutional neural network model for training to obtain the target model.

[0078] Specifically, the positive and negative samples obtained in step S62 are imported into the convolutional neural network model for training, and the model that meets the user's set requirements after training is determined as the target model.

[0079] In this embodiment, the acquired image samples are screened according to the Atractylodes macrocephala boundary box to obtain positive and negative samples, and the model is trained according to the positive and negative samples to obtain the target model, thereby achieving accurate training of the target model and ensuring the accuracy of subsequent Atractylodes macrocephala recognition using the target model.

[0080] In one embodiment, if Figure 5 As shown, in step S62, the steps of screening the image samples according to the white atractylodes bounding box to obtain positive and negative samples include:

[0081] S621: Detecting the white atractylodes bounding box in the image sample, if the white atractylodes bounding box exists in the image sample, determining the image sample as a positive sample.

[0082] In the embodiment of the present invention, by scanning the image sample, when a Baishu boundary box is found in the scanned image sample, it means that the image sample contains Baishu, and the image sample is determined as a positive sample.

[0083] S622: If the white acupoint bounding box does not exist in the image sample, the image sample is determined as a negative sample.

[0084] In the embodiment of the present invention, by scanning the image sample, when it is found that there is no Atractylodes macrocephala boundary box in the scanned image sample, it means that the image sample does not contain Atractylodes macrocephala, and the image sample is determined as a negative sample.

[0085] S623: Configure the number of positive samples and negative samples according to a preset ratio to obtain positive and negative samples.

[0086] In the embodiment of the present invention, the preset ratio refers to the ratio of the number of positive samples to the number of negative samples that are initially preset. Preferably, the preset ratio in this embodiment is 1:1 to avoid overfitting due to the different numbers of training samples corresponding to positive and negative samples. Overfitting refers to the phenomenon that the hypothesis becomes overly strict in order to obtain a consistent hypothesis. Avoiding overfitting is a core task in classifier design.

[0087] Specifically, positive samples and negative samples are selected and mixed according to a preset ratio to obtain positive and negative samples. For example, the positive and negative samples are mixed according to a preset ratio of 1:1, and the obtained positive and negative samples include half positive samples and half negative samples to avoid overfitting.

[0088] In this embodiment, by detecting the white atractylodes bounding box in the image sample, the image sample with the white atractylodes bounding box is determined as a positive sample, and the image sample without the white atractylodes bounding box is determined as a negative sample, and the number of positive samples and negative samples is configured according to a preset ratio to obtain positive and negative samples. Thereby, accurate acquisition of positive and negative samples is achieved, and configuring positive and negative samples according to a preset ratio can avoid overfitting, and further ensure the accuracy of subsequent training of the model using positive and negative samples.

[0089] In one embodiment, if Figure 6 As shown, after step S62 and before step S63, the deep learning-based Atractylodes macrocephala detection method further includes the following steps:

[0090] S71: For each positive sample and negative sample in the positive and negative samples, traverse each pixel point in the positive sample and the negative sample, and obtain the pixel value of each pixel point.

[0091] In the embodiment of the present invention, for each positive sample and negative sample in the positive and negative samples, the pixel points in the positive sample and the negative sample are traversed according to a preset traversal method to obtain the pixel value of each pixel point in the positive sample and the negative sample.

[0092] Among them, the preset traversal method can specifically be to take the upper left corner pixel point of the positive sample and the negative sample as the starting point, and traverse row by row from top to bottom and from left to right, or to traverse from the midline position of the positive sample and the negative sample to both sides at the same time, or other traversal methods, which are not limited here.

[0093] S72: Normalize the pixel values ​​to obtain updated positive and negative samples.

[0094] In the embodiment of the present invention, normalization processing refers to transforming the pixel value of each pixel in the positive sample and the negative sample to between [-1, 1]. According to formula (1), the pixel value of each pixel in the positive sample and the negative sample is normalized, and the normalized positive sample and negative sample are used to form a positive and negative sample mother, that is, the updated positive and negative samples are obtained.

[0095] (x-127.5) / 127.5=z Formula (1)

[0096] Among them, x is the pixel value of the pixel, and z is the pixel value after normalization.

[0097] It should be noted that due to the requirements of the subsequent model training computing framework, the pixel values ​​of the pixels need to be transformed to [-1, 1], which is a numerical transformation. The final detection result is displayed on the original image and is not affected by the [-1, 1] transformation. By normalizing the pixel values ​​of each pixel in the positive and negative samples and transforming them to [-1, 1], the data distribution is more uniform, thereby accelerating the subsequent model training process.

[0098] In this embodiment, by obtaining the pixel value of each pixel in the positive sample and the negative sample, and then normalizing the pixel value to obtain updated positive and negative samples, the data distribution can be made more uniform, thereby accelerating the subsequent process of model training using positive and negative samples.

[0099] In one embodiment, if Figure 7 As shown, in S63, the steps of importing positive and negative samples into the convolutional neural network model for training, and obtaining the target model include:

[0100] S631: Initialize the convolutional neural network model to obtain an initial model.

[0101] In an embodiment of the present invention, the model parameters of the convolutional neural network model are initialized by the server, and an initial parameter is assigned to the weight and bias of each network layer in the convolutional neural network model, so that the convolutional neural network model can extract and calculate features of positive and negative samples according to the initial parameters, wherein the weight and bias are model parameters for calculating the refraction transformation of the input data in the network, so that the result output by the network after calculation can be consistent with the actual situation.

[0102] It can be understood that, taking the example of people receiving information, after receiving the information, after judgment and transmission by the neurons in the human brain, people will get a certain result or cognition, that is, the process of obtaining cognition from information, and the training process of the convolutional neural network model is to optimize the weights and biases of the neuron connections in the network, so that the recognition results of the trained convolutional neural network model for the data to be recognized can achieve a recognition effect consistent with the actual situation.

[0103] Optionally, the server can arbitrarily obtain a weight in the range of [-0.30, +0.30] as an initial parameter, and set the initial parameter in a smaller range with a mean of 0, which can increase the convergence speed of the model and thus improve the efficiency of building the model.

[0104] S632: Import the positive and negative samples into the initial model and calculate the forward output of the initial model.

[0105] Specifically, the positive and negative samples are sequentially imported as input data into the input layer, convolution layer, pooling layer, fully connected layer and output layer of the initial model for convolution operation, and finally the output result of the output layer is used as the forward output. Among them, the input layer, convolution layer, pooling layer, fully connected layer and output layer all have pre-set convolution kernels. By importing positive and negative samples as input data into each layer, convolution operation can be performed according to the pre-set convolution kernel to obtain the corresponding output result.

[0106] S633: Based on the forward output, calculate the prediction error between the forward output and the preset target value.

[0107] In the embodiment of the present invention, according to the forward output obtained in step S632 and the preset target value, the prediction error between the forward output and the preset target value is calculated according to formula (2):

[0108] Loss = K - Ki Formula (2)

[0109] Among them, Loss is the prediction error, K is the preset target value, and Ki is the forward output.

[0110] S634: According to the prediction error, the initial parameters of each network layer in the initial model are adjusted using the error back propagation algorithm to obtain the target model.

[0111] In the embodiment of the present invention, the error back propagation algorithm is used to apportion the prediction error to all units of each network layer, so as to obtain the error signal of all units of each network layer, and then adjust the initial parameters of each network layer. The initial parameter is just a parameter preset for the convenience of the operation of the initial model, so that there must be an error between the forward output obtained according to the positive and negative samples and the preset target value. This error information needs to be passed back to each layer of the network structure in the initial model layer by layer, so that each layer of the network structure can adjust the preset initial parameters to obtain a target model with better recognition effect.

[0112] Specifically, according to the prediction error, the error back propagation algorithm is used to adjust the initial parameters of each network layer of the initial model, and the error back propagation algorithm is used to update each network layer of the initial model according to the output of each layer to obtain the weights and biases of each network layer after the update. The weights and biases of each network layer after the update are used to predict the positive and negative samples, and the forward outputs of the positive and negative samples are compared with the preset target values. The positive and negative samples whose prediction errors are less than the preset threshold are obtained as the number of accurate prediction samples. The total number of positive and negative samples is counted to obtain the total number of positive and negative samples, and the total error of the initial model is calculated according to formula (3):

[0113]

[0114] Among them, W is the total error, M is the number of accurate predicted samples, and N is the total number of positive and negative samples;

[0115] If the total error of the current model is greater than the preset accuracy threshold, the currently adjusted model will be used as the target model, where the preset accuracy threshold is used to indicate the prediction accuracy of the initial model for positive and negative samples. The specific accuracy threshold can be set according to actual needs and is not restricted here.

[0116] It should be noted that if the total error of the current model is less than the preset accuracy threshold, the process returns to step S743 and continues to execute until the total error of the model is greater than the preset accuracy threshold, and the current model is used as the target model.

[0117] In this embodiment, the convolutional neural network model is initialized to obtain an initial model, the forward output of the initial model is calculated according to the positive and negative samples, and the prediction error between the forward output and the preset target value is calculated. Finally, according to the preset error, the error back propagation algorithm is used to adjust the initial model to obtain the target model, thereby realizing the training and tuning of the initial model and improving the recognition accuracy of the target model for positive and negative samples.

[0118] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0119] In one embodiment, a deep learning-based Atractylodes macrocephala detection device is provided, and the deep learning-based Atractylodes macrocephala detection device corresponds one-to-one to the deep learning-based Atractylodes macrocephala detection method in the above-mentioned embodiment. Figure 8 As shown, the deep learning-based atractylodes detection device includes a first acquisition module 81, a comparison module 82, a determination module 83, an identification module 84 and a sending module 85. The functional modules are described in detail as follows:

[0120] The first acquisition module 81 is used to acquire the image of the Chinese herbal medicine plant to be identified from the image library;

[0121] A comparison module 82, used to compare the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result;

[0122] A determination module 83, used to determine the target plant image according to the comparison result;

[0123] The recognition module 84 is used to import the target plant image into the pre-trained target model for recognition, and confirm whether the target plant image contains Atractylodes macrocephala;

[0124] The sending module 85 is used to send the recognition result to the target user for clearing if Atractylodes macrocephala is included.

[0125] Further, the determination module 83 includes:

[0126] A comparison same submodule is used to determine the Chinese herbal medicine plant image corresponding to the image resolution as the target plant image if the comparison result shows that the image resolution is the same as the preset resolution;

[0127] Comparing different submodules, if the comparison result is that the image resolution is different from the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is scaled to obtain the target plant image.

[0128] Furthermore, the comparison of different submodules includes:

[0129] A downsampling unit, for downsampling the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image if the comparison result shows that the image resolution is greater than the preset resolution;

[0130] The upsampling unit is used to upsample the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image if the comparison result shows that the image resolution is less than or equal to the preset resolution.

[0131] Furthermore, the deep learning-based Atractylodes macrocephala detection device also includes:

[0132] The second acquisition module is used to acquire image samples from a preset database, wherein the image samples include image samples containing a Baishu bounding box;

[0133] A screening module is used to screen image samples according to the white atractylodes bounding box to obtain positive and negative samples;

[0134] The training module is used to import positive and negative samples into the convolutional neural network model for training to obtain the target model.

[0135] Furthermore, the screening module includes:

[0136] A positive sample determination submodule is used to detect the white atractylodes bounding box in the image sample, and if the white atractylodes bounding box exists in the image sample, the image sample is determined as a positive sample;

[0137] A negative sample determination submodule, used for determining the image sample as a negative sample if the white atractylodes bounding box does not exist in the image sample;

[0138] The configuration submodule is used to configure the number of positive samples and negative samples according to a preset ratio to obtain positive and negative samples.

[0139] Furthermore, the deep learning-based Atractylodes macrocephala detection device also includes:

[0140] A third acquisition module is used to traverse each pixel point in the positive sample and the negative sample for each positive sample and the negative sample, and obtain the pixel value of each pixel point;

[0141] The updating module is used to normalize the pixel values ​​to obtain updated positive and negative samples.

[0142] Furthermore, the training module includes:

[0143] The initialization submodule is used to initialize the convolutional neural network model and obtain the initial model;

[0144] The import submodule is used to import positive and negative samples into the initial model and calculate the forward output of the initial model;

[0145] A prediction error calculation submodule is used to calculate the prediction error between the forward output and the preset target value according to the forward output;

[0146] The target model determination submodule is used to adjust the initial parameters of each network layer in the initial model according to the prediction error using the error back propagation algorithm to obtain the target model.

[0147] Some embodiments of the present application disclose computer devices. Fig. 9 , which is a basic structural block diagram of a computer device 90 in one embodiment of the present application.

[0148] like Fig. 9 As shown in FIG. 1 , the computer device 90 includes a memory 91, a processor 92, and a network interface 93 that are interconnected and communicated via a system bus. It should be noted that Fig. 9 Only a computer device 90 having components 91-93 is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0149] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0150] The memory 91 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 91 can be an internal storage unit of the computer device 90, such as a hard disk or memory of the computer device 90. In other embodiments, the memory 91 can also be an external storage device of the computer device 90, such as a plug-in hard disk equipped on the computer device 90, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 91 can also include both the internal storage unit of the computer device 90 and its external storage device. In this embodiment, the memory 91 is generally used to store the operating system and various application software installed on the computer device 90, such as the program code of the white atractylodes detection method based on deep learning, etc. In addition, the memory 91 can also be used to temporarily store various types of data that have been output or are to be output.

[0151] The processor 92 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 92 is generally used to control the overall operation of the computer device 90. In this embodiment, the processor 92 is used to run the program code stored in the memory 91 or process data, such as running the program code of the deep learning-based Atractylodes macrocephala detection method.

[0152] The network interface 93 may include a wireless network interface or a wired network interface. The network interface 93 is generally used to establish a communication connection between the computer device 90 and other electronic devices.

[0153] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores a Baishu information entry program, and the Baishu information entry program can be executed by at least one processor to enable the at least one processor to perform any step of the above-mentioned Baishu detection method based on deep learning.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a computer device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0155] Finally, it should be noted that the embodiments described above are obviously only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. A method for detecting Atractylodes macrocephala based on deep learning, characterized in that: The deep learning-based Atractylodes macrocephala detection method comprises: Acquire the Chinese herbal medicine plant image to be identified from the image library; Comparing the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result; Determine the target plant image according to the comparison result; Importing the target plant image into a pre-trained target model for recognition, and confirming whether the target plant image contains Atractylodes macrocephala; If Atractylodes macrocephala is included, the recognition result will be sent to the target user for clearing; The step of determining the target plant image according to the comparison result comprises: If the comparison result is that the image resolution is the same as the preset resolution, the Chinese herbal medicine plant image corresponding to the image resolution is determined as the target plant image; If the comparison result is that the image resolution is different from the preset resolution, scaling the Chinese herbal medicine plant image corresponding to the image resolution to obtain the target plant image; If the comparison result is that the image resolution is different from the preset resolution, the step of scaling the Chinese herbal medicine plant image corresponding to the image resolution to obtain the target plant image includes: If the comparison result is that the image resolution is greater than the preset resolution, downsampling the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image; If the comparison result is that the image resolution is less than or equal to the preset resolution, upsampling the Chinese herbal medicine plant image corresponding to the image resolution to obtain a target plant image; The downsampling process comprises: Determining a preset downsampling coefficient according to the preset resolution; Extracting the pixel points of each row and column in the Chinese herbal medicine plant image according to the preset downsampling coefficient to obtain the target pixel points; Combining all target pixel points in the Chinese herbal medicine plant image to obtain the target plant image; The upsampling process comprises: Determining a preset upsampling factor according to the preset resolution; For each row and column of pixels in the Chinese herbal medicine plant image, horizontally and vertically copying according to the preset upsampling coefficient to obtain the target plant image; Wherein, after the step of determining the target plant image according to the comparison result, and before the step of importing the target plant image into a pre-trained target model for identification and confirming whether the target plant image contains Atractylodes macrocephala, the Atractylodes macrocephala detection method based on deep learning further includes: Acquire image samples from a preset database, wherein the image samples include image samples containing a Baishu bounding box; The image samples are screened according to the white atractylodes bounding box to obtain positive and negative samples; Importing the positive and negative samples into a convolutional neural network model for training to obtain the target model; The step of screening the image samples according to the white atractylodes bounding box to obtain positive and negative samples includes: By detecting the white atractylodes bounding box in the image sample, if the white atractylodes bounding box exists in the image sample, determining the image sample as a positive sample; If the white atractylodes bounding box does not exist in the image sample, the image sample is determined as a negative sample; The number of the positive samples and the negative samples is configured according to a preset ratio to obtain the positive and negative samples; Among them, positive samples and negative samples are selected and mixed according to a preset ratio of 1:1 to obtain positive and negative samples.

2. The deep learning-based Atractylodes macrocephala detection method according to claim 1, characterized in that: After the step of screening the image samples according to the Atractylodes macrocephala bounding box to obtain positive and negative samples, and before the step of importing the positive and negative samples into a convolutional neural network model for training to obtain the target model, the Atractylodes macrocephala detection method based on deep learning includes: For each of the positive samples and the negative samples in the positive and negative samples, traverse each pixel point in the positive sample and the negative sample, and obtain a pixel value of each pixel point; The pixel values ​​are normalized to obtain updated positive and negative samples.

3. The deep learning-based Atractylodes macrocephala detection method according to claim 1, characterized in that: The step of importing the positive and negative samples into a convolutional neural network model for training to obtain the target model comprises: Initializing the convolutional neural network model to obtain an initial model; Importing the positive and negative samples into the initial model, and calculating the forward output of the initial model; According to the forward output, calculating a prediction error between the forward output and a preset target value; According to the prediction error, an error back propagation algorithm is used to adjust the initial parameters of each network layer in the initial model to obtain the target model.

4. A deep learning-based Atractylodes macrocephala detection device, characterized in that: The deep learning-based Atractylodes macrocephala detection device implements the steps of the deep learning-based Atractylodes macrocephala detection method according to any one of claims 1 to 3 when executed, and the deep learning-based Atractylodes macrocephala detection device includes: The first acquisition module is used to acquire the image of the Chinese herbal medicine plant to be identified from the image library; A comparison module, used for comparing the image resolution of the Chinese herbal medicine plant image with a preset resolution to obtain a comparison result; A determination module, used to determine a target plant image according to the comparison result; A recognition module, used for importing the target plant image into a pre-trained target model for recognition, and confirming whether the target plant image contains Atractylodes macrocephala; The sending module is used to send the recognition result to the target user for clearing if it contains Atractylodes macrocephala.

5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the Atractylodes macrocephala detection method based on deep learning as described in any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the Atractylodes macrocephala detection method based on deep learning as described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Identification method and device for plant species, storage medium and computer equipment

    CN110059715A

  • Identification method and device for plant species, storage medium and computer equipment

    CN110070101A