Comparison self-supervision reinforcement learning method and system

By comparing the self-supervised enhancement learning method, using technologies such as data augmentation and confidence penalty, the problems of insufficient generalization ability of small sample classification models and overfitting of easy-to-classify samples are solved, and the performance of new category feature extraction and classification is improved.

CN119006911APending Publication Date: 2024-11-22HENAN UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411091459.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

When extracting new category features, the existing small sample classification model lacks generalization ability, easily overfits easy-to-classify samples, ignores difficult-to-classify samples, and tends to learn tasks-independent features.

Method used

A contrasting self-supervised enhancement learning method is adopted to construct a multi-task learning method through data augmentation and confidence penalty, and a generalized functional enhancer, projection distance measurement unit and adjustable loss function are introduced to improve the generalization ability of the model and solve the problem of classification imbalance.

Benefits of technology

The model's ability to extract and generalize new category features is improved, the excessive pursuit of separability in comparative learning is weakened, the task-related features are paid attention to, and the overall classification performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006911A_ABST
    Figure CN119006911A_ABST
Patent Text Reader

Abstract

The invention discloses a contrast self-supervised reinforcement learning method and system, and the method comprises the steps: 1, carrying out the data enhancement of a training sample, and obtaining a transformation enhanced sample and a rotation enhanced sample; 2, inputting the transformation enhancement sample and the rotation enhancement sample into a comparison self-supervision enhancement learning model; 3, calculating transformation loss, rotation loss and confidence loss; 4, calculating the total loss based on the transformation loss, the rotation loss and the confidence loss, and optimizing the comparison self-supervised reinforcement learning model parameters through minimizing the total loss to obtain an optimal comparison self-supervised reinforcement learning model; and 5, inputting the target sample into the optimal comparison self-supervised reinforcement learning model to obtain an image classification result. The problem of unsupervised few-sample image classification is solved through multi-task learning, a general function enhancer, a projection distance measurement unit and an adjustable loss function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of small sample classification, and in particular to a comparative self-supervised reinforcement learning method and system. Background Art

[0002] The small sample classification model aims to classify the query samples using the support samples. In order to deal with the small sample learning scenario, metric-based methods, clustering-based methods and data enhancement-based methods are proposed. Among them, the metric-based method is used to learn the feature space of the base class samples and classify the new query samples. The data enhancement-based method usually achieves better performance and uses data augmentation to create pseudo labels to form the support set and query set.

[0003] Previous studies have focused on creating a powerful feature embedding representation for new categories when extracting feature embeddings for samples supporting new categories. However, their performance is limited. First, existing methods often train feature representations on base class samples, but do not fully explore and utilize the distinguishability and diversity of samples, resulting in insufficient model feature extraction and generalization capabilities for new categories. Second, related work often uses simple transformations for pre-training tasks, lacks the design of complex transformations, and cannot effectively improve the complexity of pre-training and the generalization ability of the model. Furthermore, in the contrastive learning framework, semantically similar or identical samples are used as negative samples, which will cause the model to tend to learn features that are irrelevant to the task, such as background or color distribution, rather than core category discriminant features. Finally, unsupervised small sample classification often suffers from category imbalance, which can easily cause the model to overfit easy-to-classify samples during the optimization process and ignore difficult-to-classify samples, thereby resulting in a decrease in overall classification performance. Summary of the invention

[0004] In order to at least partially solve the problems of insufficient model ability to extract and generalize new category features, overfitting of easy-to-classify samples and ignoring difficult-to-classify samples during the optimization process, which leads to a decline in overall classification performance, and the model's tendency to learn features irrelevant to the task, the present invention provides a comparative self-supervised reinforcement learning method and system. The present invention constructs a multi-task learning method by performing data enhancement and confidence penalty on samples, and sets a general function enhancer, a projection distance measurement unit and an adjustable loss function to improve the generalization ability of the model and solve the classification imbalance problem, thereby promoting the accuracy of model learning.

[0005] In order to achieve the above object, the technical solution of the present invention is:

[0006] The first aspect of the present invention proposes a comparative self-supervised reinforcement learning method, comprising:

[0007] Step 1: Perform data enhancement on the training samples to obtain transformation-enhanced samples and rotation-enhanced samples, which facilitates the construction of multi-task learning, enhances the understanding of image samples, and improves the ability to extract semantic features;

[0008] Step 2: Input the transformation enhancement samples and the rotation enhancement samples into the contrastive self-supervised reinforcement learning model to obtain the transformation feature vector, the rotation feature vector, the confidence of the transformation feature vector and the confidence of the rotation feature vector, so as to enable the contrastive self-supervised reinforcement learning model to maintain a high degree of generalization ability in the feature and output space, so as to accurately capture the semantic content of the image and improve the accuracy of image classification;

[0009] Step 3: Obtain the predicted category of the transformed enhanced sample according to the confidence of the transformed feature vector, and calculate the transformation loss between the predicted category and the true category of the transformed enhanced sample according to the transformed feature vector;

[0010] The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector;

[0011] Calculate confidence loss based on positive samples of different data augmentation types;

[0012] Step 4: Calculate the total loss based on the transformation loss, rotation loss and confidence loss, optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss, and obtain the optimal contrastive self-supervised reinforcement learning model to improve the image classification accuracy of the contrastive self-supervised reinforcement learning model;

[0013] Step 5: Input the target sample into the optimal contrastive self-supervised reinforcement learning model to obtain the image classification result.

[0014] Furthermore, the step 1 specifically includes:

[0015] The training samples include samples and sample-independent pseudo labels. Each sample in the training samples is transformed and enhanced and rotated to obtain transformation-enhanced samples and rotation-enhanced samples, which are convenient for multi-task learning.

[0016] Repeating the sample-independent pseudo-labels to obtain repeated sample-independent pseudo-labels makes the number of repeated sample-independent pseudo-labels the same as the number of transformation-enhanced samples, so that the sample-independent pseudo-labels correspond to the transformation-enhanced samples;

[0017] A rotation label is assigned to each rotation enhancement sample, and the rotation label is repeated to obtain repeated rotation labels, so that the number of repeated rotation labels is the same as the total number of rotation enhancement samples, so that the rotation labels correspond to the rotation enhancement samples.

