A data processing method and related apparatus

By constructing and iteratively optimizing the target alignment matrix, global similarity matrix, and predicted label matrix, and utilizing label propagation, the problem of time-consuming and costly manual labeling is solved, and efficient target domain image recognition model training is achieved.

CN115937573BActive Publication Date: 2026-06-26AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2022-11-02
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, training target domain image recognition models by relying on manual labeling is time-consuming and costly, especially in new fields where it reduces training efficiency.

Method used

By acquiring the training sample matrix, initial domain alignment matrix, initial global similarity matrix, and initial predicted label matrix, and updating and iteratively optimizing them, the target alignment matrix, target global similarity matrix, and target predicted label matrix are constructed. The difference between the target domain and the source domain is reduced by using label propagation, thus achieving model training without manual annotation.

Benefits of technology

This improves the training efficiency of target domain image recognition models, reduces the need for manual annotation, and enhances the training efficiency of target domain image recognition models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937573B_ABST
    Figure CN115937573B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and related device, obtains a training sample matrix composed of labeled image samples of a source domain and unlabeled image samples of a target domain, a sample label of the labeled image samples is used for identifying category information of the labeled image samples, an initial field alignment matrix, an initial global similarity matrix and an initial predicted label matrix are updated according to the training sample matrix, a target alignment matrix, a target global similarity matrix and a target predicted label matrix are obtained, a check parameter is constructed according to the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix and a source domain sample label matrix, if the check parameter does not satisfy a first convergence condition, iterative updating is performed until the first convergence condition is satisfied, and it is considered that training of an image recognition model of the target domain is completed. Label propagation can make the labeled image samples of the source domain be used in image recognition of the target domain, and improve training efficiency of the image recognition model of the target domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method and related apparatus. Background Technology

[0002] With the rapid development of artificial intelligence, machine learning is being widely applied in various fields. Specifically, it involves training models using machine learning methods to obtain target models applicable to a specific domain. These target models can then be used to process related business within that domain. For example, if the trained target model is an image recognition model, it can be used to recognize and process images within the target domain.

[0003] To address image recognition needs within a specific domain, it's necessary to train an image recognition model tailored to that domain. Model training relies on a large number of labeled samples. Typically, this is done manually by labeling sample data from the new domain, thus creating labeled samples suitable for model training.

[0004] However, this method of relying on manual labeling is time-consuming and costly, especially when it comes to a completely new domain, which reduces the training efficiency of image recognition models in that new domain. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a data processing method and related apparatus that can improve the training efficiency of image recognition models in the target domain.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0008] Obtain a training sample matrix, an initial neighborhood alignment matrix, an initial global similarity matrix, and an initial prediction label matrix; the training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain, and the sample labels of the labeled image samples are used to identify the category information of the labeled image samples;

[0009] Based on the training sample matrix, the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix are updated respectively to obtain the target alignment matrix, the target global similarity matrix, and the target prediction label matrix; the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between the training samples, and the target prediction label matrix is ​​used to identify the prediction category information of the image samples in the training sample matrix;

[0010] Inspection parameters are constructed based on the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix, and the source domain sample label matrix; the source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain.

[0011] If the checking parameters do not meet the first convergence condition, the target alignment matrix, the target global similarity matrix, and the target predicted label matrix are iteratively updated until the checking parameters meet the first convergence condition.

[0012] On the other hand, embodiments of this application provide a data processing apparatus, which includes an acquisition unit, an update unit, a construction unit, and an iteration unit:

[0013] The acquisition unit is used to acquire a training sample matrix, an initial neighborhood alignment matrix, an initial global similarity matrix, and an initial prediction label matrix; the training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain, and the sample labels of the labeled image samples are used to identify the category information of the labeled image samples;

[0014] The updating unit is used to update the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix according to the training sample matrix, respectively, to obtain a target alignment matrix, a target global similarity matrix, and a target prediction label matrix; the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between the training samples, and the target prediction label matrix is ​​used to identify the prediction category information of the image samples in the training sample matrix;

[0015] The construction unit is used to construct inspection parameters based on the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix, and the source domain sample label matrix; the source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain.

[0016] The iterative unit is used to iteratively update the target alignment matrix, the target global similarity matrix, and the target predicted label matrix respectively if the checking parameters do not meet the first convergence condition, until the checking parameters meet the first convergence condition.

