CN111582502B - Sample migration learning method and device - Google Patents

Sample migration learning method and device Download PDF

Info

Publication number
CN111582502B
CN111582502B CN202010397008.1A CN202010397008A CN111582502B CN 111582502 B CN111582502 B CN 111582502B CN 202010397008 A CN202010397008 A CN 202010397008A CN 111582502 B CN111582502 B CN 111582502B
Authority
CN
China
Prior art keywords
sample
prediction
probability
field
prediction model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010397008.1A
Other languages
Chinese (zh)
Other versions
CN111582502A (en
Inventor
林熙东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202010397008.1A priority Critical patent/CN111582502B/en
Publication of CN111582502A publication Critical patent/CN111582502A/en
Application granted granted Critical
Publication of CN111582502B publication Critical patent/CN111582502B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a sample migration learning method and device, and in the sample migration process, the scheme of the application combines a prediction model of a source field and a prediction result of a prediction model of a target field on a sample, and fully considers the influence of the sample of the source field on the prediction accuracy of the prediction model of the target field; meanwhile, in the sample migration iteration process, the prediction models of the source field and the target field are continuously optimized based on intermediate state sample sets of the source field and the target field obtained through migration, so that the performance of the prediction model in each iteration is not inferior to that of the prediction model in the previous iteration, and the sample set of the target field obtained through final migration is more beneficial to improving the performance of the prediction task of the target field.

Description

Sample migration learning method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a sample migration learning method and apparatus.
Background
Transfer learning (transfer learning) is popular in that existing knowledge is used to learn new knowledge, and the core is to find the similarity between the existing knowledge and the new knowledge. In the migration learning, we have knowledge called a source domain (source domain), and a new knowledge to be learned called a target domain (target domain), where the source domain and the target domain are different but have a certain association. The relevance of the source domain and the target domain is needed to be found and utilized for carrying out knowledge migration, so that data calibration is realized.
The objective of sample migration learning is to find samples from a sample set in a source domain, where the samples can improve performance of a prediction task (such as a classification prediction task or a regression prediction task) in a target domain. For example, after a sample capable of improving the classification task of the target field is found from the sample set of the source field through sample migration learning and added to the sample set of the target field, a classification model trained based on the sample set of the target field obtained through migration has better classification performance than a classification model trained by using the sample set of the original target field. However, the sample set in the target field cannot be reliably determined based on the current sample transfer learning method, so that performance of a target field prediction task cannot be effectively improved.
Disclosure of Invention
In view of this, the present application provides a sample migration learning method and apparatus, so as to more effectively and reliably determine a sample set of a target field, so that the finally determined sample set of the target field can more effectively improve the performance of a target field prediction task.
In order to achieve the above purpose, the present application provides the following technical solutions:
in one aspect, the present application provides a sample transfer learning method, including:
Obtaining a first original sample set of a source field and a second original sample set of a target field, wherein the first original sample set and the second original sample set respectively comprise a plurality of samples marked with actual task results;
obtaining a first prediction model of the source field and a second prediction model of the target field, wherein the first prediction model is a prediction model of the source field obtained by training based on the first original sample set, and the second prediction model is a prediction model of the target field obtained by training based on the second original sample set;
performing a migration operation for each sample in the first and second original sample sets: determining a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample, determining a target field to which the sample is suitable for attribution from the source field and the target field by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and classifying the sample into an intermediate state sample set of the target field to obtain an intermediate state sample set of the source field and an intermediate state sample set of the target field;
For each sample in a first original sample set and a second original sample, if the prediction results of the first prediction model and the second prediction model on the samples are incorrect according to the actual task results, the first prediction results and the second prediction results of the samples, adding one to the circulation control variable;
and if the circulation control variable does not reach the convergence state, training based on the intermediate state sample set of the source field to obtain a first prediction model of the source field, training a second prediction model of the target field by utilizing the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to execute the migration operation for each sample in the first original sample set and the second original sample set based on the first prediction model and the second prediction model obtained by the last training until the circulation control variable reaches the convergence state.
Preferably, the determining, by combining the actual task result, the first prediction result, and the second prediction result corresponding to the sample, a destination domain to which the sample is suitable for attribution from the source domain and the destination domain includes:
Combining an actual task result, the first prediction result and the second prediction result which correspond to the sample, and determining a first probability that the sample belongs to a source field and a second probability that the sample belongs to a target field;
and determining the destination domain to which the sample is suitable from the source domain and the destination domain according to the first probability and the second probability.
Preferably, the determining, according to the first probability and the second probability, a destination domain to which the sample is suitable for attribution from the source domain and the destination domain includes:
dividing a set numerical range into a first numerical range and a second numerical range based on the first probability and the second probability, wherein the first numerical range and the second numerical range are not overlapped, and the proportion of data belonging to the first numerical range in the set numerical range is the first probability and the proportion of data belonging to the second numerical range is the second probability;
generating a random number, wherein the random number belongs to the set numerical value range;
if the random number belongs to the first numerical range, confirming that the sample is suitable for belonging to the source field;
and if the random number belongs to the second numerical range, confirming that the sample is suitable for belonging to the target field.
Preferably, the actual task result corresponding to the sample is an actual classification result corresponding to the sample;
the first prediction model and the second prediction model are both classification models;
combining the actual task result, the first prediction result and the second prediction result corresponding to the sample, determining a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain, including:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
if the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is 1 and the second probability that the sample belongs to the target field is 0;
if the first prediction result is determined to be incorrect and the second prediction result is determined to be correct by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source field is determined to be 0, and the second probability that the sample belongs to the target field is determined to be 1.
Preferably, the first prediction model and the second prediction model are both regression models;
combining the actual task result, the first prediction result and the second prediction result corresponding to the sample to determine a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain, including:
combining the actual task result corresponding to the sample with the first prediction result to determine a first prediction error of the first prediction model;
combining the actual task result corresponding to the sample with the second prediction result to determine a second prediction error of the second prediction model;
and determining a first probability that the sample belongs to the source field and a second probability that the sample belongs to the target field according to the first prediction error and the second prediction error.
Preferably, the classifying the samples into an intermediate state sample set in the destination area includes:
if the sample belongs to a first original sample set of the source field, classifying the sample into an intermediate state sample set of the destination field;
and if the sample belongs to a second original sample set of the target field and the target field is the target field, classifying the sample into an intermediate sample set of the target field.
Preferably, the classifying the samples into an intermediate state sample set in the destination area includes:
if the sample belongs to a second original sample set of the target field, classifying the sample into an intermediate state sample set of the target field;
if the sample belongs to a first original sample set of the source domain and the destination domain is a source domain, classifying the sample into an intermediate sample set of the source domain.
In still another aspect, the present application further provides a sample transfer learning apparatus, including:
the sample obtaining unit is used for obtaining a first original sample set of the source field and a second original sample set of the target field, wherein the first original sample set and the second original sample set respectively comprise a plurality of samples marked with actual task results;
the model obtaining unit is used for obtaining a first prediction model of the source field and a second prediction model of the target field, wherein the first prediction model is a prediction model of the source field obtained by training based on the first original sample set, and the second prediction model is a prediction model of the target field obtained by training based on the second original sample set;
the migration operation unit is used for determining a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample aiming at each sample in a first original sample set and a second original sample set, determining a target field to which the sample is suitable for attribution from the source field and the target field by combining an actual task result corresponding to the sample, the first prediction result and the second prediction result, classifying the sample into an intermediate sample set of the target field, and obtaining an intermediate sample set of the source field and an intermediate sample set of the target field;
The variable adjustment unit is used for adding one to the circulation control variable for each sample in the first original sample set and the second original sample if the prediction results of the first prediction model and the second prediction model on the samples are determined to be incorrect according to the actual task results, the first prediction results and the second prediction results of the samples;
and the circulation control unit is used for training the intermediate state sample set of the source field to obtain a first prediction model of the source field if the circulation control variable does not reach the convergence state, training the second prediction model of the target field by utilizing the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to execute the operation of the migration operation unit according to the first prediction model and the second prediction model obtained by the last training for each sample in the first original sample set and the second original sample set until the circulation control variable reaches the convergence state.
Preferably, when executing the actual task result, the first prediction result, and the second prediction result corresponding to the combined sample, the migration operation unit determines, from the source domain and the target domain, that the sample is suitable for the target domain to which the sample belongs, specifically:
Combining an actual task result, the first prediction result and the second prediction result which correspond to the sample, and determining a first probability that the sample belongs to a source field and a second probability that the sample belongs to a target field;
and determining the destination domain to which the sample is suitable from the source domain and the destination domain according to the first probability and the second probability.
Preferably, the actual task result corresponding to the sample obtained in the sample obtaining unit is an actual classification result corresponding to the sample;
the first prediction model and the second prediction model obtained by the model obtaining unit and the circulation control unit are both classification models;
the migration operation unit determines a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and specifically comprises:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
If the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is 1 and the second probability that the sample belongs to the target field is 0;
if the first prediction result is determined to be incorrect and the second prediction result is determined to be correct by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source field is determined to be 0, and the second probability that the sample belongs to the target field is determined to be 1.
According to the technical scheme, in the sample migration process, the prediction results of the source field prediction model and the target field prediction model on the sample are combined, so that the influence of the source field sample on the prediction accuracy of the target field prediction model is fully considered; meanwhile, in the sample migration iteration process, the prediction models of the source field and the target field are continuously optimized based on intermediate state sample sets of the source field and the target field obtained through migration, so that the performance of the prediction model in each iteration is not inferior to that of the prediction model in the previous iteration, and the sample set of the target field obtained through final migration is more beneficial to improving the performance of the prediction task of the target field.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of one embodiment of a sample transfer learning method of the present application;
FIG. 2 is a schematic flow chart of another embodiment of a sample transfer learning method according to the present application;
fig. 3 shows a schematic flow chart of a sample transfer learning method in an application scenario;
fig. 4 is a schematic diagram showing the constitution of an embodiment of a sample transfer learning device of the present application.
Detailed Description
The method and the device are suitable for sample migration based on the prediction task, such as sample migration of a classification task or sample migration based on a regression task, and sample migration can be achieved more reliably and effectively through the method and the device, so that the performance of the prediction task in the target field can be improved more effectively through a sample set based on the target field.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Fig. 1 is a schematic flow chart of an embodiment of a sample transfer learning method of the present application, where the method of the present embodiment is applied to any computer device with data processing capability, including, but not limited to, servers, personal computers, portable computers, smartphones, and other mobile computing devices, and the scheme of the present application may also be applied to cloud platforms and the like. The method of the embodiment can comprise the following steps:
s101, a first original sample set of a source domain and a second original sample set of a target domain are obtained.
It is understood that the migration learning of the sample refers to finding sample data similar to the target field from the source field, or performing sample optimization on the target field based on the source field.
For convenience of distinction, the original sample set in the source domain is referred to as a first original sample set before the transfer learning, and the original sample set in the target domain is referred to as a second original sample set. The first original sample set comprises a plurality of samples marked with actual task results, and correspondingly, the second original sample set also comprises a plurality of samples marked with actual task results.
For example, assuming that the original sample set in the source field is clothing information of different women in the area a, a classifier capable of effectively judging whether the women in the area a wear fashionably can be trained based on the original sample set in the source field. If there is a need to analyze whether women in region B wear fashionably, but at present there is less data of the clothing information of women in region B, in which case region B may be taken as the target area and the clothing information of women already in region B may be taken as sample data in the initial sample set in the target area, in which case sample data suitable for region B may be found out from the initial sample set of region a by transfer learning to enrich the sample data of region B, so that finally the sample data of region B may be obtained by transfer learning, and a classifier for judging whether women in region B wear fashionably may be trained.
Of course, the above examples are merely for the convenience of understanding the source domain, the target domain, and the corresponding original sample set, and are described in the context of one case, and are applicable to the present application for other scenarios requiring sample migration learning.
S102, training to obtain a first prediction model of the source field based on the first original sample set.
The type of the first prediction model may also be different according to the prediction task of the transfer learning, for example, in the scenario of sample transfer learning based on the classification task, the first prediction model may be a classification model. As another example, in a sample-transfer learning scenario based on a regression task, the first prediction model may be a regression model.
There are many possibilities for specific implementation of training the first predictive model based on samples in the first original sample set of the source domain, which the present application is not limited to. For example, the neural network model may be trained based on the respective samples in the first set of original samples labeled with the classification results to obtain a classifier for implementing the classification.
And S103, training to obtain a second prediction model of the target field based on the second original sample set.
Similar to step S102, the second prediction model may also be different according to the prediction task of the sample transfer learning, for example, the second prediction model may be a classification model or a regression model.
Accordingly, the present application is not limited to the specific process of training the second predictive model using samples in the second original sample set of the target area as such.
It will be appreciated that the order of steps S102 and S103 may be interchanged or may be performed simultaneously.
In this embodiment, after the first original sample set and the second original sample set are obtained, the first prediction model in the source domain and the second prediction model in the target domain are trained respectively. In practical application, the first prediction model can be trained by using the first original sample set in advance before sample transfer learning, and the second prediction model can be trained by using the second original sample set, so that the first prediction model in the source field and the second prediction model in the target field can be directly obtained on the basis.
S104, for each sample in the first original sample set and the second original sample set, determining a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample.
The method comprises the steps of inputting a sample into a first prediction model of a source field and a second prediction model of a target field respectively for task prediction aiming at any sample in an original sample set of the source field and the target field, wherein for convenience of distinguishing, the prediction result of the first prediction model on the sample is called a first prediction result, and the prediction result of the second prediction model on the sample is called a second prediction result.
In the case of different prediction tasks, the types of the prediction models in the source domain and the target domain are also different, and accordingly, the types of the task results of the first prediction result and the second prediction result are also different. For example, in the case where the first prediction model and the second prediction model are classification models, the first prediction result and the second prediction result are classification results. In another example, in the case where the first prediction model and the second prediction model are regression models, the first prediction result and the second prediction result are predicted regression prediction values.
S105, determining a target field to which the sample is suitable for attribution from a source field and the target field by combining an actual task result corresponding to the sample according to each sample in the first original sample set and the second original sample set, classifying the sample into an intermediate sample set of the target field, and obtaining an intermediate sample set of the source field and an intermediate sample set of the target field.
In the application, the target field and the source field respectively correspond to an intermediate state sample set, wherein the intermediate state sample set of the target field is used for storing samples which are confirmed in the migration learning process and need to belong to the target field; accordingly, the intermediate state sample set of the source domain is used for storing samples which need to be attributed to the source domain in the migration learning process.
Wherein, for each sample, the destination domain is one of a source domain and a target domain. For example, if it is determined that the sample needs to be attributed to the source domain (without concern about whether the sample originally belongs to an initial set of samples for the source domain or the target domain), the sample may be added to an intermediate set of samples for the source domain. Since each sample in the original sample sets of the source domain and the target domain needs to perform this step S105, all samples in the original sample sets of the source domain and the target domain may be finally determined to be an intermediate sample set belonging to the source domain or an intermediate sample set belonging to the target domain, respectively, so that the intermediate sample sets of the source domain and the target domain each include one or more samples.
It can be understood that, for each sample, by comparing the actual task result marked by the sample, the first predicted result predicted by the first prediction model for the sample, and the second predicted result predicted by the second prediction model for the sample, it can be determined whether the predicted results of the source domain prediction model and the target domain prediction model for the sample are accurate and accurate.
Because the first prediction model is a prediction model obtained based on training of a first original sample set in the source domain, if the prediction result of the first prediction model on the sample is correct or the relative accuracy is higher, the data compatibility of the sample and the sample in the source domain is higher, and the sample can be attributed to the source domain. Accordingly, since the second prediction model is trained based on the second original sample set of the target domain, if the second prediction model is correct for the prediction result of the sample or the accuracy of the prediction result is relatively higher, the sample can be attributed to the target domain.
If the first prediction result and the second prediction result are both correct or both incorrect according to the actual task result of the sample, one field can be randomly selected from the source field and the target field to serve as the target field; if the first prediction result is correct and the second prediction result is incorrect, determining that the sample needs to belong to the source field; accordingly, if the first prediction result is incorrect and the second prediction result is correct, it may be determined that the sample belongs to the target area.
Of course, this is merely an example of a manner of determining the destination domain to which the sample needs to belong from the source domain and the target domain, for example, in the case where the first prediction result and the second prediction result are both correct, it may also be determined which of the first prediction result and the second prediction result is higher in relative accuracy by combining the deviation situation of the first prediction result from the actual task result and the deviation situation of the second prediction result from the actual task result, and then, the domain corresponding to the prediction result with higher phase accuracy is determined as the destination domain; the same is true for the case where both the first prediction result and the second prediction result are erroneous. Other possible implementations may be provided in practical applications, and the detailed description will be further provided with reference to another implementation, which is not repeated herein.
It will be appreciated that the above S104 and S105 are actually steps of the migration operations that need to be performed for each sample in the first and second original sample sets.
S106, for each sample in the first original sample set and the second original sample set, if the prediction results of the first prediction model and the second prediction model on the sample are determined to be incorrect according to the actual task result, the first prediction result and the second prediction result of the sample, the circulation control variable is increased by one.
The loop control variable is preset and used for controlling the variable of the transfer learning iteration times. For example, the value of the circulation control variable can be set to zero before the transfer learning, and the circulation control variable can be continuously changed until convergence in the subsequent transfer learning process.
It can be understood that if, for a certain sample in the original sample set of the source domain and the target domain, neither the first prediction model of the source domain nor the second prediction model of the target domain can accurately predict the prediction result of the sample, it is explained that the first prediction model of the source domain and the second prediction model of the target domain are not optimal prediction models, in this case, the obtained intermediate state sample set of the target domain cannot maximally improve the performance of the prediction model of the target domain, that is, it is explained that the migration learning still needs to be continued, so the loop control variable needs to be added by one to indicate that the iterative process of the migration learning has not yet ended through the loop control variable.
It will be appreciated that, for a sample in the initial set of samples in the source domain and the target domain, if it is determined that at least one of the first prediction model and the second prediction model is correct for the prediction result of the sample according to the actual task result, the first prediction result, and the second prediction result of the sample, the operation of step S106 will not be performed for the sample.
And S107, if the circulation control variable does not reach a convergence state, training based on an intermediate state sample set of the source field to obtain a first prediction model of the source field, training a second prediction model of the target field by utilizing the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to the step S104 for each sample in the first original sample set and the second original sample set based on the first prediction model and the second prediction model obtained by the last training until the circulation control variable converges.
The condition that the circulation control variable reaches the convergence state may be that the circulation control variable acquired by the last setting is detected to be unchanged, and of course, the change range may be small or the circulation control variable tends to be stable.
After each sample in the original sample set of the source domain and the target domain is processed in steps S104 to S106 as above, if the loop control variable is not converged, the intermediate sample set of the target domain obtained in the iteration of the transfer learning is not such that the accuracy of the prediction model of the target domain is optimal, and therefore, it is necessary to continue the transfer learning to find the sample set of the target domain that can more optimize the performance of the prediction model of the target domain.
In this case, in order to more effectively migrate out a sample set suitable for the target domain, the present application retrains the first prediction model of the source domain based on the intermediate sample set of the source domain obtained at present; meanwhile, the second prediction model of the target field can be retrained based on the intermediate state sample set of the target field, so that the prediction models of the source field and the target field are continuously optimized in the transfer learning iteration process. On the basis, on the basis of an optimized prediction model, transfer learning is conducted again, so that the effectiveness of a sample set of the transfer learning is improved, and convergence is realized more quickly.
It will be appreciated that, since the samples in the intermediate sample sets of the source domain and the target domain do not belong to the optimization after the previous iteration, the samples in the intermediate sample sets of the source domain and the target domain need to be emptied before the re-migration learning, so that the intermediate sample sets of the two domains are re-determined based on the optimized prediction models of the two domains.
Accordingly, if the loop control variable converges, the sample transfer learning is completed, in which case, the intermediate sample set of the target domain is determined as the sample set of the target domain finally transferred, that is, the transferred sample set capable of improving the target domain prediction task.
From the above, in the sample migration process, the method combines the prediction results of the source field prediction model and the target field prediction model to sample migration, so that the influence of the target field sample on the prediction accuracy of the target field prediction model is fully considered; meanwhile, in the sample migration iteration process, the prediction models of the source field and the target field are continuously optimized based on intermediate state sample sets of the source field and the target field obtained through migration, so that the purpose of each sample migration iteration is to optimize the performance of a prediction task, and the sample set of the target field obtained through final migration is more beneficial to improving the performance of the prediction task of the target field.
In addition, in the transfer learning process, the prediction models of the source field and the target field are optimized after each iteration, and the optimization prediction model is actually used for realizing that the prediction model of the target field has better performance, so that the target of each iteration is converged as soon as possible, the convergence is more quickly achieved, and the transfer learning efficiency is improved.
In addition, in the sample transfer learning process, the types of the prediction models in the source field and the target field are not limited, the applicability is wider, and the complexity of sample transfer learning is reduced.
For ease of understanding, the following description will be made in connection with one case where the destination domain is determined from the source domain and the destination domain in combination with the actual task result, the first prediction result, and the second prediction result of the sample. Fig. 2 is a schematic flow chart of another embodiment of a sample transfer learning method of the present application, where the method of the present embodiment may include:
s201, a first original sample set of a source domain and a second original sample set of a target domain are obtained.
S202, training to obtain a first prediction model of the source field based on the first original sample set.
And S203, training to obtain a second prediction model of the target field based on the second original sample set.
S204, for each of the first and second original sample sets, determining a first prediction result of the first prediction model for the sample and a second prediction result of the second prediction model for the sample, and performing steps S205 to S207.
The above steps S201 to S204 may be referred to the related description of the previous embodiments, and are not repeated here.
S205, combining the actual task result corresponding to the sample, the first prediction result and the second prediction result, and determining the first probability that the sample belongs to the source field and the second probability that the sample belongs to the target field.
For example, the actual task result of the sample labeling, the predicted first predicted result and the predicted second predicted result can be combined, and the probability that the sample belongs to the source field and the target field can be respectively determined according to the relative accuracy degree of the first predicted result and the second predicted result.
Wherein the first probability actually characterizes a probability that the first predictive model considers a sample as belonging to a sample of the source domain and the second probability characterizes a probability that the second predictive model considers a sample as belonging to a sample of the target domain.
It will be appreciated that in practical applications, the manner in which the first probability and the second probability are determined may also differ when the types of prediction tasks in the source domain and the target domain are different, as will be exemplified below.
First, a case of sample transfer learning based on a classification task will be described.
In the scene of the classification task, the actual task result of the sample label is the actual classification result corresponding to the sample. For example, if the user is classified into a credit-protected user and a non-credit-protected user, and the sample is portrait data of the user, the sample may be marked as a credit-protected user or a non-credit-protected user according to the actual situation. In this case, the first predictive model of the source domain may be a classification model, i.e. a classifier, while the second predictive model of the target domain is also a classification model.
Accordingly, in one possible scenario, determining the first probability that the sample belongs to the source domain and the second probability that the sample belongs to the target domain may be:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
if the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is 1 and the second probability that the sample belongs to the target field is 0;
If the first prediction result is determined to be incorrect and the second prediction result is determined to be correct by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source domain is determined to be 0, and the second probability that the sample belongs to the target domain is determined to be 1.
If the first prediction model and the second prediction model are classifiers, and the output result is 0 or 1, wherein 0 indicates that the first prediction model does not belong to a set category, and 1 indicates that the first prediction model belongs to a set category, whether the first prediction result predicted by the first prediction model is correct or not can be determined according to whether the actual category of the sample label is 0 or 1, and accordingly, whether the second prediction result is correct or not can be determined.
For example, still taking the above example that the classifier needs to identify whether the user is a credit-keeping user, if the classifier outputs a result of 1, it means that the sample is identified as a credit-keeping user, whereas if the classifier outputs a result of 0, the sample is identified as a non-credit-keeping user. If the user represented by the sample is actually a credit-keeping user, the actual category of the sample label is the credit-keeping user, and the first prediction result of the first prediction model is correct under the assumption that the prediction result of the first prediction model is 1; if the predicted result of the second prediction model is 0, it is indicated that the second prediction model predicts that the user is an unwarranted user and the actual category corresponding to the sample is not consistent, so that the predicted result of the second prediction model is incorrect.
In this case, if both the first prediction result and the second prediction result are correct, it is explained that the degree of similarity of the sample to the sample in the original sample set of the source domain and the target domain is the same, and the probability that the sample belongs to the source domain and the target domain can be regarded as the same, and therefore, the first probability and the second probability can be set to 0.5, respectively. The same is true for the case where both the first prediction result and the second prediction result are erroneous.
If the first predictor is correct and the second predictor is incorrect, it indicates that the sample is similar to the sample in the original set of samples in the source domain and not similar to the sample in the original set of samples in the target domain, and therefore the sample is not suitable for attributing to the target domain, the second probability of attributing to the target domain may be determined to be 0 and the first probability of attributing to the source domain may be determined to be 1. The situation is similar for the first predictor being incorrect and the second predictor being correct.
Of course, in the above, taking the output result of the first prediction model and the second prediction model as 0 or 1 as an example, for the case that the probability that the first prediction model and the second prediction model output belongs to the set category, it may also be determined whether the predicted samples of the first prediction model and the second prediction model belong to the set category according to the magnitude of the probability values output by the first prediction model and the second prediction model, and the process is similar and will not be repeated here.
In addition, if the first prediction model and the second prediction model are not classifiers, it is only necessary to compare whether the predicted results of the first prediction model and the second prediction model represent whether the category to which the sample belongs is consistent with the actual category marked by the sample, so that whether the predicted results of the first prediction model and the second prediction model are accurate can be determined, and the principles are similar and are not repeated herein.
In yet another possible scenario, if the first prediction model and the second prediction model predict probabilities of belonging to the set category, specifically, the first prediction result predicted by the first prediction model is a first prediction probability that the sample belongs to the set category, and the second prediction result predicted by the second prediction model is a second prediction probability that the sample belongs to the set category. In this case, if the actual task result of the sample is combined with the first prediction probability and the second prediction probability, it is determined that both the first prediction model and the second prediction model are predicted to be correct, then the accuracy degree of the prediction accuracy of the first prediction model and the second prediction model can be respectively analyzed by combining the first prediction probability and the second prediction probability, the first probability is determined according to the accuracy degree corresponding to the first prediction model, and the accuracy degree corresponding to the second prediction model is determined as the second probability.
For example, taking the case that whether the user represented by the sample is a credit-keeping user is still identified, assuming that the probability that the first prediction model predicts that the user represented by the sample belongs to the credit-keeping user is 0.6, the probability that the user represented by the sample belongs to the credit-keeping user is 0.8, and the user category marked by the sample is the credit-keeping user, the two model prediction results can be considered to be correct because the probabilities predicted by the first prediction model and the second prediction model are both greater than 0.5. In this case, the probabilities predicted by the two prediction models may be normalized, and the probability value predicted by the first prediction model is 0.43 after normalization; and the probability value predicted by the second prediction model is 0.57 after normalization. In this case, the first probability can be considered to be 0.43 and the second probability to be 0.57.
Under the condition that the second prediction model and the second prediction model are both wrong in predicted results, the first prediction probability and the second prediction probability are combined to respectively analyze the accuracy degree of the prediction accuracy of the first prediction model and the second prediction model, the first probability is determined according to the accuracy degree corresponding to the first prediction model, the accuracy degree corresponding to the second prediction model is determined as the second probability, and the specific process is similar and is not repeated here.
Of course, the above is described by taking two cases of determining the first probability and the second probability as examples for the classification case, and other possibilities are also possible in practical applications.
The following is an example of a scenario in which the prediction task is a regression task:
in the context of the regression task, the first prediction model and the second prediction model may be regression models, although the specific type of regression model is not limited.
In this case, determining the first probability and the second probability may be: combining an actual task result and a first prediction result which correspond to the sample, and determining a first prediction error of a first prediction model; combining the actual task result and the second prediction result which correspond to the sample, and determining a second prediction error of the second prediction model; then, according to the first prediction error and the second prediction error, determining a first probability that the sample belongs to the source domain and a second probability that the sample belongs to the target domain.
Wherein if the first prediction error is less than the second prediction error, the first probability is greater than the second probability; accordingly, if the first prediction error is greater than the second prediction error, the first probability is less than the second probability.
For example, the regression prediction scene is used for predicting the rainfall of one week, and under the condition that the actual rainfall of one week of a sample label is known, the rainfall of one week predicted by the first prediction model can be compared with the actual rainfall of one week, so that a first prediction error can be obtained; similarly, a second prediction error may also be obtained. If the first prediction error is larger than the second prediction error, it is indicated that the accuracy of the first prediction model for predicting the sample is lower than that of the second prediction model for predicting the sample, and meanwhile, the probability that the sample belongs to the source field is lower than that of the sample belongs to the target field, and correspondingly, the first probability can be set to be lower than the second probability, and specific values of the first probability and the second probability can be set by combining the first prediction error and the second prediction error. S206, determining the target field to which the sample is suitable from the source field and the target field according to the first probability and the second probability, and classifying the sample into an intermediate state sample set of the target field to obtain an intermediate state sample set of the source field and an intermediate state sample set of the target field.
If the first probability is greater than the second probability, the source domain may be determined to be the destination domain; otherwise, the target domain may be determined as the target domain.
Considering that the magnitudes of the first probability and the second probability reflect the prediction accuracy degree of the prediction model of the source domain and the prediction model of the target domain on the sample, if the target domain to which the sample belongs is determined based on the magnitude relation of the first probability and the second probability, the accuracy of sample migration may be lower. For example, assuming that the prediction results of the first prediction model and the second prediction model are both correct, it is stated that the sample may belong to the source domain or the target domain, and the sample also has similarity with the sample in the target domain, and if the first probability corresponding to the source domain is large and the sample is classified as an intermediate sample in the source domain, migration of the sample to the target domain may be unfavorable.
In order to reasonably realize sample migration, as an alternative, the present application may further divide the set numerical range into a first numerical range and a second numerical range based on the first probability and the second probability. The first value range and the second value range do not overlap, and the first value range and the second value range form the whole set value range, so that the values in the set value range are not omitted. The ratio of the data belonging to the first numerical range in the numerical range is set to be a first probability, and the ratio of the data belonging to the second numerical range is set to be a second probability.
For example, the set value range may be [0,1], i.e., a value range including 0 to 1 and from 0 to 1, and accordingly, if the first probability is 0.6 and the second probability is 0.4, the first value range may be set to be from [0,0.6], and the second value range may be (0.6,1 ].
In determining the first range of values and the second range of values, a random number may be generated, the random number being a random number belonging to the set range of values. If the random number belongs to the first numerical range, confirming that the sample is suitable for belonging to the source field; if the random number belongs to the second numerical range, confirming that the sample is suitable for belonging to the target field. By the method, whether the sample is similar to the source field and the target field or not can be considered more effectively, the similarity degree is not only concerned, and the situation that the sample is migrated to the source field and the target field can be set reasonably.
S207, for each sample in the first and second original sample sets, if it is determined that the first and second prediction models are incorrect in terms of the actual task result, the first and second prediction results, then the loop control variable is incremented by one
In particular, for the regression prediction scenario, an error rate threshold may be set, and if the error rates of the prediction results predicted by the first prediction model and the second prediction model for the samples are both higher than the error rate threshold, the first prediction model and the second prediction model may be considered to be incorrect for the sample prediction, thereby adding one to the cycle control variable. The sequence of step 207 is not limited to that shown in fig. 2, and in practical applications, step S207 may be performed after step S204, for example, may be performed simultaneously with steps S205 and S206.
S208, if the circulation control variable is not converged, training based on the intermediate state sample set of the source field to obtain a first prediction model of the source field, training a second prediction model of the target field by using the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to the step S204 for each sample in the first original sample set and the second original sample set based on the first prediction model and the second prediction model obtained by the last training until the circulation control variable is converged.
The above steps S207 and S208 may be referred to the related description of the previous embodiments, and will not be repeated here.
It will be appreciated that the purpose of the sample transfer learning of the present application is to optimize a sample set of a target domain, in which case there are two cases of an original sample set of the target domain:
one is that the samples in the original sample set of the target field are relatively pure but less numerous, and the samples suitable for optimizing the test tasks of the target field need to be searched from the original sample set of the source field through migration learning.
Still another is that the number of samples in the original sample set of the target area is relatively large, but there are some sample data that adversely affect the performance of the test task of the target area. For example, assuming that the original sample set of the target area is clothing information of different women in the region B, if the original sample set of the target area includes clothing information of women in other regions than the region B, a classifier capable of identifying whether the women in the region B are fashionable may not be better obtained based on the original sample set of the target area.
For the above two cases, after determining the destination domain to which the sample needs to belong, the sample may be directly classified into an intermediate sample set in the destination domain, or some migration conditions may be set in a targeted manner.
For example, in the first case, that is, in the case where the number of samples in the original sample set in the target area is small, it may be set that in the migration learning process, only the samples in the original sample set in the source area are classified into the intermediate sample set in the target area, and the samples in the original sample set in the target area are not classified into the intermediate sample set in the source area.
Specifically, in the above embodiment, after determining the destination area to which the sample needs to belong, it may also be determined whether the sample is a sample in the second original sample set of the target area.
If the sample does not belong to the second original sample set of the target domain, i.e. the sample belongs to the first original sample set of the source domain, the sample can be directly classified into an intermediate sample set of the target domain. That is, the sample belongs to the first original sample set of the source domain, and whether the destination domain is the source domain or the target domain, the sample can be directly classified into an intermediate sample set of the destination domain.
If the sample belongs to the second original sample set of the target domain, the sample may also be classified into an intermediate sample set of the target domain if the target domain is the target domain. The sample originally belongs to the second original sample set of the target field, but the target field is the source field, and the sample originally belongs to the second original sample set of the target field at this time, which indicates that the sample is a sample suitable for the target field, and in this case, the sample may be classified into an intermediate sample set of the target field, or may not be processed.
Similarly to the first case, if the number of samples in the original sample set of the target area is rich, but there is some sample data that adversely affects the performance of the test task of the target area, it may be set to migrate only the samples of the target area to the source area, and not the samples of the source area to the target area.
In particular, if the sample is a sample in the second original sample set of the target domain, the sample may be classified directly into an intermediate sample set of the target domain without concern for whether the target domain is the source domain or the target domain.
If the sample is a sample in the first original sample set of the source domain, whether the destination domain is the source domain or the target domain needs to be considered, and if the destination domain is the source domain, the sample can be actually classified into an intermediate sample set of the source domain; if the destination domain is the target domain, no operation may be performed, or the sample may be classified into an intermediate sample set of the source domain.
In order to facilitate understanding of the solution of the present application, the solution of the present application is described below by taking sample migration learning based on classification tasks as an example. For ease of illustration, the classifier in the classification task is exemplified by two classifiers. As shown in fig. 3, which is a schematic flow chart of another embodiment of a sample transfer learning method of the present application, the method of the present embodiment may include:
S301, a first original sample set of a source domain and a second original sample set of a target domain are obtained.
The first original sample set comprises a plurality of samples which belong to the source field and are marked with actual classification results.
The second original sample set comprises samples belonging to the target field and marked with actual classification results.
S302, training to obtain a first classifier of the source field based on the first original sample set.
S303, training to obtain a second classifier of the target field based on the second original sample set.
S304, setting the intermediate state sample set of the source field and the intermediate state sample set of the target field as empty sets, setting the circulation control variable as zero, and executing the migration operation steps from S305 to S311.
S305, for each sample in the first original sample set and the second original sample, determining a first classification result of the first classifier on the sample and a second classification result of the second classifier on the sample, and executing the following step S306.
S306, combining the actual classification result corresponding to the sample, the first prediction result and the second prediction result, and determining the first probability that the sample belongs to the source field and the second probability that the sample belongs to the target field.
This step S306 may be seen in the embodiment of fig. 2 in two ways, regarding the determination of the first probability and the second probability in the case of classification tasks.
S307, dividing the set value range into a first value range and a second value range based on the first probability and the second probability.
The first numerical range and the second numerical range are not overlapped and are not omitted, wherein the proportion of data belonging to the first numerical range in the numerical range is set to be a first probability, and the proportion of data belonging to the second numerical range is set to be a second probability.
For example, in the embodiment of the present application, the first probability and the second probability may be normalized probability values, and thus, the sum of the first probability and the second probability is 1. Accordingly, the set value range may be [0,1].
S308, generating a random number, wherein the random number belongs to the set numerical range.
S309, if the random number belongs to the first numerical range, the sample is classified into an intermediate sample set in the source domain, and step S311 is performed.
S310, if the random number belongs to the second numerical range, classifying the sample into an intermediate state sample set in the target field.
And S311, if the first classifier and the second classifier are determined to be incorrect in the classification result of the sample according to the actual classification result, the first classification result and the second classification result of the sample, adding one to the circulation control variable.
Similar to the previous embodiment, the step S311 may be performed after the step S305 and before the step S312, and the specific sequence is not limited to that shown in fig. 3.
It will be appreciated that the above steps S305 to S311 are required to be performed for each sample in the first and second sets of raw samples, and therefore, it is required to determine for each sample whether the condition of adding one to the loop control variable is satisfied, so that the loop control variable is added one each time the first and second classifiers incorrectly classify one sample.
S312, after all samples in the first original sample set and the second original sample set have performed the migration operations from S305 to S311, detecting whether the circulation control variable is converged, if so, confirming that the migration learning is finished, and determining the intermediate state sample set of the currently obtained target field as the sample set of the target field obtained by the migration learning; if not, step S313 is performed.
S313, training the intermediate state sample set of the source field to obtain a first classifier of the source field, training the second classifier of the target field by using the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to execute the step S305 according to each sample in the first original sample set and the second original sample set and the first classifier and the second classifier obtained by the last training.
Corresponding to the sample transfer learning method, the application also provides a sample transfer learning device. As shown in fig. 4, which is a schematic diagram illustrating a composition structure of an embodiment of a sample transfer learning device in the present application, the device in this embodiment may include:
a sample obtaining unit 401, configured to obtain a first original sample set of a source domain and a second original sample set of a target domain, where the first original sample set and the second original sample set respectively include a plurality of samples labeled with actual task results;
a model obtaining unit 402, configured to obtain a first prediction model of the source domain and a second prediction model of the target domain, where the first prediction model is a prediction model of the source domain obtained by training based on the first original sample set, and the second prediction model is a prediction model of the target domain obtained by training based on the second original sample set;
a migration operation unit 403, configured to determine, for each sample in the first original sample set and the second original sample set, a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample, determine, in combination with an actual task result corresponding to the sample, the first prediction result, and the second prediction result, a destination domain to which the sample is suitable for attribution from the source domain and the destination domain, and classify the sample into an intermediate state sample set of the destination domain, so as to obtain an intermediate state sample set of the source domain and an intermediate state sample set of the destination domain;
A variable adjustment unit 404, configured to add one to a cycle control variable for each of a first original sample set and a second original sample, if it is determined that, according to an actual task result of the sample, the first prediction result, and the second prediction result, the prediction results of the first prediction model and the second prediction model for the sample are incorrect;
and the circulation control unit 405 is configured to, if the circulation control variable does not reach the convergence state, perform training based on the intermediate state sample set of the source domain to obtain a first prediction model of the source domain, perform training using the intermediate state sample set of the target domain to obtain a second prediction model of the target domain, empty samples in the intermediate state sample sets of the source domain and the target domain, and, for each sample in the first original sample set and the second original sample set, perform the operation of the migration operation unit based on the first prediction model and the second prediction model obtained by the last training, until the circulation control variable reaches the convergence state.
In one possible implementation manner, when the migration operation unit executes the actual task result, the first prediction result and the second prediction result corresponding to the combined sample, it determines that the sample is suitable for the destination domain of the attribution from the source domain and the destination domain, specifically:
Combining an actual task result, the first prediction result and the second prediction result which correspond to the sample, and determining a first probability that the sample belongs to a source field and a second probability that the sample belongs to a target field;
and determining the destination domain to which the sample is suitable from the source domain and the destination domain according to the first probability and the second probability.
In an alternative manner, the migration operation unit determines, according to the first probability and the second probability, that the sample is suitable for the destination domain of the attribution from the source domain and the destination domain, specifically:
dividing a set numerical range into a first numerical range and a second numerical range based on the first probability and the second probability, wherein the first numerical range and the second numerical range are not overlapped, and the proportion of data belonging to the first numerical range in the set numerical range is the first probability and the proportion of data belonging to the second numerical range is the second probability;
generating a random number, wherein the random number belongs to the set numerical value range;
if the random number belongs to the first numerical range, confirming that the sample is suitable for belonging to the source field;
And if the random number belongs to the second numerical range, confirming that the sample is suitable for belonging to the target field.
In yet another possible implementation manner, the actual task result corresponding to the sample obtained in the sample obtaining unit is an actual classification result corresponding to the sample;
the first prediction model and the second prediction model obtained by the model obtaining unit and the circulation control unit are both classification models;
the migration operation unit determines a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and specifically comprises:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
if the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is 1 and the second probability that the sample belongs to the target field is 0;
If the first prediction result is determined to be incorrect and the second prediction result is determined to be correct by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source field is determined to be 0, and the second probability that the sample belongs to the target field is determined to be 1.
In yet another possible implementation manner, the first prediction model and the second prediction model obtained by the model obtaining unit and the circulation control unit are both regression models;
the migration operation unit determines a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and specifically comprises:
combining the actual task result corresponding to the sample with the first prediction result to determine a first prediction error of the first prediction model;
combining the actual task result corresponding to the sample with the second prediction result to determine a second prediction error of the second prediction model;
and determining a first probability that the sample belongs to the source field and a second probability that the sample belongs to the target field according to the first prediction error and the second prediction error.
In yet another possible implementation manner, the migration operation unit, when classifying the sample into the intermediate state sample set in the destination domain, specifically includes:
if the sample belongs to a first original sample set of the source field, classifying the sample into an intermediate state sample set of the destination field;
and if the sample belongs to a second original sample set of the target field and the target field is the target field, classifying the sample into an intermediate sample set of the target field.
In yet another possible implementation manner, the migration operation unit, when classifying the sample into the intermediate state sample set in the destination domain, specifically includes:
if the sample belongs to a second original sample set of the target field, classifying the sample into an intermediate sample set of the target field;
if the sample belongs to a first original sample set of the source domain and the destination domain is a source domain, classifying the sample into an intermediate sample set of the source domain.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways without exceeding the spirit and scope of the present application. The present embodiments are merely illustrative examples and should not be considered limiting, as the specific disclosure given should not be limiting for the purposes of this application. For example, the division of the units or sub-units is merely a logic function division, and other division manners, such as a plurality of units or a plurality of sub-units, may be implemented in practice. In addition, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
In addition, the described systems and methods, as well as schematic illustrations of various embodiments, may be combined or integrated with other systems, modules, techniques, or methods without departing from the scope of the application. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The foregoing is merely illustrative of the embodiments of this invention and it will be appreciated by those skilled in the art that variations and modifications may be made without departing from the principles of the invention, and it is intended to cover all modifications and variations as fall within the scope of the invention.

Claims (10)

1. A sample transfer learning method, wherein the method is applied to a computer device or a cloud platform with data processing capability, and the method comprises the following steps:
obtaining a first original sample set of a source field and a second original sample set of a target field, wherein the first original sample set and the second original sample set respectively comprise a plurality of samples marked with actual task results;
obtaining a first prediction model of the source field and a second prediction model of the target field, wherein the first prediction model is a prediction model of the source field obtained by training based on the first original sample set, and the second prediction model is a prediction model of the target field obtained by training based on the second original sample set;
performing a migration operation for each sample in the first and second original sample sets: determining a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample, determining a target field to which the sample is suitable for attribution from the source field and the target field by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and classifying the sample into an intermediate state sample set of the target field to obtain an intermediate state sample set of the source field and an intermediate state sample set of the target field;
For each sample in a first original sample set and a second original sample, if the prediction results of the first prediction model and the second prediction model on the samples are incorrect according to the actual task results, the first prediction results and the second prediction results of the samples, adding one to the circulation control variable;
if the circulation control variable does not reach the convergence state, training based on the intermediate state sample set of the source field to obtain a first prediction model of the source field, training a second prediction model of the target field by utilizing the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to execute the migration operation for each sample in the first original sample set and the second original sample set based on the first prediction model and the second prediction model obtained by the last training until the circulation control variable reaches the convergence state, so that the finally migrated sample set of the target field is more beneficial to improving the performance of the target field prediction task and improving the efficiency of migration learning;
wherein the first original sample set of the source field includes apparel information for different women in a first region;
When a first original sample set of the source field is clothing information of different women in a first region, a classifier capable of judging whether the women wear fashionably in the first region can be trained based on the first original sample set; taking a second area as a target field, taking the existing female clothing information in the second area as sample data in a second original sample set in the target field, and finding out sample data suitable for the second area from the original sample set in the first area through the sample migration learning method so as to obtain the sample data of the second area; and training a classifier for judging whether the women wear fashionably in the second area by using the sample data of the second area.
2. The method according to claim 1, wherein the determining, by combining the actual task result, the first prediction result, and the second prediction result corresponding to the sample, the destination domain to which the sample is suitable for attribution from the source domain and the destination domain includes:
combining an actual task result, the first prediction result and the second prediction result which correspond to the sample, and determining a first probability that the sample belongs to the source field and a second probability that the sample belongs to the target field;
And determining the destination domain to which the sample is suitable from the source domain and the destination domain according to the first probability and the second probability.
3. The method of claim 2, wherein determining from the source domain and the destination domain that the sample is suitable for attribution based on the first probability and the second probability comprises:
dividing a set numerical range into a first numerical range and a second numerical range based on the first probability and the second probability, wherein the first numerical range and the second numerical range are not overlapped, and the proportion of data belonging to the first numerical range in the set numerical range is the first probability and the proportion of data belonging to the second numerical range is the second probability;
generating a random number, wherein the random number belongs to the set numerical value range;
if the random number belongs to the first numerical range, confirming that the sample is suitable for belonging to the source field;
and if the random number belongs to the second numerical range, confirming that the sample is suitable for belonging to the target field.
4. A method according to claim 2 or 3, wherein the actual task result corresponding to the sample is an actual classification result corresponding to the sample;
The first prediction model and the second prediction model are both classification models;
combining the actual task result, the first prediction result and the second prediction result corresponding to the sample to determine a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain, including:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
if the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is 1 and the second probability that the sample belongs to the target field is 0;
if the first prediction result is determined to be incorrect and the second prediction result is determined to be correct by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source field is determined to be 0, and the second probability that the sample belongs to the target field is determined to be 1.
5. A method according to claim 2 or 3, wherein the first predictive model and the second predictive model are both regression models;
combining the actual task result, the first prediction result and the second prediction result corresponding to the sample to determine a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain, including:
combining the actual task result corresponding to the sample with the first prediction result to determine a first prediction error of the first prediction model;
combining the actual task result corresponding to the sample with the second prediction result to determine a second prediction error of the second prediction model;
and determining a first probability that the sample belongs to the source field and a second probability that the sample belongs to the target field according to the first prediction error and the second prediction error.
6. The method of claim 1, wherein classifying the samples into an intermediate set of samples for the field of interest comprises:
if the sample belongs to a first original sample set of the source field, classifying the sample into an intermediate state sample set of the destination field;
And if the sample belongs to a second original sample set of the target field and the target field is the target field, classifying the sample into an intermediate sample set of the target field.
7. The method of claim 1, wherein classifying the samples into an intermediate set of samples for the field of interest comprises:
if the sample belongs to a second original sample set of the target field, classifying the sample into an intermediate state sample set of the target field;
if the sample belongs to a first original sample set of the source domain and the destination domain is a source domain, classifying the sample into an intermediate sample set of the source domain.
8. A sample transfer learning apparatus for use with a computer device or cloud platform having data processing capabilities, the apparatus comprising:
the sample obtaining unit is used for obtaining a first original sample set of the source field and a second original sample set of the target field, wherein the first original sample set and the second original sample set respectively comprise a plurality of samples marked with actual task results;
the model obtaining unit is used for obtaining a first prediction model of the source field and a second prediction model of the target field, wherein the first prediction model is a prediction model of the source field obtained by training based on the first original sample set, and the second prediction model is a prediction model of the target field obtained by training based on the second original sample set;
The migration operation unit is used for determining a first prediction result of the first prediction model on the sample and a second prediction result of the second prediction model on the sample aiming at each sample in a first original sample set and a second original sample set, determining a target field to which the sample is suitable for attribution from the source field and the target field by combining an actual task result corresponding to the sample, the first prediction result and the second prediction result, classifying the sample into an intermediate sample set of the target field, and obtaining an intermediate sample set of the source field and an intermediate sample set of the target field;
the variable adjustment unit is used for adding one to the circulation control variable for each sample in the first original sample set and the second original sample if the prediction results of the first prediction model and the second prediction model on the samples are determined to be incorrect according to the actual task results, the first prediction results and the second prediction results of the samples;
the circulation control unit is used for training the intermediate state sample set of the source field to obtain a first prediction model of the source field, training the second prediction model of the target field by utilizing the intermediate state sample set of the target field, emptying samples in the intermediate state sample sets of the source field and the target field, and returning to execute the operation of the migration operation unit according to each sample in the first original sample set and the second original sample set based on the first prediction model and the second prediction model obtained by the last training until the circulation control variable reaches the convergence state, so that the finally migrated sample set of the target field is more beneficial to improving the performance of the target field prediction task and improving the efficiency of migration learning;
Wherein the first original sample set of the source field includes apparel information for different women in a first region;
when a first original sample set of the source field is clothing information of different women in a first region, a classifier capable of judging whether the women wear fashionably in the first region can be trained based on the first original sample set; taking a second area as a target field, taking the existing female clothing information in the second area as sample data in a second original sample set in the target field, and finding out sample data suitable for the second area from the original sample set in the first area through the sample migration learning method so as to obtain the sample data of the second area; and training a classifier for judging whether the women wear fashionably in the second area by using the sample data of the second area.
9. The apparatus according to claim 8, wherein the migration operation unit, when executing the actual task result, the first prediction result, and the second prediction result corresponding to the combined sample, determines, from the source domain and the target domain, that the sample is suitable for the destination domain to which the sample belongs, specifically:
Combining an actual task result, the first prediction result and the second prediction result which correspond to the sample, and determining a first probability that the sample belongs to the source field and a second probability that the sample belongs to the target field;
and determining the destination domain to which the sample is suitable from the source domain and the destination domain according to the first probability and the second probability.
10. The apparatus according to claim 9, wherein the actual task result corresponding to the sample obtained in the sample obtaining unit is an actual classification result corresponding to the sample;
the first prediction model and the second prediction model obtained by the model obtaining unit and the circulation control unit are both classification models;
the migration operation unit determines a first probability that the sample belongs to a source domain and a second probability that the sample belongs to a target domain by combining an actual task result, the first prediction result and the second prediction result corresponding to the sample, and specifically comprises:
if the first prediction result and the second prediction result are both correct or both incorrect according to the actual classification result corresponding to the sample, determining that the first probability that the sample belongs to the source field is fifty percent and the second probability that the sample belongs to the target field is fifty percent;
If the first prediction result is determined to be correct and the second prediction result is determined to be incorrect by combining the actual classification result corresponding to the sample, the first probability that the sample belongs to the source field is determined to be 1, and the second probability that the sample belongs to the target field is determined to be 0.
CN202010397008.1A 2020-05-12 2020-05-12 Sample migration learning method and device Active CN111582502B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010397008.1A CN111582502B (en) 2020-05-12 2020-05-12 Sample migration learning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010397008.1A CN111582502B (en) 2020-05-12 2020-05-12 Sample migration learning method and device

Publications (2)

Publication Number Publication Date
CN111582502A CN111582502A (en) 2020-08-25
CN111582502B true CN111582502B (en) 2023-07-25

Family

ID=72113483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010397008.1A Active CN111582502B (en) 2020-05-12 2020-05-12 Sample migration learning method and device

Country Status (1)

Country Link
CN (1) CN111582502B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112330488B (en) * 2020-11-05 2022-07-05 贵州电网有限责任公司 Power grid frequency situation prediction method based on transfer learning

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107679859A (en) * 2017-07-18 2018-02-09 中国银联股份有限公司 A kind of Risk Identification Method and system based on Transfer Depth study
US10540573B1 (en) * 2018-12-06 2020-01-21 Fmr Llc Story cycle time anomaly prediction and root cause identification in an agile development environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107679859A (en) * 2017-07-18 2018-02-09 中国银联股份有限公司 A kind of Risk Identification Method and system based on Transfer Depth study
US10540573B1 (en) * 2018-12-06 2020-01-21 Fmr Llc Story cycle time anomaly prediction and root cause identification in an agile development environment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Energy Predictive Models with Limited Data using Transfer Learning;Ali Hooshmand;《arXiv》;1-5 *
基于深度卷积神经网络与迁移学习的鱼类分类识别;陈文辉;《福建师大福清分校学报》;30-39 *

Also Published As

Publication number Publication date
CN111582502A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
US10671933B2 (en) Method and apparatus for evaluating predictive model
WO2020253466A1 (en) Method and device for generating test case of user interface
Vignotto et al. Extreme value theory for anomaly detection–the GPD classifier
CN110909224B (en) Sensitive data automatic classification and identification method and system based on artificial intelligence
US20190286937A1 (en) Computer-readable recording medium, method for learning, and learning device
US20200042883A1 (en) Dictionary learning device, dictionary learning method, data recognition method, and program storage medium
CN112927061A (en) User operation detection method and program product
Vignotto et al. Extreme Value Theory for Open Set Classification--GPD and GEV Classifiers
CN113449011A (en) Big data prediction-based information push updating method and big data prediction system
CN111126347A (en) Human eye state recognition method and device, terminal and readable storage medium
EP3745317A1 (en) Apparatus and method for analyzing time series data based on machine learning
CN114492601A (en) Resource classification model training method and device, electronic equipment and storage medium
CN111582502B (en) Sample migration learning method and device
CN114221991B (en) Session recommendation feedback processing method based on big data and deep learning service system
CN111444930B (en) Method and device for determining prediction effect of two-classification model
CN113543117A (en) Prediction method and device for number portability user and computing equipment
CN114758199A (en) Training method, device, equipment and storage medium for detection model
JP2021033544A (en) Learning data refining method and computer system
CN113299380A (en) Information prompting method based on intelligent medical big data and intelligent medical service system
KR102152081B1 (en) Valuation method based on deep-learning and apparatus thereof
CN113468017A (en) Online service state detection method applied to block chain and service server
Zhang et al. Lancet: labeling complex data at scale
CN110880117A (en) False service identification method, device, equipment and storage medium
CN114003648B (en) Identification method and device for risk transaction group partner, electronic equipment and storage medium
CN113032547B (en) Big data processing method and system based on artificial intelligence and cloud platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant after: Chongqing duxiaoman Youyang Technology Co.,Ltd.

Address before: 201800 room j1328, 3 / F, building 8, 55 Huiyuan Road, Jiading District, Shanghai

Applicant before: SHANGHAI YOUYANG NEW MEDIA INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
TA01 Transfer of patent application right

Effective date of registration: 20211222

Address after: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Applicant after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant before: Chongqing duxiaoman Youyang Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant