Model training method, classification method and electronic device

By decoupling features and generating target category-independent features, the problem of reduced classification accuracy in few-sample learning is solved, and efficient classification is achieved in the case of few samples.

CN116092125BActive Publication Date: 2026-06-12JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2023-02-14
Publication Date
2026-06-12

Smart Images

  • Figure CN116092125B_ABST
    Figure CN116092125B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a model training method, a classification method, an electronic device, and a computer storage medium. The model training method comprises: obtaining a plurality of first samples and a plurality of second samples each having a plurality of first annotation categories; using a target classification model, performing feature decoupling on an original feature center of each first annotation category according to a first sample corresponding to each first annotation category to obtain a corresponding original category-related feature and an original category-independent feature; generating a target category-independent feature based on the original category-independent feature; fusing the original category-related feature corresponding to each first annotation category and the target category-independent feature to obtain a target feature center of each first annotation category; classifying each second sample according to the original feature center and the target feature center of the plurality of first annotation categories to obtain a predicted category of each second sample; and training the target classification model according to the predicted category and the first annotation category of the plurality of second samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of machine learning technology, and in particular to model training methods, classification methods, electronic devices, and computer-readable storage media. Background Technology

[0002] In recent years, deep learning has achieved remarkable results in data-intensive applications. However, on the one hand, the time and resource costs of data collection and labeling have made training traditional deep learning models based on supervised information increasingly difficult. On the other hand, due to privacy and security restrictions, models struggle to obtain large amounts of labeled data. Few-shot learning, as a new machine learning paradigm, aims to learn using minimal supervised information and has been applied in fields such as computer vision, natural language understanding, and recommender systems.

[0003] In related technologies, the original feature centers of each labeled category in the support set during few-shot learning are input as a whole into the generative sub-model of the classification model to generate the target feature center for each labeled category, thereby expanding the features of the support set. The samples in the query set are then classified based on the original feature centers and the target feature centers to obtain the predicted category of the samples in the query set. Finally, the classification model is trained based on the predicted category of the samples in the query set and the corresponding labeled category. Summary of the Invention

[0004] Few-shot learning involves generation and classification tasks. Generation tasks emphasize that generated features can simulate the data distribution of the original features, while classification tasks emphasize that generated features are strongly separable in the feature space. In related techniques, generating target feature centers by treating the original feature centers as a whole may weaken the features in the original feature centers that are closely related to the classification task. This can prevent the classification model from accurately learning the relevant features from the original feature centers during training, leading to reduced classification accuracy.

[0005] To address the aforementioned technical problems, this disclosure proposes a solution to improve the classification accuracy of classification models.

[0006] According to a first aspect of this disclosure, a model training method is provided, comprising: acquiring multiple first samples and multiple second samples, each having multiple first labeled categories, wherein the number of the multiple first samples is less than a number threshold; based on the first samples corresponding to each first labeled category, using a target classification model to decouple the original feature centers of each first labeled category to obtain original category-related features and original category-independent features corresponding to each labeled category; based on the original category-independent features corresponding to each first labeled category, using the target classification model to generate target category-independent features; fusing the original category-related features and target category-independent features corresponding to each first labeled category to obtain a target feature center for each first labeled category; based on the original feature centers and target feature centers of the multiple first labeled categories, using the target classification model to classify each second sample to obtain a predicted category for each second sample; and training the target classification model based on the predicted categories of the multiple second samples and the first labeled categories.

[0007] In some embodiments, decoupling the original feature centers of each first annotation category includes: determining the target semantic association information between the first sample corresponding to each first annotation category and the first sample corresponding to other first annotation categories; and decoupling the original feature centers of each first annotation category according to the determined target semantic association information.

[0008] In some embodiments, determining the target semantic association information between the first sample corresponding to each first annotation category and the first sample corresponding to other first annotation categories includes: determining local semantic association information between each local feature of the original feature center of each first annotation category and each local feature of the original feature center of other first annotation categories based on the original feature center of each first annotation category and the original feature center of other first annotation categories; and determining global semantic association information corresponding to each first annotation category based on the local semantic association information corresponding to each first annotation category, as the target semantic association information.

[0009] In some embodiments, the local semantic association information corresponding to each first label category is represented as a local association matrix, which includes multiple element values, including a first element value and a second element value. The first element value characterizes the degree of semantic association between a local feature of the original feature center of each first label category and a local feature of the original feature center of another first label category. The second element value characterizes the degree of semantic association between a local feature of the original feature center of each first label category and any local feature of the original feature center of each first label category. The second element value is less than the first element value.

[0010] In some embodiments, feature decoupling of the original feature centers of each first label category includes: determining a mask matrix corresponding to each first label category based on global semantic association information corresponding to each first label category, wherein each element value in the mask matrix represents the degree of class independence of the corresponding local feature center of the original feature center of each first label category relative to the class of each first label category; and decoupling the original feature centers of each first label category based on the mask matrix corresponding to each first label category to obtain original class-related features and original class-independent features corresponding to each first label category.

[0011] In some embodiments, the target classification model includes a meta-learner, and determining the mask matrix corresponding to each first labeled category includes: determining a fusion kernel using the meta-learner based on global semantic association information corresponding to each first labeled category; using the fusion kernel, fusing the local semantic association information between each local feature of the original feature center of each first labeled category and all local features of the original feature centers of other first labeled categories to obtain the degree of category independence of each local feature of the original feature center of each first labeled category relative to each first labeled category; and determining the mask matrix corresponding to each first labeled category based on the degree of category independence corresponding to each local feature of the original feature center of each first labeled category.

[0012] In some embodiments, determining the mask matrix corresponding to each first annotation category based on the degree of category independence corresponding to each local feature of the original feature center of each first annotation category includes: normalizing the degree of category independence corresponding to each local feature of the original feature center of each first annotation category; and determining the mask matrix corresponding to each first annotation category based on the normalized degree of category independence corresponding to each local feature of the original feature center of each first annotation category.

[0013] In some embodiments, at least one training task exists during model training, each training task having multiple first samples and multiple second samples of multiple first labeled categories. Training the target classification model includes: determining a prediction loss value based on the predicted categories of the multiple second samples and the multiple first labeled categories; determining a first predicted category of the first sample in all first labeled categories of the at least one training task based on the original category-related features of the first sample corresponding to each first labeled category; determining a second predicted category of the first sample in all first labeled categories of the at least one training task based on the original category-related features and target category-independent features of the first sample corresponding to each first labeled category; and training the target classification model based on the prediction loss value, a first degree of difference between the first predicted category and the first labeled category of the first sample, and a second degree of difference between the second predicted category and the first labeled category of the first sample, wherein the training objective includes reducing the first degree of difference and the second degree of difference.

[0014] In some embodiments, training the target classification model includes: determining the similarity between the original category-related features of a first sample having the same first labeled category as each second sample and the second sample, as a first similarity; determining the similarity between the target feature center of the first labeled category of each second sample and the second sample, as a second similarity; and training the target classification model based on the predicted loss value, the first difference, the second difference, the first similarity, and the second similarity, wherein the training objective further includes reducing the first similarity and the second similarity.

[0015] In some embodiments, training the target classification model includes: determining the sum of similarities between the category-related features of each second sample and each first sample, as a third similarity; determining the sum of similarities between each second sample and each target feature center, as a fourth similarity; and training the target classification model based on the predicted loss value, the first difference, the second difference, the first similarity, the second similarity, the third similarity, and the fourth similarity, wherein the training objective further includes increasing the third similarity and the fourth similarity.

[0016] In some embodiments, training the target classification model includes: determining the degree of difference between the target feature centers of the plurality of first labeled categories and the original feature centers as a third degree of difference; training the target classification model based on the predicted loss value, the first degree of difference, the second degree of difference, the third degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity and the fourth degree of similarity, wherein the training objective further includes reducing the third degree of difference.

[0017] In some embodiments, generating target class-independent features includes: determining the posterior distribution of latent variables corresponding to the original class-independent features corresponding to each first labeled class, using the class encoding of the original class-related features corresponding to each first labeled class as a condition; sampling multiple latent variables from the determined posterior distribution; and reconstructing the multiple latent variables to obtain multiple target class-independent features corresponding to each first labeled class.

[0018] In some embodiments, training the target classification model includes: determining the degree of difference between the original class-independent features corresponding to the plurality of first labeled categories and the target class-independent features, as a fourth degree of difference; determining the degree of difference between the posterior distribution of the latent variable and the prior distribution of the latent variable, as a fifth degree of difference; and training the target classification model according to the fourth degree of difference and the fifth degree of difference, wherein the training objective includes reducing the fourth degree of difference and the fifth degree of difference.

[0019] In some embodiments, the target classification model includes a maximum a posteriori (MAP)-based quadratic discriminant analysis (QDA) classifier. Classifying each second sample includes: classifying each second sample using the MAP-based QDA classifier based on the original feature centers and target feature centers of each first labeled category, thereby obtaining a predicted category for each second sample. The parameters of the MAP-based QDA classifier are prior distribution parameters of the mean and variance of the sample distribution of the first sample corresponding to each first labeled category, and the prior distribution parameters are used as training parameters in the process of training the target classification model.

[0020] In some embodiments, the target classification model is used for image classification.

[0021] According to a second aspect of this disclosure, a classification method is provided, comprising: acquiring a plurality of third samples having a plurality of second labeled categories and a fourth sample to be classified, wherein the number of the plurality of third samples is less than a number threshold; based on the third sample corresponding to each second labeled category, using a target classification model, decoupling the original feature centers of each second labeled category to obtain original category-related features and original category-independent features corresponding to each labeled category; based on the original category-independent features corresponding to each second labeled category, using the target classification model to generate target category-independent features; fusing the original category-related features and target category-independent features corresponding to each second labeled category to obtain a target feature center for each second labeled category; and classifying each fourth sample using the target classification model based on the original feature centers and target feature centers of the plurality of second labeled categories to obtain a predicted category for each fourth sample, wherein the second labeled category belongs to a different labeled category than the first labeled category used in training the target classification model.

[0022] According to a third aspect of this disclosure, an electronic device is provided, configured to perform the model training method or the classification method described in any of the above embodiments.

[0023] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute, based on instructions stored in the memory, the model training method described in any of the foregoing embodiments or the classification method described in any of the foregoing embodiments.

[0024] According to a fifth aspect of this disclosure, a computer-storeable medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the model training method or the classification method described in any of the foregoing embodiments.

[0025] In the above embodiments, the classification accuracy of the classification model is improved. Attached Figure Description

[0026] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the specification, serve to explain the principles of this disclosure.

[0027] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description.

[0028] in:

[0029] Figure 1 This is a flowchart illustrating a model training method according to some embodiments of the present disclosure;

[0030] Figure 2This is a schematic diagram illustrating feature decoupling according to some embodiments of the present disclosure;

[0031] Figure 3 This is a schematic diagram illustrating the generation of target feature centers according to some embodiments of the present disclosure;

[0032] Figure 4 This is a schematic diagram illustrating a meta-quadratic discriminant analysis according to some embodiments of the present disclosure;

[0033] Figure 5 This is a flowchart illustrating a classification method according to some embodiments of the present disclosure;

[0034] Figure 6 This is a block diagram illustrating an electronic device according to some embodiments of the present disclosure;

[0035] Figure 7 This is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure. Detailed Implementation

[0036] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0037] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0038] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.

[0039] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0040] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0041] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0042] Figure 1 This is a flowchart illustrating a model training method according to some embodiments of the present disclosure.

[0043] like Figure 1As shown, the model training method includes: step S110, obtaining multiple first samples and multiple second samples, each having multiple first labeled categories, wherein the number of multiple first samples is less than a quantity threshold; step S120, based on the first sample corresponding to each first labeled category, using a target classification model to decouple the original feature centers of each first labeled category, obtaining original category-related features and original category-independent features corresponding to each labeled category; step S130, based on the original category-independent features corresponding to each first labeled category, using a target classification model to generate target category-independent features; step S140, fusing the original category-related features and target category-independent features corresponding to each first labeled category to obtain the target feature center of each first labeled category; step S150, based on the original feature centers and target feature centers of multiple first labeled categories, using a target classification model to classify each second sample, obtaining the predicted category of each second sample; and step S160, training the target classification model based on the predicted categories of multiple second samples and the first labeled categories. In some embodiments, the model training method is performed by a model training device. For example, the target classification model is used for image classification. Image classification includes few-sample image classification. The target classification model can also be used in other classification domains with smaller sample sizes.