[0017] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0018] The memory is used to store program code and transmit the program code to the processor;

[0019] The processor is used to execute the data processing method described above according to the instructions in the program code.

[0020] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the data processing method described above.

[0021] In another aspect, embodiments of this application provide a computer program product including instructions that, when run on a computer, cause the computer to perform the data processing method described above.

[0022] As can be seen from the above technical solution, a training sample matrix is ​​obtained, consisting of labeled image samples from the source domain and unlabeled image samples from the target domain. The sample labels of the labeled image samples are used to identify the category information of the labeled image samples. Then, the initial neighborhood alignment matrix, initial global similarity matrix, and initial prediction label matrix are updated according to the training sample matrix to obtain the target alignment matrix, target global similarity matrix, and target prediction label matrix. Among them, the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between training samples, and the target prediction label matrix is ​​used to identify the predicted category information of the image samples in the training sample matrix. Finally, check parameters are constructed based on the training sample matrix, target alignment matrix, target global similarity matrix, target prediction label matrix, and source domain sample label matrix. When the check parameters do not meet the first convergence condition, the target alignment matrix, target global similarity matrix, and target prediction label matrix are iteratively updated until the check parameters meet the first convergence condition. At this point, the training can be considered complete, and the image recognition model of the target domain is obtained. Based on this, by performing domain alignment between the source and target domains and determining the global structural similarity between training samples, the differences between the target and source domains are reduced. When determining the target prediction label matrix, a label propagation method is adopted. Using label propagation, the labeled image samples of the source domain can be used for image recognition in the target domain. Based on this, no manual labeling is required, which greatly improves the training efficiency of the image recognition model in the target domain. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0025] Figure 2 This is a structural diagram of a data processing apparatus provided in an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0027] The data processing method provided in this application can be implemented using a computer device, which can be a terminal device or a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations in this regard.

[0028] The following examples illustrate this in detail:

[0029] Figure 1 A flowchart of a data processing method provided in this application embodiment, using a server as an example of the aforementioned computer device, is used for illustration. The method includes S101-S104:

[0030] S101: Obtain the training sample matrix, initial neighborhood alignment matrix, initial global similarity matrix, and initial predicted label matrix.

[0031] The training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain. The sample labels of the labeled image samples are used to identify the category information of the labeled image samples. The initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix are initialized before model training begins.

[0032] In one possible implementation, S101 may include the following steps:

[0033] Obtain the training sample matrix;

[0034] The domain alignment parameters, global similarity parameters, and predicted label parameters are initialized based on the training sample matrix and the target constraints to obtain the initial domain alignment matrix, initial global similarity matrix, and initial predicted label matrix.

[0035] In practical applications, initialization can be performed using the following formula:

[0036]

[0037] st P T P = I

[0038] Meanwhile, the global similarity parameters and predicted label parameters can be initialized using Z=I and F=Y.

[0039] Where Σ represents the covariance matrix corresponding to the training sample matrix X, I represents a constant, T represents the matrix transpose, P represents the initial neighborhood alignment matrix, Z represents the initial global similarity matrix, F represents the initial prediction label matrix, and Y represents the source domain sample label.

[0040] S102: Based on the training sample matrix, update the initial domain alignment matrix, initial global similarity matrix, and initial predicted label matrix respectively to obtain the target alignment matrix, target global similarity matrix, and target predicted label matrix.

[0041] S103: Construct inspection parameters based on the training sample matrix, target alignment matrix, target global similarity matrix, target predicted label matrix, and source domain sample label matrix.

[0042] After initialization is complete, the model training process can begin. Specifically, based on the training sample matrix, the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial predicted label matrix are updated respectively to obtain the target alignment matrix, the target global similarity matrix, and the target predicted label matrix.

[0043] The target alignment matrix identifies the domain alignment results between the source and target domains, the target global similarity matrix identifies the global structural similarity between training samples, and the target prediction label matrix identifies the predicted category information of image samples in the training sample matrix. Therefore, after the update, inspection parameters can be constructed based on the training sample matrix, target alignment matrix, target global similarity matrix, target prediction label matrix, and source domain sample label matrix. The source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain. Based on this, the constructed inspection parameters can fuse features of local mapping and global similarity, while also reflecting the differences between the target prediction label matrix and the source domain sample matrix labels, facilitating subsequent convergence condition judgments based on the inspection parameters.

[0044] It should be noted that in the process of obtaining the target prediction label matrix, a label propagation method is adopted, which uses the labels corresponding to the labeled image samples in the source domain to obtain the labels of the unlabeled image samples in the target domain through label propagation.

[0045] S104: If the check parameters do not meet the first convergence condition, iteratively update the target alignment matrix, the target global similarity matrix, and the target predicted label matrix respectively until the check parameters meet the first convergence condition.

[0046] After a training session, the parameters can be checked. Specifically, the parameters can be compared with the first convergence condition. If the parameters do not meet the first convergence condition, it means that the model training has not yet converged and the model training process needs to be iterated. At this time, the target alignment matrix, the target global similarity matrix, and the target predicted label matrix can be iteratively updated until the parameters meet the first convergence condition.

[0047] In practical applications, the alignment of the source and target domains can be achieved through projection. Specifically, the target alignment matrix can be iteratively updated using the following process:

[0048]

[0049] Where P represents the target alignment matrix, X represents the training sample matrix, P can be the projection matrix of X, λ1 is the initialization parameter, Z represents the target global similarity matrix, L represents the Laplacian matrix, and Tr represents the trace of the matrix.

[0050] Furthermore, by decomposing the Frobenius norm, we obtain:

[0051]

[0052] At this point, to avoid trivial solutions, we can... T XLX T P = 1 is used as a constraint condition. Since Tr(P) T XLX T If P is a constant, then the objective can be transformed as follows:

[0053]

[0054] Simplification yields:

[0055]

[0056] At this point, the objective function can be equated to a generalized eigenvalue problem:

[0057] XAX T p = λXX T p

[0058] Where A = Z + Z T -ZZ T -λ1L, thus we can obtain the solution P=[p1,p2,···,p n], where p1, p2, ..., p n This represents the feature vector corresponding to the n largest feature values, where n represents the number of training samples.

[0059] In practical applications, the target global similarity matrix can be updated through the following process:

[0060]

[0061] Among them, L z Let Z represent the Laplacian matrix, F represent the target prediction matrix, and λ2 be the initialization parameter.

[0062] Furthermore, this convex optimization problem can be transformed into a corresponding Lagrangian function problem, expressed by the following formula:

[0063]

[0064] Where, x i Let z represent the i-th training sample. i f represents the eigenvector of the i-th column of the global similarity matrix of the target. i f represents the eigenvector of the i-th column of the target prediction label matrix. j z represents the eigenvector of the j-th column of the target prediction label matrix. ij This represents the global structure between the i-th training sample and the j-th training sample.

[0065] Expanding further, we can obtain:

[0066]

[0067] Where, d i ∈R n×1 , representing the degree corresponding to the i-th training sample. Further research on z i Taking the partial derivative and setting it to zero, we get:

[0068]

[0069] Thus, z i The convex optimization solution is:

[0070]

[0071] in, This can then be achieved by updating z one by one. i The solution Z = [z1, z2, ..., z] is obtained. n ].

[0072] In practical applications, the target prediction label matrix can be updated using label propagation, specifically through the following process:

[0073]

[0074]

[0075] Where, n s n represents the number of image samples in the source domain. t n represents the number of image samples in the target domain. s +n t =n, (n s +n t )×c represents the dimension of the matrix, where c can be the number of rows in the matrix, λ3 is the initialization parameter, and st represents the constraint condition.

[0076] Furthermore, Ky Fan's theorem can be used to solve this problem:

[0077]

[0078] According to the above theorem, we know that... The optimal solution of F can be obtained from L z The eigenvectors corresponding to the c smallest eigenvalues ​​are used to form the eigenvectors. Substitute them into... The objective function can be obtained as follows:

[0079]

[0080] The optimal solution to this objective function can be expressed as:

[0081] F=λ2ZF+λ3Y

[0082] Further simplification yields:

[0083] F=λ3(I-λ2Z) -1 Y

[0084] Accordingly, the check parameters can be constructed using the following formula, denoted as res:

[0085]

[0086] For ease of understanding, this example uses the current iteration as the k-th iteration, and the corresponding parameter to be checked is res. k Furthermore, it can be compared with the first convergence condition using the following formula:

[0087] |res k -res k-1 |<ε

[0088] Among them, res k-1 Represents the check parameters obtained after the (k-1)th iteration, |res k -res k-1 | can represent the difference between the results of the k-th iteration and the (k-1)-th iteration. ε is an initialization parameter, which can be set during initialization according to the number of training samples, for example, ε can be set to 10-5.

[0089] Correspondingly, when |res k -res k-1 When |≥ε, then the check parameter res in the k-th iteration is considered to be k If the first convergence condition is not met, the (k+1)th iteration is required to update P, Z, and F until the parameters meet the first convergence condition.

[0090] Since model training is a progressive iterative process, to retain the knowledge learned in the previous iteration and optimize the iteration process, one possible approach is to first obtain the predicted labels with a probability greater than a preset probability from the target prediction label matrix as retained labels, and obtain correction parameters, before proceeding to the next iteration. Then, based on the retained labels and correction parameters, the target prediction labels are corrected to obtain a corrected target prediction label matrix. After correction, the next iteration begins, where the target alignment matrix, target global similarity matrix, and corrected target prediction label matrix are iteratively updated. Based on this, retaining labels allows the knowledge learned in the previous training round to be transferred to the next iteration, thereby optimizing the iteration process.

[0091] In practical applications, the first b (b≤n) values ​​with the highest prediction probability in the target prediction matrix F can be retained as retained labels, and the vector corresponding to the retained labels can be denoted as F*. When correcting the target prediction label matrix based on the retained labels and correction parameters, F* can be weighted first using the correction parameter α to obtain α*F. * Further utilize α*F * Correct F.

[0092] In one possible implementation, the number of training samples included in the training sample matrix and the number of retained labels can also be obtained. The ratio of the number of retained labels to the number of training samples can be further calculated. If the ratio does not meet the second convergence condition, it can be considered that the number of retained labels in this round is small and the effect of this round of iteration is poor. At this time, the next round of iteration can be carried out, and the target alignment matrix, the target global similarity matrix and the corrected target prediction label matrix can be iteratively updated until the ratio meets the second convergence condition.

[0093] In practical applications, the ratio of the number of retained labels to the number of training samples can be compared with the second convergence condition using the following formula:

[0094]

[0095] Where b is the number of labels to retain, n is the number of training samples, and a is the initialization parameter.

[0096] Correspondingly, when If the ratio does not meet the second convergence condition, then the next iteration is required until the ratio meets the second convergence condition.

[0097] Furthermore, when the iteration reaches the point where the check parameters satisfy the first convergence condition and the ratio satisfies the second convergence condition, it can be considered that the model training has converged and has a good training effect. At this point, the iteration can be terminated, and the target alignment matrix, target global similarity matrix, and target predicted label matrix obtained from the last iteration update can be output.

[0098] In practical applications, when the iteration ends, it indicates that the model can be well used for image recognition in the target domain. Accordingly, the target domain image recognition model can be determined based on the model parameters corresponding to the last iteration. This target domain image recognition model is used for image recognition processing in the target domain. Furthermore, image samples to be recognized in the target domain can be obtained. The target domain image recognition model is then used to recognize these image samples, outputting the category information of the image samples. This completes the recognition processing of the image samples in the target domain. The category information of the image samples can be used to indicate the probability that the image sample belongs to the target category.

[0099] Based on this, local structure mapping is achieved through domain alignment, global structure approximation through a global similarity matrix, and label propagation from the source domain to the target domain is achieved through label propagation. Local structure mapping effectively preserves the intrinsic manifold structure in the original spaces of both the source and target domains, minimizing information loss from the original space to the projected space. Global structure approximation uses the global similarity between samples in the source and target domains as a metric, reducing feature differences in projected samples and achieving more accurate domain alignment. Label propagation fully utilizes the existing labeled information in the source domain, improving the prediction accuracy of sample labels in the target domain. In actual training, these three parts are integrated into a complete progressive optimization framework. The final model parameters (i.e., the model parameters corresponding to the last iteration) are obtained through iterative updates, thus determining a target domain image recognition model suitable for target domain image recognition. Based on this progressive optimization framework, the distribution differences between the target and source domains can be gradually reduced, fully preserving variable and prediction information from historical iterations, achieving efficient and rapid model solving.