[0018] Furthermore, in the step 2, the contrastive self-supervised reinforcement learning model includes an embedding network, a universal function enhancer, a projection distance measurement unit and a rotation classifier;

[0019] The transformation enhanced samples and the rotation enhanced samples are combined into a tensor, and the obtained tensor is input into the embedding network to obtain a feature vector for easy feature extraction;

[0020] The feature vector is input into the universal function enhancer to obtain the enhanced feature vector, which is convenient for storing the general abstract knowledge learned from the base class through a learnable tensor, and allowing a single sample to interact with the global semantic features, calculate the correlation, and enhance the parts similar to the previously learned knowledge, which promotes the effective transfer of knowledge to new categories, thereby improving the model performance and generalization ability on new categories;

[0021] Split the enhanced feature vector into transformed feature vector and rotated feature vector to facilitate multi-task learning;

[0022] The transformed feature vector is input into the projection distance measurement unit to obtain the confidence of the transformed feature vector, so as to facilitate classification according to the confidence of the transformed feature vector;

[0023] The rotation feature vector is input into the rotation classifier to obtain the confidence of the rotation feature vector, so as to calculate the rotation loss according to the confidence of the rotation feature vector.

[0024] Furthermore, in the general function enhancer, Q, K and V are expressed according to the following formula:

[0025] Q=f,K=β,V=W v β

[0026] Among them, Q is the query vector, K is the key vector, V is the numerical vector, f is the input feature vector, f∈R h×w×c , β is a learnable feature weight filter, β∈R n×c , c is the number of channels of the input feature vector, h is the height of the input feature vector, w is the width of the input feature vector, n is the batch size of the input feature vector, W v is a learnable fully connected layer.

[0027] Furthermore, in the general function enhancer, the feature vector is enhanced according to the following formula:

[0028] f′=FFN(f+A)

[0029] A=σ(fβ T )V

[0030] Among them, f′ is the enhanced feature vector, FFN is the feedforward network, σ is the feature correlation measurement unit, and A is the attention response of the input feature vector.

[0031] Furthermore, in the projection distance measurement unit, the projection distance is calculated according to the following formula:

[0032] dist(x,y)=(||x|·cos(x,y)-|y||+||y|·cos(y,x)-|x||)(1+e -3cos(x,y) ) γ

[0033] Where dist(x,y) is the projection distance, x and y are the vectors corresponding to any two transformed enhanced samples, γ is the scaling ratio, |x| and |y| represent the modulus of x and y, respectively, and cos is the cosine function.

[0034] Furthermore, in step 3, the transformation loss and the rotation loss are calculated by an adjustable loss function, and the transformation loss and the rotation loss are expressed by the following formula:

[0035]

[0036] Among them, L ce is the transformation loss, L ss is the rotation loss, AL is the adjustable loss function, Rotation labels for rotation-augmented samples, Independent pseudo labels for transformation-enhanced samples, is the projection distance between the independent pseudo labels of the training sample and the transformed enhanced sample, p j is the projection distance between the training sample and the jth transformation enhanced sample, is the projection distance between the rotation labels of the training sample and the rotation enhancement sample, q j is the projection distance between the training sample and the jth rotation enhancement sample, α t is the balance factor, ω is the parameter, δ is the threshold, β t is the reward degree parameter, p t is the baseline truth probability, τ is an adjustable focusing parameter.

[0037] Furthermore, in step 4, the total loss function is expressed according to the following formula:

[0038] L=L ce +η·L ss +λ·L cr

[0039] L cr(P,Q)=P(log(P+ε)-log(Q+ε))+Q(log(Q+ε)-log(P+ε)

[0040] Among them, L is the total loss, L cr is the confidence loss, η is the weight coefficient, λ is the weight coefficient, ε is a constant, P is the probability distribution of the positive samples enhanced by transformation and all transformed samples, and Q is the probability distribution of the positive samples enhanced by rotation and all rotated samples.

[0041] Furthermore, the step five specifically includes:

[0042] Sampling support and query sets from the target sample;

[0043] Input the target sample into the embedding network to obtain the feature vectors of the support set and the query set;

[0044] Input the feature vector into the universal feature enhancer to obtain the feature vectors of the enhanced support set and query set for feature enhancement;

[0045] The enhanced feature vectors of the support set and query set are input into the projection distance measurement unit to obtain the confidence of the query set, which is convenient for image classification;

[0046] The predicted labels of the query set are obtained according to the confidence of the query set, and the image classification results are obtained according to the predicted labels.

[0047] The second aspect of the present invention provides a contrastive self-supervised reinforcement learning system, comprising:

[0048] The enhancement module is used to perform data enhancement on training samples to obtain transformation enhancement samples and rotation enhancement samples, which is convenient for building multi-task learning, enhancing the understanding of image samples and improving the ability to extract semantic features;

[0049] The contrastive self-supervised reinforcement learning module is used to input the transformation enhancement samples and the rotation enhancement samples into the contrastive self-supervised reinforcement learning model to obtain the transformation feature vector, the rotation feature vector, the confidence of the transformation feature vector and the confidence of the rotation feature vector, so as to enable the contrastive self-supervised reinforcement learning model to maintain a high degree of generalization ability in the feature and output space, so as to accurately capture the semantic content of the image and improve the accuracy of image classification;

[0050] A loss module, used to obtain a predicted category of a transformation-enhanced sample according to a confidence level of a transformation feature vector, and to calculate a transformation loss between a predicted category and a true category of the transformation-enhanced sample according to the transformation feature vector;

[0051] The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector;

[0052] Calculate confidence loss based on positive samples of different data augmentation types;

[0053] A training module is used to calculate the total loss based on the transformation loss, rotation loss and confidence loss, optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss, and obtain the optimal contrastive self-supervised reinforcement learning model, which is used to improve the image classification accuracy of the contrastive self-supervised reinforcement learning model;

[0054] The classification module is used to input the target sample into the optimal contrast self-supervised reinforcement learning model to obtain the image classification result.

[0055] Beneficial effects of the present invention:

[0056] (1) The present invention proposes a contrastive self-supervised reinforcement learning method and system, which performs multi-task training through base class information, introduces contrastive learning to improve sample discrimination, and proposes a rotation prediction task to force the contrastive self-supervised reinforcement learning model to focus on structural features with strong rotation correlation, so that it can understand images from multiple angles, reduce the contrastive learning's excessive pursuit of separability and focus on distant samples within the class generated by invalid information in the sample, and solve the problem that the contrastive self-supervised reinforcement learning model tends to learn features that are irrelevant to the task.

[0057] (2) The present invention proposes a generic feature enhancer (GFE), which enhances the semantic features of new category data similar to the common features of base category data by learning the common features of the base category data, thereby improving the generalization ability of the model, thereby solving the problem of insufficient new category feature extraction and generalization capabilities of the comparative self-supervised reinforcement learning model.

[0058] (3) The present invention proposes a projection distance metric unit (PDMA), which captures the similarity relationship between feature vectors through the modulus length relationship and angle relationship (vector projection) between vectors, thereby obtaining a better decision boundary in the feature space.

[0059] (4) The present invention proposes an adjustable loss function (AL), which is based on the cross entropy loss function, adds an adjustment factor, changes the loss weights of samples of different categories, increases the loss ratio of difficult-to-classify samples, and increases the gradient for easy-to-classify samples, thereby solving the problem that the self-supervised reinforcement learning model overfits the easy-to-classify samples during the optimization process and ignores the difficult-to-classify samples, resulting in a decrease in the overall classification performance.

[0060] (5) We conduct extensive experiments on multiple few-shot benchmarks and the results show that the proposed method achieves state-of-the-art performance. Ablation studies and detailed visualizations explain the effectiveness of different components. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 One of the flowcharts of a comparative self-supervised reinforcement learning method provided by an embodiment of the present invention.

[0062] Figure 2 The present invention provides a second flowchart of a comparative self-supervised reinforcement learning method.

[0063] Figure 3 A schematic diagram of a class collision for a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0064] Figure 4 A schematic diagram of data enhancement for a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0065] Figure 5 A schematic diagram of a general function enhancer for a comparative self-supervised reinforcement learning method provided by an embodiment of the present invention.

