Data processing method, self-learning system and electronic equipment

By combining the losses of supervised and unsupervised training and performing high-order moment matching to optimize the self-learning model, the problem of inconsistent distribution of the source domain and target domain in domain adaptive learning is solved, and the learning performance of the model is improved.

CN113065662BActive Publication Date: 2024-10-15ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010001468.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-02
Publication Date
2024-10-15
Estimated Expiration
2040-01-02

AI Technical Summary

Technical Problem

When the probability distributions of the source domain and the target domain are inconsistent, the performance of the self-learning model will be severely degraded, making it difficult to effectively perform domain adaptive learning.

Method used

By combining the losses of supervised training and unsupervised training, and using the output data of the target model layer for high-order moment matching, the self-learning model is optimized to overcome inter-domain differences and improve the domain adaptive learning effect.

Benefits of technology

It effectively overcomes the problem of poor learning results caused by different distributions of the source domain and target domain, improves the domain adaptive learning performance of the self-learning model, and makes its performance more stable and accurate in different distribution environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113065662B_ABST
    Figure CN113065662B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data processing method, a self-learning system and an electronic device. The data processing method includes: based on a first labeled image sample, supervised training of the self-learning model is performed to obtain a first loss; based on an unlabeled second image sample, unsupervised training of the self-learning model is performed to obtain a second loss; obtaining the first output data corresponding to the target model layer of the self-learning model during the supervised training process and the second output data corresponding to the target model layer during the unsupervised training process; determining the third loss according to the first output data and the second output data; optimizing the self-learning model based on the first loss, the second loss and the third loss; wherein the self-learning model is used to process images. The technical solution provided in the embodiments of the present application helps to overcome the problem of poor learning effect caused by different probability distributions of the source domain and the target domain, improve the domain adaptive learning effect of the self-learning model, and has good performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a self-learning system and an electronic device. Background Art

[0002] In traditional machine learning algorithms, it is usually assumed that the training samples and test samples come from the same probability distribution, and then the corresponding models and discriminant criteria are designed to predict the output of the test samples. However, in many practical scenarios, the training sample set (such as the labeled sample set, also called the source domain) and the test sample set (such as the unlabeled sample set, also called the target domain) may come from data with different probability distributions. In this case, the self-learning model trained with the training sample set will have a low accuracy in the output results when testing the samples to be tested in the test sample set, that is, the performance of the self-learning model will be seriously degraded.

[0003] How to learn when the probability distribution of the source domain (such as the labeled sample set) and the target domain (such as the test sample set) are inconsistent is the domain adaptive learning problem. Therefore, the focus of domain adaptive learning is how to overcome the difference between the source domain distribution and the target domain distribution and achieve the learning task in the target domain. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, a self-learning system and an electronic device that can improve the domain adaptive learning effect of a self-learning model.

[0005] In one embodiment of the present application, a data processing method is provided. The data processing method includes:

[0006] Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss;

[0007] Based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss;

[0008] Obtaining first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process;

[0009] determining a third loss according to the first output data and the second output data;

[0010] Based on the first loss, the second loss and the third loss, optimizing the self-learning model;

[0011] Wherein, the self-learning model is used to process images.

[0012] In another embodiment of the present application, a data processing method is provided. The data processing method includes:

[0013] Get the object to be classified;

[0014] Taking the object to be classified as an input parameter of a self-learning model, executing the self-learning model to obtain classification information to which the object to be classified belongs;

[0015] Among them, the self-learning model is trained using an unsupervised domain adaptive algorithm; the training process using the unsupervised domain adaptive algorithm includes: based on a labeled first image sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; the first output data corresponding to the target model layer of the self-learning model during the supervised training process and the second output data corresponding to the target model layer during the unsupervised training process are obtained; the third loss is determined based on the first output data and the second output data; and the self-learning model is optimized based on the first loss, the second loss and the third loss.

[0016] In another embodiment of the present application, a self-learning system is provided. The self-learning system comprises:

[0017] At least one model layer is used to perform data processing on an input first labeled image sample to obtain a first processing result; and perform data processing on an input second unlabeled image sample to obtain a second processing result;

[0018] an output layer, connected to a model layer of the at least one model layer, configured to output a first output result based on the first processing result; and output a second output result based on the second processing result;

[0019] An optimization module, configured to determine a first loss according to the first output result and the label of the first image sample; determine a second loss according to the second output result; and also to obtain a third processing result output by the target model layer during data processing of the first image sample and a fourth processing result output by the target model layer during data processing of the second image sample; determine a third loss according to the third processing result and the fourth processing result; and optimize at least part of the layers in the at least one model layer based on the first loss, the second loss and the third loss;

[0020] Wherein, the at least one model layer contains the target model layer.

[0021] In another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein:

[0022] The memory is used to store programs;

[0023] The processor is coupled to the memory and is configured to execute the program stored in the memory to:

[0024] Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss;

[0025] Based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss;

[0026] Obtaining first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process;

[0027] determining a third loss according to the first output data and the second output data;

[0028] Based on the first loss, the second loss and the third loss, the self-learning model is optimized.

[0029] In another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein:

[0030] The memory is used to store programs;

[0031] The processor is coupled to the memory and is configured to execute the program stored in the memory to:

[0032] Get the object to be classified;

[0033] Taking the object to be classified as an input parameter of a self-learning model, executing the self-learning model to obtain classification information to which the object to be classified belongs;

[0034] Among them, the self-learning model is trained using an unsupervised domain adaptive algorithm; the training process using the unsupervised domain adaptive algorithm includes: based on a labeled first image sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; the first output data corresponding to the target model layer of the self-learning model during the supervised training process and the second output data corresponding to the target model layer during the unsupervised training process are obtained; the third loss is determined based on the first output data and the second output data; and the self-learning model is optimized based on the first loss, the second loss and the third loss.

[0035] The technical solutions provided in the embodiments of the present application not only integrate the losses corresponding to supervised training and unsupervised training in the optimization process, but also integrate the losses determined based on the output data output by the target model layer in supervised training and unsupervised training, respectively. This helps to overcome the problem of poor learning effect caused by the different probability distributions of the source domain (such as labeled sample sets) and the target domain (such as unlabeled sample sets), improve the domain adaptive learning effect of the self-learning model, and make the self-learning model have better performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 A schematic diagram of the principle of a data processing method provided in one embodiment of the present application;

[0038] Figure 2 A flowchart of a data processing method provided in one embodiment of the present application;

[0039] Figure 3 A flowchart of a data processing method provided by another embodiment of the present application;

[0040] Figure 4 A schematic diagram of a data processing method provided in another embodiment of the present application;

