A method, device, equipment and storage medium for label offset correction

The method addresses label shift challenges by aligning label and feature distributions using Bayesian algorithms to enhance the accuracy of predictions in dynamic data environments, ensuring high accuracy in target domain predictions.

CN118781428BActive Publication Date: 2025-07-15NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410937492.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2025-07-15
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

In an open environment, the label offset of the data distribution leads to a degradation of generalization performance of traditional machine learning models, especially in medical image analysis and plant classification, where the proportion of class distributions of the target domain and the source domain are different, resulting in predicted label offsets.

Method used

By combining Bayesian algorithm, label edge distribution matching and feature edge distribution matching are performed, the parameters of the pre-trained classification prediction model are adjusted, and the target classification prediction model is formed, and the weight vector is optimized using projection gradient descent method and Lagrangian multiplication method to ensure the accuracy of the prediction model.

Benefits of technology

Effectively improve the label offset, improve the accuracy of prediction labels, simplify the calculation process, and ensure that the prediction model has excellent prediction effect after the parameters of the prediction model are adjusted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781428B_ABST
    Figure CN118781428B_ABST
Patent Text Reader

Abstract

The present invention provides a method, apparatus, device, and storage medium for label offset correction. The method includes: obtaining source domain data and its first label, where the source domain data includes image data; obtaining target domain data, where the target domain data includes image data; performing a preliminary prediction of the data type of the target domain data to obtain a predicted second label; based on the source domain data, target domain data, first label, and second label, and in combination with a target algorithm, performing label marginal distribution matching and feature marginal distribution matching on the source domain data and target domain data, where the target algorithm at least includes the Bayesian algorithm; adjusting the parameters of a pre-trained classification prediction model based on the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model; and performing a re-prediction of the data type of the target domain data based on the target classification prediction model to obtain a predicted third label. The label offset correction method of the present invention can quickly and accurately perform offset correction on the predicted label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and particularly relates to a method, device, equipment and storage medium for label offset correction. Background Art

[0002] The success of traditional machine learning methods is related to the core assumption that the training and test data are independent and identical from the same distribution. However, in some open environment applications, data is collected in a dynamic manner. In addition to the timeliness and cumulative volume of the data stream, the test (target) distribution is always different from the training (source) distribution. For example, in medical image analysis, even if the symptoms are not very different, the disease prevalence may vary significantly in different seasons. In addition, in plant classification, the types of prevalent plants in different regions have changed, while the plant characteristics are not very different. Specifically, as Figure 1 shown, poplars are mostly distributed in plain areas, while cacti are mostly distributed in desert areas, so the corresponding optimal classifier will change accordingly. This phenomenon is an important case of distribution shift, that is, label shift, based on the assumption that the class distributions of the source domain and the target domain have different proportions (p(Y)≠q(Y)), while the feature distributions of each category are the same (p(X|Y)=q(X|Y)). Research shows that the change in the label marginal distribution can significantly reduce the generalization performance of traditional models. Therefore, this shift poses a major challenge to machine learning systems deployed in the wild. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method, device, equipment and storage medium for label offset correction that can quickly and accurately correct the offset of predicted labels.

[0004] The content of the present invention includes providing a method for label offset correction, comprising:

[0005] Obtaining source domain data and its first label, wherein the source domain data includes image data;

[0006] Obtaining target domain data, wherein the target domain data includes image data;

[0007] Performing a preliminary prediction on the data type of the target domain data to obtain a predicted second label;

[0008] Based on the source domain data, target domain data, first label and second label, and in combination with a target algorithm, performing label marginal distribution matching and feature marginal distribution matching on the source domain data and target domain data, wherein the target algorithm at least includes the Bayesian algorithm;

[0009] Adjusting the parameters of a pre-trained classification prediction model based on the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model;

[0010] Based on the target classification prediction model, re-predict the data type of the target domain data to obtain a predicted third label, and the accuracy of the third label is higher than that of the second label.

[0011] As an optional embodiment, the method for performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data based on the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm includes:

[0012] Calculate the source domain label distribution based on the first label where n k is the number of the k-th source domain sample;

[0013] Construct an optimization function:

[0014]

[0015] Calculate the target domain label distribution based on the second label, the source domain label distribution, and in combination with the optimization function;