[0100] That is, this application provides a structured unsupervised domain adaptation model based on local structure mapping, global structure approximation, and label propagation, the mathematical expression of which is as follows:

[0101]

[0102]

[0103] Furthermore, this can be transformed into matrix form as follows:

[0104]

[0105]

[0106] Where X = [x1, x2, ..., x n ]∈R m×n Let n be the training sample matrix consisting of labeled image samples in the source domain and unlabeled image samples in the target domain, where n = n s +n t n s and n t The original values ​​represent the number of samples in the source domain and the number of samples in the target domain, respectively, and m×n represents the dimension of the matrix; P∈R m×n Z is the global alignment matrix, which is the projection matrix of X; Z is the global similarity matrix, z ij P represents the i-th sample after projection. T x i and the j-th sample P T x jThe global structural relationship between them; L is the Laplacian matrix, representing the i-th sample P after projection. T x i and the j-th sample P T x j Local connectivity relationships between them; F is the predicted label matrix, f ij Y represents the probability that the predicted label of the i-th sample is class j; Y is the source domain sample label matrix, y ij This represents the probability that the i-th sample belongs to class j.

[0107] The Laplace matrix can be derived based on the following process:

[0108] The basic idea of ​​spectral clustering is to view all data points in space as a graph model connected by edges, and then further extract the connectivity relationships between all sample points in the graph model. For an undirected graph G(V,E), the set of points is V={v1,v2,...,v...}. n Let E be the set of edges and}. The objective function of the Ratio cut (Rcut) method in spectral clustering is:

[0109] min H tr(H T LH)

[0110] stH T DH = I

[0111] Where L=DW represents the Laplacian matrix corresponding to the graph formed by the original samples (i.e., training samples X); W is the affinity matrix, representing v i and v j The distance relationship; D is the degree matrix, specifically represented as:

[0112]

[0113] Where d i For each point v i The degree of, is defined as:

[0114]

[0115] As can be seen from the above technical solution, a training sample matrix is ​​obtained, consisting of labeled image samples from the source domain and unlabeled image samples from the target domain. The sample labels of the labeled image samples are used to identify the category information of the labeled image samples. Then, the initial neighborhood alignment matrix, initial global similarity matrix, and initial prediction label matrix are updated according to the training sample matrix to obtain the target alignment matrix, target global similarity matrix, and target prediction label matrix. Among them, the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between training samples, and the target prediction label matrix is ​​used to identify the predicted category information of the image samples in the training sample matrix. Finally, check parameters are constructed based on the training sample matrix, target alignment matrix, target global similarity matrix, target prediction label matrix, and source domain sample label matrix. When the check parameters do not meet the first convergence condition, the target alignment matrix, target global similarity matrix, and target prediction label matrix are iteratively updated until the check parameters meet the first convergence condition. At this point, the training can be considered complete, and the image recognition model of the target domain is obtained. Based on this, by performing domain alignment between the source and target domains and determining the global structural similarity between training samples, the differences between the target and source domains are reduced. When determining the target prediction label matrix, a label propagation method is adopted. Using label propagation, the labeled image samples of the source domain can be used for image recognition in the target domain. Based on this, no manual labeling is required, which greatly improves the training efficiency of the image recognition model in the target domain.

[0116] Figure 2 This is a structural diagram of a data processing apparatus provided in an embodiment of this application. The apparatus includes an acquisition unit 201, an update unit 202, a construction unit 203, and an iteration unit 204.

[0117] The acquisition unit 201 is used to acquire a training sample matrix, an initial neighborhood alignment matrix, an initial global similarity matrix, and an initial prediction label matrix; the training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain, and the sample labels of the labeled image samples are used to identify the category information of the labeled image samples;

[0118] The updating unit 202 is used to update the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix according to the training sample matrix, respectively, to obtain a target alignment matrix, a target global similarity matrix, and a target prediction label matrix; the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between the training samples, and the target prediction label matrix is ​​used to identify the prediction category information of the image samples in the training sample matrix;

[0119] The construction unit 203 is used to construct inspection parameters based on the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix, and the source domain sample label matrix; the source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain.