[0044] In the above embodiments, during the training of the target classification model, feature decoupling is performed on the original feature centers of each first labeled category to distinguish between original category-related features that are highly correlated with the first labeled category and original category-irrelevant features that are less correlated with the first labeled category. Target category-irrelevant features are generated based on the original category-irrelevant features, and feature expansion of the first sample is achieved by fusing the original category-related features and the target category-irrelevant features. By retaining the original category-related features during feature expansion, the inconsistency between the generation task and the classification task is considered. This ensures that while maintaining the diversity of generated features, the classification model can more accurately learn the features in the original feature centers that are closely related to the classification task, thereby improving classification accuracy when the sample size is limited.

[0045] In step S110, multiple first samples and multiple second samples, each having multiple first labeled categories, are obtained, wherein the number of the multiple first samples is less than a quantity threshold. In some embodiments, taking few-shot classification as an example, the multiple first samples with multiple first labeled categories constitute the support set in the training task of few-shot classification, and the multiple second samples with multiple first labeled categories constitute the query set in the training task of few-shot classification.

[0046] In some embodiments, each first annotation category may correspond to one or more first samples, or one or more second samples.

[0047] In step S120, based on the first sample corresponding to each first labeled category, the target classification model is used to decouple the original feature centers of each first labeled category, resulting in original category-related features and original category-independent features corresponding to each labeled category. The correlation between the original category-related features and each first labeled category is greater than the correlation between the original category-independent features and each first labeled category.

[0048] In some embodiments, the target classification model extracts the sample features of the first sample corresponding to each first labeled category, and determines the average value of the sample features of the first sample corresponding to each first labeled category as the original feature center (also called the category prototype) of each first labeled category. For example, taking C first labeled categories as an example, the original feature centers of C first labeled categories are represented as S = {X1, X2, ..., X...} C The original category-related features are represented as follows: The original class-independent feature is represented as

[0049] In some embodiments, step S120 can be implemented by the following steps 1)-2).

[0050] In step 1), the target semantic association information between the first sample corresponding to each first annotation category and the first sample corresponding to other first annotation categories is determined.

[0051] For example, the target semantic association information can be determined in the following way.

[0052] First, based on the original feature centers of each first annotation category and the original feature centers of other first annotation categories, determine the local semantic association information between each local feature of the original feature center of each first annotation category and each local feature of the original feature center of other first annotation categories.

[0053] In some embodiments, the local semantic association information corresponding to each first labeled category is represented as a local association matrix. The local association matrix includes multiple element values, including a first element value and a second element value. The first element value characterizes the degree of semantic association between a local feature of the original feature center of each first labeled category and a local feature of the original feature center of another first labeled category. The second element value characterizes the degree of semantic association between a local feature of the original feature center of each first labeled category and any local feature of the original feature center of each first labeled category.

[0054] In some embodiments, the second element value is less than the first element value. This reduces the impact of the correlation information between local features of each first labeled category on feature decoupling, thereby further improving the accuracy of feature decoupling and classification accuracy. For example, the second element value can be set to 0 to eliminate the influence of the connections between local features of the original feature center on feature decoupling.

[0055] In some embodiments, the first element value in the i-th row and j-th column of the local association matrix corresponding to each first label category is based on the semantic association degree between the i-th local feature of the original feature center of each first label category after normalization and the (j%m)-th local feature of the original feature center of the ((j / m)+1)-th first label category after normalization. m is the total number of local features of the original feature center.

[0056] For example, the original feature center X c Local correlation matrix M c The element in the i-th row and j-th column is represented as Represents prototype X c The i-th local feature. In this way, the local correlation matrix M... c The i-th row Includes prototype X c The degree of semantic association between the i-th local feature and the local features of all other class prototypes.

[0057] Then, based on the local semantic association information corresponding to each first labeled category, the global semantic association information corresponding to each first labeled category is determined as the target semantic association information. The target semantic association information, which is the global semantic association information obtained through the local semantic association information, can represent the global association information between the first labeled category and all other first labeled categories, thereby more accurately understanding the feature decoupling process and further improving classification accuracy.

[0058] In some embodiments, a global average pooling operation is performed on the local semantic association information corresponding to each first annotation category to obtain the global semantic association information corresponding to each first annotation category. For example, the global average pooling operation on the local association matrix is ​​represented as GAP(M c ).

[0059] In step 2), feature decoupling is performed on the original feature centers of each first labeled category based on the determined target semantic association information. This decoupling is achieved by capturing the classification task information corresponding to each first labeled category through the semantic association between first samples of different first labeled categories. This considers the important feature information that distinguishes each first labeled category from other first labeled categories, thus enabling more accurate feature decoupling and ensuring that the target classification model can focus on the most discriminative feature parts, thereby further improving classification accuracy.

[0060] In some embodiments, feature decoupling can be performed in the following manner.

[0061] First, based on the global semantic association information corresponding to each first annotation category, a mask matrix is ​​determined for each first annotation category. Each element value in the mask matrix represents the degree to which the corresponding local features of the original feature center of each first annotation category are irrelevant to the category of each first annotation category.

[0062] Taking a target classification model including the original learner as an example, a fusion kernel is determined using a meta-learner based on the global semantic association information corresponding to each first labeled category. Using the fusion kernel, the local semantic association information between each local feature of the original feature center of each first labeled category and all local features of the original feature centers of other first labeled categories is fused to obtain the degree of category independence of each local feature of the original feature center of each first labeled category relative to each first labeled category. Based on the degree of category independence corresponding to each local feature of the original feature center of each first labeled category, a mask matrix corresponding to each first labeled category is determined. The fusion kernel focuses cross-attention on other first labeled categories, thus obtaining the degree of category independence.