[0066] Figure 6 A schematic diagram of miniImageNet training with different inputs of a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0067] Figure 7 A schematic diagram of calculating different vector distance values ​​for a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0068] Figure 8 A schematic diagram of an incorrect positive sample region generated by PDMA of a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0069] Fig. 9 A schematic diagram of an adjustable loss function experiment for comparing self-supervised reinforcement learning methods provided in an embodiment of the present invention.

[0070] Fig.10 A schematic diagram of a model of a comparative self-supervised reinforcement learning method provided in an embodiment of the present invention trained on miniImageNet.

[0071] Fig.11 A schematic diagram of an accuracy test on miniImageNet for comparing a self-supervised reinforcement learning method provided in an embodiment of the present invention.

[0072] Fig.12An architecture diagram of a comparative self-supervised reinforcement learning system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] Example 1

[0075] like Figure 1 As shown, a contrastive self-supervised reinforcement learning method includes the following steps:

[0076] S101: Perform data enhancement on the training samples to obtain transformation enhancement samples and rotation enhancement samples.

[0077] S102: Inputting the transformation enhancement sample and the rotation enhancement sample into the contrastive self-supervised reinforcement learning model to obtain a transformation feature vector, a rotation feature vector, a confidence of the transformation feature vector, and a confidence of the rotation feature vector.

[0078] S103: obtaining a predicted category of the transformed enhanced sample according to the confidence of the transformed feature vector, and calculating a transformation loss between the predicted category and the true category of the transformed enhanced sample according to the transformed feature vector;

[0079] The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector;

[0080] Compute confidence loss based on positive samples of different data augmentation types.

[0081] S104: Calculate the total loss based on the transformation loss, the rotation loss and the confidence loss, optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss, and obtain the optimal contrastive self-supervised reinforcement learning model.

[0082] S105: Input the target sample into the optimal contrast self-supervised reinforcement learning model to obtain the image classification result.

[0083] The present invention proposes a rotation prediction task that forces the contrastive self-supervised reinforcement learning model to focus on structural features with strong rotation correlation, so that it can understand the image from multiple angles, and reduce the excessive pursuit of separability in contrastive learning, which causes invalid information in the focus sample to produce distant samples within the class. On this basis, Multi-taskTraining is constructed in combination with complex data enhancement and confidence penalty to make the prediction results closer to the true distribution. In addition, the present invention proposes a new loss function to solve the problem of classification imbalance by dynamically adjusting the importance of each sample loss, thereby promoting the accuracy of learning of the contrastive self-supervised reinforcement learning model.

[0084] Example 2

[0085] Based on the above embodiments, Figure 2 As shown, the embodiment of the present invention provides a specific process of a comparative self-supervised reinforcement learning method, which specifically includes:

[0086] Specifically, in previous data-augmented contrastive learning, the negative pairs may be semantically similar or even belong to the same semantic class, which is called "class collision" or "sampling bias". This may cause the model to over-enhance the distinction between samples, such as Figure 3 To solve this problem, the present invention designs a contrastive self-supervised reinforcement learning method.

[0087] S201: Perform data enhancement on the training samples to obtain transformation enhancement samples and rotation enhancement samples.

[0088] Specifically, during the training process, a small batch of samples b = {x, y}, y is a sample independent pseudo label, x is a sample, and the sample x is transformed using transformation enhancement T and rotation enhancement R. Transformation enhancement T includes random cropping, random horizontal flipping, random vertical flipping, color jittering, and random grayscale. Rotation enhancement R includes performing geometric transformation after the sample has undergone random cropping, random horizontal flipping, color jittering, and random grayscale. The geometric transformation includes rotation from four different directions (0°, 90°, 180°, 270°).

[0089] like Figure 4 As shown, by transforming x t =T(x), enhancing R by rotation: x r = R(x), respectively synthesizing variants of sample x. t is the transformation enhancement sample, x t ∈{x 1,1 ,x 1,2 ,...,x n,m}, x n,m is the mth augmented transform enhancement sample of the nth sample, x r is the rotation enhancement sample, x r ∈{x1,0° ,x 1,90° ,x 1,180° ,x 1,270° ,...,x n,270°}, x n,270° It is the rotation enhancement sample after the nth sample is rotated 270°, x is the sample, T(x) is x after transformation enhancement, and R(x) is x after rotation enhancement.