[0041] Figure 5 A schematic diagram of a data processing method provided in accordance with another embodiment of the present invention;

[0042] Figure 6 A flowchart of a data processing method provided in yet another embodiment of the present application;

[0043] Figure 7 A schematic diagram of a first application scenario architecture to which the data processing method provided in an embodiment of the present application is suitable;

[0044] Figure 8a A schematic diagram of a second application scenario to which the data processing method provided in an embodiment of the present application is suitable;

[0045] Figure 8b A schematic diagram of a data processing method provided by an embodiment of the present application using a neural network model as an example in a second application scenario;

[0046] Fig. 9A schematic diagram of a third application scenario to which the data processing method provided in an embodiment of the present application is suitable;

[0047] Fig.10 A schematic diagram of a self-learning system according to an embodiment of the present application;

[0048] Fig.11 A schematic diagram of the structure of a data processing device provided in one embodiment of the present application;

[0049] Fig.12 A schematic diagram of the structure of a data processing device provided in another embodiment of the present application;

[0050] Fig.13 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0052] In some processes described in the specification, claims and the above-mentioned figures of this application, multiple operations appearing in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. In addition, the following embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0053] Before introducing the technical solutions provided by the embodiments of the present application, a brief description of the terms appearing in this document is first given.

[0054] Machine learning is the process of learning a part of the computer data and then predicting and classifying other data (such as images). The concept of machine learning is to train the model by inputting massive training data so that the model can master the potential rules contained in the data and accurately classify or predict the newly input data.

[0055] The self-learning model mentioned in this article is the one mentioned in the concept of machine learning that requires input training data for training in order to master the underlying rules of the data, and then accurately classify or predict the newly input data (such as images). The self-learning model can be simply understood as a function, which is used to achieve i The mapping from sample label Y to sample label Y, that is, f(x i )—>Y; The purpose of training is to continuously optimize the parameters in the function so that the trained self-learning model can accurately classify or predict the newly input data. Among them, the self-learning model may include but is not limited to: a neural network model.

[0056] Figure 1 and Figure 2 A flow chart of a data processing method provided in an embodiment of the present application is shown. Figure 1 This is a theoretical schematic diagram of the data processing method provided in this embodiment. Figure 2 The data processing method provided in this embodiment is a method flow diagram. The execution subject of the data processing method provided in this embodiment may be a processing device, which may be a server on the service end, a virtual server on the cloud or a hardware device, etc. Specifically, Figure 1 and Figure 2 As shown, the method includes:

[0057] 101. Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss.

[0058] 102. Based on the unlabeled second image sample, perform unsupervised training on the self-learning model to obtain a second loss.

[0059] 103. Obtain first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process.

[0060] 104. Determine a third loss according to the first output data and the second output data.

[0061] 105. Based on the first loss, the second loss and the third loss, optimize the self-learning model.

[0062] In the above 101, the labeled first image sample includes: first image sample data and a label. In specific implementation, the first image sample data in the first image sample can be used as an input parameter of the self-learning model, and the self-learning model is executed to obtain an output result; then, the first loss is determined according to the output result and the label. Specifically, the first loss can be determined using a loss calculation model. Among them, the loss calculation model can directly select existing functions in the prior art, such as a softmax loss calculation model, etc., and this embodiment does not specifically limit this.

[0063] In the above 102, the unlabeled second image sample can be simply understood as: containing the second image sample data but not the corresponding label. Therefore, it is impossible to supervise the self-learning model. To this end, this embodiment can perform clustering in a way of minimizing entropy, and determine the second loss based on the clustering results. It should be added here that the specific implementation example will be described in detail below.

[0064] It should be added here that the self-learning model trained using the first labeled image samples and the self-learning model trained using the second unlabeled image samples are the same model, and the parameters in the model are the same.

[0065] In the above 103, the self-learning model may include at least one model layer and an output layer connected to one of the at least one model layer. The target model layer may be a layer before the output layer, that is, a model layer connected to the output layer; or it may be any one or more layers of the at least one model layer, which is not specifically limited in this embodiment.

[0066] In the above 104, in order to learn domain-invariant features, this embodiment may propose a solution that minimizes inter-domain differences by using a high-order moment matching method. That is, in an achievable technical solution, the above “determining the third loss based on the first output data and the second output data” may include:

[0067] 1041. Perform high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements;

[0068] 1042. Determine the third loss according to the first P-order moment and the second P-order moment;

[0069] Herein, P is a value greater than or equal to 3; for example, P may be 3 or 4.

[0070] At present, in order to learn the potential common feature expressions in the source domain (such as a labeled sample set) and the target domain (such as an unlabeled sample set) in the unsupervised domain adaptation algorithm, the commonly used methods are maximizing mean difference and correlation alignment. Maximizing mean difference aims to minimize the distance between the means of two distributions in the regenerated Hilbert space, which is essentially the alignment of first-order moments. Correlation alignment aims to align the covariance moment of the feature distribution of the source domain data with the covariance moment of the feature distribution of the target domain data, which is essentially the alignment of second-order center distances. The above-mentioned maximum mean difference and correlation alignment methods only consider the alignment of statistical information of the second order and below, which cannot well reflect the true feature distribution of non-Gaussian data, while high-order statistical information can better characterize non-Gaussian distribution. Specifically, high-order statistical information includes but is not limited to at least one of the following: high-order moment, high-order cumulant, high-order spectrum, etc. Among them, high-order moment matching can achieve more fine-grained distribution alignment, thereby minimizing the difference between domains.

[0071] Typically, the first output data output by the target model layer during the supervised training process using the first image sample is a first eigenvector of dimension L; the second output data output by the target model layer during the unsupervised training process using the second image sample is a second eigenvector of dimension L; wherein dimension L is the number of neurons in the target model layer. In order to minimize the inter-domain differences by using high-order moment matching, the above step 1041 "the first output data and the second output data are subjected to high-order moment matching processing to obtain the first P-order moment and the second P-order moment that meet the matching requirements" can be specifically as follows:

[0072] Vector outer product calculation is performed on the first eigenvector and the second eigenvector respectively to obtain the first P-th order moment and the second P-th order moment.

[0073] More specifically, assume that the first eigenvector is represented as: Correspondingly, the vector outer product calculation formula for the first eigenvector can be represented as: The result calculated by using the calculation formula is a P-order tensor, and the P-order tensor is the first P-order moment.

[0074] To achieve high-order moment matching, a similar vector outer product calculation needs to be performed on the second eigenvector to obtain a second P-order moment of the same order as the first P-order moment. Specifically, assume that the second eigenvector is represented as: Correspondingly, the vector outer product calculation formula for the first eigenvector can be represented as: The result calculated by using the calculation formula is another P-order tensor, and the P-order tensor is the second P-order moment.

