Medical image classification method, system, terminal and storage medium
Through the adaptive lifting algorithm and the distillation loss of multiple knowledge forms, combined with the GCN idea, the problem of passive learning of the student model in the traditional knowledge distillation framework is solved, and the accuracy and learning efficiency of skin disease image classification are improved.
Patent Information
- Application Number
- CN202311545298.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-11-20
AI Technical Summary
In the traditional knowledge distillation framework, the student model passively learns in dermatology image classification, resulting in limited knowledge mining capabilities, and redundant information and pseudo-label interference in the teacher model lead to misleading classification learning.
The adaptive boosting algorithm (AdaBoost) is used to give the student model a perception of learning difficulties, and the teacher's knowledge is actively mined. Through the distillation loss based on three knowledge forms of logit, intermediate features and correlation, combined with the GCN idea, the teacher's node hop information is copied to the student model. , enhance its classification capabilities.
It improves the learning efficiency and accuracy of the student model in skin disease classification, enhances the perception of skin disease image features, and achieves more subtle perception and accuracy of classification difficulties.
Smart Images

Figure CN117475235B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a medical image classification method, system, terminal and storage medium. Background Art
[0002] Knowledge distillation, due to its powerful model compression capability, can transfer the knowledge in the "big" teacher model to the "small" student model, so that the developed skin disease classification and diagnosis model can be quickly deployed on lightweight mobile devices.
[0003] However, in the traditional knowledge distillation framework, the student model always "passively" imitates the knowledge in the teacher model, and this paradigm often leads to limited learning potential of students. In particular, when there is a huge knowledge gap between the teacher model and the student model based on skin disease image classification, the passive learning method often leads to limited ability of students to mine the teacher's knowledge; at the same time, the teacher model often contains redundant information on skin disease classification or "pseudo-label" interference information, and "copying" the teacher's knowledge often misleads students in skin disease classification learning. Summary of the invention
[0004] The present invention aims to at least improve one of the technical problems existing in the prior art. To this end, the present invention proposes a medical image classification method, system, terminal and storage medium.
[0005] The medical image classification method according to the first aspect of the present invention comprises:
[0006] Acquire sample data, collect skin disease image data as input, and process the skin disease image sample data to obtain an image sample data set;
[0007] Construct a knowledge distillation network model, which includes a teacher network model and a student network model. Both the teacher network model and the student network model include a backbone network and a classifier.
[0008] Training the knowledge distillation network model includes teacher network model pre-training and student network model training. The teacher network model pre-training includes two stages: In the first stage, complete the The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier To update the parameters; when training the student network model, we will have The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model is supervised by the pre-trained skin disease classification teacher model and the overall loss is calculated. ;
[0009] The output results of the network model are summarized and the classification results of skin disease images are output.
[0010] The medical image classification method according to the embodiment of the present invention is dedicated to allowing students to actively mine the required teacher information according to their own learning difficulties in skin disease classification. On the basis of giving higher weights to misclassified samples based on AdaBoost so as to perceive the difficulty of the learning process, AdaBoost is used to give students the ability to perceive the difficulty of skin disease classification, so that students can determine the "granularity" of mining teacher knowledge based on the current degree of difficulty in learning skin disease classification. The present invention actively mines the knowledge in the teacher according to the learning difficulties of the students at the current stage to carry out targeted knowledge transfer. At the same time, in order to effectively learn the feature representation of skin disease classification in the teacher, three forms of knowledge based on logit, based on intermediate features, and based on correlation are incorporated into the distillation loss. In addition, in order to fully explore the difficulties in the subsequent skin disease classification learning stage, the GCN idea is adopted. As the learning process proceeds, the current node is mined. The purpose is to allow students to perceive more subtle classification difficulties by mining multi-hop information between skin disease samples while maintaining the same neighbor relationship with the teacher.
[0011] In a possible implementation manner of the first aspect, building a knowledge distillation network model specifically includes:
[0012] Assume that both the teacher and student models contain stages, treating all stages contained in the model backbone network as an orderly learning process, constructing a base classifier for each stage. In order to estimate the prediction of each base classifier, we add intermediate auxiliary classifiers to each stage, with a total of Auxiliary classifiers, among which, To indicate the The auxiliary classifier of the stage, It consists of a convolutional layer, a global average pooling layer, and a fully connected layer.
[0013] In a possible implementation of the first aspect, when the teacher network model is pre-trained, the adaptive boosting algorithm (AdaBoost) learns different base classifiers in a sequential manner. The weight of the input skin disease samples of the base classifier is expressed as ,in Indicates the number of samples in the input batch. According to the theory of adaptive boosting algorithm, in the distillation process, To apply sample-level weights, this weight can effectively characterize which skin disease samples students have difficulty learning at this stage, and then calculate the weight of the base classifier according to the error rate of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final distillation loss based on the adaptive boosting algorithm.
[0014] It is worth mentioning that in both stages of pre-training of the teacher network model, we use the traditional cross entropy classification loss to train and update the parameters.
[0015] In a possible implementation of the first aspect, the overall loss Including task loss for ground truth label supervision in the student network model , Adaboost loss supervised by true labels and the sample-level weighted distillation loss between the student and the teacher , the formula is as follows:
[0016] ,
[0017] in: and is the balancing factor.
[0018] In a possible implementation of the first aspect, the cross entropy loss supervised by the true label is used as the task loss in the student model, and the goal is to make Able to fit one-hot label data, calculate the cross entropy between the final output and the true label to obtain the task loss .
[0019] In a possible implementation of the first aspect, in order to explore the learning difficulties of skin disease classification at various stages of students, AdaBoost trains the student model in a sequential manner. The predictions of auxiliary classifiers , No. The input sample weights of the base classifiers are expressed as , among which, The weights of the skin disease input samples for the base classifier All will be The base classifiers are updated and adjusted, and then The error rate of the base classifier is used to calculate the weight of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final true label supervised AdaBoost distillation loss. However, as the student skin disease classification learning process progresses, the difficulty of the subsequent learning stage becomes increasingly difficult to explore. In order to fully explore the learning difficulties between skin disease samples, the current node in the teacher The purpose is to make students better perceive the subtle difficulties of different stages of skin disease classification. Copy to the student model, where Represents the size of batchsize, then the student model The characteristics of the stage will be converted to The Adaboost loss for real label supervision is as follows,
[0020] ,
[0021] in, Representative skin disease input samples The real label, Representative stage, Represents the size of the input batch, The total number of all stages, Representative The weights of the base classifiers, Represents the student network model The auxiliary classifier of the stage is used to classify the samples predictions, , Representative A classifier network module with auxiliary classifiers, using right To weight, Representative Base classifier skin disease input samples The difficulty level of classification learning, the larger the value, the more difficult it is.
[0022] In a possible implementation of the first aspect, the sample-level weighted distillation loss is calculated When the first The weight of the skin disease input sample of the base classifier is expressed as According to this weight, we can model the student's The base classifiers are used to classify skin disease input samples The difficulty of classification learning, we can then apply sample-level weights to the distillation module. In order to effectively utilize the three forms of knowledge, the distillation loss will cover logits-based, intermediate feature-based, and correlation-based distillation losses, among which the logits-based distillation loss includes two forms:
[0023] The first is the loss of the last layer of the student model and the teacher model with temperature soft output , the skin disease input sample size takes a batch as an example, the formula is as follows,
[0024] ,
[0025] in, Represents temperature, which is set to 3 in this invention. Indicates the size of the input batch, Represents the temperature Next Student Network Model The auxiliary classifier of the stage is used to classify the samples predictions;
[0026] The second is the distillation loss with temperature soft output of the last layer of the auxiliary classifier corresponding to the student model and the teacher model. , the formula is as follows,
[0027] ,
[0028] in, Represents the temperature Next Teacher Network Model The auxiliary classifier of the stage is used to classify the samples predictions, Represents the temperature Next Student Network Model The auxiliary classifier of the stage is used to classify the samples predictions;
[0029] In order to effectively mine the features contained in the middle layer of the teacher model backbone network Based on the skin disease classification representation information in the paper, this application constructs a distillation loss based on intermediate features in the form of attention transfer. , the formula is as follows,
[0030] ,
[0031] in, represents the loss based on attention transfer, Represents the teacher network model for the sample No. The intermediate characteristics of the stages, Representative student network model pair sample No. The intermediate characteristics of the stages;
[0032] The above two distillation losses only focus on individual knowledge distillation. In order to explore the relationship between different individuals in skin disease images, we designed a distillation loss based on correlation. We first obtain the Logits features of skin disease samples and construct correlation matrix , similarly, for each auxiliary classifier in the student model The logits features of skin disease samples are used to construct a correlation matrix , the correlation-based distillation loss is obtained by calculating the MSE loss between the correlation matrices of the student and teacher models , the formula is as follows,
[0033] ,
[0034] in, Representing the teacher network model The correlation matrix of each stage is Represents the student network model The correlation matrix of each stage;
[0035] Calculate the weighted distillation loss for skin disease sample level weights , the formula is as follows:
[0036] ,
[0037] in, , , Both are balancing factors.
[0038] A medical image classification system according to an embodiment of the second aspect of the present invention comprises:
[0039] A data acquisition module is used to acquire sample data, collect skin disease image data as input, and process the skin disease image sample data to obtain an image sample data set;
[0040] A construction module is used to construct a knowledge distillation network model. The knowledge distillation network model includes a teacher network model and a student network model. Both the teacher network model and the student network model include a backbone network and a classifier.
[0041] The training module is used to train the knowledge distillation network model. When training the knowledge distillation network model, it includes teacher network model pre-training and student network model training. The teacher network model pre-training includes two stages: in the first stage, the training with The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier To update the parameters; when training the student network model, we will have The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model learns under the supervision of the pre-trained skin disease classification teacher model and calculates the overall loss. ;
[0042] The output module is used to summarize the output results of the network model and output the skin disease image classification results.
[0043] A terminal according to an embodiment of a third aspect of the present invention, wherein the terminal comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions for implementing the above-mentioned medical image classification method;
[0044] The processor is configured to execute the program instructions stored in the memory to control medical image classification.
[0045] A storage medium according to an embodiment of the fourth aspect of the present invention stores program instructions executable by a processor, wherein the program instructions are used to execute the above-mentioned medical image classification method.
[0046] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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.
[0048] Figure 1 is a flow chart of a medical image classification method according to an embodiment of the present invention;
[0049] Figure 2 is a knowledge distillation network model framework diagram of a medical image classification method according to an embodiment of the present invention;
[0050] Figure 3 3 is a schematic diagram of two-stage training of a teacher model in a knowledge distillation network model of a medical image classification method according to an embodiment of the present invention.
[0051] Figure 4 is a schematic diagram of a medical image classification system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element at the same time.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0055] The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or optionally, steps or units not listed are included, or optionally, other steps or units inherent to these processes, methods, products or devices are included.
[0056] Only the part relevant to the present application is shown in the accompanying drawings, but not all of the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the process can be terminated, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0057] The terms "component", "module", "system", "unit", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate through local and / or remote processes, for example, based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).
[0058] Example 1
[0059] The medical image classification method of the first aspect of the present invention comprises:
[0060] Step S100, acquiring sample data, collecting skin disease image data as input, and processing the skin disease image sample data to obtain an image sample data set;
[0061] Step S200, constructing a knowledge distillation network model, the knowledge distillation network model includes a teacher network model and a student network model, and both the teacher network model and the student network model include a backbone network and a classifier;
[0062] Step S300, training the knowledge distillation network model, when training the knowledge distillation network model, includes teacher network model pre-training and student network model training, wherein the teacher network model pre-training includes two stages: in the first stage, complete the The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier Update the parameters; when training the student network model, The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model is supervised by the pre-trained skin disease classification teacher model and the overall loss is calculated. ;
[0063] Step S400, summarizing the output results of the network model and outputting the skin disease image classification results.
[0064] The medical image classification method according to the embodiment of the present invention is dedicated to allowing students to actively mine the required teacher information according to their own learning difficulties in skin disease classification. On the basis of giving higher weights to misclassified samples based on AdaBoost so as to perceive the difficulty of the learning process, AdaBoost is used to give students the ability to perceive the difficulty of skin disease classification, so that students can determine the "granularity" of mining teacher knowledge based on the current degree of difficulty in learning skin disease classification. The present invention actively mines the knowledge in the teacher according to the learning difficulties of the students at the current stage to carry out targeted knowledge transfer. At the same time, in order to effectively learn the feature representation of skin disease classification in the teacher, three forms of knowledge based on logit, based on intermediate features, and based on correlation are incorporated into the distillation loss. In addition, in order to fully explore the difficulties in the subsequent skin disease classification learning stage, the GCN idea is adopted. As the learning process proceeds, the current node is mined. The purpose is to allow students to perceive more subtle classification difficulties by mining multi-hop information between skin disease samples while maintaining the same neighbor relationship with the teacher.
[0065] It should be noted that the construction of the knowledge distillation network model specifically includes:
[0066] Assume that both the teacher and student models contain stages, treating all stages contained in the model backbone network as an orderly learning process, constructing a base classifier for each stage. In order to estimate the prediction of each base classifier, we add intermediate auxiliary classifiers to each stage, with a total of Auxiliary classifiers, among which, To indicate the The auxiliary classifier of the stage, It consists of a convolutional layer, a global average pooling layer, and a fully connected layer.
[0067] It should be noted that when the teacher network model is pre-trained, the adaptive boosting algorithm learns different base classifiers in a sequential manner. The weight of the input skin disease samples of the base classifier is expressed as ,in Indicates the number of samples in the input batch. According to the theory of adaptive boosting algorithm, in the distillation process, To apply sample-level weights, which can effectively characterize which skin disease samples students have difficulty learning at this stage, and then according to the error rate of the base classifier To calculate the weight of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final distillation loss based on the adaptive boosting algorithm.
[0068] Specifically, the error rate The calculation formula is as follows:
[0069] ,
[0070] in, Representative skin disease input samples The true label of Represents the size of batchsize, classifier weight The calculation formula is as follows:
[0071] ,
[0072] in, Represents the number of categories, in order to ensure is positive, then the condition must be met Next, for the input sample The weights are updated to give the misclassified samples a higher weight. As the first The skin disease input sample weights of the base classifiers are performed in sequence. ,sample The initial weight .
[0073] Based on the above discussion, the present invention uses the AdaBoost idea to regard all stages in the student model as an orderly learning process, adding intermediate auxiliary classifiers to each stage. The weight of the input sample in each stage corresponds to the difficulty of learning skin disease classification at that stage. According to the learning difficulties of the students at that stage, the knowledge in the teacher is actively mined to carry out targeted knowledge transfer. Finally, the weights of each base classifier are linearly weighted to obtain the final distillation loss. At the same time, in order to effectively learn the skin disease classification feature representation in the teacher, three knowledge forms based on logit, based on intermediate features, and based on correlation are incorporated into the distillation loss.
[0074] It is worth mentioning that in both stages of pre-training of the teacher network model, we use the traditional cross entropy classification loss to train and update the parameters.
[0075] It should be noted that the overall loss Including task loss for ground truth label supervision in the student network model , Adaboost loss supervised by true labels and the sample-level weighted distillation loss between the student and the teacher , the formula is as follows:
[0076] ,
[0077] in: and is the balancing factor.
[0078] Specifically, the cross entropy loss supervised by the true label is used as the task loss in the student model, and the goal is to make Able to fit one-hot label data, calculate the cross entropy between the final output and the true label to obtain the task loss .
[0079] Specifically, in order to explore the learning difficulties of skin disease classification at each stage of students, AdaBoost trains the student model in a sequential manner The predictions of auxiliary classifiers , No. The input sample weights of the base classifiers are expressed as , among which, The weights of the skin disease input samples for the base classifier All will be The base classifiers are updated and adjusted, and then The error rate of the base classifier is used to calculate the weight of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final true label supervised AdaBoost distillation loss. However, as the student skin disease classification learning process progresses, the difficulty of the subsequent learning stage becomes increasingly difficult to explore. In order to fully explore the learning difficulties between skin disease samples, the current node in the teacher The purpose is to make students better perceive the subtle difficulties of different stages of skin disease classification. Copy to the student model, where Represents the size of batchsize, then the student model The characteristics of the stage will be converted to The Adaboost loss for real label supervision is as follows,
[0080] ,
[0081] in, Representative skin disease input samples The real label, Representative stage, Represents the size of the input batch, represents the total number of all stages, Representative The weights of the base classifiers, Represents the student network model The auxiliary classifier of the stage is used to classify the samples predictions, , Representative A classifier network module with auxiliary classifiers, using right To weight, Representative Base classifier skin disease input samples The difficulty level of classification learning, the larger the value, the more difficult it is.
[0082] Specifically, the sample-level weighted distillation loss is calculated When the first The weight of the skin disease input sample of the base classifier is expressed as According to this weight, we can model the student's The base classifiers are used to classify skin disease input samples The difficulty of classification learning, we can then apply sample-level weights to the distillation module. In order to effectively utilize the three forms of knowledge, the distillation loss will cover logits-based, intermediate feature-based, and correlation-based distillation losses, among which the logits-based distillation loss includes two forms:
[0083] The first is the loss of the last layer of the student model and the teacher model with temperature soft output , the skin disease input sample size takes a batch as an example, the formula is as follows,
[0084] ,
[0085] in, Represents temperature, which is set to 3 in this invention. Indicates the size of the input batch, Represents the student model for the sample The last layer of prediction with temperature soft output;
[0086] The second is the distillation loss with temperature soft output of the last layer of the auxiliary classifier corresponding to the student model and the teacher model. , the formula is as follows,
[0087] ,
[0088] in, Represents the temperature Next Teacher Network Model The auxiliary classifier of the stage is used to classify the samples predictions, Represents the temperature Next Student Network Model The auxiliary classifier of the stage is used to classify the samples predictions;
[0089] In order to effectively mine the features contained in the middle layer of the teacher model backbone network Based on the skin disease classification representation information in the paper, this application constructs a distillation loss based on intermediate features in the form of attention transfer. , the formula is as follows,
[0090] ,
[0091] in, represents the loss based on attention transfer, Represents the teacher network model for the sample No. The intermediate characteristics of the stages, Representative student network model pair sample No. The intermediate characteristics of the stages;
[0092] The above two distillation losses only focus on individual knowledge distillation. In order to explore the relationship between different individuals in skin disease images, we designed a distillation loss based on correlation. We first obtain the Logits features of skin disease samples and construct correlation matrix , similarly, for each auxiliary classifier in the student model The logits features of skin disease samples are used to construct a correlation matrix , the correlation-based distillation loss is obtained by calculating the MSE loss between the correlation matrices of the student and teacher models , the formula is as follows,
[0093] ,
[0094] in, Representing the teacher network model The correlation matrix of each stage is Represents the student network model The correlation matrix of each stage;
[0095] Calculate the weighted distillation loss for skin disease sample level weights , the formula is as follows:
[0096] ,
[0097] in, , , Both are balancing factors.
[0098] This example conducts a large number of experiments on two benchmark skin disease image datasets, Dermnet and ISIC2019. The experimental and visualization results show that AdaKD can capture learning difficulties and achieve better visualization. t Distributed Random Neighborhood Embedding ( t -SNE) classification results. Here, this example reproduces all knowledge distillation frameworks, repeats the experiment 5 times for each distillation framework, takes the average value, and displays its standard deviation on all indicators. The best results are shown in bold, and the teacher model is obtained through pre-training. In order to make a fair comparison, all experimental results are obtained under the guidance of this teacher model. Specifically, the results on the Dermnet dataset are shown in Table 1, and the results on the ISIC2019 dataset are shown in Table 2:
[0099] Table 1. Comparison of Top-1 accuracy and Recall of various distillation frameworks when using different teacher-student backbones on the Dermnet dataset.
[0100]
[0101] Table 2. Comparison of Top-1 accuracy and recall of various distillation frameworks on the ISIC2019 dataset when using different teacher-student backbones.
[0102]
[0103] Wherein: Ours refers to the adaptive boosting knowledge distillation network model proposed in the present invention for classification of dermatological medical images.
[0104] Table 1 shows the comparison of Top-1 accuracy and recall of different distillation methods on the Dermnet dataset using different teacher-student backbones. The results show that the adaptive boosting knowledge distillation network model AdaKD proposed in this paper achieves excellent performance on all three different teacher-student network backbones. When the teacher is ResNet34 and the student is ResNet18, our framework is very close to the teacher model. Table 2 shows the comparison of Top-1 accuracy and recall of different distillation frameworks on the ISIC2019 dataset using various teacher-student backbones. It can be seen from Table 2 that our proposed adaptive boosting knowledge distillation network model AdaKD achieved excellent results in three different teacher-student backbones, thus verifying the effectiveness of our distillation framework.
[0105] Example 2
[0106] This embodiment provides a medical image classification system, which includes:
[0107] A data acquisition module is used to acquire sample data, collect skin disease image data as input, and process the skin disease image sample data to obtain an image sample data set;
[0108] A construction module is used to construct a knowledge distillation network model. The knowledge distillation network model includes a teacher network model and a student network model. Both the teacher network model and the student network model include a backbone network and a classifier.
[0109] The training module is used to train the knowledge distillation network model. When training the knowledge distillation network model, it includes teacher network model pre-training and student network model training. The teacher network model pre-training includes two stages: in the first stage, the training with The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier To update the parameters; when training the student network model, we will have The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model is supervised by the pre-trained skin disease classification teacher model and the overall loss is calculated. ;
[0110] The output module is used to summarize the output results of the network model and output the skin disease image classification results.
[0111] Example 3
[0112] This embodiment provides a terminal, wherein the terminal includes a processor and a memory coupled to the processor, wherein the memory stores program instructions for implementing the above-mentioned medical image classification method;
[0113] The processor is configured to execute the program instructions stored in the memory to control medical image classification.
[0114] Example 4
[0115] This embodiment provides a storage medium, in which program instructions executable by a processor are stored, and the program instructions are used to execute the above-mentioned medical image classification method.
[0116] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation to the invention.
[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0118] Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0119] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A medical image classification method, It is characterized in that include: Acquire sample data, collect skin disease image data as input, and process the skin disease image sample data to obtain an image sample data set; Construct a knowledge distillation network model, which includes a teacher network model and a student network model. Both the teacher network model and the student network model include a backbone network and a classifier. Training the knowledge distillation network model includes teacher network model pre-training and student network model training. The teacher network model pre-training includes two stages: in the first stage, complete the The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier Update parameters; When training the student network model, The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model learns under the supervision of the pre-trained skin disease classification teacher model and calculates the overall loss. , where the overall loss Including task loss for ground truth label supervision in the student network model , Adaboost loss supervised by true labels and the sample-level weighted distillation loss between the student and the teacher , the formula is as follows: , in: and As a balancing factor, the cross entropy loss supervised by the true label is used as the task loss in the student model. The goal is to make Able to fit one-hot label data, calculate the cross entropy between the final output and the true label to obtain the task loss , In order to explore the learning difficulties of skin disease classification at various stages of students, AdaBoost trains the student model in a sequential manner The predictions of auxiliary classifiers , No. The input sample weights of the base classifiers are expressed as , among which, The weights of the skin disease input samples for the base classifier All will be The base classifiers are updated and adjusted, and then The error rate of the base classifier is used to calculate the weight of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final true label supervised AdaBoost distillation loss and the true label supervised Adaboost loss As shown below, , in, Representative skin disease input samples The real label, Representative stage, Represents the size of the input batch, represents the total number of all stages, Representative The weights of the base classifiers, Represents the student network model The auxiliary classifier of the stage is used to classify the samples predictions, , Representative A classifier network module with auxiliary classifiers, using right To weight, Representative Base classifier skin disease input samples The difficulty level of classification learning, the larger the value, the more difficult it is; The output results of the network model are summarized and the classification results of skin disease images are output.
2. The medical image classification method according to claim 1, It is characterized in that When building a knowledge distillation network model, it specifically includes: Assume that both the teacher and student models contain stages, treating all stages contained in the model backbone network as an orderly learning process, constructing a base classifier for each stage. In order to estimate the prediction of each base classifier, we add intermediate auxiliary classifiers to each stage, with a total of Auxiliary classifiers, among which, To express the The auxiliary classifier of the stage, It consists of a convolutional layer, a global average pooling layer, and a fully connected layer.
3. The medical image classification method according to claim 1, It is characterized in that When the teacher network model is pre-trained, the adaptive boosting algorithm learns different base classifiers in a sequential manner. The weight of the input skin disease samples of the base classifier is expressed as ,in Indicates the number of samples in the input batch. According to the theory of adaptive boosting algorithm, in the distillation process, To apply sample-level weights, this weight can effectively characterize which skin disease samples students have difficulty learning at this stage, and then calculate the weight of the base classifier according to the error rate of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final distillation loss based on the adaptive boosting algorithm.
4. The medical image classification method according to claim 1, It is characterized in that Compute sample-level weighted distillation loss When the first The weight of the skin disease input sample of the base classifier is expressed as According to this weight, we can model the student's The base classifiers are used to classify skin disease input samples The difficulty of classification learning is determined by applying sample-level weights to the distillation module, where the logits-based distillation loss includes two forms: The first is the loss of the last layer of the student model and the teacher model with temperature soft output , the skin disease input sample size takes a batch as the input unit, and the formula is as follows: , in, represents temperature, Indicates the size of the input batch, Represents the temperature The student network model is a sample The last layer has a temperature soft output; The second is the distillation loss with temperature soft output of the last layer of the auxiliary classifier corresponding to the student model and the teacher model. , the formula is as follows, , in, Represents the temperature Next Teacher Network Model The auxiliary classifier of the stage is used to classify the samples predictions, Represents the temperature Next Student Network Model The auxiliary classifier of the stage is used to classify the samples predictions; In order to effectively mine the features contained in the middle layer of the teacher model backbone network The skin disease classification representation information in the image is used to construct a distillation loss based on intermediate features through attention migration. , the formula is as follows, , in, represents the loss based on attention transfer, Represents the teacher network model for the sample No. The intermediate characteristics of the stages, Representative student network model pair sample No. The intermediate characteristics of the stages; The above two distillation losses only focus on individual knowledge distillation. In order to explore the relationship between different individuals in skin disease images, a correlation-based distillation loss is designed. First, the teacher model is obtained in each auxiliary classifier. Response characteristics of skin disease samples and construct a correlation matrix , similarly, for each auxiliary classifier in the student model The logits features of skin disease samples are used to construct a correlation matrix , the correlation-based distillation loss is obtained by calculating the mean squared error (MSE) loss between the correlation matrices of the student and teacher models , the formula is as follows, , in, Represents the teacher network model The correlation matrix of each stage is Represents the student network model The correlation matrix of each stage; Calculate the weighted distillation loss for skin disease sample level weights , the formula is as follows: , in, , , Both are balancing factors.
5. A medical image classification system, It is characterized in that include: A data acquisition module is used to acquire sample data, collect skin disease image data as input, and process the skin disease image sample data to obtain an image sample data set; A construction module is used to construct a knowledge distillation network model. The knowledge distillation network model includes a teacher network model and a student network model. Both the teacher network model and the student network model include a backbone network and a classifier. The training module is used to train the knowledge distillation network model. When training the knowledge distillation network model, it includes teacher network model pre-training and student network model training. The teacher network model pre-training includes two stages: in the first stage, the training with The teacher model is trained in stages, and finally the trained backbone network is obtained. ; Freeze the backbone network in the second phase The weight of the auxiliary classifier Update parameters; When training the student network model, The backbone network of the student model for skin disease classification with stages is represented as , where the auxiliary classifier is represented as ,That Representative student model The student network model is supervised by the pre-trained skin disease classification teacher model and the overall loss is calculated. , where the overall loss Including task loss for ground truth label supervision in the student network model , Adaboost loss supervised by true labels and the sample-level weighted distillation loss between the student and the teacher , the formula is as follows: , in: and As a balancing factor, the cross entropy loss supervised by the true label is used as the task loss in the student model. The goal is to make Able to fit one-hot label data, calculate the cross entropy between the final output and the true label to obtain the task loss , In order to explore the learning difficulties of skin disease classification at various stages of students, AdaBoost trains the student model in a sequential manner The predictions of auxiliary classifiers , No. The input sample weights of the base classifiers are expressed as , among which, The weights of the skin disease input samples for the base classifier All will be The base classifiers are updated and adjusted, and then The error rate of the base classifier is used to calculate the weight of the base classifier , and finally according to the weights of each base classifier Linear weighting is performed to obtain the final true label supervised AdaBoost distillation loss and the true label supervised Adaboost loss As shown below, , in, Representative skin disease input samples The real label, Representative stage, Represents the size of the input batch, represents the total number of all stages, Representative The weights of the base classifiers, Represents the student network model The auxiliary classifier of the stage is used to classify the samples predictions, , Representative A classifier network module with auxiliary classifiers, using right To weight, Representative Base classifier skin disease input samples The difficulty level of classification learning, the larger the value, the more difficult it is; The output module is used to summarize the output results of the network model and output the skin disease image classification results.
6. A terminal, It is characterized in that The terminal comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions for implementing the medical image classification method according to any one of claims 1 to 4; The processor is configured to execute the program instructions stored in the memory to control medical image classification.
7. A storage medium, It is characterized in that Program instructions executable by a processor are stored, and the program instructions are used to execute the medical image classification method according to any one of claims 1 to 4.