[0016] Calculate the label marginal distribution matching based on the source domain label distribution and the target domain label distribution.

[0017] As an optional embodiment, the method for performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data based on the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm includes:

[0018] Define a weighted feature marginal distribution cluster based on the Bayesian algorithm, and the weighted feature marginal distribution cluster is related to the parameters of the classification prediction model;

[0019] On the premise that the source domain feature marginal distribution matches the target domain feature marginal distribution, calculate the weight vector corresponding to each group of matching features based on the weighted feature marginal distribution cluster;

[0020] Determine the feature marginal distribution matching of the source domain data and the target domain data based on the weight vector.

[0021] As an optional embodiment, the weighted feature marginal distribution cluster is:

[0022]

[0023] where θ is the weight vector, and the weight vector is positively correlated with the parameter.

[0024] As an optional embodiment, the weight vector satisfies the following relationship:

[0025]

[0026] {p s (X|Y=k),k∈[K]};

[0027] θ * =p t (Y);

[0028] where θ is the same as θ * identical.

[0029] As an alternative embodiment, when calculating the weight vector θ, the method further includes:

[0030] participating in solving the weight vector θ based on the projected gradient descent method and the Lagrange multiplier method.

[0031] As an alternative embodiment, adjusting the parameters of the pre-trained classification prediction model based on the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model includes:

[0032] estimating the label distribution of the real target domain data based on the label marginal distribution matching result and the feature marginal distribution matching result;

[0033] adjusting the parameters of the pre-trained classification prediction model based on the estimated label distribution and the first label to form a target classification prediction model.

[0034] Another embodiment of the present invention also provides a label shift correction device, including:

[0035] A first obtaining module, configured to obtain source domain data and its first label, where the source domain data includes image data;

[0036] A second obtaining module, configured to obtain target domain data, where the target domain data includes image data;

[0037] A first prediction module, configured to perform a preliminary prediction on the data type of the target domain data to obtain a predicted second label;

[0038] A calculation module, configured to perform label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm, where the target algorithm at least includes a Bayesian algorithm;

[0039] An adjustment module, configured to adjust the parameters of the pre-trained classification prediction model according to the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model;

[0040] A second prediction module, configured to re-predict the data type of the target domain data according to the target classification prediction model, so as to obtain a predicted third label, and the accuracy of the third label is higher than that of the second label.

[0041] Another embodiment of the present invention further provides an electronic device, which is characterized by comprising:

[0042] At least one processor; and,

[0043] A memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the label offset correction method described in any one of the above embodiments.

[0045] Another embodiment of the present invention further provides a storage medium, the storage medium includes a stored program, wherein when the program runs, it controls a device including the storage medium to execute the label offset correction method described in any one of the above embodiments.

[0046] The beneficial effect of the present invention lies in the label offset correction under normal circumstances, with an ideal effect, which can effectively improve the label offset situation, and the process is short, the calculation amount is moderate, and the correction efficiency is guaranteed. Theoretically, the method of the present application can ensure that the objective function has a unique optimal solution, that is, it ensures that the predicted label after offset correction has a calibrated optimal target label distribution, which provides guidance for the design of the label shift method and ensures excellent prediction effect after the parameters of the prediction model are adjusted.

[0047] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings.

[0048] The technical solutions of the present application will be further described in detail below through the drawings and embodiments. Description of the Drawings

[0049] The drawings are used to provide a further understanding of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application, and do not constitute a limitation to the present application. In the drawings:

[0050] Figure 1 It is a comparison diagram of the label prediction effects in the existing solutions.

[0051] Figure 2It is a schematic flowchart of the label offset correction method in an embodiment of the present invention.

[0052] Figure 3 It is a schematic flowchart of the label offset correction method in another embodiment of the present invention.

[0053] Figure 4 It is a structural block diagram of the label offset correction device in an embodiment of the present invention. Detailed implementation manners

[0054] Next, specific embodiments of the present invention will be described in detail with reference to the accompanying drawings, but this is not a limitation of the present invention.

[0055] It should be understood that various modifications can be made to the embodiments disclosed herein. Therefore, the following description should not be regarded as restrictive, but only as an example of the embodiments. Those skilled in the art will think of other modifications within the scope and spirit of the present disclosure.

[0056] The accompanying drawings included in the specification and constituting a part of the specification illustrate embodiments of the present disclosure, and together with the general description of the present disclosure given above and the detailed description of the embodiments given below are used to explain the principles of the present disclosure.

[0057] These and other features of the present invention will become apparent from the following description of the preferred forms of the embodiments given as non-limiting examples with reference to the accompanying drawings.

[0058] It should also be understood that although the present invention has been described with reference to some specific examples, those skilled in the art can surely implement many other equivalent forms of the present invention, which have the features as described in the claims and thus are all within the protection scope defined thereby.

[0059] When combined with the accompanying drawings, the above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description.

[0060] Hereinafter, specific embodiments of the present disclosure will be described with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are only examples of the present disclosure and can be implemented in various ways. Well-known and / or repetitive functions and structures are not described in detail to avoid unnecessary or redundant details from obscuring the present disclosure. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but only as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in substantially any suitable detailed structure in a variety of ways.

[0061] This specification may use phrases such as "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which may each refer to one or more of the same or different embodiments according to the present disclosure.

[0062] Next, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0063] As Figure 2 shown, an embodiment of the present invention provides a method for correcting label offset, including:

[0064] S1: Obtain source domain data and its first label, where the source domain data includes image data;

[0065] S2: Obtain target domain data, where the target domain data includes image data;

[0066] S3: Perform a preliminary prediction on the data type of the target domain data to obtain a predicted second label;

[0067] S4: Based on the source domain data, target domain data, first label, and second label, and in combination with a target algorithm, perform label marginal distribution matching and feature marginal distribution matching on the source domain data and target domain data, where the target algorithm at least includes a Bayesian algorithm;

[0068] S5: Adjust the parameters of a pre-trained classification prediction model based on the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model;

[0069] S6: Perform a re-prediction on the data type of the target domain data based on the target classification prediction model to obtain a predicted third label, where the accuracy of the third label is higher than the accuracy of the second label.

[0070] For example, first, match the label marginal distributions of the source domain data and the target domain data to construct a surrogate convex function to ensure the sufficiency and uniqueness of its solution. To avoid dependence on the source classifier, a Bayesian formula based on label displacement and kernel mean matching can be used to match the feature marginal distributions. Then, combine the above two matching methods into an overall framework and use the projected gradient descent algorithm to effectively solve the simplex constraint, that is, determine the parameters of the prediction model, and then adjust the prediction model so that it can accurately predict the label of the target domain data.

[0071] When the method of this embodiment is applied to label prediction of image data, for example, when using a prediction model trained based on plant image data in desert areas to predict the labels of plant image data in continental areas, before the method of this embodiment is used, the prediction model will have an offset in plant label prediction, such as misidentifying poplar trees as tall cacti, resulting in prediction offsets. After applying the method of this embodiment, the offset of the prediction result can be adjusted to make the result accurate when predicting again.

[0072] The beneficial effect of this embodiment lies in correcting the label offset in the normal range, with an ideal effect, which can effectively improve the label offset situation, and the process is short, the calculation amount is moderate, ensuring the correction efficiency. Theoretically, the method of this application can ensure that the objective function has a unique optimal solution, that is, ensure that the predicted labels after offset correction have a calibrated optimal target label distribution, which provides guidance for the design of the label shift method and ensures excellent prediction effects after the parameters of the prediction model are adjusted.

[0073] In one embodiment, the method of performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data based on the source domain data, the target domain data, the first label, and the second label, and in combination with the target algorithm includes:

[0074] S7: Calculate the source domain label distribution based on the first label where n k is the number of the k-th source domain sample;

[0075] S8: Construct an optimization function:

[0076]

[0077] S9: Calculate the target domain label distribution based on the second label, the source domain label distribution, and in combination with the optimization function;

[0078] S10: Calculate the label marginal distribution matching based on the source domain label distribution and the target domain label distribution.

[0079] In this embodiment, in order to effectively estimate the target domain class posterior distribution p t (Y|X), first analyze its relationship with the source domain class posterior distribution p s (Y|X) according to Bayes' formula:

[0080]

[0081] According to the properties of the class posterior distribution, always holds. Combining formula (1.13), the following formula is valid:

[0082]