[0090] Repeating y m times becomes As the transformed augmented x t Label, assign a rotation label r∈{0°,90°,180°,270°} to each rotation enhancement sample, and then repeat the rotation label n times to become the repeated rotation label To match the enhanced x r The total number of enhanced samples is finally obtained

[0091] S202: Inputting the transformation enhancement sample and the rotation enhancement sample into the contrastive self-supervised reinforcement learning model to obtain a transformation feature vector, a rotation feature vector, a confidence of the transformation feature vector, and a confidence of the rotation feature vector.

[0092] Specifically, the contrastive self-supervised reinforcement learning model (ECSL) includes an embedding network, a universal feature enhancer, a projected distance metric unit, and a rotation classifier.

[0093] x t and x r Together they are called a tensor Will Input into the embedding network for feature extraction, and get The feature vector is input into the universal feature enhancer to obtain the enhanced feature vector.

[0094] Specifically, the standard Transformer layer architecture is as follows Figure 5 (a), but directly applying it to the small sample domain will cause overfitting and affect the model performance. Therefore, a Generic Feature Enhancer (GFE) is set up, as shown in Figure 5 (b) as shown.

[0095] In order to reduce the number of model parameters to prevent overfitting and make the feature reconstruction process more flexible, Q, K and V are expressed according to the following formula: Q = f, K = β, V = W v β

[0096] Among them, Q is the query vector, K is the key vector, V is the numerical vector, f is the input feature vector, f∈R h×w×c, β is a learnable feature weight filter, β∈R n×c , c is the number of channels of the input feature vector, h is the height of the input feature vector, w is the width of the input feature vector, n is the batch size of the input feature vector, W v It is a learnable fully connected layer. GFE reconstructs features by introducing learnable parameter adjustments to enhance the model's ability to process complex patterns.

[0097] GFE model training captures generalizable information from base class data, enhances key information, and reconstructs input features. The learnable feature weight filter β contains semantic information β similar to the input features. sim and dissimilar semantic information β other , using similar semantic information β sim Enhanced reconstruction of semantic information.

[0098] When testing the model on a new category dataset, the learnable feature weight filters are reweighted according to the GFE representation. The average of the reweighted learnable feature weight filters forms the attention response of the input feature vector, which is expressed as follows:

[0099] A=σ(fβ T )V

[0100] Among them, A is the attention response of the input feature vector, and σ is the feature correlation measurement unit, which is used to calculate the attention score to obtain the attention feature reconstruction weight.

[0101]

[0102] Among them, softmax is a normalized exponential function, x i is the input parameter.

[0103] GFE uses a learnable feature weight filter to collect the attention response of the target information dataset with semantic similarity to the input feature vector to enhance the input features, thereby achieving effective enhancement of the new sample features. The process is expressed as follows: f′=FFN(f+A)

[0104] Among them, f′ is the enhanced feature vector, and FFN is the feed-forward network.

[0105] Finally, the reconstruction process of the feature vector by the universal function enhancer is expressed as follows:

[0106] f′=GFE(f)=FFN(f+σ(fβ Τ )V)

[0107] The present invention conducts a series of experiments on 5-way 1-shot and 5-shot settings to study the role of GFE in few-shot image classification. From the experimental results, the classification results have been steadily improved in various few-shot benchmarks. In order to further explore the impact of input form on unsupervised small samples, different input structures are modified. The results are shown in Table 1. On this basis, the generalization effect of different inputs on new datasets is studied. The results are shown in Table 1. Figure 6 In addition, in order to further demonstrate the impact of different numbers of heads, the present invention also shows the impact of different numbers of heads on the results, as well as the degenerate representation that may be produced by the multi-head architecture. The experimental results are shown in Table 2. The experiment was conducted on a model trained for 600 epochs.

[0108] Table 1: Effects of different input settings on experimental results

[0109]

[0110] Table 2: Effect of different numbers of heads in the feature reconstructor on the experimental results

[0111]

[0112] The enhanced feature vector is split into a transformed feature vector and a rotated feature vector. The confidence of the transformed feature vector is obtained according to the projection distance measurement unit.

[0113] Specifically, commonly used distance measurement methods include Euclidean distance and cosine distance. Euclidean distance produces a visualization of distance such as Figure 7 (c) shows the distance visualization produced by the cosine distance. Figure 7 (d) as shown.

[0114] The present invention proposes a projection distance measurement unit (PDMA) to calculate the projection distance between two transformed feature vectors. The projection distance is expressed according to the following formula:

[0115] dist(x,y)=λ(x,y)d proj (x,y)

[0116] Among them, dist(x,y) is the projection distance, d proj (x, y) is the distance between two transformed feature vectors, λ(x, y) is the distance scaling, and x and y are the vectors corresponding to any two transformed enhanced samples.

[0117] The present invention proposes to calculate the similarity distance between two transformed feature vectors by considering the mutual projection length and the vector length difference between them, thereby capturing the similarity between vectors more comprehensively and generating a visualization of the distance such as Figure 7 As shown in (a), the distance measure between vectors is expressed as follows:

[0118] d proj (x,y)=||x|·cos(x,y)-|y||+||y|·cos(y,x)-|x||

[0119] Among them, |x| and |y| represent the modulus of x and y, respectively, and the cosine function.

[0120] The present invention scales the projection difference according to the following formula:

[0121]

[0122] Among them, γ is the scaling ratio and σ(x) is the Sigmoid function.

[0123] λ(x,y) has the following characteristics: When the cosine similarity is close to 1, that is, the transformation feature vectors x and y are highly consistent, the scaling factor is close to 1, thus maintaining the authenticity of the distance. When the cosine similarity is close to -1, that is, the transformation feature vectors x and y are in opposite directions, the scaling factor is close to 1+e 3 , thus expanding their distance to reflect the strong difference in direction. This produces a visualization of the distances as Figure 7 (b) As shown. So far, the PDMA complete similarity measurement function designed by the present invention is expressed according to the following formula:

[0124] dist(x,y)=(||x|·cos(x,y)-|y||+||y|·cos(y,x)-|x||)(1+e -3cos(x,y) ) γ

[0125] like Figure 7 As shown in (b), the PDMA mechanism creates a significantly compressed negative sample space (lighter color area) and a wider positive sample space (darker color area). This encourages similar samples to be in their own positive sample subspace, while negative samples are concentrated in the negative sample space direction.

[0126] In some cases, PDMA will generate range noise. Figure 8 As shown in the figure, line segment CD is the diameter of the circle with center A, EF is the tangent line of the circle perpendicular to the diameter, the tangent point is D, B is any point on circle A, G is any point on EF, at this time, the projection of CD to CB and the projection of CG to CD will coincide with CB and CD respectively, in the measurement relationship between CD and CB, CD and CG, only the other pair of projection relationships will work, thus producing a smaller solution and generating a buffer space with a relatively gentle gradient. However, since the minimum solution in the feature space remains unchanged, that is, when the two vectors coincide, this noise promotes further optimization of the model and improves generalization performance.

[0127] Experiments are conducted on the projection distance metric unit in unsupervised few-shot learning. As shown in Table 3, the experiments show that compared with the traditional Euclidean distance and cosine similarity in multiple benchmarks, there is a significant performance improvement.

[0128] Table 3: The impact of the distance metric combination on the experimental results during testing

[0129]

[0130] The confidence of the rotated feature vector is obtained according to the rotation classifier.

[0131] Specifically, the present invention adopts logistic regression as a rotation classifier to obtain the confidence of the rotation feature vector.

[0132] S203: Obtain the predicted category of the transformed enhanced sample according to the confidence of the transformed feature vector, and calculate the transformation loss between the predicted category and the true category of the transformed enhanced sample according to the transformed feature vector.

[0133] The predicted rotation angle of the rotation enhanced sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle of the rotation enhanced sample and the true rotation angle is calculated according to the rotation feature vector.

[0134] Compute confidence loss based on positive samples of different data augmentation types.

[0135] Specifically, commonly used loss functions include cross entropy loss function and mean square error loss function. However, these traditional loss functions may not perform optimally when faced with scenarios with severe class imbalance. In response to this problem, in order to handle the classification imbalance problem more carefully, the model no longer pays too much attention to samples with poor classification results, but ignores samples with good classification results (especially when these samples are far from the decision boundary). The present invention makes modifications based on cross entropy and designs an adjustable loss function (Adjustable Loss, AL), and then calculates the transformation loss and rotation loss based on the adjustable loss function.

[0136]

[0137] Among them, AL is the adjustable loss function, ω is the parameter, δ is the threshold, β t is the reward degree parameter, p t is the baseline truth probability, τ is an adjustable focusing parameter that reduces the loss contribution of easily classified samples and expands the range of samples that obtain lower loss. t is a balancing factor used to adjust the weights between difficult-to-classify samples. Used to focus on samples with better classification effects.t As the loss increases, it gradually weakens the size of the original loss. When it weakens the loss to a certain extent, a threshold is generated to regenerate the loss gradient for well-classified samples to ensure continued optimization. t ′, AL(p t ′)=0, that is, when p t >p t ′, these samples are regarded as samples with good classification effect, and the loss values ​​of these samples drop to negative numbers instead of approaching 0, thus generating loss gradients. The reward degree parameter β t ∈(0,1] and the threshold δ∈(0,1] jointly control the reward depth and threshold position of the loss function. In order to make the loss function smoother, the present invention adds (1-p t ) 3 To raise or reduce the loss vertically, as p t As the value of ω increases, its effect gradually weakens, so more attention is paid to the processing of difficult samples. ω and δ are used to adjust the curve of the loss function vertically, β t It is used to horizontally adjust the reward level in the loss function. The specific parameters for adjusting the loss change are as follows: Fig. 9 shown.

[0138] From the above content, we can see that by dynamically adjusting the AL parameter ω, threshold δ and reward degree parameter β t To change the size of the loss generated by different samples, this mechanism gradually increases the loss proportion of difficult-to-classify samples during training, and reduces the loss weight of easy-to-classify samples, so as to optimize the problem that the easy-to-classify loss dominates the loss of difficult-to-classify samples and the gradient of easy-to-classify samples disappears and optimization stops, thereby bringing a more accurate model learning process.

[0139] The present invention also explores the impact of the loss function's attention to difficult and easy-to-classify samples on unsupervised few-sample classification. As shown in Table 4, the AL proposed in the present invention is improved in all benchmark tests of small-sample classification compared to the traditional cross-entropy loss, which shows that by paying attention to the uneven distribution of difficult and easy-to-classify samples in the sample and the excessively high proportion of easy-to-classify sample loss, the comparative self-supervised reinforcement learning model can pay more attention to the learning of difficult-to-classify samples.

[0140] Table 4: Effect of different parameter settings of Adjustable Loss on experimental results

[0141]

[0142]

[0143] The transformation loss and rotation loss are expressed as follows:

[0144]

[0145] Among them, L ce is the transformation loss, L ss is the rotation loss, Rotation labels for rotation-augmented samples, Independent pseudo labels for transformation-enhanced samples, is the projection distance between the independent pseudo labels of the training sample and the transformed enhanced sample, p j is the projection distance between the training sample and the jth transformation enhanced sample, is the projection distance between the rotation labels of the training sample and the rotation enhancement sample, q j is the projection distance between the training sample and the jth rotation enhancement sample.

[0146] In order to enable the model to learn consistent and robust feature representations when processing different data enhancement versions, so that the difference between the distribution center of the prediction result and each data enhancement prediction result is as small as possible, the present invention introduces the confidence loss as shown in the following formula:

[0147] L cr (P,Q)=P(log(P+ε)-log(Q+ε))+Q(log(Q+ε)-log(P+ε)

[0148]

[0149] Among them, L cr is the confidence loss, ε is a constant, P is the probability distribution of the positive samples enhanced by transformation and all transformed samples, Q is the probability distribution of the positive samples enhanced by rotation and all rotated samples, p i represents the projection distance between the transformed enhanced positive sample and the i-th transformed enhanced sample, q i Represents the projection distance between the rotation-enhanced positive sample and the i-th rotation-enhanced sample.

[0150] S204: Calculate the total loss based on the transformation loss, the rotation loss and the confidence loss, optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss, and obtain the optimal contrastive self-supervised reinforcement learning model.

[0151] Specifically, the total loss of ECSL is expressed as follows: L = L ce +η·L ss +λ·L cr

[0152] Among them, η is the weight coefficient and λ is the weight coefficient.

[0153] The proposed ECSL training process can be viewed as an optimization problem as shown in the following formula:

[0154]

[0155] Among them, Θ is the embedding network, φ is the universal feature enhancer, DMM is the projection distance metric unit, and Ψ is the rotation classifier.

[0156] S205: Input the target sample into the optimal contrast self-supervised reinforcement learning model to obtain an image classification result.

[0157] Specifically, the predicted label of the target sample is obtained according to the confidence of the transformed feature vector, and the image classification result is obtained according to the predicted label.

[0158] Example 3

[0159] Based on the above embodiment, the embodiment of the present invention provides an evaluation process of a comparative self-supervised reinforcement learning method, which specifically includes:

[0160] The proposed model is fully evaluated on two standard small-shot learning benchmarks, namely miniImageNet and tieredImageNet. The miniImageNet dataset, proposed by Vinyals et al. in 2016, is a subset of ImageNet (constructed by Deng et al. in 2009). The dataset is divided into 64 training classes, 16 validation classes, and 20 test classes (Larochelle, 2017).

[0161] The tieredImageNet dataset, developed by Ren et al. in 2018, uses a wider subset of ImageNet, which is divided into 20 training classes, 6 validation classes, and 8 test classes, corresponding to 351 training classes, 97 validation classes, and 160 test classes.

[0162] In miniImageNet and tieredImageNet, all images are uniformly resized to a resolution of 84×84 pixels. The input images used in the benchmark dataset only contain 3 color channels. In order to truly simulate the unsupervised learning environment, the present invention does not use the label information in the training set during the training phase, and also avoids using the labeled validation set to select the optimal model checkpoint.

[0163] In order to ensure a fair comparison with the prior art, the present invention uses a Conv4 network consisting of four convolutional blocks as the basic architecture, each of which is equipped with 64 filters. The model is trained for 2000 epochs, using the Adam optimizer, and the learning rate is set to 1e-3. For the miniImageNet and tieredImageNet datasets, the batch size N set by the present invention is 64 and 192, respectively. For Conv4 and ResNet12, the number of enhanced views M per sample is set to 4 and 8, respectively. The input image is transformed and enhanced T and rotated R.

[0164] For different data sets and basic network architectures, the present invention sets the regularization coefficient ρ = 1. The number of GFE heads is selected from {1, 4}, and the dimension of the learnable feature weight filter β is selected. The loss lift coefficient λ is set to 1, and the loss reward threshold coefficient β t and reward coefficient μ are set to {0, 0.5, 1, 1.5} and {0.01, 0.03, 0.1, 0.5}, respectively, to optimize the model performance.

[0165] The present invention adopts the standard 5-way 1-shot / 5-shot task to evaluate the performance of the proposed model. In the evaluation stage, the present invention uses 10,000 randomly selected few-shot tasks to comprehensively test the generalization ability and robustness of the model. Each task includes 5 different categories (N=5), each of which contains 1 or 5 support samples (K=1 or 5), and 15 query samples per category (Q=15). Through this design, the present invention can comprehensively evaluate the performance of the model in various scenarios. The experimental results are presented in the form of average accuracy (percentage) and its 95% confidence interval to provide an intuitive and reliable understanding of the model performance. Unless otherwise stated, all non-meta-learning models, including the models of the present invention and the comparative learning models, use prototype-based nearest neighbor classifiers to solve new few-shot tasks based on pre-trained backbones.

[0166] The present invention compares ECSL with existing unsupervised few-shot learning models and classic contrastive learning models. The results of the supervised original network are provided as supervised baselines. Tables 5 and 6 give the results on miniImageNet and tieredImageNet, respectively, and the respective best unsupervised results are set in bold. All models use Conv4 as the backbone. The present invention's ECSL has a great advantage over other models and achieves performance closer to the supervised baseline, such as Fig.10 shown.

[0167] Table 5: Few-shot classification accuracy (%) on 10,000 5way-k shot tasks randomly sampled from miniImigeNet, with 95% confidence interval)

[0168]

[0169]

[0170] Table 6: Few-shot classification accuracy (%) and 95% confidence intervals for 10,000 5-way-k shot tasks randomly sampled from tieredImageNet

[0171]

[0172] In order to further analyze the impact of each step on the proposed ECSL, the effectiveness of the complex multi-task learning method, Generic Feature Enhancer (GFE), ProjectionDistance Metric Algorithm (PDMA), and Adjustable Loss (AL) constructed by comparing self-supervised learning and rotational self-supervised learning is first verified. In all experiments, the number of transformation enhancements is set to 4 and Conv-4 is used as the backbone network for ablation analysis. The ablation experiment results are shown in Table 7.

[0173] As shown in Table 7, Model 1 represents a model trained only using classification cross entropy loss, achieving 46.52% for 5-way 1-shot and 65.20% for 5-way 5-shot on miniImageNet; and 43.90% for 5-way 1-shot and 62.27% for 5-way 5-shot on tieredImageNet. With the use of the confidence loss function and modules proposed in the present invention, the 5-way 1-shot and 5-way 5-shot of the model are improved on miniImageNet and tieredImageNet. When the confidence loss function and the module proposed in the present invention are used simultaneously, namely ECSL, the small sample classification effect is best, indicating that the method proposed in the present invention is of great significance for unsupervised small sample classification. Fig.11 Figure 2 shows the 5way-1shot accuracy of 10,000 new tasks during 600 epoch training.

[0174] Table 7: Ablation study results of the proposed ECSL under the setting of 10,000 randomly sampled 5:way-k shots.

[0175]

