Chinese herbal medicine classification and identification method based on image processing
By building the MobileViT-RMF network, combining the multi-scale large-core attention MAB module and large-core tail attention LKAT module, the problem of counterfeit medicinal materials in the traditional Chinese medicine market is solved, and efficient and accurate identification of Chinese herbal medicines is achieved, suitable for resource-constrained environments.
Patent Information
- Application Number
- CN202411797179.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-29
AI Technical Summary
The traditional Chinese medicine market is complex and there are problems with counterfeit medicinal materials, which leads to inaccurate efficacy and even endangering health. It is difficult for the existing technology to accurately identify traditional Chinese herbal medicines.
Using the Chinese herbal classification recognition method based on image processing, the MobileViT-RMF network is constructed, and the multi-scale large-nuclear attention MAB module and large-nuclear tail attention LKAT module are combined to perform feature extraction and classification recognition of Chinese herbal images.
It realizes efficient and accurate Chinese herbal medicine recognition, reduces calculation complexity and resource consumption, is suitable for resource-constrained environments, and provides good operational efficiency and recognition accuracy.
Smart Images

Figure CN119904665A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of Chinese herbal medicine identification, and in particular relates to a Chinese herbal medicine classification and identification method based on image processing. Background Art
[0002] At present, the TCM market is huge and complex, and some individuals will replace drugs with more expensive ones with drugs that have very similar characteristics. For example, white peony root and red peony root, although these two herbs are similar in appearance, their medicinal effects are very different - white peony root has the effect of nourishing blood and regulating menstruation, while red peony root is mainly used to promote blood circulation and remove blood stasis. Incorrect substitution may seriously affect the treatment effect of patients and even endanger their health. In addition, the process of TCM prescription and drug collection is relatively separated, and the evaluation of drug quality mainly relies on the experience and judgment of procurement personnel, which may lead to the phenomenon of mistaking the real for the fake. Fake licorice is often replaced by "sweet root" or "cardamom grass". Real licorice has the effect of harmonizing medicinal properties and relieving pain, while fake herbs lack these effects. In addition, the number of TCM practitioners has increased significantly in recent years, and the public's attention to TCM has also increased. However, due to the wide variety of TCM, young doctors often face challenges in the process of identifying herbs. Based on this, it is necessary to design a method that can accurately classify and identify herbs to assist doctors or procurement personnel in their daily work. Summary of the invention
[0003] In order to solve at least one of the above technical problems existing in the prior art, the present invention provides a method for classifying and identifying Chinese herbal medicines based on image processing.
[0004] The present invention is implemented by the following technical solution: a method for classifying and identifying Chinese herbal medicines based on image processing, comprising the following steps:
[0005] Step S1: Construct a MABs attention module based on the multi-scale large core attention MAB module and the large core tail attention LKAT module;
[0006] Step S2: construct the MViT-k module, and construct the RMF multi-scale attention module based on the MABs attention module;
[0007] Step S3: Add the RMF multi-scale attention module between the MV2 block and the 1×1 convolutional layer in the backbone network MobileViT to construct the MobileVit-RMF network;
[0008] Step S4: obtaining a tensor of an image of the Chinese herbal medicine to be tested, inputting the tensor of the image of the Chinese herbal medicine to be tested into the MobileVit-RMF network for classification and recognition, and obtaining a classification result of the Chinese herbal medicine.
[0009] Preferably, step S1 specifically includes:
[0010] Use the primary multi-scale large kernel attention MLKA module and the gated spatial attention GSAU unit to form a multi-scale large kernel attention MAB module;
[0011] According to the requirements of the image feature extraction task, the multi-scale large core attention MAB module is stacked and residually connected with the large core tail attention LKAT module to form a MABs module.
[0012] Preferably, the primary multi-scale large kernel attention MLKA module is:
[0013]
[0014] In the formula, G i (·) is a i ×a i The i-th gate generated by depthwise separable convolution, LKA i is the large kernel attention of the i-th group of image tensors to be tested, X i is the graphic feature of the i-th group of image tensors to be tested.
[0015] Preferably, step S4 specifically includes:
[0016] Input the Chinese herbal medicine image tensor to be tested into the 3×3 standard convolutional layer in the MobileVit-RMF network for the first downsampling operation, and then input the Chinese herbal medicine image tensor after the first downsampling into the MV2 block for another downsampling operation;
[0017] After the above operations are performed, the image tensor of the Chinese herbal medicine to be tested is input into the RMF multi-scale attention module for feature extraction, so as to obtain a multi-dimensional image tensor with global information of the image tensor of the Chinese herbal medicine to be tested;
[0018] The multidimensional image tensor is subjected to channel compression through 1×1 convolution, and then global average pooling, and finally the final Chinese herbal medicine classification result is obtained through the multivariate cross entropy loss function.
[0019] Preferably, the image tensor of the Chinese herbal medicine to be tested after the above operations are performed is input into the RMF multi-scale attention module for feature extraction, including:
[0020] Performing a downsampling operation on the image tensor of the Chinese herbal medicine to be tested, extracting local information and obtaining local features;
[0021] Then, the first MABs attention module is used to obtain the reconstructed features of the image tensor of the Chinese herbal medicine to be tested, and then the weight of the reconstructed features is determined by the large-core tail attention LKAT module;
[0022] The weighted Chinese herbal medicine image tensor to be tested is input into the MViT-k module for global information extraction, and output to the second MABs attention module to obtain a multi-dimensional image tensor with global information of the Chinese herbal medicine image tensor to be tested.
[0023] Preferably, the method further comprises: evaluating the MobileVit-RMF network by using preset evaluation indicators, and optimizing the MobileVit-RMF network according to the evaluation results, wherein the preset evaluation indicators at least include precision, recall, F1 value and prediction accuracy.
[0024] Preferably, before obtaining the image tensor of the Chinese herbal medicine to be tested in step S4, the following steps are also included:
[0025] The image data of the Chinese herbal medicine to be tested is acquired, and the image data is standardized to obtain a standardized image tensor of the Chinese herbal medicine to be tested.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] The MobileViT-RMF network proposed in the present invention adds an RMF multi-scale attention module to the backbone network. Compared with other lightweight networks, it has higher efficiency in terms of storage and computing resources. In terms of average prediction time (APT), it is suitable for practical applications that require efficient processing and fast feedback. In terms of the number of floating-point operations (FLOPs), from the perspective of the number of parameters, the complexity of the model is significantly reduced, making the MobileViT-RMF network more adaptable in resource-constrained environments, and in terms of computational complexity, it is much lower than the various commonly used classical networks, which not only improves the operating efficiency of the model, but also provides a good foundation for real-time Chinese herbal medicine identification. While achieving high recognition accuracy, MobileViT-RMF can effectively manage computing resources, thereby providing good operating efficiency and adapting to diverse application needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 It is a schematic diagram of a flow chart of a Chinese herbal medicine classification and recognition method based on image processing provided by the present invention;
[0030] Figure 2It is a schematic diagram of the structures of MLKA, GSAU and LKAT in a Chinese herbal medicine classification and recognition method based on image processing provided by the present invention;
[0031] Figure 3 It is the structure diagram of Transformer (a) and FastKanLayer (b) in MobileViT-K provided by the present invention;
[0032] Figure 4 It is a schematic diagram of the structure of the RMF multi-scale attention module provided by the present invention;
[0033] Figure 5 It is a schematic diagram of the MobileVit-RMF network structure provided by the present invention;
[0034] Figure 6 It is a schematic diagram of the structure of the MV2 block provided by the present invention;
[0035] Figure 7 It is a comparison table between the MobileVit-RMF network constructed by the present invention and the classic network;
[0036] Figure 8 It is a comparison table between the MobileVit-RMF network constructed by the present invention and the lightweight network. DETAILED DESCRIPTION
[0037] In conjunction with the drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0038] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention. It should be noted that in this specification, relational terms such as first and second are only used to distinguish one entity from several other entities, and do not necessarily require or imply any actual relationship or order between these entities.
[0039] like Figure 1 As shown, the embodiment of the present invention provides a method for classifying and identifying Chinese herbal medicines based on image processing, comprising the following steps:
[0040] Step S1: Construct the MABs attention module based on the multi-scale large core attention MAB module and the large core tail attention LKAT module.
[0041] Optionally, it specifically includes: using a primary multi-scale large core attention MLKA module and a gated spatial attention GSAU unit to form a multi-scale large core attention MAB module; according to the requirements of the image feature extraction task, stacking the multi-scale large core attention MAB module, and performing a residual connection with the large core tail attention LKAT module to form a MABs module.
[0042] In this embodiment, Figure 2 As shown, first determine the large kernel attention LKA, assuming that the feature map of the Chinese herbal medicine image tensor to be tested is LKA adaptively constructs long-range relationships by decomposing a K×K convolution into three components: a (2d-1)×(2d-1) depthwise separable convolution f DW (·),one Depthwise Separable d-Dilated Convolution f DWD (·) and a point-wise convolution f PW (·), the specific formula is:
[0043] LKA(X)=f pw (f DWD (f DW (X))).
[0044] In order to learn the attention feature map with full-scale information, this embodiment enhances the fixed LKA through the group multi-scale mechanism, and converts the feature map of the Chinese herbal medicine image tensor to Divide into n parts X1,X2,...,X n , the size of each portion is For the i-th group of feature maps X i , a i ,d i The decomposed LKA is used to generate homogeneous scale attention map LKA i , where k i Represents the size of the i-th convolution kernel, and di represents the number of output channels of the i-th convolution operation.
[0045] In order to avoid blocking effects and learn more local information, spatial gating is used to dynamically adjust LKA i (·) Adapted to MLKA i (·), then the primary multi-scale large kernel attention MLKA module is:
[0046]
[0047] In the formula, G i(·) is a i ×a i The i-th gate generated by depthwise separable convolution, LKA i is the large kernel attention of the i-th group of image tensors to be tested, X i is the graphic feature of the i-th group of image tensors to be tested.
[0048] In this embodiment, the gating mechanism is combined with spatial attention to remove unnecessary linear layers and gather spatial context information. In order to capture spatial information more effectively, a single-layer depth-separable convolution is used to weight the feature map. Given densely transformed X and Y, the key process of GSAU is:
[0049]
[0050] In the formula, X and Y are both output feature maps from the previous layer, f DW (·) is the depthwise separable convolution operation, is the neural network product.
[0051] In this embodiment, a primary multi-scale large kernel attention MLKA module and a gated spatial attention GSAU unit are used to form a MAB module, and the stacked MAB modules are residually connected with the LKAT module to form a MABs module, which aims to reconstruct the network's key feature weights for Chinese herbal medicine images and make the network's attention more inclined to the key feature positions of the image. In this embodiment, according to the requirements of the image feature extraction task, a first MABs module with three layers of MAB modules stacked and a second MABs module with two layers of MAB modules stacked are designed, but the present invention is not limited thereto, and the number of MAB module stacking layers can be set according to the requirements of the image feature extraction task.
[0052] In this embodiment, the MABs (Multi-scale Attention Blocks) attention module processes the spatial relationship in the feature map more finely by weighting the features at different levels, effectively promoting the integration of global and local information and reducing the blocking artifact problem that may be caused by large kernel size.
[0053] Step S2: Construct the MViT-k module and construct the RMF multi-scale attention module based on the MABs attention module.
[0054] In this embodiment, Figure 3 As shown, the multilayer perceptron (MLP) in MviT is replaced by the fast Kolmogorov-Arnold network (FastKANLayer) to build the MViT-k module to achieve more efficient global feature fusion.
[0055] In this embodiment, Figure 4 As shown, the RMF multi-scale attention module includes an MV2 block, a first MABs module, an MViT-k module, and a second MABs module.
[0056] In this embodiment, the RMF multi-scale attention module accurately captures subtle feature changes in Chinese herbal medicine images with low computational complexity, thereby enhancing the network's effective use of key features. The introduction of the RMF module not only optimizes the computational efficiency of the network, but also significantly improves the accuracy of Chinese herbal medicine classification while keeping the model lightweight.
[0057] Step S3: Add the RMF multi-scale attention module between the MV2 block and the 1×1 convolutional layer in the backbone network MobileViT to construct the MobileVit-RMF network.
[0058] In this embodiment, Figure 5 As shown in FIG. 1 , the MobileVit-RMF network includes a 3×3 standard convolutional layer, 4 MV2 blocks, 3 RMF multi-scale attention modules, a 1×1 convolutional layer, a global average pooling layer, and a Fast Kolmogorov-Arnold Network (FastKANLayer) layer. In this embodiment, the structure of the MV2 block is as follows: Figure 6 shown.
[0059] In this embodiment, the MobileVit-RMF network structure is shown in Table 1 below, specifically:
[0060] Table 1
[0061] Input Operator <![CDATA[C out ]]> L S 3×256×256 Conv2d 32 - 2 32×128×128 MV2 32 - 1 32×128×128 MV2 72 - 2 72×64×64 MV2 72 - 1 72×64×64 MV2 72 - 1 96×32×32 RMF 96 2 1 120×16×16 RMF 120 4 1 168×8×8 RMF 168 3 1 168×8×8 Conv2d 320 - 1 320×1×1 AvgPool2d - - - 32×1×1 FC - - -
[0062] Step S4: obtaining a tensor of an image of the Chinese herbal medicine to be tested, inputting the tensor of the image of the Chinese herbal medicine to be tested into the MobileVit-RMF network for classification and recognition, and obtaining a classification result of the Chinese herbal medicine.
[0063] Optionally, it specifically includes: inputting the Chinese herbal medicine image tensor to be tested into the 3×3 standard convolution layer in the MobileVit-RMF network for an initial downsampling operation, and then inputting the Chinese herbal medicine image tensor to be tested after the initial downsampling into the MV2 block for another downsampling operation; inputting the Chinese herbal medicine image tensor to be tested after the above operation into the RMF multi-scale attention module for feature extraction to obtain a multi-dimensional image tensor with global information of the Chinese herbal medicine image tensor to be tested; performing channel compression on the multi-dimensional image tensor through 1×1 convolution, and then performing global average pooling, and finally obtaining the final Chinese herbal medicine classification result through a multivariate cross entropy loss function.
[0064] Optionally, the Chinese herbal medicine image tensor to be tested after the above operations are performed is input into the RMF multi-scale attention module for feature extraction, including: performing a downsampling operation on the Chinese herbal medicine image tensor to be tested, extracting local information and obtaining local features; then passing through the first MABs attention module to obtain the reconstructed features of the Chinese herbal medicine image tensor to be tested, and then determining the weight of the reconstructed features through the large core tail attention LKAT module; the Chinese herbal medicine image tensor to be tested after the weight is determined is input into the MViT-k module for global information extraction, and output to the second MABs attention module to obtain a multi-dimensional image tensor with the global information of the Chinese herbal medicine image tensor to be tested.
[0065] In this embodiment, the Chinese herbal medicine image tensors to be tested are input into the MobileViT-RMF model. These tensors first pass through a 3×3 standard convolution layer and perform a 2x downsampling operation to reduce the dimension and increase the number of channels. Then, these tensors are input into the MV2 blocks in the four MobileViT-RMF models and perform 2x downsampling operations.
[0066] The image tensor of the Chinese herbal medicine to be tested after the above steps is input into the RMF multi-scale attention module, and the downsampling operation is performed again in the MV2 block in the RMF multi-scale attention module to extract local information and obtain local features. The dimension of the obtained tensor remains unchanged, and the extracted information and features are copied and saved. Then it flows into the MAB unit in the first MABs module, and successively passes through the three-layer stacked multi-scale large kernel attention MLKA and gated spatial attention unit GSAU to obtain a reconstructed feature with the same dimension. After that, the reconstructed features extracted by the convolutional neural network are re-weighted through the large kernel tail attention LKAT module.
[0067] The weighted Chinese herbal medicine image tensor to be tested is input into the MViT-k module. After extracting the global information of the Chinese herbal medicine image tensor to be tested, it is output to the second MABs module to obtain a multi-dimensional image tensor with a dimension of 8×8.
[0068] Finally, the multidimensional image tensor is subjected to 1×1 convolution for channel compression, and the output result is then output by a linear classifier after global average pooling. Finally, the final Chinese herbal medicine classification result is obtained through the multivariate cross entropy loss function.
[0069] In this embodiment, the MobileViT network module integrated with RMF, the MobileViT-RMF network, reduces the computational complexity while showing good robustness, providing strong support for Chinese herbal medicine identification. In the future, we will explore the potential of MobileViT in the field of Chinese herbal medicine identification, and combine multimodal information to achieve more intelligent and efficient Chinese herbal medicine identification.
[0070] Optionally, the MobileVit-RMF network is evaluated by preset evaluation indicators, and the MobileVit-RMF network is optimized according to the evaluation results, and the preset evaluation indicators at least include precision, recall, F1 value and prediction accuracy.
[0071] In this embodiment, the precision P (Precision) is:
[0072] The recall rate R (Recall) is:
[0073] The F1-score is:
[0074] The prediction accuracy Acc(Accuracy) is:
[0075] Where TP is the number of positive samples identified as positive samples, TN is the number of negative samples identified as negative samples, FN is the number of positive samples identified as negative samples, and FP is the number of negative samples identified as positive samples.
[0076] Optionally, the step S4 of obtaining the image tensor of the Chinese herbal medicine to be tested also includes: obtaining image data of the Chinese herbal medicine to be tested, and performing standardization processing on the image data to obtain a standardized image tensor of the Chinese herbal medicine to be tested.
[0077] In this embodiment, 64 kinds of Chinese herbal medicine images were obtained from the Internet through web crawler technology, and were carefully manually screened and labeled as high-quality Chinese herbal medicine image data to be tested. The Chinese herbal medicine image data to be tested was standardized, including random resizing, center cropping, random horizontal flipping, random up and down inversion, random cropping, and random adjustment of image brightness, contrast, saturation and hue, etc., to improve the generalization ability and recognition accuracy of the model.
[0078] In this embodiment, the acquired Chinese herbal medicine image data to be tested includes species with important medicinal value such as Panax notoginseng, Salvia miltiorrhiza, Prunus mume, Ginseng, and Polygonum multiflorum, which are divided into two subsets: training set and test set. The data set contains more than 100,000 images, with an average of about 1,575 images of each Chinese herbal medicine. The test set contains about 20,000 images, with an average of about 300 images of each Chinese herbal medicine.
[0079] In this embodiment, in order to more intuitively observe the effectiveness of the proposed method, this experiment displays the feature heat map results of MobileViT-RMF. By observing these heat maps, it can be clearly seen that the MobileViT-RMF network has advantages in focusing on key features, and it also performs well in efficiency and adaptability. In the actual test process, the MobileViT-RMF network constructed by the present invention performs well in recognition accuracy with an accuracy rate of 93.78% in each test model. Figure 7 As shown, it surpasses the accuracy of VGG16 (92.27%), DenseNet121 (90.52%), Resnet18 (91.25%) and Resnet34 (92.52%).
[0080] The MobileViT-RMF network proposed in the present invention adds a lightweight module RMF to the backbone network. Figure 8 As shown in the figure, compared with other lightweight networks, it has higher efficiency in storage and computing resources, and in terms of average prediction time (APT), it is suitable for practical applications that require efficient processing and fast feedback. In terms of floating point operations (FLOPs), from the perspective of parameter quantity, the complexity of the model is significantly reduced, making the MobileViT-RMF network more adaptable in resource-constrained environments, and in terms of computational complexity, it is much lower than the various commonly used classical networks, which not only improves the operating efficiency of the model, but also provides a good foundation for real-time Chinese herbal medicine recognition. While achieving high recognition accuracy, MobileViT-RMF can effectively manage computing resources, thereby providing good operating efficiency and adapting to diverse application needs.
[0081] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A Chinese herbal medicine classification and recognition method based on image processing, characterized in that: The steps include: Step S1: Construct a MABs attention module based on the multi-scale large core attention MAB module and the large core tail attention LKAT module; Step S2: construct the MViT-k module, and construct the RMF multi-scale attention module based on the MABs attention module; Step S3: Add the RMF multi-scale attention module between the MV2 block and the 1×1 convolutional layer in the backbone network MobileViT to construct the MobileVit-RMF network; Step S4: obtaining a tensor of an image of the Chinese herbal medicine to be tested, inputting the tensor of the image of the Chinese herbal medicine to be tested into the MobileVit-RMF network for classification and recognition, and obtaining a classification result of the Chinese herbal medicine.
2. The Chinese herbal medicine classification and identification method based on image processing according to claim 1 is characterized in that: Step S1 specifically includes: The primary multi-scale large kernel attention MLKA module and the gated spatial attention GSAU unit are used to form a multi-scale large kernel attention MAB module; According to the requirements of the image feature extraction task, the multi-scale large core attention MAB module is stacked and residually connected with the large core tail attention LKAT module to form a MABs module.
3. The Chinese herbal medicine classification and identification method based on image processing according to claim 2 is characterized in that: The primary multi-scale large kernel attention MLKA module is: In the formula, G i (·) is a i ×a i The i-th gate generated by depthwise separable convolution, LKA i is the large kernel attention of the i-th group of image tensors to be tested, X i is the graphic feature of the i-th group of image tensors to be tested.
4. The Chinese herbal medicine classification and identification method based on image processing according to claim 1 is characterized in that: Step S4 specifically includes: Input the Chinese herbal medicine image tensor to be tested into the 3×3 standard convolutional layer in the MobileVit-RMF network for the first downsampling operation, and then input the Chinese herbal medicine image tensor after the first downsampling into the MV2 block for another downsampling operation; After the above operations are performed, the image tensor of the Chinese herbal medicine to be tested is input into the RMF multi-scale attention module for feature extraction, so as to obtain a multi-dimensional image tensor with global information of the image tensor of the Chinese herbal medicine to be tested; The multidimensional image tensor is subjected to channel compression through a 1×1 convolution, and then global average pooling, and finally the final Chinese herbal medicine classification result is obtained through a multivariate cross entropy loss function.
5. The Chinese herbal medicine classification and identification method based on image processing according to claim 4 is characterized in that: After the above operations are performed, the image tensor of the Chinese herbal medicine to be tested is input into the RMF multi-scale attention module for feature extraction, including: Performing a downsampling operation on the image tensor of the Chinese herbal medicine to be tested, extracting local information and obtaining local features; Then, the first MABs attention module is used to obtain the reconstructed features of the image tensor of the Chinese herbal medicine to be tested, and then the weight of the reconstructed features is determined by the large-core tail attention LKAT module; The weighted Chinese herbal medicine image tensor to be tested is input into the MViT-k module for global information extraction, and output to the second MABs attention module to obtain a multi-dimensional image tensor with global information of the Chinese herbal medicine image tensor to be tested.
6. The Chinese herbal medicine classification and identification method based on image processing according to claim 1 is characterized in that: Also includes: The MobileVit-RMF network is evaluated by preset evaluation indicators, and the MobileVit-RMF network is optimized according to the evaluation results. The preset evaluation indicators at least include precision, recall, F1 value and prediction accuracy.
7. The Chinese herbal medicine classification and identification method based on image processing according to claim 1 is characterized in that: In step S4, the image tensor of the Chinese herbal medicine to be tested is obtained, and the process also includes: The image data of the Chinese herbal medicine to be tested is acquired, and the image data is standardized to obtain a standardized image tensor of the Chinese herbal medicine to be tested.