Training classification models, data classification methods, devices, equipment, media and products
Through the dual-stream classification model, combined with supervised and unsupervised learning, the problem of medical image classification model's dependence on labeled data is solved, the model's classification performance and generalization ability are improved, and the accuracy of disease diagnosis is improved.
Patent Information
- Application Number
- CN202210336174.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-03-31
AI Technical Summary
In existing technologies, medical image classification models rely on large amounts of high-quality labeled data, resulting in insufficient generalization capabilities. Labeling noise limits the upper limit of model performance, and manual interpretation relies on the doctor's experience, making accuracy difficult to guarantee.
A classification model with a dual-stream structure is adopted, combining supervised and unsupervised contrastive learning. Classification prediction is performed through the first network branch and image features are extracted through the second network branch. The classification loss and contrast loss are used to update the model parameters, reducing dependence on annotation information and enhancing feature learning.
It has improved the performance of medical image classification models, especially in terms of similar feature differentiation and generalization capabilities, reducing the burden on doctors and improving the accuracy of disease diagnosis.
Smart Images

Figure CN114724007B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of artificial intelligence technology, in particular to deep learning and computer vision technology, and can be applied to medical image processing scenarios. Background Art
[0002] Self-supervised contrastive learning is a type of unsupervised learning that can learn from unlabeled data. With its development, self-supervised contrastive learning has achieved excellent results at the feature level. For example, in artificial intelligence data classification, self-supervised contrastive learning can be used to classify image data such as images, such as medical image data.
[0003] Supervised models require a large number of high-quality labeled samples to improve learning effectiveness. When data labeling is expensive, labeled samples are relatively few, and the quality of the labels is poor, supervised models often lack generalization capabilities, and the noise inherent in the labels limits the upper limit of supervised classification models. Summary of the Invention
[0004] The present disclosure provides a method for training a classification model, a data classification method, an apparatus, a device, a medium, and a product.
[0005] According to one aspect of the present disclosure, a method for training a classification model is provided, comprising: performing classification prediction on a first training image using a first network branch of the classification model, and determining a classification loss corresponding to the first training image based on the obtained classification prediction result; extracting first image features of the first training image and second image features of the second training image using a second network branch of the classification model; determining a contrast loss based on the first image features and the second image features; and updating parameters of the classification model based on the classification loss and the contrast loss to obtain a trained classification model.
[0006] According to another aspect of the present disclosure, a data classification method is provided, comprising:
[0007] Determine the data to be classified; input the data to be classified into a classification model to obtain the output result of the classification model; determine the classification result of the data to be classified based on the output result of the classification model; wherein the classification model includes a first network branch and a second network branch, and is pre-trained after parameter update based on classification loss and contrast loss; the first network branch is used to perform classification prediction on a first training image to obtain a classification prediction result of the first training image; the second network branch is used to extract a first image feature of the first training image and a second image feature of the second training image; wherein the classification loss is determined by the classification prediction result of the first training image, and the contrast loss is determined based on the first image feature and the second image feature.
[0008] According to another aspect of the present disclosure, a device for training a classification model is provided, including: a determination module for performing classification prediction on a first training image using a first network branch of the classification model, and determining a classification loss corresponding to the first training image based on the obtained classification prediction result, and determining a contrast loss based on first image features and second image features; an extraction module for extracting first image features of the first training image and second image features of the second training image using a second network branch of the classification model; and an update module for updating parameters of the classification model based on the classification loss and the contrast loss to obtain a trained classification model.
[0009] According to another aspect of the present disclosure, there is provided a data classification device, comprising:
[0010] A determination module is used to determine the data to be classified; a classification module is used to input the data to be classified into a classification model, obtain the output result of the classification model, and determine the classification result of the data to be classified based on the output result of the classification model; wherein the classification model includes a first network branch and a second network branch, and is pre-trained after parameter update based on classification loss and contrast loss; the first network branch is used to perform classification prediction on the first training image to obtain the classification prediction result of the first training image; the second network branch is used to extract the first image feature of the first training image and the second image feature of the second training image; wherein the classification loss is determined by the classification prediction result of the first training image, and the contrast loss is determined based on the first image feature and the second image feature.
[0011] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for training a classification model in the present disclosure.
[0012] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the data classification method of the present disclosure.
[0013] According to yet another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method for training a classification model in the present disclosure.
[0014] According to yet another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the data classification method of the present disclosure.
[0015] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method for training a classification model in the present disclosure when executed by a processor.
[0016] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the data classification method of the present disclosure when executed by a processor.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0019] Figure 1 is a flow chart of a method for training a classification model according to an exemplary embodiment of the present disclosure;
[0020] Figure 2 is a schematic diagram of a classification model structure according to an exemplary embodiment of the present disclosure;
[0021] Figure 3A schematic diagram showing the structure of a supervised classification model is shown;
[0022] Figure 4 A schematic diagram showing the structure of a classification model for unsupervised contrastive learning is shown;
[0023] Figure 5 This is a flow chart of a method for updating classification model parameters based on classification loss and contrast loss provided by the present disclosure;
[0024] Figure 6 1 is a flow chart of a method for determining a classification loss corresponding to a first training image based on a classification prediction result of a first network branch of a classification model according to the present disclosure;
[0025] Figure 7 is a flow chart of a method for respectively extracting first image features of a first training image and second image features of a second training image using the second network branch of the classification model according to the present disclosure;
[0026] Figure 8 This is a diagram showing the visualization of the output features of the backbone network of the supervised classifier on the diabetic retinopathy grading dataset;
[0027] Figure 9 shows the dataset details included in the diabetic retinopathy grading dataset;
[0028] Figure 10 Schematic diagram comparing the moving average curves of the training set loss values (loss) of the supervised classifier classification model structure and the dual-stream classification model structure in the present disclosure along the training process;
[0029] Figure 11 It is the moving average curve of the Kappa value in the validation set of the classification model structure of the supervised classifier and the classification model structure of the dual-stream structure in the present disclosure.
[0030] Figure 12 A schematic diagram showing the comparison of Kappa values of the supervised classifier classification model structure and the dual-stream classification model structure of the present disclosure on the test set;
[0031] Figure 13 is a flow chart of a data classification method according to an exemplary embodiment of the present disclosure;
[0032] Figure 14 is a block diagram of a device for training a classification model according to an exemplary embodiment of the present disclosure;
[0033] Figure 15 is a block diagram of a data classification device according to an exemplary embodiment of the present disclosure;
[0034] Figure 16 It is a block diagram of an electronic device used to implement the method for training a classification model or the data classification method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0036] Data classification is currently used in many fields. For example, it is used in the classification of medical images. Various types of medical images are widely used in clinical practice, providing an effective basis for disease diagnosis and playing a vital role in the development of healthcare. Current technology relies on manual interpretation by doctors, placing a significant burden on doctors due to the large amount of medical image data. Furthermore, interpretation of medical images relies heavily on their experience, and accuracy cannot be guaranteed.
[0037] In recent years, deep learning technology has been increasingly used in the field of medical image processing. By performing preliminary screening of medical images or assisting doctors in diagnosis, it has effectively reduced the burden on doctors and improved the accuracy of disease diagnosis. In the implementation of medical image diagnosis through deep learning, deep learning methods rely on a large amount of high-quality labeled data. Labeling medical image data is very time-consuming and costly. Because the pathogenesis of lesions shown in images is continuous, while the annotations are often discrete, and the lesions have diverse morphologies and are interconnected between different areas, it is difficult to accurately define the dividing line between the degree of disease progression. The boundaries between adjacent levels are difficult to distinguish, making it difficult to classify the severity of the disease.
[0038] With the development of artificial intelligence technology, AI model training is becoming increasingly necessary for various application scenarios. General supervised classification models require a large number of high-quality annotated samples. However, for medical images, supervised models often lack generalization capabilities, and the inherent noise in the annotations limits the upper limit of supervised classification models. With the development of self-supervised contrastive learning, contrastive learning at the feature level is becoming possible.
[0039] In view of this, an embodiment of the present disclosure provides a method for training a classification model, which effectively improves the performance of the classification model by combining unsupervised contrastive learning and supervised classification network structures.
[0040] Figure 1is a flow chart of a method for training a classification model according to an exemplary embodiment of the present disclosure, with reference to Figure 1 , the method includes the following steps.
[0041] In step S101, a first network branch of a classification model is used to perform classification prediction on a first training image, and based on the obtained classification prediction result, a classification loss corresponding to the first training image is determined.
[0042] In step S102, a second network branch of the classification model is used to extract first image features of the first training image, and second image features of the second training image.
[0043] In step S103 , the contrast loss is determined based on the first image feature and the second image feature.
[0044] In step S104, based on the classification loss and the contrast loss, the parameters of the classification model are updated to obtain a trained classification model.
[0045] In the disclosed embodiment, the classification loss of a training image is determined based on the first network branch of the classification model, and the contrastive loss corresponding to the training image is determined based on the second network branch of the classification model. The parameters of the initial classification model are then updated based on the classification loss and contrastive loss to obtain a trained classification model.
[0046] In the disclosed embodiments, data augmentation can be performed on a set of images used as training images, including a first training image and a second training image. Data augmentation can include operations such as blurring, rotation, translation, and shearing. It is understood that the first training image and the second training image are obtained by performing different data augmentations on the same training image, and the first training image and the second training image are derived from the same training image. The training images can be obtained using an existing image dataset or by collecting and constructing them as needed, which is not specifically limited in this embodiment.
[0047] For ease of description, the data augmentation used to obtain the first training image is referred to as first data augmentation. It is understood that the first training image is obtained by performing the first data augmentation on the training image. The data augmentation used to obtain the second training image is referred to as second data augmentation. It is understood that the second training image is obtained by performing the second data augmentation on the training image.
[0048] The first data enhancement and the second data enhancement can be understood as two different data enhancements that the training image undergoes.
[0049] In the embodiment of the present disclosure, different data enhancements are performed on the images in the image set to obtain a first training image and a second training image, which can enhance the diversity of the training images.
[0050] Figure 2 is a schematic diagram of a classification model structure according to an exemplary embodiment of the present disclosure, referring to Figure 2 The classification model in the embodiment of the present disclosure may be a dual-stream structure, that is, the classification model includes a first network branch and a second network branch. The first network branch and the second network branch in the embodiment of the present disclosure respectively include a backbone network module, which can be used to θ (x) indicates that the backbone network modules in the first network branch and the second network branch can have the same network structure but different network parameters. The first network branch can be a supervised classification model structure. The second network branch can be an unsupervised contrastive learning classification model structure.
[0051] in, Figure 3 A schematic diagram of a supervised classification model structure is shown. The supervised classification model requires a large amount of data and label information. Figure 3 The input image data shown (training images obtained by the supervised classification model structure) has been enhanced to increase the diversity of the image and has been trained through the backbone network f θ After the training data is trained on the dataset (x) and the classifier, the cross-entropy loss (CE) is calculated with the annotation information, and gradient backpropagation is performed to update the network weights. This structure relies on annotation information. If the annotation information is not of high quality, the classifier performance will be difficult to improve. The annotation information limits the performance of supervised learning.
[0052] in, Figure 4 A schematic diagram of the classification model structure of unsupervised contrastive learning is shown. In the classification model structure of unsupervised contrastive learning, the acquired training images are subjected to two different data enhancements ( Figure 4 The first data augmentation and the second data augmentation are schematically illustrated in FIG. ). The training images obtained after two different data augmentations are respectively passed through the respective backbone networks f θ (x), each connected to a projector (where a projector is sometimes also called a projection layer). Figure 4As shown in the figure, in the classification model structure of unsupervised contrastive learning, the backbone network module of the upper branch is connected to the predictor (wherein the predictor is sometimes also called the prediction layer) after the projector. The backbone network module of the lower branch calculates the contrast loss through the output features of the projector and the upper branch predictor. Gradient backpropagation is only performed in the upper branch, and the network weights of the lower branch are updated by exponential moving average (EMA) of the network parameters of the upper branch. Among them, the classification model structure of unsupervised contrastive learning does not require labeled information and can use a large amount of unlabeled data for training. Therefore, it is often used as a pre-training model. Models pre-trained in this way are often better than supervised pre-training models. They can bring the features of similar samples closer and push the features of dissimilar samples farther away. This is in the same direction as supervised training, with the advantage of not requiring labeled information.
[0053] An example of a classification model structure for unsupervised contrastive learning is the Momentum Contrast (MoCo) v3 architecture. Using the MoCo v3 architecture, different random transformations are performed on each original image to obtain two samples. Two samples from the same image form a positive sample pair, while two samples from different images form a negative sample pair. The same network is then used as an encoder to extract and encode features from each sample to obtain a feature representation. The model is then optimized to increase the similarity between positive sample pairs and decrease the similarity between negative sample pairs. This approach allows for the extraction of valuable and discriminative features from unsupervised samples.
[0054] See Figure 2As shown, the classification model structure with a dual-stream structure provided by the embodiment of the present disclosure combines a supervised classification model structure and an unsupervised contrastive learning classification model structure. In the first network branch, the first training image is obtained after first data augmentation is performed on the acquired training image. The first training image is connected to a classifier after passing through the backbone network module of the first network branch. By combining the output result of the classifier in the first network branch with the annotation information, a classification prediction of the first training image can be achieved to obtain a classification prediction result of the first training image. Based on the classification prediction result of the first training image, the classification loss corresponding to the first training image is determined, for example, by calculating the cross-entropy loss. The second network branch is a classification model structure for unsupervised contrastive learning. The second network branch can be used to extract feature information of the image itself, which will be referred to as image features in the following. For example, in the embodiment of the present disclosure, the second network branch includes two branches, an upper branch and a lower branch, which may be referred to as the first branch and the second branch hereinafter. The first branch includes a projector and a predictor. The second branch includes a projector. The first image features of the first training image and the second image features of the second training image can be extracted through different branches of the second network branch.
[0055] In the disclosed embodiment, a contrastive loss corresponding to the training images is determined by extracting first image features of the first training image and second image features of the second training image from different branches of the second network branch. The contrastive loss of the second network branch causes similar features to cluster and dissimilar features to separate from each other among the features extracted by the backbone network in the second network branch, thereby better learning similar features and distancing dissimilar features.
[0056] Embodiments of the present disclosure Figure 2 The dual-stream classification model architecture shown here simultaneously learns both annotation information and image features, eliminating the need to rely solely on annotation information for model training. For example, the unsupervised contrastive learning classification model architecture MoCov3 can be enhanced by adding a classification output head to implement classification. Furthermore, the contrastive loss head ensures that similar features are clustered and dissimilar features are separated by the features extracted by the backbone network. Recent research in contrastive learning has shown that backbone networks with this architecture perform best as pre-trained models after fine-tuning on downstream tasks.
[0057] In summary, according to the method for training a classification model provided by an embodiment of the present disclosure, a training image is obtained and a classification prediction is performed on the first training image using the first network branch of the classification model to obtain a classification prediction result. The classification loss corresponding to the first training image is determined based on the classification prediction result. The first image features of the first training image and the second image features of the second training image are extracted using the second network branch of the classification model. Based on the first image features and the second image features, the contrast loss corresponding to the training image is determined. The relationship between the image features can be directly compared, weakening the role of the label in the supervised classification model. The parameters of the classification model are updated based on the classification loss and the contrast loss to obtain a trained classification model.
[0058] The method for training a classification model in this embodiment updates the parameters of the classification model based on the classification loss and the contrast loss during the classification model training, thereby utilizing the image annotation information and learning the image features to effectively improve the classification performance of the trained classification model and improve the effect of image classification through the classification model.
[0059] In an exemplary embodiment of the present disclosure, the contrast loss corresponding to the training image is determined by a multi-classification version of the noise contrast estimation loss function. The contrast loss corresponding to the training image is calculated using the multi-classification version of the noise contrast estimation (Info Noise-contrastive estimation, Info NCE) loss function in contrastive learning. The Info NCE loss function uses a method of comparing positive samples with negative samples to better learn image features. That is, the difference between the classification prediction result of the first training image and the label corresponding vector annotated for the training image, i.e., the loss value, is calculated. Training the classification model based on the obtained loss value can more effectively optimize the training of the classification model.
[0060] The following embodiments of the present disclosure will separately describe the training process of the classification model structure with a dual-stream structure provided by the embodiments of the present disclosure.
[0061] Figure 5 This is a flow chart of a method for updating classification model parameters based on classification loss and contrast loss provided by the present disclosure, referring to Figure 5 , the method includes the following steps.
[0062] In step S501, the parameters of the first network branch are updated using back propagation based on the classification loss.
[0063] In step S502, based on the contrastive loss, back propagation is used to update the parameters of the first network branch.
[0064] In step S503, based on the updated parameters of the first network branch, the parameters of the second network branch are updated by momentum.
[0065] In the embodiment of the present disclosure, the classification model includes a first network branch and a second network branch. The first training image passes through the first network branch to obtain a classification prediction result of the first training image, and the classification loss is calculated based on the classification prediction result. The classification model extracts the first image features of the first training image and the second image features of the second training image through different branches of the second network branch to determine the contrast loss corresponding to the training image. Based on the classification loss, the parameters of the first network branch are updated using back propagation, and based on the contrast loss, the parameters of the first network branch are updated using back propagation. That is, the contrast loss obtained is used to update the parameters of the first network branch using the back propagation algorithm. The back propagation algorithm (BP) is a learning algorithm suitable for multi-layer neural networks. The BP algorithm is based on the gradient descent method, which minimizes the loss of the network and adjusts and updates the parameters of the first network branch through post-feedback.
[0066] In the disclosed embodiment, the parameters of the first network branch are used to momentum update the parameters of the second network branch, thereby obtaining a trained classification model. For example, the network weights of the second network branch are updated by exponential moving average (EMA) of the network parameters of the first network branch. By updating the parameters of the first network branch using the classification loss, the image annotation information can be utilized. By updating the parameters of the first network branch using the contrast loss, the features of similar samples can be brought closer and the features of dissimilar samples can be pushed away, so as to fully learn the image features and thus improve the classification performance of the trained classification model.
[0067] Figure 6 This is a flow chart of a method for determining the classification loss corresponding to the first training image based on the classification prediction result of the first network branch of the classification model disclosed in the present invention, with reference to Figure 6 , the method includes the following steps.
[0068] In step S601, a first training image is input into a classifier of a first network branch of a classification model to obtain a classification prediction result of the first training image.
[0069] In step S602 , a cross entropy classification loss corresponding to the first training image is determined based on the classification prediction result and the labeling information of the training image.
[0070] In an embodiment of the present disclosure, the classification model includes a first network branch. A first training image is classified and predicted by a backbone network module and a classifier of the first network branch to obtain a classification prediction result for the first training image. The classification prediction result is combined with the annotation information of the training image to calculate the classification loss, where the classification loss can be a cross-entropy loss. The cross-entropy describes the distance between two probability distributions. The smaller the cross-entropy, the closer the two are. The cross-entropy loss is used to determine the accuracy of each training session.
[0071] In the embodiment of the present disclosure, the classification loss function, that is, the cross entropy function, can be determined by the following formula:
[0072]
[0073] Among them, p q Indicates the probability that the model output corresponds to the annotation information after softmax transformation.
[0074] Figure 7 is a flow chart of a method for extracting first image features of a first training image and second image features of a second training image using the second network branch of the classification model according to the present disclosure, with reference to Figure 7 , the method includes the following steps.
[0075] In step S701, a first image feature of a first training image is extracted using a projector and a predictor of a first branch in a second network branch.
[0076] In step S702, a second image feature of a second training image is extracted using a projector of a second branch in a second network branch.
[0077] In the disclosed embodiment, the second network branch is an unsupervised contrastive learning model. The second network branch includes two branches, a first branch and a second branch. The first image features of the first training image and the second image features of the second training image are extracted through the first branch and the second branch of the second network branch, respectively. The first training image and the second training image are obtained by performing different data augmentations on the same training image. The first branch of the second network branch includes a backbone network, a projector, and a predictor, and the second branch includes a backbone network and a projector. That is, in the second network branch, the first training image passes through the backbone network in the first branch, is connected to the projector, and then is connected to the predictor, and the first image features are output; in the second branch of the second network branch, the second training image passes through the backbone network and is connected to the projector, and the second image features are output. The contrast loss between the first image features and the second image features is calculated. Based on the contrast loss, the parameters of the first branch are updated using backpropagation, and based on the parameters of the first branch, the parameters of the second branch are updated using momentum.
[0078] In an exemplary embodiment of the present disclosure, the contrast loss function can be determined by the following formula:
[0079]
[0080] Among them, for a training batch of K samples, the positive sample corresponding to sample q is k + , τ is the temperature coefficient, which is used to adjust the probability distribution of the output. It is adjusted according to the size of the training batch. The larger the batch, the smaller the τ value. q·k + Indicates the similarity between the input training image and its positive sample.
[0081] The classification loss function and the contrast loss function can be jointly expressed as:
[0082]
[0083] Among them, α is the weight used for weighted contrast loss and can be set according to actual training needs.
[0084] The method for training the classification model in this embodiment, through the structure of the second network branch, utilizes the comparative loss of the output features of the same image through different branches to update the network parameters, realizes direct comparison of the relationship between image features, improves the learning performance of the classification model, and thus improves the model accuracy.
[0085] The embodiments of the present disclosure will illustrate the effects that can be achieved by the classification model training process involved above in combination with actual applications.
[0086] The following embodiments of the present disclosure illustrate medical images as training images for the classification model training. For example, the present disclosure illustrates medical image data of diabetic retinopathy. Of course, in practical applications, this is not limited to medical image data, nor is it limited to medical image data of diabetic retinopathy; other data requiring classification / grading can also be used.
[0087] Figure 8 This is a diagram showing the visualization of the output features of the backbone network of the supervised classifier on the diabetic retinopathy grading dataset. Figure 8 As shown in the figure, the diabetic retinopathy grading dataset includes five levels: 0, 1, 2, 3, 4, and 5. Different color brightnesses represent different levels. Adjacent levels are mixed together, making them difficult to distinguish. This is due to the small differences between adjacent levels in the data and poor annotation quality. Adjacent levels have high similarity, and the disease itself is a continuous process, making the boundaries between consecutive levels difficult to distinguish.
[0088] In the embodiments of the present disclosure, a classification model structure based on a dual-stream structure can alleviate this problem to a certain extent. Figure 2 The loss function consists of two parts: one is the cross entropy loss function, which makes the classification model structure have a hierarchical function; the other is the contrast loss function, which does not require annotation information and can directly compare image features, learn similar features and distinguish dissimilar features. The following is explained with experimental data.
[0089] in, Figure 9 Shows the details of the dataset included in the diabetic retinopathy grading dataset. Figure 9 As shown, the dataset was captured by different camera types: camera types 1, 2, 3, 4, and 5. It also includes five levels: 0, 1, 2, 3, and 4. Level 0 indicates a negative result, while levels 1 to 4 indicate the severity of the lesion.
[0090] In one example, on a data subset of images taken by a camera of camera type 1, a supervised classifier with a cross-entropy loss was compared with the results of the network of this patent. The backbone networks were all Resnet50, the data enhancement and hyperparameter settings were the same, the learning rate was 0.001, the number of training times was 500, and the stochastic gradient descent optimizer was used for 40,000 iterative training times. Among them, for the classification model structure of the supervised classifier, the Kappa value corresponding to the cross-entropy loss finally calculated on the test set was 78.24. The Kappa value of the classification model structure using the dual-stream structure in the present disclosure was 80.01, which was 1.77% higher than the classification model structure of the supervised classifier. Among them, the larger the Kappa value, the better the classification performance, that is, the classification model structure using the dual-stream structure in the present disclosure has higher classification performance.
[0091] Further test results such as Figure 10 and Figure 11 shown. Figure 10 Schematic diagram comparing the moving average curves of the training set loss value (loss) of the supervised classifier classification model structure and the dual-stream structure classification model structure in the present disclosure along the training process. Figure 11 The moving average curve of the Kappa value in the validation set of the supervised classifier classification model structure and the dual-stream structure classification model structure in this disclosure. Figure 10 , it can be found that at the beginning of the classification model structure training, the classification model structure of the dual-stream structure in the present disclosure has a higher loss value. As the training progresses, the loss value of the classification model structure of the dual-stream structure in the present disclosure decreases rapidly, and eventually becomes lower than the classification model structure of the supervised classifier. Generally speaking, under the same conditions, the smaller the loss, the better the convergence effect of the training set. Combined with Figure 11The loss of the classification model structure of the dual-stream structure in the present disclosure has a smaller loss value in the later stage of training, but the validation set index is better, indicating that the classification model structure of the dual-stream structure in the present disclosure has better generalization performance than the classification model structure of the supervised classifier.
[0092] Based on the above example, the weights of the cross entropy loss and the contrast loss of the classification model structure of the dual-stream structure in the present disclosure are 1:1. In this case, the final loss converges less than the classification model structure of the supervised classifier. The classification model structure of the dual-stream structure in the present disclosure learns features under two types of losses at the same time, and these two losses do not conflict. The classification model structure of the dual-stream structure in the present disclosure has both the labeling information and the contrast information of the features themselves. The final effect of applying the classification model training method provided by the present disclosure is better than the classification model structure of the supervised classifier, which also shows that the contrast loss is beneficial to correcting the original labeling information by learning the similarities between different samples.
[0093] In another example, the training set and validation set of images taken by 5 camera types are combined to train a model. Tests are performed on the test sets of the 5 cameras respectively. The classification model structure of the dual-stream structure in this disclosure is consistent with the configuration parameters of the supervised classifier classification model structure. The detailed parameter configuration is the same as in the above example. The test results are shown in Figure 2. Figure 12 shown. Figure 12 The Kappa values on the five camera test sets are shown. The larger the value, the better the classification effect. After the dataset is merged, the dataset becomes larger. The network classification performance of the supervised classifier classification model structure and the dual-stream classification model structure in this disclosure are significantly improved. This is consistent with the common sense that the larger the dataset, the better the generalization performance. Figure 10 It can be determined that the classification model structure using the dual-stream structure of the present disclosure achieves better results on each type of camera. The Kappa value increases by an average of 1.2%, further confirming the effectiveness of the classification model structure using the dual-stream structure of the present disclosure.
[0094] Based on the classification model provided by the embodiment of the present disclosure, the embodiment of the present disclosure also provides a data classification method.
[0095] Figure 13 This is a flow chart of a data classification method according to an exemplary embodiment of the present disclosure. Figure 13 As shown, the following steps are included:
[0096] In step S1301 , data to be classified is determined.
[0097] In step S1302, the data to be classified is input into the classification model to obtain the output result of the classification model.
[0098] In the embodiment of the present disclosure, the classification model is a classification model structure with a dual-stream structure.
[0099] In step S1303 , the classification result of the data to be classified is determined based on the output result of the classification model.
[0100] The data classification method provided by the embodiment of the present disclosure applies a dual-stream classification model structure to perform data classification. Since the image annotation information and image features are learned, the effect of image classification through the classification model can be improved.
[0101] Among them, the training method of the classification model structure with a dual-stream structure involved in the embodiments of the present disclosure can be pre-trained using the training methods involved in the above embodiments of the present disclosure. It will not be described in detail here. Please refer to the relevant description of the above embodiments for details.
[0102] For example, the classification model with a dual-stream structure involved in the embodiments of the present disclosure includes a first network branch and a second network branch, which are pre-trained after parameter updates based on classification loss and contrastive loss. The first network branch is used to perform classification prediction on a first training image to obtain a classification prediction result for the first training image; the second network branch is used to extract first image features from the first training image and second image features from the second training image. The classification loss is determined by the classification prediction result of the first training image, and the contrastive loss is determined based on the first image features and the second image features.
[0103] In the disclosed embodiment, the classification loss of a training image is determined based on the first network branch of the classification model, and the contrastive loss corresponding to the training image is determined based on the second network branch of the classification model. The parameters of the initial classification model are then updated based on the classification loss and contrastive loss to obtain a trained classification model.
[0104] In one embodiment, the classification prediction result of the first training image is obtained based on the classifier of the first network branch; the classification loss is the cross-entropy classification loss of the first training image, and the cross-entropy classification loss of the first training image is determined based on the classification prediction result of the first training image and the annotation information of the training image; the first training image is obtained by performing data enhancement on the training image.
[0105] In an embodiment of the present disclosure, the classification model includes a first network branch. A first training image is classified and predicted by a backbone network module and a classifier of the first network branch to obtain a classification prediction result for the first training image. The classification prediction result is combined with the annotation information of the training image to calculate the classification loss, where the classification loss can be a cross-entropy loss. The cross-entropy describes the distance between two probability distributions. The smaller the cross-entropy, the closer the two are. The cross-entropy loss is used to determine the accuracy of each training session.
[0106] In one embodiment, the first image feature of the first training image is extracted using the projector and predictor of the first branch in the second network branch; the second image feature of the second training image is extracted using the projector of the second branch in the second network branch.
[0107] In the disclosed embodiment, a contrastive loss corresponding to the training images is determined by extracting first image features of the first training image and second image features of the second training image from different branches of the second network branch. The contrastive loss of the second network branch causes similar features to cluster and dissimilar features to separate from each other among the features extracted by the backbone network in the second network branch, thereby better learning similar features and distancing dissimilar features.
[0108] In one exemplary embodiment of the present disclosure, the data to be classified can be medical imaging data. By applying the dual-stream classification model structure provided in this embodiment to classify medical imaging data, such as grading lesion severity, this can effectively improve classifier performance and alleviate the problem of poor quality medical image annotation. In a typical application scenario, diabetic retinopathy can be graded.
[0109] In combination with the above examples of the present disclosure, it can be seen that when the classification model structure with a dual-stream structure provided by the embodiments of the present disclosure is applied to grade diabetic retinopathy, the classification performance indicator Kappa value is significantly improved.
[0110] Based on the same concept, an embodiment of the present disclosure also provides a device for training a classification model.
[0111] It is understandable that the device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0112] Figure 14 FIG. 1 is a block diagram of a device for training a classification model according to an exemplary embodiment of the present disclosure. Figure 14 As shown, the device 1400 for training a classification model according to an embodiment of the present disclosure includes: a determination module 1401 , an extraction module 1402 , and an update module 1403 .
[0113] The determination module 1401 is used to use the first network branch of the classification model to perform classification prediction on the first training image, and determine the classification loss corresponding to the first training image based on the obtained classification prediction result, and determine the contrast loss based on the first image feature and the second image feature; the extraction module 1402 uses the second network branch of the classification model to extract the first image feature of the first training image and the second image feature of the second training image; the update module 1403 is used to update the parameters of the classification model based on the classification loss and the contrast loss to obtain a trained classification model.
[0114] Among them, the contrast loss corresponding to the training image is determined by the multi-classification version of the noise contrast estimation loss function.
[0115] The updating module 1403 updates the parameters of the classification model based on the classification loss and the contrast loss in the following manner:
[0116] Updating the parameters of the first network branch using backpropagation based on the classification loss and updating the parameters of the first network branch using backpropagation based on the contrastive loss;
[0117] Based on the updated parameters of the first network branch, the parameters of the second network branch are updated by momentum.
[0118] The determination module 1401 is configured to perform classification prediction on the first training image using the first network branch of the classification model in the following manner, and determine the classification loss corresponding to the first training image based on the obtained classification prediction result:
[0119] Inputting the first training image into the classifier of the first network branch of the classification model to obtain a classification prediction result for the first training image;
[0120] Based on the classification prediction result and the labeling information of the training image, a cross entropy classification loss corresponding to the first training image is determined.
[0121] Among them, the extraction module 1402 is used to extract the first image features of the first training image and the second image features of the second training image using the second network branch of the classification model in the following manner: using the projector and predictor of the first branch in the second network branch to extract the first image features of the first training image; using the projector of the second branch in the second network branch to extract the second image features of the second training image.
[0122] Figure 15 FIG. 1 is a block diagram of a data classification device according to an exemplary embodiment of the present disclosure. Figure 15 As shown, the data classification device 1500 of the embodiment of the present disclosure includes: a determination module 1501 and a classification module 1502.
[0123] The determination module 1501 is used to determine the data to be classified; the classification module 1502 is used to input the data to be classified into the classification model, obtain the output result of the classification model, and determine the classification result of the data to be classified based on the output result of the classification model.
[0124] Among them, the classification model has a classification model structure with a dual-stream structure.
[0125] The dual-stream classification model involved in the embodiments of the present disclosure includes a first network branch and a second network branch, which are pre-trained after parameter updates based on classification loss and contrastive loss. The first network branch is used to perform classification prediction on a first training image to obtain a classification prediction result for the first training image; the second network branch is used to extract first image features from the first training image and second image features from the second training image. The classification loss is determined by the classification prediction result of the first training image, and the contrastive loss is determined based on the first and second image features.
[0126] In one embodiment, the classification prediction result of the first training image is obtained based on the classifier of the first network branch; the classification loss is the cross-entropy classification loss of the first training image, and the cross-entropy classification loss of the first training image is determined based on the classification prediction result of the first training image and the annotation information of the training image; the first training image is obtained by performing data enhancement on the training image.
[0127] In one embodiment, the first image feature of the first training image is extracted using the projector and predictor of the first branch in the second network branch; the second image feature of the second training image is extracted using the projector of the second branch in the second network branch.
[0128] The training method of the classification model structure with a dual-stream structure involved in the embodiments of the present disclosure can be pre-trained using the training methods involved in the above embodiments of the present disclosure. It will not be described in detail here. Please refer to the relevant description of the above embodiments for details.
[0129] Among them, the data to be classified is medical imaging data.
[0130] Regarding the above-mentioned device involved in the present disclosure, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0131] In summary, according to the device for training a classification model provided by the embodiment of the present disclosure, a training image is obtained and a classification prediction is performed on the first training image using the first network branch of the classification model to obtain a classification prediction result. The classification loss corresponding to the first training image is determined based on the classification prediction result. The first image features of the first training image and the second image features of the second training image are extracted respectively using the second network branch of the classification model. The first training image is obtained by performing a first data enhancement on the training image, and the second training image is obtained by performing a second data enhancement on the training image. Based on the first image features and the second image features, the contrast loss corresponding to the training image is determined. The relationship between the image features can be directly compared, weakening the role of the label in the supervised classification model. Finally, the parameters of the classification model are updated based on the classification loss and the contrast loss to obtain a trained classification model. The method for training a classification model in this embodiment, by updating the parameters of the classification model based on the classification loss and the contrast loss during the classification model training, realizes the use of image annotation information and learning of image features, effectively improves the classification performance of the trained classification model, and improves the effect of image classification through the classification model.
[0132] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0133] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0134] Figure 16 A schematic block diagram of an example electronic device 1600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0135] like Figure 16As shown, device 1600 includes a computing unit 1601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1602 or a computer program loaded from a storage unit 1608 into a random access memory (RAM) 1603. Various programs and data required for the operation of device 1600 can also be stored in RAM 1603. Computing unit 1601, ROM 1602, and RAM 1603 are connected to each other via a bus 1604. An input / output (I / O) interface 1605 is also connected to bus 1604.
[0136] Various components in device 1600 are connected to I / O interface 1605, including an input unit 1606, such as a keyboard and mouse; an output unit 1607, such as various types of displays and speakers; a storage unit 1608, such as a magnetic disk and optical disk; and a communication unit 1609, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1609 allows device 1600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0137] The computing unit 1601 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1601 performs the various methods and processes described above, such as the method for training a classification model or the data classification method. For example, in some embodiments, the method for training a classification model or the data classification method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 1608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1600 via the ROM 1602 and / or the communication unit 1609. When the computer program is loaded into the RAM 1603 and executed by the computing unit 1601, one or more steps of the method for training a classification model or the data classification method described above can be performed. Alternatively, in other embodiments, the computing unit 1601 may be configured to execute the method for training a classification model or the data classification method in any other appropriate manner (eg, by means of firmware).
[0138] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0139] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0140] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0142] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0143] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0144] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0145] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for training a classification model, comprising: Performing classification prediction on the first training image using the first network branch of the classification model, and determining a classification loss corresponding to the first training image based on the obtained classification prediction result; extracting first image features of the first training image and second image features of the second training image using a second network branch of the classification model; determining a contrast loss based on the first image feature and the second image feature; Based on the classification loss and the contrast loss, updating the parameters of the classification model to obtain a trained classification model; The updating of the parameters of the classification model based on the classification loss and the contrast loss includes: updating parameters of the first network branch using backpropagation based on the classification loss, and updating parameters of the first network branch using backpropagation based on the contrastive loss; Based on the updated parameters of the first network branch, the parameters of the second network branch are updated by momentum; wherein the network weight of the second network branch is updated by performing an exponential moving average on the network parameters of the first network branch; The extracting the first image feature of the first training image and the extracting the second image feature of the second training image by using the second network branch of the classification model includes: extracting a first image feature of the first training image using the projector and the predictor of the first branch in the second network branch; extracting a second image feature of the second training image using a projector of a second branch in the second network branch; The parameters of the first branch are updated based on the contrast loss between the first image feature and the second image feature, and the parameters of the second branch are updated based on the parameters of the first branch.
2. The method according to claim 1, wherein The contrastive loss is determined by a multi-class version of the noise contrastive estimation loss function.
3. The method according to claim 1, wherein The using the first network branch of the classification model to perform classification prediction on the first training image, and determining the classification loss corresponding to the first training image based on the obtained classification prediction result, includes: Inputting the first training image into a classifier of a first network branch of a classification model to obtain a classification prediction result for the first training image; Based on the classification prediction result and the labeling information of the training image, a cross entropy classification loss corresponding to the first training image is determined.
4. The method according to any one of claims 1 to 3, wherein: The first training image and the second training image are obtained by performing different times of data enhancement on the training images.
5. A data classification method comprising: Determine the data to be classified; Inputting the data to be classified into a classification model to obtain an output result of the classification model; Determining a classification result of the data to be classified based on an output result of the classification model; The classification model includes a first network branch and a second network branch, and is pre-trained by updating the parameters of the first network branch using back propagation based on the classification loss and the parameters of the first network branch using back propagation based on the contrast loss, and updating the parameters of the second network branch using momentum based on the updated parameters of the first network branch; The first network branch is used to perform classification prediction on the first training image to obtain a classification prediction result of the first training image; The second network branch is used to extract a first image feature of the first training image and a second image feature of the second training image; The classification loss is determined by the classification prediction result of the first training image, and the contrast loss is determined based on the first image feature and the second image feature; the network weight of the second network branch is updated by performing an exponential moving average on the network parameters of the first network branch; wherein the first image feature of the first training image is extracted using the projector and predictor of the first branch in the second network branch; The second image feature of the second training image is extracted using the projector of the second branch in the second network branch; The parameters of the first branch are updated based on the contrast loss between the first image feature and the second image feature, and the parameters of the second branch are updated based on the parameters of the first branch.
6. The method according to claim 5, wherein: The classification prediction result of the first training image is obtained based on the classifier of the first network branch; The classification loss is a cross-entropy classification loss of the first training image, and the cross-entropy classification loss of the first training image is determined based on the classification prediction result of the first training image and the annotation information of the training image; The first training image is obtained by performing data enhancement on the training image.
7. The method according to claim 5, wherein: The data to be classified is medical imaging data.
8. A device for training a classification model, comprising: a determination module, configured to perform classification prediction on a first training image using a first network branch of a classification model, determine a classification loss corresponding to the first training image based on the obtained classification prediction result, and determine a contrast loss based on the first image feature and the second image feature; an extraction module that extracts a first image feature of the first training image and a second image feature of the second training image using the second network branch of the classification model; An updating module, configured to update the parameters of the classification model based on the classification loss and the contrast loss to obtain a trained classification model; The updating module updates the parameters of the classification model based on the classification loss and the contrast loss in the following manner: updating parameters of the first network branch using backpropagation based on the classification loss, and updating parameters of the first network branch using backpropagation based on the contrastive loss; Based on the updated parameters of the first network branch, the parameters of the second network branch are updated by momentum; wherein the network weight of the second network branch is updated by performing an exponential moving average on the network parameters of the first network branch; The extraction module is configured to extract the first image feature of the first training image and the second image feature of the second training image using the second network branch of the classification model in the following manner: extracting a first image feature of the first training image using the projector and the predictor of the first branch in the second network branch; extracting a second image feature of the second training image using a projector of a second branch in the second network branch; The parameters of the first branch are updated based on the contrast loss between the first image feature and the second image feature, and the parameters of the second branch are updated based on the parameters of the first branch.
9. The device according to claim 8, wherein The contrastive loss is determined by a multi-class version of the noise contrastive estimation loss function.
10. The device according to claim 8, wherein The determination module is configured to perform classification prediction on the first training image using the first network branch of the classification model in the following manner, and determine the classification loss corresponding to the first training image based on the obtained classification prediction result: Inputting the first training image into a classifier of a first network branch of a classification model to obtain a classification prediction result for the first training image; Based on the classification prediction result and the labeling information of the training image, a cross entropy classification loss corresponding to the first training image is determined.
11. A data classification device comprising: A determination module, used to determine the data to be classified; A classification module, configured to input the data to be classified into a classification model, obtain an output result of the classification model, and determine a classification result of the data to be classified based on the output result of the classification model; The classification model includes a first network branch and a second network branch, and is pre-trained by updating the parameters of the first network branch using back propagation based on the classification loss and the parameters of the first network branch using back propagation based on the contrast loss, and updating the parameters of the second network branch using momentum based on the updated parameters of the first network branch; The first network branch is used to perform classification prediction on the first training image to obtain a classification prediction result of the first training image; The second network branch is used to extract a first image feature of the first training image and a second image feature of the second training image; The classification loss is determined by the classification prediction result of the first training image, and the contrast loss is determined based on the first image feature and the second image feature; the network weight of the second network branch is updated by performing an exponential moving average on the network parameters of the first network branch; wherein the first image feature of the first training image is extracted using the projector and predictor of the first branch in the second network branch; The second image feature of the second training image is extracted using the projector of the second branch in the second network branch; The parameters of the first branch are updated based on the contrast loss between the first image feature and the second image feature, and the parameters of the second branch are updated based on the parameters of the first branch.
12. The device according to claim 11, wherein The classification prediction result of the first training image is obtained based on the classifier of the first network branch; The classification loss is a cross-entropy classification loss of the first training image, and the cross-entropy classification loss of the first training image is determined based on the classification prediction result of the first training image and the annotation information of the training image; The first training image is obtained by performing data enhancement on the training image.
13. The device according to claim 11, wherein The data to be classified is medical imaging data.
14. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 4, or the method of any one of claims 5 to 7.
15. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 4, or to execute the method according to any one of claims 5 to 7.
16. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 4, or performs the method according to any one of claims 5 to 7.