[0176] In order to explore the generalization effect of rotation transformation (RT), the examples in four directions are transformed and the corresponding rotation angles are predicted. A completely unsupervised contrastive representation is used as the baseline (BL), and a series of experiments are conducted to determine the effectiveness of combining contrastive learning and self-supervised objectives. The experiments include four task settings. Task1 only uses data augmentation T applied to the unsupervised contrastive model, that is, the baseline (BL); Task2 uses the rotation self-supervised task of data augmentation R, but no unsupervised contrastive learning is performed; Task3 represents the combination of unsupervised contrastive learning and self-supervised objectives, that is, ECSL. Task4 explores another data augmentation paradigm, transformation enhancement, to remove horizontal flipping and vertical flipping. The samples after transformation enhancement are respectively subjected to rotation enhancement to generate the final four enhanced samples. The purpose is to explore whether the sample input of the model can be reduced through this de-redundant enhancement paradigm. The experimental results show that the performance of Task1 and Task2 is lower than that of Task3 in both 1-shot and 5-shot, which proves that combining rotation transformation with unsupervised contrastive learning can significantly improve the performance compared with the baseline model. This phenomenon illustrates the effectiveness of the rotation transformation, that is, Task 3 uses the rotation category information with self-supervised objectives to enhance the sample diversity and structural representation of features, thereby improving the generalization ability of the representation. The experiment was conducted on a model trained for 600 epochs, and the experimental results are shown in Table 8.

[0177] Table 8: Results of different rotation tasks under the setting of 10,000 5:way-k shots randomly sampled on miniImigeNet

[0178]

[0179] Experiments have verified that ECSL has better results than ArL, MISo, CPNWCP and other methods on the two basic datasets miniImageNet and tieredImageNet, respectively. It improves the classification accuracy by 2.10% and 2.11% on the 5-way 1-shot task and by 0.66% and 1.55% on the 5-way 5-shot task than CPNWCP. It is better than the most advanced unsupervised few-shot learning methods and surpasses the traditional supervised methods in the 5-way 1-shot experiment of miniImageNet.

[0180] Example 4

[0181] Corresponding to the above method, such as Fig.12 As shown, a contrastive self-supervised reinforcement learning system includes:

[0182] The enhancement module is used to perform data enhancement on the training samples to obtain transformation enhancement samples and rotation enhancement samples.

[0183] The contrastive self-supervised reinforcement learning module is used to input the transformation enhancement samples and the rotation enhancement samples into the contrastive self-supervised reinforcement learning model to obtain the transformation feature vector, the rotation feature vector, the confidence of the transformation feature vector and the confidence of the rotation feature vector.

[0184] A loss module, used to obtain a predicted category of a transformation-enhanced sample according to a confidence level of a transformation feature vector, and to calculate a transformation loss between a predicted category and a true category of the transformation-enhanced sample according to the transformation feature vector;

[0185] The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector;

[0186] Compute confidence loss based on positive samples of different data augmentation types.

[0187] The training module is used to calculate the total loss based on the transformation loss, rotation loss and confidence loss, and optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss to obtain the optimal contrastive self-supervised reinforcement learning model.

[0188] The classification module is used to input the target sample into the optimal contrast self-supervised reinforcement learning model to obtain the image classification result.

[0189] It should be noted that the contrastive self-supervised reinforcement learning system provided in an embodiment of the present invention is to implement a contrastive self-supervised reinforcement learning method in the above embodiment. Its specific functions can be referred to the above method embodiments and will not be repeated here.

[0190] In summary, the present invention proposes a contrastive self-supervised reinforcement learning method and system, performs multi-task training through base class information, introduces contrastive learning to improve sample discrimination, proposes a rotation prediction task to force the contrastive self-supervised reinforcement learning model to focus on structural features with strong rotation correlation, so that it can understand images from multiple angles, and reduce the contrastive learning's excessive pursuit of separability and focus on distant samples within the class generated by invalid information in the sample, solving the problem that the contrastive self-supervised reinforcement learning model tends to learn features that are irrelevant to the task. The present invention proposes a generic feature enhancer (GFE), which enhances the semantic features of new category data similar to it by learning the common features of base class data, improves the generalization ability of the model, and thus solves the problem that the contrastive self-supervised reinforcement learning model is insufficient in extracting and generalizing new category features. The present invention proposes a projection distance measurement unit (PDMA), which captures the similarity relationship between feature vectors through the modulus length relationship and angle relationship (vector projection) between vectors, so as to obtain a better decision boundary in the feature space. The present invention proposes an adjustable loss function (AL), which is based on the cross entropy loss function, adds a regulation factor, changes the loss weights of samples of different categories, increases the loss ratio of difficult-to-classify samples, and increases the gradient for easy-to-classify samples, thereby solving the problem that the self-supervised reinforcement learning model overfits easy-to-classify samples during the optimization process, ignores difficult-to-classify samples, and leads to a decrease in overall classification performance. The present invention has conducted a large number of experiments in multiple few-sample benchmarks, and the results show that the method proposed by the present invention achieves state-of-the-art performance, and ablation studies and detailed visualizations explain the effectiveness of different components.