[0083] The marginal distribution p of the source domain s (Y) can be directly estimated by the proportion of source domain labels, i.e., where n k is the number of samples in the k-th source domain. Since the target domain samples are unlabeled, the marginal distribution p t (Y) of the target domain cannot be estimated accordingly. Therefore, if the posterior distribution p t (Y|X) of the target class is to be obtained, it is necessary to estimate the marginal distribution p t (Y). Next, the importance weights are estimated by bidirectional marginal distribution matching:

[0084] For label marginal distribution matching θ = [θ1, θ2,..., θ K ∈ R K , given the weight variable, for 0 ≤ θ k ≤ 1 and θ * : = p t (Y), the weighted class posterior distribution is defined as follows:

[0085]

[0086] According to formula (1.14), if θ = θ * = p t (Y) and always holds, then the weighted class marginal distribution is defined as follows:

[0087]

[0088] If θ = θ * = p t (Y), then the following conclusion holds:

[0089]

[0090] This transforms the estimation of the target domain marginal distribution p t (Y) into weighted marginal distribution matching, i.e., is equivalent to the following formula:

[0091]

[0092] where [.] k represents the k-th part of the vector. θ = T(θ; X) can be regarded as a non-linear equation. A common method to obtain the solution of the non-linear equation is fixed-point iteration, which iteratively calculates θ t ← T(θ t-1 ; X) until a fixed point θ t = T(θ t; X). Here, t represents the number of iterations. If T is a contraction mapping, the contraction mapping theorem can guarantee the convergence of the fixed-point iteration, that is, d(T(θ u ; X), T(θ v ; X)) < d(θ u , θ v ) holds for , where d(·, ·) ∈ R is a distance metric.

[0093] However, if θ is any one-hot vector, θ = T(θ; X) always holds and the mapping T in formula (1.18) is not a contraction mapping. For example, let θ u = [1, 0, 0,..., 0] ∈ R K and θ v = [0,..., 0, 0, 1] ∈ R K , there are θ u = T(θ u ; X) and θ v = T(θ v ; X) holding, which means that T is not a contraction mapping. Therefore, T(θ v ; X)) = d(θ u , θ v ) is true. Therefore, the fixed-point iteration cannot guarantee that the solution of formula (1.18) converges to the expected value θ = p t (Y).

[0094] To solve the above problems, this embodiment constructs an alternative optimization function, and its specific form is as follows:

[0095]

[0096] Due to the concavity of the logarithmic function and the linearity of the constraints, formula 1.19 is a convex problem and has the following properties:

[0097] Property 1: Sufficiency and uniqueness. The optimal solution of formula 1.19 must satisfy the fixed-point equation. Further, if the set of distributions {p s (X|Y = k), k ∈ [K]} is linearly independent, then formula 1.19 has a unique solution θ * = p t (Y).

[0098] As Figure 3 shown, based on the source domain data, target domain data, the first label and the second label, and combined with the target algorithm, the label marginal distribution matching and feature marginal distribution matching of the source domain data and the target domain data are performed, including:

[0099] S11: Define a weighted feature marginal distribution cluster based on the Bayesian algorithm, where the weighted feature marginal distribution cluster is related to the parameters of the classification prediction model;

[0100] S12: On the premise that the source domain feature marginal distribution matches the target domain feature marginal distribution, calculate the weight vector corresponding to each group of matched features based on the weighted feature marginal distribution cluster;

[0101] S13: Determine the matching of the feature marginal distributions of the source domain data and the target domain data based on the weight vector.

[0102] Exemplarily, for feature marginal distribution matching, based on Bayes' formula, for Formula always holds. Next, define a weighted feature marginal distribution cluster on X parameterized by θ as follows:

[0103]

[0104] where θ is the weight vector, and the weight vector is positively correlated with the parameter.

[0105] Due to the label shift assumption p s (X|Y) = p t (X|Y), if θ = p t (Y), there is Therefore, an effective strategy for matching feature marginal distributions is to find a weight vector θ, so

[0106]

[0107] The optimal solution of Formula 1.21 is unique under the same mild conditions as Proposition 1.

[0108] Furthermore, if the set of distributions {p s (X|Y = k), k ∈ [K]} is linearly independent, then for any θ * satisfying Formula (1.21), the method based on this embodiment must have θ * = p t (Y). Among them, θ is the same as θ * .

[0109] To effectively strengthen the and p t (X) match, this embodiment adopts kernel mean matching of two distributions and obtains the squared maximum mean discrepancy (MMD) loss:

