Target domain label generation method and device, equipment and medium
Through the random walk method and fuzzy mapping rules, the pseudo-label quality is solved, and high-quality target domain labels are generated to reduce negative migration and improve image recognition effect.
Patent Information
- Application Number
- CN202410188947.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-20
- Publication Date
- 2025-08-22
AI Technical Summary
In the prior art, the quality of pseudo-labels in the domain adaptation method is insufficient, resulting in serious negative migration, affecting the target domain image recognition effect.
The initial pseudo-label of the target domain data is predicted by the random walk method, and filtered and updated. The feature matrix is optimized in combination with the fuzzy mapping rules, and the feature distribution differences between the source domain and the target domain are gradually narrowed to generate high-quality target domain labels.
Effectively filter out error or noise tags, generate higher quality target domain tags, reduce negative migration, improve target domain image recognition effect, and have better interpretability.
Smart Images

Figure CN120523985A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and medium for generating a target domain label. Background Art
[0002] Currently, domain adaptation methods improve the recognition performance of target domain images by minimizing the data distribution difference between the source domain and the target domain. Distribution matching, class distribution matching, and feature space alignment are common methods in domain adaptation methods.
[0003] Conditional distribution adaptation uses a supervised classifier trained on labeled source domain data to predict pseudo-target labels. The resulting pseudo-class centroid is assumed to be close to the true centroid. The true and pseudo-labels are used to calculate the source and target conditional probability distributions for each class, minimizing their distance metric, the Maximum Mean Discrepancy (MMD). Marginal distribution adaptation minimizes the MMD distance between the source and target domains after mapping using a kernel function. However, pseudo-labels predicted by a classifier trained on source domain data may overfit the source domain distribution. These predicted pseudo-labels are often used as hard labels without quality assessment, which can easily lead to severe negative transfer. Summary of the Invention
[0004] Based on this, it is necessary to address the technical problem that the existing technology does not judge the quality of the predicted pseudo labels, which easily leads to serious negative transfer. A target domain label generation method, device, equipment and medium are proposed.
[0005] In a first aspect, a method for generating a target domain label is provided, the method comprising:
[0006] Obtaining initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data;
[0007] Predicting initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels;
[0008] Determining a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data by a preset fuzzy mapping rule according to the initial target domain features and the initial source domain features;
[0009] Calculating update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updating the initial target domain features and the initial source domain features based on the update parameters, respectively, to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features;
[0010] A target domain label of the target domain data is determined according to the optimized target domain features, the optimized source domain features, and a target label matrix of the target pseudo labels.
[0011] It should be understood that feature mapping is performed using preset fuzzy mapping rules, reducing the differences between the source and target domains in the fuzzy feature space to update the features of the source and target domains. The updated results are then used for a new round of iterative pseudo-label calculation and label filtering optimization. Label filtering optimization encodes labels as hard or soft labels to filter out erroneous or noisy pseudo-labels. This iterative update solves the problem of negative transfer.
[0012] As an example, feature mapping based on fuzzy rules has better interpretability.
[0013] In a third aspect, a target domain label generation device is provided, the device comprising:
[0014] A data acquisition module is used to obtain initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data;
[0015] a label optimization module, configured to predict initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filter the initial pseudo labels, and update the filtered initial pseudo labels to obtain target pseudo labels;
[0016] a fuzzy mapping module, configured to determine, according to the initial target domain features and the initial source domain features, a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data by using a preset fuzzy mapping rule;
[0017] a feature optimization module, configured to calculate update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters, respectively, to obtain optimized target domain features corresponding to the initial target domain features and optimized source domain features corresponding to the initial source domain features;
[0018] A label generation module is used to determine the target domain label of the target domain data according to the optimized target domain features, the optimized source domain features and the target label matrix of the target pseudo labels.
[0019] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the target domain label generation method when executing the computer program.
[0020] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned target domain label generation method are implemented.
[0021] The present application obtains initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicts initial pseudo labels of the target domain data through a random walk method based on the initial label matrix, filters the initial pseudo labels, and updates the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain high-quality labels; according to the initial target domain features and the initial source domain features, determines a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data through a preset fuzzy mapping rule; calculates update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updates the initial target domain features and the initial source domain features based on the update parameters to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; determines the target domain label of the target domain data according to the optimal target domain features, the optimal source domain features, and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] in:
[0024] Figure 1 This is a diagram illustrating an application environment of a target domain label generation method according to an embodiment;
[0025] Figure 2 is a flowchart of a method for generating a target domain label in one embodiment;
[0026] Figure 3 is a structural block diagram of a target domain label generation device in one embodiment;
[0027] Figure 4 is a structural block diagram of a computer device in one embodiment;
[0028] Figure 5 It is a structural block diagram of a computer device in another embodiment. DETAILED DESCRIPTION
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0030] The target domain label generation method provided by the embodiment of the present invention can be applied in the following situations: Figure 1 In an application environment, the client 110 communicates with the server 120 through a network.
[0031] The server 120 may receive a start instruction through the client 110. The server 120 is configured to: obtain initial target domain features of the target domain data, an initial label matrix of the target domain data, and initial source domain features of the source domain data; predict initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filter the initial pseudo labels, and update the filtered initial pseudo labels to obtain target pseudo labels, thereby filtering out erroneous or noisy labels and obtaining high-quality labels; determine a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data based on the initial target domain features and the initial source domain features using a preset fuzzy mapping rule; calculate update parameters based on the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters to obtain optimized target domain features corresponding to the initial target domain features and optimized source domain features corresponding to the initial source domain features; and determine a target domain label of the target domain data based on the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability.
[0032] Similarly, when the computing pressure of the server 120 is large, in order to reduce the computing pressure of the server 120, the client 110 can also be used to: obtain the initial target domain features of the target domain data, the initial label matrix of the target domain data and the initial source domain features of the source domain data; predict the initial pseudo labels of the target domain data by random walk method based on the initial label matrix, filter the initial pseudo labels, and update the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain high-quality labels; according to the initial target domain features and the initial source domain features, the initial pseudo labels of the target domain data are predicted by random walk method, and the initial pseudo labels are filtered and updated to obtain target pseudo labels. Characteristic, determine the first fuzzy feature matrix of the target domain data and the second fuzzy feature matrix of the source domain data by preset fuzzy mapping rules; calculate update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters, so as to obtain the optimal solution target domain features corresponding to the initial target domain features and the optimal solution source domain features corresponding to the initial source domain features; determine the target domain label of the target domain data according to the optimal solution target domain features, the optimal solution source domain features and the target label matrix of the target pseudo label.
[0033] The client 110 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server 120 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0034] The present invention is described in detail below through specific examples.
[0035] See also Figure 2 As shown, Figure 2 A flowchart of a target domain label generation method provided by an embodiment of the present invention includes the following steps:
[0036] S101, obtaining initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data;
[0037] Exemplarily, the source domain data is data from a different domain than the test samples and has rich supervisory information. The target domain data is data from the same domain as the test samples and has no or few labels. The source and target domain data often belong to the same task class but have different distributions. The initial label matrix is a label matrix of the initial predicted labels for the target domain data (unlabeled data).
[0038] Among them, the initial target domain feature is the feature data of the target domain data before the label prediction process is performed, and it can also be the intermediate feature data of the target domain data during the label prediction process, for example, the intermediate feature data of the target domain data before the preset number of iterations is reached. Similarly, the initial source domain feature of the source domain data is the feature data of the target domain data before the label prediction process is performed, and it can also be the intermediate feature data of the target domain data during the label prediction process.
[0039] S102: Predicting initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels, thereby filtering out erroneous or noisy labels and obtaining high-quality labels;
[0040] Exemplarily, the random walk method is a method that allows unlabeled points (target domain data) to perform random walks under the guidance of a neighborhood similarity graph, and searches for label information from labeled points (source domain data). During the walk, the direction coefficients of the walk are recorded, and then a diagonal matrix is determined based on the direction coefficients.
[0041] Exemplarily, the initial pseudo labels are filtered, and a self-adaptive label filtering method may be used to filter out erroneous or noisy initial pseudo labels to complete label optimization.
[0042] Exemplarily, the filtered initial pseudo-label is updated to obtain the target pseudo-label by using the source domain distribution centroid to approximate the target domain centroid, and relabeling each data of the target domain data through a preset centroid classifier to complete the update process.
[0043] The initial pseudo-labels are pseudo-label data predicted by a random walk method based on the initial label matrix. They often contain interference factors such as noise, which makes the quality of the initial pseudo-labels uneven. The target pseudo-labels are pseudo-label data generated using the updated source domain data and the updated target domain data.
[0044] S103 : Determine a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data according to the initial target domain features and the initial source domain features by using a preset fuzzy mapping rule.
[0045] Exemplarily, the preset fuzzy mapping rules can use a fuzzy system (TSK) to implement the mapping process, that is, a shared feature space of source domain data and target domain data is constructed through the fuzzy system (TSK), nonlinear transformation is achieved through the antecedent part of the TSK fuzzy system, and linear dimensionality reduction is completed through the consequent part.
[0046] Exemplarily, the first fuzzy feature matrix is the feature matrix of the target domain data in the shared feature space; the second fuzzy feature matrix is the feature matrix of the source domain data in the shared feature space.
[0047] S104. Calculate update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters, respectively, to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features.
[0048] Exemplarily, through fuzzy mapping, the feature distribution difference between the source domain data and the target domain data is continuously reduced, that is, the initial target domain features and the initial source domain features are updated respectively based on the update parameters, so that the feature distribution difference between the optimized target domain features and the optimized source domain features is smaller than the feature distribution difference between the initial target domain features and the initial source domain features.
[0049] S105 : Determine a target domain label for the target domain data according to the optimized target domain features, the optimized source domain features, and a target label matrix of the target pseudo labels.
[0050] Exemplarily, the results of the fuzzy system (TSK) feature mapping (the optimal solution target domain features and the optimal solution source domain features) are used to perform a new round of iterative pseudo-label calculation and label optimization to improve the quality of the pseudo-labels and incorporate them into the unsupervised domain adaptation framework for optimization and solution.
[0051] By obtaining the initial target domain features of the target domain data, the initial label matrix of the target domain data and the initial source domain features of the source domain data; predicting the initial pseudo labels of the target domain data by the random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain good-quality labels; according to the initial target domain features and the initial source domain features, determining the first fuzzy feature matrix of the target domain data and the second fuzzy feature matrix of the source domain data by preset fuzzy mapping rules; calculating the update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updating the initial target domain features and the initial source domain features respectively based on the update parameters to obtain the optimal target domain features corresponding to the initial target domain features and the optimal source domain features corresponding to the initial source domain features; determining the target domain labels of the target domain data according to the optimal target domain features, the optimal source domain features and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability.
[0052] In a possible implementation, optionally, the step of predicting the initial pseudo labels of the target domain data by a random walk method based on the initial label matrix includes:
[0053] Obtaining a neighborhood similarity graph corresponding to the target domain data, and obtaining a path weight matrix of the neighborhood similarity graph;
[0054] Determine the direction coefficient of the target domain data by the random walk method;
[0055] An initial pseudo label of the target domain data is predicted according to each direction coefficient, the path weight matrix and the initial label matrix.
[0056] Exemplarily, the path weight matrix W of the neighborhood similarity graph is obtained, and the direction coefficient of the i-th data of the random walk is α i and β i , according to the directional coefficient α i Determine the i-th data and direction coefficient α i The corresponding diagonal matrix I α , according to the directional coefficient β i Determine the i-th data and direction coefficient β i The corresponding diagonal matrix I β, F is the soft label matrix obtained in the previous iteration (the initial label matrix), Y is the initial pseudo label of the target domain data, and I is the overall matrix of the target domain data.
[0057] Specifically, through the formula:
[0058] F=(II α W) -1 I β Y
[0059] Determine the initial pseudo label of the i-th data, where if the i-th point is the target domain data, then α i =1,β i = 0, so that the i-th point goes around. If the i-th point is the source domain data, let α i =0,β i =1, limit the stay at the i-th point.
[0060] The neighborhood similarity map is an irregular window constructed by selecting pixels with high similarity to the pixel to be measured from all pixels in the area of the pixel to be measured.
[0061] In a possible implementation, before the step of filtering the initial pseudo labels and updating the filtered initial pseudo labels to obtain target pseudo labels, the method further includes:
[0062] Using the source domain distribution centroid of the source domain data as the target domain centroid of the target domain data, and obtaining the initial target domain feature and the distance between the initial target domain feature and the target domain centroid through a first preset algorithm of a preset centroid classifier;
[0063] The target domain data is labeled according to the initial target domain features and the distance through a second preset algorithm of the preset centroid classifier to obtain labeled target domain data, and the labeled target domain data is used to update the filtered initial pseudo-label.
[0064] For example, the source domain distribution centroid is used to approximate the target domain centroid, and each data in the target domain is relabeled as
[0065]
[0066] Among them, Z T Represents the characteristics of the target domain, the first preset algorithm D g (·,·) represents two data points ((Z T ) i ,c k ), c k represents the k-th centroid of the source domain, Represents the selection of two data points ((Z T ) i ,c k ) between the minimum Euclidean distance, arg is the summation function (the second preset algorithm) representing the two data points ((Z T ) i ,c k ) are summed up by the minimum Euclidean distance between them, (Z T ) i Represents the characteristics of the i-th data in the target source data.
[0067] In a possible implementation, the step of filtering the initial pseudo labels and updating the filtered initial pseudo labels to obtain target pseudo labels includes:
[0068] Filtering the initial pseudo labels according to a preset adaptive filtering rule to obtain filtered initial pseudo labels;
[0069] The filtered initial pseudo labels are updated by using a unit step function, the attribute data of the target domain data, and the labeled target domain data to obtain optimal pseudo labels;
[0070] Determine the type of the optimal pseudo label by using a preset array index function;
[0071] If the type of the optimal pseudo label is a confidence type, encoding the optimal pseudo label as a hard label, and using the hard label as the first target pseudo label in the target pseudo labels;
[0072] If the type of the optimal pseudo-label is a fuzzy type, the optimal pseudo-label is encoded as a soft label, and the soft label is used as the second target pseudo-label in the target pseudo-label.
[0073] Exemplarily, the process of updating the filtered initial pseudo-label using the unit step function, the attribute data of the target domain data, and the labeled target domain data is as follows:
[0074]
[0075] in, The encoding vector representing the initial pseudo-label of the random walk prediction for the i-th instance in the target domain belongs to The probability of (F T ) ic represents the probability that the encoding vector of the predicted initial pseudo-label belongs to the cth class, is the optimal pseudo label. When x≥0, the unit step function ε(x)=1, when x<0, ε(x)=0, where x represents represents the sum of the unit step functions over all classes.
[0076] For example, a preset array index function (nonzero(x) function) is defined: it returns the number of non-zero values in vector x. For an updated label, that is, the optimal pseudo label if think is a confidence label, encoded as a hard label; if It is believed that are fuzzy labels, encoded in the form of soft labels to mitigate possible negative transfer.
[0077] In a possible implementation, the step of determining the first fuzzy feature matrix of the target domain data and the second fuzzy feature matrix of the source domain data by using a preset fuzzy mapping rule based on the initial target domain features and the initial source domain features includes:
[0078] Establishing a fuzzy feature set of the target domain data and the source domain data according to the initial target domain features and the initial source domain features through a nonlinear transformation rule in the preset fuzzy mapping rule;
[0079] A first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data are determined based on the fuzzy feature set.
[0080] For example, the TSK fuzzy system is expressed as follows using nonlinear transformation rules (“IF-THEN” rules):
[0081]
[0082]
[0083] in, represents a fuzzy set, f k (x) represents the output of the kth rule of the TSK fuzzy system. The membership of the fuzzy set is calculated by the Gaussian membership function, where ∧ represents "and", Represents the consequent parameters in the TSK fuzzy system, x1, x2…x d Represents the input data of the TSK fuzzy system, and the membership calculation formula is as follows:
[0084]
[0085] Among them, the center parameter and width parameters The antecedent parameter is calculated using the Fuzzy C-means (FCM) algorithm. The detailed formula is as follows:
[0086]
[0087]
[0088] Among them, u jk is the input vector x j For the membership degree of the kth class, x ji Represents the input vector x j The fuzzy data at the i-th layer can be obtained from the clustering results of the C-means (FCM) algorithm on the input data set. N is the number of training data, which is n according to the number of source domain data and target domain data. s and n t h is an adjustable parameter (which can be regarded as user preset data) that can be used to adjust the kernel width of the Gaussian membership function.
[0089] For example, the source domain feature X S and target domain features X T The feature vector obtained by partial fuzzy mapping of any instance i in the preceding part can be expressed as g si and g ti :
[0090]
[0091]
[0092] where g si ∈R K(d+1)×1 ,g ti ∈R K(d+1)×1 K is the number of fuzzy rules, d is the dimension of the sample, is the source domain mapping data corresponding to the i-th source domain feature data in the fuzzy set with sequence number 1, T is the number of iterations, is the target domain mapping data corresponding to the i-th target domain feature data in the fuzzy set with sequence number 1. si The set of all instances of (the first fuzzy feature matrix) G S and g ti The set of all instances of (the second fuzzy feature matrix) G T Expressed as:
[0093]
[0094]
[0095] In a possible implementation, the step of calculating update parameters according to the first fuzzy characteristic matrix and the second fuzzy characteristic matrix includes:
[0096] Based on the first fuzzy feature matrix and the second fuzzy feature matrix, determining a conditional distribution difference matrix between the target domain data and the source domain data by using a first preset maximum mean difference algorithm;
[0097] Determining a marginal distribution difference matrix between the target domain data and the source domain data by a second preset maximum mean difference algorithm based on the first fuzzy feature matrix and the second fuzzy feature matrix;
[0098] Update parameters of the target domain data and the source domain data are determined according to the conditional distribution difference matrix and the marginal distribution difference matrix.
[0099] For example, the edge distributions of the source domain and the target domain in the fuzzy space are aligned, and the edge distribution difference between the source domain and the target domain is measured using the first preset maximum mean difference algorithm of MMD, wherein the first preset maximum mean difference algorithm may be a maximum mean difference algorithm (MMD algorithm), specifically:
[0100]
[0101] in MMD Matrix The calculation is as follows:
[0102]
[0103] Accordingly, the conditional distributions of the source domain and the target domain in the fuzzy space are aligned, and the conditional distribution difference between the source domain and the target domain is measured using the second preset maximum mean difference algorithm of MMD, where the second preset maximum mean difference algorithm can be the maximum mean difference algorithm (MMD algorithm), and the following combination is performed for the filter labels:
[0104]
[0105] in MMD Matrix c=1,2,...,CC is the number of classes, M c The calculation is as follows:
[0106]
[0107] In order to maximize the distinguishability between source and target domain classes, the distance between categories is enlarged. c represents the subdomain of the cth class, D -c represents the subdomain of all classes except the cth class, and the inter-class distinction distance is calculated as:
[0108]
[0109] Discriminant distribution matrix M dThe definition is as follows:
[0110]
[0111] The final objective function is as follows:
[0112]
[0113] tr(P T G X (M0+M c -M d )G X T P) represents the preset distribution distance measurement module, The model complexity is limited by using λ as a trade-off parameter.
[0114] Optimize the above objective function and integrate the principal component analysis constraints by enhancing the Lagrangian method to rewrite the objective function:
[0115]
[0116] Taking the partial derivative of GX, we can get:
[0117] (P T (G X (M0+M c -M d )G X T +λI)P)=G X HG X T Pφ
[0118] The above formula is solved using generalized eigenvalue decomposition to obtain the update parameter P.
[0119] For example, p g is the consequent parameter of the single-output TSK fuzzy system, then the consequent parameter of the m-dimensional output TSK fuzzy system is expressed as:
[0120]
[0121] All data in the source and target domains in the fuzzy feature space are expressed in the form of linear regression:
[0122] Z S =P T G S
[0123] Z T =P T G T
[0124] An optimized target domain feature corresponding to the initial target domain feature and an optimized source domain feature corresponding to the initial source domain feature are obtained.
[0125] In a possible implementation, after the step of determining the target domain label of the target domain data according to the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels, the step further includes:
[0126] Recording the number of executions of the step of determining the target domain label of the target domain data based on the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels, and using the number of executions as the current iteration number;
[0127] Matching the current number of iterations with a preset number of iterations;
[0128] If the current number of iterations is less than the preset number of iterations, the label matrix of the target domain label is used as the initial label matrix, the optimal solution target domain feature is used as the initial target domain feature, and the optimal solution source domain feature is used as the initial source domain feature. The steps of obtaining the initial target domain features of the target domain data, the initial label matrix of the target domain data, and the initial source domain features of the source domain data are performed until the current number of iterations is equal to the preset number of iterations.
[0129] Exemplarily, the accuracy of the target domain label is ensured by updating the target domain features a preset number of iterations.
[0130] Exemplarily, the label matrix of the target domain label is used as the initial label matrix, the optimal target domain feature is used as the initial target domain feature, the optimal source domain feature is used as the initial source domain feature, and the label matrix of the target domain label generated in the iteration is referenced to ensure that the accuracy of the generated target domain label increases with the increase in the number of iterations.
[0131] See also Figure 3 As shown, in one embodiment, a target domain label generation device is provided, the device comprising:
[0132] A data acquisition module 201 is configured to obtain initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data;
[0133] The label optimization module 202 is configured to predict initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filter the initial pseudo labels, and update the filtered initial pseudo labels to obtain target pseudo labels;
[0134] A fuzzy mapping module 203 is configured to determine a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data according to the initial target domain features and the initial source domain features by using a preset fuzzy mapping rule;
[0135] A feature optimization module 204 is configured to calculate update parameters based on the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters to obtain optimized target domain features corresponding to the initial target domain features and optimized source domain features corresponding to the initial source domain features;
[0136] The label generation module 205 is configured to determine a target domain label for the target domain data according to the optimized target domain features, the optimized source domain features, and a target label matrix of the target pseudo labels.
[0137] In a possible implementation, the data acquisition module 201 is configured to:
[0138] Obtaining a neighborhood similarity graph corresponding to the target domain data, and obtaining a path weight matrix of the neighborhood similarity graph;
[0139] Determine the direction coefficient of the target domain data by the random walk method;
[0140] An initial pseudo label of the target domain data is predicted according to each direction coefficient, the path weight matrix and the initial label matrix.
[0141] In a possible implementation, the label optimization module 202 is configured to:
[0142] Using the source domain distribution centroid of the source domain data as the target domain centroid of the target domain data, and obtaining the initial target domain feature and the distance between the initial target domain feature and the target domain centroid through a first preset algorithm of a preset centroid classifier;
[0143] The target domain data is labeled according to the initial target domain features and the distance through a second preset algorithm of the preset centroid classifier to obtain labeled target domain data, and the labeled target domain data is used to update the filtered initial pseudo-label.
[0144] In a possible implementation, the label optimization module 202 is configured to:
[0145] Filtering the initial pseudo labels according to a preset adaptive filtering rule to obtain filtered initial pseudo labels;
[0146] The filtered initial pseudo labels are updated by using a unit step function, the attribute data of the target domain data, and the labeled target domain data to obtain optimal pseudo labels;
[0147] Determine the type of the optimal pseudo label by using a preset array index function;
[0148] If the type of the optimal pseudo label is a confidence type, encoding the optimal pseudo label as a hard label, and using the hard label as the first target pseudo label in the target pseudo labels;
[0149] If the type of the optimal pseudo-label is a fuzzy type, the optimal pseudo-label is encoded as a soft label, and the soft label is used as the second target pseudo-label in the target pseudo-label.
[0150] In a possible implementation, the fuzzy mapping module 203 is configured to:
[0151] Establishing a fuzzy feature set of the target domain data and the source domain data according to the initial target domain features and the initial source domain features through a nonlinear transformation rule in the preset fuzzy mapping rule;
[0152] A first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data are determined based on the fuzzy feature set.
[0153] In a possible implementation, the feature optimization module 204 is configured to:
[0154] Based on the first fuzzy feature matrix and the second fuzzy feature matrix, determining a conditional distribution difference matrix between the target domain data and the source domain data by using a first preset maximum mean difference algorithm;
[0155] Determining a marginal distribution difference matrix between the target domain data and the source domain data by a second preset maximum mean difference algorithm based on the first fuzzy feature matrix and the second fuzzy feature matrix;
[0156] Update parameters of the target domain data and the source domain data are determined according to the conditional distribution difference matrix and the marginal distribution difference matrix.
[0157] In a possible implementation, the label generation module 205 is configured to:
[0158] Recording the number of executions of the step of determining the target domain label of the target domain data based on the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels, and using the number of executions as the current iteration number;
[0159] Matching the current number of iterations with a preset number of iterations;
[0160] If the current number of iterations is less than the preset number of iterations, the label matrix of the target domain label is used as the initial label matrix, the optimal solution target domain feature is used as the initial target domain feature, and the optimal solution source domain feature is used as the initial source domain feature. The steps of obtaining the initial target domain features of the target domain data, the initial label matrix of the target domain data, and the initial source domain features of the source domain data are performed until the current number of iterations is equal to the preset number of iterations.
[0161] This embodiment obtains initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicts initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filters the initial pseudo labels, and updates the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain high-quality labels; determines a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data according to the initial target domain features and the initial source domain features through a preset fuzzy mapping rule; calculates update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updates the initial target domain features and the initial source domain features based on the update parameters to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; determines a target domain label of the target domain data according to the optimal target domain features, the optimal source domain features, and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability.
[0162] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a target domain label generation method.
[0163] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, display screen and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the client side of a target domain label generation method.
[0164] In one embodiment, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicting initial pseudo labels of the target domain data by a random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels, thereby filtering out erroneous or noisy labels and obtaining labels of good quality; and The initial target domain features and the initial source domain features are used to determine the first fuzzy feature matrix of the target domain data and the second fuzzy feature matrix of the source domain data through preset fuzzy mapping rules; update parameters are calculated according to the first fuzzy feature matrix and the second fuzzy feature matrix, and the initial target domain features and the initial source domain features are updated based on the update parameters to obtain the optimal target domain features corresponding to the initial target domain features and the optimal source domain features corresponding to the initial source domain features; the target domain label of the target domain data is determined according to the optimal target domain features, the optimal source domain features and the target label matrix of the target pseudo label.
[0165] This embodiment obtains initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicts initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filters the initial pseudo labels, and updates the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain high-quality labels; determines a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data according to the initial target domain features and the initial source domain features through a preset fuzzy mapping rule; calculates update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updates the initial target domain features and the initial source domain features based on the update parameters to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; determines a target domain label of the target domain data according to the optimal target domain features, the optimal source domain features, and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability.
[0166] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps: obtaining initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicting initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels, thereby filtering out erroneous or noisy labels and obtaining high-quality labels; determining a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data based on the initial target domain features and the initial source domain features using a preset fuzzy mapping rule; calculating update parameters based on the first fuzzy feature matrix and the second fuzzy feature matrix, and updating the initial target domain features and the initial source domain features based on the update parameters to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; and determining a target domain label of the target domain data based on the optimal target domain features, the optimal source domain features, and a target label matrix of the target pseudo labels.
[0167] This embodiment obtains initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; predicts initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filters the initial pseudo labels, and updates the filtered initial pseudo labels to obtain target pseudo labels, which can filter out erroneous or noisy labels and obtain high-quality labels; determines a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data according to the initial target domain features and the initial source domain features through a preset fuzzy mapping rule; calculates update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updates the initial target domain features and the initial source domain features based on the update parameters to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; determines a target domain label of the target domain data according to the optimal target domain features, the optimal source domain features, and the target label matrix of the target pseudo labels. By continuously narrowing the feature distribution differences between the source and target domains through fuzzy mapping, higher-quality labels (target domain labels) can be obtained, which are better able to address negative transfer. At the same time, feature mapping based on fuzzy rules provides better interpretability.
[0168] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the relevant descriptions of the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0169] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0170] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0171] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A target domain label generation method, characterized in that: The method comprises: Obtaining initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; Predicting initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filtering the initial pseudo labels, and updating the filtered initial pseudo labels to obtain target pseudo labels; Determining a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data by a preset fuzzy mapping rule according to the initial target domain features and the initial source domain features; Calculating update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and updating the initial target domain features and the initial source domain features based on the update parameters, respectively, to obtain optimal target domain features corresponding to the initial target domain features and optimal source domain features corresponding to the initial source domain features; A target domain label of the target domain data is determined according to the optimized target domain features, the optimized source domain features, and a target label matrix of the target pseudo labels.
2. The target domain label generation method according to claim 1, characterized in that: The step of predicting the initial pseudo labels of the target domain data by a random walk method based on the initial label matrix includes: Obtaining a neighborhood similarity graph corresponding to the target domain data, and obtaining a path weight matrix of the neighborhood similarity graph; Determine the direction coefficient of the target domain data by the random walk method; An initial pseudo label of the target domain data is predicted according to each direction coefficient, the path weight matrix and the initial label matrix.
3. The target domain label generation method according to claim 1, characterized in that: Before the step of filtering the initial pseudo labels and updating the filtered initial pseudo labels to obtain target pseudo labels, the method further includes: Using the source domain distribution centroid of the source domain data as the target domain centroid of the target domain data, and obtaining the initial target domain feature and the distance between the initial target domain feature and the target domain centroid through a first preset algorithm of a preset centroid classifier; The target domain data is labeled according to the initial target domain features and the distance through a second preset algorithm of the preset centroid classifier to obtain labeled target domain data, and the labeled target domain data is used to update the filtered initial pseudo-label.
4. The target domain label generation method according to claim 3, characterized in that: The step of filtering the initial pseudo labels and updating the filtered initial pseudo labels to obtain target pseudo labels includes: Filtering the initial pseudo labels according to a preset adaptive filtering rule to obtain filtered initial pseudo labels; The filtered initial pseudo labels are updated by using a unit step function, the attribute data of the target domain data, and the labeled target domain data to obtain optimal pseudo labels; Determine the type of the optimal pseudo label by using a preset array index function; If the type of the optimal pseudo label is a confidence type, encoding the optimal pseudo label as a hard label, and using the hard label as the first target pseudo label in the target pseudo labels; If the type of the optimal pseudo-label is a fuzzy type, the optimal pseudo-label is encoded as a soft label, and the soft label is used as the second target pseudo-label in the target pseudo-label.
5. The target domain label generation method according to claim 1, characterized in that: The step of determining the first fuzzy feature matrix of the target domain data and the second fuzzy feature matrix of the source domain data by a preset fuzzy mapping rule according to the initial target domain features and the initial source domain features includes: Establishing a fuzzy feature set of the target domain data and the source domain data according to the initial target domain features and the initial source domain features through a nonlinear transformation rule in the preset fuzzy mapping rule; A first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data are determined based on the fuzzy feature set.
6. The target domain label generation method according to claim 1, characterized in that: The step of calculating the update parameter according to the first fuzzy characteristic matrix and the second fuzzy characteristic matrix includes: Based on the first fuzzy feature matrix and the second fuzzy feature matrix, determining a conditional distribution difference matrix between the target domain data and the source domain data by using a first preset maximum mean difference algorithm; Determining a marginal distribution difference matrix between the target domain data and the source domain data by a second preset maximum mean difference algorithm based on the first fuzzy feature matrix and the second fuzzy feature matrix; Update parameters of the target domain data and the source domain data are determined according to the conditional distribution difference matrix and the marginal distribution difference matrix.
7. The target domain label generation method according to claim 1, characterized in that: After the step of determining the target domain label of the target domain data according to the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels, the method further includes: Recording the number of executions of the step of determining the target domain label of the target domain data based on the optimized target domain features, the optimized source domain features, and the target label matrix of the target pseudo labels, and using the number of executions as the current iteration number; Comparing the current number of iterations with a preset number of iterations; If the current number of iterations is less than the preset number of iterations, the label matrix of the target domain label is used as the initial label matrix, the optimal solution target domain feature is used as the initial target domain feature, and the optimal solution source domain feature is used as the initial source domain feature. The steps of obtaining the initial target domain features of the target domain data, the initial label matrix of the target domain data, and the initial source domain features of the source domain data are performed until the current number of iterations is equal to the preset number of iterations.
8. A target domain label generation device, characterized in that: The device comprises: A data acquisition module is used to obtain initial target domain features of target domain data, an initial label matrix of the target domain data, and initial source domain features of source domain data; a label optimization module, configured to predict initial pseudo labels of the target domain data using a random walk method based on the initial label matrix, filter the initial pseudo labels, and update the filtered initial pseudo labels to obtain target pseudo labels; a fuzzy mapping module, configured to determine, according to the initial target domain features and the initial source domain features, a first fuzzy feature matrix of the target domain data and a second fuzzy feature matrix of the source domain data by using a preset fuzzy mapping rule; a feature optimization module, configured to calculate update parameters according to the first fuzzy feature matrix and the second fuzzy feature matrix, and update the initial target domain features and the initial source domain features based on the update parameters, respectively, to obtain optimized target domain features corresponding to the initial target domain features and optimized source domain features corresponding to the initial source domain features; A label generation module is used to determine the target domain label of the target domain data according to the optimized target domain features, the optimized source domain features and the target label matrix of the target pseudo labels.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the target domain label generation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the target domain label generation method according to any one of claims 1 to 7 are implemented.