Cordyceps sinensis authenticity identification method and system based on convolutional neural network
The feature images of Cordyceps sinensis are extracted through convolutional neural networks, combining insect body and sub-posterior features, and the problem of high-end equipment dependence is solved, achieving high-precision and low-cost Cordyceps sinensis authenticity and false recognition.
Patent Information
- Application Number
- CN202510326339.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-03-19
AI Technical Summary
In the prior art, the authenticity identification method of Cordyceps sinensis relies on high-end instruments and equipment and precision analysis technology, which leads to high cost of use and difficult to popularize application.
The method based on the convolutional neural network is adopted to capture Cordyceps population photos, obtain feature images, divide the training set and test sets, and use the convolutional neural network to extract significant features, combining the shape, texture and color characteristics of the insect body and sub-posterior to determine the authenticity of Cordyceps sinensis.
It realizes high-precision Cordyceps sinensis identification, weakens the impact of background changes, is suitable for the distinction between different categories of Cordyceps sinensis, reduces the identification cost, and improves the convenience of identifying Chinese medicinal materials.
Smart Images

Figure CN120356195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of identification of traditional Chinese medicines, and particularly to a method and system for identifying the authenticity of Cordyceps sinensis based on a convolutional neural network. Background Art
[0002] Cordyceps sinensis is a traditional nourishing Chinese medicine in China. In recent years, due to human factors, environmental factors, etc., Cordyceps sinensis resources are very rare, resulting in a continuous increase in price and becoming a precious medicinal material. Adverse reactions such as dizziness, nausea, and vomiting will occur after misselection and misuse, so it is more necessary to conduct identification research on Cordyceps sinensis.
[0003] With the development of technology, in the process of identifying Cordyceps sinensis, in addition to the commonly used traditional identification techniques, modern identification techniques have also been gradually applied, including gas chromatography-mass spectrometry, duplex PCR identification technique, hyperspectral imaging technique, DNA barcoding technique, electrochemical gene sensor technique, Fourier transform infrared spectroscopy technique, etc., which provide important technical support for the identification of Cordyceps sinensis. However, the implementation of the above methods all requires high-end instrument equipment and precise analysis techniques, with high usage costs and difficult to popularize and apply.
[0004] Therefore, how to provide a method for identifying the authenticity of Cordyceps sinensis, which can distinguish different categories of cordyceps and accurately identify Cordyceps sinensis, is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] For this reason, the present invention provides a method for identifying the authenticity of Cordyceps sinensis based on a convolutional neural network to solve the problems of high usage costs and difficult to popularize and apply in the prior art due to the reliance on high-end instrument equipment and precise analysis techniques for identification.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] According to the first aspect of the present invention, there is provided a method for identifying the authenticity of Cordyceps sinensis based on a convolutional neural network, including the following steps:
[0008] Step S1: Take a photo of a cordyceps population containing Cordyceps sinensis to obtain a characteristic image of the cordyceps population containing Cordyceps sinensis;
[0009] Step S2: Divide the obtained characteristic image dataset into a training set and a test set, and input the training set into the convolutional neural network for training;
[0010] Step S3: Input the test set into the trained convolutional neural network, and extract the significant features in the cordyceps feature map;
[0011] Step S4: Based on the significant features of different types in the test set, classify the types of cordyceps and determine the Ophiocordyceps sinensis in the cordyceps population.
[0012] Further, in the step S2, inputting the training set into the convolutional neural network for training specifically includes:
[0013] Step S201: The convolutional neural network extracts multiple original local feature maps of the training set image data, performs dilated convolution and splicing on the multiple original local feature maps, and after being processed by the local attention module, obtains the weighted local feature maps;
[0014] Step S202: The convolutional neural network extracts the original global feature map of the training set image data, and after being processed by the global attention module, obtains the globally averaged feature map;
[0015] Step S203: Based on the weighted local feature maps and the globally averaged feature map, through the feature fusion of the convolutional neural network, and performing splicing, convolution, and pooling, obtain the cordyceps feature map.
[0016] Further, in the step S4, based on the significant features of different types in the test set, classify the types of cordyceps and determine the Ophiocordyceps sinensis in the cordyceps population, specifically including the following steps:
[0017] Step S401: Based on the caterpillar body and stroma of the cordyceps, take the image outlined by the caterpillar body of the cordyceps as the first significant feature, and the image outlined by the stroma of the cordyceps as the second significant feature;
[0018] Step S402: Based on the cordyceps having the first significant feature, obtain the shape feature, texture feature, and color feature of the caterpillar body image, and determine the first score value corresponding to the first significant feature;
[0019] Step S403: Based on the cordyceps having the second significant feature, obtain the shape feature, texture feature, and color feature of the stroma image, and determine the second score value corresponding to the second significant feature;
[0020] Step S404: Based on the cordyceps having the first significant feature and the second significant feature, determine the probability that the cordyceps is Ophiocordyceps sinensis.
[0021] Further, in the step S402, obtain the shape feature, texture feature, and color feature of the caterpillar body image, and according to the first comparison criterion, determine the first score value corresponding to the first significant feature, where the first comparison criterion specifically includes:
[0022] Based on the contour outline map of the caterpillar body image, obtain the length and the number of protrusions of the contour outline map, and determine the shape feature parameters of the caterpillar body image;
[0023] Based on the grayscale image of the worm body, obtain the number of annulations and roughness of the grayscale image, and determine the texture feature parameters of the worm body image;
[0024] Based on the grayscale image of the worm body, obtain the color lightness of the grayscale image, and determine the color feature parameters of the worm body image;
[0025] Based on the shape feature parameters, texture feature parameters, and color feature parameters of the worm body image, determine the first score value corresponding to the first significant feature.
[0026] Further, in step S403, obtain the shape feature, texture feature, and color feature of the stroma image, and determine the second score value corresponding to the second significant feature according to the second comparison criterion, where the second comparison criterion specifically includes:
[0027] Based on the contour sketch of the stroma image, obtain the base width, end width, and length of the contour sketch, and determine the shape feature parameters of the stroma image;
[0028] Based on the grayscale image of the stroma image, obtain the roughness of the grayscale image, and determine the texture feature parameters of the stroma image;
[0029] Based on the grayscale image of the stroma image, obtain the color lightness of the grayscale image, and determine the color feature parameters of the stroma image;
[0030] Based on the shape feature parameters, texture feature parameters, and color feature parameters of the stroma image, determine the second score value corresponding to the second significant feature.
[0031] Further, in the first comparison criterion, based on the shape feature parameters, texture feature parameters, and color feature parameters of the worm body image, determine the first score value corresponding to the first significant feature according to the first calculation function, where the first calculation function is:
[0032] P1 = L1 * f1(X) + S * f2(C1) + f3(M1);
[0033] Where P1 is the first score value corresponding to the first significant feature, f1(X) is the first preset function corresponding to the shape feature parameters, L1 is the length of the worm body image, X is the number of protrusions of the worm body image, f2(C1) is the second preset function corresponding to the texture feature parameters, S is the number of annulations of the worm body image, C1 is the roughness of the worm body image, f3(M1) is the third preset function corresponding to the color feature parameters, and M1 is the color lightness of the worm body image.
[0034] Further, in the second comparison criterion, based on the shape feature parameters, texture feature parameters, and color feature parameters of the stroma image, determine the second score value corresponding to the second significant feature according to the second calculation function, where the second calculation function is:
[0035] P2 = L2 * f1(W2 - W1) + f2(C2) + f3(M2);
[0036] Wherein, P2 is the second scoring value corresponding to the second significant feature, f1(W2 - W1) is the first preset function corresponding to the shape feature parameter, L2 is the length of the stroma image, W2 is the base width of the stroma image, W1 is the end width of the stroma image, f2(C2) is the second preset function corresponding to the texture feature parameter, C2 is the roughness of the stroma image, f3(M2) is the third preset function corresponding to the color feature parameter, and M2 is the color lightness of the stroma image.
[0037] Further, in the step S404, based on the cordyceps having the first significant feature and the second significant feature, the probability that the cordyceps is Ophiocordyceps sinensis is determined according to the probability calculation function, wherein the probability calculation function is:
[0038] Q = K1P1 + K2P2;
[0039] Wherein, Q is the probability that the cordyceps is Ophiocordyceps sinensis, K1 is the first preset weight corresponding to the first significant feature, P1 is the first scoring value corresponding to the first significant feature, K2 is the second preset weight corresponding to the second significant feature, and P2 is the second scoring value corresponding to the second significant feature.
[0040] Further, the calculation process of the convolutional neural network to obtain the cordyceps feature map is:
[0041]
[0042] Wherein, f g represents a one-dimensional tensor of global features, f i represents a three-dimensional tensor of local features, f orth is the orthogonalized local feature map, f final is the cordyceps feature map, conv refers to the ordinary convolution operation, contact refers to the splicing operation, and pooling refers to the average pooling operation.
[0043] According to the second aspect of the present invention, there is provided an Ophiocordyceps sinensis authenticity recognition system based on a convolutional neural network for implementing the Ophiocordyceps sinensis authenticity recognition method based on a convolutional neural network described in any one of the above, including:
[0044] An information acquisition unit for taking a photo of a cordyceps group containing Ophiocordyceps sinensis and obtaining a feature image of the cordyceps group containing Ophiocordyceps sinensis;
[0045] A first information processing unit for dividing the obtained feature image data set into a training set and a test set, and inputting the training set into the convolutional neural network for training;
[0046] A second information processing unit, configured to input a test set into a trained convolutional neural network and extract significant features from the cordyceps feature map;
[0047] A feedback unit, configured to classify cordyceps types based on different types of significant features in the test set and identify Ophiocordyceps sinensis in the cordyceps population.
[0048] The present invention has the following advantages:
[0049] This application takes photos of a cordyceps population containing Ophiocordyceps sinensis, and obtains a feature image of the cordyceps population containing Ophiocordyceps sinensis; divides the obtained feature image dataset into a training set and a test set, inputs the training set into a convolutional neural network for training; inputs the test set into the trained convolutional neural network, and extracts significant features from the cordyceps feature map; classifies cordyceps types based on different types of significant features in the test set and identifies Ophiocordyceps sinensis in the cordyceps population.
[0050] The convolutional neural network applied in this application is a high-precision recognition method. By extracting features of pictures through the convolutional neural network, it can weaken the influence of background changes, identify the stroma and worm body parts of different types of cordyceps, and is applicable to the distinction of different categories of cordyceps. This application solves the limitation problem that research needs to rely on modern high-end instrument equipment, and takes a step closer to the fast and convenient authenticity identification of traditional Chinese medicine. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only exemplary, and for those of ordinary skill in the art, without creative efforts, other implementation drawings can also be obtained according to the provided drawings.
[0052] The structures, ratios, sizes, etc. illustrated in this specification are only used to cooperate with the content disclosed in the specification for those who are familiar with this technology to understand and read, and are not used to limit the limited conditions under which the present invention can be implemented. Therefore, they do not have technical substance. Any modification of the structure, change of the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope that can be covered by the technical content disclosed in the present invention.
[0053] Figure 1 It is a flowchart of a method for identifying the authenticity of Ophiocordyceps sinensis provided by the present invention;
[0054] Figure 2 It is a specific flowchart of step S2 in the identification method provided by the present invention;
[0055] Figure 3 It is the specific flowchart of step S4 in the recognition method provided by the present invention;
[0056] Figure 4 It is the connection block diagram of a Cordyceps sinensis authenticity recognition system provided by the present invention. Specific embodiments
[0057] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0058] In order to solve the problems of high usage cost and difficulty in popularization and application in the prior art due to the reliance on high-end instrument equipment and precise analysis technology for identification, according to the first aspect, a Cordyceps sinensis authenticity recognition method based on a convolutional neural network is provided. As Figure 1 shown, it includes the following steps:
[0059] Step S1: Take a photo of a Cordyceps group containing Cordyceps sinensis to obtain a characteristic image of the Cordyceps group containing Cordyceps sinensis;
[0060] Step S2: Divide the obtained characteristic image dataset into a training set and a test set, and input the training set into a convolutional neural network for training;
[0061] Step S3: Input the test set into the trained convolutional neural network to obtain a Cordyceps characteristic map, and extract significant features in the Cordyceps characteristic map;
[0062] Step S4: Based on the significant features of different types in the test set, divide the Cordyceps types and determine Cordyceps sinensis in the Cordyceps group.
[0063] In step S1, a digital camera with a macro fixed-focus lens is used for digital acquisition and recording of specimens. The manual aperture is adjusted to F16 - F22 to ensure sufficient depth of field. In the shutter setting, the speed is set to 1 / 125 s. A tripod or fixing device is used to ensure the stability of the captured image without jitter. A copy stand and flash instant shooting are used, and a unified white shooting background is used to avoid the influence of ambient light and color around. A soft light cloth is added to the light source to ensure soft and uniform light and avoid the reflection point of the light source. The photo resolution is not less than 3 million pixels, and the high-precision mode should be selected for taking photos, and the image is saved in the JPG file format.
[0064] The experimental dataset contains a total of 333 images, and each image contains one or more cordyceps samples of corresponding categories. Among them, there are 101 images of Ophiocordyceps sinensis, 101 images of Cordyceps taii, and 131 images of Cordyceps hawkesii. When training, the sample data of each category is divided into a training set (248 images) and a test set (85 images) according to a ratio of 3:1.
[0065] As Figure 2 shown, in step S2, the training set is input into the convolutional neural network for training, which specifically includes:
[0066] Step S201: The convolutional neural network extracts multiple original local feature maps of the training set image data, performs dilated convolution on the multiple original local feature maps and splices them, and after being processed by the local attention module, obtains the weighted local feature maps;
[0067] Step S202: The convolutional neural network extracts the original global feature map of the training set image data, and after being processed by the global attention module, obtains the globally averaged pooled feature map;
[0068] Step S203: Based on the weighted local feature maps and the globally averaged pooled global feature map, through the feature fusion of the convolutional neural network, and performing splicing, convolution, and pooling, a cordyceps feature map is obtained.
[0069] The convolutional neural network is mainly divided into three major modules: the backbone network, the local feature extraction branch, and the global feature extraction branch. The backbone network uses resnet50 as the backbone network for feature extraction, and removes the downsampling operation of the Res3 module to increase the semantic information of the original local feature map f g,3 obtained by the Res3 module. The local feature extraction branch is mainly composed of multiple dilated convolutions, performs dilated convolution operations on the feature maps obtained using different network layers, and splices the multiple original local feature maps f g,1 , f g,2 , f g,3 . The global feature extraction branch sends the original global feature map f g,4 obtained by the Res4 module into the global attention feature module.
[0070] The specific process of the local feature extraction branch extracting the local feature map is as follows: The feature extraction module extracts the original local feature maps f g,1 , f g,2 , f g,3 , and the multiple original local feature maps f g,1 , f g,2 , f g,3They are concatenated to obtain a feature map containing local semantic information at different levels. The concatenated local feature map is input into the local attention feature module. Among them, the local attention mechanism performs one-dimensional convolution or passes through a fully connected layer on the vector obtained by pooling the feature map to obtain a weighted vector of one channel, then multiplies it element-wise with the original local feature map, and adds the residual connection of the original local feature map to obtain the local feature map f weighted by the local attention module. local The specific calculation process is as follows:
[0071] f local = att(conv(contact(atr_convf g,1 , f g,2 , f g,3 )));
[0072] Among them, f local is the weighted local feature map, f g,1 , f g,2 , f g,3 are the original local feature maps, att refers to the local attention module, conv refers to the ordinary convolution operation, contact refers to the concatenation operation, and atr_conv refers to the dilated convolution operation.
[0073] The specific process of the global feature extraction branch extracting the global feature map is as follows: The feature extraction module sends the original global feature map f g,4 obtained from the Res4 module into the global attention feature module. Among them, the global attention feature module constructs Q, V, and K vectors for the feature map using two-dimensional convolution, performs weighted summation on the spatial and channel interaction information respectively to obtain the attention weight map, multiplies it element-wise with the original global feature map, and adds the residual connection of the original global feature map to obtain the global feature map weighted by the global spatial and channel attention modules. The weighted global feature map is subjected to average pooling to obtain the average-pooled global feature map f global . The specific calculation process is as follows:
[0074] f global = pooling(att(f g,4 ));
[0075] Among them, f global is the average-pooled global feature map, f g,4 is the original global feature map, att refers to the global attention module, and pooling refers to the average pooling operation.
[0076] The specific process of fusing the weighted local feature map and the average-pooled global feature map is as follows: After obtaining the one-dimensional tensors f representing the global features through the global and local feature extraction branches respectively gand the three-dimensional tensor f representing local features i After that, the two are respectively fed into the feature fusion module. Among them, the feature fusion module uses the orthogonalization method to obtain the orthogonalized local feature f orth , eliminates the mutual interference between the local feature and the global feature, splices them, performs convolution, and obtains the final global cordyceps feature map f after pooling final . The specific calculation process is as follows:
[0077]
[0078] Among them, f g represents the one-dimensional tensor of the global feature, f i represents the three-dimensional tensor of the local feature, f orth is the orthogonalized local feature map, f final is the cordyceps feature map, conv refers to the ordinary convolution operation, contact refers to the splicing operation, and pooling refers to the average pooling operation.
[0079] The loss function is selected to use the softmax classification loss function for training, and the network parameters are continuously iterated until the network reaches a stable convergence state.
[0080] The convolutional neural network applied in this application is a high-precision recognition method. By extracting the features of the picture through the convolutional neural network, it can weaken the influence of background changes, recognize the stroma and worm body parts of different types of cordyceps, and is applicable to the distinction of different categories of cordyceps, so as to distinguish different types of pictures. This application solves the limitation problem that research needs to rely on modern high-end instrument equipment, and takes a step closer to the fast and convenient authenticity identification of traditional Chinese medicine.
[0081] As Figure 3 shown, in step S4, based on the significant features of different types in the test set, the cordyceps types are divided to determine the Ophiocordyceps sinensis in the cordyceps population, which specifically includes the following steps:
[0082] Step S401: Based on the worm body and stroma of the cordyceps, the image outlined by the worm body of the cordyceps is used as the first significant feature, and the image outlined by the stroma of the cordyceps is used as the second significant feature;
[0083] Step S402: Based on the cordyceps having the first significant feature, obtain the shape feature, texture feature and color feature of the worm body image, and determine the first score value corresponding to the first significant feature;
[0084] Step S403: Based on the cordyceps having the second significant feature, obtain the shape feature, texture feature and color feature of the stroma image, and determine the second score value corresponding to the second significant feature;
[0085] Step S404: Determine the probability that the cordyceps is Ophiocordyceps sinensis based on the cordyceps having the first significant feature and the second significant feature.
[0086] In step S402, obtain the shape features, texture features, and color features of the worm body image, and determine the first score value corresponding to the first significant feature according to the first comparison criterion. The first comparison criterion specifically includes:
[0087] Ophiocordyceps sinensis is formed by the combination of the worm body sclerotium and the immature stroma. Therefore, the worm body and the stroma are two significant features of Ophiocordyceps sinensis. By observing whether the cordyceps has a worm body and a stroma, it can be preliminarily judged whether it is Ophiocordyceps sinensis. Then, analyze the shape features, texture features, and color features of the worm body and the stroma respectively to further judge whether it is truly Ophiocordyceps sinensis.
[0088] Based on the contour sketch of the worm body image, obtain the length and the number of protrusions of the contour sketch, and determine the shape feature parameters of the worm body image;
[0089] Based on the grayscale image of the worm body image, obtain the number of annulations and the roughness of the grayscale image, and determine the texture feature parameters of the worm body image;
[0090] Based on the grayscale image of the worm body image, obtain the color lightness of the grayscale image, and determine the color feature parameters of the worm body image;
[0091] Based on the shape feature parameters, texture feature parameters, and color feature parameters of the worm body image, determine the first score value corresponding to the first significant feature.
[0092] In the first comparison criterion, based on the shape feature parameters, texture feature parameters, and color feature parameters of the worm body image, determine the first score value corresponding to the first significant feature according to the first calculation function. The first calculation function is:
[0093] P1 = L1 * f1(X) + S * f2(C1) + f3(M1);
[0094] Where P1 is the first score value corresponding to the first significant feature, f1(X) is the first preset function corresponding to the shape feature parameters, L1 is the length of the worm body image, X is the number of protrusions of the worm body image, f2(C1) is the second preset function corresponding to the texture feature parameters, S is the number of annulations of the worm body image, C1 is the roughness of the worm body image, f3(M1) is the third preset function corresponding to the color feature parameters, and M1 is the color lightness of the worm body image.
[0095] The shape characteristics of the worm body of Cordyceps sinensis are as follows: The worm body is slender and cylindrical, resembling a silkworm, 3-5 cm long, with 8 pairs of feet corresponding to the number of protrusions. The texture characteristics of the worm body of Cordyceps sinensis are as follows: The worm body is rough, with 20-30 annular lines on the back, and the annular lines near the head are finer. The color characteristics of Cordyceps sinensis are as follows: The color of the worm body is yellow, clean and bright. By detecting the worm body image of Cordyceps sinensis, the above-mentioned worm body characteristics are obtained, and the worm body characteristics are compared with the standard characteristics, so as to score it. The closer it is to the standard characteristics, the higher its score value.
[0096] In step S403, obtain the shape characteristics, texture characteristics and color characteristics of the stroma image, and determine the second score value corresponding to the second significant characteristic according to the second comparison standard. Among them, the second comparison standard specifically includes:
[0097] Based on the contour sketch of the stroma image, obtain the base width, end width and length of the contour sketch, and determine the shape characteristic parameters of the stroma image;
[0098] Based on the grayscale image of the stroma image, obtain the roughness of the grayscale image, and determine the texture characteristic parameters of the stroma image;
[0099] Based on the grayscale image of the stroma image, obtain the color lightness of the grayscale image, and determine the color characteristic parameters of the stroma image;
[0100] Based on the shape characteristic parameters, texture characteristic parameters and color characteristic parameters of the stroma image, determine the second score value corresponding to the second significant characteristic.
[0101] In the second comparison standard, based on the shape characteristic parameters, texture characteristic parameters and color characteristic parameters of the stroma image, according to the second calculation function, determine the second score value corresponding to the second significant characteristic. Among them, the second calculation function is:
[0102] P2 = L2 * f1(W2 - W1) + f2(C2) + f3(M2);
[0103] Among them, P2 is the second score value corresponding to the second significant characteristic, f1(W2 - W1) is the first preset function corresponding to the shape characteristic parameters, L2 is the length of the stroma image, W2 is the base width of the stroma image, W1 is the end width of the stroma image, f2(C2) is the second preset function corresponding to the texture characteristic parameters, C2 is the roughness of the stroma image, f3(M2) is the third preset function corresponding to the color characteristic parameters, and M2 is the color lightness of the stroma image.
[0104] The shape characteristics of the stroma of Cordyceps sinensis are as follows: the stroma is slender and cylindrical, 4-7 cm long, with a thicker base and a gradually tapering end. The texture characteristics of the stroma of Cordyceps sinensis are: the stroma is rough. The color characteristics of Cordyceps sinensis are: dark brown to brownish black. By detecting the stroma images of Cordyceps sinensis, each of the above stroma characteristics is obtained, and the stroma characteristics are compared with the standard characteristics, so as to score it. The closer it is to the standard characteristics, the higher its score value.
[0105] The method for obtaining the length in the contour drawing of the worm body image or the stroma image is as follows: obtain its contour drawing, determine the center point of its contour drawing, and divide the contour drawing into upper and lower parts along the center point; respectively determine the two farthest points from the center point in the upper and lower half contour drawings; connect the center point with the two farthest points, and the distance is the length in the contour drawing.
[0106] The method for obtaining the number of protrusions in the contour drawing of the worm body image is as follows: obtain the distance values from the center point of its contour drawing to each point from the starting point to the ending point in the contour line; represent all the distance values on the contour point-distance image, and the obtained curve change rate represents the smoothness of the contour drawing of the worm body image; if the curve change rate shows a sharp rise or fall, it means that the contour drawing has protrusions, and the number of protrusions is determined according to the number of curve change rates greater than the preset threshold.
[0107] The method for obtaining the base width and end width in the contour drawing of the stroma image is as follows: obtain the left and right boundary points of the base and end in the contour drawing, and the distance value between the left and right boundary points is the base width and end width.
[0108] The pixel gray value size of the grayscale image is the color lightness of the grayscale image, and the standard deviation of the pixel gray value reflects the severity of the gray change. The area with large changes is usually regarded as rough, and the roughness of the grayscale image is obtained by obtaining the standard deviation of the pixel gray value in the grayscale image. Based on the Cordyceps having the first significant feature and the second significant feature, the probability that the Cordyceps is Cordyceps sinensis is determined according to the probability calculation function, where the probability calculation function is:
[0109] Q = K1P1 + K2P2;
[0110] Among them, Q is the probability that the Cordyceps is Cordyceps sinensis, K1 is the first preset weight corresponding to the first significant feature, P1 is the first score value corresponding to the first significant feature, K2 is the second preset weight corresponding to the second significant feature, and P2 is the second score value corresponding to the second significant feature.
[0111] If the cordyceps all have the first significant feature and the second significant feature, and the scoring values of both the first significant feature and the second significant feature are relatively high, it indicates that the cordyceps is genuine Cordyceps sinensis; if the cordyceps does not have the first significant feature or the second significant feature, it indicates that the cordyceps is fake Cordyceps sinensis; if the cordyceps all have the first significant feature and the second significant feature, but the scoring values of both the first significant feature and the second significant feature are relatively low, it indicates that the cordyceps is fake Cordyceps sinensis.
[0112] Set a scoring threshold. When the first scoring value and the second scoring value are greater than the scoring threshold, the cordyceps is genuine Cordyceps sinensis.
[0113] According to a second aspect, there is provided a Cordyceps sinensis authenticity recognition system based on a convolutional neural network for implementing a Cordyceps sinensis authenticity recognition method based on a convolutional neural network, as Figure 4 shown, including:
[0114] An information acquisition unit for taking photos of Cordyceps sinensis and other cordyceps and obtaining characteristic images of Cordyceps sinensis and other cordyceps;
[0115] A first information processing unit for dividing the obtained characteristic image data set into a training set and a test set and inputting the training set into the convolutional neural network for training;
[0116] A second information processing unit for inputting the test set into the trained convolutional neural network and extracting significant features in the cordyceps feature map;
[0117] A feedback unit for classifying the cordyceps type based on different types of significant features in the test set and determining Cordyceps sinensis in the cordyceps population.
[0118] In this application, photos of Cordyceps sinensis and other cordyceps are taken, and the information acquisition unit obtains characteristic images of Cordyceps sinensis and other cordyceps. The obtained characteristic image data set is divided into a training set and a test set, and the training set is input into the convolutional neural network for training, and a cordyceps feature map is obtained through the processing of the first information processing unit. The test set is input into the trained convolutional neural network, and through the processing of the second information processing unit, significant features in the cordyceps feature map are extracted. Based on different types of significant features in the test set, the cordyceps type is classified, and the feedback unit determines Cordyceps sinensis in the cordyceps population.
[0119] Although the present invention has been described in detail above with general descriptions and specific embodiments, based on the present invention, some modifications or improvements can be made, which are obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection required by the present invention.
Claims
1. A method for identifying the authenticity of Cordyceps sinensis based on a convolutional neural network, characterized in that It includes the following steps: Step S1: Take a photo of the cordyceps population containing Cordyceps sinensis to obtain a characteristic image of the cordyceps population containing Cordyceps sinensis; Step S2: Divide the obtained characteristic image dataset into a training set and a test set, and input the training set into a convolutional neural network for training; Step S3: Input the test set into the trained convolutional neural network, and extract the significant features in the cordyceps feature map; Step S4: Based on the different types of significant features in the test set, divide the cordyceps types and determine Cordyceps sinensis in the cordyceps population.
2. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 1, characterized in that In the said step S2, inputting the training set into the convolutional neural network for training specifically includes: Step S201: The convolutional neural network extracts multiple original local feature maps of the training set image data, performs dilated convolution and splicing on the multiple original local feature maps, and after being processed by a local attention module, obtains a weighted local feature map; Step S202: The convolutional neural network extracts the original global feature map of the training set image data, and after being processed by a global attention module, obtains an average-pooled global feature map; Step S203: Based on the weighted local feature map and the average-pooled global feature map, through the feature fusion of the convolutional neural network, and performing splicing, convolution and pooling, a cordyceps feature map is obtained.
3. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 1, characterized in that In the said step S4, based on the different types of significant features in the test set, dividing the cordyceps types and determining Cordyceps sinensis in the cordyceps population specifically includes the following steps: Step S401: Based on the worm body and stroma of the cordyceps, the image outlined by the worm body of the cordyceps is used as the first significant feature, and the image outlined by the stroma of the cordyceps is used as the second significant feature; Step S402: Based on the cordyceps having the first significant feature, obtain the shape feature, texture feature and color feature of the worm body image, and determine the first score value corresponding to the first significant feature; Step S403: Based on the cordyceps having the second significant feature, obtain the shape feature, texture feature and color feature of the stroma image, and determine the second score value corresponding to the second significant feature; Step S404: Based on the cordyceps having the first significant feature and the second significant feature, determine the probability that the cordyceps is Cordyceps sinensis.
4. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 3, characterized in that, In the said step S402, obtaining the shape feature, texture feature and color feature of the worm body image, and determining the first score value corresponding to the first significant feature according to the first comparison criterion, where the first comparison criterion specifically includes: Based on the contour outline map of the worm body image, obtain the length and the number of protrusions of the contour outline map, and determine the shape feature parameters of the worm body image; Based on the grayscale image of the worm body image, obtain the number of annulations and the roughness of the grayscale image, and determine the texture feature parameters of the worm body image; Based on the grayscale image of the worm body image, obtain the color lightness of the grayscale image, and determine the color feature parameters of the worm body image; Based on the shape feature parameters, texture feature parameters and color feature parameters of the worm body image, determine the first score value corresponding to the first significant feature.
5. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 3, characterized in that, In step S403, the shape feature, texture feature, and color feature of the stroma image are obtained, and according to the second comparison criterion, the second score value corresponding to the second significant feature is determined, where the second comparison criterion specifically includes: Based on the contour sketch of the stroma image, the base width, end width, and length of the contour sketch are obtained, and the shape feature parameters of the stroma image are determined; Based on the grayscale image of the stroma image, the roughness of the grayscale image is obtained, and the texture feature parameters of the stroma image are determined; Based on the grayscale image of the stroma image, the color brightness of the grayscale image is obtained, and the color feature parameters of the stroma image are determined; Based on the shape feature parameters, texture feature parameters, and color feature parameters of the stroma image, the second score value corresponding to the second significant feature is determined.
6. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 4, characterized in that In the first comparison criterion, based on the shape feature parameters, texture feature parameters, and color feature parameters of the worm body image, according to the first calculation function, the first score value corresponding to the first significant feature is determined, where the first calculation function is: P1 = L1 * f1(X) + S * f2(C1) + f3(M1); where P1 is the first score value corresponding to the first significant feature, f1(X) is the first preset function corresponding to the shape feature parameters, L1 is the length of the worm body image, X is the number of protrusions of the worm body image, f2(C1) is the second preset function corresponding to the texture feature parameters, S is the number of annulations of the worm body image, C1 is the roughness of the worm body image, f3(M1) is the third preset function corresponding to the color feature parameters, and M1 is the color brightness of the worm body image.
7. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 5, wherein In the second comparison criterion, based on the shape feature parameters, texture feature parameters, and color feature parameters of the stroma image, according to the second calculation function, the second score value corresponding to the second significant feature is determined, where the second calculation function is: P2 = L2 * f1(W2 - W1) + f2(C2) + f3(M2); where P2 is the second score value corresponding to the second significant feature, f1(W2 - W1) is the first preset function corresponding to the shape feature parameters, L2 is the length of the stroma image, W2 is the base width of the stroma image, W1 is the end width of the stroma image, f2(C2) is the second preset function corresponding to the texture feature parameters, C2 is the roughness of the stroma image, f3(M2) is the third preset function corresponding to the color feature parameters, and M2 is the color brightness of the stroma image.
8. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 3, characterized in that, In step S404, based on the cordyceps having the first significant feature and the second significant feature, the probability that the cordyceps is Ophiocordyceps sinensis is determined according to the probability calculation function, where the probability calculation function is: Q = K1P1 + K2P2; where Q is the probability that the cordyceps is Ophiocordyceps sinensis, K1 is the first preset weight corresponding to the first significant feature, P1 is the first score value corresponding to the first significant feature, K2 is the second preset weight corresponding to the second significant feature, and P2 is the second score value corresponding to the second significant feature.
9. The Cordyceps sinensis authenticity identification method based on a convolutional neural network according to claim 2, characterized in that The calculation process of the convolutional neural network to obtain the cordyceps feature map is: Among them, f g is a one-dimensional tensor representing global features, f i is a three-dimensional tensor representing local features, f orth is an orthonormalized local feature map, f final is a cordyceps feature map, conv refers to the ordinary convolution operation, contact refers to the concatenation operation, and pooling refers to the average pooling operation.
10. A Cordyceps sinensis authenticity recognition system based on a convolutional neural network, which is used to implement the Cordyceps sinensis authenticity recognition method based on a convolutional neural network according to any one of claims 1-9, characterized in that, Including: An information acquisition unit for taking a photo of a cordyceps group containing Ophiocordyceps sinensis and obtaining a feature image of the cordyceps group containing Ophiocordyceps sinensis; The first information processing unit is used to divide the acquired feature image dataset into a training set and a test set, and input the training set into a convolutional neural network for training; The second information processing unit is used to input the test set into the trained convolutional neural network and extract the significant features in the cordyceps feature map; The feedback unit is used to divide the cordyceps types based on the significant features of different types in the test set and determine the Ophiocordyceps sinensis in the cordyceps population.
Citation Information
Patent Citations
Convolutional neural network picture feature extraction-based ship type identification method
CN107145903A
Method and device for quickly identifying authenticity of cordyceps sinensis
CN114693613A
Cited By
Dynamic threshold image copying identification method and system based on ResNet50 and ResNet18 cascade
CN121074503A