[0075] For the content related to the vector outer product calculation, reference may be made to the corresponding content in the prior art, and this embodiment does not make any specific limitation thereto.

[0076] In a specific implementation, the above 1042 “determine the third loss according to the first P-order moment and the second P-order moment” may be specifically:

[0077] 10421. Determine a difference between the first P-order moment and the second P-order moment;

[0078] 10422. Determine the third loss based on the difference.

[0079] For example, the third loss can be obtained using the following formula (1):

[0080]

[0081] Formula (1) is applicable to a process of using a single first image sample and a single second image sample as input parameters of a self-learning model, respectively, and executing the self-learning model to determine the third loss.

[0082] In actual scenarios, multiple first image samples and multiple second image samples are used as input parameters of the self-learning model, and the self-learning model is executed to perform supervised learning and unsupervised learning respectively. For scenarios where multiple first image samples and multiple second image samples are used as input parameters for training, the third loss can be obtained using the following formula (2):

[0083]

[0084] Where L is the number of neurons in the target model layer; n s is the number of labeled first image samples; n t is the number of unlabeled second image samples; is the sum of the first P-order moments corresponding to all first image samples; The above formula determines the third loss value based on the average value of the first P-order moment corresponding to all the first image samples and the average value of the second P-order moment corresponding to all the second image samples.

[0085] In the above 105, the total loss can be calculated based on the first loss, the second loss and the third loss; then, the self-learning model is optimized according to the total loss. That is, in a specific achievable technical solution, the above “optimizing the self-learning model based on the first loss, the second loss and the third loss” may include:

[0086] 1051. Calculate a total loss based on the first loss, the second loss, and the third loss;

[0087] 1052. When the total loss satisfies a convergence condition, the self-learning model completes training;

[0088] 1053. When the total loss does not satisfy the convergence condition, optimize the parameters in the self-learning model according to the total loss.

[0089] In step 1051, the sum of the first loss, the second loss and the third loss may be directly used as the total loss; or the weighted average of the first loss, the second loss and the third loss may be used as the total loss; or the total loss may be calculated using a loss calculation model, etc., which is not specifically limited in this embodiment;

[0090] That is, the above step 1051 of “calculating the total loss based on the first loss, the second loss and the third loss” may specifically include:

[0091] The sum of the first loss, the second loss and the third loss is taken as the total loss; or

[0092] taking the weighted sum of the first loss, the second loss and the third loss as the total loss; or

[0093] Using the first loss, the second loss, and the third loss as input parameters of a first loss calculation model, executing the first loss calculation model to obtain the total loss; or

[0094] Use two of the first loss, the second loss and the third loss as input parameters of a second loss calculation model to execute the second loss calculation model to obtain a first value; use the remaining one of the first loss, the second loss and the third loss and the first value as input parameters of a third loss calculation model to execute the third loss calculation model to obtain the total loss.

[0095] The above first loss calculation model can be characterized as the following function:

[0096] loss1=f1(x,y,z)

[0097] Among them, loss1 is the total loss, f1(x, y, z) represents the first loss calculation model, and the specific function form is not specifically limited in this embodiment, which represents the data relationship between the first loss, the second loss, the third loss and the total loss. x is the first loss, y is the second loss, and z is the third loss.

[0098] The above second loss calculation model can be characterized as the following function:

[0099] loss2=f2(x,y)

[0100] The third loss calculation model can be represented as the following function:

[0101] loss3 = f3(loss2, z)

[0102] Among them, loss2 is the first value, f2(x, y) represents the second loss calculation model, and the specific function form is not specifically limited in this embodiment, which represents the data relationship between the first loss, the second loss and the first value. x is the first loss, y is the second loss, and z is the third loss. Loss2 is the total loss; the above formulas loss2 = f2(x, y) and loss3 = f3(loss2, z) can be simply understood as the calculation process of the nested loss calculation model.

[0103] It should be added here that: the above-mentioned second loss calculation model takes the first loss and the second loss as input parameters, and the third loss calculation model takes the third loss and the first value as input parameters. In fact, the input parameters of the second loss calculation model can also be the second loss and the third loss, or the first loss and the third loss. Correspondingly, the function of the third loss can be the remaining loss among the three; this embodiment does not make specific limitations on this.

[0104] In a specific implementation, if the total loss is less than a preset threshold, the convergence condition is met; if the total loss is greater than or equal to the preset threshold, the convergence condition is not met. The preset threshold can be determined according to the actual model design requirements, and the specific value of the preset threshold is not specifically limited in this embodiment.

[0105] Furthermore, in this embodiment, step 102 “optimizing the self-learning model based on the first loss, the second loss, and the third loss” may specifically include:

[0106] 1021. Use the unlabeled second image sample as an input parameter of the self-learning model, and execute the self-learning model to obtain third output data.

[0107] The third output data includes: data items corresponding to the outputs of each neuron in the output layer of the self-learning model. More specifically, the number of neurons in the output layer of the self-learning model is the number of categories.

[0108] 1022. Determine the second loss according to the data item corresponding to the output of each neuron in the multiple neurons.

[0109] For example, the second loss can be obtained by minimizing the entropy loss function (3) as follows:

[0110]

[0111] Among them, C is the number of categories, p j is the softmax output of the jth neuron in the output layer.

[0112] Similarly, formula (3) is applicable to the process of using a single second image sample as an input parameter of the self-learning model and executing the self-learning model to determine the second loss.

[0113] In actual scenarios, multiple second image samples are usually used as input parameters of the self-learning model, and the self-learning model is executed to determine the second loss. Accordingly, the third loss can be obtained using the following formula (4):

[0114]

[0115] Where C is the number of categories, n t is the number of unlabeled second image samples; p j is the softmax output of the jth neuron in the output layer.

[0116] The unsupervised domain adaptation algorithm is: given labeled source domain data and unlabeled target domain data; the distribution of source domain data and target domain data is similar but inconsistent; using labeled source domain data and unlabeled target domain data, a model with good generalization performance on the target domain is trained. In order to further improve the existing unsupervised domain adaptation algorithm and improve the performance of the trained self-learning model, this embodiment proposes a scheme that combines the losses determined based on the output data output by the target model layer in the supervised training and unsupervised training in the optimization process in addition to the losses corresponding to the supervised training and unsupervised training. Among them, in the optimization process, the losses determined based on the output data output by the target model layer in the supervised training and unsupervised training are taken into account, which is very helpful for minimizing the difference between domains; and further helps to overcome the problem of poor learning effect caused by the different probability distributions of the source domain (such as labeled sample set) and the target domain (such as unlabeled sample set), improve the domain adaptation learning effect of the self-learning model, and make the self-learning model have better performance.

[0117] Furthermore, this embodiment provides a solution to minimize the difference between domains by adding high-order moment matching in the unsupervised domain adaptation algorithm. When the order is greater than 3, high-order moment matching can achieve fine-grained domain alignment, because high-order statistics can approximate more complex non-Gaussian distributions; therefore, the use of high-order moments can better reflect the true feature distribution of non-Gaussian data, and the use of high-order moment matching can minimize the difference between domains to overcome the problem of poor learning effect caused by the different probability distributions of the source domain (such as a labeled sample set) and the target domain (such as an unlabeled sample set), improve the domain adaptation learning effect of the self-learning model, and make the self-learning model have better performance.

[0118] Furthermore, the data processing method provided in this embodiment may also include the following steps:

[0119] 106. In response to a first optimization method triggering event, trigger a step of optimizing the self-learning model based on the first loss, the second loss, and the third loss.

[0120] That is, step 105 of this embodiment is triggered to execute again when the first optimization mode triggering event is monitored. Among them, the first optimization mode triggering event can be triggered by the user through an interactive unit (such as an interactive interface, a voice interactive device, etc.). For example, the user can click the corresponding optimization mode selection control through the interactive interface to trigger the first optimization mode to instruct the self-learning model to train according to the specified optimization mode. Alternatively, the first optimization mode triggering event can also be spontaneously generated by the execution subject of the method of this embodiment. For example, the execution subject triggers the corresponding optimization mode according to the preset accuracy requirement parameters.

[0121] Furthermore, the method provided in this embodiment may also include at least one of the following steps:

[0122] 107. In response to a second optimization mode triggering event, optimizing the self-learning model according to the first loss and the third loss;

[0123] 108. In response to a third optimization mode triggering event, optimizing the self-learning model according to the second loss and the third loss;

[0124] 109. In response to a triggering event of a fourth optimization method, the self-learning model is optimized according to the first loss and the second loss.

[0125] The optimization method triggering events in the above 107 to 109 may be triggered by a user through an interactive unit (such as an interactive interface, a voice interactive device, etc.); or may be triggered by an execution subject according to accuracy requirement parameters, which is not specifically limited in this embodiment.

[0126] In the above 107, “optimizing the self-learning model according to the first loss and the third loss” may specifically be:

[0127] Optimizing the self-learning model using the sum of the first loss and the third loss; or

[0128] Optimizing the self-learning model using a weighted sum of the first loss and the third loss; or

[0129] The first loss and the third loss are used as input parameters of a fourth loss calculation model, the fourth loss calculation model is executed to obtain a total loss, and the self-learning model is optimized using the total loss.

[0130] The setting of the weights corresponding to the losses in the weighted sum calculation of the first loss and the third loss is not specifically limited in this embodiment. The fourth loss calculation model can be set based on actual needs, or an existing model can be directly selected, which is not specifically limited in this embodiment.

[0131] Similarly, in the above 108, “optimizing the self-learning model according to the second loss and the third loss” may specifically be:

[0132] Optimizing the self-learning model using the sum of the second loss and the third loss; or

[0133] Optimizing the self-learning model using a weighted sum of the second loss and the third loss; or

[0134] The second loss and the third loss are used as input parameters of a fifth loss calculation model, the fifth loss calculation model is executed to obtain a total loss, and the self-learning model is optimized using the total loss.

[0135] Similarly, in the above 109, “optimizing the self-learning model according to the first loss and the second loss” may specifically be:

[0136] Optimizing the self-learning model using the sum of the first loss and the second loss; or

[0137] Optimizing the self-learning model using a weighted sum of the first loss and the second loss; or

[0138] The first loss and the second loss are used as input parameters of a sixth loss calculation model, the loss calculation model is executed to obtain a total loss, and the self-learning model is optimized using the total loss.

[0139] It should be added here that the fourth loss calculation model, the fifth loss calculation model and the sixth loss calculation model can be the same calculation model or different calculation models, and this embodiment does not make any specific limitation on this.

[0140] Figure 3 and Figure 4 A flowchart of a data processing method provided by another embodiment of the present application is shown. Similarly, the execution subject of the method provided by this embodiment may be a processing device, which may be a server on the service end side, a cloud or a virtual server deployed on a hardware device, etc. Specifically, Figure 3 and Figure 4 As shown, the method includes:

[0141] 201. Use a self-learning model to process a first image sample included in a labeled sample set and a second image sample included in an unlabeled sample set respectively.

[0142] The self-learning model can be a dual-stream deep convolutional neural network (CNNS). The parameters of the labeled sample set and the unlabeled sample set are shared, that is, the parameters in the self-learning model for processing the labeled sample set and the parameters in the self-learning model for processing the unlabeled sample set are the same set of network parameters.

[0143] For the sake of convenience, the self-learning model trained with labeled sample sets is called the source domain network; the self-learning model trained with unlabeled sample sets is called the target domain network. In specific implementation, the network architecture of the source domain network and the target domain network can adopt the ResNet-50 network and be initialized using the model pre-trained with the ImageNet dataset.

[0144] See also Figure 4 As shown, the self-learning model is implemented using a deep convolutional neural network, which may include: an input layer, one or more convolutional layers, one or more fully connected layers, and an output layer.

[0145] 202. The baseband label sample set is used to supervise the self-learning model and obtain the first loss.

[0146] Specifically, the first loss is obtained by the following calculation formula:

[0147]

[0148] Among them, J(·,·) is the standard softmax loss function, is the output of the i-th first image sample in the labeled sample set after inputting the source domain network, n s is the number of the first image samples in the labeled sample set, is the label corresponding to each first image sample in the labeled sample set.

[0149] 203. Perform unsupervised training on the self-learning model based on the unlabeled sample set to obtain a second loss.

[0150] Specifically, the second loss can be obtained by minimizing the entropy loss function as follows:

[0151]

[0152] Among them, C is the number of categories, n t is the number of the second image samples in the unlabeled sample set; p j is the softmax output of the jth neuron in the output layer.

[0153] 204. Perform vector outer product calculation on the first eigenvector and the second eigenvector respectively to obtain the first P-order moment and the second P-order moment; and determine the third loss according to the first P-order moment and the second P-order moment.

[0154] Specifically, the third loss can be obtained by the following high-order moment matching loss function:

[0155]

[0156] Among them, L is the number of neurons in the target model layer (the layer before the output layer), is the feature vector output by the target model layer of the source domain network, with a dimension of L. is the outer product of the vectors, and the result is a p-order tensor. is the feature vector output by the target model layer of the target domain network, whose dimension is L, is the outer product of the vectors. Similarly, the result is a p-order tensor.

[0157] See also Figure 4 The example shown in the figure above is the first feature vector output by the fully connected layer before the output layer during the supervised training process. And the second eigenvector output by the fully connected layer before the output layer during unsupervised training in the figure below Performing a high-order moment matching process; and determining a third loss based on a result of the high-order moment matching process.

[0158] 205. Optimize the self-learning model according to the first loss, the second loss and the third loss.

[0159] Specifically, the total loss loss is calculated according to the first loss, the second loss and the third loss; for example, the total loss loss is calculated using the following calculation formula:

[0160] loss=losss +loss t +loss m

[0161] When the total loss satisfies the convergence condition, the self-learning model completes the training;

[0162] When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

[0163] It should be added here that: for the process of how to optimize the parameters in the self-learning model according to the loss, reference can be made to the relevant contents of the prior art, and this embodiment does not make any specific limitation on this.

[0164] It should be added here that: the technical solutions provided by the embodiments of the present application not only integrate the losses corresponding to supervised training and unsupervised training, but also integrate the losses determined based on the output data output by the target model layer in supervised training and unsupervised training respectively; then the parameters in the model are optimized according to this loss. Since the losses determined based on the output data output by the target model layer in supervised training and unsupervised training are taken into account in the optimization process, it is very helpful to minimize the difference between domains, and thus it helps to overcome the problem of poor training effect caused by the different probability distributions of the source domain (such as labeled sample set) and the target domain (such as unlabeled sample set), improve the domain adaptive learning effect of the model, and make the model have better performance. Taking the self-learning model as a neural network model as an example, the neural network model contains multiple layers. In the specific implementation, the losses corresponding to supervised training and unsupervised training, as well as the losses determined based on the output data output by the target model layer in supervised training and unsupervised training respectively, can be used to optimize the parameters in the neural network model. Among them, the target model layer can be any layer of the multiple layers contained in the neural network model, for example, any layer between the input layer and the output layer, or a layer before the input layer.

[0165] Figure 5 and Figure 6 FIG. 2 is a flow chart of a data processing method provided by another embodiment of the present application. Figure 5 and Figure 6 As shown, the method includes:

[0166] 301. Obtain the object to be classified.

[0167] 302. Use the object to be classified as an input parameter of a self-learning model, and execute the self-learning model to obtain classification information to which the object to be classified belongs.

[0168] The self-learning model is trained using an unsupervised domain adaptive algorithm; the unsupervised domain adaptive algorithm training process, such as Figure 1and Figure 2 As shown, it includes: based on a first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process are obtained; a third loss is determined based on the first output data and the second output data; and the self-learning model is optimized based on the first loss, the second loss and the third loss.

[0169] It should be added here that: the unsupervised domain adaptation algorithm training process mentioned in this embodiment may include all the steps included in the above-mentioned data processing method embodiments. The specific content can be found in the above content and will not be repeated here.

[0170] In the above 301, the object to be classified may be an image, a video, an audio data, etc.

[0171] Furthermore, the self-learning model includes at least one model layer and an output layer connected to one of the at least one model layer; the target model layer is a model layer connected to the output layer.

[0172] Furthermore, in this embodiment, “determining a third loss according to the first output data and the second output data” includes:

[0173] Performing high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements;

[0174] determining the third loss according to the first P-order moment and the second P-order moment;

[0175] Wherein, P is a value greater than or equal to 3.

[0176] Furthermore, “determining the third loss according to the first P-order moment and the second P-order moment” is specifically:

[0177] determining a difference between the first P-order moment and the second P-order moment;

[0178] Based on the difference, the third loss is determined.

[0179] Furthermore, in this embodiment, “optimizing the self-learning model based on the first loss, the second loss, and the third loss” may include the following steps:

[0180] Calculating a total loss based on the first loss, the second loss, and the third loss;

[0181] When the total loss satisfies the convergence condition, the self-learning model completes the training;

[0182] When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

[0183] Furthermore, in this embodiment, “based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss” may include the following steps:

[0184] The unlabeled second image sample is used as an input parameter of the self-learning model, and the self-learning model is executed to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model;

[0185] The second loss is determined according to a data item corresponding to the output of each neuron in the multiple neurons.

[0186] It should be noted here that the unsupervised domain adaptation algorithm training process in the method provided in this embodiment is the same as the above Figure 1 to Figure 4 For the embodiments shown, the contents not mentioned in this embodiment can be referred to the corresponding contents in the above text, and this embodiment will not be repeated. In addition, the execution subject of the technical solution provided in this embodiment can be a server device deployed on the server side, such as a server, a cloud or a virtual server, etc. The data processing method provided in each embodiment of this application can be applied to a variety of application scenarios, such as Figure 7 The scene recognition scene shown in Figure 8a The image recommendation or search scene shown, etc.

[0187] like Figure 7 A specific application scenario shown in the figure provides a device system. The device system includes a camera 11, a server 12 and a client 13. Among them, the camera 11 can be set up in, for example: public office places, public activity places, etc. The server 12 is connected to the camera 11 for communication, and the server 12 is connected to the client 13 for communication (such as wifi, 4G or 5G network, etc.). The camera 11 is used to capture images and send the captured images to the server 12. When the server 12 receives a request from the client 13 to classify the image captured by the camera 11, it uses the image sent by the camera 11 as the input of the self-learning model, and executes the self-learning model to obtain the classification information corresponding to the image. Figure 4In the example shown, the result of image classification of the image captured by the camera is scene classification information (i.e., conference room). The server 12 feeds back the classification information of the image to the client so that the user can learn the classification result through the client. In addition, the self-learning model applied by the server here can be trained by the unsupervised domain adaptation algorithm provided in the above embodiment.

[0188] Of course, the client device may also be configured with a trained self-learning model. Similarly, the self-learning model on the client side may be sent to the client after the server has trained the unsupervised domain adaptive algorithm provided in the above embodiment, or may be obtained by the client locally training the unsupervised domain adaptive algorithm provided in the above embodiment. Figure 8a An image classification scenario is shown. The user can select an image or photo from the album as the image to be classified or trigger the shooting function to use the captured image as the image to be classified through the client. After the user triggers the image recognition function, the client uses the image to be classified as the input parameter of the self-learning model and executes the self-learning model to obtain the classification result. The client displays the classification result on the user interface or outputs it by voice playback so that the user can know the image classification structure.

