A training method, identification method, system and device of a traditional Chinese medicine classification model
By preprocessing and extracting features from the image dataset of Chinese herbal medicines, and optimizing the classification model of Chinese herbal medicines, the problems of large data volume and high computing resources in the existing technology are solved, and efficient and high-accuracy identification of Chinese herbal medicines is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA NORMAL UNIV
- Filing Date
- 2023-11-03
- Publication Date
- 2026-07-24
AI Technical Summary
Existing methods for identifying Chinese herbal medicines require a large amount of training data and high computational resources, resulting in high model complexity and low accuracy in classifying rare categories of Chinese herbal medicines.
By preprocessing, feature extraction, and channel extraction of the image dataset, the data volume and computational resource requirements are reduced. Feature stacking and channel splitting methods are used to optimize the classification model of traditional Chinese medicine and improve classification accuracy.
It effectively reduces the amount of data and computing resources required for model training, and improves the accuracy of Chinese herbal medicine classification, especially the accuracy of identifying rare categories.
Smart Images

Figure CN117689973B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a training method, recognition method, system, and device for a classification model of traditional Chinese medicine. Background Technology
[0002] Traditional Chinese medicine (TCM) herbs, as a part of traditional medicine, hold an important position in the field of TCM. Accurate identification and classification of TCM herbs are crucial for ensuring the quality of medicinal materials, researching the efficacy of TCM herbs, and exploring new drugs. However, due to the large variety of TCM herbs, each with its unique morphological characteristics, and the influence of factors such as growth environment and processing methods, the morphological characteristics of the same type of TCM herb can vary considerably.
[0003] Currently, traditional methods for identifying Chinese herbal medicines mainly rely on training complex deep learning models with large amounts of labeled data. This approach requires a large amount of training data, resulting in highly complex models and significant computational resources. Furthermore, in Chinese herbal medicine classification tasks, there is often a data imbalance between the number of samples for different types of herbs. Models trained using this method tend to overlook rare categories, leading to low accuracy in classifying uncommon herbs.
[0004] Therefore, the problems existing in the current technology still need to be solved and optimized. Summary of the Invention
[0005] The purpose of this invention is to at least partially solve one of the technical problems existing in the related art.
[0006] Therefore, the first objective of this invention is to provide a training method for a Chinese herbal medicine classification model. This training method can effectively reduce the amount of data and computing resources required for model training, reduce model complexity and model size, and effectively improve the model's classification accuracy for Chinese herbal medicines.
[0007] The second objective of this application is to provide a method for identifying a classification model of traditional Chinese medicine.
[0008] The third objective of this application is to provide a training system for a classification model of traditional Chinese medicine.
[0009] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of this application include:
[0010] Firstly, embodiments of this application provide a method for training a classification model of traditional Chinese medicine, including:
[0011] Obtain the original image dataset;
[0012] The image dataset is preprocessed to obtain a training image set;
[0013] The training image set is subjected to feature extraction processing to obtain a first dataset. The first dataset includes multiple first data, each of which includes a feature output result and a feature input patch corresponding to the feature output result.
[0014] The first dataset is subjected to channel extraction processing to obtain the second dataset, which is used to characterize the first dataset after integrating the feature importance of different channels;
[0015] The second dataset is updated to the training image set, and the step of performing feature extraction processing on the training image set to obtain the first dataset is repeated until the number of returns is greater than or equal to a preset first threshold.
[0016] Based on the second dataset, the parameters of the initialized Chinese herbal medicine classification model are updated to obtain a trained Chinese herbal medicine classification model.
[0017] In addition, the training method according to the above embodiments of this application may also have the following additional technical features:
[0018] Furthermore, in one embodiment of this application, the preprocessing of the image dataset to obtain the training image set includes:
[0019] The image dataset is subjected to scale unification processing to obtain a scaled image set;
[0020] The scaled image set is randomly flipped to obtain a flipped image set;
[0021] The flipped image set is subjected to a two-dimensional transformation to obtain the training image set.
[0022] Furthermore, in one embodiment of this application, the feature extraction process performed on the training image set to obtain a first dataset includes:
[0023] The training image set is subjected to a first linear processing to obtain a linear dataset, wherein the linear dataset is used to represent the set of feature input patches;
[0024] The linear dataset is subjected to feature stacking processing to obtain the first dataset.
[0025] Furthermore, in one embodiment of this application, the step of performing feature stacking processing on the linear dataset to obtain the first dataset includes:
[0026] Perform a first affine transformation on the linear dataset to obtain a first affine dataset;
[0027] Based on the linear dataset, the first affine dataset is integrated to obtain the first dataset.
[0028] Furthermore, in one embodiment of this application, the step of performing channel extraction processing on the first dataset to obtain the second dataset includes:
[0029] The first dataset is split into channels to obtain the first dataset after channel splitting.
[0030] The first dataset after channel splitting is subjected to global channel extraction processing to obtain the second dataset.
[0031] Furthermore, in one embodiment of this application, the step of performing global channel extraction processing on the first dataset after channel splitting to obtain the second dataset includes:
[0032] A second affine transformation is performed on the first dataset after the channel splitting to obtain a second affine dataset.
[0033] The second affine dataset is subjected to global normalization to obtain a global dataset, wherein the global dataset is used to characterize the feature importance of the corresponding channel;
[0034] The global dataset is processed by channel integration to obtain the second dataset.
[0035] Secondly, embodiments of this application provide a method for identifying a classification model of traditional Chinese medicine, including:
[0036] Acquire image data of the Chinese herbal medicines to be identified;
[0037] The image data of the Chinese herbal medicine to be identified is input into the Chinese herbal medicine classification model obtained by the training method of the Chinese herbal medicine classification model as described in any of the first aspects above, and a recognition result is obtained. Thirdly, embodiments of this application provide a training system for a Chinese herbal medicine classification model, comprising:
[0038] The acquisition module is used to acquire the raw image dataset;
[0039] The first processing module is used to preprocess the image dataset to obtain a training image set;
[0040] The second processing module is used to perform feature extraction processing on the training image set to obtain a first dataset. The first dataset includes multiple first data, and each first data includes a feature output result and a feature input patch corresponding to the feature output result.
[0041] The third processing module is used to perform channel extraction processing on the first dataset to obtain a second dataset, which is used to characterize the first dataset after integrating the feature importance of different channels.
[0042] The return module is used to update the second dataset to the training image set, return the step of performing feature extraction processing on the training image set to obtain the first dataset, until the number of returns is greater than or equal to a preset first threshold;
[0043] The update module is used to update the parameters of the initialized Chinese herbal medicine classification model based on the second dataset, so as to obtain the trained Chinese herbal medicine classification model.
[0044] Fourthly, embodiments of this application also provide a computer device, including:
[0045] At least one processor;
[0046] At least one memory for storing at least one program;
[0047] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0048] Fifthly, embodiments of this application also provide a computer-readable storage medium storing a processor-executable program, which, when executed by the processor, is used to implement the above-described method.
[0049] The advantages and beneficial effects of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application:
[0050] This application discloses a training method, recognition method, system, and device for a traditional Chinese medicine (TCM) classification model. The training method involves: acquiring an original image dataset; preprocessing the image dataset to obtain a training image set; performing feature extraction on the training image set to obtain a first dataset, which includes multiple first data sets, each containing a feature output result and a corresponding feature input patch; performing channel extraction on the first dataset to obtain a second dataset, which represents the first dataset after integrating the feature importance of different channels; updating the second dataset with the training image set, and repeating the step of performing feature extraction on the training image set to obtain the first dataset until the number of iterations is greater than or equal to a preset first threshold; and updating the parameters of the initialized TCM classification model based on the second dataset to obtain a trained TCM classification model. This training method effectively reduces the amount of data and computational resources required for model training, reduces model complexity and model size, and effectively improves the model's accuracy in classifying TCM. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of this application or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions in this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0052] Figure 1 A flowchart illustrating a training method for a classification model of traditional Chinese medicine provided in this application embodiment;
[0053] Figure 2 This is a schematic diagram of the structure of a training system for a classification model of traditional Chinese medicine provided in an embodiment of this application;
[0054] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0055] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0057] Currently, traditional methods for identifying Chinese herbal medicines mainly rely on training complex deep learning models with large amounts of labeled data. This approach requires a large amount of training data, resulting in highly complex models and significant computational resources. Furthermore, in Chinese herbal medicine classification tasks, there is often a data imbalance between the number of samples for different types of herbs. Models trained using this method tend to overlook rare categories, leading to low accuracy in classifying uncommon herbs.
[0058] In view of this, embodiments of the present invention provide a training method for a classification model of traditional Chinese medicine. This training method can effectively reduce the amount of data and computing resources required for model training, reduce model complexity and model size, and effectively improve the model's classification accuracy of traditional Chinese medicine.
[0059] Reference Figure 1 In this embodiment of the application, a method for training a classification model of traditional Chinese medicine includes:
[0060] Step 110: Obtain the original image dataset;
[0061] Step 120: Preprocess the image dataset to obtain a training image set;
[0062] Step 120, preprocessing the image dataset to obtain a training image set, includes:
[0063] Step 121: Perform scale unification processing on the image dataset to obtain a scaled image set;
[0064] Step 122: Randomly flip the scaled image set to obtain a flipped image set;
[0065] Step 123: Perform two-dimensional transformation processing on the flipped image set to obtain the training image set.
[0066] In this embodiment, the original image dataset can consist of various types of Chinese herbal medicine image data. For a specific image data in the image dataset, preprocessing can involve pixel adjustment of the image data, followed by cropping an image region of a certain size from the pixel-adjusted image data to form a scale image set. The specific image size can be set according to actual conditions, which will not be elaborated further here. Next, by randomly flipping each scale data in the scale image set horizontally, a flipped image set is obtained, thereby achieving data augmentation and increasing the diversity of training data. Specifically, random flipping can be performed by flipping the scale data in the horizontal or vertical direction with a certain probability. That is, a number between 0 and 1 can be randomly generated, and when the number is less than the preset flipping probability, the scale data is flipped. Finally, two-dimensional transformation processing can be performed by performing operations such as translation, rotation, and scaling on the image. Specifically, translation can be achieved by setting the number of pixels to translate the image in the horizontal and vertical directions. Rotation can be achieved by defining a rotation angle and a rotation center. Scaling can be achieved by setting a scaling factor to adjust the size of the image.
[0067] Step 130: Perform feature extraction processing on the training image set to obtain a first dataset. The first dataset includes multiple first data sets, and each first data set includes a feature output result and a feature input patch corresponding to the feature output result.
[0068] Step 130 involves performing feature extraction processing on the training image set to obtain a first dataset, including:
[0069] Step 131: Perform a first linear processing on the training image set to obtain a linear dataset, wherein the linear dataset is used to represent the set of feature input patches;
[0070] In this embodiment, each piece of first data in the first data can consist of a feature output result and a feature input patch. Specifically, the first linear processing is used to project the training data in the training image set into a high-dimensional feature space to introduce more feature dimensions, thereby enabling the Chinese herbal medicine classification model to better capture information in the data. For example, if the training image set includes N non-overlapping training images (training data), then a linear layer can be used to convert the N non-overlapping training images into a set of N... 2 The input is d-dimensional and is used as a feature input patch. All inputs constitute a linear dataset, where N and d are positive integers and their specific values can be set according to the actual situation.
[0071] Step 132: Perform feature stacking processing on the linear dataset to obtain the first dataset.
[0072] Step 132, performing feature stacking processing on the linear dataset to obtain the first dataset, includes:
[0073] Step 1321: Perform a first affine transformation on the linear dataset to obtain a first affine dataset;
[0074] Step 1322: Based on the linear dataset, integrate the first affine dataset to obtain the first dataset.
[0075] Understandably, feature stacking is used to extract features from various feature input patches in a linear dataset. The first affine transformation process can consist of affine and linear layers within a fully connected layer. Specifically, it can be a three-layer structure: the first layer is an affine layer, the second is a linear layer, and the third is an affine layer. The linear dataset can be input into this structure to complete the first affine transformation, resulting in the first affine dataset. Then, the first affine dataset is added to the input linear dataset to complete the integration process, yielding the first dataset. This integration process helps preserve information from the original input during information transfer, thus helping to overcome the gradient vanishing problem.
[0076] Step 140: Perform channel extraction processing on the first dataset to obtain a second dataset. The second dataset is used to characterize the first dataset after integrating the feature importance of different channels.
[0077] Step 140, performing channel extraction processing on the first dataset to obtain the second dataset, includes:
[0078] Step 141: Perform channel splitting on the first dataset to obtain the first dataset after channel splitting;
[0079] In this embodiment, the channel splitting process can be performed by dividing each first data point in the first dataset into multiple channel representations based on channels, thus obtaining the first dataset after channel splitting. Specifically, for a given first data point, each channel representation is a subset of that first data point, which has a lower dimensionality.
[0080] Step 142: Perform global channel extraction processing on the first dataset after channel splitting to obtain the second dataset.
[0081] Step 142 involves performing global channel extraction processing on the first dataset after channel splitting to obtain the second dataset, including:
[0082] Step 1421: Perform a second affine transformation on the first dataset after channel splitting to obtain a second affine dataset;
[0083] Step 1422: Perform global normalization on the second affine dataset to obtain a global dataset, wherein the global dataset is used to characterize the feature importance of the corresponding channel;
[0084] Step 1423: Perform channel integration processing on the global dataset to obtain the second dataset.
[0085] In this embodiment, global channel extraction processing is used to increase the contrast and selectivity of each channel representation in the first data. Specifically, an affine transformation can be applied to each channel representation to perform a linear transformation; then, based on the affine transformation, a nonlinear activation function is applied to introduce new nonlinear features, thereby achieving a second affine transformation processing, resulting in a second affine dataset; next, the importance of different channels is extracted by adding a global response normalization function, and then the second dataset is obtained through channel integration.
[0086] For example, the dimensions of a first dataset A can be represented as (M, C, H, W). After channel splitting, it can be split into C channel representations with dimensions (M, 1, H, W). An affine transformation is applied to each channel representation to obtain the output after the affine transformation. The output shape remains unchanged after the affine layer, still being (M, C, H, W). A non-linear activation function (GeLU) is applied to the result of the affine transformation to introduce non-linear features, retaining meaningful features and suppressing useless negative features, while maintaining the output shape. Subsequently, Global Response Normalization is introduced to extract the importance of different channels. Finally, a weighted summation of attention weights is used to integrate the feature representations of different channels. The shape of the integrated channel representation is still (N, C, H, W).
[0087] Step 150: Update the second dataset to the training image set, return to the step of performing feature extraction processing on the training image set to obtain the first dataset, until the number of returns is greater than or equal to the preset first threshold;
[0088] In this embodiment of the application, the preset first threshold can be set according to the actual situation. The first threshold is used as the termination condition for returning to step 130. The number of returns is used to characterize the number of times to return to step 130. When the number of returns is less than the first threshold, return to step 130. Otherwise, when the number of returns is greater than or equal to the first threshold, jump to step 160.
[0089] Step 160: Based on the second dataset, update the parameters of the initialized Chinese herbal medicine classification model to obtain the trained Chinese herbal medicine classification model.
[0090] In this embodiment, a second dataset can be predicted using an initialized traditional Chinese medicine (TCM) classification model, with the output of the TCM classification model serving as the prediction result. After obtaining the prediction result from the TCM classification model, the accuracy of the model's prediction can be evaluated based on the prediction result and the corresponding labels of the second dataset, thereby updating the model's parameters. Specifically, for machine learning models, the accuracy of the model's prediction result can be measured by a loss function. The loss function is defined on a single training data point and is used to measure the prediction error of that training data point. Specifically, the loss value of that training data point is determined by the label of that single training data point and the model's prediction result for that training data point. In actual training, a training dataset contains many training data points, so a cost function is generally used to measure the overall error of the training dataset. The cost function is defined on the entire training dataset and is used to calculate the average prediction error of all training data points, which can better measure the model's prediction performance. For general machine learning models, the aforementioned cost function, plus a regularization term to measure model complexity, can serve as the training objective function. Based on this objective function, the loss value of the entire training dataset can be calculated. There are many commonly used loss functions, such as 0-1 loss, squared loss, absolute loss, logarithmic loss, and cross-entropy loss, all of which can be used as loss functions for machine learning models. These will not be elaborated upon here. In this embodiment, any one of these loss functions can be selected to determine the training loss value, such as the cross-entropy loss function. Based on the training loss value, the backpropagation algorithm is used to update the model parameters. After several iterations, a well-trained Chinese herbal medicine classification model can be obtained. The specific number of iterations can be preset, or training can be considered complete when the accuracy requirement on the test set is met.
[0091] In addition, this application also proposes a method for identifying a classification model of traditional Chinese medicine, including:
[0092] Step 160: Obtain the image data of the Chinese herbal medicine to be identified;
[0093] Step 170: Input the image data of the Chinese herbal medicine to be identified into the Chinese herbal medicine classification model obtained by the training method of the Chinese herbal medicine classification model as described above, and obtain the recognition result.
[0094] Understandably, for image data about Chinese herbal medicines, the image data of the Chinese herbal medicine to be identified can be input into a trained Chinese herbal medicine classification model to obtain the recognition result of the Chinese herbal medicine classification model for the image data. This model can ensure the classification accuracy of common categories of Chinese herbal medicines, while also having high classification accuracy for rare categories of Chinese herbal medicines.
[0095] Reference Figure 2 This application also provides a training system for a classification model of traditional Chinese medicine, including:
[0096] Module 101 is used to acquire the original image dataset;
[0097] The first processing module 102 is used to preprocess the image dataset to obtain a training image set;
[0098] The second processing module 103 is used to perform feature extraction processing on the training image set to obtain a first dataset. The first dataset includes multiple first data, and each first data includes a feature output result and a feature input patch corresponding to the feature output result.
[0099] The third processing module 104 is used to perform channel extraction processing on the first dataset to obtain a second dataset, which is used to characterize the first dataset after integrating the feature importance of different channels.
[0100] Return module 105 is used to update the second dataset to the training image set, return the step of performing feature extraction processing on the training image set to obtain the first dataset, until the number of returns is greater than or equal to a preset first threshold;
[0101] The update module 106 is used to update the parameters of the initialized Chinese herbal medicine classification model based on the second dataset to obtain the trained Chinese herbal medicine classification model.
[0102] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0103] Reference Figure 3 This application also provides a computer device, including:
[0104] At least one processor 201;
[0105] At least one memory 202 is used to store at least one program;
[0106] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the method embodiment described above.
[0107] Similarly, it can be understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0108] This application also provides a computer-readable storage medium storing a program executable by a processor 201, which, when executed by the processor 201, is used to implement the above-described method embodiments.
[0109] Similarly, the content of the above method embodiments is applicable to the present computer-readable storage medium embodiments. The specific functions implemented by the present computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0110] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0111] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0112] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0114] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0115] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0116] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0117] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0118] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A training method for a classification model of traditional Chinese medicine, characterized in that, include: Obtain the original image dataset; The image dataset is preprocessed to obtain a training image set; The training image set is subjected to feature extraction processing to obtain a first dataset. The first dataset includes multiple first data, each of which includes a feature output result and a feature input patch corresponding to the feature output result. The first dataset is subjected to channel extraction processing to obtain the second dataset, which is used to characterize the first dataset after integrating the feature importance of different channels; The second dataset is updated to the training image set, and the step of performing feature extraction processing on the training image set to obtain the first dataset is repeated until the number of returns is greater than or equal to a preset first threshold. Based on the second dataset, the parameters of the initialized Chinese herbal medicine classification model are updated to obtain a trained Chinese herbal medicine classification model.
2. The training method according to claim 1, characterized in that, The preprocessing of the image dataset to obtain the training image set includes: The image dataset is subjected to scale unification processing to obtain a scaled image set; The scaled image set is randomly flipped to obtain a flipped image set; The flipped image set is subjected to a two-dimensional transformation to obtain the training image set.
3. The training method according to claim 1, characterized in that, The step of performing feature extraction processing on the training image set to obtain the first dataset includes: The training image set is subjected to a first linear processing to obtain a linear dataset, wherein the linear dataset is used to represent the set of feature input patches; The linear dataset is subjected to feature stacking processing to obtain the first dataset.
4. The training method according to claim 3, characterized in that, The step of performing feature stacking processing on the linear dataset to obtain the first dataset includes: The linear dataset is subjected to a first affine transformation to obtain a first affine dataset; Based on the linear dataset, the first affine dataset is integrated to obtain the first dataset.
5. The training method according to claim 1, characterized in that, The process of extracting channels from the first dataset to obtain the second dataset includes: The first dataset is split into channels to obtain the first dataset after channel splitting. The first dataset after channel splitting is subjected to global channel extraction processing to obtain the second dataset.
6. The training method according to claim 5, characterized in that, The process of performing global channel extraction on the first dataset after channel splitting to obtain the second dataset includes: A second affine transformation is performed on the first dataset after the channel splitting to obtain a second affine dataset. The second affine dataset is subjected to global normalization to obtain a global dataset, wherein the global dataset is used to characterize the feature importance of the corresponding channel; The global dataset is processed by channel integration to obtain the second dataset.
7. A method for identifying a classification model of traditional Chinese medicine, characterized in that, include: Acquire image data of the Chinese herbal medicines to be identified; The image data of the Chinese herbal medicine to be identified is input into the Chinese herbal medicine classification model obtained by the training method of the Chinese herbal medicine classification model as described in any one of claims 1-6, and the identification result is obtained.
8. A training system for a classification model of traditional Chinese medicine, characterized in that, include: The acquisition module is used to acquire the raw image dataset; The first processing module is used to preprocess the image dataset to obtain a training image set; The second processing module is used to perform feature extraction processing on the training image set to obtain a first dataset. The first dataset includes multiple first data, and each first data includes a feature output result and a feature input patch corresponding to the feature output result. The third processing module is used to perform channel extraction processing on the first dataset to obtain a second dataset, which is used to characterize the first dataset after integrating the feature importance of different channels. The return module is used to update the second dataset to the training image set, return the step of performing feature extraction processing on the training image set to obtain the first dataset, until the number of returns is greater than or equal to a preset first threshold; The update module is used to update the parameters of the initialized Chinese herbal medicine classification model based on the second dataset, so as to obtain the trained Chinese herbal medicine classification model.
9. A computer device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1-7.