[0120] The iterative unit 204 is used to iteratively update the target alignment matrix, the target global similarity matrix, and the target predicted label matrix respectively if the checking parameters do not meet the first convergence condition, until the checking parameters meet the first convergence condition.

[0121] Optionally, the update unit is further configured to:

[0122] Obtain the predicted labels with a predicted probability greater than a preset probability from the target predicted label matrix as retained labels, and obtain the correction parameters;

[0123] The target prediction label matrix is ​​corrected based on the retained labels and the correction parameters to obtain the corrected target prediction label matrix;

[0124] The target alignment matrix, the target global similarity matrix, and the corrected target prediction label matrix are iteratively updated respectively.

[0125] Optionally, the update unit is further configured to:

[0126] Obtain the number of training samples included in the training sample matrix, and obtain the number of retained labels;

[0127] Calculate the ratio of the number of retained labels to the number of training samples;

[0128] If the ratio does not meet the second convergence condition, the target alignment matrix, the target global similarity matrix, and the corrected target prediction label matrix are iteratively updated until the ratio meets the second convergence condition.

[0129] Optionally, the device further includes a termination unit and an output unit:

[0130] The termination unit is used to terminate the iteration if the checking parameters satisfy the first convergence condition and the ratio satisfies the second convergence condition.

[0131] The output unit is used to output the target alignment matrix, target global similarity matrix, and target predicted label matrix obtained from the last iteration update.

[0132] Optionally, the device further includes an identification unit, the identification unit being used for:

[0133] When the iteration ends, the target domain image recognition model is determined based on the model parameters corresponding to the last iteration.

[0134] Obtain the image sample to be identified in the target domain;

[0135] The target domain image recognition model is used to identify the image sample to be identified, and the category information of the image sample to be identified is output.

[0136] Optionally, the acquisition unit is further configured to:

[0137] Obtain the training sample matrix;

[0138] The domain alignment parameter, global similarity parameter, and predicted label parameter are initialized based on the training sample matrix and the target constraints to obtain the initial domain alignment matrix, the initial global similarity matrix, and the initial predicted label matrix.

[0139] As can be seen from the above technical solution, a training sample matrix is ​​obtained, consisting of labeled image samples from the source domain and unlabeled image samples from the target domain. The sample labels of the labeled image samples are used to identify the category information of the labeled image samples. Then, the initial neighborhood alignment matrix, initial global similarity matrix, and initial prediction label matrix are updated according to the training sample matrix to obtain the target alignment matrix, target global similarity matrix, and target prediction label matrix. Among them, the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between training samples, and the target prediction label matrix is ​​used to identify the predicted category information of the image samples in the training sample matrix. Finally, check parameters are constructed based on the training sample matrix, target alignment matrix, target global similarity matrix, target prediction label matrix, and source domain sample label matrix. When the check parameters do not meet the first convergence condition, the target alignment matrix, target global similarity matrix, and target prediction label matrix are iteratively updated until the check parameters meet the first convergence condition. At this point, the training can be considered complete, and the image recognition model of the target domain is obtained. Based on this, by performing domain alignment between the source and target domains and determining the global structural similarity between training samples, the differences between the target and source domains are reduced. When determining the target prediction label matrix, a label propagation method is adopted. Using label propagation, the labeled image samples of the source domain can be used for image recognition in the target domain. Based on this, no manual labeling is required, which greatly improves the training efficiency of the image recognition model in the target domain.

[0140] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0141] The memory is used to store program code and transmit the program code to the processor;

[0142] The processor is used to execute the data processing method provided in the above embodiments according to the instructions in the program code.

[0143] The computer device may include a terminal device or a server, and the aforementioned data processing device may be configured in the computer device.

[0144] In another aspect, embodiments of this application also provide a storage medium for storing a computer program for executing the data processing method provided in the above embodiments.

[0145] In addition, this application also provides a computer program product including instructions, which, when run on a computer, causes the computer to execute the data processing method provided in the above embodiments.

[0146] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0147] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0149] The data processing method and related apparatus provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method of this application. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the method of this application.

[0150] In summary, the content of this specification should not be construed as limiting this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. Furthermore, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.

Claims