[0063] In some embodiments, the meta-learner includes two fully connected layers. For example, the meta-learner adaptively outputs a fusion kernel w corresponding to the first labeled category c. c =W2×(σ×(W1×(GAP(M)) c W1 and W2 are the parameters of the two fully connected layers, and σ represents the ReLU (Rectified Linear Units) activation function. The fusion kernel obtained in this way fully considers the inter-class semantic information within the current task, and can guide the subsequent feature decoupling process to obtain the most differentiated class-related features based on the task information.

[0064] In some embodiments, using the fusion kernel corresponding to each first labeled category as weight, each row of the local association matrix corresponding to each first labeled category is fused to obtain the degree of class independence of each local feature of the original feature center of each first labeled category relative to each first labeled category. For example, the degree of class independence of multiple local features constitutes a mask matrix, such as denoted as A. c .

[0065] In some embodiments, the class independence degree corresponding to each local feature of the original feature center of each first labeled class can be normalized; based on the normalized class independence degree corresponding to each local feature of the original feature center of each first labeled class, a mask matrix corresponding to each first labeled class is determined. For example, the mask matrix A is obtained by normalization using the softmax function. c Mask matrix A c The i-th element is represented as This indicates the transpose operation.

[0066] Then, based on the mask matrix corresponding to each first label category, the original feature centers of each first label category are decoupled to obtain the original category-related features and original category-independent features corresponding to each first label category.

[0067] In some embodiments, the original feature centers of each first labeled category are multiplied using the mask matrix corresponding to each first labeled category to obtain original category-related features corresponding to each first labeled category. Then, the complementary matrix of the mask matrix corresponding to each first labeled category (reflecting the degree of category relevance of each local feature of the original feature center of each first labeled category relative to each first labeled category) is multiplied using the original feature centers of each first labeled category to obtain original category-independent features corresponding to each first labeled category. For example, category-related features. Category-independent features

[0068] The following will combine Figure 2 The given example describes the feature decoupling process in detail.

[0069] Figure 2 This is a schematic diagram illustrating feature decoupling according to some embodiments of the present disclosure.

[0070] like Figure 2 As shown, taking the first labeled categories including categories 1, 2, 3, 4, and 5 as an example, categories 1, 2, 3, 4, and 5 represent different birds. The original feature centers of the five first labeled categories constitute the set S = {X1, X2, X3, X4, X5}. Figure 2The original feature center is represented by a cuboid, which is for illustration only and does not represent any shape.

[0071] like Figure 2 As shown, each original feature center includes four local features, represented by four cuboids. Taking category 1 as an example, its corresponding local semantic association information is represented by the local association matrix M1. Figure 2 Each square in the matrix represents an element value of the matrix.

[0072] Elements of the local correlation matrix M1 Represents the first local feature of the original feature center X1 The fourth local feature of the original feature center X2 The degree of semantic connection between them. Figure 2 Each element in each row of the local association matrix M1 represents the degree of semantic association between the corresponding local feature of the original feature center X1 and each local feature of all original feature centers. For example, the values ​​of columns 1 to 4 of the local association matrix are set to 0 to eliminate the influence of the association information between local features on decoupling.

[0073] The local association matrix M1 is subjected to global average pooling along its rows to obtain global semantic association information. This global semantic association information is then input into the meta-learner to obtain the fusion kernel w1.

[0074] Using the fusion kernel w1, the local correlation matrix M1 is meta-fused to obtain the mask matrix A1. The mask matrix A1 is then reshaped (normalized) and multiplied by the original feature center X1 to obtain the original class-independent features.

[0075] The original category-related features are obtained by performing a dot product operation between the complementary matrix 1-A1 of the normalized mask matrix A1 and the original feature center X1.

[0076] For example, Figure 2 The feature decoupling process shown is performed by the Task-adaptive Feature Disentanglement Module (TaFDM) of the target classification model.

[0077] return Figure 1 In step S130, target category-independent features are generated based on the original category-independent features corresponding to each first labeled category using the target classification model.

[0078] In some embodiments, step S130 can be implemented by using variational inference techniques.

[0079] The principle of variational inference techniques is as follows.

[0080] Since category-independent features caused by factors such as lighting conditions and background have a certain degree of similarity, it is assumed that they follow a certain distribution. yes The corresponding latent variables. Considering that the generated class-independent features may be inconsistent with class-related features, a class code c is introduced to further refine the posterior distribution of the latent variables. Modeling is performed.

[0081] Variational distributions are introduced using variational inference techniques. The true posterior distribution is simulated by minimizing the Kullback-Leibler divergence. KL divergence can be expressed as... Where φ is the parameter of the variational inference network.

[0082] because Unaffected by φ, minimizing the KL divergence is equivalent to maximizing the ELBO term, where, In variational inference techniques, a prior distribution is assumed. A unit isotropic Gaussian distribution The posterior distribution is a multidimensional Gaussian distribution.

[0083] Generating target category-independent features involves the following steps.

[0084] First, based on the original class-independent features corresponding to each first labeled category, and using the class encoding of the original class-related features corresponding to each first labeled category as a condition, the posterior distribution of the latent variables corresponding to the original class-independent features corresponding to each first labeled category is determined. In some embodiments, the encoder in the conditional variational autoencoder is used to determine the parameters of the posterior distribution (also called the variational distribution) of the latent variables to determine the posterior distribution.

[0085] Then, multiple latent variables are sampled from the determined posterior distribution.

[0086] Finally, the multiple latent variables are reconstructed to obtain multiple target class-independent features corresponding to each first labeled category. In some embodiments, the decoder in the conditional variational autoencoder is used to reconstruct the multiple latent variables.

[0087] Original category-independent features For example, the encoder uses class-independent features As input, the output is the variational distribution. The parameters μ and σ. From the variational distribution Latent variables obtained from sampling As input to the decoder, the output is the reconstructed class-independent features. In this way, the KL term in the variational inference principle formula can be explicitly calculated, and maximizing the expectation term in the formula is equivalent to minimizing... and The Euclidean distance between them.

[0088] For example, from variational distribution Sampling A hidden variable, obtained through the decoder Generated class-independent features Will Generated class-independent features Features related to the corresponding category The fusion process yields enhanced feature centers (also known as enhanced support sets). λfuse represents the fusion coefficient. This method ensures that while enhancing the support set samples, the enhanced feature centers possess strong separability and high diversity.

[0089] The following will be based on Figure 2 Combination Figure 3 Describe in detail the process of generating target category-independent features.

[0090] Figure 3 This is a schematic diagram illustrating the generation of target feature centers according to some embodiments of the present disclosure.

[0091] like Figure 3 As shown, Figure 2 The original class-related features obtained from the decoupling are mainly concentrated on the bird's head, while the original class-independent features are mainly concentrated on the bird's body. By inputting the original class-independent features of each category (1 to 5) into the encoder of the variational inference network, and using the original class-related features of each category as the condition of the variational inference network, the mean and variance of the variational distribution of the latent variables corresponding to each category are obtained. Then, multiple latent variables are sampled from the variational distribution based on the mean and variance, and the sampled latent variables are input into the decoder of the variational inference network to obtain the target class-independent features for each category. Figure 3 The image shows one target category-independent feature for each category, which is for illustrative purposes only and does not represent the number of target category-independent features generated.

[0092] return Figure 1 In step S140, the original category-related features and target category-independent features corresponding to each first labeled category are fused to obtain the target feature center for each first labeled category. For example, the target feature center of the first labeled category c is represented as... For example, the target feature centers of multiple first-labeled categories are represented as follows:

[0093] Combination Figure 3 The original category-related features of each category are fused with the target category-independent features of each category to obtain the target feature center for each category. Together they constitute the set of target feature centers.

[0094] For example, Figure 3 The target feature center generation process shown is executed by the Variational Feature Hallucination Module (VFHM) of the target classification model.

[0095] return Figure 1 In step S150, based on the original feature centers and target feature centers of multiple first labeled categories, the target classification model is used to classify each second sample to obtain the predicted category of each second sample.

[0096] In some embodiments, the target classification model includes a Maximum A Posteriori (MAP)-based Quadratic Discriminant Analysis (QDA) classifier. Classifying each second sample involves: using the MAP-based QDA classifier to classify each second sample based on the original feature centers and target feature centers of each first labeled category, thereby obtaining a predicted category for each second sample. The parameters of the MAP-based QDA classifier are prior distribution parameters of the mean and variance of the sample distribution of the first samples corresponding to each first labeled category. These prior distribution parameters serve as training parameters in the process of training the target classification model.

[0097] The principle of the quadratic discriminant analysis classifier based on maximum a posteriori is as follows.

[0098] When using quadratic discriminant analysis to enhance the support set During classification, the results are influenced by the generated samples because the data distribution simulated using a very small number of samples introduces uncertainty. To address this, a strong prior distribution of the quadratic classifier parameters is introduced through meta-learning, enabling the generation of a class-specific posterior distribution using only a small number of samples. Specifically, quadratic discriminant analysis assumes that samples of class c follow a multidimensional Gaussian distribution. The class prediction of the query set sample x can be calculated using Bayes' theorem.

[0099] From a Bayesian perspective, infer the distribution of class c samples. The posterior distribution of the parameter p(μ) c ,∑ c When both the mean and variance are unknown, the conjugate prior of the multivariate normal distribution is the inverse Wissaud distribution. Therefore, the inverse Wissaud distribution is introduced as its prior distribution. Based on Bayes' theorem, the posterior distribution p(μ) can be explicitly calculated. c ,∑ c The analytical form of ) is expressed as: {m c ,κ c ,Ψ c ,v c} represents the parameters of the posterior distribution, and {m,κ,Ψ,v} represents the meta-parameters.

[0100] The fast fit process from the prior distribution to the posterior distribution is calculated as follows:

[0101]

[0102]

[0103]

[0104] In the above rapid adaptation process This refers to the total number of target category-irrelevant features corresponding to the first labeled category c in the aforementioned embodiments. To augment the i-th element of the support set. In this way, the prior distribution can be used and the augmented dataset can be utilized. The corresponding posterior distribution is obtained through rapid adaptation. To simplify computation, maximum a posteriori estimation can be used to obtain μ. c ,∑ c The point estimate, expressed as d is the dimension of the feature.

[0105] After obtaining the point estimate, the result is calculated based on Bayes' theorem. Class prediction can be performed on sample x. In this way, the meta-parameters {m,κ,Ψ,v} can be optimized based on the classification performance of the query set samples, so that the prior distribution can be adjusted according to the enhanced support set. The rapid adaptation yields a category-specific posterior distribution, further mitigating the uncertainty of the augmented support set samples.

[0106] The above classification process is, for example, the specific operation of a Meta-Quadratic Discriminant Analysis (MetaQDA) classifier. {m,κ,Ψ,v} are obtained by training a MAP-based QDA classifier through meta-learning based on the predicted category.

[0107] Figure 4 This is a schematic diagram illustrating a meta-quadratic discriminant analysis according to some embodiments of the present disclosure.

[0108] like Figure 4 As shown, based on Figure 3 The obtained target feature center set The union of the original feature center set S and the original feature center set S constitutes the enhanced support set S. aua Utilizing the prior distribution p(μ) of the enhanced support set c ,Σ c The corresponding posterior distribution p(μ) is obtained through rapid adaptation. c ,Σ c |X c Then, the posterior distribution is used to classify the query set Q, which consists of multiple second samples, to obtain the predicted category of the second sample in the query set Q (represented by a pentagram in the figure). As can be seen from the figure, the original feature centers in the original feature center set (represented by triangles) and the target feature centers in the target feature center set (represented by circles) are also classified into different categories.

[0109] For example, Figure 4 The classification process shown is performed by the Meta-learned Quadratic Discriminant Analysis Module (MQDAM) in the target classification model.

[0110] return Figure 1 In step S160, a target classification model is trained based on the predicted categories of multiple second samples and the first labeled categories.

[0111] In some embodiments, there is at least one training task during the model training process, and each training task has multiple first samples and multiple second samples of multiple first labeled categories. Training the target classification model may include the following steps.

[0112] First, the prediction loss is determined based on the predicted categories of multiple second samples and the multiple labeled categories of the first samples. For example, the prediction loss corresponding to the query set Q composed of multiple second samples is expressed as follows:

[0113] Secondly, based on the original category-related features of the first sample corresponding to each first labeled category, the first predicted category of that first sample among all first labeled categories in at least one training task is determined. Taking few-sample classification as an example, all first labeled categories of at least one training task belong to the base class. In some embodiments, a base class-based method D can be used. base A learnable global classifier determines the first predicted category. For example, the first predicted category is represented as... Where GAP() is the global average pooling operation, and W is the parameter of the global classifier.

[0114] Then, based on the original class-related features and target class-independent features of the first sample corresponding to each first labeled category, a second predicted category for the first sample is determined from all first labeled categories in at least one training task. In some embodiments, a base-class learnable classifier can be used to determine the second predicted category. For example, the second predicted category is represented as... Where GAP() is the global average pooling operation, and W is the parameter of the global classifier.

[0115] Finally, based on the predicted loss value, the first degree of difference between the first predicted class and the first labeled class of the first sample, and the second degree of difference between the second predicted class and the first labeled class of the first sample, the target classification model is trained, and the training objective includes reducing the first degree of difference and the second degree of difference.

[0116] In the above embodiments, training the target classification model by reducing the first degree of difference and the second degree of difference can preserve the necessary semantic information of the features, thereby ensuring the classification accuracy of the features in the base class, constraining feature decoupling, making feature decoupling more accurate, and thus further improving classification accuracy.

[0117] In some embodiments, the first degree of difference and the second degree of difference are determined using a cross-entropy loss function. For example, the first degree of difference is expressed as... The second degree of difference is expressed as Among them, g c for and The global class label is the first labeled class for all training tasks.

[0118] In some embodiments, the loss value of the global loss function can be determined based on a first degree of difference and a second degree of difference, denoted as:

[0119] In some embodiments, training an object classification model includes the following steps, based on a predicted loss value, a first degree of difference between a first predicted class and a first labeled class of the first sample, and a second degree of difference between a second predicted class and a first labeled class of the first sample.

[0120] First, the similarity between the original category-related features of the first samples that have the same first labeled category as each second sample and each second sample is determined as the first similarity. In some embodiments, the first similarity corresponding to the second sample q is expressed as: Among them, c q Let be the local class label of the second sample q. The local class label belongs to multiple first-labeled classes in the current training task. s() is a similarity function based on Euclidean distance. This represents the original category-related features of the first sample that has the same first labeled category as the second sample q.

[0121] Then, the similarity between the target feature center of the first labeled category of each second sample and each second sample is determined as the second similarity. In some embodiments, the first similarity corresponding to the second sample q is expressed as... The first labeled category c represents the first labeled category possessed by the second sample q. q The target feature center.

[0122] Finally, the target classification model is trained based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, and the second degree of similarity. The training objective also includes reducing the first degree of similarity and the second degree of similarity.

[0123] In the above embodiments, both the first similarity and the second similarity reflect the similarity between features of the same labeled category, belonging to intra-class similarity or intra-class distance. By reducing intra-class distance or intra-class similarity, the accuracy of feature decoupling can be further guaranteed, thereby further improving classification accuracy.

[0124] In some embodiments, training a target classification model based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, and the second degree of similarity includes the following steps.

[0125] First, the sum of the similarities between the category-related features of each second sample and each first sample is determined as the third similarity.

[0126] Then, the sum of the similarities between each second sample and each target feature center is determined as the fourth similarity.

[0127] Finally, the target classification model is trained based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity, and the fourth degree of similarity. The training objective also includes increasing the third and fourth degree of similarity.

[0128] In the above embodiments, both the third and fourth similarity levels reflect the inter-class distance between sample features of different labeled categories in the feature space of the support set of the current training task. By increasing the inter-class distance, the strong separability between category-related features and generated target category-independent features can be guaranteed, thereby further improving the decoupling accuracy and further improving the classification accuracy.

[0129] In some embodiments, the loss value of the local classification loss can be determined based on a first similarity level, a second similarity level, a third similarity level, and a fourth similarity level, and is expressed as follows: The local classification loss classifies the second sample based on the Euclidean distance between the corresponding prototypes using a parameterless classifier.

[0130] The total classification loss can be expressed as

[0131] In some embodiments, training the target classification model based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity, and the fourth degree of similarity includes the following steps.

[0132] First, the degree of difference between the target feature centers of multiple first-labeled categories and the original feature centers is determined as a third degree of difference. In some embodiments, the third degree of difference is the degree of difference between the feature mean of the target feature centers of multiple first-labeled categories and the feature mean of the original feature centers. For example, the third degree of difference is represented by Euclidean distance. in, The feature mean representing the center of the target feature. The mean of the original feature centers.

[0133] Then, based on the predicted loss value, the first degree of difference, the second degree of difference, the third degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity, and the fourth degree of similarity, the target classification model is trained. The training objective also includes reducing the third degree of difference. By reducing the third degree of difference, the position of each feature center in the feature space can be constrained, so that the offset of the target feature center of the same labeled class relative to the original feature center is not too large, thereby improving the accuracy of feature decoupling and further improving the classification accuracy.

[0134] Taking the generation of target category-independent features using variational inference techniques as an example, training a target classification model includes the following steps.

[0135] First, the degree of difference between the original class-independent features and the target class-independent features corresponding to multiple first-labeled categories is determined, and this is defined as the fourth degree of difference. For example, the fourth degree of difference is expressed as... and European distance

[0136] Then, the degree of difference between the posterior and prior distributions of the latent variables is determined, serving as the fifth degree of difference. For example, the fifth degree of difference is expressed using KL divergence as...

[0137]

[0138] Finally, based on the fourth and fifth degrees of dissimilarity, the target classification model is trained, with the training objectives including reducing the fourth and fifth degrees of dissimilarity. Reducing the fourth degree of dissimilarity makes the generated target class-irrelevant features closer to the original class-irrelevant features, improving the accuracy of the generated target class-irrelevant features and thus improving classification accuracy. Reducing the fifth degree of dissimilarity makes the posterior distribution of the latent variables simulated by the variational distribution of the variational inference network closer to the prior distribution of the latent variables as a standard normal distribution, making sampling simpler.

[0139] In some embodiments, the loss value of the loss function of the response can be determined based on the fourth and fifth degrees of difference, and can be expressed as follows:

[0140]

[0141] In some embodiments, the loss value of the overall loss function for training the target classification model can be expressed as L = λ. cls L cls +λ var L var +λ pre L pre +λ loc L loc That is, the weighted sum of different loss values. λ cls , λ var , λ pre , λ loc These are the coefficients of the corresponding loss function.

[0142] Figure 5 This is a flowchart illustrating a classification method according to some embodiments of the present disclosure.

[0143] like Figure 5As shown, the classification method includes steps S510-S550. For example, the classification method is performed by a classification device.

[0144] In step S510, multiple third samples with multiple second labeled categories and a fourth sample to be classified are obtained. The number of multiple third samples is less than a quantity threshold.

[0145] In step S520, based on the third sample corresponding to each second labeled category, the target classification model is used to decouple the original feature centers of each second labeled category to obtain the original category-related features and original category-independent features corresponding to each labeled category.

[0146] In step S530, target category-independent features are generated based on the original category-independent features corresponding to each second labeled category using the target classification model.

[0147] In step S540, the original category-related features and target category-independent features corresponding to each second annotation category are fused to obtain the target feature center of each second annotation category.

[0148] In step S550, based on the original feature centers and target feature centers of multiple second-label categories, the fourth sample is classified using the target classification model to obtain the predicted category of the fourth sample. The second-label categories belong to different label categories than the first-label categories in the training target classification model.

[0149] The implementation of each of the relevant embodiments in steps S510-S550 above can be referred to the relevant embodiments of the above model training method.

[0150] In some embodiments, the classification method includes: acquiring multiple third samples with multiple second labeled categories and a fourth sample to be classified; and determining the predicted category of the fourth sample to be classified based on the multiple third samples using a target classification model, wherein the target classification model is obtained through the model training method in any of the foregoing embodiments. The number of multiple third samples is less than a number threshold.

[0151] In some embodiments, this disclosure provides an electronic device. This electronic device is configured to perform model training or classification methods as described in any of the embodiments of this disclosure.

[0152] Figure 6 This is a block diagram illustrating an electronic device according to some embodiments of the present disclosure.

[0153] like Figure 6As shown, the electronic device 6 includes a memory 61 and a processor 62 coupled to the memory 61. The memory 61 is used to store instructions for executing embodiments of model training methods or classification methods. The processor 62 is configured to execute model training methods or classification methods in any of the embodiments of this disclosure based on the instructions stored in the memory 61. The electronic device, for example, includes an execution... Figure 1 The model training apparatus for each step shown may include the module for execution. Figure 5 The module classification device for each step shown.

[0154] Figure 7 This is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.

[0155] like Figure 7 As shown, the computer system 70 can be represented in the form of a general computing device. The computer system 70 includes a memory 710, a processor 720, and a bus 700 connecting different system components.

[0156] The memory 710 may include, for example, system memory, non-volatile storage media, etc. The system memory may store, for example, an operating system, application programs, a boot loader, and other programs. The system memory may include volatile storage media, such as random access memory (RAM) and / or cache memory. The non-volatile storage media may store, for example, instructions for executing at least one embodiment of a model training method or a classification method. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, etc.

[0157] The processor 720 can be implemented using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete hardware components such as discrete gates or transistors. Accordingly, each module, such as the decision module and the determination module, can be implemented by the central processing unit (CPU) running instructions in memory to execute the corresponding steps, or by dedicated circuitry to execute the corresponding steps.

[0158] Bus 700 can use any of the various bus architectures. For example, bus architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.

[0159] The computer system 70 may also include an input / output interface 730, a network interface 740, and a storage interface 750. These interfaces 730, 740, and 750, as well as the memory 710 and processor 720, can be connected via a bus 700. The input / output interface 730 provides a connection interface for input / output devices such as a monitor, mouse, and keyboard. The network interface 740 provides a connection interface for various networked devices. The storage interface 750 provides a connection interface for external storage devices such as floppy disks, USB flash drives, and SD cards.

[0160] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations thereof, can be implemented by computer-readable program instructions.

[0161] These computer-readable program instructions are provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable device to produce a machine, such that execution of the instructions by the processor produces means for implementing the functions specified in one or more boxes of the flowchart and / or block diagram.

[0162] These computer-readable program instructions may also be stored in a computer-readable storage medium. These instructions cause a computer to work in a particular manner to produce an article of manufacture, including instructions that implement the functions specified in one or more boxes in a flowchart and / or block diagram.

[0163] This disclosure may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.

[0164] The classification accuracy of the classification model is improved by using the model training method, classification method, electronic device, and computer storage medium described in the above embodiments.

[0165] The model training method, classification method, electronic device, and computer-readable storage medium according to this disclosure have been described in detail above. To avoid obscuring the concept of this disclosure, some details known in the art have not been described. Those skilled in the art will fully understand how to implement the technical solutions disclosed herein based on the above description.

Claims

1. A model training method, comprising: Acquire multiple first samples and multiple second samples, each having multiple first labeled categories, wherein the number of the multiple first samples is less than a quantity threshold; Based on the first sample corresponding to each first labeled category, the target classification model is used to decouple the original feature centers of each first labeled category to obtain the original category-related features and original category-independent features corresponding to each labeled category. The target classification model is used for image classification. Based on the original category-independent features corresponding to each first labeled category, target category-independent features are generated using the target classification model; By fusing the original category-related features and target category-independent features corresponding to each first labeled category, the target feature center of each first labeled category is obtained; Based on the original feature centers and target feature centers of the multiple first labeled categories, the target classification model is used to classify each second sample to obtain the predicted category of each second sample. The target classification model is trained based on the predicted categories of the multiple second samples and the first labeled categories.

2. The model training method according to claim 1, wherein, Feature decoupling for the original feature centers of each first labeled category includes: Determine the target semantic association information between the first sample corresponding to each first annotation category and the first samples corresponding to other first annotation categories; Based on the determined target semantic association information, feature decoupling is performed on the original feature centers of each first labeled category.

3. The model training method according to claim 2, wherein, Determining the target semantic association information between the first sample corresponding to each first labeled category and the first samples corresponding to other first labeled categories includes: Based on the original feature centers of each first annotation category and the original feature centers of other first annotation categories, determine the local semantic association information between each local feature of the original feature center of each first annotation category and each local feature of the original feature center of other first annotation categories; Based on the local semantic association information corresponding to each first annotation category, global semantic association information corresponding to each first annotation category is determined as the target semantic association information.

4. The model training method according to claim 3, wherein, The local semantic association information corresponding to each first label category is represented as a local association matrix. The local association matrix includes multiple element values, including a first element value and a second element value. The first element value represents the degree of semantic association between a local feature of the original feature center of each first label category and a local feature of the original feature center of another first label category. The second element value represents the degree of semantic association between a local feature of the original feature center of each first label category and any local feature of the original feature center of each first label category. The second element value is less than the first element value.

5. The model training method according to claim 3, wherein, Feature decoupling for the original feature centers of each first labeled category includes: Based on the global semantic association information corresponding to each first label category, a mask matrix corresponding to each first label category is determined. Each element value in the mask matrix represents the degree of local feature irrelevance of the original feature center of each first label category to the category of each first label category. Based on the mask matrix corresponding to each first label category, the original feature centers of each first label category are decoupled to obtain the original category-related features and original category-independent features corresponding to each first label category.

6. The model training method according to claim 5, wherein, The target classification model includes a meta-learner, and the mask matrix corresponding to each first labeled category includes: Based on the global semantic association information corresponding to each first labeled category, the meta-learner is used to determine the fusion kernel; Using a fusion kernel, the local semantic association information between each local feature of the original feature center of each first labeling category and all local features of the original feature centers of other first labeling categories is fused to obtain the degree of class independence of each local feature of the original feature center of each first labeling category relative to each first labeling category; The mask matrix corresponding to each first label category is determined based on the degree of category independence corresponding to each local feature of the original feature center of each first label category.

7. The model training method according to claim 6, wherein, Based on the degree of category independence corresponding to each local feature of the original feature center of each first labeled category, the mask matrix corresponding to each first labeled category is determined as follows: The degree of class independence corresponding to each local feature of the original feature center of each first labeled category is normalized; The mask matrix corresponding to each first label category is determined based on the degree of class independence of each local feature corresponding to the original feature center of each first label category.

8. The model training method according to claim 1, wherein, During model training, there is at least one training task, and each training task has multiple first samples and multiple second samples of multiple first labeled categories. Training the target classification model includes: The prediction loss value is determined based on the predicted categories of the plurality of second samples and the plurality of first labeled categories; Based on the original category-related features of the first sample corresponding to each first labeled category, determine the first predicted category of the first sample among all first labeled categories in the at least one training task; Based on the original category-related features and target category-independent features of the first sample corresponding to each first labeled category, the second predicted category of the first sample is determined from all the first labeled categories of the at least one training task; The target classification model is trained based on the predicted loss value, the first degree of difference between the first predicted category and the first labeled category of the first sample, and the second degree of difference between the second predicted category and the first labeled category of the first sample. The training objective includes reducing the first degree of difference and the second degree of difference.

9. The model training method according to claim 8, wherein, Training the target classification model includes: Determine the degree of similarity between the original category-related features of the first sample that has the same first labeled category as each second sample and the second sample, as the first similarity degree; Determine the similarity between the target feature center of the first labeled category of each second sample and each second sample, as the second similarity; The target classification model is trained based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, and the second degree of similarity. The training objective further includes reducing the first degree of similarity and the second degree of similarity.

10. The model training method according to claim 9, wherein, Training the target classification model includes: The sum of the similarities between the category-related features of each second sample and each first sample is determined as the third similarity. The sum of the similarities between each second sample and each target feature center is determined as the fourth similarity level; The target classification model is trained based on the predicted loss value, the first degree of difference, the second degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity, and the fourth degree of similarity. The training objective further includes increasing the third degree of similarity and the fourth degree of similarity.

11. The model training method according to claim 10, wherein, Training the target classification model includes: Determine the degree of difference between the target feature centers and the original feature centers of the plurality of first labeled categories, as the third degree of difference; The target classification model is trained based on the predicted loss value, the first degree of difference, the second degree of difference, the third degree of difference, the first degree of similarity, the second degree of similarity, the third degree of similarity, and the fourth degree of similarity. The training objective further includes reducing the third degree of difference.

12. The model training method according to any one of claims 1-11, wherein, Generating target category-independent features includes: Based on the original category-independent features corresponding to each first labeled category, and using the category encoding of the original category-related features corresponding to each first labeled category as a condition, the posterior distribution of the latent variables corresponding to the original category-independent features corresponding to each first labeled category is determined. Sample multiple latent variables from the determined posterior distribution; The multiple latent variables are reconstructed to obtain multiple target category-independent features corresponding to each first labeled category.

13. The model training method according to claim 12, wherein, Training the target classification model includes: The degree of difference between the original category-independent features and the target category-independent features corresponding to the plurality of first labeled categories is determined as the fourth degree of difference; The degree of difference between the posterior distribution of the latent variable and the prior distribution of the latent variable is determined as the fifth degree of difference; The target classification model is trained based on the fourth degree of difference and the fifth degree of difference, and the training objective includes reducing the fourth degree of difference and the fifth degree of difference.

14. The model training method according to claim 1, wherein, The target classification model includes a quadratic discriminant analysis classifier based on maximum a posteriori (MAP), which classifies each second sample by: Based on the original feature center and target feature center of each first labeled category, the maximum a posteriori (MAP)-based quadratic discriminant analysis classifier is used to classify each second sample to obtain the predicted category of each second sample. The parameters of the MAP-based quadratic discriminant analysis classifier are the prior distribution parameters of the mean and variance of the sample distribution of the first sample corresponding to each first labeled category. The prior distribution parameters are used as training parameters in the process of training the target classification model.

15. A classification method, comprising: Obtain multiple third samples with multiple second labeled categories and a fourth sample to be classified, wherein the number of the multiple third samples is less than a number threshold; Based on the third sample corresponding to each second labeled category, the target classification model is used to decouple the original feature centers of each second labeled category to obtain the original category-related features and original category-independent features corresponding to each labeled category. The target classification model is used for image classification. Based on the original category-independent features corresponding to each second labeled category, target category-independent features are generated using the target classification model; By fusing the original category-related features and target category-independent features corresponding to each second labeled category, the target feature center of each second labeled category is obtained; Based on the original feature centers and target feature centers of the multiple second labeled categories, the target classification model is used to classify each fourth sample to obtain the predicted category of each fourth sample. The second labeled category and the first labeled category in training the target classification model belong to different labeled categories.

16. An electronic device configured to perform the model training method as claimed in any one of claims 1-14 or the classification method as claimed in claim 15.

17. An electronic device comprising: Memory; as well as A processor coupled to the memory, the processor being configured for the model training method as described in any one of claims 1-14 or the classification method as described in claim 15.

18. A computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the model training method as claimed in any one of claims 1-14 or the classification method as claimed in claim 15.