[0110]

[0111] where is a kernel mapping. According to formula (1.20), we have:

[0112]

[0113] Combining formula 1.23, the loss function 1.22 is consistent with the following formula:

[0114]

[0115] Therefore, this embodiment adopts formula 1.24 to match the feature edge distribution.

[0116] In another embodiment, when calculating the weight vector θ, the method further includes:

[0117] S14: Participate in solving the weight vector θ based on the projected gradient descent method and the Lagrange multiplier method.

[0118] Among them, adjusting the parameters of the pre-trained classification prediction model based on the label edge distribution matching result and the feature edge distribution matching result to form a target classification prediction model includes:

[0119] S15: Estimate the label distribution of the real target domain data based on the label edge distribution matching result and the feature edge distribution matching result;

[0120] S16: Adjust the parameters of the pre-trained classification prediction model based on the estimated label distribution and the first label to form a target classification prediction model.

[0121] Exemplarily, based on the above information, this embodiment can estimate the real target label distribution p t (Y) by simultaneously matching the feature and label distributions. The overall loss function is:

[0122]

[0123] where λ ∈ [0, 1] is a parameter that weighs the losses between the two distribution matches. According to Propositions 1 and 2, it can be clearly seen that θ = p t (Y) is the optimal solution of formula (1.25).

[0124] Using the labeled source samples and the unlabeled target samples This embodiment approximates the expectation with its empirical average and gives the following optimization problem:

[0125]

[0126] Because p s (Y|X) is unknown, this embodiment adopts the calibrated posterior probability to approximate it, that is On this basis, by to estimate p s (Y).

[0127] In addition, this embodiment constructs a representation vector where Therefore, this embodiment designs a transfer matrix D ∈ R n , where the i-th row of D is d i . Then, and the MMD loss can be reparameterized as

[0128]

[0129] where K s and K t are the kernel matrices of the source domain and the target domain respectively, and K t,s is the cross-kernel matrix. In this embodiment, the Gaussian kernel is adopted, that is where δ is the bandwidth. Therefore, the final objective function of this embodiment is as follows:

[0130]

[0131] Since this embodiment uses both the negative log loss and the constraint regularization term at the same time, it is difficult to derive a closed-form solution. To solve this problem, the method adopted in this embodiment is the projected gradient descent method (PGD):

[0132]

[0133] where t is the number of iterations, η t is the step size determined by the exact line search, is the gradient of the function L at the point θ t , and Π Δ (.) is the projection of v

[0134] . Specifically:

[0135]

[0136] Suppose then formula (1.30) can be replaced by the following optimization problem:

[0137]

[0138] Since the objective function has strong convexity and the linearity of the constraint conditions, there exists a unique solution. The Lagrange multiplier method is used to solve the above optimization problem with constraint conditions, and its Lagrangian function is:

[0139]