[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A contrastive self-supervised reinforcement learning method, characterized in that: include: Step 1: Perform data enhancement on the training samples to obtain transformation enhancement samples and rotation enhancement samples; Step 2: Input the transformation enhancement sample and the rotation enhancement sample into the contrastive self-supervised reinforcement learning model to obtain the transformation feature vector, the rotation feature vector, the confidence of the transformation feature vector and the confidence of the rotation feature vector; Step 3: Obtain the predicted category of the transformed enhanced sample according to the confidence of the transformed feature vector, and calculate the transformation loss between the predicted category and the true category of the transformed enhanced sample according to the transformed feature vector; The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector; Calculate confidence loss based on positive samples of different data augmentation types; Step 4: Calculate the total loss based on transformation loss, rotation loss and confidence loss, optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss, and obtain the optimal contrastive self-supervised reinforcement learning model; Step 5: Input the target sample into the optimal contrastive self-supervised reinforcement learning model to obtain the image classification result.

2. A contrastive self-supervised reinforcement learning method according to claim 1, characterized in that: The step one specifically includes: The training samples include samples and sample-independent pseudo labels. Each sample in the training samples is transformed and enhanced and rotated to obtain a transformed and enhanced sample and a rotated and enhanced sample. Repeat the sample-independent pseudo-labels to obtain repeated sample-independent pseudo-labels, so that the number of repeated sample-independent pseudo-labels is the same as the number of transformation-enhanced samples; A rotation label is assigned to each rotation enhancement sample, and the rotation label is repeated to obtain repeated rotation labels, so that the number of repeated rotation labels is the same as the total number of rotation enhancement samples.

3. A contrastive self-supervised reinforcement learning method according to claim 1, characterized in that: In the step 2, the contrastive self-supervised reinforcement learning model includes an embedding network, a universal function enhancer, a projection distance measurement unit and a rotation classifier; Merge the transformation-enhanced samples and the rotation-enhanced samples into a tensor, and input the obtained tensor into the embedding network to obtain a feature vector; Input the feature vector into the universal function enhancer to obtain an enhanced feature vector; Split the enhanced feature vector into a transformed feature vector and a rotated feature vector; Input the transformed feature vector into the projection distance measurement unit to obtain the confidence of the transformed feature vector; The rotated feature vector is input into the rotation classifier to obtain the confidence of the rotated feature vector.

4. A contrastive self-supervised reinforcement learning method according to claim 3, characterized in that: In the general function enhancer, Q, K and V are expressed according to the following formula: Q=f,K=β,V=W v b Among them, Q is the query vector, K is the key vector, V is the numerical vector, f is the input feature vector, f∈R h×w×c , β is a learnable feature weight filter, β∈R n×c , c is the number of channels of the input feature vector, h is the height of the input feature vector, w is the width of the input feature vector, n is the batch size of the input feature vector, W v is a learnable fully connected layer.

5. A contrastive self-supervised reinforcement learning method according to claim 4, characterized in that: In the general function enhancer, the feature vector is enhanced according to the following formula: f′=FFN(f+A) A=σ(fβ T )V Among them, f′ is the enhanced feature vector, FFN is the feedforward network, σ is the feature correlation measurement unit, and A is the attention response of the input feature vector.

6. A contrastive self-supervised reinforcement learning method according to claim 3, characterized in that: In the projection distance measurement unit, the projection distance is calculated according to the following formula: dist(x,y)=(||x|·cos(x,y)-|y||+||y|·cos(y,x)-|x||)(1+e -3cos(x,y) ) γ Where dist(x,y) is the projection distance, x and y are the vectors corresponding to any two transformed enhanced samples, γ is the scaling ratio, |x| and |y| represent the modulus of x and y, respectively, and cos is the cosine function.

7. A contrastive self-supervised reinforcement learning method according to claim 2, characterized in that: In step 3, the transformation loss and the rotation loss are calculated by an adjustable loss function, and the transformation loss and the rotation loss are expressed by the following formula: Among them, L ce is the transformation loss, L ss is the rotation loss, AL is the adjustable loss function, Rotation labels for rotation-augmented samples, Independent pseudo labels for transformation-enhanced samples, is the projection distance between the independent pseudo labels of the training sample and the transformed enhanced sample, p j is the projection distance between the training sample and the jth transformation enhanced sample, is the projection distance between the rotation labels of the training sample and the rotation enhancement sample, q j is the projection distance between the training sample and the jth rotation enhancement sample, α t is the balance factor, ω is the parameter, δ is the threshold, β t is the reward degree parameter, p t is the baseline truth probability, τ is an adjustable focusing parameter.

8. A contrastive self-supervised reinforcement learning method according to claim 7, characterized in that: In step 4, the total loss function is expressed according to the following formula: L=L ce +η·L ss +λ·L cr L cr (P,Q)=P(log(P+ε)-log(Q+ε))+Q(log(Q+ε)-log(P+ε) Among them, L is the total loss, L cr is the confidence loss, η is the weight coefficient, λ is the weight coefficient, ε is a constant, P is the probability distribution of the positive samples enhanced by transformation and all the samples enhanced by transformation, and Q is the probability distribution of the positive samples enhanced by rotation and all the samples enhanced by rotation.

9. A contrastive self-supervised reinforcement learning method according to claim 1, characterized in that: The step five specifically includes: Sampling support and query sets from the target sample; Input the target sample into the embedding network to obtain the feature vectors of the support set and the query set; Input the feature vector into the universal feature enhancer to obtain the feature vectors of the enhanced support set and query set; The enhanced feature vectors of the support set and the query set are input into the projection distance measurement unit to obtain the confidence of the query set; The predicted labels of the query set are obtained according to the confidence of the query set, and the image classification results are obtained according to the predicted labels.

10. A contrastive self-supervised reinforcement learning system, characterized in that: include: An enhancement module is used to perform data enhancement on training samples to obtain transformation enhancement samples and rotation enhancement samples; A contrastive self-supervised reinforcement learning module is used to input the transformation reinforcement sample and the rotation reinforcement sample into the contrastive self-supervised reinforcement learning model to obtain the transformation feature vector, the rotation feature vector, the confidence of the transformation feature vector and the confidence of the rotation feature vector; A loss module, used to obtain a predicted category of a transformation-enhanced sample according to a confidence level of a transformation feature vector, and to calculate a transformation loss between a predicted category and a true category of the transformation-enhanced sample according to the transformation feature vector; The predicted rotation angle of the rotation enhancement sample is obtained according to the confidence of the rotation feature vector, and the rotation loss between the predicted rotation angle and the true rotation angle of the rotation enhancement sample is calculated according to the rotation feature vector; Calculate confidence loss based on positive samples of different data augmentation types; A training module is used to calculate the total loss based on the transformation loss, rotation loss and confidence loss, and optimize the contrastive self-supervised reinforcement learning model parameters by minimizing the total loss to obtain the optimal contrastive self-supervised reinforcement learning model; The classification module is used to input the target sample into the optimal contrast self-supervised reinforcement learning model to obtain the image classification result.

Citation Information

Cited By

  • Machine learning training sample-oriented efficient data version management platform

    CN120104595A

  • New goods category discovery method based on asymmetric enhancement and confidence collaborative learning

    CN120236146A

  • Image classification method for worst class performance improvement under long-tail semi-supervised setting, electronic equipment, storage medium and product

    CN122289829A