1. A data processing method, characterized in that, The method includes: Obtain a training sample matrix, an initial neighborhood alignment matrix, an initial global similarity matrix, and an initial prediction label matrix; the training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain, and the sample labels of the labeled image samples are used to identify the category information of the labeled image samples; Based on the training sample matrix, the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix are updated respectively to obtain the target alignment matrix, the target global similarity matrix, and the target prediction label matrix; the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between the training samples, and the target prediction label matrix is ​​used to identify the prediction category information of the image samples in the training sample matrix; Inspection parameters are constructed based on the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix, and the source domain sample label matrix; the source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain. If the checking parameters do not meet the first convergence condition, the target alignment matrix, the target global similarity matrix and the target predicted label matrix are iteratively updated until the checking parameters meet the first convergence condition. The iterative updates of the target alignment matrix, the target global similarity matrix, and the target predicted label matrix include: Obtain the predicted labels with a predicted probability greater than a preset probability from the target predicted label matrix as retained labels, and obtain the correction parameters; The target prediction label matrix is ​​corrected based on the retained labels and the correction parameters to obtain the corrected target prediction label matrix; The target alignment matrix, the target global similarity matrix, and the corrected target prediction label matrix are iteratively updated respectively.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the number of training samples included in the training sample matrix, and obtain the number of retained labels; Calculate the ratio of the number of retained labels to the number of training samples; If the ratio does not meet the second convergence condition, the target alignment matrix, the target global similarity matrix, and the corrected target prediction label matrix are iteratively updated until the ratio meets the second convergence condition.

3. The method according to claim 2, characterized in that, The method further includes: If the checked parameters satisfy the first convergence condition and the ratio satisfies the second convergence condition, the iteration ends; Output the target alignment matrix, target global similarity matrix, and target predicted label matrix obtained from the last iteration update.

4. The method according to claim 3, characterized in that, The method further includes: When the iteration ends, the target domain image recognition model is determined based on the model parameters corresponding to the last iteration. Obtain the image sample to be identified in the target domain; The target domain image recognition model is used to identify the image sample to be identified, and the category information of the image sample to be identified is output.

5. The method according to any one of claims 1-4, characterized in that, The process of obtaining the training sample matrix, the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial predicted label matrix includes: Obtain the training sample matrix; The domain alignment parameter, global similarity parameter, and predicted label parameter are initialized based on the training sample matrix and the target constraints to obtain the initial domain alignment matrix, the initial global similarity matrix, and the initial predicted label matrix.

6. A data processing apparatus, characterized in that, The device includes an acquisition unit, an update unit, a construction unit, and an iteration unit: The acquisition unit is used to acquire a training sample matrix, an initial neighborhood alignment matrix, an initial global similarity matrix, and an initial prediction label matrix; the training sample matrix includes labeled image samples from the source domain and unlabeled image samples from the target domain, and the sample labels of the labeled image samples are used to identify the category information of the labeled image samples; The updating unit is used to update the initial neighborhood alignment matrix, the initial global similarity matrix, and the initial prediction label matrix according to the training sample matrix, respectively, to obtain a target alignment matrix, a target global similarity matrix, and a target prediction label matrix; the target alignment matrix is ​​used to identify the neighborhood alignment result between the source domain and the target domain, the target global similarity matrix is ​​used to identify the global structural similarity between the training samples, and the target prediction label matrix is ​​used to identify the prediction category information of the image samples in the training sample matrix; The construction unit is used to construct inspection parameters based on the training sample matrix, the target alignment matrix, the target global similarity matrix, the target predicted label matrix, and the source domain sample label matrix; the source domain sample label matrix is ​​constructed based on the sample labels of the labeled image samples in the source domain. The iterative unit is used to iteratively update the target alignment matrix, the target global similarity matrix, and the target predicted label matrix respectively if the checking parameters do not meet the first convergence condition, until the checking parameters meet the first convergence condition. The iterative unit is further configured to: Obtain the predicted labels with a predicted probability greater than a preset probability from the target predicted label matrix as retained labels, and obtain the correction parameters; The target prediction label matrix is ​​corrected based on the retained labels and the correction parameters to obtain the corrected target prediction label matrix; The target alignment matrix, the target global similarity matrix, and the corrected target prediction label matrix are iteratively updated respectively.

7. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method described in any one of claims 1-5 according to the instructions in the program code.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-5.

9. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-5.