[0140] where θ and β = [β1;...; β K are the Lagrange multipliers for equality and inequality constraints, respectively. The KKT conditions that the optimal solution needs to satisfy are as follows:

[0141]

[0142] It can be clearly seen from the second complementary condition of formula (1.33) that if θ k = 0, then β i ≥ 0, which is equivalent to if θ k > 0, then β i = 0 and Therefore, the zero components in the optimal solution correspond to the smaller partial components in. For clarity, the components of and θ are sorted in the same order, i.e.:

[0143]

[0144] where ρ is the number of positive components. Now applying the last condition of formula (1.33), we get:

[0145]

[0146] In other words, the optimal value of the Lagrange multiplier can be obtained by the method based on the above embodiments, i.e.:

[0147]

[0148] Therefore, ρ is the key to this problem. Once ρ is obtained, the Lagrange multiplier α will naturally be obtained, and then the optimal solution Since is ordered, the parameter ρ needs to satisfy the following properties:

[0149]

[0150] Based on the above, the optimal ρ is solved as follows:

[0151]

[0152] Based on the above optimal solution, the parameters, i.e., the weight vector, can be calculated. Based on the obtained parameter information, the prediction model can be adjusted so that the prediction model after the parameters are updated can accurately predict the target domain data, and the accuracy of the obtained prediction label, i.e., the third label, is much higher than that of the second label.

[0153] Such as Figure 4As shown in the figure, another embodiment of the present invention also provides a label offset correction device 100, including:

[0154] A first acquisition module, configured to acquire source domain data and its first label, where the source domain data includes image data;

[0155] A second acquisition module, configured to acquire target domain data, where the target domain data includes image data;

[0156] A first prediction module, configured to perform a preliminary prediction on the data type of the target domain data to obtain a predicted second label;

[0157] A calculation module, configured to perform label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm, where the target algorithm at least includes a Bayesian algorithm;

[0158] An adjustment module, configured to adjust the parameters of a pre-trained classification prediction model according to the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model;

[0159] A second prediction module, configured to perform a re-prediction on the data type of the target domain data according to the target classification prediction model to obtain a predicted third label, where the accuracy of the third label is higher than the accuracy of the second label.

[0160] As an optional embodiment, the performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm includes:

[0161] Calculating a source domain label distribution based on the first label where n k is the number of the k-th source domain sample;

[0162] Constructing an optimization function:

[0163]

[0164] Calculating a target domain label distribution based on the second label, the source domain label distribution, and in combination with the optimization function;

[0165] Calculating label marginal distribution matching based on the source domain label distribution and the target domain label distribution.

[0166] As an optional embodiment, the performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm includes:

[0167] Define a weighted feature marginal distribution cluster based on the Bayesian algorithm, where the weighted feature marginal distribution cluster is related to the parameters of the classification prediction model;

[0168] On the premise that the source domain feature marginal distribution matches the target domain feature marginal distribution, calculate the weight vector corresponding to each group of matching features based on the weighted feature marginal distribution cluster;

[0169] Determine the matching of the feature marginal distributions of the source domain data and the target domain data based on the weight vector.

[0170] As an optional embodiment, the weighted feature marginal distribution cluster is:

[0171]

[0172] The θ is the weight vector, and the weight vector is positively correlated with the parameter.

[0173] As an optional embodiment, the weight vector satisfies the following relationship:

[0174]

[0175] {p s (X|Y = k), k ∈ [K]};

[0176] θ * = p t (Y);

[0177] Where θ is the same as θ * identical.

[0178] As an optional embodiment, when calculating the weight vector θ, the calculation module is further configured to:

[0179] Participate in solving the weight vector θ based on the projected gradient descent method and the Lagrange multiplier method.

[0180] As an optional embodiment, adjusting the parameters of the pre-trained classification prediction model based on the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model includes:

[0181] Estimate the label distribution of the real target domain data based on the label marginal distribution matching result and the feature marginal distribution matching result;

[0182] Adjust the parameters of the pre-trained classification prediction model based on the estimated label distribution and the first label to form a target classification prediction model.

[0183] Another embodiment of the present invention further provides an electronic device, including:

[0184] at least one processor; and,

[0185] a memory communicatively connected to the at least one processor; wherein,

[0186] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the tag offset correction method as described in any one of the above embodiments.

[0187] Another embodiment of the present invention further provides a storage medium, the storage medium includes a stored program, wherein, when the program runs, it controls a device including the storage medium to execute the tag offset correction method as described in any one of the above embodiments.

[0188] An embodiment of the present invention further provides a computer program product, the computer program product is tangibly stored on a computer-readable medium and includes computer-readable instructions, and the computer-executable instructions, when executed, cause at least one processor to execute a tag offset correction method such as that in the above-described embodiments. It should be understood that each of the solutions in this embodiment has corresponding technical effects in the above method embodiment, and will not be elaborated herein.

[0189] It should be noted that the computer storage medium of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable medium can, for example but not limited to, be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program configured to be used by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.

[0190] One or more embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application shall be included within the protection scope of the present application.

[0191] The above embodiments are only exemplary embodiments of the present invention and are not used to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within the essence and protection scope of the present invention, and such modifications or equivalent substitutions should also be regarded as falling within the protection scope of the present invention.

Claims

1. A label offset correction method, characterized in that, Comprising: Obtaining source domain data and its first label, where the source domain data includes image data; Obtaining target domain data, where the target domain data includes image data; Performing a preliminary prediction on the data type of the target domain data to obtain a predicted second label; Based on the source domain data, target domain data, first label, and second label, and in combination with a target algorithm, performing label marginal distribution matching and feature marginal distribution matching on the source domain data and target domain data, where the target algorithm at least includes the Bayesian algorithm; Adjusting the parameters of a pre-trained classification prediction model based on the label marginal distribution matching result and feature marginal distribution matching result to form a target classification prediction model; Performing a re-prediction on the data type of the target domain data based on the target classification prediction model to obtain a predicted third label, where the accuracy of the third label is higher than the accuracy of the second label; Wherein, the performing label marginal distribution matching and feature marginal distribution matching on the source domain data and target domain data based on the source domain data, target domain data, first label, and second label, and in combination with a target algorithm includes: Calculating the source domain label distribution based on the first label where n k is the number of the k-th source domain sample; Constructing an optimization function: Calculating a target domain label distribution based on the second label, source domain label distribution, and in combination with the optimization function; Calculating label marginal distribution matching based on the source domain label distribution and target domain label distribution; The method further includes: Defining a weighted feature marginal distribution cluster based on the Bayesian algorithm, where the weighted feature marginal distribution cluster is related to the parameters of the classification prediction model; On the premise that the source domain feature marginal distribution matches the target domain feature marginal distribution, calculating a weight vector corresponding to each group of matching features based on the weighted feature marginal distribution cluster; Determining the feature marginal distribution matching of the source domain data and target domain data based on the weight vector.

2. The label offset correction method according to claim 1, wherein The weighted feature marginal distribution cluster is: Where θ is the weight vector, and the weight vector is positively correlated with the parameter.

3. The label offset correction method according to claim 2, wherein The weight vector satisfies the following relationship: {p s (X|Y = k), k ∈ [K]}; θ * = p t (Y); Among them, θ and θ * are the same.

4. The label offset correction method according to claim 2, wherein When calculating the weight vector θ, the method further includes: Participating in solving the weight vector θ based on the projected gradient descent method and Lagrange multiplier method.

5. The label offset correction method according to claim 1, wherein The adjusting the parameters of a pre-trained classification prediction model based on the label marginal distribution matching result and feature marginal distribution matching result to form a target classification prediction model includes: Estimating the label distribution of the real target domain data based on the label marginal distribution matching result and feature marginal distribution matching result; Adjusting the parameters of a pre-trained classification prediction model based on the estimated label distribution and the first label to form a target classification prediction model.

6. A label offset correction device, characterized in that, Comprising: A first obtaining module, configured to obtain source domain data and its first label, where the source domain data includes image data; A second obtaining module, configured to obtain target domain data, where the target domain data includes image data; A first prediction module, configured to perform a preliminary prediction on the data type of the target domain data to obtain a predicted second label; A calculation module, configured to perform label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm, where the target algorithm at least includes a Bayesian algorithm; An adjustment module, configured to adjust parameters of a pre-trained classification prediction model according to the label marginal distribution matching result and the feature marginal distribution matching result to form a target classification prediction model; A second prediction module, configured to re-predict the data type of the target domain data according to the target classification prediction model to obtain a predicted third label, and the accuracy of the third label is higher than the accuracy of the second label; Wherein, the performing label marginal distribution matching and feature marginal distribution matching on the source domain data and the target domain data according to the source domain data, the target domain data, the first label, and the second label, and in combination with a target algorithm includes: Calculate the source domain label distribution based on the first label where n k is the number of the k-th source domain sample; Constructing an optimization function: Calculating a target domain label distribution based on the second label, the source domain label distribution, and in combination with the optimization function; Calculating label marginal distribution matching based on the source domain label distribution and the target domain label distribution; Further includes: Defining a weighted feature marginal distribution cluster based on the Bayesian algorithm, where the weighted feature marginal distribution cluster is related to parameters of the classification prediction model; On the premise that the source domain feature marginal distribution matches the target domain feature marginal distribution, calculating a weight vector corresponding to each group of matched features based on the weighted feature marginal distribution cluster; Determining the feature marginal distribution matching of the source domain data and the target domain data based on the weight vector.

7. An electronic device, characterized in that, Includes: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the label offset correction method according to any one of claims 1-6.

8. A storage medium, the storage medium comprising a stored program, wherein, Controlling a device including the storage medium to execute the label offset correction method according to any one of claims 1-6 when the program is running.

Citation Information

Patent Citations

  • Feature distribution measurement method based on hybrid measurement

    CN115861660A

  • Classifier training method and device, data classification method and device, equipment and storage medium

    CN117708648A