[0189] Figure 8b Another image classification scenario is shown. The client 2 locally stores a neural network model trained by the method provided by the above method embodiment. The neural network model 10 to be trained obtains a first loss through supervised training; the neural network model 10 to be trained obtains a second loss through unsupervised training; based on the output of a network layer in the supervised training of the neural network model 10 to be trained and the output of the network layer in the unsupervised training, a third loss is obtained; then, according to the first loss, the second loss and the third loss, the parameters of the neural network model 10 are optimized. The neural network model 10 after training is obtained. Figure 8b The user specifies the image 20 to be classified in the client, and the client 2 can use the neural network model 1 to obtain the classification result, such as Figure 8a For the image shown, the classification results include: study, desk, bookcase, computer, etc.

[0190] Fig. 9 An image search scenario is shown. Specifically, Fig. 9As shown, the user can upload the image to be searched through the client. The client directly sends the image to be searched to the server, and the server uses the image to be searched as the input parameter of the self-learning model, executes the self-learning model to obtain the classification result, and then performs a search operation based on the classification result to search for matching information, and feeds back the search results to the client. Among them, the searched information may include images, web pages, etc. related to the classification result, which is not specifically limited in this embodiment. Alternatively, a trained self-learning model is deployed on the client side, and the client uses the image to be searched as the input parameter of the self-learning model, executes the self-learning model to obtain the classification result; and then sends the classification result to the server, so that the server performs a search operation based on the classification result to search for matching information, and feeds back the search results to the client.

[0191] Fig.10 FIG. 1 shows a schematic diagram of the principle of a self-learning system provided by an embodiment of the present application. Fig.10 As shown, the self-learning system includes:

[0192] At least one model layer 21, used to perform data processing on an input first labeled image sample to obtain a first processing result; and perform data processing on an input second unlabeled image sample to obtain a second processing result;

[0193] an output layer 22, connected to a model layer 21 of the at least one model layer 21, and configured to output a first output result based on the first processing result; and output a second output result based on the second processing result;

[0194] The optimization module 23 is used to determine a first loss according to the first output result and the label of the first image sample; determine a second loss according to the second output result; and obtain a third processing result output by the target model layer during data processing of the first image sample and a fourth processing result output by the target model layer during data processing of the second image sample; determine a third loss according to the third processing result and the fourth processing result; and optimize at least part of the layers in the at least one model layer based on the first loss, the second loss and the third loss;

[0195] Wherein, the at least one model layer contains the target model layer.

[0196] In a feasible technical solution, the target model layer is a layer connected to the output layer.

[0197] Furthermore, the at least one model layer is at least one neural network layer in a deep convolutional neural network model.

[0198] Furthermore, the optimization module 23 in this embodiment may include:

[0199] The optimization unit is used to determine a first loss according to the first output result and the label of the first image sample; determine a second loss according to the second output result; and obtain a third processing result output by the target model layer during data processing of the first image sample and a fourth processing result output by the target model layer during data processing of the second image sample; determine a third loss according to the third processing result and the fourth processing result;

[0200] An optimization mode switching switch, used to monitor an optimization mode switching event, and send a corresponding switching instruction to the optimization unit according to the optimization mode switching event;

[0201] The optimization unit is also used for optimizing the self-learning model based on the first loss, the second loss and the third loss when the switching instruction points to the first optimization mode; optimizing the self-learning model according to the first loss and the third loss when the switching instruction points to the second optimization mode; optimizing the self-learning model according to the second loss and the third loss when the switching instruction points to the third optimization mode; optimizing the self-learning model according to the first loss and the second loss when the switching instruction points to the fourth optimization mode.

[0202] It should be noted here that the optimization module described in this embodiment can implement the technical solutions described in the above-mentioned method embodiments. The specific implementation principles can be found in the corresponding contents in the above-mentioned method embodiments, which will not be repeated here.

[0203] Fig.11 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present application. Fig.11 As shown, the data processing device includes:

[0204] A first training module 31 is used to perform supervised training on the self-learning model based on a first labeled image sample to obtain a first loss;

[0205] A second training module 32, configured to perform unsupervised training on the self-learning model based on a second unlabeled image sample to obtain a second loss;

[0206] An acquisition module 33 is used to acquire the first output data corresponding to the target model layer of the self-learning model in the supervised training process and the second output data corresponding to the target model layer in the unsupervised training process;

[0207] A determination module 34, configured to determine a third loss according to the first output data and the second output data;

[0208] The optimization module 35 is used to optimize the self-learning model based on the first loss, the second loss and the third loss.

[0209] The technical solution provided in this embodiment, in addition to integrating the losses corresponding to supervised training and unsupervised training in the optimization process, also integrates the losses determined based on the output data output by the target model layer in supervised training and unsupervised training, respectively. This helps to overcome the problem of poor learning effect caused by the different probability distributions of the source domain (such as labeled sample sets) and the target domain (such as unlabeled sample sets), improve the domain adaptive learning effect of the self-learning model, and make the self-learning model have better performance.

[0210] Furthermore, the self-learning model includes at least one model layer and an output layer connected to one of the at least one model layer; the target model layer is a model layer connected to the output layer.

[0211] Furthermore, the determining module 34 is also used for:

[0212] Performing high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements;

[0213] determining the third loss according to the first P-order moment and the second P-order moment;

[0214] Wherein, P is a value greater than or equal to 3.

[0215] Further, the first output data is a first feature vector with a dimension of L, and the second output data is a second feature vector with a dimension of L; wherein the dimension L is the number of neurons in the target model layer. Accordingly, the determination module 34 is also used for:

[0216] Vector outer product calculation is performed on the first eigenvector and the second eigenvector respectively to obtain the first P-th order moment and the second P-th order moment.

[0217] Furthermore, the determination module 34 is further configured to: determine a difference between the first P-order moment and the second P-order moment; and determine the third loss according to the difference.

[0218] Furthermore, the optimization module is also used for:

[0219] Calculating a total loss based on the first loss, the second loss, and the third loss;

[0220] When the total loss satisfies the convergence condition, the self-learning model completes the training;

[0221] When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

[0222] Furthermore, the second training module is also used for:

[0223] The unlabeled second image sample is used as an input parameter of the self-learning model, and the self-learning model is executed to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model;

[0224] The second loss is determined according to a data item corresponding to the output of each neuron in the multiple neurons.

[0225] Furthermore, the number of neurons contained in the output layer of the self-learning model is the number of categories.

[0226] Furthermore, the data processing device provided in this embodiment may also include:

[0227] A trigger module is used to respond to a first optimization method trigger event, triggering the optimization module to optimize the self-learning model based on the first loss, the second loss and the third loss.

[0228] Furthermore, the trigger module also has at least one of the following functions:

[0229] In response to a second optimization mode triggering event, optimizing the self-learning model according to the first loss and the third loss;

[0230] In response to a third optimization mode triggering event, optimizing the self-learning model according to the second loss and the third loss;

[0231] In response to a fourth optimization method triggering event, the self-learning model is optimized according to the first loss and the second loss.

[0232] It should be noted here that: the data processing device provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above method embodiments, which will not be repeated here.

[0233] Fig.12 FIG. 2 shows a schematic diagram of the structure of a data processing device provided by another embodiment of the present application. Fig.12 As shown, the data processing device includes:

[0234] An acquisition module 41 is used to acquire an object to be classified;

[0235] An execution module 42, configured to use the object to be classified as an input parameter of a self-learning model, and execute the self-learning model to obtain classification information to which the object to be classified belongs;

[0236] Among them, the self-learning model is trained using an unsupervised domain adaptive algorithm. The unsupervised domain adaptive algorithm training process can be implemented by a training module 43. That is, the training module 43 includes: a first training unit, which is used to perform supervised training on the self-learning model based on a labeled first image sample to obtain a first loss; a second training unit is used to perform unsupervised training on the self-learning model based on an unlabeled second image sample to obtain a second loss; an acquisition unit is used to obtain the first output data corresponding to the target model layer of the self-learning model during the supervised training process and the second output data corresponding to the target model layer during the unsupervised training process; a determination unit is used to determine a third loss based on the first output data and the second output data; an optimization unit is used to optimize the self-learning model based on the first loss, the second loss and the third loss.

[0237] Furthermore, the self-learning model includes at least one model layer and an output layer connected to one of the at least one model layer; the target model layer is a model layer connected to the output layer.

[0238] Furthermore, the above-mentioned determination unit is also used for:

[0239] Performing high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements;

[0240] determining the third loss according to the first P-order moment and the second P-order moment;

[0241] Wherein, P is a value greater than or equal to 3.

[0242] Furthermore, the determining unit is further used to: determine a difference between the first P-order moment and the second P-order moment; and determine the third loss according to the difference.

[0243] Furthermore, the optimization unit is also used for:

[0244] Calculating a total loss based on the first loss, the second loss, and the third loss;

[0245] When the total loss satisfies the convergence condition, the self-learning model completes the training;

[0246] When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

[0247] Furthermore, the second training unit is also used for:

[0248] The unlabeled second image sample is used as an input parameter of the self-learning model, and the self-learning model is executed to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model;

[0249] The second loss is determined according to a data item corresponding to the output of each neuron in the multiple neurons.

[0250] It should be noted here that: the multi-data processing device provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents of the above method embodiments, which will not be repeated here.

[0251] Fig.13 FIG. 1 shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.13 As shown, the electronic device includes a memory 51 and a processor 52. The memory 51 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 51 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

[0252] The processor 52 is coupled to the memory 51 and is configured to execute the program stored in the memory 51 to:

[0253] Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss;

[0254] Based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss;

[0255] Obtaining first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process;

[0256] determining a third loss according to the first output data and the second output data;

[0257] The self-learning model is optimized based on the first loss, the second loss and the third loss.

[0258] In particular, when the processor 52 executes the program in the memory 51, in addition to the above functions, other functions may also be implemented, and details may refer to the description of the previous embodiments.

[0259] Further, if Fig.13 As shown, the electronic device also includes: a communication component 53, a display 54, a power component 55, an audio component 56 and other components. Fig.13 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.13 Components shown.

[0260] Another embodiment of the present application provides an electronic device. The structure of the electronic device is similar to the above Fig.13 Specifically, the electronic device includes: a memory and a processor, wherein:

[0261] The memory is used to store programs;

[0262] The processor is coupled to the memory and is configured to execute the program stored in the memory to:

[0263] Get the object to be classified;

[0264] Taking the object to be classified as an input parameter of a self-learning model, executing the self-learning model to obtain classification information to which the object to be classified belongs;

[0265] Among them, the self-learning model is trained using an unsupervised domain adaptive algorithm; the training process using the unsupervised domain adaptive algorithm includes: based on a labeled first image sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; the first output data corresponding to the target model layer of the self-learning model during the supervised training process and the second output data corresponding to the target model layer during the unsupervised training process are obtained; the third loss is determined based on the first output data and the second output data; and the self-learning model is optimized based on the first loss, the second loss and the third loss.

[0266] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, it can implement the data processing method steps or functions provided in the above embodiments.

[0267] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0268] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

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

Claims

1. A data processing method, characterized in that: include: Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss; Based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss; Obtaining first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process; determining a third loss according to the first output data and the second output data; Based on the first loss, the second loss and the third loss, optimizing the self-learning model; Wherein, the self-learning model is used to process images; Based on the unlabeled second image sample, the self-learning model is unsupervisedly trained to obtain a second loss, including: The unlabeled second image sample is used as an input parameter of the self-learning model, and the self-learning model is executed to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model; The second loss is determined according to a data item corresponding to the output of each neuron in the multiple neurons.

2. The method according to claim 1, characterized in that The self-learning model comprises at least one model layer and an output layer connected to one of the at least one model layer; The target model layer is a model layer connected to the output layer.

3. The method according to claim 1 or 2, characterized in that: Determining a third loss according to the first output data and the second output data includes: Performing high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements; determining the third loss according to the first P-order moment and the second P-order moment; Wherein, P is a value greater than or equal to 3.

4. The method according to claim 3, characterized in that The first output data is a first feature vector with a dimension of L, and the second output data is a second feature vector with a dimension of L; wherein the dimension L is the number of neurons in the target model layer; and The first output data and the second output data are subjected to high-order moment matching processing to obtain a first P-order moment and a second P-order moment that meet the matching requirements, including: Vector outer product calculation is performed on the first eigenvector and the second eigenvector respectively to obtain the first P-th order moment and the second P-th order moment.

5. The method according to claim 3, characterized in that: Determining the third loss according to the first P-order moment and the second P-order moment includes: determining a difference between the first P-order moment and the second P-order moment; Based on the difference, the third loss is determined.

6. The method according to claim 1 or 2, characterized in that: Based on the first loss, the second loss, and the third loss, optimizing the self-learning model includes: Calculating a total loss based on the first loss, the second loss, and the third loss; When the total loss satisfies the convergence condition, the self-learning model completes the training; When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

7. The method according to claim 6, characterized in that Calculating a total loss based on the first loss, the second loss, and the third loss includes: The sum of the first loss, the second loss and the third loss is taken as the total loss; or taking the weighted sum of the first loss, the second loss and the third loss as the total loss; or Using the first loss, the second loss, and the third loss as input parameters of a first loss calculation model, executing the first loss calculation model to obtain the total loss; or Use two of the first loss, the second loss and the third loss as input parameters of a second loss calculation model to execute the second loss calculation model to obtain a first value; use the remaining one of the first loss, the second loss and the third loss and the first value as input parameters of a third loss calculation model to execute the third loss calculation model to obtain the total loss.

8. The method according to claim 1 or 2, characterized in that: The number of neurons contained in the output layer of the self-learning model is the number of categories.

9. The method according to claim 1, characterized in that: Also includes: In response to a first optimization method triggering event, a step of optimizing the self-learning model based on the first loss, the second loss and the third loss is triggered.

10. The method according to claim 9, characterized in that Also includes at least one of the following: In response to a second optimization mode triggering event, optimizing the self-learning model according to the first loss and the third loss; In response to a third optimization mode triggering event, optimizing the self-learning model according to the second loss and the third loss; In response to a fourth optimization method triggering event, the self-learning model is optimized according to the first loss and the second loss.

11. A data processing method, characterized in that: include: Get the object to be classified; Taking the object to be classified as an input parameter of a self-learning model, executing the self-learning model to obtain classification information to which the object to be classified belongs; The self-learning model is trained using an unsupervised domain adaptive algorithm; the unsupervised domain adaptive algorithm training process includes: based on a labeled first sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; the first output data corresponding to the target model layer of the self-learning model in the supervised training process and the second output data corresponding to the target model layer in the unsupervised training process are obtained; the third loss is determined based on the first output data and the second output data; the self-learning model is optimized based on the first loss, the second loss and the third loss; Based on the unlabeled second image sample, the self-learning model is unsupervisedly trained to obtain the second loss, including: taking the unlabeled second image sample as the input parameter of the self-learning model, executing the self-learning model to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model; and determining the second loss according to the data items corresponding to the output of each neuron in the multiple neurons.

12. The method according to claim 11, characterized in that The self-learning model comprises at least one model layer and an output layer connected to one of the at least one model layer; The target model layer is a model layer connected to the output layer.

13. The method according to claim 11 or 12, characterized in that: Determining a third loss according to the first output data and the second output data includes: Performing high-order moment matching processing on the first output data and the second output data to obtain a first P-order moment and a second P-order moment that meet matching requirements; determining the third loss according to the first P-order moment and the second P-order moment; Wherein, P is a value greater than or equal to 3.

14. The method according to claim 13, characterized in that Determining the third loss according to the first P-order moment and the second P-order moment includes: determining a difference between the first P-order moment and the second P-order moment; Based on the difference, the third loss is determined.

15. The method according to claim 11 or 12, characterized in that: Based on the first loss, the second loss, and the third loss, optimizing the self-learning model includes: Calculating a total loss based on the first loss, the second loss, and the third loss; When the total loss satisfies the convergence condition, the self-learning model completes the training; When the total loss does not satisfy the convergence condition, the parameters in the self-learning model are optimized according to the total loss.

16. A self-learning system, characterized in that: include: At least one model layer, used to perform data processing on the input first labeled image sample to obtain a first processing result; Performing data processing on the input unlabeled second image sample to obtain a second processing result; an output layer, connected to a model layer of the at least one model layer, and configured to output a first output result based on the first processing result; outputting a second output result based on the second processing result; an optimization module, configured to determine a first loss according to the first output result and the label of the first image sample; determining a second loss according to the second output result; Also used to obtain a third processing result output by the target model layer during data processing of the first image sample and a fourth processing result output by the target model layer during data processing of the second image sample; Determine a third loss according to the third processing result and the fourth processing result; optimize at least part of the layers in the at least one model layer based on the first loss, the second loss and the third loss; Among them, the at least one model layer contains the target model layer; the second output result includes: the data item corresponding to the output of each neuron in the multiple neurons contained in the output layer; when the optimization module determines the second loss according to the second output result, it is used to determine the second loss according to the data item corresponding to the output of each neuron in the multiple neurons.

17. The system according to claim 16, characterized in that The target model layer is a layer connected to the output layer.

18. The system according to claim 16 or 17, characterized in that The at least one model layer is at least one neural network layer in a deep convolutional neural network model.

19. The system according to claim 16, characterized in that The optimization module comprises: The optimization unit is used to determine a first loss according to the first output result and the label of the first image sample; determine a second loss according to the second output result; and obtain a third processing result output by the target model layer during data processing of the first image sample and a fourth processing result output by the target model layer during data processing of the second image sample; determine a third loss according to the third processing result and the fourth processing result; An optimization mode switching switch, used to monitor an optimization mode switching event, and send a corresponding switching instruction to the optimization unit according to the optimization mode switching event; The optimization unit is also used for optimizing the self-learning model based on the first loss, the second loss and the third loss when the switching instruction points to the first optimization mode; optimizing the self-learning model according to the first loss and the third loss when the switching instruction points to the second optimization mode; optimizing the self-learning model according to the second loss and the third loss when the switching instruction points to the third optimization mode; optimizing the self-learning model according to the first loss and the second loss when the switching instruction points to the fourth optimization mode.

20. An electronic device, characterized in that: include: A memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to: Based on the first labeled image sample, supervised training is performed on the self-learning model to obtain a first loss; Based on the unlabeled second image sample, performing unsupervised training on the self-learning model to obtain a second loss; Obtaining first output data corresponding to the target model layer of the self-learning model during the supervised training process and second output data corresponding to the target model layer during the unsupervised training process; determining a third loss according to the first output data and the second output data; Based on the first loss, the second loss and the third loss, optimizing the self-learning model; The self-learning model is unsupervisedly trained based on the unlabeled second image sample to obtain the second loss, including: The unlabeled second image sample is used as an input parameter of the self-learning model, and the self-learning model is executed to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model; The second loss is determined according to a data item corresponding to the output of each neuron in the multiple neurons.

21. An electronic device, characterized in that: include: A memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to: Get the object to be classified; Taking the object to be classified as an input parameter of a self-learning model, executing the self-learning model to obtain classification information to which the object to be classified belongs; The self-learning model is trained using an unsupervised domain adaptive algorithm; the training process using the unsupervised domain adaptive algorithm includes: based on a labeled first image sample, supervised training is performed on the self-learning model to obtain a first loss; based on an unlabeled second image sample, unsupervised training is performed on the self-learning model to obtain a second loss; the first output data corresponding to the target model layer of the self-learning model in the supervised training process and the second output data corresponding to the target model layer in the unsupervised training process are obtained; the third loss is determined based on the first output data and the second output data; the self-learning model is optimized based on the first loss, the second loss and the third loss; Based on the unlabeled second image sample, the self-learning model is unsupervisedly trained to obtain the second loss, including: taking the unlabeled second image sample as the input parameter of the self-learning model, executing the self-learning model to obtain third output data; wherein the third output data includes: data items corresponding to the output of each neuron in the output layer of the self-learning model; and determining the second loss according to the data items corresponding to the output of each neuron in the multiple neurons.